home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
bootpd-2.zip
/
PATCHES.OS2
< prev
next >
Wrap
Text File
|
1995-09-04
|
16KB
|
572 lines
diff -cb orig/bootpd.c new/bootpd.c
*** orig/bootpd.c Mon Sep 04 00:09:58 1995
--- new/bootpd.c Mon Sep 04 00:42:46 1995
***************
*** 216,221 ****
--- 216,232 ----
struct sigaction sa;
#endif
+ #ifdef __EMX__
+ static char bootptab_file[256];
+ char *etc = getenv("ETC");
+ if (etc != NULL)
+ {
+ strcpy(bootptab_file, etc);
+ strcat(bootptab_file, "\\bootptab");
+ bootptab = bootptab_file;
+ }
+ #endif
+
progname = strrchr(argv[0], '/');
if (progname) progname++;
else progname = argv[0];
***************
*** 253,258 ****
--- 264,270 ----
bzero((char *) &bind_addr, ba_len);
errno = 0;
standalone = TRUE;
+ #ifndef __EMX__
if (getsockname(s, (struct sockaddr *) &bind_addr, &ba_len) == 0) {
/*
* Descriptor 0 is a socket. Assume we are a child of inetd.
***************
*** 265,270 ****
--- 277,283 ----
report(LOG_ERR, "getsockname: not an INET socket");
}
}
+ #endif
/*
* Set defaults that might be changed by option switches.
***************
*** 341,346 ****
--- 354,360 ----
hostname = stmp;
break;
+ #ifndef __EMX__
case 'i': /* inetd mode */
standalone = FALSE;
break;
***************
*** 348,353 ****
--- 362,368 ----
case 's': /* standalone mode */
standalone = TRUE;
break;
+ #endif
case 't': /* timeout */
if (argv[0][2]) {
***************
*** 400,405 ****
--- 415,421 ----
}
bcopy(hep->h_addr, (char *)&my_ip_addr, sizeof(my_ip_addr));
+ #ifndef __EMX__
if (standalone) {
/*
* Go into background and disassociate from controlling terminal.
***************
*** 428,433 ****
--- 444,450 ----
timeout = NULL;
} /* if standalone (1st) */
+ #endif
/* Set the cwd (i.e. to /tftpboot) */
if (chdir_path) {
***************
*** 459,465 ****
/*
* Get server's listening port number
*/
! servp = getservbyname("bootps", "udp");
if (servp) {
bootps_port = ntohs((u_short) servp->s_port);
} else {
--- 476,482 ----
/*
* Get server's listening port number
*/
! servp = getservbyname("sbootp", "udp");
if (servp) {
bootps_port = ntohs((u_short) servp->s_port);
} else {
***************
*** 486,492 ****
/*
* Get destination port number so we can reply to client
*/
! servp = getservbyname("bootpc", "udp");
if (servp) {
bootpc_port = ntohs(servp->s_port);
} else {
--- 503,509 ----
/*
* Get destination port number so we can reply to client
*/
! servp = getservbyname("cbootp", "udp");
if (servp) {
bootpc_port = ntohs(servp->s_port);
} else {
***************
*** 615,622 ****
--- 632,641 ----
"usage: bootpd [-d level] [-i] [-s] [-t timeout] [configfile [dumpfile]]\n");
fprintf(stderr, "\t -c n\tset current directory\n");
fprintf(stderr, "\t -d n\tset debug level\n");
+ #ifndef __EMX__
fprintf(stderr, "\t -i\tforce inetd mode (run as child of inetd)\n");
fprintf(stderr, "\t -s\tforce standalone mode (run without inetd)\n");
+ #endif
fprintf(stderr, "\t -t n\tset inetd exit timeout to n minutes\n");
exit(1);
}
diff -cb orig/bootpef.c new/bootpef.c
*** orig/bootpef.c Wed Feb 15 22:00:48 1995
--- new/bootpef.c Mon Sep 04 01:08:08 1995
***************
*** 142,147 ****
--- 142,158 ----
char *stmp;
int n;
+ #ifdef __EMX__
+ static char bootptab_file[256];
+ char *etc = getenv("ETC");
+ if (etc != NULL)
+ {
+ strcpy(bootptab_file, etc);
+ strcat(bootptab_file, "\\bootptab");
+ bootptab = bootptab_file;
+ }
+ #endif
+
progname = strrchr(argv[0], '/');
if (progname) progname++;
else progname = argv[0];
diff -cb orig/bootpgw.c new/bootpgw.c
*** orig/bootpgw.c Wed Feb 15 23:36:38 1995
--- new/bootpgw.c Mon Sep 04 01:09:20 1995
***************
*** 204,209 ****
--- 204,210 ----
bzero((char *) &bind_addr, ba_len);
errno = 0;
standalone = TRUE;
+ #ifndef __EMX__
if (getsockname(s, (struct sockaddr *) &bind_addr, &ba_len) == 0) {
/*
* Descriptor 0 is a socket. Assume we are a child of inetd.
***************
*** 216,221 ****
--- 217,223 ----
report(LOG_INFO, "getsockname: not an INET socket");
}
}
+ #endif
/*
* Set defaults that might be changed by option switches.
*/
***************
*** 284,289 ****
--- 286,292 ----
maxhops = (u_int)n;
break;
+ #ifndef __EMX__
case 'i': /* inetd mode */
standalone = FALSE;
break;
***************
*** 291,296 ****
--- 294,300 ----
case 's': /* standalone mode */
standalone = TRUE;
break;
+ #endif
case 't': /* timeout */
if (argv[0][2]) {
***************
*** 366,371 ****
--- 370,376 ----
* Go into background and disassociate from controlling terminal.
* XXX - This is not the POSIX way (Should use setsid). -gwr
*/
+ #ifndef __EMX__
if (debug < 3) {
if (fork())
exit(0);
***************
*** 383,388 ****
--- 388,394 ----
perror("setsid");
#endif /* SETSID */
} /* if debug < 3 */
+ #endif
/*
* Nuke any timeout value
*/
***************
*** 406,412 ****
/*
* Get server's listening port number
*/
! servp = getservbyname("bootps", "udp");
if (servp) {
bootps_port = ntohs((u_short) servp->s_port);
} else {
--- 412,418 ----
/*
* Get server's listening port number
*/
! servp = getservbyname("sbootp", "udp");
if (servp) {
bootps_port = ntohs((u_short) servp->s_port);
} else {
***************
*** 432,438 ****
/*
* Get destination port number so we can reply to client
*/
! servp = getservbyname("bootpc", "udp");
if (servp) {
bootpc_port = ntohs(servp->s_port);
} else {
--- 438,444 ----
/*
* Get destination port number so we can reply to client
*/
! servp = getservbyname("cbootp", "udp");
if (servp) {
bootpc_port = ntohs(servp->s_port);
} else {
***************
*** 510,517 ****
--- 516,525 ----
"usage: bootpgw [-d level] [-i] [-s] [-t timeout] server\n");
fprintf(stderr, "\t -d n\tset debug level\n");
fprintf(stderr, "\t -h n\tset max hop count\n");
+ #ifndef __EMX__
fprintf(stderr, "\t -i\tforce inetd mode (run as child of inetd)\n");
fprintf(stderr, "\t -s\tforce standalone mode (run without inetd)\n");
+ #endif
fprintf(stderr, "\t -t n\tset inetd exit timeout to n minutes\n");
fprintf(stderr, "\t -w n\tset min wait time (secs)\n");
exit(1);
diff -cb orig/bootptest.c new/bootptest.c
*** orig/bootptest.c Mon Sep 04 00:09:58 1995
--- new/bootptest.c Mon Sep 04 01:06:42 1995
***************
*** 244,250 ****
/*
* Get server's listening port number
*/
! sep = getservbyname("bootps", "udp");
if (sep) {
bootps_port = ntohs((u_short) sep->s_port);
} else {
--- 244,250 ----
/*
* Get server's listening port number
*/
! sep = getservbyname("sbootp", "udp");
if (sep) {
bootps_port = ntohs((u_short) sep->s_port);
} else {
***************
*** 279,285 ****
/*
* Get client's listening port number
*/
! sep = getservbyname("bootpc", "udp");
if (sep) {
bootpc_port = ntohs(sep->s_port);
} else {
--- 279,285 ----
/*
* Get client's listening port number
*/
! sep = getservbyname("cbootp", "udp");
if (sep) {
bootpc_port = ntohs(sep->s_port);
} else {
diff -cb orig/Makefile new/Makefile
*** orig/Makefile Mon Sep 04 00:09:58 1995
--- new/Makefile Mon Sep 04 01:04:52 1995
***************
*** 10,16 ****
# Remove the -DVEND_CMU if you don't wish to support the "CMU vendor format"
# in addition to the RFC1048 format. Leaving out DEBUG saves little.
# Remove the -DDHCP if you don't need DHCP support.
! OPTDEFS= -DSYSLOG -DVEND_CMU -DDHCP -DDEBUG
# Uncomment and edit this to choose the facility code used for syslog.
# LOG_FACILITY= "-DLOG_BOOTP=LOG_LOCAL2"
--- 10,16 ----
# Remove the -DVEND_CMU if you don't wish to support the "CMU vendor format"
# in addition to the RFC1048 format. Leaving out DEBUG saves little.
# Remove the -DDHCP if you don't need DHCP support.
! OPTDEFS= -DVEND_CMU -DDHCP -DDEBUG
# Uncomment and edit this to choose the facility code used for syslog.
# LOG_FACILITY= "-DLOG_BOOTP=LOG_LOCAL2"
***************
*** 23,29 ****
# SYSLIBS= -lsocket -lnsl
# Uncomment this if your system does not provide streror(3)
! # STRERROR=strerror.o
# FILE DEFinitions:
# The next few lines may be uncommented and changed to alter the default
--- 23,29 ----
# SYSLIBS= -lsocket -lnsl
# Uncomment this if your system does not provide streror(3)
! # STRERROR=strerror$O
# FILE DEFinitions:
# The next few lines may be uncommented and changed to alter the default
***************
*** 42,49 ****
MANDIR=/usr/local/man
CFLAGS= $(OPTDEFS) $(SYSDEFS) $(FILEDEFS) $(MOREDEFS)
! PROGS= bootpd bootpef bootpgw bootptest
! TESTS= trylook trygetif trygetea
all: $(PROGS) $(TESTS)
--- 42,52 ----
MANDIR=/usr/local/man
CFLAGS= $(OPTDEFS) $(SYSDEFS) $(FILEDEFS) $(MOREDEFS)
! PROGS= bootpd$X bootpef$X bootpgw$X bootptest$X
! TESTS= trylook$X trygetif$X trygetea$X
!
! X=
! O=.o
all: $(PROGS) $(TESTS)
***************
*** 68,74 ****
done
clean:
! -rm -f core *.o
-rm -f $(PROGS) $(TESTS)
distclean:
--- 71,77 ----
done
clean:
! -rm -f core *$O
-rm -f $(PROGS) $(TESTS)
distclean:
***************
*** 82,94 ****
# DEC/OSF1 on the Alpha
alpha:
$(MAKE) SYSDEFS="-DETC_ETHERS -Dint32=int -D_SOCKADDR_LEN" \
! STRERROR=strerror.o
# Control Data EP/IX 1.4.3 system, BSD 4.3 mode
epix143:
$(MAKE) CC="cc -systype bsd43" \
SYSDEFS="-Dconst= -D_SIZE_T -DNO_UNISTD -DUSE_BFUNCS" \
! STRERROR=strerror.o
# Control Data EP/IX 2.1.1 system, SVR4 mode
epix211:
--- 85,97 ----
# DEC/OSF1 on the Alpha
alpha:
$(MAKE) SYSDEFS="-DETC_ETHERS -Dint32=int -D_SOCKADDR_LEN" \
! STRERROR=strerror$O
# Control Data EP/IX 1.4.3 system, BSD 4.3 mode
epix143:
$(MAKE) CC="cc -systype bsd43" \
SYSDEFS="-Dconst= -D_SIZE_T -DNO_UNISTD -DUSE_BFUNCS" \
! STRERROR=strerror$O
# Control Data EP/IX 2.1.1 system, SVR4 mode
epix211:
***************
*** 114,120 ****
# SunOS 4.X
sunos4:
$(MAKE) SYSDEFS="-DSUNOS -DETC_ETHERS" \
! STRERROR=strerror.o
# Solaris 2.X (i.e. SunOS 5.X)
sunos5:
--- 117,123 ----
# SunOS 4.X
sunos4:
$(MAKE) SYSDEFS="-DSUNOS -DETC_ETHERS" \
! STRERROR=strerror$O
# Solaris 2.X (i.e. SunOS 5.X)
sunos5:
***************
*** 142,211 ****
$(MAKE) SYSDEFS="-DSVR4 -DWIN_TCP" \
SYSLIBS="-lsocket -lnsl"
#
# How to build each program:
#
! OBJ_D= bootpd.o dovend.o readfile.o hash.o dumptab.o \
! lookup.o getif.o hwaddr.o tzone.o report.o $(STRERROR)
! bootpd: $(OBJ_D)
$(CC) -o $@ $(OBJ_D) $(SYSLIBS)
! OBJ_EF= bootpef.o dovend.o readfile.o hash.o dumptab.o \
! lookup.o hwaddr.o tzone.o report.o $(STRERROR)
! bootpef: $(OBJ_EF)
$(CC) -o $@ $(OBJ_EF) $(SYSLIBS)
! OBJ_GW= bootpgw.o getif.o hwaddr.o report.o $(STRERROR)
! bootpgw: $(OBJ_GW)
$(CC) -o $@ $(OBJ_GW) $(SYSLIBS)
! OBJ_TEST= bootptest.o print-bootp.o getif.o getether.o \
! report.o $(STRERROR)
! bootptest: $(OBJ_TEST)
$(CC) -o $@ $(OBJ_TEST) $(SYSLIBS)
# This is just for testing the lookup functions.
! TRYLOOK= trylook.o lookup.o report.o $(STRERROR)
! trylook : $(TRYLOOK)
$(CC) -o $@ $(TRYLOOK) $(SYSLIBS)
# This is just for testing getif.
! TRYGETIF= trygetif.o getif.o report.o $(STRERROR)
! trygetif : $(TRYGETIF)
$(CC) -o $@ $(TRYGETIF) $(SYSLIBS)
# This is just for testing getether.
! TRYGETEA= trygetea.o getether.o report.o $(STRERROR)
! trygetea : $(TRYGETEA)
$(CC) -o $@ $(TRYGETEA) $(SYSLIBS)
# This rule just keeps the LOG_BOOTP define localized.
! report.o : report.c
$(CC) $(CFLAGS) $(LOG_FACILITY) -c $<
# Punt SunOS -target noise
! .c.o:
$(CC) $(CFLAGS) -c $<
#
# Header file dependencies:
#
! bootpd.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
! bootpd.o : readfile.h report.h tzone.h patchlevel.h getif.h
! bootpef.o : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
! bootpef.o : readfile.h report.h tzone.h patchlevel.h
! bootpgw.o : bootp.h bptypes.h getif.h hwaddr.h report.h patchlevel.h
! bootptest.o : bootp.h bptypes.h bootptest.h getif.h patchlevel.h
! dovend.o : bootp.h bptypes.h bootpd.h hash.h hwaddr.h report.h dovend.h
! dumptab.o : bootp.h bptypes.h hash.h hwaddr.h report.h patchlevel.h bootpd.h
! getif.o : getif.h report.h
! hash.o : hash.h
! hwaddr.o : bptypes.h hwaddr.h report.h
! lookup.o : bootp.h bptypes.h lookup.h report.h
! print-bootp.o : bootp.h bptypes.h bootptest.h
! readfile.o : bootp.h bptypes.h hash.h hwaddr.h lookup.h readfile.h
! readfile.o : report.h tzone.h bootpd.h
! report.o : report.h
! tzone.o : bptypes.h report.h tzone.h
--- 145,220 ----
$(MAKE) SYSDEFS="-DSVR4 -DWIN_TCP" \
SYSLIBS="-lsocket -lnsl"
+ # emx
+ emx:
+ $(MAKE) CC="gcc -Zomf -O" X=".exe" O=".obj" \
+ MOREDEFS="-I." SYSLIBS="-lsocket -Zcrtdll -Zstack 512"
+
#
# How to build each program:
#
! OBJ_D= bootpd$O dovend$O readfile$O hash$O dumptab$O \
! lookup$O getif$O hwaddr$O tzone$O report$O $(STRERROR)
! bootpd$X: $(OBJ_D)
$(CC) -o $@ $(OBJ_D) $(SYSLIBS)
! OBJ_EF= bootpef$O dovend$O readfile$O hash$O dumptab$O \
! lookup$O hwaddr$O tzone$O report$O $(STRERROR)
! bootpef$X: $(OBJ_EF)
$(CC) -o $@ $(OBJ_EF) $(SYSLIBS)
! OBJ_GW= bootpgw$O getif$O hwaddr$O report$O $(STRERROR)
! bootpgw$X: $(OBJ_GW)
$(CC) -o $@ $(OBJ_GW) $(SYSLIBS)
! OBJ_TEST= bootptest$O print-bootp$O getif$O getether$O \
! report$O $(STRERROR)
! bootptest$X: $(OBJ_TEST)
$(CC) -o $@ $(OBJ_TEST) $(SYSLIBS)
# This is just for testing the lookup functions.
! TRYLOOK= trylook$O lookup$O report$O $(STRERROR)
! trylook$X : $(TRYLOOK)
$(CC) -o $@ $(TRYLOOK) $(SYSLIBS)
# This is just for testing getif.
! TRYGETIF= trygetif$O getif$O report$O $(STRERROR)
! trygetif$X : $(TRYGETIF)
$(CC) -o $@ $(TRYGETIF) $(SYSLIBS)
# This is just for testing getether.
! TRYGETEA= trygetea$O getether$O report$O $(STRERROR)
! trygetea$X : $(TRYGETEA)
$(CC) -o $@ $(TRYGETEA) $(SYSLIBS)
# This rule just keeps the LOG_BOOTP define localized.
! report$O : report.c
$(CC) $(CFLAGS) $(LOG_FACILITY) -c $<
# Punt SunOS -target noise
! .SUFFIXES: .c $O
! .c$O:
$(CC) $(CFLAGS) -c $<
#
# Header file dependencies:
#
! bootpd$O : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
! bootpd$O : readfile.h report.h tzone.h patchlevel.h getif.h
! bootpef$O : bootp.h bptypes.h hash.h hwaddr.h bootpd.h dovend.h
! bootpef$O : readfile.h report.h tzone.h patchlevel.h
! bootpgw$O : bootp.h bptypes.h getif.h hwaddr.h report.h patchlevel.h
! bootptest$O : bootp.h bptypes.h bootptest.h getif.h patchlevel.h
! dovend$O : bootp.h bptypes.h bootpd.h hash.h hwaddr.h report.h dovend.h
! dumptab$O : bootp.h bptypes.h hash.h hwaddr.h report.h patchlevel.h bootpd.h
! getif$O : getif.h report.h
! hash$O : hash.h
! hwaddr$O : bptypes.h hwaddr.h report.h
! lookup$O : bootp.h bptypes.h lookup.h report.h
! print-bootp$O : bootp.h bptypes.h bootptest.h
! readfile$O : bootp.h bptypes.h hash.h hwaddr.h lookup.h readfile.h
! readfile$O : report.h tzone.h bootpd.h
! report$O : report.h
! tzone$O : bptypes.h report.h tzone.h