Hi to all,
i would like some help regarding the following:
I'm trying myself at network programming and I want to access the TCP flags in a TCP packet. I know that in C programming language, the TCP header can be accessed in the following manner:
Code:
const struct ethernet_header *ethernet;
const struct tcp_header *tcp;
const u_char *packet;
ethernet = (struct ethernet_header*) (packet)
tcp = (struct tcp_header*) (packet + size_ethernet + size_ip)
We kind of skip past the ethernet frame and IP packet headers. But I'm having problems with how to access the TCP flags (SYN, ACK, URG, FIN...).
Can anyone help me with this? Any help will be very much appreciated.
Warm regards,
Visham