X.25 API Reference

| Introduction | Function Summary | Function Reference |

Function Summary

X25openOpen a X25CALLT on a specified X25MUX
X25closeClose an X25CALLT
X25incallReceive a call index for a pending incoming call
X25getcallAccept a call given a call index
X25makecallMake an X.25 call
X25acceptProcess call acceptance of an X.25 call
X25clearClear a call
X25pvcattach/X25hdlcattachAttach to a PVC or HDLC/LAPB link.
X25gotresetHandles reception of an incoming RESET packet
X25pvcdetach/X25hdlcdetachDetach from a PVC or HDLC/LAPB link
X25writeWrite a packet across your X.25 virtual circuit or HDLC link
X25readReceive a packet from your X.25 virtual circuit or HDLC link
X25resetSend a RESET packet
X25resetconfSend a RESET CONFIRM packet
X25interruptSend an INTERRUPT packet
X25interruptconfSend an INTERRUPT CONFIRM packet
X25listenStart listening on the specific X25CALLT
X25stoplistenStop listening for incoming calls on the specified X25CALLT
X25lookCheck for pending events on your VC or listener.
X25findtagFind tag index in tag array
X25setoptsSet X.25 library parameters
X25getoptsGet X.25 library parameters
X25linkupObtain link up status
X25getcallinfoObtain X.25 Incoming call information
X25senseObtain status of DCD, DSR and CTS for chosen link
X25setdebugfileSets the library debug output file
X25setdebugfuncSets the library debug output function
X25debugEnable or disable X.25 library debugging
X25setfilterSets network type filter for packetnets accesses
X25setnetentInitializes the packetnets file for reading
X25endnetentEnds packetnets file processing
X25getnetentReturn next X25netent entry from packetnets file
X25getnetbynameFinds the network ID given the network name
X25getnetbynetidFinds the network entry with the given network ID in packetnets file
X25getnetbyboardFinds the host with the given board and link in packetnets file
X25remotenetidtolocalnetidMap remote netid to local netid
X25sethostentInitializes the x25hosts file for reading
X25endhostentEnds x25hosts file processing
X25gethostentReturn next X25hostent entry from x25hosts file
X25gethostbyaddrFinds the host with the given X.25 address in x25hosts file
X25gethostbynameFinds the named host in x25hosts file
X25getinfoObtain information about an established call
X25initcpstagsInitialize a Call Progress Structure
X25initcpsClears a Call Progress Structure
X25initpvctagsInitialize a PVC Descriptor Structure
X25initpvcClears a PVC description Structure
X25lookinitInitialize the file descriptor selection mechanism
X25lookcloseCloses the look list handle
X25lookaddAdd file descriptor(s) to the look list
X25lookdelRemoves the file descriptor(s) from the look list
X25lookselChecks for availability of datagrams on look list
X25lookatoneLook at one X25CALLT and wait for activity
X25errorPrints the X.25 error message
X25seterrorSets the X.25 error
X25geterrorGets the X.25 error
X25getsyserrorGets the X.25 system error
X25getdiagsGets the X.25 diagnostic and cause codes
X25errormsgObtain error message based on X.25 error code
X25causemsgObtain error message based on cause code
X25diagmsgObtain error message based on diagnostic code





| Introduction | Function Summary | Function Reference |

Function Reference



X25open

PrototypesX25CALLT X25open(int netid, ...)

X25CALLT X25opentags(int netid, TAGS *tags)

PurposeOpen a X25CALLT on a specified X25MUX
Description X25open opens a suitable X.25 device. No calls are made or accepted in this function.
You may identify the endpoint in 2 ways:
  • Specify a valid network ID as the first argument
  • Specify a valid network name (T_NETNAME) and an arbitrary netid
You may use the T_FLAGS tag to specify special options for the Unix open() flag for local network IDs only.
Tags
  • All global tags
  • T_NETNAME
  • T_HANDLE
  • T_DEVICE
  • T_BOARD
  • T_LINK
  • T_WATCH
  • T_WATCHEVENT
  • T_WATCHMESSAGE
  • T_FLAGS
  • T_BLOCKING
  • T_SYNCTCP
Parameters
netidnetwork ID to open (ignored depending on tag choices)
tagspointer to TAGS list
Returns
X25CALLTon success
NULLon failure
Errors
  • X25SYSERR
  • X25BADMUX
  • X25BADNETID
  • X25BADPOINTER
  • X25NOMUXSLOTS
  • X25MUXNOTINIT
See Also

| Introduction | Function Summary | Function Reference |



X25close

Prototypesvoid X25close(X25CALLT ct)

PurposeClose an X25CALLT
Description Closes the file descriptor associated with a specific call.
Frees all internally allocated memory for a specific call.
Calls X25pvcdetach() for PVCs or X25clear() if a call was established.
After this call ct should no longer be considered a valid pointer.
Parameters
ctX25CALLT handle
See Also

| Introduction | Function Summary | Function Reference |



X25incall

Prototypesint X25incall(X25CALLT ct, ...)

int X25incall(X25CALLT ct, TAGS *tags)

