Hi,

I am trying to compile a program I wrote that needs to find the size of
the tcphdr struct but I keep getting the following error:

gcc main.c -lpcap && ./a.out
main.c: In function `gotPacket':
main.c:68: sizeof applied to an incomplete type

Here is the code

<snip
#include <netinet/ip.h>
#include <net/ethernet.h>

...

        struct ip *ip;
        struct tcphdr *tcp;
        struct ether_header *ethernet;
        char *payload;
        
        int size_ip=sizeof(struct ip);
        int size_tcphdr=sizeof(struct tcphdr); // line 68
        int size_ethernet=sizeof(struct ether_header);

        ethernet=(struct ether_header*)(packet);



</snip>

Thanks for any help. 

Cheers

Paul


Reply via email to