I'm trying to compile "Example 11-9. Source code to the SYNplescan tool" from this NetworkSecurityTools book on Ubuntu 18.04: http://books.gigatux.nl/mirror/networksecuritytools/0596007949/networkst-CHP-11-SECT-4.html
But it says
error: dereferencing pointer to incomplete type ‘struct tcphdr’
if (tcp->th_flags == 0x14)
^~
How do I fix this?
People change and includes come and go, after the following changes:
I was able to compile with:
with no compiler messages. I guess that once
netinet/tcp.h
was included bylibnet.h
or maybe bypcap.h
- seems not be the case anymore and you have to includenetinet/tcp.h
yourself forstruct tcphdr
.