PurposeReceive a call index for a pending incoming call
Description Receive a call index for a pending incoming call.
This call index is appropriate to use for a call to X25getcall().
This function should be called with the ct associated with the X25listen() request.
Normally this function is used after establishing that a call has indeed been received using the X25look() function.
The T_PNETID tag allows determining on which netid the call arrived on.
The T_CPSP tag with a pointer to enough storage for a cps structure will copy the cps (Call Progress Structure) into that user supplied buffer.
Tags
  • All global tags
  • T_CPSP
  • T_PNETID
Parameters
ctX25CALLT handle
Returns
idxcall index on success
-1on failure
Errors
  • X25SYSERR
  • X25CLEAR
  • X25PVCINUSE
  • X25BADCALLT
  • X25BADMSG
  • X25NOVC
See Also

| Introduction | Function Summary | Function Reference |



X25getcall

Prototypesint X25getcall(X25CALLT ct, ...)

int X25getcalltags(X25CALLT ct, TAGS *tags)

PurposeAccept a call given a call index
Description X25getcall() will accept a call given a call index.
The T_CALLINDEX argument MUST be specified and can be obtained by the user program from the x25daemon or x25calld by specifying $index on the x25incalls or x25tab command line or by calling X25incall().
The cps for this call will be updated.
Tags
  • All global tags
  • T_CALLINDEX
  • T_CPSP
Parameters
ctX25CALLT handle
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25CLEAR
  • X25PVCINUSE
  • X25BADCALLT
  • X25NOVC
See Also

| Introduction | Function Summary | Function Reference |



X25makecall

Prototypesint X25makecall(X25CALLT ct, ...)

int X25makecalltags(X25CALLT ct, TAGS *tags)

PurposeMake an X.25 call
Description There are two ways to specify parameters to this function:
The first involves passing in each parameter seperately, however, for the advanced user, a cps structure may be passed in directly using the T_CPSP tag. A copy of the CPS is made (so that the passed in cps storage does not have to stay persistent/in scope.)
The T_HOST tag will use the host names in the x25hosts file to bind default options to a particular host. T_HOSTADDR will try to match a host by its address from the x25hosts file.
T_DNA will default to 9999 if not supplied.
T_CUD will default to 1 0 0 0 if not supplied.
Tags
  • All global tags
  • T_INPKTSIZE
  • T_OUTPKTSIZE
  • T_INWINDOW
  • T_OUTWINDOW
  • T_PRIORITY
  • T_REVERSE
  • T_CUD
  • T_CUDLEN
  • T_DNA
  • T_DNALEN
  • T_NUI
  • T_CPSP
  • T_NUILEN
  • T_INTHRUCLASS
  • T_OUTTHRUCLASS
  • T_DBITSUPPORT
  • T_PKTSIZE
  • T_WINDOW
  • T_THRUCLASS
  • T_HOST
  • T_HOSTADDR
Parameters
ctX25CALLT handle
tagspointer to TAGS list
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25BADHOST
  • X25PVCINUSE
  • X25BADCALLT
  • X25BADMSG
  • X25CLEAR
  • X25CONNECTEDIND
  • X25BADCUD
  • X25BADDNA
  • X25BADNUI

| Introduction | Function Summary | Function Reference |



X25accept

Prototypesint X25accept(X25CALLT ct)

PurposeProcess call acceptance of an X.25 call
Description This function will process Call acceptance of a previous X25makecall() with the T_NOWAIT tag set to TRUE. This function assumes that there is a call acceptance packet to be read. (ie. X25look() returns X25CONNECTEDIND).
Parameters
ctX25CALLT handle
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25PVCINUSE
  • X25BADCALLT
  • X25BADMSG
  • X25CLEAR
  • X25CONNECTEDIND

| Introduction | Function Summary | Function Reference |



X25clear

Prototypesint X25clear(X25CALLT ct, ...)

int X25cleartags(X25CALLT ct, tags);

PurposeClear a call
Description Clears an X.25 call. Not valid on PVCs. There are 3 ways to call this function:
  • No tags (except TAG_END of course!) In this case the driver will use a Diagnostic and XIP cause of XCA_CLOSED, and a Cause value of 0x00
  • You may supply the cps structure (using T_CPSP) in which case all the other tags are not considered. you may use the value NULL for this tag in order to use the cps associated with this call. If you are using this tag then the other tags will have no effect
  • You may supply the Cause value (T_CAUSE) (defaults to 0x00) you may also supply a diagnostic (T_DIAG) (defaults to XCA_CLOSED) you may also supply an XIP Cause code (T_XIPCAUSE) (def. to 0x00)
Tags
  • All global tags
  • T_DIAG
  • T_CAUSE
  • T_XIPCAUSE
  • T_CPSP
  • T_CALLINDEX
  • T_NETID
Parameters
ctX25CALLT handle
tagspointer to TAGS list
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25PVCINUSE
  • X25BADCALLT
  • X25ISAPVC
  • X25USERDATA

| Introduction | Function Summary | Function Reference |



X25pvcattach/X25hdlcattach

Prototypesint X25pvcattach(X25CALLT ct, ...)

int X25hdlcattach(X25CALLT ct, ...)

int X25pvcattachtags(X25CALLT ct, TAGS *tags)

int X25hdlcattachtags(X25CALLT ct, TAGS *tags)

