X25MakeCall(3X25) — Subroutines
Digital
NAME
X25MakeCall − Initiates an outgoing X.25 call
LIBRARY
X.25 Library (libx25.a)
SYNOPSIS
#include <netx25/x25.h>
int X25MakeCall(
int pd ,
int manualMode ,
unsigned char ∗ epl ,
int eplLength ,
char ∗ template );
PARAMETERS
pdIdentifies the port on which to make the outgoing call.
manualMode
Specifies the data-transfer mode in which the port is to operate. A value of 1 sets the port to Manual Mode. A value of 0 sets the port to Automatic Mode.
eplPoints to an Encoded Parameter List containing the parameters that define the destination DTE and the X.25 facilities required for the call. Parameter values defined in the template are overridden by the values contained in this list.
eplLengthSpecifies the length of the Encoded Parameter List epl.
templatePoints to a null-terminated string containing the name of the template to be used for the outgoing X.25 call.
DESCRIPTION
The X25MakeCall routine initiates an outgoing connection on an X.25 port that has been previously created with the X25OpenPort routine. The X25 Access Template entity contains a collection of X.25 parameters to be used in making the X.25 call. Additional or overriding call parameters can be specified in the encoded parameter list epl. The valid facilities/parameters that can be specified are subscription and network dependent. They are further described in the X25Encode(3X25) manpage and the X.25 for Digital UNIX − Programmer’s Reference Manual.
If a zero length or NULL pointer is passed for the encoded parameter list, all parameter values are taken from the template.
The manualMode parameter controls the data transfer mode of the connection. To operate in Manual Mode, where the user controls the more data bit, qualified data bit and packetization, the manualMode parameter must be set to a non-zero value. To operate in Automatic Mode, where all packet fragmentation and re-assembly are handled by the system, the manualMode parameter must be set to zero.
If a NULL string is passed for template, then the "Default" template is used to make the outgoing call.
The X25MakeCall routine blocks until the call is accepted or rejected or an error is encountered. As a result, the port should be in the X25S_RUNNING state after returning from X25MakeCall. If the call was successful, the X25ReadAccept routine can be used to obtain the negotiated call facilities.
RETURN VALUES
Upon successful completion, the X25MakeCall routine returns a value of 0. Otherwise, a (negative) error code is returned.
ERRORS
If the X25MakeCall routine fails, one of the following error codes is returned:
[X25RC_BADPARAM]
One of the items in the specified EPL does not have a recognized X.25 item code. The permissible item codes are defined in the x25.h include file.
[X25RC_BADPD]
Invalid port descriptor specified.
[X25RC_BADSECDTECLASS]
The Security DTE Class specified in the X25 Access DTE Class entity used to make the call does not exist.
[X25RC_CALLCOLLISION]
The outgoing call selected the same logical channel number as an incoming call arriving at the same time. Attempt to make the call again.
[X25RC_CALLPARAM]
One of the call parameters specified in the EPL or the template is not valid. Either the EPL contains an item that is not a valid call parameter, or one of the X.25 facilities requested was rejected by the network.
[X25RC_DTECLASS]
The specified DTE class does not exist.
[X25RC_INPROGRESS]
The specified port is operating in non-blocking mode, and the connection is still being established.
[X25RC_INVALCALLDATA]
The X.25 call user data specified for the call is longer than is permitted for this network or for this type of call. Note that the maximum permissible length of the call data varies according to whether the call is a fast select call.
[X25RC_INVALDEST]
The specified NSAP address is not known. The NSAP address requested is not in the X25 Access Reachable Address database.
[X25RC_INVALFAC]
The X.25 facilities specified in the EPL and/or the template are too long for the network to which the DTE is connected.
[X25RC_INVALNSAP]
The format of the specified NSAP is invalid.
[X25RC_INVALSTATE]
The port is not in a valid state to perform the requested operation. There is a connection already established on the specified port.
[X25RC_LINKDOWN]
The X.25 call was aborted due to a LAPB or LLC2 link failure. Before attempting another call, ensure that the Link Service Provider of the DTE used to make the call is enabled and running.
[X25RC_NETABORT]
The X.25 call was aborted due to a network-initiated restart of the DTE on which the call was established. Wait for the X25 Protocol DTE entity to return to the running state before making the call again.
[X25RC_NOLCN]
No outgoing logical channels were available on any DTEs in the DTE class used to make the call.
[X25RC_NOMEM]
There were insufficient system resources to perform the requested operation. The call was not established.
[X25RC_PORTABORT]
The X.25 call was aborted due to a failure in a module below X25 Access. Before attempting another call, ensure that the X25 Protocol DTE entity and its Link Service Provider are enabled and in the running state.
[X25RC_PORTCLR]
The operation could not be performed because the X.25 call has been cleared. Clear information can be obtained using the X25ReadClear routine.
[X25RC_PROTOCOL]
The X.25 call was aborted due to an invalid packet received from the network. To further isolate this problem, use CTF to determine the packet in error.
[X25RC_SECURITY]
The call has been blocked by X.25 security. For details on X.25 security, refer to X.25 for Digital UNIX − Security Guide.
[X25RC_SERVICEDOWN]
The X.25 service is not available because an entity is not in the correct state. Either the X25 Access entity is disabled, or the X25 Protocol entity does not exist.
[X25RC_SYSERR]
An operating system error occurred. The external variable errno is set to indicate the error.
[X25RC_TEMPLATE]
The specified template does not exist.
[X25RC_TIMEOUT]
The X.25 call was aborted due to the remote DTE not responding to an interrupt or a reset within the required time.
[X25RC_UNKNOWNGROUP]
The specified Closed User Group does not exist.
RELATED INFORMATION
Functions: X25Encode(3X25), X25GetPortStatus(3X25), X25OpenPort(3X25).
CTF for Digital UNIX − CTF User’s Guide,
X.25 for Digital UNIX − Programmer’s Reference Manual,
X.25 for Digital UNIX − Security Guide.