Thursday, December 25, 2008

Adjust the performance of WinPcap

1. WinPcap archtechure




2. Performance related function.

2.1 int pcap_setuserbuffer(pcap_t *p, int size); // set the user-buffer size, in bytes,

2.2 int pcap_setbuff (pcap_t *p, int dim); // set the kernel-buffer size, in bytes

2.3 int pcap_setmintocopy (pcap_t *p, int size);//

2.4 send multi-packages to the kernel at once

pcap_send_queue* pcap_sendqueue_alloc ( u_int memsize );
void pcap_sendqueue_destroy ( pcap_send_queue * queue ) ;
int pcap_sendqueue_queue ( pcap_send_queue * queue, const struct pcap_pkthdr * pkt_header, const u_char * pkt_data );
u_int pcap_sendqueue_transmit ( pcap_t * p, pcap_send_queue * queue, int sync )

1 comment:

Anonymous said...

a rare and good note on the topic. thanks.