LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-05-2004, 10:07 AM   #1
guam
LQ Newbie
 
Registered: Feb 2004
Location: Korea
Posts: 25

Rep: Reputation: 15
Using the option field in IP header


Hello everyone,

I want to use the option field of IP header and add some custom information to the IP header. Can anyone suggest me how is it possible?

From some research, I found that I can use ip_var.h file. But I can not find the file in /usr/include/netinet directory. I am using Redhat 8.0.

Appreciate your help.

Thanks

Guam
 
Old 11-06-2004, 03:11 PM   #2
krupa
LQ Newbie
 
Registered: Sep 2003
Posts: 6

Rep: Reputation: 0
Assuming you have nothing but good intentions in mind, don't touch the IP options. Write your own layer 7 header that contains your "custom information".

If you put your own crap in the IP header, no one else's computer will know what to do with it. If it's a good stack (the thing that takes packets apart inside your computer), the packet's will be dropped. If it's a bad stack... well, who knows.
 
Old 11-06-2004, 09:51 PM   #3
randyding
Member
 
Registered: May 2004
Posts: 552

Rep: Reputation: 31
The first byte of IP packet is normally 0x45, the 5 means 5*4=20 bytes in the header. If you make it 0x46 then you have an additional 4 bytes of options immediately following the header. The previous post is right, don't modify the ip header by adding options, your results will only be frustrating when the receiving computer doesn't handle it the way you expect. This doesn't mean they don't exist, but I've never seen the options used for anything in modern computers and I wouldn't be surprised if its broken in most stacks.
 
Old 08-22-2011, 11:39 PM   #4
Maitrikkshah
LQ Newbie
 
Registered: Aug 2011
Posts: 9

Rep: Reputation: Disabled
hey guam i have similar problem as u... I also want to add my custom info in the options field of ip header... Have you find any solution how to do it... Please help me... Please give me a reply...
 
Old 08-23-2011, 03:56 AM   #5
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,507

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Quote:
Originally Posted by Maitrikkshah View Post
hey guam i have similar problem as u... I also want to add my custom info in the options field of ip header... Have you find any solution how to do it... Please help me... Please give me a reply...
Do you realize that you posted to a thread that is nearly 7 years old? I'm sure Guam has moved onto other things, and probably doesn't monitor this forum anymore.

You'll have better luck opening a new thread.
 
Old 08-25-2011, 04:52 AM   #6
Maitrikkshah
LQ Newbie
 
Registered: Aug 2011
Posts: 9

Rep: Reputation: Disabled
Yes for that reason i have sent him an email also...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error using RPM -header read field? tonywoptio Linux - Software 1 11-01-2005 05:14 PM
Adding Option field in IP header guam Linux - Networking 0 11-04-2004 10:17 AM
Setting TOS field in IP header malik_mca Programming 1 10-13-2004 01:42 PM
CC field in Evolution mblanco2000 Linux - Software 3 04-16-2004 05:10 PM
c header files in linux in place of header files in windows? harun_acs Programming 1 03-17-2004 02:24 AM


All times are GMT -5. The time now is 09:14 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration