|
|
1.1 ! root 1: .TH IP 4P "25 March 1982" ! 2: .UC 4 ! 3: .SH NAME ! 4: ip \- Internet Protocol ! 5: .SH SYNOPSIS ! 6: .B #include <sys/socket.h> ! 7: .br ! 8: .B #include <netinet/in.h> ! 9: .PP ! 10: .B s = socket(AF_INET, SOCK_RAW, 0); ! 11: .SH DESCRIPTION ! 12: IP is the transport layer protocol used ! 13: by the Internet protocol family. It may be accessed ! 14: through a \*(lqraw socket\*(rq when developing new protocols, or ! 15: special purpose applications. IP sockets are connectionless, ! 16: and are normally used with the ! 17: .I sendto ! 18: and ! 19: .I recvfrom ! 20: calls, though the ! 21: .IR connect (2) ! 22: call may also be used to fix the destination for future ! 23: packets (in which case the ! 24: .IR read (2) ! 25: or ! 26: .IR recv (2) ! 27: and ! 28: .IR write (2) ! 29: or ! 30: .IR send (2) ! 31: system calls may be used). ! 32: .PP ! 33: Outgoing packets automatically have an IP header prepended to ! 34: them (based on the destination address and the protocol ! 35: number the socket is created with). ! 36: Likewise, incoming packets have their IP header stripped ! 37: before being sent to the user. ! 38: .SH DIAGNOSTICS ! 39: A socket operation may fail with one of the following errors returned: ! 40: .TP 15 ! 41: [EISCONN] ! 42: when trying to establish a connection on a socket which ! 43: already has one, or when trying to send a datagram with the destination ! 44: address specified and the socket is already connected; ! 45: .TP 15 ! 46: [ENOTCONN] ! 47: when trying to send a datagram, but ! 48: no destination address is specified, and the socket hasn't been ! 49: connected; ! 50: .TP 15 ! 51: [ENOBUFS] ! 52: when the system runs out of memory for ! 53: an internal data structure; ! 54: .TP 15 ! 55: [EADDRNOTAVAIL] ! 56: when an attempt is made to create a ! 57: socket with a network address for which no network interface ! 58: exists. ! 59: .SH SEE ALSO ! 60: send(2), recv(2), intro(4N), inet(4F) ! 61: .SH BUGS ! 62: One should be able to send and receive ip options. ! 63: .PP ! 64: The protocol should be settable after socket creation.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.