Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ip(4p) — Ultrix/UWS 4.0 RISC

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

send(2)

recv(2)

inet(4f)

intro(4n)

ip(4p)

Name

ip − Internet Protocol

Syntax

#include <sys/socket.h>
#include <netinet/in.h>

s = socket(AF_INET, SOCK_RAW, 0);

Description

The 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 special purpose applications.  IP sockets are connectionless and are normally used with the sendto and recvfrom calls, though the connect() call can also be used to fix the destination for future packets, in which case the read() or recv() and write() or send() system calls can be used.

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. 

Diagnostics

A socket operation fails with any of the following errors is returned:

[EISCONN] Tries to establish a connection on a socket which already has one, or tries to send a datagram with the destination address specified when the socket is already connected. 

[ENOTCONN] Tries to send a datagram, but no destination address is specified and the socket has not been connected. 

[ENOBUFS] The system runs out of memory for an internal data structure. 

[EADDRNOTAVAIL]
Makes an attempt to create a socket with a network address for which no network interface exists.

See Also

send(2), recv(2), inet(4f), intro(4n)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026