Technical Standard: Networking Services (XNS), Issue 5.2 Draft 2.0
Copyright © 1999 The Open Group
XTI Library Functions and Parameters
The function synopses in this Chapter 6, and the function definitions in
Example XTI Header Files,
conform to ISO C standard (see
How to Prepare XTI Applications
In a software development environment, a program, for example
that uses XTI functions must be compiled with the XTI
An application may also have a requirement to define some feature test
macro(s) as described in
The Compilation Environment
(The Compilation Environment)
to enable the functionality described in this specification.
XTI structures and constants are all defined in the
header, which can be found in
Example XTI Header Files.
Any protocol-specific header files described in Appendices of
this specification and needed by the application must follow
the inclusion of
- When _XOPEN_SOURCE is defined to be less than 500,
the definitions from some protocol specific
headers are automatically exposed by the inclusion of <xti.h>. The
individual appendices for those protocols document the headers for which
Key for Parameter Arrays
For each XTI function description, a table
is given which summarises the contents of the input and
The key is given below:
- The parameter value is meaningful.
(Input parameter must be set before the call and
output parameter may be read after the call.)
- The content of the object pointed to by the x pointer is meaningful.
- The parameter value is meaningful but the parameter is optional.
- The content of the object pointed to by the ? pointer is optional.
- The parameter value is meaningless.
- The parameter after the call keeps the same value as before the call.
Return of TLOOK Error
Many of the XTI functions contained in this chapter return a
[TLOOK] error to report the occurrence of an asynchronous event.
For these functions a complete list describing the function and the events
is provided in
Events and TLOOK Error Indication.
Use of "struct netbuf"
Many of the XTI functions have an argument that points to a
structure with members of type
These are used to pass arbitrary length buffer items such as
user data, network addresses and option buffers to and from the
contains the following members:
unsigned int maxlen
unsigned int len
For guaranteed portability, the space pointed to by
should be aligned appropriately to the most restrictive alignment
of any of the data types it contains.
When a buffer item is being passed to the provider,
are the address and length in bytes of the data in the user's
is not used and may take any value.
When a buffer item is being passed to the user, prior to the call the
user must set
to the address and length of
the user's buffer. On return the provider will set
number of bytes of data placed into the user's buffer. If the
user's buffer has a non-zero
but is not long enough for
the buffer item, then the provider will fail the XTI call, setting
to TBUFOVFLW and discarding the event being returned to the
is zero then the provider will discard the
data that would have been returned, and ignore
(which need not have been a valid address).