I ran a program ( the link is - http://www.security-freak.net/raw-so...r_eth_ip_tcp.c
) in my fedora core 5. On compilation , i get the following errors :
[root@localhost ~]# gcc sniffer_eth_ip_tcp.c
In file included from sniffer_eth_ip_tcp.c:12: /usr/include/linux/ip.h:97: error: expected specifier-qualifier-list before ‘uint8_t’
In file included from /usr/include/linux/tcp.h:21,
/usr/include/asm/byteorder.h:6:2: warning: #warning using private kernel header; include <endian.h> instead!
sniffer_eth_ip_tcp.c: In function ‘ParseIpHeader’:
sniffer_eth_ip_tcp.c:147: error: ‘struct iphdr’ has no member named ‘daddr’
sniffer_eth_ip_tcp.c:148: error: ‘struct iphdr’ has no member named ‘saddr’
sniffer_eth_ip_tcp.c: In function ‘ParseTcpHeader’:
sniffer_eth_ip_tcp.c:185: error: ‘struct iphdr’ has no member named ‘protocol’
sniffer_eth_ip_tcp.c:187: error: ‘struct iphdr’ has no member named ‘ihl’
But , the struct iphdr in the corresponding header file contains the above mentioned data members. I feel the last four errors will be solved if the ones before them are solved.
can anyone please help..