📄 t_getinfo.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>t_getinfo</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><xref type="10" name="getinfo"></xref><h4>NAME</h4><blockquote>t_getinfo - get protocol-specific service information</blockquote><h4>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="xti.h.html">xti.h</a>>int t_getinfo( int fd, struct t_info *info)</code></pre></blockquote><h4>DESCRIPTION</h4><blockquote><pre><P><table bordercolor=#000000 border=1 align=center><tr valign=top><th align=center><b>Parameters</b><th align=center><b>Before call</b><th align=center><b>After call</b><tr valign=top><td align=left>fd<td align=center>x<td align=center>/<tr valign=top><td align=left>info-><td align=center>addr<td align=center>/<tr valign=top><td align=left>info-><td align=center>options<td align=center>/<tr valign=top><td align=left>info-><td align=center>tsdu<td align=center>/<tr valign=top><td align=left>info-><td align=center>etsdu<td align=center>/<tr valign=top><td align=left>info-><td align=center>connect<td align=center>/<tr valign=top><td align=left>info-><td align=center>discon<td align=center>/<tr valign=top><td align=left>info-><td align=center>servtype<td align=center>/<tr valign=top><td align=left>info-><td align=center>flags<td align=center>/</table></pre><p>This function returns the current characteristics of the underlyingtransport protocol and/or transport connectionassociated with file descriptor <I>fd</I>.The <I>info</I> pointer is used to return the same information returned by<i><a href="t_open.html">t_open()</a></i>,although not necessarily precisely the same values.This function enables a transport user to access thisinformation during any phase of communication.<p>This argument points to a<B>t_info</B>structure which contains the followingmembers:<pre><code>t_scalar_t addr; /*max size in octets of the transport protocol address*/t_scalar_t options; /*max number of bytes of protocol-specific options */t_scalar_t tsdu; /*max size in octets of a transport service data unit */t_scalar_t etsdu; /*max size in octets of an expedited transport service*/ /*data unit (ETSDU) */t_scalar_t connect; /*max number of octets allowed on connection */ /*establishment functions */t_scalar_t discon; /*max number of octets of data allowed on t_snddis() */ /*and t_rcvdis() functions */t_scalar_t servtype; /*service type supported by the transport provider */t_scalar_t flags; /*other info about the transport provider */</code></pre><p>The values of the fields have the following meanings:<dl compact><dt><I>addr</I><dd>A value greater than zero indicates the maximumsize of a transport protocol addressand a value of T_INVALID (-2)specifies that the transport provider does not provide useraccess to transport protocol addresses.<dt><I>options</I><dd>A value greater than zero indicates the maximumnumber of bytes of protocol-specific options supported by theprovider,and a value of T_INVALID (-2) specifies that the transport providerdoes not support user-settable options.<dt><I>tsdu</I><dd>A value greater than zero specifiesthe maximum size in octets of a transport servicedata unit (TSDU);a value of T_NULL (zero) specifies that thetransport provider does not support the concept ofTSDU,although it does support the sending of a datastream with nological boundaries preserved across a connection;a value of T_INFINITE (-1)specifies that there is no limit on the size in octets of aTSDU;and a value of T_INVALID (-2) specifies that the transfer of normal data isnot supported by the transport provider.<dt><I>etsdu</I><dd>A value greater than zero specifiesthe maximum size in octets of an expedited transportservice data unit (ETSDU);a value of T_NULL (zero) specifies that thetransport provider does not support the concept of ETSDU,although it does support the sending of an expedited data stream with nological boundaries preserved across a connection;a value of T_INFINITE (-1)specifies that there is no limit on the size (in octets) of anETSDU;and a value of T_INVALID (-2)specifies that the transfer of expedited data isnot supported by the transport provider.Note that the semantics of expedited data may be quitedifferent for different transport providers(see<xref href=istpi></xref>and<xref href=ipsi></xref>).<dt><I>connect</I><dd>A value greater than zero specifiesthe maximum number of octets that may be associated withconnection establishment functionsand a value of T_INVALID (-2) specifies that the transport provider does notallow data to be sent with connection establishment functions.<dt><I>discon</I><dd>If the T_ORDRELDATA bit in flags is clear,a value greater than zero specifiesthe maximum number of octets that may be associated with the<i><a href="t_snddis.html">t_snddis()</a></i>and<i><a href="t_rcvdis.html">t_rcvdis()</a></i>functions,and a value of T_INVALID (-2) specifies that the transport provider does notallow data to be sent with the abortive release functions.If the T_ORDRELDATA bit is set in flags, a valuegreater than zero specifies the maximum number of octetsthat may be associated with the <i><a href="t_sndreldata.html">t_sndreldata()</a></i>,<i><a href="t_rcvreldata.html">t_rcvreldata()</a></i>,<i><a href="t_snddis.html">t_snddis()</a></i>and <i><a href="t_rcvdis.html">t_rcvdis()</a></i>functions.<dt><I>servtype</I><dd>This field specifies the service type supported by the transport provider,as described below.<dt><I>flags</I><dd>This is a bit field used to specify other information about the communications provider. If the T_ORDRELDATA bit is set,the communications provider supports sending user datawith an orderly release.If the T_SENDZERO bit is set in flags, this indicates thatthe underlyingtransport provider supports the sending of zero-length TSDUs.See<xref href=istpi></xref>for a discussion of the separate issue of zero-length fragmentswithin a TSDU.</dl><p>If a transport user is concerned with protocol independence, the abovesizes may be accessed to determine how large the buffers must beto hold each piece of information. Alternatively, the<i><a href="t_alloc.html">t_alloc()</a></i>function may be used to allocate these buffers.An error will result if a transport user exceeds the alloweddata size on any function.The value of each field may change as a result of protocoloption negotiation during connection establishment(the<i><a href="t_optmgmt.html">t_optmgmt()</a></i>call has no effect on the values returned by<i>t_getinfo()</i>).These values will only change from the values presented to<i><a href="t_open.html">t_open()</a></i>after the endpoint enters the T_DATAXFER state.<p>The<I>servtype</I>field of<I>info</I>specifies one of the following values on return:<dl compact><dt>T_COTS<dd>The transport provider supports a connection-mode service butdoes not support the optional orderly release facility.<dt>T_COTS_ORD<dd>The transport provider supports a connection-mode service withthe optional orderly release facility.<dt>T_CLTS<dd>The transport provider supports a connectionless-mode service.For this service type,<i><a href="t_open.html">t_open()</a></i>will return T_INVALID (-2) for<I>etsdu</I>,<I>connect</I>and<I>discon</I>.</dl></blockquote><h4>VALID STATES</h4><blockquote>ALL - apart from T_UNINIT</blockquote><h4>ERRORS</h4><blockquote>On failure,<I>t_errno</I>is set to one of the following:<dl compact><dt>[TBADF]<dd>The specified file descriptor does not refer to a transportendpoint.<dt>[TPROTO]<dd>This error indicates that a communication problem has been detected betweenXTI and the transport provider for which there is no other suitable XTIerror<I>(t_errno)</I>.<dt>[TSYSERR]<dd>A system error has occurred during execution of this function.</dl></blockquote><h4>RETURN VALUE</h4><blockquote>Upon successful completion, a value of 0 is returned. Otherwise,a value of -1 is returned and<I>t_errno</I>is set to indicate an error.</blockquote><h4>SEE ALSO</h4><blockquote><i><a href="t_alloc.html">t_alloc()</a></i>,<i><a href="t_open.html">t_open()</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -