X25GetPortStatus(3X25) — Subroutines
Digital
NAME
X25GetPortStatus − Returns the current port status information
LIBRARY
X.25 Library (libx25.a)
SYNOPSIS
#include <netx25/x25.h>
int X25GetPortStatus(
int pd ,
unsigned char ∗ epl ,
int ∗ eplLength );
PARAMETERS
pdIdentifies the port for which the status information is to be obtained.
eplPoints to an Encoded Parameter List in which the data-transfer information for the port is returned.
eplLengthPoints to the size of the Encoded Parameter List.
DESCRIPTION
If successful, this routine returns the port state as detailed in the table below as well as the data transfer parameters when the port is in state X25S_RUNNING.
The epl parameter is an optional parameter that is used to return the data transfer parameters. The information is returned in an encoded parameter list as described in the X.25 for Digital UNIX − Programmer’s Reference Manual, and can be read using the X25Decode routine. This parameter is not returned if a NULL pointer for the epl is specified or if a zero length value is specified for eplLength.
The following item codes are returned provided the buffer pointed to by epl is large enough and the port state is X25S_RUNNING:
X25I_AUTOMODE
Indicates that the port was set to Automatic Mode. If this item is not returned the port mode is Manual Mode.
X25I_INTMSGSIZE
Defines the maximum interrupt message size.
X25I_PKTSIZEIN
X25I_PKTSIZEOUT
Defines the maximum incoming and outgoing packet sizes.
X25I_SENDBUFSIZE
X25I_RECVBUFSIZE
These values control the maximum amount of outgoing and incoming data that can be stored in the port. The values of these parameters also control the maximum data message size that can be sent or received in Automatic Mode.
The incoming and outgoing packet sizes and the interrupt size represent the values actually used at the protocol level and may differ from the requested sizes if negotiated at call setup. These values are especially significant if the port is in Manual Mode.
The following table defines the port states as returned by the X25GetPortStatus routine:
| Port State | Value | Description |
| X25S_CALLED | 3 | A call has been received and accepted |
| X25S_CALLING | 2 | A connection is in progress |
| X25S_CLEARBYDIR | 10 | The connection has been cleared by a network management command |
| X25S_CLEARED | 8 | The connection has been cleared |
| X25S_CLEARING | 7 | The user has requested clearing the call |
| X25S_NOCOMM | 9 | There is no communication with the network |
| X25S_OPEN | 1 | No connection is in progress |
| X25S_RUNNING | 4 | The port is ready for data transfer |
| X25S_SYNC | 5 | An unconfirmed reset is present |
| X25S_UNSYNC | 6 | An unconfirmed reset indication is present |
RETURN VALUES
Upon successful completion, the X25GetPortStatus routine returns the current port state. Otherwise, a (negative) error code is returned.
ERRORS
If the X25GetPortStatus routine fails, one of the following error codes is returned:
[X25RC_BADPD]
Invalid port descriptor specified.
[X25RC_EPLSIZE]
The specified EPL is too small to contain the port status items. As many of the items as will fit are returned in epl.
[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_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.
RELATED INFORMATION
Functions: X25AcceptCall(3X25), X25Decode(3X25), X25MakeCall(3X25), X25OpenPort(3X25).
X.25 for Digital UNIX − Programmer’s Reference Manual.