[Winpcap-users] Re: linked list problem urgent help needed!

Steve Mc Donnell s-mc-d at hotmail.com
Mon Apr 24 22:07:23 GMT 2006


>You *are* allocating new "pcap_pkthdr" structures for each new packet, 
>right?  (I presume, from

I think so, if pcap_pkthdr is one of the fields in the packet struct:
typedef struct packet{
		int packet_number;
                struct pcap_pkthdr *pkt_header; //points to the header of a 
packet
                const u_char *pkt_data; //packet data
		struct packet *next; //pointer to next node in list
	} packet;

and if I'm creating a new one of these nodes for each packet that should 
cover it right?

>I'm a C programmer rather than a C++ programmer, but it sounds like you're 
>copying the pointer to the header record rather than the entire struct.
>
>Specifically, does
>
>tail->pkt_header = this->SniffEther->pkt_header;
>
>copy just the pointer to the header or the entire struct?
>
>DC

I'll admit, getting my head around pointers is definitly not one of my 
strong points. Since I can pass this->SniffEther->pkt_header directly to the 
function to update the gui I just assumed I could assign it to 
tail->pkt_header the same way.

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/



More information about the Winpcap-users mailing list