Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ X25ReadDataQM(3X25) — DECnet WAN Support 3.0A

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

X25OpenPort(3X25)

X25ReadData(3X25)

X25SendDataQM(3X25)

X25ReadDataQM(3X25)  —  Subroutines

Digital

NAME

X25ReadDataQM − Reads data from an X.25 port in Manual Mode

LIBRARY

X.25 Library (libx25.a)

SYNOPSIS

#include <netx25/x25.h>
int X25ReadDataQM(

int pd ,
unsigned char ∗ buf ,
int bufLength ,
X25DataFlags ∗ dataFlags );

 

PARAMETERS

pdIdentifies the port from which the data is to be read. 

bufPoints to a buffer where the data read is to be stored. 

bufLengthSpecifies the size of buf. 

dataFlagsPoints to a bit map of packet flags set on incoming data packet.  The parameter is decoded by performing a logical AND with the following masks, defined in the x25.h include file:

X25P_MDATA
more-data bit is set

X25P_QDATA
qualified-data bit is set.

 

DESCRIPTION

 
The X25ReadDataQM routine attempts to read data from an X.25 port operating in Manual Mode.  The data is read in packet-sized blocks. 

If there  is no data waiting to be read, the X25ReadDataQM routine blocks waiting for incoming data.  If an out-of-band message is received while blocking, the routine returns X25RC_OOB.  If there is both normal data and out-of-band data then X25ReadDataQM returns X25RC_OOB.  This ensures out-of-band data is read before normal data. 

The dataFlags parameter is a bit map indicating which packet flags, namely the more-data and/or the qualified-data bits, were set in the incoming data packet.  They can be decoded using the masks defined in the x25.h include file. 
 

The X25ReadDataQM routine reads data from the network as messages.  If the datagram read from the network is larger than the caller supplied buffer, only the first bufLength bytes of data is passed to the caller.  Excess data in the message is discarded. 
 

RETURN VALUES

Upon successful completion, the X25ReadDataQM routine returns the number of bytes read.  A return value greater than bufLength indicates the buffer was too small and an unspecified amount of data has been lost.  Otherwise, a (negative) error code is returned. 
 

ERRORS

If the X25ReadDataQM routine fails, one of the following error codes is returned:

[X25RC_BADPD]
Invalid port descriptor specified.

[X25RC_INVALMODE]
The data mode of the port is not valid for the requested operation. The port is operating in Automatic Mode − use the X25ReadData routine. 

[X25RC_INVALSTATE]
The port is not in a valid state to perform the requested operation. Either there is no connection established on the specified port, or the port is currently unable to receive data because it is processing a reset.

[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_NETMANCLR]
The call has been cleared by a network management command.

[X25RC_NOMEM]
There were insufficient system resources to perform the requested operation.  No data was read.

[X25RC_OOB]
The read was not performed, because out-of-band data is waiting to be read.  Use the X25ReadOOB routine to read the out-of-band data. 

[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_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_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_WOULDBLOCK]
The specified port is operating in non-blocking mode, and there is no data available to be read at this time.
 

RELATED INFORMATION

Functions: X25OpenPort(3X25), X25ReadData(3X25), X25SendDataQM(3X25). 

CTF for Digital UNIX − CTF User’s Guide,
X.25 for Digital UNIX − Programmer’s Reference Manual. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026