PurposeAttach to a PVC or HDLC/LAPB link.
Description This function tries to establish a PVC or HDLC/LAPB connection over the given Logical Channel (defaults to 1.)
When passing a copy of the _pvcdesc using T_PVCP a copy of the _pvcdesc is made (so that the passed in _pvcdesc storage does not have to stay persistent/in scope.)
A reset will normally be generated by the protocol stack in response to this function. In the case of X25pvcattach(), this reset is sent to the application when a reset packet has been exchanged with the remote application on the selected LCI.
In the case of X25hdlcattach(), this reset is sent to the application when the link (layer 2) is up. Usually, these routines wait for the resulting reset before returning to the calling application. This means that the application can start to send and/or receive data upon return from these routines.
If T_NOWAIT, TRUE is passed in then this function will not wait for a RESET (X25RESET event). X25look() may be called upon readability of the associated PVC file descriptor to determine if a X25RESET has been received, at which point X25gotreset() should be called to properly set internal library state.
Tags
  • All global tags
  • T_OUTPKTSIZE
  • T_INPKTSIZE
  • T_INWINDOW
  • T_OUTWINDOW
  • T_PKTSIZE
  • T_WINDOW
  • T_LCI
  • T_PVCP
Parameters
ctX25CALLT handle
tagspointer to TAGS list
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25BADMSG
  • X25BADCALLT
  • X25CONNECTEDIND
  • X25BADCUD
See Also

| Introduction | Function Summary | Function Reference |



X25gotreset

Prototypesint X25gotreset(X25CALLT ct, ...)

int X25gotresettags(X25CALLT ct, TAGS *tags)

PurposeHandles reception of an incoming RESET packet
Description This function has to be called after doing a non-blocking X25pvcattach() ie. T_NOWAIT, TRUE.
If T_VERBOSE is set "Complete" is printed on the console. We obtain PVC information and return 0. It is assumed that the reset was already observed using X25look() or X25read().
Tags
  • None
Parameters
ctX25CALLT handle
tagspointer to TAGS list
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25BADCALLT
See Also

| Introduction | Function Summary | Function Reference |



X25pvcdetach/X25hdlcdetach

Prototypesint X25pvcdetach(X25CALLT ct, ...)

int X25hdlcdetach(X25CALLT ct, ...)

int X25pvcdetachtags(X25CALLT ct, TAGS *tags)

int X25hdlcdetachtags(X25CALLT ct, TAGS *tags)

PurposeDetach from a PVC or HDLC/LAPB link
Description Detaches from PVC or HDLC/LAPB associated with ct.
Tags
  • All global tags
Parameters
ctX25CALLT handle
tagspointer to TAGS list
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25BADMSG
  • X25CONNECTEDIND
  • X25BADCALLT
See Also

| Introduction | Function Summary | Function Reference |



X25write

Prototypesint X25write(X25CALLT ct, ...)

int X25writetags(X25CALLT ct, TAGS *tags);

PurposeWrite a packet across your X.25 virtual circuit or HDLC link
Description Sends data over an established X.25 connection.
You may use this function to send data over SVC or PVC connections.
NOTE: the T_BITS tag expects an integer containing some combination of DBIT, MBIT & QBIT Also note that only QBIT may be used by user applications as the other bits are handled in the protocol driver.
If D Bit acknowledgement is active, then for each call to this function an X25read() should be performed which will return an X25DATAACK status code.
Tags
  • All global tags
  • T_BITS
  • T_BUFFER
  • T_BUFLEN
Parameters
ctX25CALLT handle
tagspointer to TAGS list
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25CLEAR
  • X25RESET
  • X25BADBUFFER
  • X25NOTINIT
  • X25BADCALLT

| Introduction | Function Summary | Function Reference |



X25read

Prototypesint X25read(X25CALLT ct, ...)

int X25readtags(X25CALLT ct, TAGS *tags);

PurposeReceive a packet from your X.25 virtual circuit or HDLC link
Description Receive characters from an X.25 connection. You may use this function to receive data from VC or PVC connections.
This function returns the number of bytes read.
It is USUALLY a good idea to check the X.25 error for more information when a -1 is returned.
On Unix, to check for System interrupts ie. EINTR check if X25geterrorct() returns X25SYSERR and errno == EINTR.
NOTE: the T_BITS tag expects a pointer to an integer which is to hold a combination of DBIT, and QBIT. The M Bit should never be set. When receiving a packet with the D Bit set, X25read will send an acknowledgement. The packet level will assemble M-bit-connected packet sequences together before presenting them to the application. This assembly stops when one of the following is true:
  • the M bit is not set on a packet
  • it has collected 4096 bytes worth of data
  • the D bit is set
  • the packet is not full
When receiving a packet with the D Bit set, X25read will send an acknowledgement. The T_BLOCKING and T_TIMEOUT tags available under UNIX are not available under NT. To avoid waiting for data under NT, see the Frame Reception Overview discussion.
Tags
  • All global tags
  • T_BITS
  • T_BUFFER
  • T_BUFLEN
Parameters
ctX25CALLT handle
tagspointer to TAGS list
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25CLEAR
  • X25RESET
  • X25BADBUFFER
  • X25NOTINIT
  • X25BADCALLT

| Introduction | Function Summary | Function Reference |



X25reset

Prototypesint X25reset(X25CALLT ct, ...)

int X25resettags(X25CALLT ct, TAGS *tags)

PurposeSend a RESET packet
Description Send a RESET with given cause and diagnostic values specified by the T_CAUSE and T_DIAG tags respectively.
Tags
  • All global tags
  • T_CAUSE
  • T_DIAG
Parameters
ctX25CALLT handle
tagspointer to TAGS list
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25BADCALLT
See Also

| Introduction | Function Summary | Function Reference |



X25resetconf

Prototypesint X25resetconf(X25CALLT ct)

PurposeSend a RESET CONFIRM packet
Description Send a RESET Confirm.
A reset confirm should be sent on reception of an X25RESET event when returned as an error or from X25look().
Parameters
ctX25CALLT handle
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25BADCALLT
See Also

| Introduction | Function Summary | Function Reference |



X25interrupt

Prototypesint X25interrupt(X25CALLT ct, ...)

int X25interrupttags(X25CALLT ct, TAGS *tags)

PurposeSend an INTERRUPT packet
Description Send an INTERRUPT with given buffer specified by T_BUFFER and T_BUFLEN.
Tags
  • All global tags
  • T_BUFFER
  • T_BUFLEN
Parameters
ctX25CALLT handle
tagspointer to TAGS list
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25BADCALLT
  • X25BADBUFFER
  • X25NOTINIT
  • X25USERDATA
See Also

| Introduction | Function Summary | Function Reference |



X25interruptconf

Prototypesint X25interruptconf(X25CALLT ct)

PurposeSend an INTERRUPT CONFIRM packet
Description Send an INTERRUPT CONFIRM packet.
Parameters
ctX25CALLT handle
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25BADCALLT
  • X25NOTINIT
See Also

| Introduction | Function Summary | Function Reference |



X25listen

Prototypesint X25listen(X25CALLT ct, ...);

int X25listentags(X25CALLT ct, TAGS *tags)

PurposeStart listening on the specific X25CALLT
Description This function will initiate a listen request for the specified protocol identifier which is the first byte of Call User Data. This is usually Hex 01 for CCITT X.29 calls. This function is usually invoked using either the T_LISTENTYPE tag or T_LISTENPIDS. When using the default listener (T_LISTENTYPE, X25_LISTEN_DEF) it does not make sense to also supply the T_LISTENPIDS tag. Valid values for the T_LISTENTYPE tag are:
X25_LISTEN_DEF
default listener. Note that only one default listener is allowed per machine.
X25_LISTEN_NULL
Null listener (Accept calls without any call user data)
X25_LISTEN_ACC
Accounting information
Use X25stoplisten() to stop listening for incoming calls.
Tags
  • All global tags
  • T_LISTENTYPE
  • T_NUMLISTEN
  • T_LISTENPIDS
Parameters
ctX25CALLT handle
tagspointer to TAGS list
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25BADPID
  • X25BADCALLT
See Also

| Introduction | Function Summary | Function Reference |



X25stoplisten

Prototypesint X25stoplisten(X25CALLT ct);

PurposeStop listening for incoming calls on the specified X25CALLT
Description This function will stop a listen request previously enabled. with a call to X25listen().
Parameters
ctX25CALLT handle
Returns
0on success
-1on failure
Errors
  • X25SYSERR
  • X25BADCALLT
See Also

| Introduction | Function Summary | Function Reference |



X25look

Prototypesint X25look(X25CALLT ct);

PurposeCheck for pending events on your VC or listener.
Description This function should be used to see if there are any events ready to be read. It returns one of the following event codes:
X25CLEAR
The call got cleared
X25SYSERR
System Error Message
X25BADMSG
Unexpected Message from Driver
X25BADERRMSG
Unknown Error Message
X25OUTSTATE
Message Received Out of State
X25RESET
Received Reset
X25INTRCONF
Received Interrupt Confirm
X25INTERRUPT
Received Interrupt
X25DATAIND
Received Data
X25DATAACKIND
Received Data Ack
X25RESETCOMP
Received Reset Complete
X25CALLIND
Received Call Indication
X25CONNECTEDIND
Received Call Connected Indication
Parameters
ctX25CALLT handle
Returns
X.25 erroron success
0no events pending
-1on failure
See Also

| Introduction | Function Summary | Function Reference |



X25findtag

Prototypesint X25findtag(TAGS *tags, unsigned long item);

PurposeFind tag index in tag array
Description Finds the tag item in the tags array pointed to by tags and returns the index of the tag item in the array.
Parameters
tagspointer to TAGS list
itemitem to find in tags
Returns
indexon success
-1if not found

| Introduction | Function Summary | Function Reference |



X25setopts

Prototypesvoid X25setopts(int dummy, ...);

void X25setoptstags(TAGS *tags);

void X25setoptsct(X25CALLT ct, ...);

void X25setoptsct(X25CALLT ct, TAGS *tags);

PurposeSet X.25 library parameters
Description Sets X.25 library parameters.
Tags
  • These global tags
  • T_OUTERR
  • T_TIMEOUT
  • T_VERBOSE
Parameters
dummyAny value will do
ctX25CALLT handle
tagspointer to TAGS list

| Introduction | Function Summary | Function Reference |



X25getopts

Prototypesvoid X25getopts(int dummy, ...);

