I am trying to set up a queuing routine for packets returned from pcap_loop(). I am able to copy the pcap_pkthdr into the list element by element and dequeue it correctly. If I try to copy the packet data into the queue I am only able to dequeue the last packet captured. So I assume I am only copying the pointer into the list. I am new to writing programs and cannot seem to properly dereference the pointer and copy the data into the queue. Any advice or samples would be greatly appreciated.

The queue is a linked list whose nodes contain a structure as follows.

typedef struct _queue_node

{

            struct pcap_pkthdr * pkthdr;

            u_char  * pkt;

}queue_node;

The queuing function is passed a pointer to the packet header and data.

 

-thanks

Reply via email to