IP(7) — Silicon Graphics
NAME
ip − Internet Protocol
SYNOPSIS
#include <sys/socket.h>
#include <net/in.h>
struct sockproto proto = { PF_INET, protocol };
socket(SOCK_RAW, &proto, address, options);
struct sockaddr_in *address; int options;
DESCRIPTION
IP is the transport layer protocol used by the Internet protocol family. It may 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--the 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
Can not send and receive IP options.
The protocol is not changeable after socket creation.
Version 2.3 — July 04, 1985