163010Sbostic.\" Copyright (c) 1990, 1991, 1993 263010Sbostic.\" The Regents of the University of California. All rights reserved. 342482Ssklower.\" 442482Ssklower.\" %sccs.include.redist.man% 542482Ssklower.\" 6*66969Sbostic.\" @(#)tp.4 8.4 (Berkeley) 04/19/94 742482Ssklower.\" 847675Scael.Dd 947675Scael.Dt TP 4 1047675Scael.Os 1147675Scael.Sh NAME 1247675Scael.Nm TP 1347675Scael.Nd 1447675Scael.Tn ISO 1547675ScaelTransport Protocol 1647675Scael.Sh SYNOPSIS 1747675Scael.Fd #include <sys/socket.h> 1847675Scael.Fd #include <netiso/iso_errno.h> 1947675Scael.Fd #include <netiso/tp_param.h> 2047675Scael.Fd #include <netiso/tp_user.h> 2147675Scael.Ft int 2247675Scael.Fn socket "[AF_INET, AF_ISO]" SOCK_SEQPACKET 0 2347675Scael.Sh DESCRIPTION 2447675Scael.Pp 2547675ScaelThe 2647675Scael.Tn TP 2747675Scaelprotocol provides reliable, flow-controlled, two-way 2842482Ssklowertransmission of data and record boundaries. 2942482SsklowerIt is a byte-stream protocol and is accessed according to 3047675Scaelthe 3147675Scael.Dv SOCK_SEQPACKET 3247675Scaelabstraction. 3347675ScaelThe 3447675Scael.Tn TP 3547675Scaelprotocol makes use of a standard 3647675Scael.Tn ISO 3747675Scaeladdress format, 3842482Ssklowerincluding a Network Service Access Point, and a Transport Service Entity 3942482SsklowerSelector. 4042482SsklowerSubclass 4 may make use of the internet 4142482SsklowerInternet address format. 4247675Scael.Pp 4347675ScaelSockets utilizing the tp protocol are either 4447675Scael.Dq active 4547675Scaelor 4647675Scael.Dq passive . 4747675ScaelActive sockets initiate connections to passive 4847675Scaelsockets. By default 4947675Scael.Tn TCP 5047675Scaelsockets are created active; to create a 5142482Ssklowerpassive socket the 5247675Scael.Xr listen 2 5342482Ssklowersystem call must be used 5442482Ssklowerafter binding the socket with the 5547675Scael.Xr bind 2 5642482Ssklowersystem call. Only 5742482Ssklowerpassive sockets may use the 5847675Scael.Xr accept 2 5942482Ssklowercall to accept incoming connections. Only active sockets may 6042482Sskloweruse the 6147675Scael.Xr connect 2 6242482Ssklowercall to initiate connections. 6347675Scael.Pp 6447675ScaelPassive sockets may 6547675Scael.Dq underspecify 6647675Scaeltheir location to match 6742482Ssklowerincoming connection requests from multiple networks. This 6847675Scaeltechnique, termed 6947675Scael.Dq wildcard addressing , 7047675Scaelallows a single 7142482Ssklowerserver to provide service to clients on multiple networks. 7247675ScaelTo create a socket which listens on all networks, the 7347675Scael.Tn NSAP 7447675Scaelportion 7542482Ssklowerof the bound address must be void (of length zero). 7642482SsklowerThe Transport Selector may still be specified 7742482Ssklowerat this time; if the port is not specified the system will assign one. 7842482SsklowerOnce a connection has been established the socket's address is 7942482Ssklowerfixed by the peer entity's location. The address assigned the 8042482Ssklowersocket is the address associated with the network interface 8142482Ssklowerthrough which packets are being transmitted and received. 8247675Scael.Pp 8347675ScaelThe 8447675Scael.Tn ISO 8547675ScaelTransport Protocol implemented for 8647675Scael.Tn AOS R2 8742482Ssklowerat the University of Wisconsin - Madison, 8842482Ssklowerand modified for inclusion in the Berkeley Software Distribution, 8942482Ssklowerincludes classes 0 and 4 9047675Scaelof the 9147675Scael.Tn ISO 9247675Scaeltransport protocols 9342482Sskloweras specified in 9447675Scaelthe June 1986 version of 9547675Scael.Tn IS 9647675Scael8073. 9742482SsklowerClass 4 of the protocol provides reliable, sequenced, 9842482Ssklowerflow-controlled, two-way 9942482Ssklowertransmission of data packets with an alternate stop-and-wait data path called 10042482Ssklowerthe "expedited data" service. 10142482SsklowerClass 0 is essentially a null transport protocol, which is used 10242482Ssklowerwhen the underlying network service provides reliable, sequenced, 10342482Ssklowerflow-controlled, two-way data transmission. 10442482SsklowerClass 0 does not provide the expedited data service. 10542482SsklowerThe protocols are implemented as a single transport layer entity 10642482Ssklowerthat coexists with the Internet protocol suite. 10747675ScaelClass 0 may be used only in the 10847675Scael.Tn ISO 10947675Scaeldomain. 11047675ScaelClass 4 may be used in the Internet domain as well as in the 11147675Scael.Tn ISO 11247675Scaeldomain. 11347675Scael.Pp 11442482SsklowerTwo system calls were modified from the previous 11542482Ssklowerrelease of the Berkeley Software Distribution 11664994Smckusickto permit the support of the end-of-transport-service-data-unit 11747675Scael.Pq Dv EOTSDU 11842482Ssklowerindication, and for the receipt and transmission of user 11942482Ssklowerconnect, confirm, and disconnect data. 12047675ScaelSee 12147675Scael.Xr sendmsg 2 12247675Scaeland 123*66969Sbostic.Xr recvmsg 2 , 12447675Scaeland further discussion 12542482Ssklowerbelow for the formats of the data in the ancillary data buffer. 12647675ScaelIf the 12747675Scael.Dv EOTSDU 12847675Scaelis not needed, the normal 12947675Scael.Xr read 2 , 13042482Ssklowerand 13147675Scael.Xr write 2 13242482Ssklowersystem calls may be used. 13347675Scael.Pp 13442482SsklowerThrough the 13547675Scael.Xr getsockopt 13647675Scaeland 13747675Scael.Xr setsockopt 13842482Ssklowersystem calls, 13947675Scael.Tn TP 14047675Scaelsupports several options 14142482Ssklowerto control such things as negotiable options 14242482Ssklowerin the protocol and protocol strategies. 14347675ScaelThe options are defined in 14447675Scael.Aq Pa netiso/tp_user.h , 14542482Ssklowerand are described below. 14647675Scael.Pp 14742482SsklowerIn the tables below, 14847675Scaelthe options marked with a pound sign 14947675Scael.Ql \&# 15042482Ssklowermay be used 15147675Scaelwith 15247675Scael.Xr setsockopt 15342482Ssklowerafter a connection is established. 15442482SsklowerOthers must be used before the connection 15542482Sskloweris established, in other words, 15642482Ssklowerbefore calling 15747675Scael.Xr connect 15847675Scaelor 15947675Scael.Xr accept . 16042482SsklowerAll options may be used 16147675Scaelwith 16247675Scael.Xr getsockopt 16342482Ssklowerbefore or 16442482Ssklowerafter a connection is established. 16547675Scael.Bl -tag -width TPOPT_PSTATISTICS 16647675Scael.It Dv TPOPT_CONN_DATA 16742482Ssklower(char *) [none] 16847675Scael.br 16947675ScaelData to send on 17047675Scael.Xr connect . 17142482SsklowerThe passive user may issue a 17247675Scael.Xr getsockopt 17342482Ssklowercall to retrieve a connection request's user data, 17442482Ssklowerafter having done the 17547675Scael.Xr accept 17642482Ssklowersystem call without implying confirmation of the connection. 17747675Scael.Pp 17842482SsklowerThe data may also be retrieved by issuing a 17947675Scael.Xr recvmsg 18042482Ssklowerrequest for ancillary data only, 18142482Ssklowerwithout implying confirmation of the connection. 18247675ScaelThe returned 18347675Scael.Va cmsghdr 18447675Scaelwill contain 18547675Scael.Dv SOL_TRANSPORT 18647675Scaelfor the 18747675Scael.Va csmg_level 18847675Scaeland 18947675Scael.Dv TPOPT_CONN_DATA 19047675Scaelfor 19147675Scael.Va cmsg_type. 19247675Scael.It Dv TPOPT_DISC_DATA \&# 19342482Ssklower(char *) [none] 19447675Scael.br 19547675ScaelData to send on 19647675Scael.Xr close . 19742482SsklowerDisconnect data may be sent by the side initiating the close 19842482Ssklowerbut not by the passive side ("passive" with respect to the closing 19942482Ssklowerof the connection), so there is no need to read disconnect data 20047675Scaelafter calling 20147675Scael.Xr close . 20242482SsklowerThis may be sent by a 20347675Scael.Xr setsockopt 20442482Ssklowersystem call, or by issuing a 20547675Scael.Xr sendmsg 20642482Ssklowerrequest specifying ancillary data only. 20747675ScaelThe user-provided 20847675Scael.Va cmsghdr 20947675Scaelmust contain 21047675Scael.Dv SOL_TRANSPORT 21147675Scaelfor 21247675Scael.Va csmg_level 21347675Scaeland 21447675Scael.Dv TPOPT_DISC_DATA 21547675Scaelfor 21647675Scael.Va cmsg_type . 21742482SsklowerSending of disconnect data will in of itself tear down (or reject) 21842482Ssklowerthe connection. 21947675Scael.It Dv TPOPT_CFRM_DATA \&# 22042482Ssklower(char *) [none] 22147675Scael.br 22242482SsklowerData to send when confirming a connection. 22364994SmckusickThis may also be sent by a 22447675Scael.Xr setsockopt 22542482Ssklowersystem call, or by issuing a 22647675Scael.Xr sendmsg 22742482Ssklowerrequest, as above. 22842482SsklowerSending of connect confirm data will cause the connection 22942482Ssklowerto be confirmed rather than rejected. 23047675Scael.It Dv TPOPT_PERF_MEAS \&# 23142482SsklowerBoolean. 23247675Scael.br 23347675ScaelWhen 23447675Scael.Xr true , 23547675Scaelperformance measurements will be kept 23642482Ssklowerfor this connection. 23742482SsklowerWhen set before a connection is established, the 23842482Sskloweractive side will use a locally defined parameter on the 23947675Scaelconnect request packet; if the peer is another 24047675Scael.Tn ARGO 24142482Ssklowerimplementation, this will cause performance measurement to be 24242482Ssklowerturned on 24342482Sskloweron the passive side as well. 24447675ScaelSee 24547675Scael.Xr tpperf 8 . 24647675Scael.It Dv TPOPT_PSTATISTICS 24742482SsklowerNo associated value on input. 24847675ScaelOn output, 24947675Scael.Ar struct tp_pmeas . 25047675Scael.Pp 25142482SsklowerThis command is used to read the performance statistics accumulated 25242482Ssklowerduring a connection's lifetime. 25347675ScaelIt can only be used with 25447675Scael.Xr getsockopt . 25547675ScaelThe structure it returns is described in 25647675Scael.Aq Pa netiso/tp_stat.h . 25747675ScaelSee 25847675Scael.Xr tpperf 8 . 25947675Scael.It Dv TPOPT_FLAGS 26047675Scaelunsigned integer. [0x0] 26147675Scael.br 26247675ScaelThis command can only be used with 26347675Scael.Xr getsockopt . 26442482SsklowerSee the description of the flags below. 26547675Scael.It Dv TPOPT_PARAMS 26647675Scael.Ar struct tp_conn_param 26747675Scael.br 26842482SsklowerUsed to get or set a group parameters for a connection. 26947675ScaelThe 27047675Scael.Ar struct tp_conn_param 27147675Scaelis the argument used with the 27247675Scael.Xr getsockopt 27347675Scaelor 27447675Scael.Xr setsockopt 27547675Scaelsystem call. 27642482SsklowerIt is described in 27747675Scael.Aq Pa netiso/tp_user.h . 27847675Scael.Pp 27947675ScaelThe fields of the 28047675Scael.Ar tp_conn_param 28147675Scaelstructure are 28242482Ssklowerdescribed below. 28347675Scael.El 28447675Scael.Pp 28547675Scael.Em Values for TPOPT_PARAMS: 28647675Scael.Bl -tag -width p_sendack_ticks 28747675Scael.It Ar p_Nretrans 28847675Scaelnonzero short integer [1] 28947675Scael.br 29047675ScaelNumber of times a TPDU 29147675Scaelwill be retransmitted before the 29242482Ssklowerlocal TP entity closes a connection. 29347675Scael.It Ar p_dr_ticks 29447675Scaelnonzero short integer [various] 29547675Scael.br 29647675ScaelNumber of clock ticks between retransmissions of disconnect request 29747675ScaelTPDUs. 29847675Scael.It Ar p_dt_ticks 29947675Scaelnonzero short integer [various] 30047675Scael.br 30147675ScaelNumber of clock ticks between retransmissions of data 30247675ScaelTPDUs. 30342482SsklowerThis parameter applies only to class 4. 30447675Scael.It Ar p_cr_ticks 30547675Scaelnonzero short integer [various] 30647675Scael.br 30747675ScaelNumber of clock ticks between retransmissions of connection request 30847675ScaelTPDUs. 30947675Scael.It Ar p_cc_ticks 31047675Scaelnonzero short integer [various] 31147675Scael.br 31247675ScaelNumber of clock ticks between retransmissions of connection confirm 31347675ScaelTPDUs. 31442482SsklowerThis parameter applies only to class 4. 31547675Scael.It Ar p_x_ticks 31647675Scaelnonzero short integer [various] 31747675Scael.br 31847675ScaelNumber of clock ticks between retransmissions of expedited data 31947675ScaelTPDUs. 32042482SsklowerThis parameter applies only to class 4. 32147675Scael.It Ar p_sendack_ticks 32247675Scaelnonzero short integer [various] 32347675Scael.br 32442482SsklowerNumber of clock ticks that the local TP entity 32542482Ssklowerwill wait before sending an acknowledgment for normal data 32666968Sbostic(not applicable if the acknowledgement strategy is 32747675Scael.Dv TPACK_EACH ) . 32842482SsklowerThis parameter applies only to class 4. 32947675Scael.It Ar p_ref_ticks 33047675Scaelnonzero short integer [various] 33147675Scael.br 33242482SsklowerNumber of clock ticks for which a reference will 33342482Ssklowerbe considered frozen after the connection to which 33442482Ssklowerit applied is closed. 33542482SsklowerThis parameter applies to classes 4 and 0 in the 33647675Scael.Tn ARGO 33747675Scaelimplementation, despite the fact that 33842482Ssklowerthe frozen reference function is required only for 33942482Ssklowerclass 4. 34047675Scael.It Ar p_inact_ticks 34147675Scaelnonzero short integer [various] 34247675Scael.br 34342482SsklowerNumber of clock ticks without an incoming packet from the peer after which 34447675Scael.Tn TP 34547675Scaelclose the connection. 34642482SsklowerThis parameter applies only to class 4. 34747675Scael.It Ar p_keepalive_ticks 34847675Scaelnonzero short integer [various] 34947675Scael.br 35042482SsklowerNumber of clock ticks between acknowledgments that are sent 35142482Ssklowerto keep an inactive connection open (to prevent the peer's 35242482Ssklowerinactivity control function from closing the connection). 35342482SsklowerThis parameter applies only to class 4. 35447675Scael.It Ar p_winsize 35542482Ssklowershort integer between 128 and 16384. [4096 bytes] 35647675Scael.br 35742482SsklowerThe buffer space limits in bytes for incoming and outgoing data. 35842482SsklowerThere is no way to specify different limits for incoming and outgoing 35942482Ssklowerpaths. 36042482SsklowerThe actual window size at any time 36142482Ssklowerduring the lifetime of a connection 36242482Sskloweris a function of the buffer size limit, the negotiated 36347675Scaelmaximum TPDU 36447675Scaelsize, and the 36542482Ssklowerrate at which the user program receives data. 36642482SsklowerThis parameter applies only to class 4. 36747675Scael.It Ar p_tpdusize 36842482Ssklowerunsigned char between 0x7 and 0xd. 36947675Scael[0xc for class 4] [0xb for class 0] 37047675Scael.br 37142482SsklowerLog 2 of the maximum TPDU size to be negotiated. 37247675ScaelThe 37347675Scael.Tn TP 37447675Scaelstandard 37547675Scael.Pf ( Tn ISO 37647675Scael8473) gives an upper bound of 37742482Ssklower0xd for class 4 and 0xb for class 0. 37847675ScaelThe 37947675Scael.Tn ARGO 38047675Scaelimplementation places upper bounds of 38142482Ssklower0xc on class 4 and 0xb on class 0. 38247675Scael.It Ar p_ack_strat 38347675Scael.Dv TPACK_EACH 38447675Scaelor 38547675Scael.Dv TPACK_WINDOW. 38647675Scael.Bq Dv TPACK_WINDOW 38747675Scael.br 38842482SsklowerThis parameter applies only to class 4. 38942482SsklowerTwo acknowledgment strategies are supported: 39047675Scael.Pp 39147675Scael.Dv TPACK_EACH means that each data TPDU 39247675Scaelis acknowledged 39342482Ssklowerwith an AK TPDU. 39447675Scael.Pp 39547675Scael.Dv TPACK_WINDOW 39642482Ssklowermeans that upon receipt of the packet that represents 39764994Smckusickthe high edge of the last window advertised, an AK TPDU is generated. 39847675Scael.It Ar p_rx_strat 39942482Ssklower4 bit mask 40047675Scael.Bq Dv TPRX_USE_CW No \&|\ Dv TPRX_FASTSTART 40147675Scaelover 40247675Scaelconnectionless network protocols] 40347675Scael.Pf [ Dv TPRX_USE_CW 40447675Scaelover 40547675Scaelconnection-oriented network protocols] 40647675Scael.br 40742482SsklowerThis parameter applies only to class 4. 40842482SsklowerThe bit mask may include the following values: 40947675Scael.Pp 41047675Scael.Dv TPRX_EACH : 41147675ScaelWhen a retransmission timer expires, retransmit 41242482Ssklowereach packet in the send window rather than 41342482Ssklowerjust the first unacknowledged packet. 41447675Scael.Pp 41547675Scael.Dv TPRX_USE_CW : 41647675ScaelUse a "congestion window" strategy borrowed 41742482Ssklowerfrom Van Jacobson's congestion window strategy for TCP. 41842482SsklowerThe congestion window size is set to one whenever 41942482Ssklowera retransmission occurs. 42047675Scael.Pp 42147675Scael.Dv TPRX_FASTSTART : 42247675ScaelBegin sending the maximum amount of data permitted 42342482Ssklowerby the peer (subject to availability). 42442482SsklowerThe alternative is to start sending slowly by 42542482Ssklowerpretending the peer's window is smaller than it is, and letting 42664994Smckusickit slowly grow up to the peer window's real size. 42742482SsklowerThis is to smooth the effect of new connections on a congested network 42842482Ssklowerby preventing a transport connection from suddenly 42942482Sskloweroverloading the network with a burst of packets. 43042482SsklowerThis strategy is also due to Van Jacobson. 43147675Scael.It Ar p_class 43242482Ssklower5 bit mask 43347675Scael.Bq Dv TP_CLASS_4 No \&|\ Dv TP_CLASS_0 43447675Scael.br 43547675ScaelBit mask including one or both of the values 43647675Scael.Dv TP_CLASS_4 43747675Scaeland 43847675Scael.Dv TP_CLASS_0 . 43942482SsklowerThe higher class indicated is the preferred class. 44042482SsklowerIf only one class is indicated, negotiation will not occur 44142482Ssklowerduring connection establishment. 44247675Scael.It Ar p_xtd_format 44342482SsklowerBoolean. 44447675Scael[false] 44547675Scael.br 44664994SmckusickBoolean indicating that extended format is negotiated. 44742482SsklowerThis parameter applies only to class 4. 44847675Scael.It Ar p_xpd_service 44942482SsklowerBoolean. 45047675Scael[true] 45147675Scael.br 45242482SsklowerBoolean indicating that 45342482Ssklowerthe expedited data transport service will be negotiated. 45442482SsklowerThis parameter applies only to class 4. 45547675Scael.It Ar p_use_checksum 45642482SsklowerBoolean. 45747675Scael[true] 45847675Scael.br 45942482SsklowerBoolean indicating the the use of checksums will be negotiated. 46042482SsklowerThis parameter applies only to class 4. 46147675Scael.It Ar p_use_nxpd 46242482SsklowerReserved for future use. 46347675Scael.It Ar p_use_rcc 46442482SsklowerReserved for future use. 46547675Scael.It Ar p_use_efc 46642482SsklowerReserved for future use. 46747675Scael.It Ar p_no_disc_indications 46842482SsklowerBoolean. 46947675Scael[false] 47047675Scael.Pp 47147675ScaelBoolean indicating that the local 47247675Scael.Tn TP 47364994Smckusickentity will not issue 47447675Scaelindications (signals) when a 47547675Scael.Tn TP 47647675Scaelconnection is disconnected. 47747675Scael.It Ar p_dont_change_params 47847675ScaelBoolean. [false] 47947675Scael.br 48047675ScaelIf 48147675Scael.Em true 48247675Scaelthe 48347675Scael.Tn TP 48447675Scaelentity will not override 48542482Ssklowerany of the other values given in this structure. 48647675ScaelIf the values cannot be used, the 48747675Scael.Tn TP 48847675Scaelentity will drop, disconnect, 48942482Sskloweror refuse to establish the connection to which this structure pertains. 49047675Scael.It Ar p_netservice 49147675ScaelOne of { 49247675Scael.Dv ISO_CLNS , 49347675Scael.Dv ISO_CONS , 49447675Scael.Dv ISO_COSNS , 49547675Scael.Dv IN_CLNS } . 49647675Scael.Pf [ Dv ISO_CLNS ] 49747675Scael.br 49842482SsklowerIndicates which network service is to be used. 49947675Scael.Pp 50047675Scael.Dv ISO_CLNS 50147675Scaelindicates the connectionless network service provided 50247675Scaelby CLNP 50347675Scael.Pf ( Tn ISO 50447675Scael8473). 50547675Scael.Pp 50647675Scael.Dv ISO_CONS 50747675Scaelindicates the connection-oriented network service provided 50847675Scaelby X.25 50947675Scael.Pf ( Tn ISO 51047675Scael8208) and 51147675Scael.Tn ISO 51247675Scael8878. 51347675Scael.Pp 51447675Scael.Dv ISO_COSNS 51547675Scaelindicates the 51642482Ssklowerconnectionless network service running over a 51747675Scaelconnection-oriented subnetwork service: CLNP 51847675Scael.Pf ( Tn ISO 51947675Scael8473) over X.25 52047675Scael.Pf ( Tn ISO 52147675Scael8208). 52247675Scael.Pp 52347675Scael.Dv IN_CLNS 52447675Scaelindicates the 52542482SsklowerDARPA Internet connectionless network service provided by IP (RFC 791). 52647675Scael.It Ar p_dummy 52742482SsklowerReserved for future use. 52847675Scael.El 52947675Scael.Pp 53047675ScaelThe 53147675Scael.Dv TPOPT_FLAGS 53247675Scaeloption is used for obtaining 53342482Ssklowervarious boolean-valued options. 53442482SsklowerIts meaning is as follows. 53542482SsklowerThe bit numbering used is that of the RT PC, which means that bit 53642482Ssklower0 is the most significant bit, while bit 8 is the least significant bit. 53742482Ssklower.sp 1 53847675Scael.Em Values for TPOPT_FLAGS: 53947675Scael.Bl -tag -width Bitsx 54047675Scael.It Sy Bits 54147675Scael.Sy Description [Default] 54247675Scael.It \&0 54347675Scael.Dv TPFLAG_NLQOS_PDN : 54447675Scaelset when the quality of the 54542482Ssklowernetwork service is 54642482Ssklowersimilar to that of a public data network. 54747675Scael.It \&1 54847675Scael.Dv TPFLAG_PEER_ON_SAMENET : 54947675Scaelset when the peer 55047675Scael.Tn TP 55147675Scaelentity 55242482Sskloweris considered to be on the same network as the local 55347675Scael.Tn TP 55447675Scaelentity. 55547675Scael.It \&2 55642482SsklowerNot used. 55747675Scael.It \&3 55847675Scael.Dv TPFLAG_XPD_PRES : 55947675Scaelset when expedited data are present 56047675Scael[0] 56147675Scael.It 4\&..7 56242482SsklowerReserved. 56347675Scael.El 56447675Scael.Sh ERROR VALUES 56547675Scael.Pp 56647675ScaelThe 56747675Scael.Tn TP 56847675Scaelentity returns 56947675Scael.Va errno 57047675Scaelerror values as defined in 57147675Scael.Aq Pa sys/errno.h 57242482Ssklowerand 57347675Scael.Aq Pa netiso/iso_errno.h . 57442482SsklowerUser programs may print messages associated with these value by 57547675Scaelusing an expanded version of 57647675Scael.Xr perror 57747675Scaelfound in the 57847675Scael.Tn ISO 57947675Scaellibrary, 58047675Scael.Pa libisodir.a . 58147675Scael.Pp 58247675ScaelIf the 58347675Scael.Tn TP 58447675Scaelentity encounters asynchronous events 58542482Ssklowerthat will cause a transport connection to be closed, 58642482Ssklowersuch as 58742482Ssklowertiming out while retransmitting a connect request TPDU, 58842482Sskloweror receiving a DR TPDU, 58947675Scaelthe 59047675Scael.Tn TP 59147675Scaelentity issues a 59247675Scael.Dv SIGURG 59347675Scaelsignal, indicating that 59442482Ssklowerdisconnection has occurred. 59542482SsklowerIf the signal is issued during a 59642482Ssklowera system call, the system call may be interrupted, 59742482Ssklowerin which case the 59847675Scael.Va errno 59947675Scaelvalue upon return from the system call is 60047675Scael.Er EINTR. 60147675ScaelIf the signal 60247675Scael.Dv SIGURG 60342482Sskloweris being handled by reading 60464994Smckusickfrom the socket, and it was an 60547675Scael.Xr accept 2 60647675Scaelthat 60747675Scaeltimed out, the read may result in 60847675Scael.Er ENOTSOCK , 60947675Scaelbecause the 61047675Scael.Xr accept 61147675Scaelcall had not yet returned a 61242482Ssklowerlegitimate socket descriptor when the signal was handled. 61347675Scael.Dv ETIMEDOUT 61447675Scael(or a some other errno value appropriate to the 61547675Scaeltype of error) is returned if 61647675Scael.Dv SIGURG 61747675Scaelis blocked 61842482Ssklowerfor the duration of the system call. 61942482SsklowerA user program should take one of the following approaches: 62047675Scael.Bl -tag -width Ds 62147675Scael.It Block Dv SIGURG 62242482SsklowerIf the program is servicing 62347675Scaelonly one connection, it can block or ignore 62447675Scael.Dv SIGURG 62547675Scaelduring connection 62642482Ssklowerestablishment. 62747675ScaelThe advantage of this is that the 62847675Scael.Va errno 62947675Scaelvalue 63042482Ssklowerreturned is somewhat meaningful. 63142482SsklowerThe disadvantage of this is that 63242482Ssklowerif ignored, disconnection and expedited data indications could be 63342482Ssklowermissed. 63442482SsklowerFor some programs this is not a problem. 63547675Scael.It Handle Dv SIGURG 63642482SsklowerIf the program is servicing more than one connection at a time 63742482Sskloweror expedited data may arrive or both, the program may elect to 63847675Scaelservice 63947675Scael.Dv SIGURG . 64047675ScaelIt can use the 64147675Scael.Fn getsockopt ...TPOPT_FLAGS... 64247675Scaelsystem 64342482Ssklowercall to see if the signal 64442482Ssklowerwas due to the arrival of expedited data or due to a disconnection. 64542482SsklowerIn the latter case, 64647675Scael.Xr getsockopt 64747675Scaelwill return 64847675Scael.Er ENOTCONN . 64947675Scael.El 65047675Scael.Sh SEE ALSO 65147675Scael.Xr tcp 4 , 65247675Scael.Xr netstat 1 , 65347675Scael.Xr iso 4 , 65447675Scael.Xr clnp 4 , 65547675Scael.Xr cltp 4 , 65647675Scael.Xr ifconfig 8 . 65747675Scael.Sh BUGS 65842482SsklowerThe protocol definition of expedited data is slightly problematic, 65942482Ssklowerin a way that renders expedited data almost useless, 66042482Ssklowerif two or more packets of expedited data are send within 66147675Scaeltime \(*e, where \(*e 66242482Ssklowerdepends on the application. 66342482SsklowerThe problem is not of major significance since most applications 66442482Ssklowerdo not use transport expedited data. 66542482SsklowerThe problem is this: 66647675Scaelthe expedited data acknowledgment TPDU 66747675Scaelhas no field for conveying 66847675Scaelcredit, thus it is not possible for a 66947675Scael.Tn TP 67047675Scaelentity to inform its peer 67142482Ssklowerthat "I received your expedited data but have no room to receive more." 67247675ScaelThe 67347675Scael.Tn TP 67447675Scaelentity has the choice of acknowledging receipt of the 67547675ScaelXPD TPDU: 67647675Scael.Bl -tag -width Ds 67747675Scael.It "when the user receives the" XPD TSDU 67842482Ssklowerwhich may be a fairly long time, 67947675Scaelwhich may cause the sending 68047675Scael.Tn TP 68147675Scaelentity to retransmit the packet, 68242482Ssklowerand possibly to close the connection after retransmission, or 68347675Scael.It "when the" Tn TP No "entity receives it" 68442482Ssklowerso the sending entity does not retransmit or close the connection. 68542482SsklowerIf the sending user then tries to send more expedited data 68647675Scael.Dq soon , 68747675Scaelthe expedited data will not be acknowledged (until the 68842482Ssklowerreceiving user receives the first XPD TSDU). 68947675Scael.El 69047675Scael.Pp 69147675ScaelThe 69247675Scael.Tn ARGO 69347675Scaelimplementation acknowledges XPD TPDUs 69447675Scaelimmediately, 69564994Smckusickin the hope that most users will not use expedited data frequently 69642482Ssklowerenough for this to be a problem. 697