Accessing ifunit/ifaddr_byindex

2005-03-17 Thread Patrik Arlos
rbuf); if(fp==-1){ fprintf(stderr,"Error opening adapter %s",argv[1]); return(-1); } pcap_loop(fp,5,dispatch_handler,NULL); return(0); } void dispatch_handler(u_char *temp1, const struct pcap_pkthdr *header, const u_char *pkt_data) { u_int i=0; printf("%ld:%l

Sending Ethernet frames

2005-03-21 Thread Patrik Arlos
Hi, I'm trying to send 'raw' Ethernet frames. I have however not found any examples of how to do this in BSD. Is it possible to open a 'ethernet' socket, similar to a AF_INET? I need to be able to control the destination address and type/len field in the Ethernet header. In Linux it is pos