Help with TCP Options in C


 
Thread Tools Search this Thread
Top Forums Programming Help with TCP Options in C
# 1  
Old 07-24-2009
Help with TCP Options in C

Hello everybody,
It's me again, i need your help!
I was almost finishing a program when it crashed, because of TCP segments with the TCP Options enabled.

I am able to control every field of every packet i receive, except of those using TCP Options. Is there a way to determine if a packet is using TCP Options, and the Options size to reduce it to the TCP payload?

there are no more fields after Urgent Pointer (urg_ptr) in the /usr/include/linux/tcp.h file, Please, Help!!

Thank you.

---------- Post updated at 03:46 PM ---------- Previous update was at 03:27 PM ----------

I've found the solution, the TCP Offset determines the size of the header, and with no options it's normal value is twenty. If tcp->doff is greater than 20, it means that the TCP Segment has the Options field enabled, and the Options field size is the value of the offset minus 20.

Thanks anyway.
Zykl0n-B
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

Too much TCP retransmitted and TCP duplicate on server Oracle Solaris 10

I have problem with oracle solaris 10 running on oracle sparc T4-2 server. Os information: 5.10 Generic_150400-03 sun4v sparc sun4v Output from tcpstat.d script TCP bytes: out outRetrans in inDup inUnorder 6833763 7300 98884 0... (2 Replies)
Discussion started by: insatiable1610
2 Replies

2. Ubuntu

Kernel boot options removed by fault, no boot options

Hello Everyone, First of all, I highly appreciate all Linux forum members and whole Linux community. http://forums.linuxmint.com/images/smilies/icon_wink.gif. I wish you the best for all of you ! I will try to be short and concise: I am using Linux Mint 10 for 2 months on 2 ws, and all went... (3 Replies)
Discussion started by: cdt
3 Replies

3. IP Networking

Doubt regarding TCP Options negotiation

Hi, I am aware that duirng the intial SYN, SYN-ACK, ACK (connection establishment) phase, both TCP ends advertize TCP options (or extended features) each would like to use for the connection. Ultimately both ends end up using TCP options commonly supported and advertized by both. My doubt... (2 Replies)
Discussion started by: jake24
2 Replies

4. Red Hat

tcp/ip problem

how the data from disk is loaded into memory and then it transfered to tcp/ip packet. how i can find how many pages are loaded into memory by that process what is the rate of context switch for that process. (5 Replies)
Discussion started by: amar20
5 Replies

5. IP Networking

TCP/IP in c (unix)

I have written a client receive (TCP/IP) program which is up all the time. It connects to the server during Beginning of the day and stays alert and reads a message whenever one comes in. the problem is after receiving a message, the client_receive program is getting a message with zero bytes.... (0 Replies)
Discussion started by: Rajeshsu
0 Replies

6. IP Networking

Tcp\ip

I have written a TCP/IP client and server program. The client sends a message to the server and then the server sends a file back to the client. The client reads the buffer and stores it another file in the client side. I need to know what are the various exceptions that I need to handle in... (0 Replies)
Discussion started by: Rajeshsu
0 Replies

7. Programming

Changing TCP/IP Options in SunOS

Due to some project requirement I am writing an application which uses Transport Layer Interface (TLI's) in Sun OS Release 5.8. The problem is in setting the tcp's TCP_KEEPIDLE or TCP_KEEPINTVL or TCP_NKEEP parameters by t_optmgmt ( ) function.I understand that in Sun OS these are referenced by... (2 Replies)
Discussion started by: S.P.Prasad
2 Replies

8. Cybersecurity

Tcp/ip

!HELLO , What is the maximum number of hosts on a TCP/IP internet? plz can u help me. :rolleyes: (2 Replies)
Discussion started by: smdakram
2 Replies
Login or Register to Ask a Question