Operating System - Linux
1827856 Members
1516 Online
109969 Solutions
New Discussion

Re: How to get the flags in TCP header in application level?

 
Robert Pang
New Member

How to get the flags in TCP header in application level?

I want to get the TCP flags(such as FIN,ACK ,RST) which are in the TCP header in my applications via 'socket'method.
How can I do it?
Thank you

Robert Pang
2 REPLIES 2
Ron Kinner
Honored Contributor

Re: How to get the flags in TCP header in application level?

The following URL has code for a packet sniffer which looks at the flags. It should get you started.

http://westcose.nologin.org/code/ip_sniff.c.htm

Ron

westcose
New Member

Re: How to get the flags in TCP header in application level?

Hello Robert Pang,
Sounds like you need a sniffer. If you are running X, I reccomend ethereal. It is a very good stable sniffer that will allow you to dissect and analyze the packet data. If you are not using X, then ip_sniff(mentioned above) or tcpdump will work fine.

-westcose