NAME
zx25callrej - Clear (reject) an X.25 call
SYNOPSIS
#include <zcom/zcomsys.h>
#include <zcom/zcomx25.h>
int zx25callrej (zxip, vzap, cause, diag, fbuf, flen,
ubuf, ulen, dbit, clngaddr, caldaddr)
zx25info_type *zxip;
zaddr_type *vzap;
int cause;
int diag;
char *fbuf;
int flen;
char *ubuf;
int ulen;
int dbit;
char *clngaddr
char *caldaddr;
DESCRIPTION
Routine zx25callrej is
used to initiate a CLEAR REQUEST on the logical channel of the supplied
Virtual Circuit ZLU. This routine can be used to clear an established
call, to reject an inbound call, or to terminate an outbound call
request.
The libraries libzx25.a, libzcom_c.a and libpthread.a must
be linked into the calling program by giving the "-lzx25
-lzcom_c -lpthread" options to cc(1) or ld(1).
Threads Considerations
This routine may be called from a multi-threaded application
using the POSIX (1003.1c) kernel threads API package. It has the
following characteristics when called by multi-threaded applications:
- cancellation point
Thread cancellation can occur when a thread calls
this routine.
- async-cancel unsafe
The calling thread's cancelability type
must be PTHREAD_CANCEL_DEFERRED if cancellation is enabled.
- async-signal unsafe
It cannot be called from a signal handler.
- fork unsafe
It cannot be called by a child process after fork(2) but before exec(2).
See the NOTES section that follows for more information on
using this routine in a multi-threaded application.
PARAMETERS:
- zxip
ZCOM X.25 access data structure (from zx25info call).
- vzap
ZCOM address of the Virtual Circuit terminal.
- cause
Cause code.
- diag
Diagnostic code.
- fbuf
Facilities data buffer.
- flen
Facilities data length (in bytes).
- ubuf
Call user data buffer.
- ulen
Call user data length (in bytes).
- dbit
D-bit
0 - no D-bit
non-zero
- D-bit set to 1
- clngaddr
User-supplied calling address buffer (if NULL, calling address
not supplied). See Notes below for its format.
- caldaddr
User-supplied called address buffer (if NULL, calling address
not supplied). See Notes below for its format.
RETURN VALUE
Routine zx25callrej returns
a 0 when successful. If there
was a ZCOM error, it returns a negative value.
(See /opt/acc/include/zcom/zcomsys.h for
the list of ZCOM error codes and their meanings.) If zx25callrej, itself, failed, one
of the following positive error
codes is returned:
- ZxeUNKNOWN_L2_ZLU (02)
Unable to find the X.25 link ZLU for this SVC ZLU.
- ZxeREQ_TIMEOUT (04)
The remote ZCOM system did not respond within 30
seconds.
- ZxeNOT_A_SVC (05)
The ZLU specified is a PVC ZLU. You must specify
an SVC ZLU with this routine.
- ZxeINVALID_STATE (06)
There is no call established or in progress. It
is illegal to issue a Clear Request in this state.
- ZxeLINK_IS_DOWN (11)
The X.25 link is down. Unable to clear call (e.g.
none exist).
- ZxeUNKNOWN_VC_ZLU (13)
The ZLU specified is not an X.25 Virtual Circuit
ZLU.
- ZxeINVALID_CUD_LEN (14)
The length specified for the Call User data is longer
than the maximum permissible value (usually 128 bytes).
- ZxeINVALID_FAC_LEN (15)
The length specified for the Facilities data is
longer than the maximum permissible value (usually 109 bytes).
- ZxeMUST_CALL_ZX25INFO
(17)
The zx25info() routine
has not been called. You must call zx25info before issuing
any other zx25...() calls.
- ZxeBAD_ZX25INFO_ADDR
(18)
The pointer to the zx25info_type structure does
not contain the same address that was passed to the zx25info() routine.
- ZxeX25_NOT_INITIALIZED
(98)
The ACC X.25 subsystem has not been initialized.
You must run zx25d_init before
issuing any zx25...() calls.
- ZxeX25_TBL_FULL (99)
The X.25 routines maintain an internal table for
accessing remote ZCOM nodes. This table has room to access up to
20 different ZCOM nodes (including the local node). This request
attempted to access the 21st ZCOM remote node and the internal table
used had insufficient space to save the routing data.
NOTES
The X.121 call address consists of
8 bytes, and it is used a a 15-digit BCD number plus a length digit
in the last position. For example, in hex:
DD DD DD DD DD DD DD DL
where D is a 4-bit BCD digit, whose range is from 0 to 9
L is a 4-bit length digit, whose range is from 1 to 15
The 15 address digits should be left-justified and without
leading zero. The length digit indicates the number of address digits.
For example, to specify addresses "1773648" and "123456789012",
the hex values of the address buffer should be:
17 73 64 8X XX XX XX X7 for 1773648
12
34 56 78 90 12 XX XC for 123456789012
where X is unused digit (normally should
be set to zero).
The calling program (or thread) must call zx25info before calling this routine.
In a multi-threaded application, each thread must make a separate
call to zx25info using a per-thread
ZCOM X.25 access data buffer zxip.
The per-thread data buffer can then be used to call this routine.
EXAMPLE
#include <zcom/zcomsys.h>
#include <zcom/zcomx25.h>
int ierr;
zx25info_type zxi;
zaddr_type vzaddr;
char fbuf[size]; /* user-defined size */
int flen;
char ubuf[size]; /* user-defined size */
int ulen;
int dbit;
int cause;
int diag;
char clngaddr[size]; /* user-defined size */
char caldaddr[size]; /* user-defined size */
if (ierr = zx25callrej (&zxi, &vzaddr, cause, diag, fbuf, flen,
ubuf, ulen, dbit, clngaddr, caldaddr)) {
/* error return code */
}
else {
/* good return code */
}
FILES
- /opt/acc/include/zcom/zcomsys.h
ZCOM system general include file, containing data
types, data structures, constants, error codes, masks, etc. Note
that this must be the first include file before any other ZCOM include
files.
- /opt/acc/include/zcom/zcomx25.h
ZCOM X.25 access data structures.
SEE ALSO
zx25info(3x)