diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1998-03-05 13:01:40 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1998-03-05 13:01:40 +0000 |
| commit | 4806c3b763ef0a3639a1e4ebed76fe27838de9a7 (patch) | |
| tree | e6597f54942cc7ab53491075c747ff0d7bc628e3 /libexec | |
| parent | d93a6ba8b315c5b2f21f52773beda101def8846f (diff) | |
Notes
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/rbootd/Makefile | 9 | ||||
| -rw-r--r-- | libexec/rbootd/bpf.c | 34 | ||||
| -rw-r--r-- | libexec/rbootd/conf.c | 12 | ||||
| -rw-r--r-- | libexec/rbootd/defs.h | 18 | ||||
| -rw-r--r-- | libexec/rbootd/parseconf.c | 31 | ||||
| -rw-r--r-- | libexec/rbootd/pathnames.h | 4 | ||||
| -rw-r--r-- | libexec/rbootd/rbootd.c | 80 | ||||
| -rw-r--r-- | libexec/rbootd/rmp.h | 24 | ||||
| -rw-r--r-- | libexec/rbootd/rmp_var.h | 94 | ||||
| -rw-r--r-- | libexec/rbootd/rmpproto.c | 76 | ||||
| -rw-r--r-- | libexec/rbootd/utils.c | 82 |
11 files changed, 202 insertions, 262 deletions
diff --git a/libexec/rbootd/Makefile b/libexec/rbootd/Makefile index dfb087004e34..75a16fbc8055 100644 --- a/libexec/rbootd/Makefile +++ b/libexec/rbootd/Makefile @@ -1,13 +1,8 @@ -# @(#)Makefile 8.1 (Berkeley) 6/4/93 -# $Id$ +# from: @(#)Makefile 8.1 (Berkeley) 6/4/93 +# $Id: Makefile,v 1.5 1996/09/22 21:54:19 wosch Exp $ PROG= rbootd SRCS= bpf.c conf.c parseconf.c rbootd.c rmpproto.c utils.c MAN8= rbootd.8 -# XXX BROKEN: afterinstall: -XXXafterinstall: - (cd ${.CURDIR}/bootdir && ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} \ - -m 444 * ${DESTDIR}/usr/mdec/) - .include <bsd.prog.mk> diff --git a/libexec/rbootd/bpf.c b/libexec/rbootd/bpf.c index 7a3a792d4963..505fef76072b 100644 --- a/libexec/rbootd/bpf.c +++ b/libexec/rbootd/bpf.c @@ -38,7 +38,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)bpf.c 8.1 (Berkeley) 6/4/93 + * from: @(#)bpf.c 8.1 (Berkeley) 6/4/93 * * From: Utah Hdr: bpf.c 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS @@ -46,15 +46,16 @@ #ifndef lint #if 0 -static char sccsid[] = "@(#)bpf.c 8.1 (Berkeley) 6/4/93"; +static const char sccsid[] = "@(#)bpf.c 8.1 (Berkeley) 6/4/93"; #endif static const char rcsid[] = - "$Id$"; + "$Id: bpf.c,v 1.3.2.1 1997/12/16 07:17:34 charnier Exp $"; #endif /* not lint */ #include <sys/param.h> #include <sys/ioctl.h> #include <sys/socket.h> +#include <sys/time.h> #include <net/if.h> #include <net/bpf.h> @@ -72,7 +73,7 @@ static const char rcsid[] = static int BpfFd = -1; static unsigned BpfLen = 0; -static u_char *BpfPkt = NULL; +static u_int8_t *BpfPkt = NULL; /* ** BpfOpen -- Open and initialize a BPF device. @@ -148,15 +149,10 @@ BpfOpen() ifr.ifr_addr.sa_len = RMP_ADDRLEN + 2; #endif ifr.ifr_addr.sa_family = AF_UNSPEC; - bcopy(&RmpMcastAddr[0], (char *)&ifr.ifr_addr.sa_data[0], RMP_ADDRLEN); - if (ioctl(BpfFd, SIOCADDMULTI, (caddr_t)&ifr) < 0) { - syslog(LOG_WARNING, - "bpf: can't add mcast addr (%m), setting promiscuous mode"); - - if (ioctl(BpfFd, BIOCPROMISC, (caddr_t)0) < 0) { - syslog(LOG_ERR, "bpf: can't set promiscuous mode: %m"); - Exit(0); - } + memmove((char *)&ifr.ifr_addr.sa_data[0], &RmpMcastAddr[0], RMP_ADDRLEN); + if (ioctl(BpfFd, BIOCPROMISC, (caddr_t)0) < 0) { + syslog(LOG_ERR, "bpf: can't set promiscuous mode: %m"); + Exit(0); } /* @@ -167,7 +163,7 @@ BpfOpen() Exit(0); } if (BpfPkt == NULL) - BpfPkt = (u_char *)malloc(BpfLen); + BpfPkt = (u_int8_t *)malloc(BpfLen); if (BpfPkt == NULL) { syslog(LOG_ERR, "bpf: out of memory (%u bytes for bpfpkt)", @@ -315,8 +311,8 @@ BpfRead(rconn, doread) RMPCONN *rconn; int doread; { - register int datlen, caplen, hdrlen; - static u_char *bp = NULL, *ep = NULL; + int datlen, caplen, hdrlen; + static u_int8_t *bp = NULL, *ep = NULL; int cc; /* @@ -352,9 +348,9 @@ BpfRead(rconn, doread) caplen); else { rconn->rmplen = caplen; - bcopy((char *)&bhp->bh_tstamp, (char *)&rconn->tstamp, + memmove((char *)&rconn->tstamp, (char *)&bhp->bh_tstamp, sizeof(struct timeval)); - bcopy((char *)bp + hdrlen, (char *)&rconn->rmp, caplen); + memmove((char *)&rconn->rmp, (char *)bp + hdrlen, caplen); } bp += BPF_WORDALIGN(caplen + hdrlen); return(1); @@ -417,7 +413,7 @@ BpfClose() ifr.ifr_addr.sa_len = RMP_ADDRLEN + 2; #endif ifr.ifr_addr.sa_family = AF_UNSPEC; - bcopy(&RmpMcastAddr[0], (char *)&ifr.ifr_addr.sa_data[0], RMP_ADDRLEN); + memmove((char *)&ifr.ifr_addr.sa_data[0], &RmpMcastAddr[0], RMP_ADDRLEN); if (ioctl(BpfFd, SIOCDELMULTI, (caddr_t)&ifr) < 0) (void) ioctl(BpfFd, BIOCPROMISC, (caddr_t)0); diff --git a/libexec/rbootd/conf.c b/libexec/rbootd/conf.c index b0786cd63a69..014c02921834 100644 --- a/libexec/rbootd/conf.c +++ b/libexec/rbootd/conf.c @@ -38,7 +38,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)conf.c 8.1 (Berkeley) 6/4/93 + * from: @(#)conf.c 8.1 (Berkeley) 6/4/93 * * From: Utah Hdr: conf.c 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS @@ -46,10 +46,10 @@ #ifndef lint #if 0 -static char sccsid[] = "@(#)conf.c 8.1 (Berkeley) 6/4/93"; +static const char sccsid[] = "@(#)conf.c 8.1 (Berkeley) 6/4/93"; #endif static const char rcsid[] = - "$Id$"; + "$Id: conf.c,v 1.1.1.1.8.1 1997/12/16 07:17:36 charnier Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -70,7 +70,7 @@ static const char rcsid[] = */ char MyHost[MAXHOSTNAMELEN+1]; /* host name */ -int MyPid; /* process id */ +pid_t MyPid; /* process id */ int DebugFlg = 0; /* set true if debugging */ int BootAny = 0; /* set true if we boot anyone */ @@ -83,11 +83,11 @@ char *DbgFile = _PATH_RBOOTDDBG; /* debug output file */ FILE *DbgFp = NULL; /* debug file pointer */ char *IntfName = NULL; /* intf we are attached to */ -u_short SessionID = 0; /* generated session ID */ +u_int16_t SessionID = 0; /* generated session ID */ char *BootFiles[C_MAXFILE]; /* list of boot files */ CLIENT *Clients = NULL; /* list of addrs we'll accept */ RMPCONN *RmpConns = NULL; /* list of active connections */ -char RmpMcastAddr[RMP_ADDRLEN] = RMP_ADDR; /* RMP multicast address */ +u_int8_t RmpMcastAddr[RMP_ADDRLEN] = RMP_ADDR; /* RMP multicast address */ diff --git a/libexec/rbootd/defs.h b/libexec/rbootd/defs.h index 07aa35761ad4..6edde9bff8c8 100644 --- a/libexec/rbootd/defs.h +++ b/libexec/rbootd/defs.h @@ -38,9 +38,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)defs.h 8.1 (Berkeley) 6/4/93 + * from: @(#)defs.h 8.1 (Berkeley) 6/4/93 * - * Utah $Hdr: defs.h 3.1 92/07/06$ + * From: Utah Hdr: defs.h 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS */ @@ -107,7 +107,7 @@ * (unless there are no restrictions on who we can boot). */ typedef struct client_s { - u_char addr[RMP_ADDRLEN]; /* addr of machine */ + u_int8_t addr[RMP_ADDRLEN]; /* addr of machine */ char *files[C_MAXFILE]; /* boot-able files */ struct client_s *next; /* ptr to next */ } CLIENT; @@ -127,7 +127,7 @@ typedef struct rmpconn_s { * All these variables are defined in "conf.c". */ extern char MyHost[]; /* this hosts' name */ -extern int MyPid; /* this processes' ID */ +extern pid_t MyPid; /* this processes' ID */ extern int DebugFlg; /* set true if debugging */ extern int BootAny; /* set true if we can boot anyone */ @@ -140,14 +140,14 @@ extern char *BootDir; /* directory w/boot files */ extern FILE *DbgFp; /* debug file pointer */ extern char *IntfName; /* interface we are attached to */ -extern u_short SessionID; /* generated session ID */ +extern u_int16_t SessionID; /* generated session ID */ extern char *BootFiles[]; /* list of boot files */ extern CLIENT *Clients; /* list of addrs we'll accept */ extern RMPCONN *RmpConns; /* list of active connections */ -extern char RmpMcastAddr[]; /* RMP multicast address */ +extern u_int8_t RmpMcastAddr[]; /* RMP multicast address */ void AddConn __P((RMPCONN *)); int BootDone __P((RMPCONN *)); @@ -168,11 +168,11 @@ void FreeClients __P((void)); void FreeConn __P((RMPCONN *)); void FreeConns __P((void)); int GetBootFiles __P((void)); -char *GetEtherAddr __P((u_char *)); -CLIENT *NewClient __P((u_char *)); +char *GetEtherAddr __P((u_int8_t *)); +CLIENT *NewClient __P((u_int8_t *)); RMPCONN *NewConn __P((RMPCONN *)); char *NewStr __P((char *)); -u_char *ParseAddr __P((char *)); +u_int8_t *ParseAddr __P((char *)); int ParseConfig __P((void)); void ProcessPacket __P((RMPCONN *, CLIENT *)); void ReConfig __P((int)); diff --git a/libexec/rbootd/parseconf.c b/libexec/rbootd/parseconf.c index 81f652f0bf46..e812531d9b95 100644 --- a/libexec/rbootd/parseconf.c +++ b/libexec/rbootd/parseconf.c @@ -38,7 +38,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)parseconf.c 8.1 (Berkeley) 6/4/93 + * from: @(#)parseconf.c 8.1 (Berkeley) 6/4/93 * * From: Utah Hdr: parseconf.c 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS @@ -46,10 +46,10 @@ #ifndef lint #if 0 -static char sccsid[] = "@(#)parseconf.c 8.1 (Berkeley) 6/4/93"; +static const char sccsid[] = "@(#)parseconf.c 8.1 (Berkeley) 6/4/93"; #endif static const char rcsid[] = - "$Id$"; + "$Id: parseconf.c,v 1.3.2.1 1997/12/16 07:17:41 charnier Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -86,10 +86,10 @@ ParseConfig() { FILE *fp; CLIENT *client; - u_char *addr; + u_int8_t *addr; char line[C_LINELEN]; - register char *cp, *bcp; - register int i, j; + char *cp, *bcp; + int i, j; int omask, linecnt = 0; if (BootAny) /* ignore config file */ @@ -131,7 +131,7 @@ ParseConfig() if (*line == '\0' || *line == '#') /* ignore comment */ continue; - if ((cp = index(line,'#')) != NULL) /* trash comments */ + if ((cp = strchr(line,'#')) != NULL) /* trash comments */ *cp = '\0'; cp = line; /* init `cp' */ @@ -245,18 +245,17 @@ ParseConfig() ** Warnings: ** - The return value points to a static buffer; it must ** be copied if it's to be saved. -** - For speed, we assume a u_char consists of 8 bits. */ -u_char * +u_int8_t * ParseAddr(str) char *str; { - static u_char addr[RMP_ADDRLEN]; - register char *cp; - register unsigned i; - register int part, subpart; + static u_int8_t addr[RMP_ADDRLEN]; + char *cp; + unsigned i; + int part, subpart; - bzero((char *)&addr[0], RMP_ADDRLEN); /* zero static buffer */ + memset((char *)&addr[0], 0, RMP_ADDRLEN); /* zero static buffer */ part = subpart = 0; for (cp = str; *cp; cp++) { @@ -316,8 +315,8 @@ GetBootFiles() { DIR *dfd; struct stat statb; - register struct dirent *dp; - register int i; + struct dirent *dp; + int i; /* * Free the current list of boot files. diff --git a/libexec/rbootd/pathnames.h b/libexec/rbootd/pathnames.h index d960dcee96ac..56b9deb39fc3 100644 --- a/libexec/rbootd/pathnames.h +++ b/libexec/rbootd/pathnames.h @@ -38,9 +38,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)pathnames.h 8.1 (Berkeley) 6/4/93 + * from: @(#)pathnames.h 8.1 (Berkeley) 6/4/93 * - * Utah $Hdr: pathnames.h 3.1 92/07/06$ + * From: Utah Hdr: pathnames.h 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS */ diff --git a/libexec/rbootd/rbootd.c b/libexec/rbootd/rbootd.c index 736c7c14bcf7..563c7ebcbf37 100644 --- a/libexec/rbootd/rbootd.c +++ b/libexec/rbootd/rbootd.c @@ -38,7 +38,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)rbootd.c 8.2 (Berkeley) 2/22/94 + * from: @(#)rbootd.c 8.1 (Berkeley) 6/4/93 * * From: Utah Hdr: rbootd.c 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS @@ -55,7 +55,7 @@ static const char copyright[] = static char sccsid[] = "@(#)rbootd.c 8.2 (Berkeley) 2/22/94"; #endif static const char rcsid[] = - "$Id$"; + "$Id: rbootd.c,v 1.3.2.2 1997/12/16 07:17:46 charnier Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -74,20 +74,6 @@ static const char rcsid[] = #include <unistd.h> #include "defs.h" - -/* fd mask macros (backward compatibility with 4.2BSD) */ -#ifndef FD_SET -#ifdef notdef -typedef struct fd_set { /* this should already be in 4.2 */ - int fds_bits[1]; -} fd_set; -#endif -#define FD_ZERO(p) ((p)->fds_bits[0] = 0) -#define FD_SET(n, p) ((p)->fds_bits[0] |= (1 << (n))) -#define FD_CLR(n, p) ((p)->fds_bits[0] &= ~(1 << (n))) -#define FD_ISSET(n, p) ((p)->fds_bits[0] & (1 << (n))) -#endif - static void usage __P((void)); int @@ -115,7 +101,7 @@ main(argc, argv) /* * Parse any arguments. */ - while ((c = getopt(argc, argv, "adi:")) != -1) + while ((c = getopt(argc, argv, "adi:")) != -1) switch(c) { case 'a': BootAny++; @@ -134,7 +120,7 @@ main(argc, argv) ConfigFile = argv[optind]; else { warnx("too many config files (`%s' ignored)", - argv[optind]); + argv[optind]); } } @@ -146,54 +132,16 @@ main(argc, argv) (void) signal(SIGUSR1, SIG_IGN); /* dont muck w/DbgFp */ (void) signal(SIGUSR2, SIG_IGN); + (void) fclose(stderr); /* finished with it */ } else { - (void) fclose(stdin); /* dont need these */ - (void) fclose(stdout); - - /* - * Fork off a child to do the work & exit. - */ - switch(fork()) { - case -1: /* fork failed */ - warn("fork"); - Exit(0); - case 0: /* this is the CHILD */ - break; - default: /* this is the PARENT */ - _exit(0); - } - - /* - * Try to disassociate from the current tty. - */ - { - char *devtty = "/dev/tty"; - int i; - - if ((i = open(devtty, O_RDWR)) < 0) { - /* probably already disassociated */ - if (setpgrp(0, 0) < 0) { - warn("setpgrp"); - } - } else { - if (ioctl(i, (u_long)TIOCNOTTY, (char *)0) < 0){ - warn("ioctl"); - } - (void) close(i); - } - } + if (daemon(0, 0)) + err(1, "can't detach from terminal"); (void) signal(SIGUSR1, DebugOn); (void) signal(SIGUSR2, DebugOff); } - (void) fclose(stderr); /* finished with it */ - -#ifdef SYSLOG4_2 - openlog("rbootd", LOG_PID); -#else openlog("rbootd", LOG_PID, LOG_DAEMON); -#endif /* * If no interface was specified, get one now. @@ -237,7 +185,7 @@ main(argc, argv) FILE *fp; if ((fp = fopen(PidFile, "w")) != NULL) { - (void) fprintf(fp, "%d\n", MyPid); + (void) fprintf(fp, "%d\n", (int) MyPid); (void) fclose(fp); } else { syslog(LOG_WARNING, "fopen: failed (%s)", PidFile); @@ -286,13 +234,11 @@ main(argc, argv) r = rset; if (RmpConns == NULL) { /* timeout isnt necessary */ - nsel = select(maxfds, &r, (fd_set *)0, (fd_set *)0, - (struct timeval *)0); + nsel = select(maxfds, &r, NULL, NULL, NULL); } else { timeout.tv_sec = RMP_TIMEOUT; timeout.tv_usec = 0; - nsel = select(maxfds, &r, (fd_set *)0, (fd_set *)0, - &timeout); + nsel = select(maxfds, &r, NULL, NULL, &timeout); } if (nsel < 0) { @@ -365,7 +311,7 @@ usage() void DoTimeout() { - register RMPCONN *rtmp; + RMPCONN *rtmp; struct timeval now; (void) gettimeofday(&now, (struct timezone *)0); @@ -401,9 +347,9 @@ DoTimeout() CLIENT * FindClient(rconn) - register RMPCONN *rconn; + RMPCONN *rconn; { - register CLIENT *ctmp; + CLIENT *ctmp; for (ctmp = Clients; ctmp != NULL; ctmp = ctmp->next) if (bcmp((char *)&rconn->rmp.hp_hdr.saddr[0], diff --git a/libexec/rbootd/rmp.h b/libexec/rbootd/rmp.h index d3b016760d35..c4285c9b37cc 100644 --- a/libexec/rbootd/rmp.h +++ b/libexec/rbootd/rmp.h @@ -38,9 +38,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)rmp.h 8.1 (Berkeley) 6/4/93 + * from: @(#)rmp.h 8.1 (Berkeley) 6/4/93 * - * Utah $Hdr: rmp.h 3.1 92/07/06$ + * From: Utah Hdr: rmp.h 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS */ @@ -75,21 +75,21 @@ */ struct hp_hdr { - u_char daddr[RMP_ADDRLEN]; - u_char saddr[RMP_ADDRLEN]; - u_short len; + u_int8_t daddr[RMP_ADDRLEN]; + u_int8_t saddr[RMP_ADDRLEN]; + u_int16_t len; }; /* * HP uses 802.2 LLC with their own local extensions. This struct makes - * sence out of this data (encapsulated in the above 802.3 packet). + * sense out of this data (encapsulated in the above 802.3 packet). */ struct hp_llc { - u_char dsap; /* 802.2 DSAP */ - u_char ssap; /* 802.2 SSAP */ - u_short cntrl; /* 802.2 control field */ - u_short filler; /* HP filler (must be zero) */ - u_short dxsap; /* HP extended DSAP */ - u_short sxsap; /* HP extended SSAP */ + u_int8_t dsap; /* 802.2 DSAP */ + u_int8_t ssap; /* 802.2 SSAP */ + u_int16_t cntrl; /* 802.2 control field */ + u_int16_t filler; /* HP filler (must be zero) */ + u_int16_t dxsap; /* HP extended DSAP */ + u_int16_t sxsap; /* HP extended SSAP */ }; diff --git a/libexec/rbootd/rmp_var.h b/libexec/rbootd/rmp_var.h index 7df1e87465fc..3a9c7f4e20c4 100644 --- a/libexec/rbootd/rmp_var.h +++ b/libexec/rbootd/rmp_var.h @@ -38,9 +38,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)rmp_var.h 8.1 (Berkeley) 6/4/93 + * from: @(#)rmp_var.h 8.1 (Berkeley) 6/4/93 * - * Utah $Hdr: rmp_var.h 3.1 92/07/06$ + * from: Utah Hdr: rmp_var.h 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS */ @@ -100,12 +100,12 @@ sizeof(struct rmp_boot_repl) + s - sizeof(restofpkt)) #define RMPREADSIZE(s) (sizeof(struct hp_hdr) + sizeof(struct hp_llc) + \ sizeof(struct rmp_read_repl) + s - sizeof(restofpkt) \ - - sizeof(u_char)) + - sizeof(u_int8_t)) #define RMPDONESIZE (sizeof(struct hp_hdr) + sizeof(struct hp_llc) + \ sizeof(struct rmp_boot_done)) #define RMPBOOTDATA 255 #define RMPREADDATA (RMPDATALEN - \ - (2*sizeof(u_char)+sizeof(u_short)+sizeof(u_word))) + (2*sizeof(u_int8_t)+sizeof(u_int16_t)+sizeof(u_word))) /* * This protocol defines some field sizes as "rest of ethernet packet". @@ -117,9 +117,9 @@ typedef char restofpkt; /* * Due to the RMP packet layout, we'll run into alignment problems - * on machines that cant access words on half-word boundaries. If - * you know that your machine does not suffer from this problem, - * add it to the hp300 #define below. + * on machines that can't access (or don't, by default, align) words + * on half-word boundaries. If you know that your machine does not suffer + * from this problem, add it to the vax/tahoe/m68k #define below. * * The following macros are used to deal with this problem: * WORDZE(w) Return True if u_word `w' is zero, False otherwise. @@ -128,24 +128,24 @@ typedef char restofpkt; * GETWORD(w,i) Copy u_word `w' into int `i'. * PUTWORD(i,w) Copy int `i' into u_word `w'. * - * N.B. We do not support little endian alignment-challenged machines. + * N.B. Endianness is handled by use of ntohl/htonl */ -#if defined(vax) || defined(tahoe) || defined(hp300) +#if defined(__vax__) || defined(__tahoe__) || defined(__m68k__) -typedef u_int u_word; +typedef u_int32_t u_word; #define WORDZE(w) ((w) == 0) #define ZEROWORD(w) (w) = 0 #define COPYWORD(w1,w2) (w2) = (w1) -#define GETWORD(w, i) (i) = (w) -#define PUTWORD(i, w) (w) = (i) +#define GETWORD(w, i) (i) = ntohl(w) +#define PUTWORD(i, w) (w) = htonl(i) #else -#define _WORD_HIGHPART 0 /* XXX: assume Big Endian for now */ +#define _WORD_HIGHPART 0 #define _WORD_LOWPART 1 -typedef struct _uword { u_short val[2]; } u_word; +typedef struct _uword { u_int16_t val[2]; } u_word; #define WORDZE(w) \ ((w.val[_WORD_HIGHPART] == 0) && (w.val[_WORD_LOWPART] == 0)) @@ -156,10 +156,10 @@ typedef struct _uword { u_short val[2]; } u_word; (w2).val[_WORD_LOWPART] = (w1).val[_WORD_LOWPART]; \ } #define GETWORD(w, i) \ - (i) = (((u_int)(w).val[_WORD_HIGHPART]) << 16) | (w).val[_WORD_LOWPART] + (i) = (((u_int32_t)ntohs((w).val[_WORD_HIGHPART])) << 16) | ntohs((w).val[_WORD_LOWPART]) #define PUTWORD(i, w) \ - { (w).val[_WORD_HIGHPART] = (u_short) (((i) >> 16) & 0xffff); \ - (w).val[_WORD_LOWPART] = (u_short) (i & 0xffff); \ + { (w).val[_WORD_HIGHPART] = htons((u_int16_t) ((i >> 16) & 0xffff)); \ + (w).val[_WORD_LOWPART] = htons((u_int16_t) (i & 0xffff)); \ } #endif @@ -169,53 +169,53 @@ typedef struct _uword { u_short val[2]; } u_word; */ struct rmp_raw { /* generic RMP packet */ - u_char rmp_type; /* packet type */ - u_char rmp_rawdata[RMPDATALEN-1]; + u_int8_t rmp_type; /* packet type */ + u_int8_t rmp_rawdata[RMPDATALEN-1]; }; struct rmp_boot_req { /* boot request */ - u_char rmp_type; /* packet type (RMP_BOOT_REQ) */ - u_char rmp_retcode; /* return code (0) */ - u_word rmp_seqno; /* sequence number (real time clock) */ - u_short rmp_session; /* session id (normally 0) */ - u_short rmp_version; /* protocol version (RMP_VERSION) */ - char rmp_machtype[RMP_MACHLEN]; /* machine type */ - u_char rmp_flnmsize; /* length of rmp_flnm */ + u_int8_t rmp_type; /* packet type (RMP_BOOT_REQ) */ + u_int8_t rmp_retcode; /* return code (0) */ + u_word rmp_seqno; /* sequence number (real time clock) */ + u_int16_t rmp_session; /* session id (normally 0) */ + u_int16_t rmp_version; /* protocol version (RMP_VERSION) */ + char rmp_machtype[RMP_MACHLEN]; /* machine type */ + u_int8_t rmp_flnmsize; /* length of rmp_flnm */ restofpkt rmp_flnm; /* name of file to be read */ }; struct rmp_boot_repl { /* boot reply */ - u_char rmp_type; /* packet type (RMP_BOOT_REPL) */ - u_char rmp_retcode; /* return code (normally 0) */ - u_word rmp_seqno; /* sequence number (from boot req) */ - u_short rmp_session; /* session id (generated) */ - u_short rmp_version; /* protocol version (RMP_VERSION) */ - u_char rmp_flnmsize; /* length of rmp_flnm */ + u_int8_t rmp_type; /* packet type (RMP_BOOT_REPL) */ + u_int8_t rmp_retcode; /* return code (normally 0) */ + u_word rmp_seqno; /* sequence number (from boot req) */ + u_int16_t rmp_session; /* session id (generated) */ + u_int16_t rmp_version; /* protocol version (RMP_VERSION) */ + u_int8_t rmp_flnmsize; /* length of rmp_flnm */ restofpkt rmp_flnm; /* name of file (from boot req) */ }; struct rmp_read_req { /* read request */ - u_char rmp_type; /* packet type (RMP_READ_REQ) */ - u_char rmp_retcode; /* return code (0) */ - u_word rmp_offset; /* file relative byte offset */ - u_short rmp_session; /* session id (from boot repl) */ - u_short rmp_size; /* max no of bytes to send */ + u_int8_t rmp_type; /* packet type (RMP_READ_REQ) */ + u_int8_t rmp_retcode; /* return code (0) */ + u_word rmp_offset; /* file relative byte offset */ + u_int16_t rmp_session; /* session id (from boot repl) */ + u_int16_t rmp_size; /* max no of bytes to send */ }; struct rmp_read_repl { /* read reply */ - u_char rmp_type; /* packet type (RMP_READ_REPL) */ - u_char rmp_retcode; /* return code (normally 0) */ - u_word rmp_offset; /* byte offset (from read req) */ - u_short rmp_session; /* session id (from read req) */ + u_int8_t rmp_type; /* packet type (RMP_READ_REPL) */ + u_int8_t rmp_retcode; /* return code (normally 0) */ + u_word rmp_offset; /* byte offset (from read req) */ + u_int16_t rmp_session; /* session id (from read req) */ restofpkt rmp_data; /* data (max size from read req) */ - u_char rmp_unused; /* padding to 16-bit boundary */ + u_int8_t rmp_unused; /* padding to 16-bit boundary */ }; struct rmp_boot_done { /* boot complete */ - u_char rmp_type; /* packet type (RMP_BOOT_DONE) */ - u_char rmp_retcode; /* return code (0) */ - u_word rmp_unused; /* not used (0) */ - u_short rmp_session; /* session id (from read repl) */ + u_int8_t rmp_type; /* packet type (RMP_BOOT_DONE) */ + u_int8_t rmp_retcode; /* return code (0) */ + u_word rmp_unused; /* not used (0) */ + u_int16_t rmp_session; /* session id (from read repl) */ }; struct rmp_packet { @@ -236,7 +236,7 @@ struct rmp_packet { */ #define r_type rmp_proto.rmp_raw.rmp_type -#define r_data rmp_proto.rmp_raw.rmp_data +#define r_data rmp_proto.rmp_raw.rmp_rawdata #define r_brq rmp_proto.rmp_brq #define r_brpl rmp_proto.rmp_brpl #define r_rrq rmp_proto.rmp_rrq diff --git a/libexec/rbootd/rmpproto.c b/libexec/rbootd/rmpproto.c index 204e1aad6844..c80995895b83 100644 --- a/libexec/rbootd/rmpproto.c +++ b/libexec/rbootd/rmpproto.c @@ -38,7 +38,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)rmpproto.c 8.1 (Berkeley) 6/4/93 + * from: @(#)rmpproto.c 8.1 (Berkeley) 6/4/93 * * From: Utah Hdr: rmpproto.c 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS @@ -46,10 +46,10 @@ #ifndef lint #if 0 -static char sccsid[] = "@(#)rmpproto.c 8.1 (Berkeley) 6/4/93"; +static const char sccsid[] = "@(#)rmpproto.c 8.1 (Berkeley) 6/4/93"; #endif static const char rcsid[] = - "$Id$"; + "$Id: rmpproto.c,v 1.1.1.1.8.1 1997/12/16 07:17:51 charnier Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -115,7 +115,7 @@ ProcessPacket(rconn, client) * of active connections, otherwise delete it since * an error was encountered. */ - if (rmp->r_brq.rmp_session == RMP_PROBESID) { + if (ntohs(rmp->r_brq.rmp_session) == RMP_PROBESID) { if (WORDZE(rmp->r_brq.rmp_seqno)) (void) SendServerID(rconnout); else @@ -179,9 +179,9 @@ int SendServerID(rconn) RMPCONN *rconn; { - register struct rmp_packet *rpl; - register char *src, *dst; - register u_char *size; + struct rmp_packet *rpl; + char *src, *dst; + u_int8_t *size; rpl = &rconn->rmp; /* cache ptr to RMP packet */ @@ -192,7 +192,7 @@ SendServerID(rconn) rpl->r_brpl.rmp_retcode = RMP_E_OKAY; ZEROWORD(rpl->r_brpl.rmp_seqno); rpl->r_brpl.rmp_session = 0; - rpl->r_brpl.rmp_version = RMP_VERSION; + rpl->r_brpl.rmp_version = htons(RMP_VERSION); size = &rpl->r_brpl.rmp_flnmsize; /* ptr to length of host name */ @@ -233,9 +233,10 @@ SendFileNo(req, rconn, filelist) RMPCONN *rconn; char *filelist[]; { - register struct rmp_packet *rpl; - register char *src, *dst; - register u_char *size, i; + struct rmp_packet *rpl; + char *src, *dst; + u_int8_t *size; + int i; GETWORD(req->r_brpl.rmp_seqno, i); /* SeqNo is really FileNo */ rpl = &rconn->rmp; /* cache ptr to RMP packet */ @@ -247,7 +248,7 @@ SendFileNo(req, rconn, filelist) PUTWORD(i, rpl->r_brpl.rmp_seqno); i--; rpl->r_brpl.rmp_session = 0; - rpl->r_brpl.rmp_version = RMP_VERSION; + rpl->r_brpl.rmp_version = htons(RMP_VERSION); size = &rpl->r_brpl.rmp_flnmsize; /* ptr to length of filename */ *size = 0; /* init length to zero */ @@ -298,9 +299,9 @@ SendBootRepl(req, rconn, filelist) int retval; char *filename, filepath[RMPBOOTDATA+1]; RMPCONN *oldconn; - register struct rmp_packet *rpl; - register char *src, *dst1, *dst2; - register u_char i; + struct rmp_packet *rpl; + char *src, *dst1, *dst2; + u_int8_t i; /* * If another connection already exists, delete it since we @@ -319,8 +320,8 @@ SendBootRepl(req, rconn, filelist) */ rpl->r_brpl.rmp_type = RMP_BOOT_REPL; COPYWORD(req->r_brq.rmp_seqno, rpl->r_brpl.rmp_seqno); - rpl->r_brpl.rmp_session = GenSessID(); - rpl->r_brpl.rmp_version = RMP_VERSION; + rpl->r_brpl.rmp_session = htons(GenSessID()); + rpl->r_brpl.rmp_version = htons(RMP_VERSION); rpl->r_brpl.rmp_flnmsize = req->r_brq.rmp_flnmsize; /* @@ -341,7 +342,7 @@ SendBootRepl(req, rconn, filelist) * stripped file name and spoof the client into thinking that it * really got what it wanted. */ - filename = (filename = rindex(filepath,'/'))? ++filename: filepath; + filename = (filename = strrchr(filepath,'/'))? ++filename: filepath; /* * Check that this is a valid boot file name. @@ -402,10 +403,10 @@ int SendReadRepl(rconn) RMPCONN *rconn; { - int retval; + int retval = 0; RMPCONN *oldconn; - register struct rmp_packet *rpl, *req; - register int size = 0; + struct rmp_packet *rpl, *req; + int size = 0; int madeconn = 0; /* @@ -432,9 +433,9 @@ SendReadRepl(rconn) /* * Make sure Session ID's match. */ - if (req->r_rrq.rmp_session != - ((rpl->r_type == RMP_BOOT_REPL)? rpl->r_brpl.rmp_session: - rpl->r_rrpl.rmp_session)) { + if (ntohs(req->r_rrq.rmp_session) != + ((rpl->r_type == RMP_BOOT_REPL)? ntohs(rpl->r_brpl.rmp_session): + ntohs(rpl->r_rrpl.rmp_session))) { syslog(LOG_ERR, "SendReadRepl: bad session id (%s)", EnetStr(rconn)); rpl->r_rrpl.rmp_retcode = RMP_E_BADSID; @@ -450,8 +451,8 @@ SendReadRepl(rconn) * to work. This is necessary for bpfwrite() on machines * with MCLBYTES less than 1514. */ - if (req->r_rrq.rmp_size > RMPREADDATA) - req->r_rrq.rmp_size = RMPREADDATA; + if (ntohs(req->r_rrq.rmp_size) > RMPREADDATA) + req->r_rrq.rmp_size = htons(RMPREADDATA); /* * Position read head on file according to info in request packet. @@ -469,7 +470,7 @@ SendReadRepl(rconn) * Read data directly into reply packet. */ if ((size = read(oldconn->bootfd, &rpl->r_rrpl.rmp_data, - (int) req->r_rrq.rmp_size)) <= 0) { + (int) ntohs(req->r_rrq.rmp_size))) <= 0) { if (size < 0) { syslog(LOG_ERR, "SendReadRepl: read: %m (%s)", EnetStr(rconn)); @@ -537,9 +538,9 @@ BootDone(rconn) /* * Make sure Session ID's match. */ - if (rconn->rmp.r_rrq.rmp_session != - ((rpl->r_type == RMP_BOOT_REPL)? rpl->r_brpl.rmp_session: - rpl->r_rrpl.rmp_session)) { + if (ntohs(rconn->rmp.r_rrq.rmp_session) != + ((rpl->r_type == RMP_BOOT_REPL)? ntohs(rpl->r_brpl.rmp_session): + ntohs(rpl->r_rrpl.rmp_session))) { syslog(LOG_ERR, "BootDone: bad session id (%s)", EnetStr(rconn)); return(0); @@ -566,21 +567,26 @@ BootDone(rconn) */ int SendPacket(rconn) - register RMPCONN *rconn; + RMPCONN *rconn; { /* * Set Ethernet Destination address to Source (BPF and the enet * driver will take care of getting our source address set). */ - bcopy((char *)&rconn->rmp.hp_hdr.saddr[0], - (char *)&rconn->rmp.hp_hdr.daddr[0], RMP_ADDRLEN); + memmove((char *)&rconn->rmp.hp_hdr.daddr[0], + (char *)&rconn->rmp.hp_hdr.saddr[0], RMP_ADDRLEN); +#ifdef __FreeBSD__ + /* BPF (incorrectly) wants this in host order. */ rconn->rmp.hp_hdr.len = rconn->rmplen - sizeof(struct hp_hdr); +#else + rconn->rmp.hp_hdr.len = htons(rconn->rmplen - sizeof(struct hp_hdr)); +#endif /* * Reverse 802.2/HP Extended Source & Destination Access Pts. */ - rconn->rmp.hp_llc.dxsap = HPEXT_SXSAP; - rconn->rmp.hp_llc.sxsap = HPEXT_DXSAP; + rconn->rmp.hp_llc.dxsap = htons(HPEXT_SXSAP); + rconn->rmp.hp_llc.sxsap = htons(HPEXT_DXSAP); /* * Last time this connection was active. diff --git a/libexec/rbootd/utils.c b/libexec/rbootd/utils.c index 87ca5e257333..e0921952d2cd 100644 --- a/libexec/rbootd/utils.c +++ b/libexec/rbootd/utils.c @@ -38,7 +38,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)utils.c 8.2 (Berkeley) 2/22/94 + * from: @(#)utils.c 8.1 (Berkeley) 6/4/93 * * From: Utah Hdr: utils.c 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS @@ -46,10 +46,10 @@ #ifndef lint #if 0 -static char sccsid[] = "@(#)utils.c 8.2 (Berkeley) 2/22/94"; +static const char sccsid[] = "@(#)utils.c 8.1 (Berkeley) 6/4/93"; #endif static const char rcsid[] = - "$Id$"; + "$Id: utils.c,v 1.1.1.1.8.1 1997/12/16 07:17:53 charnier Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -87,9 +87,9 @@ DispPkt(rconn, direct) static char ReadFmt[] = "\t\tRetCode:%u Offset:%lx SessID:%x\n"; struct tm *tmp; - register struct rmp_packet *rmp; + struct rmp_packet *rmp; int i, omask; - u_int t; + u_int32_t t; /* * Since we will be working with RmpConns as well as DbgFp, we @@ -117,11 +117,11 @@ DispPkt(rconn, direct) /* display IEEE 802.2 Logical Link Control header */ (void) fprintf(DbgFp, "\t802.2 LLC: DSAP:%x SSAP:%x CTRL:%x\n", - rmp->hp_llc.dsap, rmp->hp_llc.ssap, rmp->hp_llc.cntrl); + rmp->hp_llc.dsap, rmp->hp_llc.ssap, ntohs(rmp->hp_llc.cntrl)); /* display HP extensions to 802.2 Logical Link Control header */ (void) fprintf(DbgFp, "\tHP Ext: DXSAP:%x SXSAP:%x\n", - rmp->hp_llc.dxsap, rmp->hp_llc.sxsap); + ntohs(rmp->hp_llc.dxsap), ntohs(rmp->hp_llc.sxsap)); /* * Display information about RMP packet using type field to @@ -131,7 +131,7 @@ DispPkt(rconn, direct) case RMP_BOOT_REQ: /* boot request */ (void) fprintf(DbgFp, "\tBoot Request:"); GETWORD(rmp->r_brq.rmp_seqno, t); - if (rmp->r_brq.rmp_session == RMP_PROBESID) { + if (ntohs(rmp->r_brq.rmp_session) == RMP_PROBESID) { if (WORDZE(rmp->r_brq.rmp_seqno)) fputs(" (Send Server ID)", DbgFp); else @@ -139,8 +139,8 @@ DispPkt(rconn, direct) } (void) fputc('\n', DbgFp); (void) fprintf(DbgFp, BootFmt, rmp->r_brq.rmp_retcode, - t, rmp->r_brq.rmp_session, - rmp->r_brq.rmp_version); + t, ntohs(rmp->r_brq.rmp_session), + ntohs(rmp->r_brq.rmp_version)); (void) fprintf(DbgFp, "\n\t\tMachine Type: "); for (i = 0; i < RMP_MACHLEN; i++) (void) fputc(rmp->r_brq.rmp_machtype[i], DbgFp); @@ -150,23 +150,23 @@ DispPkt(rconn, direct) fprintf(DbgFp, "\tBoot Reply:\n"); GETWORD(rmp->r_brpl.rmp_seqno, t); (void) fprintf(DbgFp, BootFmt, rmp->r_brpl.rmp_retcode, - t, rmp->r_brpl.rmp_session, - rmp->r_brpl.rmp_version); + t, ntohs(rmp->r_brpl.rmp_session), + ntohs(rmp->r_brpl.rmp_version)); DspFlnm(rmp->r_brpl.rmp_flnmsize,&rmp->r_brpl.rmp_flnm); break; case RMP_READ_REQ: /* read request */ (void) fprintf(DbgFp, "\tRead Request:\n"); GETWORD(rmp->r_rrq.rmp_offset, t); (void) fprintf(DbgFp, ReadFmt, rmp->r_rrq.rmp_retcode, - t, rmp->r_rrq.rmp_session); + t, ntohs(rmp->r_rrq.rmp_session)); (void) fprintf(DbgFp, "\t\tNoOfBytes: %u\n", - rmp->r_rrq.rmp_size); + ntohs(rmp->r_rrq.rmp_size)); break; case RMP_READ_REPL: /* read reply */ (void) fprintf(DbgFp, "\tRead Reply:\n"); GETWORD(rmp->r_rrpl.rmp_offset, t); (void) fprintf(DbgFp, ReadFmt, rmp->r_rrpl.rmp_retcode, - t, rmp->r_rrpl.rmp_session); + t, ntohs(rmp->r_rrpl.rmp_session)); (void) fprintf(DbgFp, "\t\tNoOfBytesSent: %d\n", rconn->rmplen - RMPREADSIZE(0)); break; @@ -174,7 +174,7 @@ DispPkt(rconn, direct) (void) fprintf(DbgFp, "\tBoot Complete:\n"); (void) fprintf(DbgFp, "\t\tRetCode:%u SessID:%x\n", rmp->r_done.rmp_retcode, - rmp->r_done.rmp_session); + ntohs(rmp->r_done.rmp_session)); break; default: /* ??? */ (void) fprintf(DbgFp, "\tUnknown Type:(%d)\n", @@ -206,32 +206,30 @@ DispPkt(rconn, direct) ** Warnings: ** - The return value points to a static buffer; it must ** be copied if it's to be saved. -** - For speed, we assume a u_char consists of 8 bits. */ char * GetEtherAddr(addr) - u_char *addr; + u_int8_t *addr; { static char Hex[] = "0123456789abcdef"; static char etherstr[RMP_ADDRLEN*3]; - register int i; - register char *cp1, *cp2; + int i; + char *cp; /* * For each byte in `addr', convert it to "<hexchar><hexchar>:". * The last byte does not get a trailing `:' appended. */ i = 0; - cp1 = (char *)addr; - cp2 = etherstr; + cp = etherstr; for(;;) { - *cp2++ = Hex[*cp1 >> 4 & 0xf]; - *cp2++ = Hex[*cp1++ & 0xf]; + *cp++ = Hex[*addr >> 4 & 0xf]; + *cp++ = Hex[*addr++ & 0xf]; if (++i == RMP_ADDRLEN) break; - *cp2++ = ':'; + *cp++ = ':'; } - *cp2 = '\0'; + *cp = '\0'; return(etherstr); } @@ -252,12 +250,12 @@ GetEtherAddr(addr) */ void DspFlnm(size, flnm) - register u_int size; - register char *flnm; + u_int size; + char *flnm; { - register int i; + int i; - (void) fprintf(DbgFp, "\n\t\tFile Name (%d): <", size); + (void) fprintf(DbgFp, "\n\t\tFile Name (%u): <", size); for (i = 0; i < size; i++) (void) fputc(*flnm++, DbgFp); (void) fputs(">\n", DbgFp); @@ -279,7 +277,7 @@ DspFlnm(size, flnm) */ CLIENT * NewClient(addr) - u_char *addr; + u_int8_t *addr; { CLIENT *ctmp; @@ -289,8 +287,8 @@ NewClient(addr) return(NULL); } - bzero(ctmp, sizeof(CLIENT)); - bcopy(addr, &ctmp->addr[0], RMP_ADDRLEN); + memset(ctmp, 0, sizeof(CLIENT)); + memmove(&ctmp->addr[0], addr, RMP_ADDRLEN); return(ctmp); } @@ -313,7 +311,7 @@ NewClient(addr) void FreeClients() { - register CLIENT *ctmp; + CLIENT *ctmp; while (Clients != NULL) { ctmp = Clients; @@ -391,7 +389,7 @@ NewConn(rconn) * Copy template into `rtmp', init file descriptor to `-1' and * set ptr to next elem NULL. */ - bcopy((char *)rconn, (char *)rtmp, sizeof(RMPCONN)); + memmove((char *)rtmp, (char *)rconn, sizeof(RMPCONN)); rtmp->bootfd = -1; rtmp->next = NULL; @@ -413,7 +411,7 @@ NewConn(rconn) */ void FreeConn(rtmp) - register RMPCONN *rtmp; + RMPCONN *rtmp; { /* * If the file descriptor is in use, close the file. @@ -449,7 +447,7 @@ FreeConn(rtmp) void FreeConns() { - register RMPCONN *rtmp; + RMPCONN *rtmp; while (RmpConns != NULL) { rtmp = RmpConns; @@ -480,7 +478,7 @@ FreeConns() */ void AddConn(rconn) - register RMPCONN *rconn; + RMPCONN *rconn; { if (RmpConns != NULL) rconn->next = RmpConns; @@ -508,9 +506,9 @@ AddConn(rconn) */ RMPCONN * FindConn(rconn) - register RMPCONN *rconn; + RMPCONN *rconn; { - register RMPCONN *rtmp; + RMPCONN *rtmp; for (rtmp = RmpConns; rtmp != NULL; rtmp = rtmp->next) if (bcmp((char *)&rconn->rmp.hp_hdr.saddr[0], @@ -538,9 +536,9 @@ FindConn(rconn) */ void RemoveConn(rconn) - register RMPCONN *rconn; + RMPCONN *rconn; { - register RMPCONN *thisrconn, *lastrconn; + RMPCONN *thisrconn, *lastrconn; if (RmpConns == rconn) { /* easy case */ RmpConns = RmpConns->next; |
