1*47675Scael.\" Copyright (c) 1990, 1991 The Regents of the University of California. 242482Ssklower.\" All rights reserved. 342482Ssklower.\" 442482Ssklower.\" %sccs.include.redist.man% 542482Ssklower.\" 6*47675Scael.\" @(#)tp.4 6.4 (Berkeley) 03/28/91 742482Ssklower.\" 8*47675Scael.Dd 9*47675Scael.Dt TP 4 10*47675Scael.Os 11*47675Scael.Sh NAME 12*47675Scael.Nm TP 13*47675Scael.Nd 14*47675Scael.Tn ISO 15*47675ScaelTransport Protocol 16*47675Scael.Sh SYNOPSIS 17*47675Scael.Fd #include <sys/socket.h> 18*47675Scael.Fd #include <netiso/iso_errno.h> 19*47675Scael.Fd #include <netiso/tp_param.h> 20*47675Scael.Fd #include <netiso/tp_user.h> 21*47675Scael.Ft int 22*47675Scael.Fn socket "[AF_INET, AF_ISO]" SOCK_SEQPACKET 0 23*47675Scael.Sh DESCRIPTION 24*47675Scael.Pp 25*47675ScaelThe 26*47675Scael.Tn TP 27*47675Scaelprotocol provides reliable, flow-controlled, two-way 2842482Ssklowertransmission of data and record boundaries. 2942482SsklowerIt is a byte-stream protocol and is accessed according to 30*47675Scaelthe 31*47675Scael.Dv SOCK_SEQPACKET 32*47675Scaelabstraction. 33*47675ScaelThe 34*47675Scael.Tn TP 35*47675Scaelprotocol makes use of a standard 36*47675Scael.Tn ISO 37*47675Scaeladdress format, 3842482Ssklowerincluding a Network Service Access Point, and a Transport Service Entity 3942482SsklowerSelector. 4042482SsklowerSubclass 4 may make use of the internet 4142482SsklowerInternet address format. 42*47675Scael.Pp 43*47675ScaelSockets utilizing the tp protocol are either 44*47675Scael.Dq active 45*47675Scaelor 46*47675Scael.Dq passive . 47*47675ScaelActive sockets initiate connections to passive 48*47675Scaelsockets. By default 49*47675Scael.Tn TCP 50*47675Scaelsockets are created active; to create a 5142482Ssklowerpassive socket the 52*47675Scael.Xr listen 2 5342482Ssklowersystem call must be used 5442482Ssklowerafter binding the socket with the 55*47675Scael.Xr bind 2 5642482Ssklowersystem call. Only 5742482Ssklowerpassive sockets may use the 58*47675Scael.Xr accept 2 5942482Ssklowercall to accept incoming connections. Only active sockets may 6042482Sskloweruse the 61*47675Scael.Xr connect 2 6242482Ssklowercall to initiate connections. 63*47675Scael.Pp 64*47675ScaelPassive sockets may 65*47675Scael.Dq underspecify 66*47675Scaeltheir location to match 6742482Ssklowerincoming connection requests from multiple networks. This 68*47675Scaeltechnique, termed 69*47675Scael.Dq wildcard addressing , 70*47675Scaelallows a single 7142482Ssklowerserver to provide service to clients on multiple networks. 72*47675ScaelTo create a socket which listens on all networks, the 73*47675Scael.Tn NSAP 74*47675Scaelportion 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. 82*47675Scael.Pp 83*47675ScaelThe 84*47675Scael.Tn ISO 85*47675ScaelTransport Protocol implemented for 86*47675Scael.Tn AOS R2 8742482Ssklowerat the University of Wisconsin - Madison, 8842482Ssklowerand modified for inclusion in the Berkeley Software Distribution, 8942482Ssklowerincludes classes 0 and 4 90*47675Scaelof the 91*47675Scael.Tn ISO 92*47675Scaeltransport protocols 9342482Sskloweras specified in 94*47675Scaelthe June 1986 version of 95*47675Scael.Tn IS 96*47675Scael8073. 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. 107*47675ScaelClass 0 may be used only in the 108*47675Scael.Tn ISO 109*47675Scaeldomain. 110*47675ScaelClass 4 may be used in the Internet domain as well as in the 111*47675Scael.Tn ISO 112*47675Scaeldomain. 113*47675Scael.Pp 11442482SsklowerTwo system calls were modified from the previous 11542482Ssklowerrelease of the Berkeley Software Distribution 116*47675Scaelto permit the support the end-of-transport-service-data-unit 117*47675Scael.Pq Dv EOTSDU 11842482Ssklowerindication, and for the receipt and transmission of user 11942482Ssklowerconnect, confirm, and disconnect data. 120*47675ScaelSee 121*47675Scael.Xr sendmsg 2 122*47675Scaeland 123*47675Scael.Xr recmsgv 2 , 124*47675Scaeland further discussion 12542482Ssklowerbelow for the formats of the data in the ancillary data buffer. 126*47675ScaelIf the 127*47675Scael.Dv EOTSDU 128*47675Scaelis not needed, the normal 129*47675Scael.Xr read 2 , 13042482Ssklowerand 131*47675Scael.Xr write 2 13242482Ssklowersystem calls may be used. 133*47675Scael.Pp 13442482SsklowerThrough the 135*47675Scael.Xr getsockopt 136*47675Scaeland 137*47675Scael.Xr setsockopt 13842482Ssklowersystem calls, 139*47675Scael.Tn TP 140*47675Scaelsupports several options 14142482Ssklowerto control such things as negotiable options 14242482Ssklowerin the protocol and protocol strategies. 143*47675ScaelThe options are defined in 144*47675Scael.Aq Pa netiso/tp_user.h , 14542482Ssklowerand are described below. 146*47675Scael.Pp 14742482SsklowerIn the tables below, 148*47675Scaelthe options marked with a pound sign 149*47675Scael.Ql \&# 15042482Ssklowermay be used 151*47675Scaelwith 152*47675Scael.Xr setsockopt 15342482Ssklowerafter a connection is established. 15442482SsklowerOthers must be used before the connection 15542482Sskloweris established, in other words, 15642482Ssklowerbefore calling 157*47675Scael.Xr connect 158*47675Scaelor 159*47675Scael.Xr accept . 16042482SsklowerAll options may be used 161*47675Scaelwith 162*47675Scael.Xr getsockopt 16342482Ssklowerbefore or 16442482Ssklowerafter a connection is established. 165*47675Scael.Bl -tag -width TPOPT_PSTATISTICS 166*47675Scael.It Dv TPOPT_CONN_DATA 16742482Ssklower(char *) [none] 168*47675Scael.br 169*47675ScaelData to send on 170*47675Scael.Xr connect . 17142482SsklowerThe passive user may issue a 172*47675Scael.Xr getsockopt 17342482Ssklowercall to retrieve a connection request's user data, 17442482Ssklowerafter having done the 175*47675Scael.Xr accept 17642482Ssklowersystem call without implying confirmation of the connection. 177*47675Scael.Pp 17842482SsklowerThe data may also be retrieved by issuing a 179*47675Scael.Xr recvmsg 18042482Ssklowerrequest for ancillary data only, 18142482Ssklowerwithout implying confirmation of the connection. 182*47675ScaelThe returned 183*47675Scael.Va cmsghdr 184*47675Scaelwill contain 185*47675Scael.Dv SOL_TRANSPORT 186*47675Scaelfor the 187*47675Scael.Va csmg_level 188*47675Scaeland 189*47675Scael.Dv TPOPT_CONN_DATA 190*47675Scaelfor 191*47675Scael.Va cmsg_type. 192*47675Scael.It Dv TPOPT_DISC_DATA \&# 19342482Ssklower(char *) [none] 194*47675Scael.br 195*47675ScaelData to send on 196*47675Scael.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 200*47675Scaelafter calling 201*47675Scael.Xr close . 20242482SsklowerThis may be sent by a 203*47675Scael.Xr setsockopt 20442482Ssklowersystem call, or by issuing a 205*47675Scael.Xr sendmsg 20642482Ssklowerrequest specifying ancillary data only. 207*47675ScaelThe user-provided 208*47675Scael.Va cmsghdr 209*47675Scaelmust contain 210*47675Scael.Dv SOL_TRANSPORT 211*47675Scaelfor 212*47675Scael.Va csmg_level 213*47675Scaeland 214*47675Scael.Dv TPOPT_DISC_DATA 215*47675Scaelfor 216*47675Scael.Va cmsg_type . 21742482SsklowerSending of disconnect data will in of itself tear down (or reject) 21842482Ssklowerthe connection. 219*47675Scael.It Dv TPOPT_CFRM_DATA \&# 22042482Ssklower(char *) [none] 221*47675Scael.br 22242482SsklowerData to send when confirming a connection. 22342482SsklowerThis may aslo be sent by a 224*47675Scael.Xr setsockopt 22542482Ssklowersystem call, or by issuing a 226*47675Scael.Xr sendmsg 22742482Ssklowerrequest, as above. 22842482SsklowerSending of connect confirm data will cause the connection 22942482Ssklowerto be confirmed rather than rejected. 230*47675Scael.It Dv TPOPT_PERF_MEAS \&# 23142482SsklowerBoolean. 232*47675Scael.br 233*47675ScaelWhen 234*47675Scael.Xr true , 235*47675Scaelperformance 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 239*47675Scaelconnect request packet; if the peer is another 240*47675Scael.Tn ARGO 24142482Ssklowerimplementation, this will cause performance measurement to be 24242482Ssklowerturned on 24342482Sskloweron the passive side as well. 244*47675ScaelSee 245*47675Scael.Xr tpperf 8 . 246*47675Scael.It Dv TPOPT_PSTATISTICS 24742482SsklowerNo associated value on input. 248*47675ScaelOn output, 249*47675Scael.Ar struct tp_pmeas . 250*47675Scael.Pp 25142482SsklowerThis command is used to read the performance statistics accumulated 25242482Ssklowerduring a connection's lifetime. 253*47675ScaelIt can only be used with 254*47675Scael.Xr getsockopt . 255*47675ScaelThe structure it returns is described in 256*47675Scael.Aq Pa netiso/tp_stat.h . 257*47675ScaelSee 258*47675Scael.Xr tpperf 8 . 259*47675Scael.It Dv TPOPT_FLAGS 260*47675Scaelunsigned integer. [0x0] 261*47675Scael.br 262*47675ScaelThis command can only be used with 263*47675Scael.Xr getsockopt . 26442482SsklowerSee the description of the flags below. 265*47675Scael.It Dv TPOPT_PARAMS 266*47675Scael.Ar struct tp_conn_param 267*47675Scael.br 26842482SsklowerUsed to get or set a group parameters for a connection. 269*47675ScaelThe 270*47675Scael.Ar struct tp_conn_param 271*47675Scaelis the argument used with the 272*47675Scael.Xr getsockopt 273*47675Scaelor 274*47675Scael.Xr setsockopt 275*47675Scaelsystem call. 27642482SsklowerIt is described in 277*47675Scael.Aq Pa netiso/tp_user.h . 278*47675Scael.Pp 279*47675ScaelThe fields of the 280*47675Scael.Ar tp_conn_param 281*47675Scaelstructure are 28242482Ssklowerdescribed below. 283*47675Scael.El 284*47675Scael.Pp 285*47675Scael.Em Values for TPOPT_PARAMS: 286*47675Scael.Bl -tag -width p_sendack_ticks 287*47675Scael.It Ar p_Nretrans 288*47675Scaelnonzero short integer [1] 289*47675Scael.br 290*47675ScaelNumber of times a TPDU 291*47675Scaelwill be retransmitted before the 29242482Ssklowerlocal TP entity closes a connection. 293*47675Scael.It Ar p_dr_ticks 294*47675Scaelnonzero short integer [various] 295*47675Scael.br 296*47675ScaelNumber of clock ticks between retransmissions of disconnect request 297*47675ScaelTPDUs. 298*47675Scael.It Ar p_dt_ticks 299*47675Scaelnonzero short integer [various] 300*47675Scael.br 301*47675ScaelNumber of clock ticks between retransmissions of data 302*47675ScaelTPDUs. 30342482SsklowerThis parameter applies only to class 4. 304*47675Scael.It Ar p_cr_ticks 305*47675Scaelnonzero short integer [various] 306*47675Scael.br 307*47675ScaelNumber of clock ticks between retransmissions of connection request 308*47675ScaelTPDUs. 309*47675Scael.It Ar p_cc_ticks 310*47675Scaelnonzero short integer [various] 311*47675Scael.br 312*47675ScaelNumber of clock ticks between retransmissions of connection confirm 313*47675ScaelTPDUs. 31442482SsklowerThis parameter applies only to class 4. 315*47675Scael.It Ar p_x_ticks 316*47675Scaelnonzero short integer [various] 317*47675Scael.br 318*47675ScaelNumber of clock ticks between retransmissions of expedited data 319*47675ScaelTPDUs. 32042482SsklowerThis parameter applies only to class 4. 321*47675Scael.It Ar p_sendack_ticks 322*47675Scaelnonzero short integer [various] 323*47675Scael.br 32442482SsklowerNumber of clock ticks that the local TP entity 32542482Ssklowerwill wait before sending an acknowledgment for normal data 326*47675Scael(not applicable if the acknowlegement strategy is 327*47675Scael.Dv TPACK_EACH ) . 32842482SsklowerThis parameter applies only to class 4. 329*47675Scael.It Ar p_ref_ticks 330*47675Scaelnonzero short integer [various] 331*47675Scael.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 336*47675Scael.Tn ARGO 337*47675Scaelimplementation, despite the fact that 33842482Ssklowerthe frozen reference function is required only for 33942482Ssklowerclass 4. 340*47675Scael.It Ar p_inact_ticks 341*47675Scaelnonzero short integer [various] 342*47675Scael.br 34342482SsklowerNumber of clock ticks without an incoming packet from the peer after which 344*47675Scael.Tn TP 345*47675Scaelclose the connection. 34642482SsklowerThis parameter applies only to class 4. 347*47675Scael.It Ar p_keepalive_ticks 348*47675Scaelnonzero short integer [various] 349*47675Scael.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. 354*47675Scael.It Ar p_winsize 35542482Ssklowershort integer between 128 and 16384. [4096 bytes] 356*47675Scael.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 363*47675Scaelmaximum TPDU 364*47675Scaelsize, and the 36542482Ssklowerrate at which the user program receives data. 36642482SsklowerThis parameter applies only to class 4. 367*47675Scael.It Ar p_tpdusize 36842482Ssklowerunsigned char between 0x7 and 0xd. 369*47675Scael[0xc for class 4] [0xb for class 0] 370*47675Scael.br 37142482SsklowerLog 2 of the maximum TPDU size to be negotiated. 372*47675ScaelThe 373*47675Scael.Tn TP 374*47675Scaelstandard 375*47675Scael.Pf ( Tn ISO 376*47675Scael8473) gives an upper bound of 37742482Ssklower0xd for class 4 and 0xb for class 0. 378*47675ScaelThe 379*47675Scael.Tn ARGO 380*47675Scaelimplementation places upper bounds of 38142482Ssklower0xc on class 4 and 0xb on class 0. 382*47675Scael.It Ar p_ack_strat 383*47675Scael.Dv TPACK_EACH 384*47675Scaelor 385*47675Scael.Dv TPACK_WINDOW. 386*47675Scael.Bq Dv TPACK_WINDOW 387*47675Scael.br 38842482SsklowerThis parameter applies only to class 4. 38942482SsklowerTwo acknowledgment strategies are supported: 390*47675Scael.Pp 391*47675Scael.Dv TPACK_EACH means that each data TPDU 392*47675Scaelis acknowledged 39342482Ssklowerwith an AK TPDU. 394*47675Scael.Pp 395*47675Scael.Dv TPACK_WINDOW 39642482Ssklowermeans that upon receipt of the packet that represents 39742482Ssklowerthe high edge of the last window advertised, and AK TPDU is generated. 398*47675Scael.It Ar p_rx_strat 39942482Ssklower4 bit mask 400*47675Scael.Bq Dv TPRX_USE_CW No \&|\ Dv TPRX_FASTSTART 401*47675Scaelover 402*47675Scaelconnectionless network protocols] 403*47675Scael.Pf [ Dv TPRX_USE_CW 404*47675Scaelover 405*47675Scaelconnection-oriented network protocols] 406*47675Scael.br 40742482SsklowerThis parameter applies only to class 4. 40842482SsklowerThe bit mask may include the following values: 409*47675Scael.Pp 410*47675Scael.Dv TPRX_EACH : 411*47675ScaelWhen a retransmission timer expires, retransmit 41242482Ssklowereach packet in the send window rather than 41342482Ssklowerjust the first unacknowledged packet. 414*47675Scael.Pp 415*47675Scael.Dv TPRX_USE_CW : 416*47675ScaelUse 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. 420*47675Scael.Pp 421*47675Scael.Dv TPRX_FASTSTART : 422*47675ScaelBegin 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 42642482Ssklowerit slowly grow up to the real peer's window 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. 431*47675Scael.It Ar p_class 43242482Ssklower5 bit mask 433*47675Scael.Bq Dv TP_CLASS_4 No \&|\ Dv TP_CLASS_0 434*47675Scael.br 435*47675ScaelBit mask including one or both of the values 436*47675Scael.Dv TP_CLASS_4 437*47675Scaeland 438*47675Scael.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. 442*47675Scael.It Ar p_xtd_format 44342482SsklowerBoolean. 444*47675Scael[false] 445*47675Scael.br 44642482SsklowerBoolean indicating that extended format shall be negotiated. 44742482SsklowerThis parameter applies only to class 4. 448*47675Scael.It Ar p_xpd_service 44942482SsklowerBoolean. 450*47675Scael[true] 451*47675Scael.br 45242482SsklowerBoolean indicating that 45342482Ssklowerthe expedited data transport service will be negotiated. 45442482SsklowerThis parameter applies only to class 4. 455*47675Scael.It Ar p_use_checksum 45642482SsklowerBoolean. 457*47675Scael[true] 458*47675Scael.br 45942482SsklowerBoolean indicating the the use of checksums will be negotiated. 46042482SsklowerThis parameter applies only to class 4. 461*47675Scael.It Ar p_use_nxpd 46242482SsklowerReserved for future use. 463*47675Scael.It Ar p_use_rcc 46442482SsklowerReserved for future use. 465*47675Scael.It Ar p_use_efc 46642482SsklowerReserved for future use. 467*47675Scael.It Ar p_no_disc_indications 46842482SsklowerBoolean. 469*47675Scael[false] 470*47675Scael.Pp 471*47675ScaelBoolean indicating that the local 472*47675Scael.Tn TP 473*47675Scaelentity shall not issue 474*47675Scaelindications (signals) when a 475*47675Scael.Tn TP 476*47675Scaelconnection is disconnected. 477*47675Scael.It Ar p_dont_change_params 478*47675ScaelBoolean. [false] 479*47675Scael.br 480*47675ScaelIf 481*47675Scael.Em true 482*47675Scaelthe 483*47675Scael.Tn TP 484*47675Scaelentity will not override 48542482Ssklowerany of the other values given in this structure. 486*47675ScaelIf the values cannot be used, the 487*47675Scael.Tn TP 488*47675Scaelentity will drop, disconnect, 48942482Sskloweror refuse to establish the connection to which this structure pertains. 490*47675Scael.It Ar p_netservice 491*47675ScaelOne of { 492*47675Scael.Dv ISO_CLNS , 493*47675Scael.Dv ISO_CONS , 494*47675Scael.Dv ISO_COSNS , 495*47675Scael.Dv IN_CLNS } . 496*47675Scael.Pf [ Dv ISO_CLNS ] 497*47675Scael.br 49842482SsklowerIndicates which network service is to be used. 499*47675Scael.Pp 500*47675Scael.Dv ISO_CLNS 501*47675Scaelindicates the connectionless network service provided 502*47675Scaelby CLNP 503*47675Scael.Pf ( Tn ISO 504*47675Scael8473). 505*47675Scael.Pp 506*47675Scael.Dv ISO_CONS 507*47675Scaelindicates the connection-oriented network service provided 508*47675Scaelby X.25 509*47675Scael.Pf ( Tn ISO 510*47675Scael8208) and 511*47675Scael.Tn ISO 512*47675Scael8878. 513*47675Scael.Pp 514*47675Scael.Dv ISO_COSNS 515*47675Scaelindicates the 51642482Ssklowerconnectionless network service running over a 517*47675Scaelconnection-oriented subnetwork service: CLNP 518*47675Scael.Pf ( Tn ISO 519*47675Scael8473) over X.25 520*47675Scael.Pf ( Tn ISO 521*47675Scael8208). 522*47675Scael.Pp 523*47675Scael.Dv IN_CLNS 524*47675Scaelindicates the 52542482SsklowerDARPA Internet connectionless network service provided by IP (RFC 791). 526*47675Scael.It Ar p_dummy 52742482SsklowerReserved for future use. 528*47675Scael.El 529*47675Scael.Pp 530*47675ScaelThe 531*47675Scael.Dv TPOPT_FLAGS 532*47675Scaeloption 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 538*47675Scael.Em Values for TPOPT_FLAGS: 539*47675Scael.Bl -tag -width Bitsx 540*47675Scael.It Sy Bits 541*47675Scael.Sy Description [Default] 542*47675Scael.It \&0 543*47675Scael.Dv TPFLAG_NLQOS_PDN : 544*47675Scaelset when the quality of the 54542482Ssklowernetwork service is 54642482Ssklowersimilar to that of a public data network. 547*47675Scael.It \&1 548*47675Scael.Dv TPFLAG_PEER_ON_SAMENET : 549*47675Scaelset when the peer 550*47675Scael.Tn TP 551*47675Scaelentity 55242482Sskloweris considered to be on the same network as the local 553*47675Scael.Tn TP 554*47675Scaelentity. 555*47675Scael.It \&2 55642482SsklowerNot used. 557*47675Scael.It \&3 558*47675Scael.Dv TPFLAG_XPD_PRES : 559*47675Scaelset when expedited data are present 560*47675Scael[0] 561*47675Scael.It 4\&..7 56242482SsklowerReserved. 563*47675Scael.El 564*47675Scael.Sh ERROR VALUES 565*47675Scael.Pp 566*47675ScaelThe 567*47675Scael.Tn TP 568*47675Scaelentity returns 569*47675Scael.Va errno 570*47675Scaelerror values as defined in 571*47675Scael.Aq Pa sys/errno.h 57242482Ssklowerand 573*47675Scael.Aq Pa netiso/iso_errno.h . 57442482SsklowerUser programs may print messages associated with these value by 575*47675Scaelusing an expanded version of 576*47675Scael.Xr perror 577*47675Scaelfound in the 578*47675Scael.Tn ISO 579*47675Scaellibrary, 580*47675Scael.Pa libisodir.a . 581*47675Scael.Pp 582*47675ScaelIf the 583*47675Scael.Tn TP 584*47675Scaelentity 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, 589*47675Scaelthe 590*47675Scael.Tn TP 591*47675Scaelentity issues a 592*47675Scael.Dv SIGURG 593*47675Scaelsignal, 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 598*47675Scael.Va errno 599*47675Scaelvalue upon return from the system call is 600*47675Scael.Er EINTR. 601*47675ScaelIf the signal 602*47675Scael.Dv SIGURG 60342482Sskloweris being handled by reading 604*47675Scaelfrom the socket, and it was a 605*47675Scael.Xr accept 2 606*47675Scaelthat 607*47675Scaeltimed out, the read may result in 608*47675Scael.Er ENOTSOCK , 609*47675Scaelbecause the 610*47675Scael.Xr accept 611*47675Scaelcall had not yet returned a 61242482Ssklowerlegitimate socket descriptor when the signal was handled. 613*47675Scael.Dv ETIMEDOUT 614*47675Scael(or a some other errno value appropriate to the 615*47675Scaeltype of error) is returned if 616*47675Scael.Dv SIGURG 617*47675Scaelis blocked 61842482Ssklowerfor the duration of the system call. 61942482SsklowerA user program should take one of the following approaches: 620*47675Scael.Bl -tag -width Ds 621*47675Scael.It Block Dv SIGURG 62242482SsklowerIf the program is servicing 623*47675Scaelonly one connection, it can block or ignore 624*47675Scael.Dv SIGURG 625*47675Scaelduring connection 62642482Ssklowerestablishment. 627*47675ScaelThe advantage of this is that the 628*47675Scael.Va errno 629*47675Scaelvalue 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. 635*47675Scael.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 638*47675Scaelservice 639*47675Scael.Dv SIGURG . 640*47675ScaelIt can use the 641*47675Scael.Fn getsockopt ...TPOPT_FLAGS... 642*47675Scaelsystem 64342482Ssklowercall to see if the signal 64442482Ssklowerwas due to the arrival of expedited data or due to a disconnection. 64542482SsklowerIn the latter case, 646*47675Scael.Xr getsockopt 647*47675Scaelwill return 648*47675Scael.Er ENOTCONN . 649*47675Scael.El 650*47675Scael.Sh SEE ALSO 651*47675Scael.Xr tcp 4 , 652*47675Scael.Xr netstat 1 , 653*47675Scael.Xr iso 4 , 654*47675Scael.Xr clnp 4 , 655*47675Scael.Xr cltp 4 , 656*47675Scael.Xr ifconfig 8 . 657*47675Scael.Sh HISTORY 658*47675ScaelThe 659*47675Scael.Nm 660*47675Scaelprotocol 661*47675Scael.Ud 662*47675Scael.Sh BUGS 66342482SsklowerThe protocol definition of expedited data is slightly problematic, 66442482Ssklowerin a way that renders expedited data almost useless, 66542482Ssklowerif two or more packets of expedited data are send within 666*47675Scaeltime \(*e, where \(*e 66742482Ssklowerdepends on the application. 66842482SsklowerThe problem is not of major significance since most applications 66942482Ssklowerdo not use transport expedited data. 67042482SsklowerThe problem is this: 671*47675Scaelthe expedited data acknowledgment TPDU 672*47675Scaelhas no field for conveying 673*47675Scaelcredit, thus it is not possible for a 674*47675Scael.Tn TP 675*47675Scaelentity to inform its peer 67642482Ssklowerthat "I received your expedited data but have no room to receive more." 677*47675ScaelThe 678*47675Scael.Tn TP 679*47675Scaelentity has the choice of acknowledging receipt of the 680*47675ScaelXPD TPDU: 681*47675Scael.Bl -tag -width Ds 682*47675Scael.It "when the user receives the" XPD TSDU 68342482Ssklowerwhich may be a fairly long time, 684*47675Scaelwhich may cause the sending 685*47675Scael.Tn TP 686*47675Scaelentity to retransmit the packet, 68742482Ssklowerand possibly to close the connection after retransmission, or 688*47675Scael.It "when the" Tn TP No "entity receives it" 68942482Ssklowerso the sending entity does not retransmit or close the connection. 69042482SsklowerIf the sending user then tries to send more expedited data 691*47675Scael.Dq soon , 692*47675Scaelthe expedited data will not be acknowledged (until the 69342482Ssklowerreceiving user receives the first XPD TSDU). 694*47675Scael.El 695*47675Scael.Pp 696*47675ScaelThe 697*47675Scael.Tn ARGO 698*47675Scaelimplementation acknowledges XPD TPDUs 699*47675Scaelimmediately, 70042482Ssklowerin the hope that most users will not use expedited data requently 70142482Ssklowerenough for this to be a problem. 702