Sponsored Content
Special Forums IP Networking set the source IP address to zero Post 11949 by developer on Friday 14th of December 2001 01:34:21 PM
Old 12-14-2001
Question set the source IP address to zero

Hi, does anybody know how to set the IP source address of an IP packet to be zero? The problem is that when you create a raw socket and set the IP_HDRINCL socket option, if you put the ip_src address to zero (INADDR_ANY) the kernel will automatically set the source address to the primary IP address of the outgoing interface.
 

10 More Discussions You Might Find Interesting

1. IP Networking

set ip address

I'm new to Solaris. How do I set a server's IP address? Thanks in advance. (3 Replies)
Discussion started by: confused
3 Replies

2. IP Networking

source address woes

I have checkpoint firewall-1 running on a solaris 7 sparc box with two physical working networks interface cards hme0, qfe0, (please note these are false addresses) qfe0 = 195.111.222.178 internet ISP hme0 = 172.19.12.58 /24 internal Lan which has a router to france on it I want to... (3 Replies)
Discussion started by: hcclnoodles
3 Replies

3. Forum Support Area for Unregistered Users & Account Problems

Email Address set up too late

I set up the email address for my account too late for it to be activated prior to the transmission of the activate message from unix.com. Can you resend that message? (2 Replies)
Discussion started by: Retson Retap
2 Replies

4. IP Networking

Selecting interface based on source and destination ip address

Hi all, I have some doubts in selecting the interface to transfer packets and receive the packets. --> Multiple interfaces : -------------------- 1) 0.0.0.0 --------> wild card address. 2) x.x.x.x --------> valid address.(192.168.1.156) 3) ff.ff.ff.ff -------->... (0 Replies)
Discussion started by: vijaypdp2006
0 Replies

5. UNIX for Dummies Questions & Answers

How to set server's ip address, router, network mask and set if it is an internal or external ip?

Hello, I need to write a program which sets server's ip address, router, network mask. Program also should set if it is an internal or external ip. Maybe someone can help me ? Any information from u is very useful :b: I stopped at .. :( #!/bin/sh A=`hostname -i` echo "server ip address is $A"... (4 Replies)
Discussion started by: zagaruika
4 Replies

6. Solaris

ping with source address

Hello, is there any way to ping with source address on Solaris ? (3 Replies)
Discussion started by: marmellata
3 Replies

7. IP Networking

iproute2 loopback source address

Hi, I'm trying to set up a test bed where I can use a single machine to do some network packet captures between 2 different applications without needing a network connection. I'm actually trying to do some SIP VoIP development, but for illustration purposes will use ping. I want: ping 127.0.0.1... (0 Replies)
Discussion started by: racitup
0 Replies

8. SuSE

FTP set codepage of source dataset

I have a file on Suse Linux which is created in codepage 420. I need to FTP this file to a remote server with codepage 1256. How do I specify in FTP that the source codepage is 420 instead of the Linux default? Is this possible with curl or any other ftp client on Linux. I don't see a... (2 Replies)
Discussion started by: tsdjim
2 Replies

9. Solaris

How to set gateway address to a particular interface?

How to set gateway address to a particular interface? waht are the files need to update to make it permanent? (2 Replies)
Discussion started by: Naveen.6025
2 Replies

10. IP Networking

Source IP address field in RREP on DSR routing

Hello I have a question about routing in MANET using Dynamic Source Routing protocol. IN RFC4728 (DSR) in section "IP fields" of RREP (Route Reply) packet we have this: ok. I read in several books and also in rfc4728 that: when a source node (node that initiate route discovery process)... (1 Reply)
Discussion started by: acu281
1 Replies
ICMP(4) 						   BSD Kernel Interfaces Manual 						   ICMP(4)

NAME
icmp -- Internet Control Message Protocol SYNOPSIS
#include <sys/socket.h> #include <netinet/in.h> int socket(AF_INET, SOCK_RAW, proto); DESCRIPTION
ICMP is the error and control message protocol used by IP and the Internet protocol family. It may be accessed through a ``raw socket'' for network monitoring and diagnostic functions. The proto parameter to the socket call to create an ICMP socket is obtained from getprotobyname(3). ICMP sockets are connectionless, and are normally used with the sendto and recvfrom calls, though the connect(2) call may also be used to fix the destination for future packets (in which case the read(2) or recv(2) and write(2) or send(2) system calls may be used). Outgoing packets automatically have an IP header prepended to them (based on the destination address). Incoming packets are received with the IP header and options intact. Note that the ip_off and ip_len fields are in host byte order. For more information about the IP header structure, see ip(4). Non-privileged ICMP ICMP sockets can be opened with the SOCK_DGRAM socket type without requiring root privileges. The synopsis is the following: socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP) Datagram oriented ICMP sockets offer a subset of the functionality available to raw ICMP sockets. Only IMCP request messages of the following types can be sent: ICMP_ECHO, ICMP_TSTAMP or ICMP_MASKREQ. The code field must be the value zero (0). The minimal length of an ICMP message request is eight (8) octets. The advantage of using datagram oriented ICMP sockets is that even a non-privileged process can use ICMP echo requests to gauge the quality of the connectivity to a host, or to receive ICMP destination unreachable message for path MTU discovery, or to receive time exceeded mes- sages for traceroute. The following IP level option can be used with datagram oriented ICMP sockets: IP_OPTIONS IP_HDRINCL IP_TOS IP_TTL IP_RECVOPTS IP_RECVRETOPTS IP_RECVDSTADDR IP_RETOPTS IP_MULTICAST_IF IP_MULTICAST_TTL IP_MULTICAST_LOOP IP_ADD_MEMBERSHIP IP_DROP_MEMBERSHIP IP_MULTICAST_VIF IP_PORTRANGE IP_RECVIF IP_IPSEC_POLICY IP_STRIPHDR When the IP option IP_HDRINCL is used, the provided IP header must obey the following rules: ip_v Must be IPVERSION (4); ip_hl Between 5 and 10 (inclusive); ip_tos Any value; ip_len Must be the total length of IP datagram (IP header + ICMP message); ip_id Must be zero, will be automatically set; ip_off Must be zero, will be automatically set; ip_ttl Any value; ip_p Must be IPPROTO_IP; ip_sum Value ignored, will be automatically set; ip_src Must be an IP address currently assigned to one of the local interface or INADDR_ANY; ip_dst Any address; ip_opts Any option. The maximum length of a IMCP message that can be sent is controlled by the sysctl variable net.inet.raw.maxdgram. DIAGNOSTICS
A socket operation may fail with one of the following errors returned: [EISCONN] when trying to establish a connection on a socket which already has one, or when trying to send a datagram with the destina- tion address specified and the socket is already connected; [ENOTCONN] when trying to send a datagram, but no destination address is specified, and the socket hasn't been connected; [ENOBUFS] when the system runs out of memory for an internal data structure; [EADDRNOTAVAIL] when an attempt is made to create a socket with a network address for which no network interface exists; [EINVAL] when an invalid value is used with IMCP datagram socket for a field of the IP or ICMP header. SEE ALSO
recv(2), send(2), inet(4), intro(4), ip(4) HISTORY
The icmp protocol appeared in 4.3BSD. 4.3 Berkeley Distribution June 19, 2002 4.3 Berkeley Distribution
All times are GMT -4. The time now is 08:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy