9 char *printether(u_int8_t *addr)
14 sprintf(out, "%02x:%02x:%02x:%02x:%02x:%02x",
22 int cmpether(u_int8_t *addr, u_int8_t *addr2)
25 for (i=0; i<ETH_ALEN; i++)
27 if (addr[i] != addr2[i])
33 void printframe(struct pcap_pkthdr *hdr, char *pkt)
36 struct ether_header *ether = NULL;
38 if ( (!hdr) || (!pkt) )
41 if (hdr->caplen != hdr->len)
42 fprintf(stderr, "rpld: caplen/len mismatch\n");
44 ether = (struct ether_header *)pkt;
46 printf("\n\nrpld: %s > ", printether(ether->ether_shost));
47 printf("%s\n", printether(ether->ether_dhost));
49 //pkt = 18; /* skip over ethernet headers */
50 for (i=0;i<hdr->caplen;i+=2)
54 printf("%02x%02x ", pkt[i] &0xff, pkt[i+1] & 0xff);