1*47675Scael.\" Copyright (c) 1990, 1991 The Regents of the University of California. 242484Ssklower.\" All rights reserved. 342484Ssklower.\" 442484Ssklower.\" %sccs.include.redist.man% 542484Ssklower.\" 6*47675Scael.\" @(#)clnp.4 6.2 (Berkeley) 03/28/91 742484Ssklower.\" 8*47675Scael.Dd 9*47675Scael.Dt CLNP 4 10*47675Scael.Os 11*47675Scael.Sh NAME 12*47675Scael.Nm clnp 13*47675Scael.Nd Connectionless-Mode Network Protocol 14*47675Scael.Sh SYNOPSIS 15*47675Scael.Fd #include <sys/socket.h> 16*47675Scael.Fd #include <netargo/iso.h> 17*47675Scael.Fd #include <netargo/clnp.h> 18*47675Scael.Ft int 19*47675Scael.Fn socket AF_ISO SOCK_RAW 0 20*47675Scael.Sh DESCRIPTION 21*47675Scael.Tn CLNP 22*47675Scaelis the connectionless-mode network protocol used by the 2342484Ssklowerconnectionless-mode network service. This protocol is specified in 24*47675Scael.Tn ISO 25*47675Scael8473. 2642484SsklowerIt may be accessed 27*47675Scaelthrough a 28*47675Scael.Dq raw socket 29*47675Scaelfor debugging purposes only. 30*47675Scael.Tn CLNP 31*47675Scaelsockets are connectionless, 3242484Ssklowerand are normally used with the 33*47675Scael.Xr sendto 3442484Ssklowerand 35*47675Scael.Xr recvfrom 3642484Ssklowercalls, though the 37*47675Scael.Xr connect 2 3842484Ssklowercall may also be used to fix the destination for future 3942484Ssklowerpackets (in which case the 40*47675Scael.Xr read 2 4142484Sskloweror 42*47675Scael.Xr recv 2 4342484Ssklowerand 44*47675Scael.Xr write 2 4542484Sskloweror 46*47675Scael.Xr send 2 4742484Ssklowersystem calls may be used). 48*47675Scael.Pp 49*47675ScaelOutgoing packets automatically have a 50*47675Scael.Tn CLNP 51*47675Scaelheader prepended to 52*47675Scaelthem. Incoming packets received by the user contain the full 53*47675Scael.Tn CLNP 54*47675Scaelheader. 55*47675ScaelThe following 56*47675Scael.Xr setsockopt 57*47675Scaeloptions apply to 58*47675Scael.Tn CLNP : 59*47675Scael.Bl -tag -width CLNPOPT_FLAGS 60*47675Scael.It Dv CLNPOPT_FLAGS 6142484SsklowerSets the flags which are passed to clnp when sending a datagram. 6242484SsklowerValid flags are: 63*47675Scael.Pp 64*47675Scael.Bl -tag -width CLNP_NO_CKSUM -compact -offset Ds 65*47675Scael.It Dv CLNP_NO_SEG 66*47675ScaelDo not allow segmentation 67*47675Scael.It Dv CLNP_NO_ER 68*47675ScaelSuppress ER pdus 69*47675Scael.It Dv CLNP_NO_CKSUM 70*47675ScaelDo not generate the 71*47675Scael.Tn CLNP 72*47675Scaelchecksum 73*47675Scael.El 74*47675Scael.Pp 75*47675Scael.It Dv CLNPOPT_OPTS 76*47675ScaelSets 77*47675Scael.Tn CLNP 78*47675Scaeloptions. The options must be formatted exactly as specified by 79*47675Scael.Tn ISO 80*47675Scael8473, section 7.5 81*47675Scael.Dq Options Part. 82*47675ScaelOnce an option has been set, it will 8342484Ssklowerbe sent on all packets until a different option is set. 84*47675Scael.El 85*47675Scael.Sh CONGESTION EXPERIENCE BIT 8642484SsklowerWhenever a packet is transmitted, the globally unique quality of 8742484Ssklowerservice option is added to the packet. The sequencing preferred bit and 8842484Ssklowerthe low transit delay bit are set in this option. 89*47675Scael.Pp 9042484SsklowerIf a packet is forwarded containing the globally unique quality of 9142484Ssklowerservice option, and the interface through which the packet will be 92*47675Scaeltransmitted has a queue length greater than 93*47675Scael.Em congest_threshold , 9442484Ssklowerthen the congestion experienced bit is set in the quality of service option. 95*47675Scael.Pp 96*47675ScaelThe threshold value stored in 97*47675Scael.Em congest_threshold 98*47675Scaelmay be tuned. 99*47675Scael.Pp 10042484SsklowerWhen a packet is received with the 10142484Ssklowerglobally unique quality of service option present, and the 10242484Ssklowercongestion experienced bit is set, then the transport congestion 10342484Ssklowercontrol function is called. 104*47675Scael.Sh DIAGNOSTICS 10542484SsklowerA socket operation may fail with one of the following errors returned: 106*47675Scael.Bl -tag -width [EADDRNOTAVAIL] 107*47675Scael.It Bq Er EISCONN 108*47675ScaelWhen trying to establish a connection on a socket which 10942484Sskloweralready has one, or when trying to send a datagram with the destination 11042484Sskloweraddress specified and the socket is already connected; 111*47675Scael.It Bq Er ENOTCONN 112*47675ScaelWhen trying to send a datagram, but 11342484Ssklowerno destination address is specified, and the socket hasn't been 11442484Ssklowerconnected; 115*47675Scael.It Bq Er ENOBUFS 116*47675ScaelWhen the system runs out of memory for 11742484Sskloweran internal data structure; 118*47675Scael.It Bq Er EADDRNOTAVAIL 119*47675ScaelWhen an attempt is made to create a 12042484Ssklowersocket with a network address for which no network interface 12142484Ssklowerexists; 122*47675Scael.It Bq Er EHOSTUNREACH 123*47675ScaelWhen trying to send a datagram, but no route to the destination 12442484Sskloweraddress exists. 125*47675Scael.It Bq Er EINVAL 126*47675ScaelWhen specifying unsupported options. 127*47675Scael.El 128*47675Scael.Sh SEE ALSO 129*47675Scael.Xr send 2 , 130*47675Scael.Xr recv 2 , 131*47675Scael.Xr intro 4 , 132*47675Scael.Xr iso 4 133*47675Scael.Sh HISTORY 134*47675ScaelThe 135*47675Scael.Nm 136*47675Scaelprotocol implementation 137*47675Scael.Ud 138*47675Scael.Sh BUGS 13942484SsklowerPackets are sent with the type code of 0x1d (technically an invalid 140*47675Scaelpacket type) for lack of a better way to identify raw 141*47675Scael.Tn CLNP 142*47675Scaelpackets. 143*47675Scael.Pp 144*47675ScaelNo more than 145*47675Scael.Dv MLEN 146*47675Scaelbytes of options can be specified. 147