#!/bin/rc # # command: /bin/boddle /usr/rsc/plan9/cd/cmd/ip . # srcdir: /usr/rsc/plan9/cd/cmd/ip # version: 898308838 # date: Sat Jun 20 02:13:58 GMT 1998 # myname=$0 doextract=no fn usage{ echo $myname: usage: $myname '[-X] [src-directory]' >[1=2] exit usage } fn sigint{ rm -rf 898308838 exit interrupt } while(~ $1 -*){ switch($1){ case -X doextract=yes case -* usage } shift } switch($#*){ case 0 srcdir=/usr/rsc/plan9/cd/cmd/ip case 1 srcdir=$1 case * usage } if(! ~ $doextract yes){ echo This shell file contains a bundle of diffs representing changes echo to original source files in the Plan 9 distribution. It will run echo against the files in echo ' ' $srcdir echo '(unless overridden by the optional source directory argument)' echo and create a directory 898308838 containing the updated files. echo It will NOT automatically update the original files. echo echo Invoke with argument -X to perform the actual extraction. exit 0 } rm -rf 898308838 mkdir 898308838 target=898308838/arpd.c echo -n '898308838/arpd.c: ' if(! test -f $srcdir/arpd.c || ! test -r $srcdir/arpd.c){ echo $srcdir/arpd.c unreadable exit unreadable } sum=`{sum < $srcdir/arpd.c} if(! ~ 9fa2e5675731 $sum(1)^$sum(2)){ echo $srcdir/arpd.c is not the original distribution file exit original } cp $srcdir/arpd.c 898308838/arpd.c ed 898308838/arpd.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM arpd.c' 290a . 259d 250c ippending(uchar *ip) . 244c ippending(entry.ipaddr); . 103,105c if((arpdev = open("#a/arp/data", ORDWR)) < 0) . 101c sprint(name, "arpd %s", etherdev + 5); /* 5 -> "etherX" */ WRITESTR(ectl, name); . 99a switch(argc){ default: usage(); break; case 1: parseip(ipaddr, argv[0]); break; case 0: sprint(name, "%E", eaddr); if(ndbgetval(db, &s, "ether", name, "ip", name) == 0) { fprint(2, "arpd: failed ndbgetval for %E\n", eaddr); usage(); } parseip(ipaddr, name); break; } . 87,88d 79,80c usage(); . 61a Ndbs s; . 54a usage(void) { fprint(2, "usage: arpd [-dp] [-e device] [-b broadcast address] [ipaddr]\n"); exits("usage"); } void . 47c char *etherdev = "ether0"; . 37c void ippending(uchar*); . 9d 6a #include . wq //GO.SYSIN DD VADIM arpd.c sum=`{sum < 898308838/arpd.c} if(~ 56c27ebb5923 $sum(1)^$sum(2)) echo if not{ echo 898308838/arpd.c checksum error creating updated file exit checksum } target=898308838/bootp.c echo -n '898308838/bootp.c: ' if(! test -f $srcdir/bootp.c || ! test -r $srcdir/bootp.c){ echo $srcdir/bootp.c unreadable exit unreadable } sum=`{sum < $srcdir/bootp.c} if(! ~ bb0fb3e46662 $sum(1)^$sum(2)){ echo $srcdir/bootp.c is not the original distribution file exit original } cp $srcdir/bootp.c 898308838/bootp.c ed 898308838/bootp.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM bootp.c' 330a . 66,68d 59,60d 40d wq //GO.SYSIN DD VADIM bootp.c sum=`{sum < 898308838/bootp.c} if(~ b20e5f396463 $sum(1)^$sum(2)) echo if not{ echo 898308838/bootp.c checksum error creating updated file exit checksum } target=898308838/ipconfig.c echo -n '898308838/ipconfig.c: ' if(! test -f $srcdir/ipconfig.c || ! test -r $srcdir/ipconfig.c){ echo $srcdir/ipconfig.c unreadable exit unreadable } sum=`{sum < $srcdir/ipconfig.c} if(! ~ 3eb158446142 $sum(1)^$sum(2)){ echo $srcdir/ipconfig.c is not the original distribution file exit original } cp $srcdir/ipconfig.c 898308838/ipconfig.c ed 898308838/ipconfig.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM ipconfig.c' 323a . 228c if(ename == 0 && sysname == 0) . 212,214c ipname = 0; . 187c execl(ARPD, "arpd", "-e", device, buf, 0); . 185c execl(ARPD, "arpd", "-pe", device, buf, 0); . 182d 180c sprint(buf, "%I", ii.ipaddr); switch(rfork(RFPROC|RFNOWAIT|RFNOTEG)) { . 174,176d 171,172d 163,167c } else { if(nobootp == 0) bootp(&ii); buf[i] = '\0'; sprint(maskbuf, "%I", ii.ipaddr); if (strstr(buf, maskbuf)) { /* special case for boot when arp needs to be started */ if (*(strchr(buf, '\n') + 1) != '\0') { print("ipconfig: address %s already set\n", maskbuf); exits(0); } } else { WRITESTR(ectl, "push arp"); WRITESTR(ectl, "push internet"); WRITESTR(ectl, "push permanent"); if(mflag == 0){ sprint(maskbuf, "%I", ii.ipmask); mask = maskbuf; } sprint(buf, "setip %I %s", ii.ipaddr, mask); print("ipconfig: %s\n", buf); if(write(ectl, buf, strlen(buf)) < 0) { syslog(1, iplog, "write: setip: %r"); exits(Bad); } . 158,161c csaddnet("il"); csaddnet("tcp"); csaddnet("udp"); . 153,156d 111c if (!i){ . 109a i = 0; if((fd = open("#P/ipifc", OREAD)) < 0){ fprint(2, "ipconfig: can't open #P/ipifc: %r\n"); exits(Bad); } else { if ((i = read(fd, buf, sizeof(buf))) < 0){ fprint(2, "ipconfig: can't read #P/ipifc: %r\n"); exits(Bad); } close(fd); } . 93c close(fd); . 88,89c fd = dial(netmkaddr("0x800", device, 0), 0, 0, &ectl); if(fd < 0){ . 71,73d 60d 57d 52,54c int i, nobootp; int ectl, fd; char buf[1024]; . 45c fprint(2, "usage: ipconfig [-bap] [-e device] [-m ipmask] [ipaddr]\n"); . 26c char *device = "ether0"; . wq //GO.SYSIN DD VADIM ipconfig.c sum=`{sum < 898308838/ipconfig.c} if(~ 7256a6476479 $sum(1)^$sum(2)) echo if not{ echo 898308838/ipconfig.c checksum error creating updated file exit checksum } target=898308838/rarpd.c echo -n '898308838/rarpd.c: ' if(! test -f $srcdir/rarpd.c || ! test -r $srcdir/rarpd.c){ echo $srcdir/rarpd.c unreadable exit unreadable } sum=`{sum < $srcdir/rarpd.c} if(! ~ 1fa94c3e2625 $sum(1)^$sum(2)){ echo $srcdir/rarpd.c is not the original distribution file exit original } cp $srcdir/rarpd.c 898308838/rarpd.c ed 898308838/rarpd.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM rarpd.c' 139a . 28,29c char rlog[] = "rarpd"; char *device = "ether0"; . wq //GO.SYSIN DD VADIM rarpd.c sum=`{sum < 898308838/rarpd.c} if(~ 70f835ef2626 $sum(1)^$sum(2)) echo if not{ echo 898308838/rarpd.c checksum error creating updated file exit checksum } target=898308838/snoopy.c echo -n '898308838/snoopy.c: ' if(! test -f $srcdir/snoopy.c || ! test -r $srcdir/snoopy.c){ echo $srcdir/snoopy.c unreadable exit unreadable } sum=`{sum < $srcdir/snoopy.c} if(! ~ cef0532512734 $sum(1)^$sum(2)){ echo $srcdir/snoopy.c is not the original distribution file exit original } cp $srcdir/snoopy.c 898308838/snoopy.c ed 898308838/snoopy.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM snoopy.c' 282c fd = dial("ether0!-1", 0, 0, &cfd); . wq //GO.SYSIN DD VADIM snoopy.c sum=`{sum < 898308838/snoopy.c} if(~ 31bd98f112735 $sum(1)^$sum(2)) echo if not{ echo 898308838/snoopy.c checksum error creating updated file exit checksum }