void X25getoptstags(TAGS *tags);

void X25getoptsct(X25CALLT ct, ...);

void X25getoptsct(X25CALLT ct, TAGS *tags);

PurposeGet X.25 library parameters
Description Gets X.25 library parameters. The provided tag arguments must be of the following types:
T_OUTERR
FILE **
T_TIMEOUT
int *
T_VERBOSE
int *
Tags
  • These global tags
  • T_OUTERR
  • T_TIMEOUT
  • T_VERBOSE
Parameters
dummyAny value will do
ctX25CALLT handle
tagspointer to TAGS list

| Introduction | Function Summary | Function Reference |



X25linkup

Prototypesvoid X25linkup(X25CALLT ct);

PurposeObtain link up status
Description Return the status of an X.25 link being run by the streams stack
Parameters
ctX25CALLT handle
Returns
1if link is up
0if link is down
-1an error occured

| Introduction | Function Summary | Function Reference |



X25getcallinfo

Prototypesvoid X25getcallinfo(X25CALLT ct, unsigned short indx, cps *callinfo);

PurposeObtain X.25 Incoming call information
Description Obtain X.25 call information about an incoming call which has not yet been accepted. Ie. a call indicated to have arrived on a listener channel.
Parameters
ctX25CALLT handle
indxCall Index
callinfocps *
Returns
0on success
-1on failure
See Also

| Introduction | Function Summary | Function Reference |



X25sense

Prototypesvoid X25sense(int netid, int *dcd, int *dsr, int *cts);

void X25sensect(X25CALLT ct, int *dcd, int *dsr, int *cts);

PurposeObtain status of DCD, DSR and CTS for chosen link
Description Returns the status of the DCD, DSR and CTS lines for the specified netid or X25CALLT.
When this function returns 0 the locations to which the dcd, dsr, cts pointers point to will be filled in as 1 if the line is high and 0 if the line is low.
When the X25sense() function is called internally a new X25CALLT is created and destroyed during this function call.
Parameters
netidNetwork ID of link
ctX25CALLT handle
dcdpointer to integer to hold DCD status
dsrpointer to integer to hold DSR status
ctspointer to integer to hold CTS status
Returns
00 on success
-1an error occured

| Introduction | Function Summary | Function Reference |



X25setdebugfile

Prototypesint X25setdebugfile(char *file);

PurposeSets the library debug output file
Description Sets file name of library debug output when debug type is set to X25DEBUG_FILE. The file is opened in write mode. Any previous file with that name will be truncated. This function should be called before calling X25debug(X25DEBUG_FILE). Calling this function after has no effect unless a call to X25debug(X25DEBUG_NONE) is performed first.
Parameters
fileFile name to write to
Returns
00 on success
-1an error occured

| Introduction | Function Summary | Function Reference |



X25setdebugfunc

Prototypesint X25setdebugfunc(X25DBGFUNC func);

PurposeSets the library debug output function
Description Sets the call back debug output function. You may call this function at any time unless multiple threads are using the library. In this case you should make sure that other threads are not accessing the library before calling this function. Alternatively a call to X25debug(X25DEBUG_NONE) may be made before setting a different function. This function must be called before calling X25debug(X25DEBUG_FUNCTION)
Parameters
functionX25DBGFUNC declared function
Returns
00 on success
-1an error occured

| Introduction | Function Summary | Function Reference |



X25debug

Prototypesvoid X25debug(int debugtype);

PurposeEnable or disable X.25 library debugging
Description Sets library debugging mode.
One of the following values (defined in libx25tcp.h) can be passed in:
  • X25DEBUG_NONE - turn off debugging
  • X25DEBUG_CONSOLE - Linux: output to stderr
  • X25DEBUG_MONITOR - Windows: output to system debug monitor
  • X25DEBUG_FILE - output to file specified through X25setdebugfile()
  • X25DEBUG_FUNCTION - call to function specified through X25setdebugfunc()
If X25DEBUG_FILE is enabled then a subsequent call to X25debug(X25DEBUG_NONE) will close the file.
Parameters
debugtypeOne of the above values

| Introduction | Function Summary | Function Reference |



X25setfilter

Prototypesvoid X25setfilter(int type)

PurposeSets network type filter for packetnets accesses
Description Sets a network type filter for all accesses to the packetnets file so that the functions X25getnetent(), X25getnetby...() will return only the specified network types.
Default type is NETX25E_TYPE | NETX25_TYPE selecting both Streams based links and intelligent card links.
NETALL_TYPE will retrieve all network types.
Parameters
typetype of network mask
See Also

| Introduction | Function Summary | Function Reference |



X25setnetent

Prototypesvoid X25setnetent()

PurposeInitializes the packetnets file for reading
Description Initializes the packetnets file for reading.
The first X25getnetent() will return the first network entry in the file. Subsequent calls to this function will rewind the file pointer to the beginning of the file. The function X25endnetent() should be called to terminate network file processing.
See Also

| Introduction | Function Summary | Function Reference |



X25endnetent

Prototypesvoid X25endnetent()

PurposeEnds packetnets file processing
Description Ends packetnets file processing.
See Also

| Introduction | Function Summary | Function Reference |



X25getnetent

PrototypesX25netent *X25getnetent()

