Hi!

I had a hard day figuring out what was wrong with my code.
I found that pcap_pkthdr is defined different in the include files.

in /usr/include/linux/ring.h it is defined as 

#ifndef HAVE_PCAP
struct pcap_pkthdr {
  struct timeval ts;    /* time stamp */
  u_int32_t caplen;     /* length of portion present */
  u_int32_t len;        /* length this packet (off wire) */
};
#endif

and in /usr/src/linux-2.6.20/include/linux/ring.h this way:

#ifndef HAVE_PCAP
struct pcap_pkthdr {
  struct timeval ts;    /* time stamp */
  u_int32_t caplen;     /* length of portion present */
  u_int32_t len;        /* length this packet (off wire) */
  /* packet parsing info */
  u_int16_t eth_type; /* Ethernet type */
  u_int16_t vlan_id;  /* VLAN Id or -1 for no vlan */
  u_int8_t  l3_proto;  /* Layer 3 protocol */
  u_int16_t l3_offset, l4_offset; /* Offsets of L3 and L4 elements */
  u_int32_t ipv4_src, ipv4_dst;   /* IPv4 src/dst IP addresses */
  u_int16_t l4_src_port, l4_dst_port; /* Layer 4 src/dst ports */
  };
#endif

Maybe i made a mess with the include files and different versions,
but: 

Above struct (the longer one) should really be named pfring_pkthdr or
something and not pcap_pkthdr. 


Cheers,

-Michael

_______________________________________________
Ntop-misc mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-misc

Reply via email to