--- dip-3.3.7p.orig/Makefile +++ dip-3.3.7p/Makefile @@ -38,26 +38,39 @@ # Enable either one only, or none of the following. # If you use SecureID card, enable this: -#SECUREID=-DSECUREID -#SECUREIDLIB= +SECUREID=-DSECUREID +SECUREIDLIB= # If you have SNK-004 card, enable this: #SNK=-DSNK #SNKLIB= SKEYDEF = -DSKEY -#SKEYLIB = -L. -L./skey -L/usr/local/lib -lskey -SKEYLIB = -lskey + +ifdef SKEYDEF +SKEYLIB = -L./skey -lskey +# if you want to build the skey library with shadow password support, +# enable this: +SHADOW = -DSHADOW +endif + CC = gcc # If you wish, add -g flag to the next line -CFLAGS = -DLINUX $(SKEYDEF) $(SECUREID) -pipe -O6 -Wall -m486 +#CFLAGS = -DLINUX $(SKEYDEF) $(SECUREID) -pipe -O6 -Wall -m486 +CFLAGS = -g $(SKEYDEF) $(SECUREID) -pipe -O6 -Wall -DFSSTND \ + -DHAVE_LIBLOCKDEV + +### -I/usr/src/linux/include -LDFLAGS = -Wl,-qmagic +#LDFLAGS = -Wl,-qmagic #LDFLAGS= -Wl,-verbose -Wl,-qmagic #LDFLAGS = -v -s +# to debug libraries, uncomment this +#LDFLAGS = -static + LD = $(CC) #LD = ld @@ -74,7 +87,9 @@ # Object modules. OBJS = main.o config.o daemon.o tty.o attach.o term.o \ - modem.o command.o login.o + modem.o command.o login.o + +LIBS = -llockdev PROTOS = slip.o ppp.o termp.o @@ -87,13 +102,18 @@ -@echo "DIP is built successfully." install: all - -@cp /usr/sbin/dip ./dip- - install -c -o root -g uucp -m 04755 -s dip /usr/sbin - ln -sf /usr/sbin/dip /usr/sbin/diplogin - install -c -m 0444 dip.8 /usr/man/man8 + install -c -o root -g dip -m 04754 -s dip ${BASEDIR}/usr/sbin + ( cd ${BASEDIR}/usr/sbin && ln -sf dip diplogin && ln -sf dip diplogini ) + install -c -o root -g root -m 0644 dip.8 ${BASEDIR}/usr/share/man/man8 + (cd ${BASEDIR}/usr/share/man/man8 && ln -sf dip.8 diplogin.8) + (cd ${BASEDIR}/usr/share/man/man8 && ln -sf dip.8 diplogini.8) -@echo "DIP is installed. Now please install/configure /etc/diphosts." + dip: protocols.a $(OBJS) +ifdef SKEYDEF + (cd skey && make "SHADOW=$(SHADOW)" linux) +endif $(LD) $(LDFLAGS) -o dip $(SYSBOBJS) $(OBJS) protocols.a \ $(SKEYLIB) $(SECUREIDLIB) $(SNKLIB) $(LIBS) $(SYSEOBJS) @@ -101,7 +121,10 @@ ar rcs protocols.a $(PROTOS) clean: - rm -f core *.o *.a +ifdef SKEYDEF + (cd skey && make clean) +endif + rm -f core *.o *.a dip clobber: clean rm -f dip @@ -113,502 +136,3 @@ # End of Makefile. # DO NOT DELETE -attach.o: attach.c dip.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/linux/posix_types.h \ - /usr/include/asm/posix_types.h /usr/include/asm/types.h \ - /usr/include/sys/bitypes.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/stdlib.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \ - /usr/include/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/posix_opt.h /usr/include/gnu/types.h \ - /usr/include/confname.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stdarg.h \ - /usr/include/string.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/fcntl.h /usr/include/linux/fcntl.h \ - /usr/include/asm/fcntl.h /usr/include/termios.h \ - /usr/include/linux/termios.h /usr/include/asm/termios.h \ - /usr/include/asm/termbits.h /usr/include/asm/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/signal.h \ - /usr/include/linux/signal.h /usr/include/asm/signal.h \ - /usr/include/dirent.h /usr/include/linux/limits.h \ - /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/limits.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/syslimits.h \ - /usr/include/limits.h /usr/include/posix2_lim.h /usr/include/ctype.h \ - /usr/include/endian.h /usr/include/bytesex.h /usr/include/pwd.h \ - /usr/include/sys/stat.h /usr/include/linux/stat.h \ - /usr/include/sys/socket.h /usr/include/linux/socket.h \ - /usr/include/asm/socket.h /usr/include/asm/sockios.h \ - /usr/include/linux/sockios.h /usr/include/linux/uio.h \ - /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ - /usr/include/sys/socketio.h /usr/include/sys/time.h \ - /usr/include/linux/time.h /usr/include/time.h \ - /usr/include/arpa/inet.h /usr/include/sys/param.h \ - /usr/include/linux/param.h /usr/include/asm/param.h \ - /usr/include/netinet/in.h /usr/include/linux/in.h \ - /usr/include/asm/byteorder.h /usr/include/arpa/nameser.h \ - /usr/include/netdb.h /usr/include/paths.h /usr/include/resolv.h \ - /usr/include/net/if_arp.h /usr/include/linux/netdevice.h \ - /usr/include/linux/config.h /usr/include/linux/autoconf.h \ - /usr/include/linux/if.h /usr/include/linux/if_ether.h \ - /usr/include/linux/if_arp.h pathnames.h /usr/include/net/if.h \ - /usr/include/linux/route.h -command.o: command.c dip.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/linux/posix_types.h \ - /usr/include/asm/posix_types.h /usr/include/asm/types.h \ - /usr/include/sys/bitypes.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/stdlib.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \ - /usr/include/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/posix_opt.h /usr/include/gnu/types.h \ - /usr/include/confname.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stdarg.h \ - /usr/include/string.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/fcntl.h /usr/include/linux/fcntl.h \ - /usr/include/asm/fcntl.h /usr/include/termios.h \ - /usr/include/linux/termios.h /usr/include/asm/termios.h \ - /usr/include/asm/termbits.h /usr/include/asm/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/signal.h \ - /usr/include/linux/signal.h /usr/include/asm/signal.h \ - /usr/include/dirent.h /usr/include/linux/limits.h \ - /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/limits.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/syslimits.h \ - /usr/include/limits.h /usr/include/posix2_lim.h /usr/include/ctype.h \ - /usr/include/endian.h /usr/include/bytesex.h /usr/include/pwd.h \ - /usr/include/sys/stat.h /usr/include/linux/stat.h \ - /usr/include/sys/socket.h /usr/include/linux/socket.h \ - /usr/include/asm/socket.h /usr/include/asm/sockios.h \ - /usr/include/linux/sockios.h /usr/include/linux/uio.h \ - /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ - /usr/include/sys/socketio.h /usr/include/sys/time.h \ - /usr/include/linux/time.h /usr/include/time.h \ - /usr/include/arpa/inet.h /usr/include/sys/param.h \ - /usr/include/linux/param.h /usr/include/asm/param.h \ - /usr/include/netinet/in.h /usr/include/linux/in.h \ - /usr/include/asm/byteorder.h /usr/include/arpa/nameser.h \ - /usr/include/netdb.h /usr/include/paths.h /usr/include/resolv.h \ - /usr/include/net/if_arp.h /usr/include/linux/netdevice.h \ - /usr/include/linux/config.h /usr/include/linux/autoconf.h \ - /usr/include/linux/if.h /usr/include/linux/if_ether.h \ - /usr/include/linux/if_arp.h pathnames.h /usr/include/linux/ip.h \ - /usr/include/linux/udp.h /usr/include/sys/wait.h \ - /usr/include/waitflags.h /usr/include/linux/wait.h \ - /usr/include/waitstatus.h -config.o: config.c dip.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/linux/posix_types.h \ - /usr/include/asm/posix_types.h /usr/include/asm/types.h \ - /usr/include/sys/bitypes.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/stdlib.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \ - /usr/include/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/posix_opt.h /usr/include/gnu/types.h \ - /usr/include/confname.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stdarg.h \ - /usr/include/string.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/fcntl.h /usr/include/linux/fcntl.h \ - /usr/include/asm/fcntl.h /usr/include/termios.h \ - /usr/include/linux/termios.h /usr/include/asm/termios.h \ - /usr/include/asm/termbits.h /usr/include/asm/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/signal.h \ - /usr/include/linux/signal.h /usr/include/asm/signal.h \ - /usr/include/dirent.h /usr/include/linux/limits.h \ - /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/limits.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/syslimits.h \ - /usr/include/limits.h /usr/include/posix2_lim.h /usr/include/ctype.h \ - /usr/include/endian.h /usr/include/bytesex.h /usr/include/pwd.h \ - /usr/include/sys/stat.h /usr/include/linux/stat.h \ - /usr/include/sys/socket.h /usr/include/linux/socket.h \ - /usr/include/asm/socket.h /usr/include/asm/sockios.h \ - /usr/include/linux/sockios.h /usr/include/linux/uio.h \ - /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ - /usr/include/sys/socketio.h /usr/include/sys/time.h \ - /usr/include/linux/time.h /usr/include/time.h \ - /usr/include/arpa/inet.h /usr/include/sys/param.h \ - /usr/include/linux/param.h /usr/include/asm/param.h \ - /usr/include/netinet/in.h /usr/include/linux/in.h \ - /usr/include/asm/byteorder.h /usr/include/arpa/nameser.h \ - /usr/include/netdb.h /usr/include/paths.h /usr/include/resolv.h \ - /usr/include/net/if_arp.h /usr/include/linux/netdevice.h \ - /usr/include/linux/config.h /usr/include/linux/autoconf.h \ - /usr/include/linux/if.h /usr/include/linux/if_ether.h \ - /usr/include/linux/if_arp.h pathnames.h -daemon.o: daemon.c dip.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/linux/posix_types.h \ - /usr/include/asm/posix_types.h /usr/include/asm/types.h \ - /usr/include/sys/bitypes.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/stdlib.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \ - /usr/include/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/posix_opt.h /usr/include/gnu/types.h \ - /usr/include/confname.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stdarg.h \ - /usr/include/string.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/fcntl.h /usr/include/linux/fcntl.h \ - /usr/include/asm/fcntl.h /usr/include/termios.h \ - /usr/include/linux/termios.h /usr/include/asm/termios.h \ - /usr/include/asm/termbits.h /usr/include/asm/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/signal.h \ - /usr/include/linux/signal.h /usr/include/asm/signal.h \ - /usr/include/dirent.h /usr/include/linux/limits.h \ - /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/limits.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/syslimits.h \ - /usr/include/limits.h /usr/include/posix2_lim.h /usr/include/ctype.h \ - /usr/include/endian.h /usr/include/bytesex.h /usr/include/pwd.h \ - /usr/include/sys/stat.h /usr/include/linux/stat.h \ - /usr/include/sys/socket.h /usr/include/linux/socket.h \ - /usr/include/asm/socket.h /usr/include/asm/sockios.h \ - /usr/include/linux/sockios.h /usr/include/linux/uio.h \ - /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ - /usr/include/sys/socketio.h /usr/include/sys/time.h \ - /usr/include/linux/time.h /usr/include/time.h \ - /usr/include/arpa/inet.h /usr/include/sys/param.h \ - /usr/include/linux/param.h /usr/include/asm/param.h \ - /usr/include/netinet/in.h /usr/include/linux/in.h \ - /usr/include/asm/byteorder.h /usr/include/arpa/nameser.h \ - /usr/include/netdb.h /usr/include/paths.h /usr/include/resolv.h \ - /usr/include/net/if_arp.h /usr/include/linux/netdevice.h \ - /usr/include/linux/config.h /usr/include/linux/autoconf.h \ - /usr/include/linux/if.h /usr/include/linux/if_ether.h \ - /usr/include/linux/if_arp.h pathnames.h -login.o: login.c dip.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/linux/posix_types.h \ - /usr/include/asm/posix_types.h /usr/include/asm/types.h \ - /usr/include/sys/bitypes.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/stdlib.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \ - /usr/include/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/posix_opt.h /usr/include/gnu/types.h \ - /usr/include/confname.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stdarg.h \ - /usr/include/string.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/fcntl.h /usr/include/linux/fcntl.h \ - /usr/include/asm/fcntl.h /usr/include/termios.h \ - /usr/include/linux/termios.h /usr/include/asm/termios.h \ - /usr/include/asm/termbits.h /usr/include/asm/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/signal.h \ - /usr/include/linux/signal.h /usr/include/asm/signal.h \ - /usr/include/dirent.h /usr/include/linux/limits.h \ - /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/limits.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/syslimits.h \ - /usr/include/limits.h /usr/include/posix2_lim.h /usr/include/ctype.h \ - /usr/include/endian.h /usr/include/bytesex.h /usr/include/pwd.h \ - /usr/include/sys/stat.h /usr/include/linux/stat.h \ - /usr/include/sys/socket.h /usr/include/linux/socket.h \ - /usr/include/asm/socket.h /usr/include/asm/sockios.h \ - /usr/include/linux/sockios.h /usr/include/linux/uio.h \ - /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ - /usr/include/sys/socketio.h /usr/include/sys/time.h \ - /usr/include/linux/time.h /usr/include/time.h \ - /usr/include/arpa/inet.h /usr/include/sys/param.h \ - /usr/include/linux/param.h /usr/include/asm/param.h \ - /usr/include/netinet/in.h /usr/include/linux/in.h \ - /usr/include/asm/byteorder.h /usr/include/arpa/nameser.h \ - /usr/include/netdb.h /usr/include/paths.h /usr/include/resolv.h \ - /usr/include/net/if_arp.h /usr/include/linux/netdevice.h \ - /usr/include/linux/config.h /usr/include/linux/autoconf.h \ - /usr/include/linux/if.h /usr/include/linux/if_ether.h \ - /usr/include/linux/if_arp.h pathnames.h -main.o: main.c dip.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/linux/posix_types.h \ - /usr/include/asm/posix_types.h /usr/include/asm/types.h \ - /usr/include/sys/bitypes.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/stdlib.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \ - /usr/include/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/posix_opt.h /usr/include/gnu/types.h \ - /usr/include/confname.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stdarg.h \ - /usr/include/string.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/fcntl.h /usr/include/linux/fcntl.h \ - /usr/include/asm/fcntl.h /usr/include/termios.h \ - /usr/include/linux/termios.h /usr/include/asm/termios.h \ - /usr/include/asm/termbits.h /usr/include/asm/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/signal.h \ - /usr/include/linux/signal.h /usr/include/asm/signal.h \ - /usr/include/dirent.h /usr/include/linux/limits.h \ - /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/limits.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/syslimits.h \ - /usr/include/limits.h /usr/include/posix2_lim.h /usr/include/ctype.h \ - /usr/include/endian.h /usr/include/bytesex.h /usr/include/pwd.h \ - /usr/include/sys/stat.h /usr/include/linux/stat.h \ - /usr/include/sys/socket.h /usr/include/linux/socket.h \ - /usr/include/asm/socket.h /usr/include/asm/sockios.h \ - /usr/include/linux/sockios.h /usr/include/linux/uio.h \ - /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ - /usr/include/sys/socketio.h /usr/include/sys/time.h \ - /usr/include/linux/time.h /usr/include/time.h \ - /usr/include/arpa/inet.h /usr/include/sys/param.h \ - /usr/include/linux/param.h /usr/include/asm/param.h \ - /usr/include/netinet/in.h /usr/include/linux/in.h \ - /usr/include/asm/byteorder.h /usr/include/arpa/nameser.h \ - /usr/include/netdb.h /usr/include/paths.h /usr/include/resolv.h \ - /usr/include/net/if_arp.h /usr/include/linux/netdevice.h \ - /usr/include/linux/config.h /usr/include/linux/autoconf.h \ - /usr/include/linux/if.h /usr/include/linux/if_ether.h \ - /usr/include/linux/if_arp.h pathnames.h -modem.o: modem.c dip.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/linux/posix_types.h \ - /usr/include/asm/posix_types.h /usr/include/asm/types.h \ - /usr/include/sys/bitypes.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/stdlib.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \ - /usr/include/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/posix_opt.h /usr/include/gnu/types.h \ - /usr/include/confname.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stdarg.h \ - /usr/include/string.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/fcntl.h /usr/include/linux/fcntl.h \ - /usr/include/asm/fcntl.h /usr/include/termios.h \ - /usr/include/linux/termios.h /usr/include/asm/termios.h \ - /usr/include/asm/termbits.h /usr/include/asm/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/signal.h \ - /usr/include/linux/signal.h /usr/include/asm/signal.h \ - /usr/include/dirent.h /usr/include/linux/limits.h \ - /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/limits.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/syslimits.h \ - /usr/include/limits.h /usr/include/posix2_lim.h /usr/include/ctype.h \ - /usr/include/endian.h /usr/include/bytesex.h /usr/include/pwd.h \ - /usr/include/sys/stat.h /usr/include/linux/stat.h \ - /usr/include/sys/socket.h /usr/include/linux/socket.h \ - /usr/include/asm/socket.h /usr/include/asm/sockios.h \ - /usr/include/linux/sockios.h /usr/include/linux/uio.h \ - /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ - /usr/include/sys/socketio.h /usr/include/sys/time.h \ - /usr/include/linux/time.h /usr/include/time.h \ - /usr/include/arpa/inet.h /usr/include/sys/param.h \ - /usr/include/linux/param.h /usr/include/asm/param.h \ - /usr/include/netinet/in.h /usr/include/linux/in.h \ - /usr/include/asm/byteorder.h /usr/include/arpa/nameser.h \ - /usr/include/netdb.h /usr/include/paths.h /usr/include/resolv.h \ - /usr/include/net/if_arp.h /usr/include/linux/netdevice.h \ - /usr/include/linux/config.h /usr/include/linux/autoconf.h \ - /usr/include/linux/if.h /usr/include/linux/if_ether.h \ - /usr/include/linux/if_arp.h pathnames.h -ppp.o: ppp.c dip.h /usr/include/sys/types.h /usr/include/linux/types.h \ - /usr/include/linux/posix_types.h /usr/include/asm/posix_types.h \ - /usr/include/asm/types.h /usr/include/sys/bitypes.h \ - /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/stdlib.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \ - /usr/include/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/posix_opt.h /usr/include/gnu/types.h \ - /usr/include/confname.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stdarg.h \ - /usr/include/string.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/fcntl.h /usr/include/linux/fcntl.h \ - /usr/include/asm/fcntl.h /usr/include/termios.h \ - /usr/include/linux/termios.h /usr/include/asm/termios.h \ - /usr/include/asm/termbits.h /usr/include/asm/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/signal.h \ - /usr/include/linux/signal.h /usr/include/asm/signal.h \ - /usr/include/dirent.h /usr/include/linux/limits.h \ - /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/limits.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/syslimits.h \ - /usr/include/limits.h /usr/include/posix2_lim.h /usr/include/ctype.h \ - /usr/include/endian.h /usr/include/bytesex.h /usr/include/pwd.h \ - /usr/include/sys/stat.h /usr/include/linux/stat.h \ - /usr/include/sys/socket.h /usr/include/linux/socket.h \ - /usr/include/asm/socket.h /usr/include/asm/sockios.h \ - /usr/include/linux/sockios.h /usr/include/linux/uio.h \ - /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ - /usr/include/sys/socketio.h /usr/include/sys/time.h \ - /usr/include/linux/time.h /usr/include/time.h \ - /usr/include/arpa/inet.h /usr/include/sys/param.h \ - /usr/include/linux/param.h /usr/include/asm/param.h \ - /usr/include/netinet/in.h /usr/include/linux/in.h \ - /usr/include/asm/byteorder.h /usr/include/arpa/nameser.h \ - /usr/include/netdb.h /usr/include/paths.h /usr/include/resolv.h \ - /usr/include/net/if_arp.h /usr/include/linux/netdevice.h \ - /usr/include/linux/config.h /usr/include/linux/autoconf.h \ - /usr/include/linux/if.h /usr/include/linux/if_ether.h \ - /usr/include/linux/if_arp.h pathnames.h -slip.o: slip.c dip.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/linux/posix_types.h \ - /usr/include/asm/posix_types.h /usr/include/asm/types.h \ - /usr/include/sys/bitypes.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/stdlib.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \ - /usr/include/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/posix_opt.h /usr/include/gnu/types.h \ - /usr/include/confname.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stdarg.h \ - /usr/include/string.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/fcntl.h /usr/include/linux/fcntl.h \ - /usr/include/asm/fcntl.h /usr/include/termios.h \ - /usr/include/linux/termios.h /usr/include/asm/termios.h \ - /usr/include/asm/termbits.h /usr/include/asm/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/signal.h \ - /usr/include/linux/signal.h /usr/include/asm/signal.h \ - /usr/include/dirent.h /usr/include/linux/limits.h \ - /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/limits.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/syslimits.h \ - /usr/include/limits.h /usr/include/posix2_lim.h /usr/include/ctype.h \ - /usr/include/endian.h /usr/include/bytesex.h /usr/include/pwd.h \ - /usr/include/sys/stat.h /usr/include/linux/stat.h \ - /usr/include/sys/socket.h /usr/include/linux/socket.h \ - /usr/include/asm/socket.h /usr/include/asm/sockios.h \ - /usr/include/linux/sockios.h /usr/include/linux/uio.h \ - /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ - /usr/include/sys/socketio.h /usr/include/sys/time.h \ - /usr/include/linux/time.h /usr/include/time.h \ - /usr/include/arpa/inet.h /usr/include/sys/param.h \ - /usr/include/linux/param.h /usr/include/asm/param.h \ - /usr/include/netinet/in.h /usr/include/linux/in.h \ - /usr/include/asm/byteorder.h /usr/include/arpa/nameser.h \ - /usr/include/netdb.h /usr/include/paths.h /usr/include/resolv.h \ - /usr/include/net/if_arp.h /usr/include/linux/netdevice.h \ - /usr/include/linux/config.h /usr/include/linux/autoconf.h \ - /usr/include/linux/if.h /usr/include/linux/if_ether.h \ - /usr/include/linux/if_arp.h pathnames.h -snk.o: snk.c -term.o: term.c dip.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/linux/posix_types.h \ - /usr/include/asm/posix_types.h /usr/include/asm/types.h \ - /usr/include/sys/bitypes.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/stdlib.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \ - /usr/include/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/posix_opt.h /usr/include/gnu/types.h \ - /usr/include/confname.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stdarg.h \ - /usr/include/string.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/fcntl.h /usr/include/linux/fcntl.h \ - /usr/include/asm/fcntl.h /usr/include/termios.h \ - /usr/include/linux/termios.h /usr/include/asm/termios.h \ - /usr/include/asm/termbits.h /usr/include/asm/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/signal.h \ - /usr/include/linux/signal.h /usr/include/asm/signal.h \ - /usr/include/dirent.h /usr/include/linux/limits.h \ - /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/limits.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/syslimits.h \ - /usr/include/limits.h /usr/include/posix2_lim.h /usr/include/ctype.h \ - /usr/include/endian.h /usr/include/bytesex.h /usr/include/pwd.h \ - /usr/include/sys/stat.h /usr/include/linux/stat.h \ - /usr/include/sys/socket.h /usr/include/linux/socket.h \ - /usr/include/asm/socket.h /usr/include/asm/sockios.h \ - /usr/include/linux/sockios.h /usr/include/linux/uio.h \ - /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ - /usr/include/sys/socketio.h /usr/include/sys/time.h \ - /usr/include/linux/time.h /usr/include/time.h \ - /usr/include/arpa/inet.h /usr/include/sys/param.h \ - /usr/include/linux/param.h /usr/include/asm/param.h \ - /usr/include/netinet/in.h /usr/include/linux/in.h \ - /usr/include/asm/byteorder.h /usr/include/arpa/nameser.h \ - /usr/include/netdb.h /usr/include/paths.h /usr/include/resolv.h \ - /usr/include/net/if_arp.h /usr/include/linux/netdevice.h \ - /usr/include/linux/config.h /usr/include/linux/autoconf.h \ - /usr/include/linux/if.h /usr/include/linux/if_ether.h \ - /usr/include/linux/if_arp.h pathnames.h -termp.o: termp.c dip.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/linux/posix_types.h \ - /usr/include/asm/posix_types.h /usr/include/asm/types.h \ - /usr/include/sys/bitypes.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/stdlib.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \ - /usr/include/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/posix_opt.h /usr/include/gnu/types.h \ - /usr/include/confname.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stdarg.h \ - /usr/include/string.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/fcntl.h /usr/include/linux/fcntl.h \ - /usr/include/asm/fcntl.h /usr/include/termios.h \ - /usr/include/linux/termios.h /usr/include/asm/termios.h \ - /usr/include/asm/termbits.h /usr/include/asm/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/signal.h \ - /usr/include/linux/signal.h /usr/include/asm/signal.h \ - /usr/include/dirent.h /usr/include/linux/limits.h \ - /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/limits.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/syslimits.h \ - /usr/include/limits.h /usr/include/posix2_lim.h /usr/include/ctype.h \ - /usr/include/endian.h /usr/include/bytesex.h /usr/include/pwd.h \ - /usr/include/sys/stat.h /usr/include/linux/stat.h \ - /usr/include/sys/socket.h /usr/include/linux/socket.h \ - /usr/include/asm/socket.h /usr/include/asm/sockios.h \ - /usr/include/linux/sockios.h /usr/include/linux/uio.h \ - /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ - /usr/include/sys/socketio.h /usr/include/sys/time.h \ - /usr/include/linux/time.h /usr/include/time.h \ - /usr/include/arpa/inet.h /usr/include/sys/param.h \ - /usr/include/linux/param.h /usr/include/asm/param.h \ - /usr/include/netinet/in.h /usr/include/linux/in.h \ - /usr/include/asm/byteorder.h /usr/include/arpa/nameser.h \ - /usr/include/netdb.h /usr/include/paths.h /usr/include/resolv.h \ - /usr/include/net/if_arp.h /usr/include/linux/netdevice.h \ - /usr/include/linux/config.h /usr/include/linux/autoconf.h \ - /usr/include/linux/if.h /usr/include/linux/if_ether.h \ - /usr/include/linux/if_arp.h pathnames.h -tty.o: tty.c dip.h /usr/include/sys/types.h /usr/include/linux/types.h \ - /usr/include/linux/posix_types.h /usr/include/asm/posix_types.h \ - /usr/include/asm/types.h /usr/include/sys/bitypes.h \ - /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/stdlib.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stddef.h \ - /usr/include/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/posix_opt.h /usr/include/gnu/types.h \ - /usr/include/confname.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/stdarg.h \ - /usr/include/string.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/fcntl.h /usr/include/linux/fcntl.h \ - /usr/include/asm/fcntl.h /usr/include/termios.h \ - /usr/include/linux/termios.h /usr/include/asm/termios.h \ - /usr/include/asm/termbits.h /usr/include/asm/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/signal.h \ - /usr/include/linux/signal.h /usr/include/asm/signal.h \ - /usr/include/dirent.h /usr/include/linux/limits.h \ - /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/limits.h \ - /usr/lib/gcc-lib/i486-linux/2.7.2.1/include/syslimits.h \ - /usr/include/limits.h /usr/include/posix2_lim.h /usr/include/ctype.h \ - /usr/include/endian.h /usr/include/bytesex.h /usr/include/pwd.h \ - /usr/include/sys/stat.h /usr/include/linux/stat.h \ - /usr/include/sys/socket.h /usr/include/linux/socket.h \ - /usr/include/asm/socket.h /usr/include/asm/sockios.h \ - /usr/include/linux/sockios.h /usr/include/linux/uio.h \ - /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ - /usr/include/sys/socketio.h /usr/include/sys/time.h \ - /usr/include/linux/time.h /usr/include/time.h \ - /usr/include/arpa/inet.h /usr/include/sys/param.h \ - /usr/include/linux/param.h /usr/include/asm/param.h \ - /usr/include/netinet/in.h /usr/include/linux/in.h \ - /usr/include/asm/byteorder.h /usr/include/arpa/nameser.h \ - /usr/include/netdb.h /usr/include/paths.h /usr/include/resolv.h \ - /usr/include/net/if_arp.h /usr/include/linux/netdevice.h \ - /usr/include/linux/config.h /usr/include/linux/autoconf.h \ - /usr/include/linux/if.h /usr/include/linux/if_ether.h \ - /usr/include/linux/if_arp.h pathnames.h /usr/include/linux/fs.h \ - /usr/include/linux/linkage.h /usr/include/linux/wait.h \ - /usr/include/linux/vfs.h /usr/include/asm/statfs.h \ - /usr/include/linux/net.h /usr/include/linux/kdev_t.h \ - /usr/include/linux/tty.h /usr/include/linux/serial.h --- dip-3.3.7p.orig/config.c +++ dip-3.3.7p/config.c @@ -22,15 +22,17 @@ #if DIP_SLIP -#define DIP_HAVE_SLIP 1 /* select "SLIP" */ -#define DIP_HAVE_CSLIP 1 /* select "CompressedSLIP" */ -#define DIP_HAVE_SLIP6 1 /* select "SLIP6" */ -#define DIP_HAVE_CLSIP6 1 /* select "CompressedSLIP6" */ -#else -#define DIP_HAVE_SLIP 0 /* no "SLIP" */ -#define DIP_HAVE_CSLIP 0 /* no "CompressedSLIP" */ -#define DIP_HAVE_SLIP6 0 /* no "SLIP6" */ -#define DIP_HAVE_CLSIP6 0 /* no "CompressedSLIP6" */ +# define DIP_HAVE_SLIP 1 /* select "SLIP" */ +# define DIP_HAVE_CSLIP 1 /* select "CompressedSLIP" */ +# define DIP_HAVE_SLIP6 1 /* select "SLIP6" */ +# define DIP_HAVE_CLSIP6 1 /* select "CompressedSLIP6" */ +# define DIP_HAVE_ADAPTIVE 1 /* select "Adaptive SLIP" */ +#else +# define DIP_HAVE_SLIP 0 /* no "SLIP" */ +# define DIP_HAVE_CSLIP 0 /* no "CompressedSLIP" */ +# define DIP_HAVE_SLIP6 0 /* no "SLIP6" */ +# define DIP_HAVE_CLSIP6 0 /* no "CompressedSLIP6" */ +# define DIP_HAVE_ADAPTIVE 0 /* no "Adaptive SLIP" */ #endif @@ -52,6 +54,9 @@ #if (DIP_TERM || DIP_HAVE_TERM) extern void do_termp(struct dip *dip); #endif +#if (DIP_HAVE_ADAPTIVE || DIP_ADAPTIVE) +extern void do_adaptive(struct dip *dip); +#endif struct protosw protosw[] = { @@ -82,6 +87,11 @@ #endif #if (DIP_TERM || DIP_HAVE_TERM) { "TERM", 6, do_termp }, +#else + { (char *)NULL, 0, NULL } +#endif +#if (DIP_HAVE_ADAPTIVE || DIP_ADAPTIVE) + { "AUTO", 7, do_adaptive }, #else { (char *)NULL, 0, NULL } #endif --- dip-3.3.7p.orig/attach.c +++ dip-3.3.7p/attach.c @@ -138,7 +138,14 @@ #include #include #include -#include + +#if !defined(__GLIBC__) +# include +# include +#else +# include +#endif + #include #include @@ -461,7 +468,9 @@ int fw_flg; } fw_rec; -#define MIN(a,b) ((a)<(b)? (a): (b)) +#ifndef MIN +# define MIN(a,b) ((a)<(b)? (a): (b)) +#endif #define SRC(x) ((x)->sa & (x)->sm) #define DST(x) ((x)->da & (x)->dm) --- dip-3.3.7p.orig/dip.8 +++ dip-3.3.7p/dip.8 @@ -1,5 +1,6 @@ -..\" 3/5/95 man page updated by Jim Van Zandt -.TH DIP "8" "3/7/95" "Version 3.3.7o" "Reference" +.\" 3/5/95 man page updated by Jim Van Zandt +.\" Sep/97 man page updated by Fabrizio Polacco +.TH DIP "8" "12/26/96" "Version 3.3.7p" "Reference" .SH NAME dip - handle dialup IP connections .SH SYNOPSIS @@ -202,6 +203,10 @@ to indicate Compressed SLIP protocol. .br .ti +.2i +.B AUTO +to autodetect whether the client uses SLIP or CSLIP +.br +.ti +.2i .B SLIP6 to indicate we must use the SLIP6 protocol. .br @@ -268,7 +273,9 @@ to. If this command isn't present in the command file, the default route won't be set/changed. .IP "\fBdial\fP \fIphonenumber\fP [\fItimeout\fP]" -Dials the indicated number. The default \fItimeout\fP is 60 sec. +Sends the string in the \fBinit\fP variable to initialize +the modem and then dials the indicated number. +The default \fItimeout\fP is 60 sec. \fBdip\fP parses the string returned by the modem, and sets \fB$errlvl\fP accordingly. The standard codes are as follows: .nf @@ -322,7 +329,8 @@ Increment a variable. The default \fIincrement-value\fP is 1. .IP "\fBinit\fP \fIinit-string\fP" Set the initialization string (sent to the modem before -dialing) to the indicated string (default ATE0 Q0 V1 X1). +dialing with the \fBdial\fP command) to the indicated string +(default is ATE0 Q0 V1 X4). \fIPlease\fP use it! .IP "\fBmode SLIP\fP|\fBCSLIP\fP|\fBSLIP6\fP|\fBCSLIP6\fP|\fBPPP\fP|\fBTERM\fP" Set the line protocol (default SLIP). @@ -487,9 +495,7 @@ # You can change these with the chatkey command # Prepare for dialing. - send ATQ0V1E1X4\\r - wait OK 2 - if $errlvl != 0 goto modem_trouble + get $init ATQ0V1E1X4 dial 555-1234567 if $errlvl != 1 goto modem_trouble --- dip-3.3.7p.orig/command.c +++ dip-3.3.7p/command.c @@ -22,6 +22,9 @@ * Offered code for "shell" command, added "onexit" * command. * + * Added support for string variables in diald coomand + * Fabrizio Polacco Wed, 17 Sep 1997 + * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software @@ -29,9 +32,17 @@ * your option) any later version. */ #include "dip.h" -#include -#include -#include + +#if !defined(__GLIBC__) +# include +# include +# include +#else +# include +# include +# include +#endif + #include #define HASHSIZE 128 @@ -63,7 +74,7 @@ }; -static int timeout; /* script "wait" timed out */ +static volatile int timeout; /* script "wait" timed out */ static int errlevel; /* script command return code */ static FILE *scriptfp = (FILE *)NULL; /* input script pointer */ static char *var_modem = NULL; /* name of modem we are using */ @@ -102,7 +113,7 @@ static char cvt_char(char c) { - if (c == '\0') return(c); + if ( !c || c == '0') return( 0x00); switch(c) { case 'a': @@ -299,9 +310,10 @@ } -/* valudates a decimal number as value of variable */ +/* validates a decimal number as value of variable */ inline static int is_a_num(char *n) { + if (*n == '0' && n[1]) return 0; /* no leading zeros on decimal numbers */ while (*n) { /* check all the characters on the value */ if ((*n < '0') || (*n > '9')) return 0; /* not a decimal number */ @@ -1179,10 +1191,10 @@ } oldsig = signal(SIGALRM, TimeOut); + timeout = 0; (void) alarm(howlong); p = argv[1]; - timeout = 0; while((!timeout) && (*p != '\0')) { #ifdef NE_PAUL /* Paul Cadach */ c = (char) tty_getc(); @@ -1319,6 +1331,8 @@ do_dial(int argc, char *argv[]) { int timeout; + struct variable *v; + char *p = argv[1]; if ((argc != 2) && (argc != 3)) { fprintf(stderr, "Usage: dial telno []\n"); @@ -1330,12 +1344,21 @@ return(-1); } + if (( *p == '$' ) && (v=lookup_hash( p))) { /* variable */ + static char t_buf[120]; + memset(t_buf, '\0', sizeof(t_buf)); + if (v->type == 's') strcpy (t_buf, v->str_value); + else if (v->type == 'i') sprintf (t_buf, "%i", v->value); + else return(-1); + p = t_buf; + } + if (argc == 3) get_value(&timeout, argv[2]); else timeout = 60; var_dcount++; - return(mdm_dial(argv[1], timeout)); + return(mdm_dial( p, timeout)); } @@ -2203,8 +2226,8 @@ return(0); } -#define int32 unsigned long -#define int16 unsigned short +#define int32 __u32 +#define int16 __u16 struct bootp { char op; /* packet opcode type */ @@ -2254,6 +2277,139 @@ } } + /* code contribuited by S.u.s.e. gmbh */ +#ifdef __alpha__ + +/* + * The following routines come from linux/arch/alpha/lib/checksum.c and + * linux/net/ipv4/udp.c. See, I'm in a hurry to get this working... :) + */ + +static inline unsigned short +from64to16(unsigned long x) +{ + /* add up 32-bit words for 33 bits */ + x = (x & 0xffffffff) + (x >> 32); + /* add up 16-bit and 17-bit words for 17+c bits */ + x = (x & 0xffff) + (x >> 16); + /* add up 16-bit and 2-bit for 16+c bit */ + x = (x & 0xffff) + (x >> 16); + /* add up carry.. */ + x = (x & 0xffff) + (x >> 16); + return x; +} + +/* + * Do a 64-bit checksum on an arbitrary memory area.. + * + * This isn't a great routine, but it's not _horrible_ either. The + * inner loop could be unrolled a bit further, and there are better + * ways to do the carry, but this is reasonable. + */ +static inline unsigned long +do_csum(unsigned char * buff, int len) +{ + int odd, count; + unsigned long result = 0; + + if (len <= 0) + goto out; + odd = 1 & (unsigned long) buff; + if (odd) { + result = *buff << 8; + len--; + buff++; + } + count = len >> 1; /* nr of 16-bit words.. */ + if (count) { + if (2 & (unsigned long) buff) { + result += *(unsigned short *) buff; + count--; + len -= 2; + buff += 2; + } + count >>= 1; /* nr of 32-bit words.. */ + if (count) { + if (4 & (unsigned long) buff) { + result += *(unsigned int *) buff; + count--; + len -= 4; + buff += 4; + } + count >>= 1; /* nr of 64-bit words.. */ + if (count) { + unsigned long carry = 0; + do { + unsigned long w = *(unsigned long *) buff; + count--; + buff += 8; + result += carry; + result += w; + carry = (w > result); + } while (count); + result += carry; + result = (result & 0xffffffff) + (result >> 32); + } + if (len & 4) { + result += *(unsigned int *) buff; + buff += 4; + } + } + if (len & 2) { + result += *(unsigned short *) buff; + buff += 2; + } + } + if (len & 1) + result += *buff; + result = from64to16(result); + if (odd) + result = ((result >> 8) & 0xff) | ((result & 0xff) << 8); +out: + return result; +} + +/* + * This is a version of ip_compute_csum() optimized for IP headers, + * which always checksum on 4 octet boundaries. + */ +unsigned short +ip_fast_csum( unsigned char * iph, + unsigned int ihl) +{ + return ~do_csum(iph,ihl*4); +} + +/* + * computes the checksum of the TCP/UDP pseudo-header + * returns a 16-bit checksum, already complemented. + */ +unsigned short int +csum_tcpudp_magic( unsigned long saddr, + unsigned long daddr, + unsigned short len, + unsigned short proto, + unsigned int sum) +{ + return ~from64to16(saddr + daddr + sum + + ((unsigned long) ntohs(len) << 16) + + ((unsigned long) proto << 8)); +} + + +static unsigned short +udp_check( struct udphdr *uh, int len, + unsigned long saddr, + unsigned long daddr) +{ + return(csum_tcpudp_magic(saddr, daddr, len, IPPROTO_UDP, 0)); +} + + + +#else /* !__alpha__ */ + + /* This is a version of ip_compute_csum() optimized for IP headers, which always checksum on 4 octet boundaries. */ static inline unsigned short @@ -2261,6 +2417,7 @@ { unsigned long sum = 0; if (wlen) { +#if defined (__i386__) unsigned long bogus; __asm__("clc\n" "1:\t" @@ -2275,6 +2432,21 @@ "adcw $0, %w0" : "=r" (sum), "=S" (buff), "=r" (wlen), "=a" (bogus) : "0" (sum), "1" (buff), "2" (wlen)); +#elif defined (__mc68000__) + __asm__("subqw #1,%2\n" + "1:\t" + "movel %1@+,%/d0\n\t" + "addxl %/d0,%0\n\t" + "dbra %2,1b\n\t" + "movel %0,%/d0\n\t" + "swap %/d0\n\t" + "addxw %/d0,%0\n\t" + "clrw %/d0\n\t" + "addxw %/d0,%0" + : "=d" (sum), "=a" (buff), "=d" (wlen) + : "0" (sum), "1" (buff), "2" (wlen) + : "d0"); +#endif } return (~sum) & 0xffff; } @@ -2284,60 +2456,59 @@ unsigned long saddr, unsigned long daddr) { unsigned long sum; + int i; + unsigned short *pkt; - __asm__("\t addl %%ecx,%%ebx\n" - "\t adcl %%edx,%%ebx\n" - "\t adcl $0, %%ebx\n" - : "=b"(sum) - : "0"(daddr), "c"(saddr), "d"((ntohs(len) << 16) + IPPROTO_UDP*256) - : "cx","bx","dx" ); - - if (len > 3) { - __asm__("\tclc\n" - "1:\n" - "\t lodsl\n" - "\t adcl %%eax, %%ebx\n" - "\t loop 1b\n" - "\t adcl $0, %%ebx\n" - : "=b"(sum) , "=S"(uh) - : "0"(sum), "c"(len/4) ,"1"(uh) - : "ax", "cx", "bx", "si" ); - } - - /* Convert from 32 bits to 16 bits. */ - __asm__("\t movl %%ebx, %%ecx\n" - "\t shrl $16,%%ecx\n" - "\t addw %%cx, %%bx\n" - "\t adcw $0, %%bx\n" - : "=b"(sum) - : "0"(sum) - : "bx", "cx"); - - /* Check for an extra word. */ - if ((len & 2) != 0) { - __asm__("\t lodsw\n" - "\t addw %%ax,%%bx\n" - "\t adcw $0, %%bx\n" - : "=b"(sum), "=S"(uh) - : "0"(sum) ,"1"(uh) - : "si", "ax", "bx"); - } - - /* Now check for the extra byte. */ - if ((len & 1) != 0) { - __asm__("\t lodsb\n" - "\t movb $0,%%ah\n" - "\t addw %%ax,%%bx\n" - "\t adcw $0, %%bx\n" - : "=b"(sum) - : "0"(sum) ,"S"(uh) - : "si", "ax", "bx"); + /* Checksum is the 16-bit one's complement of the one's complement sum of a + pseudo header of information from the IP header, the UDP header, and the + data, padded with zero octets at the end (if necessary) to make a + multiple of two octets. + -- RFC 768 */ + + /* IP pseudoheader: (low bytes on left) + 4 byte source addr + 4 byte dest addr + [0 byte] [proto byte] [2 byte udp len] + UDP header: [struct udphdr] + [2 byte src port] [2 byte dst port] + [2 byte len] [2 byte cksum goes here] + */ + + /* linux folding trick: add the 4 byte values of the IP header, then + cross add the 2 byte halves. */ + + /* sum is in host byte order since that is how we add, but saddr, + daddr, and *uh are just overlay-casts of the raw packet, so are in + network order. len is already in host byte order, though. */ + + /* ip pseudo header */ + sum = ntohl(saddr); + sum += ntohl(daddr); + sum += (len<<16)+(IPPROTO_UDP<<8)+0; + /* udp header */ + sum += ntohs(uh->source); + sum += ntohs(uh->dest); + sum += ntohs(uh->len); + sum += ntohs(uh->check); + /* packet */ + pkt = (unsigned short *)(uh + 1); + i = 0; + while(i*2+1 < len) { + sum += ntohs(pkt[i]); + i++; + } + /* is there an extra byte? */ + if (i*2 < len) { + sum += *(unsigned char*)(&pkt[i]); } + /* now fold */ + sum = (sum & 0xffff) + ((sum >> 16) & 0xffff); - /* We only want the bottom 16 bits, but we never cleared the top 16. */ - return((~sum) & 0xffff); + return sum; } +#endif /* !__alpha__ */ + static void put_bootreq(void) { struct iphdr ip; @@ -2500,12 +2671,12 @@ struct commands commands[] = { - { "beep", do_beep }, + { "beep", do_beep }, { "bootp", do_bootp }, { "break", do_break }, { "chatkey", do_chatkey }, { "config", do_config }, - { "databits", do_databits }, + { "databits", do_databits }, { "dec", do_dec }, { "default", do_default }, { "dial", do_dial }, @@ -2519,28 +2690,28 @@ { "init", do_init }, { "mode", do_mode }, { "modem", do_modem }, - { "netmask", do_netmask }, - { "onexit", do_onexit }, - { "parity", do_parity }, + { "netmask", do_netmask }, + { "onexit", do_onexit }, + { "parity", do_parity }, { "password", do_password }, { "proxyarp", do_proxyarp }, { "print", do_print }, { "psend", do_psend }, { "port", do_port }, - { "quit", do_quit }, + { "quit", do_quit }, { "reset", do_reset }, #ifdef SECUREID { "securidfixed", do_securidfixed }, { "securid", do_securid }, #endif /* SECUREID */ { "send", do_send }, - { "shell", do_shell }, + { "shell", do_shell }, #ifdef SKEY { "skey", do_skey }, #endif /* SKEY */ { "sleep", do_sleep }, { "speed", do_speed }, - { "stopbits", do_stopbits }, + { "stopbits", do_stopbits }, { "term", do_term }, { "timeout", do_timeout }, { "wait", do_wait }, --- dip-3.3.7p.orig/slip.c +++ dip-3.3.7p/slip.c @@ -31,7 +31,9 @@ /* Put line in SLIP discipline. */ if (tty_set_disc(N_SLIP) < 0) { syslog(LOG_ERR, "SETD(N_SLIP): %m"); - return; + /* return; ** changed by debian */ + cleanup(); + exit(1); } if (opt_v == 1) @@ -70,7 +72,9 @@ /* Put line in SLIP discipline. */ if (tty_set_disc(N_SLIP) < 0) { syslog(LOG_ERR, "SETD(N_SLIP): %m"); - return; + /* return; ** changed by debian */ + cleanup(); + exit(1); } if (opt_v == 1) @@ -108,6 +112,9 @@ /* Put line in SLIP discipline. */ if (tty_set_disc(N_SLIP) < 0) { syslog(LOG_ERR, "SETD(N_SLIP): %m"); + /* return; ** changed by debian */ + cleanup(); + exit(1); return; } @@ -117,6 +124,9 @@ /* Disable VJ Header Compression. */ if (tty_set_encap(0x0002) < 0) { syslog(LOG_ERR, "SET_ENCAP(VJ_COMP=0): %m"); + /* found different in old diffs: + syslog(LOG_ERR, "SET_ENCAP(VJ_COMP=0,SLIP6=2): %m"); + */ return; } @@ -156,6 +166,9 @@ /* Enable VJ Header Compression. */ if (tty_set_encap(0x0003) < 0) { syslog(LOG_ERR, "SET_ENCAP(VJ_COMP=1): %m"); + /* found different in old diffs: + syslog(LOG_ERR, "SET_ENCAP(VJ_COMP=1,SLIP6=2): %m"); + */ return; } @@ -175,3 +188,43 @@ /* Add the route to that host. */ (void) attach(dip); } + +void +do_adaptive(struct dip *dip) +{ + (void) strcpy((char *) dip->protocol, "AUTO"); + + /* Put line in SLIP discipline. */ + if (tty_set_disc(N_SLIP) < 0) { + syslog(LOG_ERR, "SETD(N_SLIP): %m"); + cleanup(); + exit(1); + } + + if (opt_v == 1) + syslog(LOG_INFO, "adaptive: set_disc N_SLIP (%d)", N_SLIP); + + /* Enable VJ Header Compression. */ + if (tty_set_encap(0x0008) < 0) { + syslog(LOG_ERR, "SET_ENCAP(ADAPTIVE=8): %m"); + return; + } + + if (opt_v == 1) + syslog(LOG_INFO, "adaptive: set_encap(0x0008)"); + + /* Ask the kernel for the name of our interface. */ + if (tty_get_name(dip->ifname) < 0) { + syslog(LOG_ERR, "GIFNAME: %m"); + (void) tty_set_disc(-1); + return; + } + + if (opt_v == 1) { + printf("adaptive: interface %s\n", dip->ifname); + } + /* Add the route to that host. */ + (void) attach(dip); +} + + --- dip-3.3.7p.orig/dip.h +++ dip-3.3.7p/dip.h @@ -40,27 +40,36 @@ #include #include #include +/* #include + Suse adds this. */ #include #include #include #include #include +#if !defined(__GLIBC__) +# include +# include +#endif #include -#include #include "pathnames.h" +#ifndef CONFIG_IP_ACCT +#define CONFIG_IP_ACCT 1 +#endif /* DIP definitions. */ #define DIP_SFX ".dip" -#define DIP_SLIP 1 /* we support the SLIP protocol */ -#define DIP_CSLIP 1 /* we support the CSLIP protocol */ -#define DIP_PPP 1 /* we support the PPP protocol */ -#define DIP_TERM 1 /* we support the TERM protocol */ -#define DIP_SLIP6 1 /* we support 6bit SLIP protocol */ -#define DIP_CSLIP6 1 /* we support 6bit CSLIP protocol */ +#define DIP_SLIP 1 /* we support the SLIP protocol */ +#define DIP_CSLIP 1 /* we support the CSLIP protocol */ +#define DIP_PPP 1 /* we support the PPP protocol */ +#define DIP_TERM 1 /* we support the TERM protocol */ +#define DIP_SLIP6 1 /* we support 6bit SLIP protocol */ +#define DIP_CSLIP6 1 /* we support 6bit CSLIP protocol */ +#define DIP_ADAPTIVE 1 /* we support the ADAPTIVE mode */ /* SLIP/PPP/ASK initial protocol configuration. */ @@ -190,6 +199,11 @@ extern void tty_setmode(int mode); extern int tty_getmode(void); extern void tty_sendbreak(void); + +#if !defined(HAS_STPCPY) +char *stpcpy(char *dest, const char *src); +#endif /* !defined(HAS_STPCPY) */ + #ifdef SKEY /* S/Key authentication routines in libskey.a */ --- dip-3.3.7p.orig/login.c +++ dip-3.3.7p/login.c @@ -18,8 +18,6 @@ */ #include "dip.h" -#define MIN(a, b) ((a < b)? a : b) - static int verify_inet_addr(char *p); static struct dip * @@ -281,7 +279,7 @@ sleep(1); (void) fflush(stdout); printf("Server address is %s\n",inet_ntoa(dip->loc_ip)); sleep(1); (void) fflush(stdout); - printf("Netmask is %s MTU is %d Starting %s\n", + printf("Netmask is %s MTU is %d Starting %s mode\n", dip->netmask, dip->mtu, dip->protocol); sleep(1); (void) fflush(stdout); --- dip-3.3.7p.orig/main.c +++ dip-3.3.7p/main.c @@ -46,6 +46,7 @@ #define GLOBAL #include "dip.h" +#include "version.h" #define VERSION "3.3.7p-uri (25 Dec 96)" @@ -176,7 +177,7 @@ static void new_kill_dip(char *nam) { - char buf[128]; + char buf[128+sizeof(_PATH_LOCKD)+8]; int pid = 0; FILE *fp; #if HAVE_V2_LOCKFILES @@ -186,12 +187,13 @@ if ((nam == (char *)0) || (nam[0] == '\0')) { /* tty name was not given */ if (opt_v == 1) - fprintf(stderr, "No tty name given, will use /etc/dip.pid...\n"); + fprintf(stderr, "No tty name given, will use %s ...\n", + _PATH_DIP_PID); kill_dip(); return; } - sprintf(buf, "%s/LCK..%s", _PATH_LOCKD, nam); + snprintf(buf, sizeof(buf), "%s/LCK..%s", _PATH_LOCKD, nam); fp = fopen(buf, "r"); if (fp == (FILE *)0) { @@ -379,7 +381,8 @@ openlog("dip", LOG_PID, LOG_DAEMON); printf("DIP: Dialup IP Protocol Driver version %s\n", VERSION); - printf("Written by Fred N. van Kempen, MicroWalt Corporation.\n\n"); + printf("Written by Fred N. van Kempen, MicroWalt Corporation.\n"); + printf("Debian version %s.\n\n", DEBVER); /* Are we called to kill off a DIP process? */ if (opt_k == 1) { @@ -430,7 +433,6 @@ strncpy(path, argv[optind], sizeof(path) - sizeof(DIP_SFX)); if ((sp = strrchr(path, '/')) != (char *)NULL) sp++; else sp = path; - if (strchr(sp, '.') == (char *)NULL) strcat(path, DIP_SFX); /* set euid to ruid */ if (setreuid(geteuid(), getuid()) != 0){ @@ -440,8 +442,11 @@ } /* open file with real uid */ if ((fp = fopen(path, "r")) == (FILE *)NULL) { - fprintf(stderr, "dip: %s: %s\n", path, strerror(errno)); - exit(-1); + if (strchr(sp, '.') == (char *)NULL) strcat(path, DIP_SFX); + if ((fp = fopen(path, "r")) == (FILE *)NULL) { + fprintf(stderr, "dip: %s: %s\n", path, strerror(errno)); + exit(-1); + } } /* set uids back */ if (setreuid(geteuid(), getuid()) != 0){ --- dip-3.3.7p.orig/modem.c +++ dip-3.3.7p/modem.c @@ -26,6 +26,7 @@ #define AT_RSET "ATZ" /* reset the modem */ #define AT_INIT "ATE0 Q0 V1 X4" /* setup for dialing */ #define AT_DIAL "ATD" /* start a dial */ +#define AT_DIAL_TONE "ATDT" /* start a dial (+tone) */ #define AT_HANG "ATH" /* hang up the modem */ #define AT_EOL "\r" /* AT "CRLF" mark */ @@ -61,7 +62,7 @@ #if 0 /* - * FIXME: this is ugly!!! Some modem's faults when its receiving + * _FIXME: this is ugly!!! Some modem's faults when its receiving * new command before finish of sending reply for previous command. */ struct timeval delay; @@ -119,6 +120,8 @@ { (void) signal(SIGALRM, oldsig); (void) alarm(0); + if (opt_v == 1) + printf("Got response \"[%d] %s\"\n", resp->code, resp->string); return(resp->code); /* We got that */ } @@ -213,6 +216,8 @@ number++; prefix=AT_DIAL_STORED; } + else if ( isdigit(*number) ) + prefix=AT_DIAL_TONE; else prefix=AT_DIAL; /* R.H. End */ @@ -220,6 +225,8 @@ if (mdm_setup == 1) { /* Setup to dial out. Send the init command */ + if (opt_v == 1) + printf("Sending INIT string \"%s\"\n", mdm_init_s); #ifdef NE_PAUL sprintf(buff, "%s%s", mdm_init_s, AT_EOL); tty_puts(buff); @@ -238,6 +245,8 @@ } /* Dial the phone number. The dialing itself */ + if (opt_v == 1) + printf("Dialing number \"%s%s\"\n", prefix, number); #ifdef NE_PAUL sprintf(buff, "%s%s%s", prefix, number, AT_EOL); tty_puts(buff); --- dip-3.3.7p.orig/pathnames.h +++ dip-3.3.7p/pathnames.h @@ -17,12 +17,13 @@ /* Pathnames of some customizable files. */ #define _PATH_ETC_DIPHOSTS "/etc/diphosts" -#define _PATH_DIP_PID "/etc/dip.pid" #ifdef FSSTND -#define _PATH_LOCKD "/var/lock" /* lock files */ +# define _PATH_DIP_PID "/var/run/dip.pid" +# define _PATH_LOCKD "/var/lock" /* lock files */ #else -#define _PATH_LOCKD "/usr/spool/uucp" /* lock files */ +# define _PATH_DIP_PID "/etc/dip.pid" +# define _PATH_LOCKD "/usr/spool/uucp" /* lock files */ #endif /* SNK Users Database - be careful not to expose it! */ --- dip-3.3.7p.orig/ppp.c +++ dip-3.3.7p/ppp.c @@ -39,7 +39,9 @@ dup2(tty_askfd(),0); dup2(tty_askfd(),1); /* re-direct cua? to stdin/stdout */ +#if 0 if (dip->loc_ip.s_addr == INADDR_ANY) { /* loc IP addr not set */ +#endif /* PPP will negotiate everything by itself, automatic! */ if (opt_v == 1) { syslog(LOG_DEBUG, "Invoking PPPD with \"debug -detach defaultroute \ @@ -50,6 +52,7 @@ stat=execlp(_PATH_BIN_PPP, "pppd", "-detach", "defaultroute", "noipdefault", "crtscts", "modem", NULL); } +#if 0 } else { if (dip->rmt_ip.s_addr == INADDR_ANY) { /*rem IP addr not set*/ /* DIP found the addresses necessary and we are */ @@ -70,6 +73,7 @@ "crtscts", "modem", string, NULL); } } +#endif perror("DIP: do_ppp(pppd)"); /* point of no return */ return; --- dip-3.3.7p.orig/skey/Makefile +++ dip-3.3.7p/skey/Makefile @@ -12,7 +12,10 @@ CC = gcc CFLAGS = -pipe -O2 #-DUSE_ECHO #SYSLIBS = -lshadow -ldbm -SYSLIBS = -ldbm # For ELF - no shadow needed (included in libc). +#SYSLIBS = -ldbm # For ELF - no shadow needed (included in libc). +SYSLIBS = -lcrypt # no dbm needed either.. +SHADOW = -DSHADOW_PWD # Now works with both shadow and non-shadow passwords. + LIB = libskey.a PROGS = key keyinit keysh @@ -50,11 +53,11 @@ mv $(LIB) $(LIBDIR) linux: - make all SYS=sysv RANLIB="ranlib" CFLAGS="$(CFLAGS) -DSHADOW -DSYSV -DPOSIX" + make all SYS=sysv RANLIB="ranlib" CFLAGS="$(CFLAGS) $(SHADOW) -DSYSV -DPOSIX" sunos5: make all SYS=$@ RANLIB="echo" CFLAGS="$(CFLAGS) -DSYSV -DSOLARIS \ - -DSIGVOID" + -DSIGVOID -DSHADOW_PWD" sunos4: make all SYS=$@ RANLIB="/bin/ranlib" CFLAGS="$(CFLAGS) -DSUN" --- dip-3.3.7p.orig/skey/md4.c +++ dip-3.3.7p/skey/md4.c @@ -34,11 +34,15 @@ * in each word are reversed). If this is undesired a call to MDreverse(X) can * reverse the bytes of X back into order after each call to MDupdate. */ + +#include +#include + #define TRUE 1 #define FALSE 0 #if (defined(__MSDOS__) || defined(MPU8086) || defined(MPU8080) \ - || defined(vax) || defined (MIPSEL)) + || defined(vax) || defined (MIPSEL) || defined(__alpha__)) #define LOWBYTEFIRST TRUE /* Low order bytes are first in memory */ #else /* Almost all other machines are big-endian */ #define LOWBYTEFIRST FALSE @@ -87,7 +91,7 @@ #define gg(A,B,C,D,i,s) A = rot((A + g(B,C,D) + X[i] + C2),s) #define hh(A,B,C,D,i,s) A = rot((A + h(B,C,D) + X[i] + C3),s) -void MDreverse __ARGS((unsigned long *X)); +void MDreverse __ARGS(( __u32 *X)); /* MDprint(MDp) * Print message digest buffer MDp as 32 hexadecimal digits. @@ -134,9 +138,9 @@ *X++ = ((t & 0xFF00FF00) >> 8) | ((t & 0x00FF00FF) << 8); } void MDreverse(X) -unsigned long *X; +__u32 *X; { - register unsigned long t; + register __u32 t; revx; revx; @@ -165,9 +169,9 @@ static void MDblock(MDp,X) MDptr MDp; -unsigned long *X; +__u32 *X; { - register unsigned long tmp, A, B, C, D; + register __u32 tmp, A, B, C, D; #if LOWBYTEFIRST == FALSE MDreverse(X); @@ -251,7 +255,7 @@ unsigned int count; { int i,bit,byte,mask; - unsigned long tmp; + __u32 tmp; unsigned char XX[64]; unsigned char *p; @@ -276,7 +280,7 @@ /* Process data */ if(count == 512){ /* Full block of data to handle */ - MDblock(MDp,(unsigned long *)X); + MDblock(MDp,(__u32 *)X); } else if(count > 512){ /* Check for count too large */ printf("\nError: MDupdate called with illegal count value %ld.",count); @@ -299,15 +303,15 @@ if(byte <= 55){ for(i=0;i<8;i++) XX[56+i] = MDp->count[i]; - MDblock(MDp,(unsigned long *)XX); + MDblock(MDp,(__u32 *)XX); } else { /* need to do two blocks to finish up */ - MDblock(MDp,(unsigned long *)XX); + MDblock(MDp,(__u32 *)XX); for(i=0;i<56;i++) XX[i] = 0; for(i=0;i<8;i++) XX[56+i] = MDp->count[i]; - MDblock(MDp,(unsigned long *)XX); + MDblock(MDp,(__u32 *)XX); } /* Set flag saying we're done with MD computation */ MDp->done = 1; --- dip-3.3.7p.orig/skey/put.c +++ dip-3.3.7p/skey/put.c @@ -13,9 +13,11 @@ #include #include #include +#include +#include #include "skey.h" -static unsigned long extract __ARGS ((char *s, int start, int length)); +static __u32 extract __ARGS ((char *s, int start, int length)); static void standard __ARGS ((char *word)); static void insert __ARGS ((char *s, int x, int start, int length)); static int wsrch __ARGS ((char *w, int low, int high)); @@ -2244,7 +2246,7 @@ unsigned char cl; unsigned char cc; unsigned char cr; - unsigned long y; + __u32 y; int shift; assert (length <= 11); @@ -2295,7 +2297,7 @@ } /* Extract 'length' bits from the char array 's' starting with bit 'start' */ -static unsigned long +static __u32 extract (s, start, length) char *s; int start, length; @@ -2303,7 +2305,7 @@ unsigned char cl; unsigned char cc; unsigned char cr; - unsigned long x; + __u32 x; assert (length <= 11); assert (start >= 0); --- dip-3.3.7p.orig/skey/skeyinit.c +++ dip-3.3.7p/skey/skeyinit.c @@ -12,18 +12,22 @@ #include #include #include +/* commented in debian #ifdef linux #undef SHADOW #include #endif +*/ #include #include #ifdef __svr4__ #include #include +/* commented in debian #include #include "sysv_shadow.h" +*/ #endif /* __svr4__ */ @@ -100,15 +104,10 @@ } } -#ifdef SHADOW - if ((sp = getspnam (pp->pw_name)) == NULL) { - fprintf(stderr, "Who are you?\n"); - exit(1); - } -#endif /* SHADOW */ - -#ifdef SHADOW - salt = sp->sp_pwdp; +#ifdef SHADOW_PWD + sp = getspnam(pp->pw_name); + salt = sp ? sp->sp_pwdp : pp->pw_passwd; + endspent(); #else salt = pp->pw_passwd; #endif @@ -127,11 +126,7 @@ setpriority(PRIO_PROCESS, 0, 0); #endif -#ifdef SHADOW - if (pp && strcmp(p, sp->sp_pwdp)) { -#else - if (pp && strcmp(p, pp->pw_passwd)) { -#endif + if (strcmp(p, salt)) { printf ("Password incorrect.\n"); exit (-1); } @@ -141,7 +136,7 @@ switch (rval) { case -1: - perror ("Error opening database: "); + perror ("Error opening database"); exit (1); case 0: printf ("[Updating %s]\n", pp->pw_name); --- dip-3.3.7p.orig/skey/skeylogin.c +++ dip-3.3.7p/skey/skeylogin.c @@ -352,7 +352,7 @@ char *username; { int i; - char str [50]; + static char str [50]; struct skey skey; --- dip-3.3.7p.orig/skey/skeysh.c +++ dip-3.3.7p/skey/skeysh.c @@ -12,22 +12,19 @@ #include #include #include -#ifdef linux -#include -#endif char userbuf[16] = "USER="; char homebuf[128] = "HOME="; char shellbuf[128] = "SHELL="; -char pathbuf[128] = "PATH=:/usr/ucb:/bin:/usr/bin"; +/* char pathbuf[128] = "PATH=:/usr/ucb:/bin:/usr/bin"; */ +char pathbuf[128] = "PATH=:/usr/local/bin:/bin:/usr/bin"; char *cleanenv[] = { userbuf, homebuf, shellbuf, pathbuf, 0, 0 }; -char *shell = "/bin/csh"; +char *shell = "/bin/sh"; char *getenv(); extern char **environ; struct passwd *pwd; -struct spwd *spw; main (argc, argv) int argc; --- dip-3.3.7p.orig/skey/skeysubr.c +++ dip-3.3.7p/skey/skeysubr.c @@ -11,6 +11,7 @@ * S/KEY misc routines. */ +#include #include #ifdef HAS_STD_LIB @@ -86,7 +87,7 @@ unsigned int buflen; #ifndef LITTLE_ENDIAN int i; - register long tmp; + register __u32 tmp; #endif buflen = strlen(seed) + strlen(passwd); @@ -134,7 +135,7 @@ { MDstruct md; #ifndef LITTLE_ENDIAN - register long tmp; + register __u32 tmp; #endif MDbegin(&md); --- dip-3.3.7p.orig/tty.c +++ dip-3.3.7p/tty.c @@ -28,12 +28,18 @@ */ #include "dip.h" #include -#ifdef LINUX -# include -# include -#ifndef NO_SERIAL -# include /* for Linux-1.1.13 */ -#endif /* ~NO_SERIAL */ +#if defined(__linux__) +# if !defined(__GLIBC__) +# include +# include +# endif /* ~__GLIBC__ */ +# ifndef NO_SERIAL +# include /* for Linux-1.1.13 */ +# endif /* ~NO_SERIAL */ +#endif /* __linux__ */ + +#ifdef HAVE_LIBLOCKDEV +# include #endif @@ -98,6 +104,11 @@ static int tty_already_locked(char *nam) /* nam - complete path to lock file */ +#ifdef HAVE_LIBLOCKDEV +{ + return( (int)is_dev_lock( nam) != 0 ); +} +#else { int i = 0, pid = 0; FILE *fd = (FILE *)0; @@ -122,17 +133,65 @@ /* Dead, we can proceed locking this device... */ return 0; } +#endif /* Lock or unlock a terminal line. */ int tty_lock(char *path, int mode) +#ifdef HAVE_LIBLOCKDEV +{ + pid_t pid; + static char nam[PATH_MAX]; + + if (mode == 1) { /* lock */ + strcpy( nam, path); + pid = dev_lock( nam); + if ( pid == -1 ) { + syslog( LOG_ERR, "DIP: tty: lock: (%s): %s\n", nam, strerror(errno)); + fprintf( stderr, "DIP: tty: lock: (%s): %s\n", nam, strerror(errno)); + return (-1); + } + if ( pid > 0 ) { + syslog( LOG_ERR, "DIP: attempt to use tty %s already locked by process %d\n", nam, pid); + fprintf( stderr, "DIP: attempt to use tty %s already locked by process %d\n", nam, pid); + return (-1); + } + return 0; + } else if (mode == 2) { /* re-acquire a lock after a fork() */ + pid = dev_relock( nam, 0); + if ( pid == -1 ) { + syslog( LOG_ERR, "DIP: tty: relock: (%s): %s\n", nam, strerror(errno)); + fprintf( stderr, "DIP: tty: relock: (%s): %s\n", nam, strerror(errno)); + return (-1); + } + if ( pid > 0 ) { + syslog( LOG_ERR, "DIP: attempt to reuse tty %s already locked by process %d\n", nam, pid); + fprintf( stderr, "DIP: attempt to reuse tty %s already locked by process %d\n", nam, pid); + return (-1); + } + return 0; + } else { /* unlock */ + pid = dev_unlock( nam, 0); + if ( pid == -1 ) { + syslog( LOG_ERR, "DIP: tty: unlock: (%s): %s\n", nam, strerror(errno)); + fprintf( stderr, "DIP: tty: unlock: (%s): %s\n", nam, strerror(errno)); + return (-1); + } + if ( pid > 0 ) { + syslog( LOG_ERR, "DIP: attempt to unlock tty %s already locked by process %d\n", nam, pid); + fprintf( stderr, "DIP: attempt to unlock tty %s already locked by process %d\n", nam, pid); + return (-1); + } + return 0; + } +} +#else { static char saved_path[PATH_MAX]; static char nam_tmp[PATH_MAX]; static char dev_nam[20]; static int saved_lock = 0; - struct passwd *pw; pid_t ime; #if HAVE_V2_LOCKFILES int cwrote; @@ -170,6 +229,8 @@ } #if 0 + { + struct passwd *pw; /* Make sure UUCP owns the lockfile. Required by some packages. */ if ((pw = getpwnam(_UID_UUCP)) == NULL) { fprintf(stderr, "DIP: tty: lock: UUCP user %s unknown!\n", @@ -177,6 +238,7 @@ return(0); /* keep the lock anyway */ } (void) chown(saved_path, pw->pw_uid, pw->pw_gid); + } #endif /* chown LCK-file to UUCP */ saved_lock = 1; } else { @@ -231,6 +293,7 @@ return(0); } +#endif /* Find a serial speed code in the table. */ @@ -596,7 +659,7 @@ int tty_speed(char *speed) { -#if defined(LINUX) || defined(linux) +#if defined(__linux__) struct serial_struct info; int spd; @@ -604,13 +667,19 @@ if (ioctl(tty_fd, TIOCGSERIAL, &info)) return(-1); info.flags = info.flags & ~ASYNC_SPD_MASK; +#ifndef B115200 /* if we have it, just use it */ if (spd == 115200) { if (tty_set_speed(&tty_current, speed) < 0) return(-1); info.flags |= ASYNC_SPD_VHI; - } else if (spd == 57600) { + } else +#endif /* B115200 */ +#ifndef B57600 /* if we have it, just use it */ + if (spd == 57600) { if (tty_set_speed(&tty_current, speed) < 0) return(-1); info.flags |= ASYNC_SPD_HI; - } else { + } else +#endif /* B57600 */ + { if (tty_set_speed(&tty_current, speed) < 0) return(-1); } if (ioctl(tty_fd, TIOCSSERIAL, &info)) return(-1); @@ -621,6 +690,18 @@ return(tty_set_state(&tty_current)); } +int +prephangup(void) +{ + int fd; + + fd = tty_askfd(); + ioctl(fd, TIOCMBIC, TIOCM_DTR); + usleep(500000); + ioctl(fd, TIOCMBIS, TIOCM_DTR); + usleep(250000); + return(0); +} /* Hangup the line. */ int @@ -636,7 +717,7 @@ return(-errno); } - (void) sleep(3); + (void) sleep(1); if (tty_set_state(&tty_current) < 0) { syslog(LOG_ERR, "DIP: tty: hangup(RAISE): %s\n", strerror(errno)); @@ -747,6 +828,7 @@ return(-errno); } + (void) prephangup(); (void) hanguptty(); (void) mdm_hangup(); (void) close(tty_fd); @@ -759,16 +841,14 @@ int tty_login_close(void) { -#ifdef NE_PAUL if (tty_fd >= 0) { + (void) prephangup(); +#ifdef NE_PAUL (void) tty_get_name(mydip.ifname); (void) detach(&mydip); +#endif (void) mdm_hangup(); } -#else - if (tty_fd >= 0) - (void) mdm_hangup(); -#endif return 0; } @@ -887,11 +967,7 @@ int tty_getmode(void) { -#if 0 return(tty_mode); -#else - return 1; -#endif } --- dip-3.3.7p.orig/DEBIAN-VERSION +++ dip-3.3.7p/DEBIAN-VERSION @@ -0,0 +1 @@ +"3.3.7p-4 (debian)" --- dip-3.3.7p.orig/version.h +++ dip-3.3.7p/version.h @@ -0,0 +1 @@ +# define DEBVER "3.3.7p-4 (debian)" --- dip-3.3.7p.orig/less +++ dip-3.3.7p/less @@ -0,0 +1,89 @@ +md4.c:93: parse error before `*' +md4.c:140: parse error before `__u32' +md4.c:140: warning: data definition has no type or storage class +md4.c:141: parse error before `{' +md4.c:144: parse error before `++' +md4.c:145: parse error before `++' +md4.c:146: parse error before `++' +md4.c:147: parse error before `++' +md4.c:148: parse error before `++' +md4.c:149: parse error before `++' +md4.c:150: parse error before `++' +md4.c:151: parse error before `++' +md4.c:152: parse error before `++' +md4.c:153: parse error before `++' +md4.c:154: parse error before `++' +md4.c:155: parse error before `++' +md4.c:156: parse error before `++' +md4.c:157: parse error before `++' +md4.c:158: parse error before `++' +md4.c:159: parse error before `++' +md4.c: In function `MDblock': +md4.c:171: parse error before `__u32' +md4.c:173: syntax error before `tmp' +md4.c:178: `A' undeclared (first use this function) +md4.c:178: (Each undeclared identifier is reported only once +md4.c:178: for each function it appears in.) +md4.c:179: `B' undeclared (first use this function) +md4.c:180: `C' undeclared (first use this function) +md4.c:181: `D' undeclared (first use this function) +md4.c:183: `tmp' undeclared (first use this function) +md4.c:183: subscripted value is neither array nor pointer +md4.c:184: subscripted value is neither array nor pointer +md4.c:185: subscripted value is neither array nor pointer +md4.c:186: subscripted value is neither array nor pointer +md4.c:187: subscripted value is neither array nor pointer +md4.c:188: subscripted value is neither array nor pointer +md4.c:189: subscripted value is neither array nor pointer +md4.c:190: subscripted value is neither array nor pointer +md4.c:191: subscripted value is neither array nor pointer +md4.c:192: subscripted value is neither array nor pointer +md4.c:193: subscripted value is neither array nor pointer +md4.c:194: subscripted value is neither array nor pointer +md4.c:195: subscripted value is neither array nor pointer +md4.c:196: subscripted value is neither array nor pointer +md4.c:197: subscripted value is neither array nor pointer +md4.c:198: subscripted value is neither array nor pointer +md4.c:199: subscripted value is neither array nor pointer +md4.c:200: subscripted value is neither array nor pointer +md4.c:201: subscripted value is neither array nor pointer +md4.c:202: subscripted value is neither array nor pointer +md4.c:203: subscripted value is neither array nor pointer +md4.c:204: subscripted value is neither array nor pointer +md4.c:205: subscripted value is neither array nor pointer +md4.c:206: subscripted value is neither array nor pointer +md4.c:207: subscripted value is neither array nor pointer +md4.c:208: subscripted value is neither array nor pointer +md4.c:209: subscripted value is neither array nor pointer +md4.c:210: subscripted value is neither array nor pointer +md4.c:211: subscripted value is neither array nor pointer +md4.c:212: subscripted value is neither array nor pointer +md4.c:213: subscripted value is neither array nor pointer +md4.c:214: subscripted value is neither array nor pointer +md4.c:215: subscripted value is neither array nor pointer +md4.c:216: subscripted value is neither array nor pointer +md4.c:217: subscripted value is neither array nor pointer +md4.c:218: subscripted value is neither array nor pointer +md4.c:219: subscripted value is neither array nor pointer +md4.c:220: subscripted value is neither array nor pointer +md4.c:221: subscripted value is neither array nor pointer +md4.c:222: subscripted value is neither array nor pointer +md4.c:223: subscripted value is neither array nor pointer +md4.c:224: subscripted value is neither array nor pointer +md4.c:225: subscripted value is neither array nor pointer +md4.c:226: subscripted value is neither array nor pointer +md4.c:227: subscripted value is neither array nor pointer +md4.c:228: subscripted value is neither array nor pointer +md4.c:229: subscripted value is neither array nor pointer +md4.c:230: subscripted value is neither array nor pointer +md4.c: In function `MDupdate': +md4.c:257: `__u32' undeclared (first use this function) +md4.c:257: parse error before `tmp' +md4.c:272: `tmp' undeclared (first use this function) +md4.c:282: parse error before `)' +md4.c:305: parse error before `)' +md4.c:308: parse error before `)' +md4.c:313: parse error before `)' +make[2]: *** [md4.o] Error 1 +make[1]: *** [linux] Error 2 +make: *** [dip] Error 2 --- dip-3.3.7p.orig/debian/changelog +++ dip-3.3.7p/debian/changelog @@ -0,0 +1,164 @@ +dip (3.3.7p-4) unstable; urgency=low + + * debian/control: change priority to extra, to match override file. + * tty.c (tty_speed): if we actually have B115200 and B57600, don't + bother with SPD_HI and SPD_VHI. (Closes: #25087) + * command.c (is_a_num): avoid losing leading zeros by deciding things + (other than a single zero) with leading simply aren't + numbers. (Closes: #28378) + (do_wait): Mark "timeout" as volatile so the signal handler actually + works. Also fix negligible race condition. (Closes: #33741) + + -- Mark W. Eichin Tue, 29 Jan 2002 23:51:44 -0500 + +dip (3.3.7p-3) unstable; urgency=low, closes=74220 91140 91428 68105 + + * New maintainer. Scream if I broke anything, especially the "bootp" + command... (Closes: #68105) + * Rebuild to modernize library dependencies, handle /usr/share + move. (Closes: #74220, #91140, #91428). + * debian/control: add build-depends, update standards-version. + * debian/copyright: more complete pointer to public sources. + * Makefile: use /usr/share/man. + * tty.c (tty_lock): use new lockdev names (dev_lock, not lock_dev.) + * command.c (udp_check): rewrite in C, vs. asm; the old crufty asm code + doesn't build anymore, and there's just no need for speed [at the + expense of maintainability] for something that is tossing a few + single packets around. Also, the current linux macros are different + enough to be hard to substitute in. The replacement code is a + readable and portable C expression of RFC 768. + * debian/rules: use dpkg-gencontrol -isp. + + -- Mark W. Eichin Sun, 1 Apr 2001 23:36:09 -0400 + +dip (3.3.7p-2) frozen unstable; urgency=low + + * applied patch supplied by Goran Gajic + which closes: #22164 [dip -k -l `perl -e 'print "a" x 2000'`] + (thanx to James Troup, Christian Hudon and Andrea Arcangeli) + * added a /etc/ppp.dip conffile script working for dynamic PPP + * added messages (option verbose) to report init string and return + strings. There is a potential problem when sending initialization + strings without using the INIT string: the default content, sent + at the dial command, deletes the previous initialization. + Now the verbose option permits to notice this. Still misses the capability + to have multiple INIT strings (ATZ silently discards following options) + * added use of tone dialing when supplying only a number (corrected + use of numeric variables in "dial" command: it accepted only strings). + * binary moved from /usr/sbin to /usr/bin (leaving a symlink) because the + command is usually issued by normal users in group dip. + * forced PPP working ignoring existing IP address, it didn't work + for me before. (this tested from Feb98 to May98 by me only) + + -- Fabrizio Polacco Fri, 6 Feb 1998 11:28:38 +0200 + +dip (3.3.7p-1) unstable; urgency=low + + * Linked with glibc6 and liblockdev0g + * Added string variables support to dial command (undocumented) + * Added use of locking library libdevlock. + * Added patch for alpha contributed by Suse gmbh. + * Added debian version information to startup message. + * Changed version name and date in manpage. + * Changed the way that tty_getmode() return its value; now dip removes + its lock file. Thanx to Peter Tobias for the hint. + * addedd more sample files and more README to the package. + * Should work with and without shadow password. + * Compared manually all patches applyed to version 3.3.7o with the + new version 3.3.7p, and applyed differencies. + * Added patches already in previous debian version: support for + adaptive mode, assembler code for mc68000, for FSSTND compliant + (var/run), ... some old bug, and some new :-) + Here is a list of the Debian changes in previous version 3.3.7o: + - transparent SHADOW support (the same binary will work with and + without shadow support) + - removed -m486 (it is not necessary and it doesn't work on non + intel platforms) + - additional configuration option FSSTND (place of pid file) + - removed -Wl,-qmagic (not supported anymore) + - added a BASEDIR variable. If unset nothing changes but you + can install now to a separate hierarchy. You could set it + to /tmp and say "make install" and create a tar archive with + the binaries (great for distributions) + - in attach.c changed "#ifndef old_ifr_hwaddr" to + "#ifdef old_ifr_hwaddr" (the kernel doesn't define it anymore) + - changed dip to use ipfwadm instead of ipfw (ipfw isn't currently + supported by linux) + - fixed reading from /proc + - ignore comments after labels in the dip script + - added assembler ip checksum routines for m68k + - added support for SLIP6 (some users wanted it) + - added an "adaptive SLIP mode" (AUTO). Great for diplogin. You + don't need to specify SLIP or CSLIP in /etc/diphosts anymore. + Just say "AUTO" and the same entry will work for both SLIP + and CSLIP. You now only need one entry for both SLIP and CSLIP. + - added a section about escape characters to the manual page + (they weren't documented) + - always enable IP-accounting (maybe supress output when the + counters are 0??) + - make sure that the modem init string is terminated by a \0 + - added a prehangup function that will make sure that the modem + will hangup. + * upstream package wasn't clean; cleaned debian .orig sources + here are md5sum from upstream and my cleaned: + 2fc3c9723a4a8ab506d5fde85d6e2f63 188381 dip-3.3.7p.tar.gz + 2a514e5a3cd737944d443633dcdd3c46 113604 dip_3.3.7p.orig.tar.gz + * New upstream sources, with most of the debian patches applied + directly upstream. + + -- Fabrizio Polacco Mon, 18 Aug 1997 19:11:24 +0300 + +dip (3.3.7o-2) unstable; urgency=low + + * Change of debian maintainer. + * Added netstd changelog to record old changes (only from Jan 97) + * Minor changes to debian files (removed dirs file). + + -- Fabrizio Polacco Sun, 10 Aug 1997 16:28:19 +0300 + +dip (3.3.7o-1) unstable; urgency=low + + * Initial Release after the divorce from netstd. + + -- Peter Tobias Sat, 26 Jul 1997 13:31:57 +0200 + +netstd (2.13-1) unstable; urgency=low + + * rexecd: replaced the NetKit-0.09 rexecd by the working Debian rexecd + * rexec: updated to rexec-1.3 + * nfs-server: changed to create /etc/rmtab with mode 0644 + * dip: fixed IP accounting support + + -- Peter Tobias Mon, 3 Mar 1997 01:17:28 +0100 + +netstd (2.12-1) unstable; urgency=high + + * FYI: the netstd package now uses about 70% of the NetKit-0.09 sources + * netstd now pre-depends on netbase to make sure that the portmapper is + started before the NFS daemons + * dpkg-source -x should work now + * ruptime: replaced by OpenBSD ruptime (Bug#6934) + * nfs-server: fixed manual page links + * /etc/init.d/netstd_nfs: automagically start nfsd/mountd if /etc/exports + contains valid entries + * talkd: security fixes (buffer overruns) + * rlogin: security fixes (buffer overruns) + * rwalld: fixed to only show the message once + * nfs-server: updated to v2.2-beta26 + + -- Peter Tobias Wed, 12 Feb 1997 00:25:14 +0100 + +netstd (2.11-1) unstable; urgency=high + + * converted to packaging standard 2.1.2.2 + * minor changes to the /etc/init.d/netstd* and /etc/slip.dip files + * ftp: mget will work with libreadline now (Bug#4091) + * ftpd: further security fixes + * identd: removed reference to authuser(3) (Bug#6483) + * sliplogin: fixed the path of the arp binary (Bug#6596) + * nfs-server: updated to v2.2-beta23 + * checkrhosts: added manual page + * routed: added patch from Alan Cox + + -- Peter Tobias Sun, 19 Jan 1997 15:04:57 +0100 + --- dip-3.3.7p.orig/debian/copyright +++ dip-3.3.7p/debian/copyright @@ -0,0 +1,62 @@ +This version was debianized by Fabrizio Polacco on +Mon, 18 Aug 1997 20:13:45 +0300 , adding manually the patches included +in previous debian version by Peter Tobias, and not yet included +upstream, particularly support for Adaptive SLIP. + +[ftp.funet.fi:/pub/Linux/util/networking/programs/dip seems to only +have 337 n and o] +The upstream surces package was downloaded from ftp.funet.fi with md5sum +2fc3c9723a4a8ab506d5fde85d6e2f63 188381 dip-3.3.7p.tar.gz +was not well cleaned, including .bak files, dip binary and some .o +files. I cleaned and repackaged in +2a514e5a3cd737944d443633dcdd3c46 113604 dip_3.3.7p.orig.tar.gz + + +Copyright: + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at +your option) any later version. + +Author: Fred N. van Kempen, + Copyright 1988-1993 MicroWalt Corporation + please DON'T pester Fred van Kempen with questions + about this version of DIP, OK? + +Modified: Uri Blumenthal, (C) 1994, 1995 + Paul Cadach, (C) 1994 + +Others: Matthew Baker (c) 1995 + Inaky Perez Gonzalez (C) 1995 + Pauline Middelink (C) 1994 + Peter Tobias + Peter Wassenaar Oct 1 '94 + Dirk Melchers dirk@merlin.nbg.sub.org Jan 3, 95 + Colten Edwards Nov 11 94 + and Rob Janssen, Erik Olson, Neal Becker, Michael N. Lipp, + Joerg Schlaeger, Stephen Shortland, Mike Norman, Bill Reynolds, + Daniel Suman, H. J. Lu, Kyriakos Georgiou, Scott Howard, + martin.buck@student.uni-ulm.de, Tim Josling, Horst von Brand + +Lock file stuff stolen from Taylor UUCP, (C) 1991, 1992 Ian Lance Taylor + +This code uses some routines from "pppd" code developed + * by Carnegie Mellon University. + * Here's their Copyright: + * + * Copyright (c) 1989 Carnegie Mellon University. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by Carnegie Mellon University. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + --- dip-3.3.7p.orig/debian/conffiles +++ dip-3.3.7p/debian/conffiles @@ -0,0 +1,3 @@ +/etc/diphosts +/etc/slip.dip +/etc/ppp.dip --- dip-3.3.7p.orig/debian/examples +++ dip-3.3.7p/debian/examples @@ -0,0 +1,15 @@ +samples/advantis.dip +samples/annex.dip +samples/blair.dip +samples/diphosts +samples/dyna1.dip +samples/dynamic-ip.dip +samples/dynamic-ip.sh +samples/ign.dip +samples/netblaz.dip +samples/netcom.scripts +samples/ppp.dip +samples/sample-paul.dip +samples/sample.dip +samples/secureip.dip +samples/uri-annex.dip --- dip-3.3.7p.orig/debian/control +++ dip-3.3.7p/debian/control @@ -0,0 +1,16 @@ +Source: dip +Section: net +Priority: extra +Maintainer: Mark W. Eichin +Build-Depends: debmake, liblockdev1-dev +Standards-Version: 3.5.2 + +Package: dip +Architecture: any +Depends: ${shlibs:Depends} +Replaces: netstd (<=2.14) +Description: Tool for handling SLIP/PPP dialup IP connections + This program handles the connections needed for dialup IP links, like + SLIP or PPP. It can handle both incoming and outgoing connections, + using password security for incoming connections. + --- dip-3.3.7p.orig/debian/rules +++ dip-3.3.7p/debian/rules @@ -0,0 +1,64 @@ +#!/usr/bin/make -f +# Made with the aid of debmake, by Christoph Lameter, +# based on the sample debian/rules file for GNU hello by Ian Jackson. + +package=dip + +DIRS= \ + usr/bin \ + usr/sbin \ + usr/share/man/man8 \ + etc + +build: + $(checkdir) + make + touch build + +clean: + $(checkdir) + -rm -f build + -make clean + -rm -f `find . -name '*~'` debian/.dwww-index~ *.bak + -rm -rf debian/tmp + -rm -f debian/files* core debian/substvars + # build debian version include file and put it in diff file + dpkg-parsechangelog | awk '/Version:/{ print "\"" $$2 " (debian)" "\"" }' > DEBIAN-VERSION + echo -ne "\043 define DEBVER \c" > version.h + cat DEBIAN-VERSION >> version.h + +binary-indep: checkroot build + $(checkdir) +# There are no architecture-independent files to be uploaded +# generated by this package. If there were any they would be +# made here. + +binary-arch: checkroot build + $(checkdir) + -rm -rf debian/tmp + install -d debian/tmp + cd debian/tmp && install -d $(DIRS) + make install BASEDIR=`pwd`/debian/tmp + cd debian/tmp/usr && mv sbin/dip bin && ln -s ../bin/dip sbin/dip + install -o root -g root -m 0644 debian/diphosts debian/tmp/etc + install -o root -g dip -m 0640 debian/slip.dip debian/tmp/etc + install -o root -g dip -m 0640 debian/ppp.dip debian/tmp/etc +# Must have debmake installed for this to work. Otherwise please copy +# /usr/bin/debstd into the debian directory and change debstd to debian/debstd + debstd -m *README* + dpkg-gencontrol -isp + dpkg --build debian/tmp .. + +define checkdir + test -f debian/rules +endef + +# Below here is fairly generic really + +binary: binary-indep binary-arch + +checkroot: + $(checkdir) + test root = "`whoami`" + +.PHONY: binary binary-arch binary-indep clean checkroot --- dip-3.3.7p.orig/debian/diphosts +++ dip-3.3.7p/debian/diphosts @@ -0,0 +1,20 @@ +# /etc/diphosts: name to IP address mapping for diplogin. See diplogin(8). +# +# diphosts This file describes a number of name-to-address +# mappings for the DIP program. It is used to determine +# which host IP address to use for in incoming call of +# some user. +# +# Version: @(#)diphosts 1.20 05/31/94 +# +# Author: Fred N. van Kempen, +# Modified: Uri Blumenthal +# +# name : pwd : hostname : local server: netmask: comments : protocol,mtu +#================================================== +#sbonjovi::bonjovi:server1:netmask:MicroWalt "bonjovi" SLIP:SLIP,296 +#sroxette::roxette:server2:netmask:MicroWalt "roxette" SLIP:CSLIP,296 + +#stephen:s/key:tuin:server3:netmask:S/Key Authenticated login:CSLIP,296 + +# End of diphosts. --- dip-3.3.7p.orig/debian/slip.dip +++ dip-3.3.7p/debian/slip.dip @@ -0,0 +1,118 @@ +# /etc/slip.dip +# Author : Peter Tobias +# Version : 1.1 + +# Return codes: +# 0 - ok +# 5 - non serious problem (they won't cost you money) +# 10 - serious problem + +# Predefined error levels: +# 0 - OK 1 - CONNECT 2 - ERROR 3 - BUSY 4 - NO CARRIER + +# Assign the error level 5 to the modem string "NO DIALTONE" + chatkey NO\sDIALTONE 5 + +main: + print Initializing networking parameters ... + get $local *INSERT_YOUR_LOCAL_IP_NUMBER* + get $remote *INSERT_THE_REMOTE_IP_NUMBER* + + print Initializing serial port and modem ... + print + get $retries 0 + +# you should use ttyS* devices here (not cua* devices) +# ttyS0 is the first serial port, ttyS1 the second ... + port ttyS1 + if $errlvl != 0 goto bad_tty + speed 38400 + reset + init ATZ + +redial: +# Set max. retries + if $retries == 10 goto busy_end + inc $retries + print [ $retries ] Dialing to $remote [ $rmtip ] + + dial *INSERT_THE_PHONE_NUMBER* + if $errlvl == 3 goto busy + if $errlvl == 4 goto no_carrier + if $errlvl == 5 goto no_dialtone + if $errlvl != 1 goto error + +login: + wait ogin: 10 + if $errlvl != 0 goto login_err + send *INSERT_LOGIN_NAME*\n + wait ord: 5 + if $errlvl != 0 goto passwd_err + send *INSERT_PASSWORD*\n + +### The following lines may be necessary for dynamic IP +# send slip\n +# wait address 5 +# if $errlvl != 0 goto no_slip +# get $locip remote 10 +# if $errlvl != 0 goto no_ip_address + + +# mtu 1500 + default + + print CONNECTED to $remote with address $local +# beep + mode CSLIP + goto exit + + +busy: + print [ $retries ] Dialing failed (BUSY), repeating after delay (20 sec)... + print + sleep 20 + goto redial + +busy_end: + print The SLIP line is still busy. Try again later ... + goto exit_warn + +bad_tty: + print Can't open TTY line ... + goto exit_error + +login_err: + print Error sending login name + goto exit_error + +passwd_err: + print Error sending password + goto exit_error + +no_carrier: + print Dialing failed (NO CARRIER) + goto exit_error + +no_ip_address: + print Can't get (local) IP address from $remote + goto exit_error + +no_slip: + print Protocol not supported on remote host? + goto exit_error + +no_dialtone: + print Dialing failed (NO DIALTONE) + goto exit_warn + +error: + print SLIP to $remote [ $rmtip ] failed + +exit_error: + exit 10 + +exit_warn: + exit 5 + +exit: + --- dip-3.3.7p.orig/debian/ppp.dip +++ dip-3.3.7p/debian/ppp.dip @@ -0,0 +1,88 @@ +# /etc/ppp.dip +# Author : Fabrizio Polacco +# dip script to connect to vanilla dynamic IP server using PPP + + get $number *INSERT_THE_PHONE_NUMBER* + get $logname *INSERT_LOGIN_NAME*\n + get $passwd *INSERT_PASSWORD*\n + +main: + print Initializing serial port and modem ... + port modem + if $errlvl != 0 goto bad_tty + speed 115200 + reset + init ATS7=45S0=0L1V1X4&C1E1Q0%C3 + # use X3 if your modem doesn't recognize the dialtone + + get $retries 0 +redial: + # Set max. retries + if $retries == 10 goto busy_end + inc $retries + print [ $retries ] Dialing to $number + + dial $number + if $errlvl == 3 goto busy + if $errlvl == 4 goto no_carrier + if $errlvl == 5 goto no_dialtone + if $errlvl != 1 goto error + +login: + send \r\n + # some ISP ask for "Login:", others for "Username:" + #wait sername: 10 + wait ogin: 10 + if $errlvl != 0 goto login_err + send $logname + wait ord: 5 + if $errlvl != 0 goto passwd_err + send $passwd + + send ppp\n + mode PPP + goto exit + +busy: + print [ $retries ] Dialing failed (BUSY), repeating after delay (20 sec)... + print + sleep 20 + goto redial + +busy_end: + print The SLIP line is still busy. Try again later ... + goto exit_warn + +bad_tty: + print Can't open TTY line ... + print ... is the device group "dip"? + goto exit_error + +login_err: + print Error sending login name + goto exit_error + +passwd_err: + print Error sending password + goto exit_error + +no_carrier: + print Dialing failed (NO CARRIER) + goto exit_error + +no_dialtone: + print Dialing failed (NO DIALTONE) + print Have you tryed to use X3 in INIT string? + goto exit_warn + +error: + print PPP connection failed + +exit_error: + exit 10 + +exit_warn: + exit 5 + +exit: + --- dip-3.3.7p.orig/tags +++ dip-3.3.7p/tags @@ -0,0 +1,154 @@ +DST attach.c /^#define DST(x) ((x)->da & (x)->dm)$/ +MIN attach.c /^#define MIN(a,b) ((a)<(b)? (a): (b))$/ +Mmain main.c /^main(int argc, char **argv, char **envp)$/ +SET_SA_FAMILY attach.c /^#define SET_SA_FAMILY(addr, family) \\$/ +SRC attach.c /^#define SRC(x) ((x)->sa & (x)->sm)$/ +TimeOut command.c /^TimeOut(int sig)$/ +add_hash command.c /^add_hash(char *varname)$/ +add_label command.c /^add_label(char *label, off_t offset)$/ +arg_clean command.c /^void arg_clean (int argc, char **argv)$/ +argv_sprintf command.c /^char *argv_sprintf (int argc, char **argv)$/ +attach attach.c /^attach(struct dip *dip)$/ +catch main.c /^catch(int sig)$/ +cfg_clean attach.c /^cfg_clean(void)$/ +cifproxyarp attach.c /^static int cifproxyarp (void)$/ +cleanup main.c /^cleanup(void)$/ +config attach.c /^config(int when, int direction, char *buff, char */ +csum_tcpudp_magic command.c /^csum_tcpudp_magic( unsigned long saddr,$/ +cvt_char command.c /^cvt_char(char c)$/ +detach attach.c /^detach(struct dip *dip)$/ +dip_addchat main.c /^dip_addchat(struct response **seq, char *string, i/ +dip_daemon daemon.c /^dip_daemon(struct dip *dip)$/ +dip_init main.c /^dip_init(void)$/ +dip_login_setup daemon.c /^int dip_login_setup(struct dip *dp)$/ +dip_record daemon.c /^dip_record(void)$/ +dip_setup daemon.c /^dip_setup(struct dip *dp)$/ +do_adaptive slip.c /^do_adaptive(struct dip *dip)$/ +do_beep command.c /^static int do_beep(int argc, char *argv[])$/ +do_bootp command.c /^do_bootp(int argc, char *argv[])$/ +do_break command.c /^do_break(int argc, char *argv[])$/ +do_chatkey command.c /^do_chatkey(int argc, char *argv[])$/ +do_command command.c /^void do_command(fp)$/ +do_config command.c /^do_config(int argc, char *argv[])$/ +do_cslip slip.c /^do_cslip(struct dip *dip)$/ +do_cslip6 slip.c /^do_cslip6(struct dip *dip)$/ +do_csum command.c /^do_csum(unsigned char * buff, int len)$/ +do_databits command.c /^do_databits(int argc, char *argv[])$/ +do_dec command.c /^do_dec(int argc, char *argv[])$/ +do_default command.c /^do_default(int argc, char *argv[])$/ +do_dial command.c /^do_dial(int argc, char *argv[])$/ +do_echo command.c /^do_echo(int argc, char *argv[])$/ +do_flush command.c /^do_flush(int argc, char *argv[])$/ +do_get command.c /^do_get(int argc, char *argv[])$/ +do_goto command.c /^do_goto(int argc, char *argv[])$/ +do_help command.c /^do_help(int argc, char *argv[])$/ +do_if command.c /^do_if(int argc, char *argv[])$/ +do_inc command.c /^do_inc(int argc, char *argv[])$/ +do_init command.c /^do_init(int argc, char *argv[])$/ +do_login login.c /^do_login(char *name)$/ +do_mode command.c /^do_mode(int argc, char *argv[])$/ +do_modem command.c /^do_modem(int argc, char *argv[])$/ +do_netmask command.c /^do_netmask(int argc, char *argv[])$/ +do_onexit command.c /^do_onexit (int argc, char **argv)$/ +do_parity command.c /^do_parity(int argc, char *argv[])$/ +do_password command.c /^do_password(int argc, char *argv[])$/ +do_port command.c /^do_port(int argc, char *argv[])$/ +do_ppp ppp.c /^do_ppp(struct dip *dip)$/ +do_print command.c /^do_print(int argc, char *argv[])$/ +do_proxyarp command.c /^static int do_proxyarp(int argc, char *argv[])$/ +do_psend command.c /^do_psend(int argc, char *argv[]) {$/ +do_quit command.c /^do_quit(int argc, char *argv[])$/ +do_reset command.c /^do_reset(int argc, char *argv[])$/ +do_securid command.c /^do_securid(int argc, char *argv[])$/ +do_securidfixed command.c /^do_securidfixed(int argc, char *argv[])$/ +do_send command.c /^do_send(int argc, char *argv[])$/ +do_shell command.c /^do_shell(int argc, char *argv[])$/ +do_skey command.c /^do_skey(int argc, char *argv[])$/ +do_sleep command.c /^do_sleep(int argc, char *argv[])$/ +do_slip slip.c /^do_slip(struct dip *dip)$/ +do_slip6 slip.c /^do_slip6(struct dip *dip)$/ +do_speed command.c /^do_speed(int argc, char *argv[])$/ +do_stopbits command.c /^do_stopbits(int argc, char *argv[])$/ +do_term command.c /^do_term(int argc, char *argv[])$/ +do_terminal term.c /^do_terminal(void)$/ +do_termp termp.c /^do_termp(struct dip *dip)$/ +do_timeout command.c /^do_timeout(int argc, char *argv[])$/ +do_wait command.c /^do_wait(int argc, char *argv[])$/ +from64to16 command.c /^from64to16(unsigned long x)$/ +generate_random_challenge snk.c /^generate_random_challenge(char *u)$/ +get_buf command.c /^static void get_buf(void)$/ +get_ether_addr attach.c /^int get_ether_addr (u_long ipaddr, struct sockaddr/ +get_prot config.c /^get_prot(char *name)$/ +get_value command.c /^inline static void get_value(int *var, char *name)/ +getargs command.c /^getargs(char *string, char *arguments[])$/ +getdipnam login.c /^getdipnam(char *who)$/ +getkeyword command.c /^getkeyword(char *key, struct keyword *list)$/ +hanguptty tty.c /^hanguptty(void)$/ +hashsum command.c /^hashsum(char *name)$/ +if tty.c /^ if ((fd = fopen(nam, "r")) == (FILE *)0)$/ +ip_fast_csum command.c /^ip_fast_csum( unsigned char * iph,$/ +ip_ntoa attach.c /^ip_ntoa(ipaddr)$/ +is_a_num command.c /^inline static int is_a_num(char *n)$/ +is_special command.c /^int is_special(char *name)$/ +issnkregistered snk.c /^int issnkregistered(char *user, USER_DATA *ud)$/ +kill_dip main.c /^kill_dip(void)$/ +last_label command.c /^last_label(void)$/ +list_stat attach.c /^void list_stat(struct dip *dip, $/ +log_catch main.c /^log_catch(int sig)$/ +log_cleanup main.c /^log_cleanup(void)$/ +lookkeyword command.c /^lookkeyword(int code, struct keyword *list)$/ +lookup_hash command.c /^lookup_hash(char *varname)$/ +lookup_label command.c /^lookup_label(char *label)$/ +mdm_chatseq modem.c /^mdm_chatseq(char *send, struct response *expect, i/ +mdm_dial modem.c /^mdm_dial(char *number, int out)$/ +mdm_hangup modem.c /^mdm_hangup(void)$/ +mdm_init modem.c /^mdm_init(char *text)$/ +mdm_modem modem.c /^mdm_modem(char *modem)$/ +mdm_reset modem.c /^mdm_reset(void)$/ +new_kill_dip main.c /^static void new_kill_dip(char *nam)$/ +prephangup tty.c /^prephangup(void)$/ +put_bootreq command.c /^static void put_bootreq(void)$/ +put_buf command.c /^static void put_buf(unsigned char c)$/ +readifc daemon.c /^void readifc(char *ifname, int *TX, int *RX)$/ +setproctitle main.c /^setproctitle(char *fmt, ...)$/ +sifproxyarp attach.c /^static int sifproxyarp (struct dip *dip)$/ +sig_catcher daemon.c /^sig_catcher(int sig)$/ +sig_exit command.c /^sig_exit(void)$/ +sig_login_catcher daemon.c /^static void sig_login_catcher(int sig)$/ +snkauth snk.c /^int snkauth(char *username)$/ +stpcpy main.c /^char *stpcpy(char *dest, const char *src)$/ +tty_already_locked tty.c /^tty_already_locked(char *nam) \/* nam - complete pa/ +tty_askfd tty.c /^tty_askfd(void)$/ +tty_close tty.c /^tty_close(void)$/ +tty_databits tty.c /^tty_databits(char *bits)$/ +tty_find_speed tty.c /^tty_find_speed(char *speed)$/ +tty_flush tty.c /^tty_flush(void)$/ +tty_get_disc tty.c /^tty_get_disc(int *disc)$/ +tty_get_encap tty.c /^tty_get_encap(int *encap)$/ +tty_get_name tty.c /^tty_get_name(char *name)$/ +tty_get_state tty.c /^tty_get_state(struct termios *tty)$/ +tty_getc tty.c /^tty_getc(void)$/ +tty_getmode tty.c /^int tty_getmode(void)$/ +tty_login tty.c /^int tty_login(void)$/ +tty_login_close tty.c /^int tty_login_close(void)$/ +tty_nomesg tty.c /^tty_nomesg(void)$/ +tty_notlocal tty.c /^tty_notlocal(void)$/ +tty_open tty.c /^tty_open(char *name)$/ +tty_parity tty.c /^tty_parity(char *type)$/ +tty_putc tty.c /^tty_putc(int c)$/ +tty_puts tty.c /^tty_puts(char *s)$/ +tty_sendbreak tty.c /^tty_sendbreak(void)$/ +tty_set_databits tty.c /^tty_set_databits(struct termios *tty, char *databi/ +tty_set_disc tty.c /^tty_set_disc(int disc)$/ +tty_set_encap tty.c /^tty_set_encap(int encap)$/ +tty_set_parity tty.c /^tty_set_parity(struct termios *tty, char *parity)$/ +tty_set_raw tty.c /^tty_set_raw(struct termios *tty)$/ +tty_set_speed tty.c /^tty_set_speed(struct termios *tty, char *speed)$/ +tty_set_state tty.c /^tty_set_state(struct termios *tty)$/ +tty_set_stopbits tty.c /^tty_set_stopbits(struct termios *tty, char *stopbi/ +tty_setmode tty.c /^tty_setmode(int mode)$/ +tty_speed tty.c /^tty_speed(char *speed)$/ +tty_stopbits tty.c /^tty_stopbits(char *bits)$/ +udp_check command.c /^udp_check( struct udphdr *uh, int len,$/ +usage main.c /^usage(void)$/ +verify_inet_addr login.c /^int verify_inet_addr(char *p)$/