X25Listen(3X25) — Subroutines
Digital
NAME
X25Listen − Listens for incoming X.25 calls
LIBRARY
X.25 Library (libx25.a)
SYNOPSIS
#include <netx25/x25.h>
int X25Listen(
int ld ,
char ∗ filter ,
int filterLength ,
unsigned char ∗ epl ,
int ∗ eplLength );
PARAMETERS
ldIdentifies the listener on which to listen for incoming X.25 calls.
filterPoints to the buffer in which a string containing the name of the filter that matched the call is returned. The filter name is truncated to a length of (filterLength - 1) and null-terminated if the filter name is too long.
filterLengthSpecifies the size of the buffer in which the filter name is to be returned.
eplPoints to an Encoded Parameter List in which the incoming call details are returned.
eplLengthPoints to the size of the buffer pointed to by epl. On return, eplLength indicates the length of the encoded parameters.
DESCRIPTION
The X25Listen routine declares a listener as being available to receive call requests. It should be called after the listener has had one or more filters associated with it using the X25BindFilter routine.
If no pending connections are present on the incoming call queue, X25Listen blocks until a connection is present, provided that is not operating in non-blocking mode.
If a filter is deleted by a network management command while the X25Listen is in progress, the routine returns X25RC_FILTERDEL or X25RC_LASTFILTER. For a description of the X.25 Item Codes refer to the X.25 for Digital UNIX − Programmer’s Reference Manual.
If NULL pointers or zero length parameters are passed in the routine call the filter name and/or call details are not returned.
If an error occurs, the listener can still be used to listen for incoming calls.
RETURN VALUES
Upon successful completion, the X25Listen routine returns a positive integer representing the port on which the incoming call arrived. Otherwise, a (negative) error code is returned.
ERRORS
If the X25Listen routine fails, one of the following error codes is returned:
[X25RC_BADLD]
Invalid listener descriptor specified.
[X25RC_CALLABORT]
An X.25 call arrived at the Digital UNIX host, but was cleared by the network or the remote DTE before the call was accepted with the X25AcceptCall routine. You may need to increase the Call Timer at the remote DTE if the transit delay through the network is greater than or comparable to the current setting of the timer.
[X25RC_EPLSIZE]
The specified EPL is too small to contain the call detail items. As many of the items as will fit are returned in epl.
[X25RC_FILTERDEL]
One or more filters associated with this listener have been deleted by network management commands. The X25Listen routine should be called again to listen for further calls.
[X25RC_INVALSTATE]
The port is not in a valid state to perform the requested operation. The most likely cause is that the port is a call port rather than a listener port.
[X25RC_LASTFILTER]
All filters associated with this listener have been deleted by network management commands. The X25Listen routine cannot be called again until another filter is associated with the listener.
[X25RC_NETMANCLR]
The call has been cleared by a network management command.
[X25RC_NOMEM]
There were insufficient system resources to perform the requested operation. No incoming call was retrieved from the call queue.
[X25RC_NOPORT]
An X25 Access Port entity could not be created because the system-wide limit had already been reached. The call received on the listener was cleared.
[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_WOULDBLOCK]
The specified listener is operating in non-blocking mode, and there is no incoming call available at this time.
RELATED INFORMATION
Functions: X25BindFilter(3X25), X25CreateListener(3X25), X25RematchCall(3X25).
X.25 for Digital UNIX − Programmer’s Reference Manual.