Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!brl-tgr!tgr!root%bostonu.csnet@CSNET-RELAY.ARPA From: root%bostonu.csnet@CSNET-RELAY.ARPA (BostonU SysMgr) Newsgroups: net.unix-wizards Subject: Re: Re: Ethernet problems Message-ID: <2287@brl-tgr.ARPA> Date: Mon, 21-Oct-85 10:51:43 EDT Article-I.D.: brl-tgr.2287 Posted: Mon Oct 21 10:51:43 1985 Date-Received: Wed, 23-Oct-85 03:28:05 EDT Sender: news@brl-tgr.ARPA Lines: 88 Re: Hedrick's suggestion that the problem may be with your ARP tables: Here's a hack I use to examine the arp tables on my systems, I think half of it or more is from something else, but it seems to do the job (4.2bsd): ---------arpdump.c--------------- #include #include #include #include #include #include char *fcore = "/dev/kmem", *fnlist = "/vmunix" ; struct nlist nl[] = { #define ARPTAB 0 { "_arptab" }, { "" } } ; struct arptab { struct in_addr at_iaddr; /* internet address */ u_char at_enaddr[6]; /* ethernet address */ struct mbuf *at_hold; /* last packet until resolved/timeout */ u_char at_timer; /* minutes since last reference */ u_char at_flags; /* flags */ }; /* at_flags field values */ #define ATF_INUSE 1 /* entry in use */ #define ATF_COM 2 /* completed entry (enaddr valid) */ #define ARPTAB_BSIZ 5 /* bucket size */ #define ARPTAB_NB 19 /* number of buckets */ #define ARPTAB_SIZE (ARPTAB_BSIZ * ARPTAB_NB) struct arptab *arptab, atab ; main(argc,argv) int argc ; char **argv ; { int fc ; int i,j ; int secs ; char *ap ; struct hostent *gethostbyaddr(), *hp ; if((fc = open(fcore,0)) < 0) { perror(fcore) ; exit(1) ; } nlist(fnlist,nl) ; arptab = (struct arptab *) nl[ARPTAB].n_value ; if(nl[0].n_type == 0) { fprintf(stderr,"No name list %s\n",fnlist) ; exit(1) ; } if(argc > 1) secs = atoi(argv[1]) ; else secs = 0 ; printf("\t\tACTIVE ARP TABLE DUMP\n") ; loop: printf("Index\tAddr\t\tEthernet Interface\tHostName\n") ; lseek(fc,(int) arptab,0) ; ap = (char *) &atab.at_iaddr ; for(i=0 ; i < ARPTAB_SIZE ; i++) { if(read(fc,&atab,sizeof atab) != (sizeof atab)) { fprintf(stderr,"Error reading arp table\n") ; exit(1) ; } if(inet_netof(atab.at_iaddr) == 0) continue ; printf("%2d:\t",i) ; printf("%s\t",ap = (char *) inet_ntoa(atab.at_iaddr)) ; for(j=0 ; j < 6 ; j++) printf("%02x",atab.at_enaddr[j]) ; if((hp = gethostbyaddr(&atab.at_iaddr.s_addr, sizeof atab.at_iaddr.s_addr, AF_INET)) == NULL) printf("\t\t(unknown)") ; else printf("\t\t%s",hp->h_name) ; printf("\n") ; } if(secs <= 0) exit(0) ; sleep(secs) ; goto loop ; } -Barry Shein, Boston University