# */
#
-# $Id: Makefile,v 1.13 2000/07/16 13:18:12 root Exp root $
+# $Id: Makefile,v 1.16 1999/09/26 10:46:57 root Exp root $
#
# $Log: Makefile,v $
-# Revision 1.13 2000/07/16 13:18:12 root
+# Revision 1.16 1999/09/26 10:46:57 root
# #
#
-# Revision 1.1 2000/07/16 13:16:42 root
+# Revision 1.15 1999/09/21 11:39:32 root
# #
#
# Revision 1.14 1999/09/15 13:46:58 root
################# NO USER SERVICABLE PARTS BELOW HERE
-VERSION=1.2
+VERSION=1.3
COFLAGS = -l
endif
BINDIR= ${DESTDIR}/sbin
-NROFF= groff -Tascii -a
+NROFF= groff -Tascii
+NRCLN = sed 's/.\b//g'
MANDOC= -mandoc
INSTALL=install
BINOWN= root
BINGRP= kmem
-BINMODE=4555
+BINMODE=555
MANOWN= bin
MANGRP= bin
doc:${MEN}
doc/rpld.8:rpld.man
- ${NROFF} ${MANDOC} $< > $@
+ ${NROFF} ${MANDOC} $< | ${NRCLN} > $@
doc/rpld.conf.5:rpld.conf.man
- ${NROFF} ${MANDOC} $< > $@
+ ${NROFF} ${MANDOC} $< | ${NRCLN} > $@
%.${MAN8EXT}:%.${MAN8SRC}
cp $< $@
${MAKE} clean
${MAKE} yguff
${MAKE} ${TXTMEN}
- ${MAKE} -C nics
cd ..; tar cvfzX ${MYDIR}/DISTRIB/${MYDIR}.tar.gz ${MYDIR}/.xclude ${MYDIR}
yguff:${YGUFF}
#include <stdio.h>
#include <strings.h>
-static char *rcsid = "$Id: ana.c,v 1.3 2000/07/16 13:18:10 root Exp $";
+static char *rcsid = "$Id: ana.c,v 1.2 1999/09/13 12:37:06 root Exp $";
/*
* $Log: ana.c,v $
- * Revision 1.3 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
- * #
- *
* Revision 1.2 1999/09/13 12:37:06 root
* #
*
*/
-static char rcsid[] = "$Id: client.c,v 1.11 2000/07/16 13:18:10 root Exp root $";
+static char rcsid[] = "$Id: client.c,v 1.11 1999/09/26 10:46:56 root Exp root $";
/*
* $Log: client.c,v $
- * Revision 1.11 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
+ * Revision 1.11 1999/09/26 10:46:56 root
* #
*
* Revision 1.10 1999/09/14 17:12:38 root
{
struct client *pc = NULL, *c = clients;
+/* We need to match clients by a (possibly partial) MAC address; however
+ * this struct client is also used to transmit to them, so we need to return
+ * a struct client containing a _real_ MAC address; this is a first and
+ * pretty ugly implementation of this idea.
+ */
while (c)
{
-
- if (memcmp (mac, c->mac, ETH_ALEN) == 0)
+ if (memcmp (mac, c->mac, c->partial_mac_len) == 0)
{
+ /* if partial match, create new struct client */
+ if (c->partial_mac_len != ETH_ALEN)
+ {
+ pc = (struct client *) malloc (sizeof (struct client));
+ memcpy (pc, c, sizeof (struct client));
+
+ pc->next = c->next;
+ c->next = clients;
+ clients = c;
+
+ return pc;
+ }
+
+ /* else reorder the tree for speed, and return the found client */
if (pc)
{ /*Short circuit for next time */
pc->next = c->next;
/*
- * $Id: client.h,v 1.6 2000/07/16 13:18:10 root Exp root $
+ * $Id: client.h,v 1.6 1999/09/22 13:17:49 root Exp $
*
* $Log: client.h,v $
- * Revision 1.6 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
- * #
+ * Revision 1.6 1999/09/22 13:17:49 root
+ * Added partial_mac_len field for wildcarded mac addresses in
+ * struct client.
*
* Revision 1.5 1999/09/13 11:17:35 root
* \#
int state;
u8 mac[ETH_ALEN];
+ int partial_mac_len;
int framelen;
int blocknum;
int blocklen;
*/
-static char rcsid[] = "$Id: config.c,v 1.5 2000/07/16 13:18:10 root Exp root $";
+static char rcsid[] = "$Id: config.c,v 1.4 1999/09/13 11:17:35 root Exp $";
/*
* $Log: config.c,v $
- * Revision 1.5 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
- * #
- *
* Revision 1.4 1999/09/13 11:17:35 root
* \#
*
-<beginning of page>
-RPLD ( 8 ) UNIX System Manager's Manual RPLD ( 8 )
-NAME
- rpld <-> an RPL/RIPL remote boot server
-SYNOPSIS
- rpld
-WARRANTY
- rpld DOES NOT come with ANY WARRANTY, NOT even an IMPLIED WARRANTY.
-DESCRIPTION
- rpld will net-boot IBM style RPL boot ROMs. Communication between the
- client and the server is done in LLC-1 ui/C frames with the source and
- destination SAP both being 0xfc. On booting the client transmits a FIND
- frame containing the client's MAC address, adapter type and frame length.
- The server replies with a FOUND frame containing the server's MAC address
- and a possibly smaller frame length. The client issues a SEND.FILE.RE<hy>
- QUEST frame requesting the first block of the boot file. The server then
- issues a sequence of FILE.DATA.RESPONSE frames with increasing block num<hy>
- bers. The FILE.DATA.RESPONSE frames contain a load address and an execute
- address and a flag. If the client fails to receive a FILE.DATA.RESPONSE
- frame within a certain period it sends another SEND.FILE.REQUEST frame
- requesting the block which follows the last block that was successfully
- received. On the last FILE.DATA.RESPONSE frame the server sets a special
- value of the flags which cause the client to transfer execution to the
- execute address specified in the frame.
- The server starts by reading the configuration file in /etc/rpld.conf,
- see rpld.conf(5), After the configuration file has been read, it opens
- the system's default network interface and listens for RPL frames. The
- server recalculates the length of all the files to be downloaded every
- time it receives a SEND.FILE.REQUEST frame.
-BUGS
- Solenopsis invicta Buren
- rpld (probably) doesn't support the new bzImage format correctly.
- rpld doesn't reload the first 512 octets of Linux kernels automatical<hy>
- ly.
- There is no way to make rpld re-read its configuration file.
- rpld needs to meet more network adapters.
-NOTES
- IBM is a trademark of IBM Corp.
-FILES
- /usr/sbin/rpld
- /etc/rpld.conf
- /rplboot
-SEE ALSO
- rpld.conf(5),
- bootpd(1),
- dhcpd(1),
- http://bullard.esc.cam.ac.uk/~james/rpld;
-AUTHORS AND COPYRIGHT
- (c) 1999 James McKenzie, and Christopher Lightfoot. All rights reserved.
- Linux Sep 14, 1999 1
+
+RPLD(8) UNIX System Manager's Manual RPLD(8)
+
+NAME
+ rpld - an RPL/RIPL remote boot server
+
+SYNOPSIS
+ rpld
+
+WARRANTY
+ rpld DOES NOT come with ANY WARRANTY, NOT even an IMPLIED WARRANTY.
+
+DESCRIPTION
+ rpld will net-boot IBM style RPL boot ROMs. Communication between the
+ client and the server is done in LLC-1 ui/C frames with the source and
+ destination SAP both being 0xfc. On booting the client transmits a FIND
+ frame containing the client's MAC address, adapter type and frame length.
+ The server replies with a FOUND frame containing the server's MAC address
+ and a possibly smaller frame length. The client issues a SEND.FILE.RE-
+ QUEST frame requesting the first block of the boot file. The server then
+ issues a sequence of FILE.DATA.RESPONSE frames with increasing block num-
+ bers. The FILE.DATA.RESPONSE frames contain a load address and an execute
+ address and a flag. If the client fails to receive a FILE.DATA.RESPONSE
+ frame within a certain period it sends another SEND.FILE.REQUEST frame
+ requesting the block which follows the last block that was successfully
+ received. On the last FILE.DATA.RESPONSE frame the server sets a special
+ value of the flags which cause the client to transfer execution to the
+ execute address specified in the frame.
+
+ The server starts by reading the configuration file in /etc/rpld.conf,
+ see rpld.conf(5), After the configuration file has been read, it opens
+ the system's default network interface and listens for RPL frames. The
+ server recalculates the length of all the files to be downloaded every
+ time it receives a SEND.FILE.REQUEST frame.
+
+BUGS
+ Solenopsis invicta Buren
+ rpld (probably) doesn't support the new bzImage format correctly.
+ rpld doesn't reload the first 512 octets of Linux kernels automatical-
+ ly.
+ There is no way to make rpld re-read its configuration file.
+ rpld needs to meet more network adapters.
+
+NOTES
+ IBM is a trademark of IBM Corp.
+
+FILES
+ /usr/sbin/rpld
+ /etc/rpld.conf
+ /rplboot
+
+SEE ALSO
+ rpld.conf(5),
+ bootpd(1),
+ dhcpd(1),
+ http://bullard.esc.cam.ac.uk/~james/rpld;
+
+AUTHORS AND COPYRIGHT
+ (c) 1999 James McKenzie, and Christopher Lightfoot. All rights reserved.
+
+ Linux Sep 14, 1999 1
-<beginning of page>
-RPLD.CONF ( 5 ) UNIX Programmer's Manual RPLD.CONF ( 5 )
-NAME
- rpld.conf <-> rpld configuration file
-DESCRIPTION
- The rpld.conf file is the configuration file for the rpld(1) program. It
- consists of a number of HOST blocks of the form:
- HOST {
- ...
- };
- Within the HOST blocks there can be ethernet, execute, framesize and
- blocksize directives and FILE blocks. FILE blocks are of the form:
- FILE {
- ...
- };
- Within FILE blocks there can be path, offset, length, load and linux di<hy>
- rectives. Directives are of the form
- foo = something;
- or
- bar;
- and are detailed below. Comments are allowed in the configuration file
- and can either be in C-form (i.e. starting with /* and ending with */) or
- C++ form (starting with // and ending at the line break).
-DIRECTIVES
- Directives are of the form
- foo = something;
- or
- bar;
- If something is a string it should be entered between quotes. Numbers are
- assumed to be decimal unless preceded by 0x in which case they are inter<hy>
- preted in hexadecimal. MAC addresses should be given as 6 octets in hex<hy>
- adecimal without the leading 0x. The octets should be separated by
- colons.
- number = 131;
- hexnumber = 0x7382;
- macaddr = 08:00:02:43:21:22;
- string = "fish soup";
- blocksize
- This directive sets the maximum size in octets of data that is trans<hy>
- mitted in each FILE.DATA.RESPONSE frame that the server sends. The
- block size should be at least 48 octets smaller than the frame size.
- After the client negotiates a frame size the block size is checked and
- if it is no longer 48 octets smaller than frame size it is adjusted ac<hy>
- cordingly. Some buggy boot ROMs will fail if block size is not a multi<hy>
- ple of four, accordingly you should be aware of the situation that
- could arise if the client was to negotiate the block size down to some<hy>
- thing that wasn't a multiple of four.
- blocksize = 528;
-<beginning of page>
- ethernet
- This directive sets the MAC address of the client referenced in this
- HOST block. It should be formatted as six octets separated by colons.
- e.g..
- ethernet = 00:60:6e:33:4f:2c;
- execute
- This directive sets the execute address that control is transferred to
- when downloading has finished. It should be a number in either decimal
- or hexadecimal.
- execute = 0x92000;
- It is not clear whether or not the client's Ethernet adapter is or
- should be shut down prior to the transfer of control. This may cause
- problems on systems where the Ethernet adapter in the client can do DMA
- directly into host memory. As the adapter may continue writing to the
- buffers that the boot ROM set up, it may be necessary to download a
- small program to reset the Ethernet adapter. See code under the nics/
- directory in the source distribution for examples.
- framesize
- This directive sets the maximum size of the frames that the server uses
- to communicate with the client. The actual frame size used is negotiat<hy>
- ed between the client and the server, the server will force the client
- to use this value if it requests a larger one. The maximum frame size
- that Ethernet can support is 1500, and this is the default value.
- framesize = 576;
- length
- This directive sets the number of octets transmitted to the client for
- this FILE block. If this directive is not specified the server trans<hy>
- mits data until an end of file condition occurs.
- length = 4096;
- would send 4096 octets from the file.
- linux
- This directive takes no argument. It indicates to rpld(1) that the file
- specified in the path directive is a Linux kernel image. rpld(1) then
- analyses the kernel image and generates three FILE blocks corresponding
- to the primary boot loader, secondary boot loader, and data portions of
- the image. It then sets a default execute address which points to the
- secondary boot loader which is loaded at 0x90200. The execute address
- may be over-ridden with an execute directive which appears AFTER the
- FILE block.
- linux;
- rpld(1) may have problems with bzImage kernels.
- load
- This directive sets the load address for this FILE block. Data is read
- from offset octets into the file at copied to the client starting at
- the address specified by the load directive. The FILE block
- FILE {
- path = "/rplboot/fish";
- offset = 512;
- length = 4096;
- load = 0x90200;
- };
- would load 4096 octets from the file /rplboot/fish starting 512 octets
- into the file into the client's memory starting at address 0x90200. (so
-<beginning of page>
- the 513th byte of the file will load to address 0x90200)
- offset
- This directive sets the offset for this FILE block. Data is read from
- offset octets into the file at copied to the client starting at the ad<hy>
- dress specified by the load directive.
- offset = 512;
- path
- This directive sets the path to the file that is to be downloaded. The
- file must exist, and is examined at startup and on reception of
- SEND.FILE.REQUEST frames.
- path = "/rplboot/fish";
-NOTES
- The server downloads the FILE blocks in the inverse order to that in
- which they were specified. Boot ROMs typically prefer the blocks to ar<hy>
- rive in decreasing load address, so you should specify them in increasing
- load address. The server recalculates the length of all the files speci<hy>
- fied on reception of a SEND.FILE.REQUEST frame. If the file changes size
- during downloading the server will attempt to read to the original length
- of the file. If it encounters an end of file condition empty FILE DATA
- FRAMES will be sent. For Linux kernel images the first sector of the ker<hy>
- nel image will only be read from disk when rpld is started. The first
- sector contains information such as the default root device and the
- length of secondary boot loader. You should therefore restart rpld if
- you change the version of the kernel you are downloading. The order of
- directives is important: the execute directive, if present, should always
- come after the linux directive.
-Example
- A complete example file using every directive:
- // Sample rpld.conf file
- /* (c) 1999 James McKenzie and
- * Christopher Lightfoot
- * All rights reserved.
- */
- HOST {
- ethernet=08:00:02:32:1e:fc;
- FILE {
- path="/rplboot/vmlinuz";
- linux;
- };
- FILE {
- path="/rplboot/vesarom.img";
- offset=0x200;
- length=0x400;
- load=0x92000;
- };
- execute=0x92000;
- };
-FILES
- /etc/rpld.conf The rpld(1) configuration file.
-SEE ALSO
- rpld(1), bootpd(1), dhcpd(1),
- http://bullard.esc.cam.ac.uk/~james/rpld;
-AUTHORS AND COPYRIGHT
-<beginning of page>
- (c) 1999 James McKenzie, and Christopher Lightfoot. All rights reserved.
- Linux Sep 14, 1999 4
+
+RPLD.CONF(5) UNIX Programmer's Manual RPLD.CONF(5)
+
+NAME
+ rpld.conf - rpld configuration file
+
+DESCRIPTION
+ The rpld.conf file is the configuration file for the rpld(1) program. It
+ consists of a number of HOST blocks of the form:
+
+ HOST {
+ ...
+ };
+
+ Within the HOST blocks there can be ethernet, execute, framesize and
+ blocksize directives and FILE blocks. FILE blocks are of the form:
+
+ FILE {
+ ...
+ };
+
+ Within FILE blocks there can be path, offset, length, load and linux di-
+ rectives. Directives are of the form
+
+ foo = something;
+ or
+
+ bar;
+
+ and are detailed below. Comments are allowed in the configuration file
+ and can either be in C-form (i.e. starting with /* and ending with */) or
+ C++ form (starting with // and ending at the line break).
+
+DIRECTIVES
+ Directives are of the form
+
+ foo = something;
+ or
+
+ bar;
+
+ If something is a string it should be entered between quotes. Numbers are
+ assumed to be decimal unless preceded by 0x in which case they are inter-
+ preted in hexadecimal. MAC addresses should be given as 6 octets in hex-
+ adecimal without the leading 0x. The octets should be separated by
+ colons.
+
+ number = 131;
+ hexnumber = 0x7382;
+ macaddr = 08:00:02:43:21:22;
+ string = "fish soup";
+
+ blocksize
+ This directive sets the maximum size in octets of data that is trans-
+ mitted in each FILE.DATA.RESPONSE frame that the server sends. The
+ block size should be at least 48 octets smaller than the frame size.
+ After the client negotiates a frame size the block size is checked and
+ if it is no longer 48 octets smaller than frame size it is adjusted ac-
+ cordingly. Some buggy boot ROMs will fail if block size is not a multi-
+ ple of four, accordingly you should be aware of the situation that
+ could arise if the client was to negotiate the block size down to some-
+ thing that wasn't a multiple of four.
+
+ blocksize = 528;
+
+
+ ethernet
+ This directive sets the MAC address of the client referenced in this
+ HOST block. It should be formatted as six octets separated by colons.
+ e.g..
+
+ ethernet = 00:60:6e:33:4f:2c;
+
+ execute
+ This directive sets the execute address that control is transferred to
+ when downloading has finished. It should be a number in either decimal
+ or hexadecimal.
+
+ execute = 0x92000;
+
+ It is not clear whether or not the client's Ethernet adapter is or
+ should be shut down prior to the transfer of control. This may cause
+ problems on systems where the Ethernet adapter in the client can do DMA
+ directly into host memory. As the adapter may continue writing to the
+ buffers that the boot ROM set up, it may be necessary to download a
+ small program to reset the Ethernet adapter. See code under the nics/
+ directory in the source distribution for examples.
+ framesize
+ This directive sets the maximum size of the frames that the server uses
+ to communicate with the client. The actual frame size used is negotiat-
+ ed between the client and the server, the server will force the client
+ to use this value if it requests a larger one. The maximum frame size
+ that Ethernet can support is 1500, and this is the default value.
+
+ framesize = 576;
+
+ length
+ This directive sets the number of octets transmitted to the client for
+ this FILE block. If this directive is not specified the server trans-
+ mits data until an end of file condition occurs.
+
+ length = 4096;
+
+ would send 4096 octets from the file.
+ linux
+ This directive takes no argument. It indicates to rpld(1) that the file
+ specified in the path directive is a Linux kernel image. rpld(1) then
+ analyses the kernel image and generates three FILE blocks corresponding
+ to the primary boot loader, secondary boot loader, and data portions of
+ the image. It then sets a default execute address which points to the
+ secondary boot loader which is loaded at 0x90200. The execute address
+ may be over-ridden with an execute directive which appears AFTER the
+ FILE block.
+
+ linux;
+
+ rpld(1) may have problems with bzImage kernels.
+ load
+ This directive sets the load address for this FILE block. Data is read
+ from offset octets into the file at copied to the client starting at
+ the address specified by the load directive. The FILE block
+
+ FILE {
+ path = "/rplboot/fish";
+ offset = 512;
+ length = 4096;
+ load = 0x90200;
+ };
+
+ would load 4096 octets from the file /rplboot/fish starting 512 octets
+ into the file into the client's memory starting at address 0x90200. (so
+
+ the 513th byte of the file will load to address 0x90200)
+ offset
+ This directive sets the offset for this FILE block. Data is read from
+ offset octets into the file at copied to the client starting at the ad-
+ dress specified by the load directive.
+
+ offset = 512;
+
+ path
+ This directive sets the path to the file that is to be downloaded. The
+ file must exist, and is examined at startup and on reception of
+ SEND.FILE.REQUEST frames.
+
+ path = "/rplboot/fish";
+
+
+NOTES
+ The server downloads the FILE blocks in the inverse order to that in
+ which they were specified. Boot ROMs typically prefer the blocks to ar-
+ rive in decreasing load address, so you should specify them in increasing
+ load address. The server recalculates the length of all the files speci-
+ fied on reception of a SEND.FILE.REQUEST frame. If the file changes size
+ during downloading the server will attempt to read to the original length
+ of the file. If it encounters an end of file condition empty FILE DATA
+ FRAMES will be sent. For Linux kernel images the first sector of the ker-
+ nel image will only be read from disk when rpld is started. The first
+ sector contains information such as the default root device and the
+ length of secondary boot loader. You should therefore restart rpld if
+ you change the version of the kernel you are downloading. The order of
+ directives is important: the execute directive, if present, should always
+ come after the linux directive.
+
+
+Example
+ A complete example file using every directive:
+
+ // Sample rpld.conf file
+ /* (c) 1999 James McKenzie and
+ * Christopher Lightfoot
+ * All rights reserved.
+ */
+
+ HOST {
+ ethernet=08:00:02:32:1e:fc;
+ FILE {
+ path="/rplboot/vmlinuz";
+ linux;
+ };
+ FILE {
+ path="/rplboot/vesarom.img";
+ offset=0x200;
+ length=0x400;
+ load=0x92000;
+ };
+ execute=0x92000;
+ };
+
+
+FILES
+ /etc/rpld.conf The rpld(1) configuration file.
+
+SEE ALSO
+ rpld(1), bootpd(1), dhcpd(1),
+ http://bullard.esc.cam.ac.uk/~james/rpld;
+
+AUTHORS AND COPYRIGHT
+ (c) 1999 James McKenzie, and Christopher Lightfoot. All rights reserved.
+
+ Linux Sep 14, 1999 4
*/
-static char rcsid[] = "$Id: linux-ps.c,v 1.6 2000/07/16 13:18:10 root Exp root $";
+static char rcsid[] = "$Id: linux-ps.c,v 1.6 1999/09/21 11:38:51 root Exp $";
/*
* $Log: linux-ps.c,v $
- * Revision 1.6 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
+ * Revision 1.6 1999/09/21 11:38:51 root
* #
*
* Revision 1.5 1999/09/13 11:17:35 root
if (!name)
name = "eth0";
+#ifdef PF_PACKET
fd = socket (PF_PACKET, SOCK_PACKET, htons (ETH_P_ALL));
if (fd < 0)
+#endif
fd = socket (AF_INET, SOCK_PACKET, htons (ETH_P_ALL));
if (fd < 0)
/*
- * $Id: linux-ps.h,v 1.3 2000/07/16 13:18:10 root Exp root $
+ * $Id: linux-ps.h,v 1.2 1999/09/13 12:36:18 root Exp $
*
* $Log: linux-ps.h,v $
- * Revision 1.3 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
- * #
- *
* Revision 1.2 1999/09/13 12:36:18 root
* #
*
*/
-static char rcsid[] = "$Id: llc.c,v 1.7 2000/07/16 13:18:10 root Exp root $";
+static char rcsid[] = "$Id: llc.c,v 1.6 1999/09/13 11:17:35 root Exp $";
/*
* $Log: llc.c,v $
- * Revision 1.7 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
- * #
- *
* Revision 1.6 1999/09/13 11:17:35 root
* \#
*
/*
- * $Id: llc.h,v 1.6 2000/07/16 13:18:10 root Exp root $
+ * $Id: llc.h,v 1.5 1999/09/13 11:17:35 root Exp $
*
* $Log: llc.h,v $
- * Revision 1.6 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
- * #
- *
* Revision 1.5 1999/09/13 11:17:35 root
* \#
*
+++ /dev/null
-head 1.1;
-access;
-symbols;
-locks
- root:1.1; strict;
-comment @# @;
-
-
-1.1
-date 2000.07.16.13.16.42; author root; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.1
-log
-@#
-@
-text
-@#
-# /*************************************************
-# * rpld - an IBM style RIPL server *
-# *************************************************/
-#
-# /* Copyright (c) 1999, James McKenzie.
-# * All rights reserved
-# * Copyright (c) 1999, Christopher Lightfoot.
-# * All rights reserved
-# *
-# * By using this file, you agree to the terms and conditions set
-# * forth in the LICENCE file which can be found at the top level of
-# * the rpld distribution.
-# *
-# * IBM is a trademark of IBM corp.
-# *
-# */
-
-SUBDIRS=dm9102
-
-default:
- for i in $(SUBDIRS); do ${MAKE} -C $$i ; done
-clean:
- for i in $(SUBDIRS); do ${MAKE} -C $$i clean ; done
-tidy:
- for i in $(SUBDIRS); do ${MAKE} -C $$i tidy ; done
- ci -l -m\# Makefile
-
-@
# */
#
-# $Id: Makefile,v 1.1 2000/07/16 13:16:41 root Exp $
+# $Id: Makefile,v 1.3 1999/09/14 17:18:27 root Exp $
#
# $Log: Makefile,v $
-# Revision 1.1 2000/07/16 13:16:41 root
-# #
-#
# Revision 1.3 1999/09/14 17:18:27 root
# #
#
+++ /dev/null
-head 1.1;
-access;
-symbols;
-locks
- root:1.1; strict;
-comment @# @;
-
-
-1.1
-date 2000.07.16.13.16.41; author root; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.1
-log
-@#
-@
-text
-@#
-# /*************************************************
-# * rpld - an IBM style RIPL server *
-# *************************************************/
-#
-# /* Copyright (c) 1999, James McKenzie.
-# * All rights reserved
-# * Copyright (c) 1999, Christopher Lightfoot.
-# * All rights reserved
-# *
-# * By using this file, you agree to the terms and conditions set
-# * forth in the LICENCE file which can be found at the top level of
-# * the rpld distribution.
-# *
-# * IBM is a trademark of IBM corp.
-# *
-# */
-
-#
-# $Id: Makefile,v 1.3 1999/09/14 17:18:27 root Exp $
-#
-# $Log: Makefile,v $
-# Revision 1.3 1999/09/14 17:18:27 root
-# #
-#
-# Revision 1.2 1999/09/14 17:12:38 root
-# #
-#
-# Revision 1.1 1999/09/14 16:17:15 root
-# #
-#
-# Revision 1.1 1999/09/13 12:36:20 root
-# #
-#
-#
-
-AS86=/software/src/bin86/as/as86 -0 -a
-LD86=ld86 -s -d
-
-dmfix:dmfix.o
- $(LD86) -o $@@ $<
-
-dmfix.o: dmfix.s
- $(AS86) -o $@@ $<
-
-dmfix.s: dmfix.S
- $(CPP) -traditional $< -o $@@
-
-clean:
- /bin/rm -rf dmfix dmfix.s dmfix.o
-
-tidy:
- ci -m\# -l dmfix.S
- ci -m\# -l Makefile
-
-install: dmfix
- cp dmfix /rplboot
-@
!
!
!
-! $Id: dmfix.S,v 1.1 2000/07/16 13:16:40 root Exp $ll rights reserved
+! $Id: dmfix.S,v 1.4 1999/09/14 17:18:27 root Exp $ll rights reserved
!
! Copyright (c) 1999, James McKenzie.
! All rights reserved
!
!
! $Log: dmfix.S,v $
-! Revision 1.1 2000/07/16 13:16:40 root
-! #
-!
! Revision 1.4 1999/09/14 17:18:27 root
! #
!
+++ /dev/null
-head 1.1;
-access;
-symbols;
-locks
- root:1.1; strict;
-comment @# @;
-
-
-1.1
-date 2000.07.16.13.16.40; author root; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.1
-log
-@#
-@
-text
-@! Davicom Bootloader fixup, switches off the DAVICOM fast ethernet chip
-! before transfering control to the RPL'd image, so that the chip
-! doesn't scribble all over it while it relocates
-!
-! This image needs 2k of memory, and can be loaded anywhere, after
-! it does its stuff it does jmp 0x9020:0x0
-!
-!
-!
-! $Id: dmfix.S,v 1.4 1999/09/14 17:18:27 root Exp $ll rights reserved
-!
-! Copyright (c) 1999, James McKenzie.
-! All rights reserved
-! Copyright (c) 1999, Christopher Lightfoot.
-! All rights reserved
-!
-! By using this file, you agree to the terms and conditions set
-! forth in the LICENCE file which can be found at the top level of
-! the rpld distribution.
-!
-! DAVICOM is a trademark of DAVICOM semiconductor inc.
-!
-!
-!
-! $Log: dmfix.S,v $
-! Revision 1.4 1999/09/14 17:18:27 root
-! #
-!
-! Revision 1.3 1999/09/13 12:32:26 root
-! #
-!
-! Revision 1.2 1999/09/12 05:07:29 root
-! *** empty log message ***
-!
-!
-
-! Offsets into the PCI config space
-#define PCI_VENDOR_ID 0x00
-#define PCI_DEVICE_ID 0x02
-#define PCI_HEADER_TYPE 0x0e
-#define PCI_BASE_ADDRESS_0 0x10
-
-!PCI constants
-#define PCI_BASE_ADDRESS_IO_MASK 0xfffc
-#define PCI_VENDOR_ID_DAVICOM 0x1282
-#define PCI_DEVICE_ID_DAVICOM_9102 0x9102
-
-
-.globl begtext, begdata, begbss, endtext, enddata, endbss
-.text
-begtext:
-.data
-begdata:
-.bss
-begbss:
-.text
-
-entry start
-start:
- mov ax,cs
- mov es,ax
- mov ds,ax
- mov ss,ax
-
-! Put the stack at us+2k
- mov di,#0x800-12
- mov sp,di
-
-! Say hello
- lea si,hello
- call prtstr
- call print_nl
-
- lea si,top
- call prtstr
- call print_nl
-
-! Scan the pci bus
- mov byte (devfn),#0
-
-dev_loop:
- mov bh, byte (devfn) !Device number
- mov bl,#PCI_VENDOR_ID !Offset into config space
- mov cl, byte (bus) !Bus number
- call pci_read_config_word
-
- cmp ax,#0xffff
- beq dull
- cmp ax,#0x0000
- beq dull
-
- mov (vid),ax
-
- xor dh,dh
- mov dl,byte (bus)
-
- call print_2hex
- call print_sp
-
- mov dl, byte (devfn)
- sar dl,#3
- and dx,#0x1f
-
- call print_2hex
- call print_sp
-
- mov dl, byte (devfn)
- and dl,#7
-
- call print_2hex
- call print_sp
-
- mov dx,(vid)
- call print_hex
- call print_sp
-
- mov bh, byte (devfn) !Device number
- mov bl,#PCI_DEVICE_ID !Offset into config space
- mov cl,byte (bus) !Bus number
- call pci_read_config_word
-
- mov (did),ax
-
- mov dx,ax
- call print_hex
- call print_sp
-
- mov bh, byte (devfn) !Device number
- mov bl,#PCI_BASE_ADDRESS_0 !Offset into config space
- mov cl, byte (bus) !Bus number
- call pci_read_config_word
-
- and ax,#PCI_BASE_ADDRESS_IO_MASK
- mov (dad),ax
-
- mov dx,ax
- call print_hex
- call print_sp
-
-
- cmp (vid),#PCI_VENDOR_ID_DAVICOM
- bne skipfix
- cmp (did),#PCI_DEVICE_ID_DAVICOM_9102
- bne skipfix
-
- mov dx,(dad) !Hit the Reset bit
- in eax,dx
- or eax,#1
- out dx,eax
-
- lea si,fixed
- call prtstr
-
-skipfix:
-
-
- mov bh, byte (devfn) !Device number
- mov bl,#PCI_HEADER_TYPE !Offset into config space
- mov cl,byte (bus) !Bus number
- call pci_read_config_byte
-
- and al,#0x80
- cmp al,#0x80
- beq multi
- inc byte (devfn)
- inc byte (devfn)
- inc byte (devfn)
- inc byte (devfn)
- inc byte (devfn)
- inc byte (devfn)
- inc byte (devfn)
-multi:
-
- call print_nl
-
-dull:
-
-
- inc byte (devfn)
- mov dl, byte (devfn)
- cmp dl,#0
- beq dev_loop_skip
- br dev_loop
-dev_loop_skip:
-
- lea si,done
- call prtstr
- call print_nl
-
-! Hand over control to the linux 2ndary boot loader
- jmp 0x9020:0x0
-
-
-! bh contains device_fn
-! bl conatins offset
-! cl contains the bus number
-
-
-pci_read_config_word:
- push bx
- and bl,#0xfc
- mov ch,#0x80
-
- mov (controldword),bx
- mov (controldword+2),cx
-
- mov eax,(controldword)
- mov dx,#0xcf8
- out dx,eax
-
- pop dx
- and dx,#0x2
- add dx,#0xcfc
-
- in ax,dx
- ret
-
-pci_read_config_byte:
- push bx
- and bl,#0xfc
- mov ch,#0x80
-
- mov (controldword),bx
- mov (controldword+2),cx
-
- mov eax,(controldword)
- mov dx,#0xcf8
- out dx,eax
-
- pop dx
- and dx,#0x3
- add dx,#0xcfc
-
- in al,dx
- ret
-
-
-prtstr:
- lodsb
- and al,al
- jz fin
- call prtchr
- jmp prtstr
-fin: ret
-
-prtchr: push ax
- push cx
- xor bh,bh
- mov cx,#0x01
- mov ah,#0x0e
- int 0x10
- pop cx
- pop ax
- ret
-
-print_hex:
- mov cx, #4 ! 4 hex digits
-print_digit:
- rol dx, #4 ! rotate so that lowest 4 bits are used
- mov ax, #0xe0f ! ah = request, al = mask for nybble
- and al, dl
- add al, #0x90 ! convert al to ascii hex (four instructions)
- daa
- adc al, #0x40
- daa
- int 0x10
- loop print_digit
- ret
-
-print_2hex:
- mov cx, #2 ! 2 hex digits
-print_2digit:
- rol dx, #4 ! rotate so that lowest 4 bits are used
- mov ax, #0xe0f ! ah = request, al = mask for nybble
- and al, dl
- add al, #0x90 ! convert al to ascii hex (four instructions)
- daa
- adc al, #0x40
- daa
- int 0x10
- loop print_2digit
- ret
-
-print_sp:
- mov ax, #0xe20 ! SP
- int 0x10
- ret
-
-print_nl:
- mov ax, #0xe0d ! CR
- int 0x10
- mov al, #0xa ! LF
- int 0x10
- ret
-
-davicom_base:
- .word 0x0
-bus:
- .byte 0x0
-devfn:
- .byte 0x0
-
-controldword:
- .word 0
- .word 0
-vid:
- .word 0
-did:
- .word 0
-dad:
- .word 0
-
-hello: .ascii "DAVICOM killer (c) 1999 James McKenzie <james@@fishsoup.dhs.org>"
- db 0x00
-
-top: .ascii "Bs Sl Fn VID DID Window 0 base"
- db 0x00
-fixed: .ascii "- FIXED"
- db 0x00
-
-done: .ascii "Transfering control to linux secondary boot loader"
- db 0x00
-
-.text
-endtext:
-.data
-enddata:
-.bss
-endbss:
-
-@
+++ /dev/null
-# 1 "dmfix.S"
-! Davicom Bootloader fixup, switches off the DAVICOM fast ethernet chip
-! before transfering control to the RPL'd image, so that the chip
-! doesn't scribble all over it while it relocates
-!
-! This image needs 2k of memory, and can be loaded anywhere, after
-! it does its stuff it does jmp 0x9020:0x0
-!
-!
-!
-! $Id: dmfix.S,v 1.1 2000/07/16 13:16:40 root Exp $ll rights reserved
-!
-! Copyright (c) 1999, James McKenzie.
-! All rights reserved
-! Copyright (c) 1999, Christopher Lightfoot.
-! All rights reserved
-!
-! By using this file, you agree to the terms and conditions set
-! forth in the LICENCE file which can be found at the top level of
-! the rpld distribution.
-!
-! DAVICOM is a trademark of DAVICOM semiconductor inc.
-!
-!
-!
-! $Log: dmfix.S,v $
-! Revision 1.1 2000/07/16 13:16:40 root
-! #
-!
-! Revision 1.4 1999/09/14 17:18:27 root
-! #
-!
-! Revision 1.3 1999/09/13 12:32:26 root
-! #
-!
-! Revision 1.2 1999/09/12 05:07:29 root
-! *** empty log message ***
-!
-!
-
-! Offsets into the PCI config space
-
-
-
-
-
-!PCI constants
-
-
-
-
-
-.globl begtext, begdata, begbss, endtext, enddata, endbss
-.text
-begtext:
-.data
-begdata:
-.bss
-begbss:
-.text
-
-entry start
-start:
- mov ax,cs
- mov es,ax
- mov ds,ax
- mov ss,ax
-
-! Put the stack at us+2k
- mov di,#0x800-12
- mov sp,di
-
-! Say hello
- lea si,hello
- call prtstr
- call print_nl
-
- lea si,top
- call prtstr
- call print_nl
-
-! Scan the pci bus
- mov byte (devfn),#0
-
-dev_loop:
- mov bh, byte (devfn) !Device number
- mov bl,#0x00 !Offset into config space
- mov cl, byte (bus) !Bus number
- call pci_read_config_word
-
- cmp ax,#0xffff
- beq dull
- cmp ax,#0x0000
- beq dull
-
- mov (vid),ax
-
- xor dh,dh
- mov dl,byte (bus)
-
- call print_2hex
- call print_sp
-
- mov dl, byte (devfn)
- sar dl,#3
- and dx,#0x1f
-
- call print_2hex
- call print_sp
-
- mov dl, byte (devfn)
- and dl,#7
-
- call print_2hex
- call print_sp
-
- mov dx,(vid)
- call print_hex
- call print_sp
-
- mov bh, byte (devfn) !Device number
- mov bl,#0x02 !Offset into config space
- mov cl,byte (bus) !Bus number
- call pci_read_config_word
-
- mov (did),ax
-
- mov dx,ax
- call print_hex
- call print_sp
-
- mov bh, byte (devfn) !Device number
- mov bl,#0x10 !Offset into config space
- mov cl, byte (bus) !Bus number
- call pci_read_config_word
-
- and ax,#0xfffc
- mov (dad),ax
-
- mov dx,ax
- call print_hex
- call print_sp
-
-
- cmp (vid),#0x1282
- bne skipfix
- cmp (did),#0x9102
- bne skipfix
-
- mov dx,(dad) !Hit the Reset bit
- in eax,dx
- or eax,#1
- out dx,eax
-
- lea si,fixed
- call prtstr
-
-skipfix:
-
-
- mov bh, byte (devfn) !Device number
- mov bl,#0x0e !Offset into config space
- mov cl,byte (bus) !Bus number
- call pci_read_config_byte
-
- and al,#0x80
- cmp al,#0x80
- beq multi
- inc byte (devfn)
- inc byte (devfn)
- inc byte (devfn)
- inc byte (devfn)
- inc byte (devfn)
- inc byte (devfn)
- inc byte (devfn)
-multi:
-
- call print_nl
-
-dull:
-
-
- inc byte (devfn)
- mov dl, byte (devfn)
- cmp dl,#0
- beq dev_loop_skip
- br dev_loop
-dev_loop_skip:
-
- lea si,done
- call prtstr
- call print_nl
-
-! Hand over control to the 1 2ndary boot loader
- jmp 0x9020:0x0
-
-
-! bh contains device_fn
-! bl conatins offset
-! cl contains the bus number
-
-
-pci_read_config_word:
- push bx
- and bl,#0xfc
- mov ch,#0x80
-
- mov (controldword),bx
- mov (controldword+2),cx
-
- mov eax,(controldword)
- mov dx,#0xcf8
- out dx,eax
-
- pop dx
- and dx,#0x2
- add dx,#0xcfc
-
- in ax,dx
- ret
-
-pci_read_config_byte:
- push bx
- and bl,#0xfc
- mov ch,#0x80
-
- mov (controldword),bx
- mov (controldword+2),cx
-
- mov eax,(controldword)
- mov dx,#0xcf8
- out dx,eax
-
- pop dx
- and dx,#0x3
- add dx,#0xcfc
-
- in al,dx
- ret
-
-
-prtstr:
- lodsb
- and al,al
- jz fin
- call prtchr
- jmp prtstr
-fin: ret
-
-prtchr: push ax
- push cx
- xor bh,bh
- mov cx,#0x01
- mov ah,#0x0e
- int 0x10
- pop cx
- pop ax
- ret
-
-print_hex:
- mov cx, #4 ! 4 hex digits
-print_digit:
- rol dx, #4 ! rotate so that lowest 4 bits are used
- mov ax, #0xe0f ! ah = request, al = mask for nybble
- and al, dl
- add al, #0x90 ! convert al to ascii hex (four instructions)
- daa
- adc al, #0x40
- daa
- int 0x10
- loop print_digit
- ret
-
-print_2hex:
- mov cx, #2 ! 2 hex digits
-print_2digit:
- rol dx, #4 ! rotate so that lowest 4 bits are used
- mov ax, #0xe0f ! ah = request, al = mask for nybble
- and al, dl
- add al, #0x90 ! convert al to ascii hex (four instructions)
- daa
- adc al, #0x40
- daa
- int 0x10
- loop print_2digit
- ret
-
-print_sp:
- mov ax, #0xe20 ! SP
- int 0x10
- ret
-
-print_nl:
- mov ax, #0xe0d ! CR
- int 0x10
- mov al, #0xa ! LF
- int 0x10
- ret
-
-davicom_base:
- .word 0x0
-bus:
- .byte 0x0
-devfn:
- .byte 0x0
-
-controldword:
- .word 0
- .word 0
-vid:
- .word 0
-did:
- .word 0
-dad:
- .word 0
-
-hello: .ascii "DAVICOM killer (c) 1999 James McKenzie <james@fishsoup.dhs.org>"
- db 0x00
-
-top: .ascii "Bs Sl Fn VID DID Window 0 base"
- db 0x00
-fixed: .ascii "- FIXED"
- db 0x00
-
-done: .ascii "Transfering control to linux secondary boot loader"
- db 0x00
-
-.text
-endtext:
-.data
-enddata:
-.bss
-endbss:
-
*/
/*
- * $Id: project.h,v 1.11 2000/07/16 13:18:10 root Exp root $
+ * $Id: project.h,v 1.10 1999/09/14 21:36:02 root Exp $
*
* $Log: project.h,v $
- * Revision 1.11 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
- * #
- *
* Revision 1.10 1999/09/14 21:36:02 root
* #
*
*/
-static char rcsid[] = "$Id: protocol.c,v 1.10 2000/07/16 13:18:10 root Exp root $";
+static char rcsid[] = "$Id: protocol.c,v 1.9 1999/09/13 11:17:35 root Exp $";
/*
* $Log: protocol.c,v $
- * Revision 1.10 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
- * #
- *
* Revision 1.9 1999/09/13 11:17:35 root
* \#
*
-static char rcsid[] = "$Id: rpl.c,v 1.8 2000/07/16 13:18:10 root Exp root $";
+static char rcsid[] = "$Id: rpl.c,v 1.7 1999/09/13 11:17:35 root Exp $";
/*
* $Log: rpl.c,v $
- * Revision 1.8 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
- * #
- *
* Revision 1.7 1999/09/13 11:17:35 root
* \#
*
/*
- * $Id: rpl.h,v 1.9 2000/07/16 13:18:10 root Exp $
+ * $Id: rpl.h,v 1.8 1999/09/13 11:17:35 root Exp $
*
* $Log: rpl.h,v $
- * Revision 1.9 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
- * #
- *
* Revision 1.8 1999/09/13 11:17:35 root
* \#
*
*/
-static char rcsid[] = "$Id: rpld.c,v 1.10 2000/07/16 13:18:10 root Exp root $";
+static char rcsid[] = "$Id: rpld.c,v 1.9 1999/09/13 11:17:35 root Exp $";
/*
* $Log: rpld.c,v $
- * Revision 1.10 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
- * #
- *
* Revision 1.9 1999/09/13 11:17:35 root
* \#
*
.\"
.\"
.\"
-.\" $Id: rpld.conf.man,v 1.3 2000/07/16 13:18:10 root Exp root $;
+.\" $Id: rpld.conf.man,v 1.7 1999/09/15 14:29:10 root Exp $;
.\"
.\" $Log: rpld.conf.man,v $
-.\" Revision 1.3 2000/07/16 13:18:10 root
-.\" #
-.\"
-.\" Revision 1.1 2000/07/16 13:16:33 root
-.\" #
-.\"
.\" Revision 1.7 1999/09/15 14:29:10 root
.\" #
.\"
.\"
.\"
.\"
-.\" $Id: rpld.man,v 1.6 2000/07/16 13:18:10 root Exp root $;
+.\" $Id: rpld.man,v 1.10 1999/09/15 01:22:18 root Exp $;
.\"
.\" $Log: rpld.man,v $
-.\" Revision 1.6 2000/07/16 13:18:10 root
-.\" #
-.\"
-.\" Revision 1.1 2000/07/16 13:16:33 root
-.\" #
-.\"
.\" Revision 1.10 1999/09/15 01:22:18 root
.\" #
.\"
* Lexer for RPLD conf files
*
* $Log: rpld_conf.lex,v $
- * Revision 1.4 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
+ * Revision 1.4 1999/09/26 10:46:56 root
* #
*
* Revision 1.3 1999/09/13 11:17:35 root
* Revision 1.1 1999/09/13 11:04:13 root
* \#
*
- * Revision 1.10 1999/09/12 19:08:24 chris
- * Another attempt at C comments.
- *
- * Revision 1.9 1999/09/12 17:38:45 chris
- * Implemented proper MAC reading.
- *
- * Revision 1.8 1999/09/12 03:27:43 chris
- * Changes to enable error reporting in yacc grammar.
- *
- * Revision 1.7 1999/09/11 19:30:26 chris
- * Fixed hex number support.
- *
- * Revision 1.6 1999/09/11 19:25:06 chris
- * No major changes.
- *
- * Revision 1.5 1999/09/11 19:24:23 chris
- * Removed support for C-style comments, inserted support for C++ ones. Comment support actually works now
- *
- * Revision 1.4 1999/09/11 19:02:25 chris
- * Fixed bug in comment support.
- *
- * Revision 1.3 1999/09/11 19:00:43 chris
- * Added support for comments.
- *
- * Revision 1.2 1999/09/11 18:57:31 chris
- * Initial revision.
- *
*
*/
%x COMMENT
%{
-static char rcsid[]="$Id: rpld_conf.lex,v 1.4 2000/07/16 13:18:10 root Exp root $";
+static char rcsid[]="$Id: rpld_conf.lex,v 1.4 1999/09/26 10:46:56 root Exp root $";
#include <stdio.h>
#include <string.h>
[}] { return BLOCK_END; }
-{hb}:{hb}:{hb}:{hb}:{hb}:{hb} { strtomac(yytext, (yylval.mac_address)); return MACADDR; }
+{hb}:{hb}:{hb}:{hb}:{hb}:{hb} {
+ strtomac(yytext, (yylval.mac_address));
+ return MACADDR;
+ }
+
+{hb}:{hb}:{hb}:{hb}:{hb}:{hb}/[1-6] {
+ strtomac(yytext, (yylval.pm.mac_address));
+ yylval.pm.mac_len = yytext[13] - '0';
+ return MACADDR_PARTIAL;
+ }
0x[0-9A-Fa-f]+ {
yylval.number = strtol(yytext + 2, NULL, 16);
#define yyerrok (yyerrflag=0)
#define YYRECOVERING (yyerrflag!=0)
#define YYPREFIX "yy"
-#line 65 "rpld_conf.y"
+#line 34 "rpld_conf.y"
-static char rcsid[]="$Id: rpld_conf.y,v 1.3 2000/07/16 13:18:10 root Exp root $";
+static char rcsid[]="$Id: rpld_conf.y,v 1.3 1999/09/26 10:46:56 root Exp root $";
#include "project.h"
/*void process_thing(THING thing, char *name, int type, YYSTYPE *pvalue);*/
-#line 81 "rpld_conf.y"
+#line 50 "rpld_conf.y"
typedef union {
long number;
char *name;
char *text;
char mac_address[6];
+ struct partial_mac {
+ char mac_address[6];
+ int mac_len;
+ } pm;
} YYSTYPE;
-#line 32 "rpld_conf.tab.c"
+#line 36 "rpld_conf.tab.c"
#define BLOCK_START 257
#define BLOCK_END 258
#define NAME 259
#define TEXT 260
#define NUMBER 261
#define MACADDR 262
+#define MACADDR_PARTIAL 263
#define YYERRCODE 256
short yylhs[] = { -1,
0, 0, 1, 1, 2, 2, 3, 3, 3, 4,
- 4, 4, 4, 4,
+ 4, 4, 4, 4, 4,
};
short yylen[] = { 2,
2, 3, 3, 2, 2, 1, 1, 2, 3, 1,
- 3, 3, 3, 1,
+ 3, 3, 3, 3, 1,
};
short yydefred[] = { 0,
6, 0, 0, 0, 0, 5, 0, 1, 4, 0,
- 7, 14, 0, 0, 2, 0, 3, 0, 8, 11,
- 12, 13, 9,
+ 7, 15, 0, 0, 2, 0, 3, 0, 8, 11,
+ 12, 13, 14, 9,
};
short yydgoto[] = { 3,
12, 5, 13, 14,
};
short yysindex[] = { -244,
- 0, -254, -244, -55, -59, 0, -50, 0, 0, -60,
- 0, 0, -251, -45, 0, -250, 0, -43, 0, 0,
- 0, 0, 0,
+ 0, -250, -244, -51, -59, 0, -45, 0, 0, -60,
+ 0, 0, -247, -43, 0, -258, 0, -42, 0, 0,
+ 0, 0, 0, 0,
};
short yyrindex[] = { 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, -42,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, -41,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0,
+ 0, 0, 0, 0,
};
short yygindex[] = { 0,
- 2, 0, 0, 5,
+ 6, 0, 0, 7,
};
#define YYTABLESIZE 200
short yytable[] = { 11,
- 16, 4, 6, 8, 7, 1, 17, 10, 15, 20,
- 21, 22, 1, 19, 2, 23, 10, 18, 0, 0,
+ 16, 20, 21, 22, 23, 4, 6, 8, 7, 1,
+ 17, 10, 1, 15, 2, 19, 24, 10, 0, 18,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 6, 1, 9, 10,
};
short yycheck[] = { 59,
- 61, 0, 257, 59, 3, 257, 258, 259, 59, 260,
- 261, 262, 257, 59, 259, 59, 59, 13, -1, -1,
+ 61, 260, 261, 262, 263, 0, 257, 59, 3, 257,
+ 258, 259, 257, 59, 259, 59, 59, 59, -1, 13,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
#ifndef YYDEBUG
#define YYDEBUG 0
#endif
-#define YYMAXTOKEN 262
+#define YYMAXTOKEN 263
#if YYDEBUG
char *yyname[] = {
"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"BLOCK_START","BLOCK_END",
-"NAME","TEXT","NUMBER","MACADDR",
+"NAME","TEXT","NUMBER","MACADDR","MACADDR_PARTIAL",
};
char *yyrule[] = {
"$accept : block_list",
"statement : NAME '=' TEXT",
"statement : NAME '=' NUMBER",
"statement : NAME '=' MACADDR",
+"statement : NAME '=' MACADDR_PARTIAL",
"statement : block",
};
#endif
short yyss[YYSTACKSIZE];
YYSTYPE yyvs[YYSTACKSIZE];
#define yystacksize YYSTACKSIZE
-#line 114 "rpld_conf.y"
+#line 88 "rpld_conf.y"
//
// ERROR REPORTING
} else if (state == HOSTBLOCK) {
// ethernet address
if (strsame(name, "ethernet") || strsame(name, "mac")) {
- if (type != MACADDR) THROW_ERROR("Directive must be followed by an ethernet address");
+ if (type != MACADDR && type != MACADDR_PARTIAL)
+ THROW_ERROR("Directive must be followed by a (partial or complete) ethernet address");
else if (ci.have_mac) THROW_ERROR("Repeated directive");
- // set MAC address
- bcopy(pvalue->mac_address,pc->mac,ETH_ALEN);
+ if (type == MACADDR) {
+ // set MAC address; this is non-partial, so len = ETH_ALEN
+ bcopy(pvalue->mac_address, pc->mac, ETH_ALEN);
+ pc->partial_mac_len = ETH_ALEN;
+ } else {
+ bcopy(pvalue->pm.mac_address, pc->mac, pvalue->pm.mac_len);
+ pc->partial_mac_len = pvalue->pm.mac_len;
+ }
+
ci.have_mac = 1;
}
// execute address
}
-#line 439 "rpld_conf.tab.c"
+#line 453 "rpld_conf.tab.c"
#define YYABORT goto yyabort
#define YYREJECT goto yyabort
#define YYACCEPT goto yyaccept
switch (yyn)
{
case 3:
-#line 96 "rpld_conf.y"
+#line 69 "rpld_conf.y"
{ process_thing(BLOCK_END, "", 0, NULL); }
break;
case 4:
-#line 97 "rpld_conf.y"
+#line 70 "rpld_conf.y"
{ process_thing(BLOCK_END, "", 0, NULL); }
break;
case 5:
-#line 99 "rpld_conf.y"
+#line 72 "rpld_conf.y"
{ process_thing(BLOCK_START, yyvsp[-1].name, 0, NULL); }
break;
case 6:
-#line 100 "rpld_conf.y"
+#line 73 "rpld_conf.y"
{ process_thing(BLOCK_START, "", 0, NULL); }
break;
case 10:
-#line 107 "rpld_conf.y"
+#line 80 "rpld_conf.y"
{ process_thing(ASSERTION, yyvsp[0].name, 0, NULL); }
break;
case 11:
-#line 108 "rpld_conf.y"
+#line 81 "rpld_conf.y"
{ process_thing(ASSIGNMENT, yyvsp[-2].name, TEXT, &yyvsp[0]); }
break;
case 12:
-#line 109 "rpld_conf.y"
+#line 82 "rpld_conf.y"
{ process_thing(ASSIGNMENT, yyvsp[-2].name, NUMBER, &yyvsp[0]); }
break;
case 13:
-#line 110 "rpld_conf.y"
+#line 83 "rpld_conf.y"
{ process_thing(ASSIGNMENT, yyvsp[-2].name, MACADDR, &yyvsp[0]); }
break;
-#line 612 "rpld_conf.tab.c"
+case 14:
+#line 84 "rpld_conf.y"
+{ process_thing(ASSIGNMENT, yyvsp[-2].name, MACADDR_PARTIAL, &yyvsp[0]); }
+break;
+#line 630 "rpld_conf.tab.c"
}
yyssp -= yym;
yystate = *yyssp;
#define TEXT 260
#define NUMBER 261
#define MACADDR 262
+#define MACADDR_PARTIAL 263
typedef union {
long number;
char *name;
char *text;
char mac_address[6];
+ struct partial_mac {
+ char mac_address[6];
+ int mac_len;
+ } pm;
} YYSTYPE;
extern YYSTYPE yylval;
* YACC grammar for RPLD conf file parser
*
* $Log: rpld_conf.y,v $
- * Revision 1.3 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
+ * Revision 1.3 1999/09/26 10:46:56 root
* #
*
* Revision 1.2 1999/09/13 11:17:35 root
* Revision 1.1 1999/09/13 11:04:13 root
* \#
*
- * Revision 1.10 1999/09/12 19:45:03 chris
- * *** empty log message ***
- *
- * Revision 1.9 1999/09/12 19:14:07 chris
- * Error messages now report name of last token scanned, instead of current yytext.
- *
- * Revision 1.8 1999/09/12 17:39:01 chris
- * Configuration file now correctly builds structures; various minor problems fixed.
- *
- * Revision 1.7 1999/09/12 04:21:29 chris
- * Wrote back-end to parser.
- *
- * Revision 1.6 1999/09/12 03:27:35 chris
- * Added better error reporting.
- *
- * Revision 1.5 1999/09/12 01:05:00 chris
- * Supports detecting start and end of blocks.
- *
- * Revision 1.4 1999/09/12 00:58:02 chris
- * Added named block syntax.
- *
- * Revision 1.3 1999/09/11 19:00:51 chris
- * Added support for nested blocks.
- *
- * Revision 1.2 1999/09/11 18:53:41 chris
- * Added a comment to say what the file does.
- *
- *
*/
%{
-static char rcsid[]="$Id: rpld_conf.y,v 1.3 2000/07/16 13:18:10 root Exp root $";
+static char rcsid[]="$Id: rpld_conf.y,v 1.3 1999/09/26 10:46:56 root Exp root $";
#include "project.h"
%}
-%token BLOCK_START BLOCK_END NAME TEXT NUMBER MACADDR
+%token BLOCK_START BLOCK_END NAME TEXT NUMBER MACADDR MACADDR_PARTIAL
%union {
long number;
char *name;
char *text;
char mac_address[6];
+ struct partial_mac {
+ char mac_address[6];
+ int mac_len;
+ } pm;
}
%start block_list
| NAME '=' TEXT { process_thing(ASSIGNMENT, $1.name, TEXT, &$3); }
| NAME '=' NUMBER { process_thing(ASSIGNMENT, $1.name, NUMBER, &$3); }
| NAME '=' MACADDR { process_thing(ASSIGNMENT, $1.name, MACADDR, &$3); }
+ | NAME '=' MACADDR_PARTIAL { process_thing(ASSIGNMENT, $1.name, MACADDR_PARTIAL, &$3); }
| block
%%
} else if (state == HOSTBLOCK) {
// ethernet address
if (strsame(name, "ethernet") || strsame(name, "mac")) {
- if (type != MACADDR) THROW_ERROR("Directive must be followed by an ethernet address");
+ if (type != MACADDR && type != MACADDR_PARTIAL)
+ THROW_ERROR("Directive must be followed by a (partial or complete) ethernet address");
else if (ci.have_mac) THROW_ERROR("Repeated directive");
- // set MAC address
- bcopy(pvalue->mac_address,pc->mac,ETH_ALEN);
+ if (type == MACADDR) {
+ // set MAC address; this is non-partial, so len = ETH_ALEN
+ bcopy(pvalue->mac_address, pc->mac, ETH_ALEN);
+ pc->partial_mac_len = ETH_ALEN;
+ } else {
+ bcopy(pvalue->pm.mac_address, pc->mac, pvalue->pm.mac_len);
+ pc->partial_mac_len = pvalue->pm.mac_len;
+ }
+
ci.have_mac = 1;
}
// execute address
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;
-#define YY_NUM_RULES 16
-#define YY_END_OF_BUFFER 17
-static yyconst short int yy_accept[50] =
+#define YY_NUM_RULES 17
+#define YY_END_OF_BUFFER 18
+static yyconst short int yy_accept[51] =
{ 0,
- 0, 0, 0, 0, 17, 15, 1, 2, 15, 13,
- 15, 12, 12, 13, 8, 9, 5, 6, 5, 1,
- 0, 14, 13, 4, 3, 12, 0, 0, 13, 7,
- 3, 12, 0, 11, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 10, 0
+ 0, 0, 0, 0, 18, 16, 1, 2, 16, 14,
+ 16, 13, 13, 14, 8, 9, 5, 6, 5, 1,
+ 0, 15, 14, 4, 3, 13, 0, 0, 14, 7,
+ 3, 13, 0, 12, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 10, 11, 0
} ;
static yyconst int yy_ec[256] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 4, 1, 5, 1, 1, 1, 1, 1, 1,
1, 6, 1, 1, 7, 8, 9, 10, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 12, 1, 1,
- 1, 1, 1, 1, 13, 13, 13, 13, 13, 13,
+ 11, 11, 11, 11, 12, 12, 12, 13, 1, 1,
+ 1, 1, 1, 1, 14, 14, 14, 14, 14, 14,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 1, 1, 1, 1, 7, 1, 13, 13, 13, 13,
+ 1, 1, 1, 1, 7, 1, 14, 14, 14, 14,
- 13, 13, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 14,
- 7, 7, 15, 1, 16, 1, 1, 1, 1, 1,
+ 14, 14, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 15,
+ 7, 7, 16, 1, 17, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;
-static yyconst int yy_meta[17] =
+static yyconst int yy_meta[18] =
{ 0,
1, 1, 2, 3, 3, 1, 4, 3, 3, 5,
- 5, 6, 7, 4, 1, 1
+ 5, 5, 6, 7, 8, 1, 1
} ;
-static yyconst short int yy_base[66] =
+static yyconst short int yy_base[68] =
{ 0,
- 0, 0, 14, 15, 78, 101, 20, 101, 70, 0,
- 17, 17, 58, 25, 101, 101, 101, 101, 60, 38,
- 55, 101, 0, 101, 0, 45, 44, 0, 29, 101,
- 0, 23, 0, 0, 0, 25, 0, 0, 17, 0,
- 0, 13, 0, 0, 7, 0, 0, 101, 101, 42,
- 47, 51, 58, 61, 63, 66, 69, 72, 75, 78,
- 81, 84, 87, 90, 93
+ 0, 0, 15, 16, 84, 110, 21, 110, 76, 0,
+ 18, 14, 16, 25, 110, 110, 110, 110, 69, 39,
+ 63, 110, 0, 110, 0, 51, 47, 0, 46, 110,
+ 0, 29, 0, 0, 0, 25, 0, 0, 21, 0,
+ 0, 20, 0, 0, 13, 0, 0, 9, 110, 110,
+ 43, 49, 54, 58, 66, 70, 72, 75, 78, 81,
+ 84, 87, 90, 93, 96, 99, 102
} ;
-static yyconst short int yy_def[66] =
+static yyconst short int yy_def[68] =
{ 0,
- 49, 1, 50, 50, 49, 49, 49, 49, 51, 52,
- 49, 49, 12, 49, 49, 49, 49, 49, 49, 49,
- 51, 49, 52, 49, 53, 54, 49, 55, 52, 49,
- 53, 49, 56, 55, 57, 49, 58, 59, 49, 60,
- 61, 49, 62, 63, 49, 64, 65, 49, 0, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49
+ 50, 1, 51, 51, 50, 50, 50, 50, 52, 53,
+ 50, 54, 54, 50, 50, 50, 50, 50, 50, 50,
+ 52, 50, 53, 50, 55, 56, 50, 57, 53, 50,
+ 55, 56, 58, 57, 59, 50, 60, 61, 50, 62,
+ 63, 50, 64, 65, 50, 66, 67, 50, 50, 0,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50
} ;
-static yyconst short int yy_nxt[118] =
+static yyconst short int yy_nxt[128] =
{ 0,
6, 7, 8, 7, 9, 6, 10, 6, 11, 12,
- 13, 6, 14, 10, 15, 16, 18, 18, 46, 19,
- 19, 20, 24, 20, 43, 25, 26, 26, 40, 27,
- 28, 23, 32, 32, 27, 27, 37, 29, 23, 20,
- 33, 20, 17, 17, 17, 17, 17, 17, 17, 21,
- 21, 21, 21, 21, 23, 33, 33, 23, 31, 22,
- 31, 31, 31, 31, 31, 32, 32, 34, 30, 34,
- 35, 49, 35, 36, 22, 36, 38, 49, 38, 39,
- 49, 39, 41, 49, 41, 42, 49, 42, 44, 49,
- 44, 45, 49, 45, 47, 49, 47, 48, 49, 48,
-
- 5, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49
+ 13, 13, 6, 14, 10, 15, 16, 18, 18, 49,
+ 19, 19, 20, 24, 20, 46, 25, 27, 28, 27,
+ 50, 23, 43, 40, 27, 27, 27, 37, 29, 23,
+ 20, 50, 20, 17, 17, 17, 17, 17, 17, 17,
+ 17, 21, 21, 21, 21, 21, 21, 23, 33, 33,
+ 23, 23, 26, 33, 26, 26, 31, 22, 31, 31,
+ 31, 31, 31, 31, 32, 32, 34, 30, 34, 35,
+ 22, 35, 36, 50, 36, 38, 50, 38, 39, 50,
+ 39, 41, 50, 41, 42, 50, 42, 44, 50, 44,
+
+ 45, 50, 45, 47, 50, 47, 48, 50, 48, 5,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50
} ;
-static yyconst short int yy_chk[118] =
+static yyconst short int yy_chk[128] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 3, 4, 45, 3,
- 4, 7, 11, 7, 42, 11, 12, 12, 39, 12,
- 12, 14, 32, 32, 14, 14, 36, 14, 14, 20,
- 29, 20, 50, 50, 50, 50, 50, 50, 50, 51,
- 51, 51, 51, 51, 52, 27, 26, 52, 53, 21,
- 53, 53, 53, 53, 53, 54, 54, 55, 19, 55,
- 56, 13, 56, 57, 9, 57, 58, 5, 58, 59,
- 0, 59, 60, 0, 60, 61, 0, 61, 62, 0,
- 62, 63, 0, 63, 64, 0, 64, 65, 0, 65,
-
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49
+ 1, 1, 1, 1, 1, 1, 1, 3, 4, 48,
+ 3, 4, 7, 11, 7, 45, 11, 12, 12, 13,
+ 13, 14, 42, 39, 14, 14, 14, 36, 14, 14,
+ 20, 32, 20, 51, 51, 51, 51, 51, 51, 51,
+ 51, 52, 52, 52, 52, 52, 52, 53, 29, 27,
+ 53, 53, 54, 26, 54, 54, 55, 21, 55, 55,
+ 55, 55, 55, 55, 56, 56, 57, 19, 57, 58,
+ 9, 58, 59, 5, 59, 60, 0, 60, 61, 0,
+ 61, 62, 0, 62, 63, 0, 63, 64, 0, 64,
+
+ 65, 0, 65, 66, 0, 66, 67, 0, 67, 50,
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50
} ;
static yy_state_type yy_last_accepting_state;
* Lexer for RPLD conf files
*
* $Log: rpld_conf.lex,v $
- * Revision 1.4 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
+ * Revision 1.4 1999/09/26 10:46:56 root
* #
*
* Revision 1.3 1999/09/13 11:17:35 root
* Revision 1.1 1999/09/13 11:04:13 root
* \#
*
- * Revision 1.10 1999/09/12 19:08:24 chris
- * Another attempt at C comments.
- *
- * Revision 1.9 1999/09/12 17:38:45 chris
- * Implemented proper MAC reading.
- *
- * Revision 1.8 1999/09/12 03:27:43 chris
- * Changes to enable error reporting in yacc grammar.
- *
- * Revision 1.7 1999/09/11 19:30:26 chris
- * Fixed hex number support.
- *
- * Revision 1.6 1999/09/11 19:25:06 chris
- * No major changes.
- *
- * Revision 1.5 1999/09/11 19:24:23 chris
- * Removed support for C-style comments, inserted support for C++ ones. Comment support actually works now
- *
- * Revision 1.4 1999/09/11 19:02:25 chris
- * Fixed bug in comment support.
- *
- * Revision 1.3 1999/09/11 19:00:43 chris
- * Added support for comments.
- *
- * Revision 1.2 1999/09/11 18:57:31 chris
- * Initial revision.
- *
*
*/
#define COMMENT 1
-#line 70 "rpld_conf.lex"
-static char rcsid[]="$Id: rpld_conf.lex,v 1.4 2000/07/16 13:18:10 root Exp root $";
+#line 40 "rpld_conf.lex"
+static char rcsid[]="$Id: rpld_conf.lex,v 1.4 1999/09/26 10:46:56 root Exp root $";
#include <stdio.h>
#include <string.h>
}
-#line 494 "rpld_conf.yy.c"
+#line 466 "rpld_conf.yy.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 98 "rpld_conf.lex"
+#line 68 "rpld_conf.lex"
-#line 648 "rpld_conf.yy.c"
+#line 620 "rpld_conf.yy.c"
if ( yy_init )
{
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 50 )
+ if ( yy_current_state >= 51 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 101 );
+ while ( yy_base[yy_current_state] != 110 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
case 1:
YY_RULE_SETUP
-#line 100 "rpld_conf.lex"
+#line 70 "rpld_conf.lex"
;
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 101 "rpld_conf.lex"
+#line 71 "rpld_conf.lex"
{ lineno++; }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 103 "rpld_conf.lex"
+#line 73 "rpld_conf.lex"
;
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 105 "rpld_conf.lex"
+#line 75 "rpld_conf.lex"
BEGIN COMMENT;
YY_BREAK
case 5:
-#line 107 "rpld_conf.lex"
+#line 77 "rpld_conf.lex"
case 6:
YY_RULE_SETUP
-#line 107 "rpld_conf.lex"
+#line 77 "rpld_conf.lex"
;
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 108 "rpld_conf.lex"
+#line 78 "rpld_conf.lex"
BEGIN INITIAL;
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 110 "rpld_conf.lex"
+#line 80 "rpld_conf.lex"
{ return BLOCK_START; }
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 112 "rpld_conf.lex"
+#line 82 "rpld_conf.lex"
{ return BLOCK_END; }
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 114 "rpld_conf.lex"
-{ strtomac(yytext, (yylval.mac_address)); return MACADDR; }
+#line 84 "rpld_conf.lex"
+{
+ strtomac(yytext, (yylval.mac_address));
+ return MACADDR;
+ }
YY_BREAK
case 11:
+*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
+yy_c_buf_p = yy_cp = yy_bp + 17;
+YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 116 "rpld_conf.lex"
+#line 89 "rpld_conf.lex"
+{
+ strtomac(yytext, (yylval.pm.mac_address));
+ yylval.pm.mac_len = yytext[13] - '0';
+ return MACADDR_PARTIAL;
+ }
+ YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 95 "rpld_conf.lex"
{
yylval.number = strtol(yytext + 2, NULL, 16);
return NUMBER;
}
YY_BREAK
-case 12:
+case 13:
YY_RULE_SETUP
-#line 121 "rpld_conf.lex"
+#line 100 "rpld_conf.lex"
{
int i; i = strtol(yytext, NULL, 10);
yylval.number = i; return NUMBER;
}
YY_BREAK
-case 13:
+case 14:
YY_RULE_SETUP
-#line 126 "rpld_conf.lex"
+#line 105 "rpld_conf.lex"
{ yylval.name = strdup(yytext); return NAME; }
YY_BREAK
-case 14:
+case 15:
YY_RULE_SETUP
-#line 128 "rpld_conf.lex"
+#line 107 "rpld_conf.lex"
{ yylval.text = strdup(yytext + 1); *(yylval.text + strlen(yylval.text) - 1) = 0; return TEXT;}
YY_BREAK
-case 15:
+case 16:
YY_RULE_SETUP
-#line 130 "rpld_conf.lex"
+#line 109 "rpld_conf.lex"
{ return yytext[0]; }
YY_BREAK
-case 16:
+case 17:
YY_RULE_SETUP
-#line 132 "rpld_conf.lex"
+#line 111 "rpld_conf.lex"
ECHO;
YY_BREAK
-#line 814 "rpld_conf.yy.c"
+#line 801 "rpld_conf.yy.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(COMMENT):
yyterminate();
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 50 )
+ if ( yy_current_state >= 51 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 50 )
+ if ( yy_current_state >= 51 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 49);
+ yy_is_jam = (yy_current_state == 50);
return yy_is_jam ? 0 : yy_current_state;
}
return 0;
}
#endif
-#line 132 "rpld_conf.lex"
+#line 111 "rpld_conf.lex"
*/
-static char rcsid[] = "$Id: util.c,v 1.6 2000/07/16 13:18:10 root Exp root $";
+static char rcsid[] = "$Id: util.c,v 1.5 1999/09/13 11:17:35 root Exp $";
/*
* $Log: util.c,v $
- * Revision 1.6 2000/07/16 13:18:10 root
- * #
- *
- * Revision 1.1 2000/07/16 13:16:33 root
- * #
- *
* Revision 1.5 1999/09/13 11:17:35 root
* \#
*