Modifying IPv4 headers


 
Thread Tools Search this Thread
Special Forums IP Networking Modifying IPv4 headers
# 1  
Old 12-25-2009
Question 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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Disable IPV4

Hi im using Redhat Ver 6.4 is it possible to disable IPV4 and use only IPV6? how can i do that? thanks Guy (2 Replies)
Discussion started by: guy3145
2 Replies

2. Solaris

Ntp between ipv4 and ipv6

Hi, I am looking for a solution to configure ntp between ipv4 ( ntp server ) to ipv6 ( client) . I had google, but lot many sites suggest to have dual stock or tunnaling. my issue is I have client has only ipv6 address ans server has ipv4 address. is it possible to sync time,... (4 Replies)
Discussion started by: naveen.surisett
4 Replies

3. Programming

IPv4 string->int

Does anyone know how to convert a IP address given as 'string' into a 'u_int32_t'? Are there any build any functions already? (1 Reply)
Discussion started by: Freaky123
1 Replies

4. AIX

IPv6/IPv4 Only in AIX

Hi all, I have setup ipv6 in AIX machine using autoconf6 command. I was successfull in doing this. after execution of the command local link address was assigned to one of the interfaces (en1).But I have to setup the following environment as well. 1) Machine with only IPv6 support(IPv4... (0 Replies)
Discussion started by: ard
0 Replies

5. UNIX for Dummies Questions & Answers

Modifying headers

I have a FASTA file with thousands of sequences that looks something like this: I need to modfy the header in such way that everything after the dot is remove. Thus, I will end up with something like this: Thanks (1 Reply)
Discussion started by: Xterra
1 Replies

6. Shell Programming and Scripting

Merging of files with different headers to make combined headers file

Hi , I have a typical situation. I have 4 files and with different headers (number of headers is varible ). I need to make such a merged file which will have headers combined from all files (comman coluns should appear once only). For example - File 1 H1|H2|H3|H4 11|12|13|14 21|22|23|23... (1 Reply)
Discussion started by: marut_ashu
1 Replies

7. Shell Programming and Scripting

Remove text between headers while leaving headers intact

Hi, I'm trying to strip all lines between two headers in a file: ### BEGIN ### Text to remove, contains all kinds of characters ... Antispyware-Downloadserver.com (Germany)=http://www.antispyware-downloadserver.c om/updates/ Antispyware-Downloadserver.com #2... (3 Replies)
Discussion started by: Trones
3 Replies

8. AIX

convert ipv4 ti ipv6

hello i'm working on AIX 5300-05-03 P520 hacmp 5.4 when connection to the internet is going down , firewall down, my application work verey verey slowly!!! and on the sliffer output i'm got trys of my serevr to do convert from ipv4 ipv6 ( 0.0.2.0 and AAAAAAAA). some one have an idea why... (1 Reply)
Discussion started by: ariec
1 Replies

9. UNIX for Advanced & Expert Users

convert from ipv4 to ipv6

hello i'm working on aix 5300-05-03 hacmp ver 5.4 well my issue is that when firewall (gateway to internet ) goes down my machine start to work very very slowly!!! the output of the sniffer is that on the output card , my machine try to convert ipv4 to ipv6 0.0.2.0 my machine is not configure... (1 Reply)
Discussion started by: ariec
1 Replies

10. Programming

IPv4 LSRR Option

Hello Friends, I have one doubt regarding LSRR (Loose Source and Record Route) IP option. Whether IPv4 optoins will be processed only by Router or they can be processed by any PC within the network?? What i'm trying is: i'm giving a list of IP address in the option using setsockopt system call,... (1 Reply)
Discussion started by: aamirglb
1 Replies
Login or Register to Ask a Question
icmp6(7P)							     Protocols								 icmp6(7P)

NAME
icmp6 - Internet Control Message Protocol for Internet Protocol Version 6 SYNOPSIS
#include <sys/socket.h> #include <netinet/in.h> #include <netinet/ip_icmp.h> #include <netinet/icmp6.h> s = socket(AF_INET6, SOCK_RAW, proto); t = t_open("/dev/icmp6", O_RDWR); DESCRIPTION
The ICMP6 protocol is the error and control message protocol used with Version 6 of the Internet Protocol. It is used by the kernel to han- dle and report errors in protocol processing. It is also used for IPv6 neighbor and router discovery, and for multicast group membership queries and reports. It may also be accessed by programs using the socket interface or the Transport Level Interface (TLI) for network mon- itoring and diagnostic functions. When used with the socket interface, a "raw socket" type is used. The protocol number for ICMP6, used in the proto parameter to the socket call, can be obtained from getprotobyname(3SOCKET). ICMP6 file descriptors and sockets are connectionless and are normally used with the t_sndudata / t_rcvudata and the sendto() / recvfrom() calls. They may also be used with the sendmsg()/recvgmsg() calls when sending or receiving ancillary data. Outgoing packets automatically have an Internet Protocol Version 6 (IPv6) header and zero or more IPv6 extension headers prepended. These headers are prepended by the kernel. Unlike ICMP for IPv4, the IP_HDRINCL option is not supported for ICMP6, so ICMP6 applications neither build their own outbound IPv6 headers, nor do they receive the inbound IPv6 headers with received data. IPv6 extension headers and relevant fields of the IPv6 header may be set or received as ancillary data to a sendmsg(3SOCKET) or recvmsg(3SOCKET) system call. Each of these fields and extension headers may also be set on a per socket basis with the setsockopt(3SOCKET) system call. Such "sticky" options are used on all outgoing packets unless overridden by ancillary data. When any ancillary data is present with a sendmsg(3SOCKET) system call, all sticky options are ignored for that system call, but subsequently remain configured. ICMP6 is a datagram protocol layered above IPv6. Received ICMP6 messages may be reflected back to users of higher-level protocols such as TCP or UDP as error returns from system calls. A copy of each ICMP6error message received by the system is provided to every holder of an open ICMP6 socket or TLI descriptor. SEE ALSO
getprotobyname(3SOCKET), recv(3SOCKET), recvmsg(3SOCKET), send(3SOCKET), sendmsg(3SOCKET), setsockopt(3SOCKET), t_rcvudata(3NSL), t_sndu- data(3NSL), inet6(7P), ip6(7P), routing(7P) Conta, A. and Deering, S., RFC 2463, Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification, The Internet Society, December 1998. DIAGNOSTICS
A socket operation may fail with one of the following errors returned: EISCONN An attempt was made to establish a connection on a socket which already has one, or when trying to send a datagram with the destination address specified and the socket is already connected. ENOTCONN An attempt was made to send a datagram, but no destination address is specified, and the socket has not been con- nected. ENOBUFS The system ran out of memory for an internal data structure. EADDRNOTAVAIL An attempt was made to create a socket with a network address for which no network interface exists. ENOMEM The system was unable to allocate memory for an internal data structure. ENOPROTOOPT An attempt was made to set an IPv4 socket option on an IPv6 socket. EINVAL An attempt was made to set an invalid or malformed socket option. EAFNOSUPPORT An attempt was made to bind or connect to an IPv4 or mapped address, or to specify an IPv4 or mapped address as the next hop. SunOS 5.10 10 Nov 1999 icmp6(7P)