diff -u --recursive rpld-1.2/Makefile rpld-1.2.patched/Makefile --- rpld-1.2/Makefile Wed Sep 15 16:29:10 1999 +++ rpld-1.2.patched/Makefile Sat Apr 1 02:02:06 2000 @@ -70,7 +70,7 @@ # issue a retransmit request causing a delay. # do make clean after changing this -DEFINES=-DPACKET_DELAY=0 +DEFINES=-DPACKET_DELAY=10000 -DDEBUG # where do you want all this stuff @@ -190,13 +190,13 @@ ana:ana.c realtime: ana - tcpdump -l -x -s 2048 ether[14]=0xfc and ether[15]=0xfc | ana + tcpdump -l -x -s 2048 ether[14]=0xfc and ether[15]=0xfc | ./ana capture: tcpdump -x -s 2048 ether[14]=0xfc and ether[15]=0xfc -w capture.dat replay: ana capture.dat - tcpdump -x -r capture.dat | ana + tcpdump -x -r capture.dat | ./ana nics: nics.doesntexist diff -u --recursive rpld-1.2/ana.c rpld-1.2.patched/ana.c --- rpld-1.2/ana.c Wed Sep 15 16:29:10 1999 +++ rpld-1.2.patched/ana.c Fri Mar 31 22:35:06 2000 @@ -19,6 +19,8 @@ * */ +#define MAX_HOSTNAME_LEN 255 + unsigned char pbuf[4096]; int plen; @@ -220,11 +222,14 @@ main () { int i, s; + int dataflag; char *pptr; *buf = '\t'; while (!feof (stdin)) { + char name[MAX_HOSTNAME_LEN]; + dataflag=0; get_packet (); pptr = pbuf; @@ -232,6 +237,59 @@ plen -= 2; printf (" Pack Type:"); + if (plen == 0x494e) { /* fscking "IP"-2+1 */ + if (pull_short(pptr) == 0x4c4f) + pptr += 2; + plen -= 2; + if (pull_short (pptr) == 0x4b01) { + printf (" IPLOK:"); + pptr += 2; + plen -= 2; + if ((pull_short (pptr) == 0) && (pull_short (pptr+2) == 0) && (pull_short (pptr+4) == 0)) { + pptr += 9; /* wtf? why not a prime? */ + plen -= 9; + printf ("\n YOU-ARE %i.%i.%i.%i", + pptr[0]&0xff, pptr[1]&0xff, pptr[2]&0xff, pptr[3]&0xff); + pptr += 4; + plen -= 4; + printf ("\n NETMASK %i.%i.%i.%i", + pptr[0]&0xff, pptr[1]&0xff, pptr[2]&0xff, pptr[3]&0xff); + pptr += 4; + plen -= 4; + printf ("\n NETWORK %i.%i.%i.%i", + pptr[0]&0xff, pptr[1]&0xff, pptr[2]&0xff, pptr[3]&0xff); + pptr += 4; + plen -= 4; + printf ("\n GW %i.%i.%i.%i", + pptr[0]&0xff, pptr[1]&0xff, pptr[2]&0xff, pptr[3]&0xff); + pptr += 4; + plen -= 4; + snprintf (name, MAX_HOSTNAME_LEN, "\n DNS %s\n ", &pptr[0]); + printf(name); + if (strlen(name) > MAX_HOSTNAME_LEN) { + pptr += MAX_HOSTNAME_LEN; + plen -= MAX_HOSTNAME_LEN; + } else { + pptr += strlen(name); + plen -= strlen(name); + } + } else { + printf (" I-AM %0.2x:%0.2x:%0.2x:%0.2x:%0.2x:%0.2x", + pptr[0]&0xff, pptr[1]&0xff, pptr[2]&0xff, pptr[3]&0xff, pptr[4]&0xff, pptr[5]&0xff); + pptr += 6; + plen -= 6; + }; +/* if ((i = pull_short(pptr)) > 0) { + printf (" - \n weird payload (presumably 0x%x words) found, skipping ",i); + plen = 2*i; + } + plen=0; +*/ + dataflag=unix; + } else + printf (" IPLOK lookalike???: 0x%04x ?:", pull_short (pptr)); + } else + switch (pull_short (pptr)) { case 0x1: @@ -245,6 +303,7 @@ break; case 0x20: printf (" FILE.DATA.RESPONSE:"); + dataflag=unix; break; default: printf (" 0x%04x ?:", pull_short (pptr)); @@ -253,7 +312,8 @@ pptr += 2; plen -= 2; - s = ana_frag (pptr, plen); + if (!dataflag) + s = ana_frag (pptr, plen); printf ("\n\n"); Only in rpld-1.2.patched/: binpack.pl Only in rpld-1.2.patched/: d diff -u --recursive rpld-1.2/llc.c rpld-1.2.patched/llc.c --- rpld-1.2/llc.c Wed Sep 15 16:29:10 1999 +++ rpld-1.2.patched/llc.c Sat Apr 1 00:07:46 2000 @@ -62,7 +62,7 @@ struct llchdr *h = (struct llchdr *) buf; int llclen; - if ((h->h_dsap == RPL_SAP) && (h->h_ssap == RPL_SAP)) + if (((h->h_dsap == MY_RPL_SAP) || (h->h_dsap == RPL_SAP)) && (h->h_ssap == RPL_SAP)) { #ifdef DEBUG diff -u --recursive rpld-1.2/project.h rpld-1.2.patched/project.h --- rpld-1.2/project.h Wed Sep 15 16:29:10 1999 +++ rpld-1.2.patched/project.h Sat Apr 1 03:54:27 2000 @@ -63,7 +63,7 @@ #define MAX_FRAME_LEN 1514 #define MY_FRAME_LEN 1500 -#define MY_BLOCK_LEN 1440 /*quad word aligned */ +#define MY_BLOCK_LEN 1440 /*quad word aligned*/ #define CONFIG_FILE "/etc/rpld.conf" diff -u --recursive rpld-1.2/protocol.c rpld-1.2.patched/protocol.c --- rpld-1.2/protocol.c Wed Sep 15 16:29:10 1999 +++ rpld-1.2.patched/protocol.c Sat Apr 1 00:08:11 2000 @@ -73,7 +73,7 @@ } c->framelen = out.framelen = (in->framelen > c->framelen) ? c->framelen : in->framelen; - out.sap = RPL_SAP; + out.sap = MY_RPL_SAP; bcopy (in->mymac, out.youmac, ETH_ALEN); bcopy (nit_mac (n), out.mymac, ETH_ALEN); diff -u --recursive rpld-1.2/rpl.h rpld-1.2.patched/rpl.h --- rpld-1.2/rpl.h Wed Sep 15 16:29:10 1999 +++ rpld-1.2.patched/rpl.h Fri Mar 31 23:57:48 2000 @@ -44,6 +44,7 @@ #define LLC_RPL_OVERHEAD 0x30 #define RPL_SAP 0xfc +#define MY_RPL_SAP 0xf8 #define RPL_PK_FIND 0x0001 #define RPL_PK_FOUND 0x0002 diff -u --recursive rpld-1.2/rpld.c rpld-1.2.patched/rpld.c --- rpld-1.2/rpld.c Wed Sep 15 16:29:10 1999 +++ rpld-1.2.patched/rpld.c Fri Mar 31 22:44:30 2000 @@ -55,7 +55,11 @@ daemonize (); - n = nit_open (NULL); + if (argc>=2) + n = nit_open (argv[1]); + else + n = nit_open (NULL); + if (!n) { Only in rpld-1.2: rpld_conf.tab.c Only in rpld-1.2: rpld_conf.tab.h Only in rpld-1.2: rpld_conf.yy.c diff -u --recursive rpld-1.2/util.c rpld-1.2.patched/util.c --- rpld-1.2/util.c Wed Sep 15 16:29:10 1999 +++ rpld-1.2.patched/util.c Sat Apr 1 00:31:07 2000 @@ -56,6 +56,7 @@ { int fd; +#ifndef DEBUG /* grrrrrrrrr! aoe */ switch (fork ()) { case 0: @@ -67,12 +68,14 @@ default: exit (0); } +#endif setpgrp (); - +#ifndef DEBUG /* grrrrrrrrr! aoe */ fd = open ("/dev/null", O_RDWR); dup2 (fd, 0); dup2 (fd, 1); dup2 (fd, 2); close (fd); +#endif }