All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.
@(#)ip.4 5.1 (Berkeley) 05/15/85
s = socket(AF_INET, SOCK_RAW, 0);
Outgoing packets automatically have an IP header prepended to them (based on the destination address and the protocol number the socket is created with). Likewise, incoming packets have their IP header stripped before being sent to the user.
15 [EISCONN] when trying 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;
15 [ENOTCONN] when trying to send a datagram, but no destination address is specified, and the socket hasn't been connected;
15 [ENOBUFS] when the system runs out of memory for an internal data structure;
15 [EADDRNOTAVAIL] when an attempt is made to create a socket with a network address for which no network interface exists.
The protocol should be settable after socket creation.