PurposeReturn next X25netent entry from packetnets file
Description Return next X25netent entry from packetnets file.
Each call to this function will retrieve the next network entry in this file in the form of an X25netent structure.
This function only returns X.25 entries by default. See X25setfilter() to change.
Example

        X25netent *ne;
        X25setnetent();
        // shows all hosts defined in packetnets
        while ((ne = X25getnetent()) != NULL)
        {
    	    printf("Name: %s, Network ID: %d\n", ne->name, ne->netid);
        }
        X25endnetent();
    
Returns
X25netent *on success
NULLon failure or no more entries
See Also

| Introduction | Function Summary | Function Reference |



X25getnetbyname

PrototypesX25netent *X25getnetbyname(char *name)

PurposeFinds the network ID given the network name
Description Attempts to look up a network entry given a name.
This function only returns an X.25 entry by default. See X25setfilter() to change.
There is no need to call X25setnetent() or X25endnetent() before and after calling this function.
Parameters
addrX.25 address
Returns
X25netent *on success
NULLon failure or entry not found
See Also

| Introduction | Function Summary | Function Reference |



X25getnetbynetid

PrototypesX25netent *X25getnetbynetid(char *name)

PurposeFinds the network entry with the given network ID in packetnets file
Description Attempts to look up a network entry given a netid.
This function only returns an X.25 entry by default. See X25setfilter() to change.
There is no need to call X25setnetent() or X25endnetent() before and after calling this function.
Parameters
netidNetwork ID to find
Returns
X25netent *on success
NULLon failure or entry not found
See Also

| Introduction | Function Summary | Function Reference |



X25getnetbyboard

PrototypesX25netent *X25getnetbyboard(int board, int link)

PurposeFinds the host with the given board and link in packetnets file
Description Attempts to look up a network entry given board and link number.
NOTE: only old style intelligent boards have a board and link number and as such use of this function should be considered deprecated.
There is no need to call X25setnetent() or X25endnetent() before and after calling this function.
Parameters
boardBoard #
linkLink #
Returns
X25netent *on success
NULLon failure or entry not found
See Also

| Introduction | Function Summary | Function Reference |



X25remotenetidtolocalnetid

Prototypesint X25remotenetidtolocalnetid(char *host, int remotenetid)

PurposeMap remote netid to local netid
Description Attempts to map the remote netid # on a specified host to the local network ID as specified in packetnets.
Parameters
hostTCPSERVER host in packetnets
remotenetidTCPNETID in packetnets
Returns
netidon success
-1on failure
See Also

| Introduction | Function Summary | Function Reference |



X25sethostent

Prototypesvoid X25sethostent()

PurposeInitializes the x25hosts file for reading
Description Initializes the x25hosts file for reading. The first X25gethostent() will return the first host entry in the file. Subsequent calls to this function will rewind the file pointer to the beginning of the file. The function X25endhostent() should be called to terminate x25hosts file processing.
See Also

| Introduction | Function Summary | Function Reference |



X25endhostent

Prototypesvoid X25endhostent()

PurposeEnds x25hosts file processing
Description Ends x25hosts file processing, closing the file.
See Also

| Introduction | Function Summary | Function Reference |



X25gethostent

PrototypesX25hostent *X25gethostent()

PurposeReturn next X25hostent entry from x25hosts file
Description Returns next X25hostent entry from x25hosts file.
Example

        X25hostent *he;
        X25sethostent();
        // shows all hosts defined in x25hosts
        while ((he = X25gethostent()) != NULL)
        {
    	    printf("Host name: %s on Network ID: %d\n", he->host, he->netid);
        }
        X25endhostent();
    
Returns
X25hostent *on success
NULLon failure or no more entries
See Also

| Introduction | Function Summary | Function Reference |



X25gethostbyaddr

PrototypesX25hostent *X25gethostbyaddr(char *name)

PurposeFinds the host with the given X.25 address in x25hosts file
Description Finds the host with the given X.25 address in the x25hosts file.
There is no need to call X25sethostent() or X25endhostent() before and after calling this function.
Parameters
addrX.25 address
Returns
X25hostent *on success
NULLon failure or entry not found
See Also

| Introduction | Function Summary | Function Reference |



X25gethostbyname

PrototypesX25hostent *X25gethostbyname(char *name)

PurposeFinds the named host in x25hosts file
Description Finds the named host in x25hosts file.
There is no need to call X25sethostent() or X25endhostent() before and after calling this function.
Parameters
nameHost name
Returns
X25hostent *on success
NULLon failure or entry not found
See Also

| Introduction | Function Summary | Function Reference |



X25getinfo

Prototypesint X25getinfo(X25CALLT ct, ...)

int X25getinfo(X25CALLT ct, TAGS *tags)

PurposeObtain information about an established call
Description Obtains information from an established call for both PVCs and SVCs. NOTE: Tags expect pointers to valid areas of memory as arguments
Example

        int size;
        X25CALLT ct;
        rc = X25getinfo(ct, T_OUTPKTSIZE, &size, TAG_END);
    
