xref: /original-bsd/share/man/man4/clnp.4 (revision 7e5c8007)
1.\" Copyright (c) 1990, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)clnp.4	8.2 (Berkeley) 04/02/94
7.\"
8.Dd
9.Dt CLNP 4
10.Os
11.Sh NAME
12.Nm clnp
13.Nd Connectionless-Mode Network Protocol
14.Sh SYNOPSIS
15.Fd #include <sys/socket.h>
16.Fd #include <netiso/iso.h>
17.Fd #include <netiso/clnp.h>
18.Ft int
19.Fn socket AF_ISO SOCK_RAW 0
20.Sh DESCRIPTION
21.Tn CLNP
22is the connectionless-mode network protocol used by the
23connectionless-mode network service. This protocol is specified in
24.Tn ISO
258473.
26It may be accessed
27through a
28.Dq raw socket
29for debugging purposes only.
30.Tn CLNP
31sockets are connectionless,
32and are normally used with the
33.Xr sendto
34and
35.Xr recvfrom
36calls, though the
37.Xr connect 2
38call may also be used to fix the destination for future
39packets (in which case the
40.Xr read 2
41or
42.Xr recv 2
43and
44.Xr write 2
45or
46.Xr send 2
47system calls may be used).
48.Pp
49Outgoing packets automatically have a
50.Tn CLNP
51header prepended to
52them. Incoming packets received by the user contain the full
53.Tn CLNP
54header.
55The following
56.Xr setsockopt
57options apply to
58.Tn CLNP :
59.Bl -tag -width CLNPOPT_FLAGS
60.It Dv CLNPOPT_FLAGS
61Sets the flags which are passed to clnp when sending a datagram.
62Valid flags are:
63.Pp
64.Bl -tag -width "CLNP_NO_CKSUM" -offset indent -compact
65.It Dv CLNP_NO_SEG
66Do not allow segmentation
67.It Dv CLNP_NO_ER
68Suppress ER pdus
69.It Dv CLNP_NO_CKSUM
70Do not generate the
71.Tn CLNP
72checksum
73.El
74.Pp
75.It Dv CLNPOPT_OPTS
76Sets
77.Tn CLNP
78options. The options must be formatted exactly as specified by
79.Tn ISO
808473, section 7.5
81.Dq Options Part.
82Once an option has been set, it will
83be sent on all packets until a different option is set.
84.El
85.Sh CONGESTION EXPERIENCE BIT
86Whenever a packet is transmitted, the globally unique quality of
87service option is added to the packet. The sequencing preferred bit and
88the low transit delay bit are set in this option.
89.Pp
90If a packet is forwarded containing the globally unique quality of
91service option, and the interface through which the packet will be
92transmitted has a queue length greater than
93.Em congest_threshold ,
94then the congestion experienced bit is set in the quality of service option.
95.Pp
96The threshold value stored in
97.Em congest_threshold
98may be tuned.
99.Pp
100When a packet is received with the
101globally unique quality of service option present, and the
102congestion experienced bit is set, then the transport congestion
103control function is called.
104.Sh DIAGNOSTICS
105A socket operation may fail with one of the following errors returned:
106.Bl -tag -width [EADDRNOTAVAIL]
107.It Bq Er EISCONN
108When trying to establish a connection on a socket which
109already has one, or when trying to send a datagram with the destination
110address specified and the socket is already connected;
111.It Bq Er ENOTCONN
112When trying to send a datagram, but
113no destination address is specified, and the socket hasn't been
114connected;
115.It Bq Er ENOBUFS
116When the system runs out of memory for
117an internal data structure;
118.It Bq Er EADDRNOTAVAIL
119When an attempt is made to create a
120socket with a network address for which no network interface
121exists;
122.It Bq Er EHOSTUNREACH
123When trying to send a datagram, but no route to the destination
124address exists.
125.It Bq Er EINVAL
126When specifying unsupported options.
127.El
128.Sh SEE ALSO
129.Xr send 2 ,
130.Xr recv 2 ,
131.Xr intro 4 ,
132.Xr iso 4
133.Sh BUGS
134Packets are sent with the type code of 0x1d (technically an invalid
135packet type) for lack of a better way to identify raw
136.Tn CLNP
137packets.
138.Pp
139No more than
140.Dv MLEN
141bytes of options can be specified.
142