idp(7) — Special Files
NAME
idp − Xerox Internet Datagram Protocol
SYNOPSIS
#include <sys/socket.h>
#include <netns/ns.h>
#include <netns/idp.h>
s = socket(AF_NS, SOCK_DGRAM, 0);
DESCRIPTION
The Xerox Internet Datagram Protocol (IDP) is a simple, unreliable datagram protocol which is used to support the SOCK_DGRAM abstraction for the Internet protocol family. IDP sockets are connectionless, and are normally used with the sendto() and recvfrom() functions. The connect() function may also be used to fix the destination for future packets, in which case the recv() or read() and send() or write() functions may be used.
Xerox protocols are built vertically on top of IDP. Thus, IDP address formats are identical to those used by the Sequenced Packet Protocol (SPP). Note that the IDP port space is the same as the SPP port space; that is, an IDP port may be connected to an SPP port, with certain options enabled as described below. In addition, broadcast packets may be sent (assuming the underlying network supports this) by using a reserved broadcast address; this address is network interface dependent.
The following socket options are available:
SO_HEADERS_ON_INPUT
When set, the first 30 bytes of any data returned from a read() or recv() function will be the initial 30 bytes of the IDP packet, as described by
struct idp {
u_shortidp_sum;
u_shortidp_len;
u_charidp_tc;
u_charidp_pt;
struct ns_addridp_dna;
struct ns_addridp_sna;
};
This allows the user to determine the packet type, and whether the packet was a multicast packet or directed specifically at the local host. When requested, gives the current state of the option as either NSP_RAWIN or 0 (zero).
SO_HEADERS_ON_OUTPUT
When set, the first 30 bytes of any data sent will be the initial 30 bytes of the IDP packet. This allows the user to determine the packet type, and whether the packet should be a multicast packet or directed specifically at the local host. You can also misrepresent the sender of the packet. When requested, gives the current state of the option as either NSP_RAWOUT or 0 (zero).
SO_DEFAULT_HEADERS
The user provides the kernel an IDP header, from which it gleans the packet type. When requested, the kernel will provide an IDP header, showing the default packet type, and local and foreign addresses, if connected.
SO_ALL_PACKETS
When set, this option defeats automatic processing of error packets, and sequence protocol packets.
SO_SEQNOWhen requested, this option returns a sequence number which is not likely to be repeated until the machine crashes or a very long time has passed. It is useful in constructing packet exchange protocol packets.
ERRORS
If a socket operation fails, errno may be set to one of the following values:
[EISCONN]The socket is already connected. This error occurs when trying to establish connection on a socket or when trying to send a datagram with the destination address specified.
[ENOTCONN]
The destination address of a datagram was not specified, and the socket has not been connected.
[ENOBUFS]The system ran out of memory for an internal data structure.
[EADDRINUSE]
An attempt was made to create a socket with a network address for which no network interface exists.
[EADDRNOTAVAIL]
An attempt was made to create a socket with a network address for which no network interface exists.
RELATED INFORMATION
Files: netintro(7), ns(7)