LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Modifying IPv4 headers (https://www.linuxquestions.org/questions/programming-9/modifying-ipv4-headers-777855/)

kiran_4u 12-24-2009 05:05 AM

Modifying IPv4 headers
 
Hi,

My query is:
I need to set the IPv4 header fields(like TOS, TTL, Precedence and Flags) in the linux kernel using the system calls.
I tried setting the fields using the setsockopt() call using sockets but it is not reflecting the actual IPv4 header fields. Is it possible to modify these fields? Please let me know the way of setting IPv4 header fields using the system calls.

Also, I can set the TTL field using /proc interface - /proc/sys/net/ipv4/ip_default_ttl. Anyone knows how to set for other header fields?

I tried googling but I couldn't find it. Please help me.

Thanks in advance,
Kiran.

GooseYArd 12-24-2009 06:13 AM

Quote:

Originally Posted by kiran_4u (Post 3803393)
Hi,

My query is:
I need to set the IPv4 header fields(like TOS, TTL, Precedence and Flags) in the linux kernel using the system calls.
I tried setting the fields using the setsockopt() call using sockets but it is not reflecting the actual IPv4 header fields. Is it possible to modify these fields? Please let me know the way of setting IPv4 header fields using the system calls.

Also, I can set the TTL field using /proc interface - /proc/sys/net/ipv4/ip_default_ttl. Anyone knows how to set for other header fields?

I tried googling but I couldn't find it. Please help me.

Thanks in advance,
Kiran.

Have you looked into dnet?

http://libdnet.sourceforge.net/

not sure what your application is, but if you're doing testing or research, dnet is great.


All times are GMT -5. The time now is 05:32 PM.