Tags
  • T_INPKTSIZE
  • T_OUTPKTSIZE
  • T_INWINDOW
  • T_OUTWINDOW
  • T_PRIORITY
  • T_REVERSE
  • T_CUD
  • T_CUDLEN
  • T_DNA
  • T_DNALEN
  • T_NUI
  • T_CPSP
  • T_PVCP
  • T_NUILEN
  • T_INTHRUCLASS
  • T_OUTTHRUCLASS
  • T_DBITSUPPORT
  • T_PKTSIZE
  • T_WINDOW
  • T_THRUCLASS
Parameters
ctX25CALLT handle
tagspointer to TAGS list
Returns
0on success
-1on failure
Errors
  • X25BADCALLT

| Introduction | Function Summary | Function Reference |



X25initcpstags

Prototypesint X25initcpstags(cps *cpsp, ...)

int X25initcpstags(cps *cpsp, TAGS *tags)

PurposeInitialize a Call Progress Structure
Description Initializes cps with the information contained in tags.
Note:
To specify the DNA you need not provide the T_DNALEN tag. If this T_DNALEN is not provided it will assume to take the length of the string passed to T_DNA. The T_CUD and T_NUI tags, however, require the presence of T_CUDLEN and T_NUILEN respectively.
Example

          cps C;
          X25initcps(&C);
          rc = X25initcpstags(&C, T_WINDOW, 7, T_OUTPKTSIZE, 128, TAG_END);
    
Tags
  • T_INPKTSIZE
  • T_OUTPKTSIZE
  • T_INWINDOW
  • T_OUTWINDOW
  • T_PRIORITY
  • T_REVERSE
  • T_CUD
  • T_CUDLEN
  • T_DNA
  • T_DNALEN
  • T_NUI
  • T_NUILEN
  • T_INTHRUCLASS
  • T_OUTTHRUCLASS
  • T_DBITSUPPORT
  • T_PKTSIZE
  • T_WINDOW
  • T_THRUCLASS
Parameters
cpsppointer to cps
tagspointer to TAGS list
Returns
0on success
-X.25 Erroron failure
Errors
  • X25BADCUD
  • X25BADNUI
  • X25BADDNA
See Also

| Introduction | Function Summary | Function Reference |



X25initcps

Prototypesint X25initcps(cps *cpsp)

PurposeClears a Call Progress Structure
Description Clear cps struct, thereby allowing the drivers to use their default values.
Parameters
cpsppointer to cps
See Also

| Introduction | Function Summary | Function Reference |



X25initpvctags

Prototypesint X25initpvctags(_pvcdesc *pvcp, ...)

int X25initpvctags(_pvcdesc *pvcp, TAGS *tags)

PurposeInitialize a PVC Descriptor Structure
Description Initializes pvc structure with the information contained in tags.
Example

          _pvcdesc P;
          rc = X25initpvctags(&P, T_WINDOW, 7, T_OUTPKTSIZE, 128, TAG_END);
    
Tags
  • T_INPKTSIZE
  • T_OUTPKTSIZE
  • T_PKTSIZE
  • T_INWINDOW
  • T_OUTWINDOW
  • T_WINDOW
  • T_LCI
Parameters
pvcppointer to _pvcdesc structure
tagspointer to TAGS list
Returns
0on success
See Also

| Introduction | Function Summary | Function Reference |



X25initpvc

Prototypesint X25initpvc(_pvcdesc *pvcp)

PurposeClears a PVC description Structure
Description Initialize _pvcdesc structure to default values of all zeroes, which implies that the Packet Level or SPI drivers will use the configured defaults. However, the default LCI number is set to 1.
Parameters
pvcppointer to _pvcdesc
See Also

| Introduction | Function Summary | Function Reference |



X25lookinit

PrototypesX25_lookent *X25lookinit(int maxlcis)

PurposeInitialize the file descriptor selection mechanism
Description Initializes the selection mechanism for file descriptors.
MAXLOOKFDS is 512 for non SyncServer and 256 for SyncServer client.
Currently the limit for the number of file descriptors to listen on is imposed by the operating system to be MAXLOOKFDS. If maxlcis is specfied to be more than MAXLOOKFDS the call will succeed, but still only MAXLOOKFDS file descriptors are allowed. The pointer returned by this function must be used in all the other "look" functions expecting a X25_lookent.
Parameters
maxlcismaximum number of lcis
Returns
X25_lookent *on success
NULLon failure
See Also

| Introduction | Function Summary | Function Reference |



X25lookclose

Prototypesvoid X25lookclose(X25_lookent *xlook)

PurposeCloses the look list handle
Description Closes the selection mechanism for xlook.
Parameters
xlookPointer to X25_lookent structure
See Also

| Introduction | Function Summary | Function Reference |



X25lookadd

Prototypesint X25lookadd(X25_lookent *xlook, X25CALLT ct)

PurposeAdd file descriptor(s) to the look list
Description Add the file descriptor(s) associated with ct to the selection list contained in look if possible.
Parameters
xlookPointer to X25_lookent structure
ctX25CALLT handle
Returns
0on success
-1on failure
See Also

| Introduction | Function Summary | Function Reference |



X25lookdel

Prototypesint X25lookdel(X25_lookent *xlook, X25CALLT ct)

PurposeRemoves the file descriptor(s) from the look list
Description Removes the file descriptor(s) associated with ct from the selection list contained in xlook.
Parameters
xlookPointer to X25_lookent structure
ctX25CALLT handle
Returns
0on success
-1on failure
See Also

