X25open |
| Prototypes | X25CALLT X25open(int netid, ...) X25CALLT X25opentags(int netid, TAGS *tags)
|
|---|
| Purpose | Open 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 | | netid | network ID to open (ignored depending on tag choices) |
|---|
| tags | pointer to TAGS list |
|---|
|
|---|
| Returns | | X25CALLT | on success |
|---|
| NULL | on failure |
|---|
|
|---|
| Errors | - X25SYSERR
- X25BADMUX
- X25BADNETID
- X25BADPOINTER
- X25NOMUXSLOTS
- X25MUXNOTINIT
|
|---|
| See Also | |
|---|
| Introduction
| Function Summary
| Function Reference
|
|
X25makecall |
| Prototypes | int X25makecall(X25CALLT ct, ...) int X25makecalltags(X25CALLT ct, TAGS *tags)
|
|---|
| Purpose | Make 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 | | ct | X25CALLT handle |
|---|
| tags | pointer to TAGS list |
|---|
|
|---|
| Returns | |
|---|
| Errors | - X25SYSERR
- X25BADHOST
- X25PVCINUSE
- X25BADCALLT
- X25BADMSG
- X25CLEAR
- X25CONNECTEDIND
- X25BADCUD
- X25BADDNA
- X25BADNUI
|
|---|
| Introduction
| Function Summary
| Function Reference
|
|
X25pvcattach/X25hdlcattach |
| Prototypes | int X25pvcattach(X25CALLT ct, ...) int X25hdlcattach(X25CALLT ct, ...) int X25pvcattachtags(X25CALLT ct, TAGS *tags) int X25hdlcattachtags(X25CALLT ct, TAGS *tags)
|
|---|
| Purpose | Attach 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 | | ct | X25CALLT handle |
|---|
| tags | pointer to TAGS list |
|---|
|
|---|
| Returns | |
|---|
| Errors | - X25SYSERR
- X25BADMSG
- X25BADCALLT
- X25CONNECTEDIND
- X25BADCUD
|
|---|
| See Also | |
|---|
| Introduction
| Function Summary
| Function Reference
|
|
X25pvcdetach/X25hdlcdetach |
| Prototypes | int X25pvcdetach(X25CALLT ct, ...) int X25hdlcdetach(X25CALLT ct, ...) int X25pvcdetachtags(X25CALLT ct, TAGS *tags) int X25hdlcdetachtags(X25CALLT ct, TAGS *tags)
|
|---|
| Purpose | Detach from a PVC or HDLC/LAPB link |
|---|
| Description |
Detaches from PVC or HDLC/LAPB associated with ct.
|
|---|
| Tags | |
|---|
| Parameters | | ct | X25CALLT handle |
|---|
| tags | pointer to TAGS list |
|---|
|
|---|
| Returns | |
|---|
| Errors | - X25SYSERR
- X25BADMSG
- X25CONNECTEDIND
- X25BADCALLT
|
|---|
| See Also | |
|---|
| Introduction
| Function Summary
| Function Reference
|
|
X25write |
| Prototypes | int X25write(X25CALLT ct, ...) int X25writetags(X25CALLT ct, TAGS *tags);
|
|---|
| Purpose | Write 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 | | ct | X25CALLT handle |
|---|
| tags | pointer to TAGS list |
|---|
|
|---|
| Returns | |
|---|
| Errors | - X25SYSERR
- X25CLEAR
- X25RESET
- X25BADBUFFER
- X25NOTINIT
- X25BADCALLT
|
|---|
| Introduction
| Function Summary
| Function Reference
|
|
X25read |
| Prototypes | int X25read(X25CALLT ct, ...) int X25readtags(X25CALLT ct, TAGS *tags);
|
|---|
| Purpose | Receive 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 | | ct | X25CALLT handle |
|---|
| tags | pointer to TAGS list |
|---|
|
|---|
| Returns | |
|---|
| Errors | - X25SYSERR
- X25CLEAR
- X25RESET
- X25BADBUFFER
- X25NOTINIT
- X25BADCALLT
|
|---|
| Introduction
| Function Summary
| Function Reference
|
|
X25listen |
| Prototypes | int X25listen(X25CALLT ct, ...); int X25listentags(X25CALLT ct, TAGS *tags)
|
|---|
| Purpose | Start 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 | | ct | X25CALLT handle |
|---|
| tags | pointer to TAGS list |
|---|
|
|---|
| Returns | |
|---|
| Errors | - X25SYSERR
- X25BADPID
- X25BADCALLT
|
|---|
| See Also | |
|---|
| Introduction
| Function Summary
| Function Reference
|
|
X25sense |
| Prototypes | void X25sense(int netid, int *dcd, int *dsr, int *cts); void X25sensect(X25CALLT ct, int *dcd, int *dsr, int *cts);
|
|---|
| Purpose | Obtain 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 | | netid | Network ID of link |
|---|
| ct | X25CALLT handle |
|---|
| dcd | pointer to integer to hold DCD status |
|---|
| dsr | pointer to integer to hold DSR status |
|---|
| cts | pointer to integer to hold CTS status |
|---|
|
|---|
| Returns | | 0 | 0 on success |
|---|
| -1 | an error occured |
|---|
|
|---|
| Introduction
| Function Summary
| Function Reference
|
|
X25getnetent |
| Prototypes | X25netent *X25getnetent()
|
|---|
| Purpose | Return 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 |
|---|
| NULL | on failure or no more entries |
|---|
|
|---|
| See Also | |
|---|
| Introduction
| Function Summary
| Function Reference
|
|
X25getinfo |
| Prototypes | int X25getinfo(X25CALLT ct, ...) int X25getinfo(X25CALLT ct, TAGS *tags)
|
|---|
| Purpose | Obtain 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 | | ct | X25CALLT handle |
|---|
| tags | pointer to TAGS list |
|---|
|
|---|
| Returns | |
|---|
| Errors | |
|---|
| Introduction
| Function Summary
| Function Reference
|
|
X25initcpstags |
| Prototypes | int X25initcpstags(cps *cpsp, ...) int X25initcpstags(cps *cpsp, TAGS *tags)
|
|---|
| Purpose | Initialize 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 | | cpsp | pointer to cps |
|---|
| tags | pointer to TAGS list |
|---|
|
|---|
| Returns | | 0 | on success |
|---|
| -X.25 Error | on failure |
|---|
|
|---|
| Errors | - X25BADCUD
- X25BADNUI
- X25BADDNA
|
|---|
| See Also | |
|---|
| Introduction
| Function Summary
| Function Reference
|
|
X25initpvctags |
| Prototypes | int X25initpvctags(_pvcdesc *pvcp, ...) int X25initpvctags(_pvcdesc *pvcp, TAGS *tags)
|
|---|
| Purpose | Initialize 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 | | pvcp | pointer to _pvcdesc structure |
|---|
| tags | pointer to TAGS list |
|---|
|
|---|
| Returns | |
|---|
| See Also | |
|---|
| Introduction
| Function Summary
| Function Reference
|
|
X25errormsg |
| Prototypes | int X25errormsg(int xerrno, char *buf, int buflen);
|
|---|
| Purpose | Obtain 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 | | xerrno | X.25 error number |
|---|
| buf | pointer to buffer to write error to |
|---|
| buflen | max size of buffer to copy to |
|---|
|
|---|
| Returns | | #bytes | (# of bytes copied to buffer) - 1 |
|---|
|
|---|
| See Also | |
|---|
| Introduction
| Function Summary
| Function Reference
|
|
X25causemsg |
| Prototypes | int X25causemsg(int cause, int xcause, char *buf, int buflen);
|
|---|
| Purpose | Obtain 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 | | cause | Cause Code |
|---|
| xcause | XIP Cause Code |
|---|
| buf | pointer to buffer to write error to |
|---|
| buflen | max size of buffer to copy to |
|---|
|
|---|
| Returns | | #bytes | (# of bytes copied to buffer) - 1 |
|---|
|
|---|
| See Also | |
|---|
| Introduction
| Function Summary
| Function Reference
|
|
X25diagmsg |
| Prototypes | int X25diagmsg(int diag, char *buf, int buflen);
|
|---|
| Purpose | Obtain 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 | | diag | Diagnostic Code |
|---|
| buf | pointer to buffer to write error to |
|---|
| buflen | max size of buffer to copy to |
|---|
|
|---|
| Returns | | #bytes | (# of bytes copied to buffer) - 1 |
|---|
|
|---|
| See Also | |
|---|
| Introduction
| Function Summary
| Function Reference
|
|