IP(7P) — Silicon Graphics
NAME
ip − Internet Protocol
SYNOPSIS
#include <sys/socket.h>
#include <netinet/in.h>
struct sockproto proto = { PF_INET, ? };
socket(SOCK_RAW, (struct sockproto *)0, address, options);
struct sockaddr_in *address;
int options;
DESCRIPTION
IP is the transport layer protocol used by the Internet protocol family. It can be accessed through a “raw socket” when developing new protocols or by special-purpose applications. IP sockets are connectionless, and normally use send(3N) and receive(3N) calls. The destination for future packets can be set via a connect(3N) call. Then read(2) and write(2) system calls can be used.
Outgoing packets have an IP header prepended to them (based on what the destination address and protocol number are when the socket is created). Likewise, incoming packets have their IP header stripped before being sent to the user. It is not possible to send or receive IP options.
DIAGNOSTICS
EISCONN
Trying to establish a connection on an already connected socket, or trying to send a datagram with the destination address specified when the socket is already connected
ENOTCONN
Trying to send a datagram when no destination address is specified and the socket is not connected
ENOBUFS
System does not have enough memory for an internal data structure
EADDRNOTAVAIL
Attempted to create a socket with an invalid network interface
SEE ALSO
BUGS
IP options cannot be sent or received.
The protocol is not changeable after socket creation.
Version 2.4 — May 08, 1986