| Introduction | Function Summary | Function Reference |



X25looksel

PrototypesX25CALLT X25looksel(X25_lookent *xlook, int tmout)

PurposeChecks for availability of datagrams on look list
Description Checks for availability of datagrams for the LCIs in the selection list specified through X25lookadds.
Parameters
xlookPointer to X25_lookent structure
tmoutmilliseconds to wait (-1 to block indefinitely, 0 for non blocking)
Returns
ctX25CALLT handle where a datagram can be read
NULLnothing to be read
See Also

| Introduction | Function Summary | Function Reference |



X25lookatone

Prototypesint X25lookatone(X25CALLT ct, int tmout)

PurposeLook at one X25CALLT and wait for activity
Description Checks for availability of datagrams for the LCI associated with ct.
Parameters
ctX25CALLT handle
tmoutmilliseconds to wait (-1 to block indefinitely, 0 for non blocking)
Returns
1something to read
0nothing to read
-1on failure
See Also

| Introduction | Function Summary | Function Reference |



X25error

Prototypesvoid X25error(char *string);

void X25errorct(X25CALLT ct, char *string);

PurposePrints the X.25 error message
Description Prints the error message associated with X.25 library error codes as in unix's perror(S). If a system error was encountered it will also be printed. The resulting output will be of the form:
    	string: error message
        
In the case of a Clear or Reset, the cause and diagnostic codes are also printed. This function will reset the library error codes.
Parameters
ctX25CALLT handle
stringstring to be printed
See Also

| Introduction | Function Summary | Function Reference |



X25seterror

Prototypesvoid X25seterror(int xerr);

void X25seterrorct(X25CALLT ct, int xerr);

PurposeSets the X.25 error
Description Sets the current X.25 error.
Parameters
ctX25CALLT handle
xerrError number
See Also

| Introduction | Function Summary | Function Reference |



X25geterror

Prototypesint X25geterror();

int X25geterrorct(X25CALLT ct);

PurposeGets the X.25 error
Description Gets the current X.25 error.
Parameters
ctX25CALLT handle
See Also

| Introduction | Function Summary | Function Reference |



X25getsyserror

Prototypesint X25getsyserror();

int X25getsyserrorct(X25CALLT ct);

PurposeGets the X.25 system error
Description Gets the current X.25 system error when the X.25 error is X25SYSERR.
Parameters
ctX25CALLT handle
See Also

| Introduction | Function Summary | Function Reference |



X25getdiags

Prototypesint X25getdiags(X25diags *diag, int szdiags);

int X25getdiagsct(X25CALLT ct, X25diags *diag, int szdiags);

PurposeGets the X.25 diagnostic and cause codes
Description Gets the current X.25 cause and diagnostic data into a X25diag structure defined in the library header file.
Example

        X25diags diag;
        X25getdiagsct(ct, &diag, sizeof(diag));
    
Parameters
ctX25CALLT handle
diagpointer to X25diags structure
szdiagssizeof X25diags structure
See Also

| Introduction | Function Summary | Function Reference |



X25errormsg

Prototypesint X25errormsg(int xerrno, char *buf, int buflen);

PurposeObtain error message based on X.25 error code
Description Copies the error message associated with X.25 library error code into a buffer.
In the case of a Clear or Reset, the cause and diagnostic codes can be interpreted by calling X25causemsg() and X25diagmsg() respectively.
If buflen is smaller than the size required in buf, then buf remains unmodified and the return value indicates the number of bytes needed.
If buf is NULL then this function will return the size required for the string (minus the terminating 0)
Parameters
xerrnoX.25 error number
bufpointer to buffer to write error to
buflenmax size of buffer to copy to
Returns
#bytes(# of bytes copied to buffer) - 1
See Also

| Introduction | Function Summary | Function Reference |



X25causemsg

Prototypesint X25causemsg(int cause, int xcause, char *buf, int buflen);

PurposeObtain error message based on cause code
Description Copies the error message associated with X.25 Cause and XIP cause code into a buffer.
If buflen is smaller than the size required in buf, then buf remains unmodified and the return value indicates the number of bytes needed.
If buf is NULL then this function will return the size required for the string (minus the terminating 0)
Parameters
causeCause Code
xcauseXIP Cause Code
bufpointer to buffer to write error to
buflenmax size of buffer to copy to
Returns
#bytes(# of bytes copied to buffer) - 1
See Also

| Introduction | Function Summary | Function Reference |



X25diagmsg

Prototypesint X25diagmsg(int diag, char *buf, int buflen);

PurposeObtain error message based on diagnostic code
Description Copies the error message associated with X.25 diagnostic code into a buffer.
If buflen is smaller than the size required in buf, then buf remains unmodified and the return value indicates the number of bytes needed.
If buf is NULL then this function will return the size required for the string (minus the terminating 0)
Parameters
diagDiagnostic Code
bufpointer to buffer to write error to
buflenmax size of buffer to copy to
Returns
#bytes(# of bytes copied to buffer) - 1
See Also

| Introduction | Function Summary | Function Reference |






Mon May 3 12:15:05 2004 by xtractxml.pl$Revision: 1.2 $

Copyright (C) 2003 The Software Group Limited. All Rights Reserved.