Re: Setting IP Options in the IP-Header

2000-11-16 Thread Mike A. Harris

On Thu, 16 Nov 2000, Nishant Rao wrote:

>Date: Thu, 16 Nov 2000 11:55:24 -0600 (CST)
>From: Nishant Rao <[EMAIL PROTECTED]>
>To: Andi Kleen <[EMAIL PROTECTED]>
>Cc: [EMAIL PROTECTED]
>Content-Type: TEXT/PLAIN; charset=US-ASCII
>Subject: Re: Setting IP Options in the IP-Header
>
>Well, while what you say makes sense, it isn't exactly a solution to our
>problem.
>
>we are trying to expose and set a NEW option altogether. So our question 
>pertains more to what code we write in the kernel to create and expose a 
>new custom option. so for this, we would need to know the offsets of the
>current options like source routing etc and then hopefully try and stuff
>data from setting our option after the maximum that can be set by these
>other existing options.
>
>once that code is in place within the ip_build_options routine in the
>ip_options.c file in the linux kernel, we can then use the setsockopt() 
>at the application level to make sure that a packet is filled with the
>corresponding option.
>
>i hope i was able to explain my question more clearly.

RFC791 should give you all you need to know I believe, plus
examining the existing kernel sources. It's pretty basic.

--
  Mike A. Harris  -  Linux advocate  -  Open source advocate
  This message is copyright 2000, all rights reserved.
  Views expressed are my own, not necessarily shared by my employer.
--

Red Hat Linux:  http://www.redhat.com
Download for free:  ftp://ftp.redhat.com/pub/redhat/redhat-6.2/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Setting IP Options in the IP-Header

2000-11-16 Thread Andi Kleen

On Thu, Nov 16, 2000 at 11:55:24AM -0600, Nishant Rao wrote:
> Well, while what you say makes sense, it isn't exactly a solution to our
> problem.
> 
> we are trying to expose and set a NEW option altogether. So our question 
> pertains more to what code we write in the kernel to create and expose a 
> new custom option. so for this, we would need to know the offsets of the
> current options like source routing etc and then hopefully try and stuff
> data from setting our option after the maximum that can be set by these
> other existing options.
> 
> once that code is in place within the ip_build_options routine in the
> ip_options.c file in the linux kernel, we can then use the setsockopt() 
> at the application level to make sure that a packet is filled with the
> corresponding option.
> 
> i hope i was able to explain my question more clearly.

It still does not make more sense. Linux never generates options itself,
so there are no fixed offsets for you to know. It all depends on the 
one generating the options in the first place (application or peer) 

If you want to add a new option you'll need to add an option parser that
handles all cases. For application sending it is probably better to just
change the application though. 

Usually it is not a good idea to add options anyways, because they tend
to trigger slow paths in routers.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Setting IP Options in the IP-Header

2000-11-16 Thread Nishant Rao

Well, while what you say makes sense, it isn't exactly a solution to our
problem.

we are trying to expose and set a NEW option altogether. So our question 
pertains more to what code we write in the kernel to create and expose a 
new custom option. so for this, we would need to know the offsets of the
current options like source routing etc and then hopefully try and stuff
data from setting our option after the maximum that can be set by these
other existing options.

once that code is in place within the ip_build_options routine in the
ip_options.c file in the linux kernel, we can then use the setsockopt() 
at the application level to make sure that a packet is filled with the
corresponding option.

i hope i was able to explain my question more clearly.

thanks for your help !

nishant

On Thu, 16 Nov 2000, Andi Kleen wrote:

> On Thu, Nov 16, 2000 at 11:11:45AM -0600, Nishant Rao wrote:
> > Hi,
> > 
> > We are conducting some research that involves setting our custom data as
> > a new IP option in the IP header (in the options field) of every packet.
> > 
> > We have poured over the source code but it is quite confusing to figure
> > out how the details of the way the options field is split among various
> > options (ie. offsets etc). Can anyone help us figure out how to add new
> > custom options into the IP header ? 
> 
> man ip(7), see the IP_OPTIONS socket option.
> 
> Linux only echoes received options, but never sets them by default unless that 
> socket option is specified. So it depends on the application and/or the sender.
> 
> -Andi
> 


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Setting IP Options in the IP-Header

2000-11-16 Thread Andi Kleen

On Thu, Nov 16, 2000 at 11:11:45AM -0600, Nishant Rao wrote:
> Hi,
> 
> We are conducting some research that involves setting our custom data as
> a new IP option in the IP header (in the options field) of every packet.
> 
> We have poured over the source code but it is quite confusing to figure
> out how the details of the way the options field is split among various
> options (ie. offsets etc). Can anyone help us figure out how to add new
> custom options into the IP header ? 

man ip(7), see the IP_OPTIONS socket option.

Linux only echoes received options, but never sets them by default unless that 
socket option is specified. So it depends on the application and/or the sender.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Setting IP Options in the IP-Header

2000-11-16 Thread Nishant Rao

Hi,

We are conducting some research that involves setting our custom data as
a new IP option in the IP header (in the options field) of every packet.

We have poured over the source code but it is quite confusing to figure
out how the details of the way the options field is split among various
options (ie. offsets etc). Can anyone help us figure out how to add new
custom options into the IP header ? 

Please CC me on your replies so that I can also get the answer :
<[EMAIL PROTECTED]> 

Thanks,
Nishant


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Setting IP Options in the IP-Header

2000-11-16 Thread Nishant Rao

Hi,

We are conducting some research that involves setting our custom data as
a new IP option in the IP header (in the options field) of every packet.

We have poured over the source code but it is quite confusing to figure
out how the details of the way the options field is split among various
options (ie. offsets etc). Can anyone help us figure out how to add new
custom options into the IP header ? 

Please CC me on your replies so that I can also get the answer :
[EMAIL PROTECTED] 

Thanks,
Nishant


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Setting IP Options in the IP-Header

2000-11-16 Thread Andi Kleen

On Thu, Nov 16, 2000 at 11:11:45AM -0600, Nishant Rao wrote:
 Hi,
 
 We are conducting some research that involves setting our custom data as
 a new IP option in the IP header (in the options field) of every packet.
 
 We have poured over the source code but it is quite confusing to figure
 out how the details of the way the options field is split among various
 options (ie. offsets etc). Can anyone help us figure out how to add new
 custom options into the IP header ? 

man ip(7), see the IP_OPTIONS socket option.

Linux only echoes received options, but never sets them by default unless that 
socket option is specified. So it depends on the application and/or the sender.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Setting IP Options in the IP-Header

2000-11-16 Thread Nishant Rao

Well, while what you say makes sense, it isn't exactly a solution to our
problem.

we are trying to expose and set a NEW option altogether. So our question 
pertains more to what code we write in the kernel to create and expose a 
new custom option. so for this, we would need to know the offsets of the
current options like source routing etc and then hopefully try and stuff
data from setting our option after the maximum that can be set by these
other existing options.

once that code is in place within the ip_build_options routine in the
ip_options.c file in the linux kernel, we can then use the setsockopt() 
at the application level to make sure that a packet is filled with the
corresponding option.

i hope i was able to explain my question more clearly.

thanks for your help !

nishant

On Thu, 16 Nov 2000, Andi Kleen wrote:

 On Thu, Nov 16, 2000 at 11:11:45AM -0600, Nishant Rao wrote:
  Hi,
  
  We are conducting some research that involves setting our custom data as
  a new IP option in the IP header (in the options field) of every packet.
  
  We have poured over the source code but it is quite confusing to figure
  out how the details of the way the options field is split among various
  options (ie. offsets etc). Can anyone help us figure out how to add new
  custom options into the IP header ? 
 
 man ip(7), see the IP_OPTIONS socket option.
 
 Linux only echoes received options, but never sets them by default unless that 
 socket option is specified. So it depends on the application and/or the sender.
 
 -Andi
 


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Setting IP Options in the IP-Header

2000-11-16 Thread Andi Kleen

On Thu, Nov 16, 2000 at 11:55:24AM -0600, Nishant Rao wrote:
 Well, while what you say makes sense, it isn't exactly a solution to our
 problem.
 
 we are trying to expose and set a NEW option altogether. So our question 
 pertains more to what code we write in the kernel to create and expose a 
 new custom option. so for this, we would need to know the offsets of the
 current options like source routing etc and then hopefully try and stuff
 data from setting our option after the maximum that can be set by these
 other existing options.
 
 once that code is in place within the ip_build_options routine in the
 ip_options.c file in the linux kernel, we can then use the setsockopt() 
 at the application level to make sure that a packet is filled with the
 corresponding option.
 
 i hope i was able to explain my question more clearly.

It still does not make more sense. Linux never generates options itself,
so there are no fixed offsets for you to know. It all depends on the 
one generating the options in the first place (application or peer) 

If you want to add a new option you'll need to add an option parser that
handles all cases. For application sending it is probably better to just
change the application though. 

Usually it is not a good idea to add options anyways, because they tend
to trigger slow paths in routers.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Setting IP Options in the IP-Header

2000-11-16 Thread Mike A. Harris

On Thu, 16 Nov 2000, Nishant Rao wrote:

Date: Thu, 16 Nov 2000 11:55:24 -0600 (CST)
From: Nishant Rao [EMAIL PROTECTED]
To: Andi Kleen [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Content-Type: TEXT/PLAIN; charset=US-ASCII
Subject: Re: Setting IP Options in the IP-Header

Well, while what you say makes sense, it isn't exactly a solution to our
problem.

we are trying to expose and set a NEW option altogether. So our question 
pertains more to what code we write in the kernel to create and expose a 
new custom option. so for this, we would need to know the offsets of the
current options like source routing etc and then hopefully try and stuff
data from setting our option after the maximum that can be set by these
other existing options.

once that code is in place within the ip_build_options routine in the
ip_options.c file in the linux kernel, we can then use the setsockopt() 
at the application level to make sure that a packet is filled with the
corresponding option.

i hope i was able to explain my question more clearly.

RFC791 should give you all you need to know I believe, plus
examining the existing kernel sources. It's pretty basic.

--
  Mike A. Harris  -  Linux advocate  -  Open source advocate
  This message is copyright 2000, all rights reserved.
  Views expressed are my own, not necessarily shared by my employer.
--

Red Hat Linux:  http://www.redhat.com
Download for free:  ftp://ftp.redhat.com/pub/redhat/redhat-6.2/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/