[ Previous | Next | Contents | Search ]
AIXLink/X.25 1.1 for AIX: Guide and Reference

CIO_HALT (Halt Session) x25sioctl X.25 Device Handler Operation

Purpose

Ends a session with the X.25 device handler.

Description

The CIO_HALT x25sioctl operation ends a session with the X.25 device handler. A session identified by a particular session_id field can be terminated in any of the following ways:

If the CIO_HALT operation is the last for this port, appropriate termination (such as automatic disconnection, if configured) is done.

The CIO_HALT operation returns immediately to the caller before the halt completes. If the return does not indicate an error, the X.25 device handler builds a CIO_START_DONE status block on completion of the operation. For kernel-mode processes the status block is passed to the associated status function, as specified by the x25sopen entry point. For user-mode processes, the block is placed in the associated status-and-exception queue.

Parameter Block

The parameter block for the CIO_HALT operation is the x25_halt_data structure. This structure contains the following fields:

sb Indicates that the session_blk structure is defined in the /usr/include/sys/comio.h file. The status field in this structure has meaning when returned only if the return code is EIO.
session_id Identifies the ID of the session to halt.

If the CIO_HALT operation is issued to send a Clear Request packet on a session of type SESSION_SVC_OUT or SESSION_SVC_IN, the CIO_HALT operation ext parameter is used. The ext parameter points to a buffer containing the data required for the Clear Request packet. This data is in the form described in the mbuf structure.

For a kernel-mode process, the data passed in the ext parameter is an mbuf pointer. Only the calling process can free the mbuf data returned in the CIO_HALT_DONE status block. The mbuf data returned by this status block is not the same as the data passed down.

For a user-mode process, the data passed in the ext parameter is a pointer to a buffer of the same format in user space. If the pointer is null, then the Clear Request packet is sent with default cause-and-diagnostic codes (0, 0), but with no facilities or user data. When the CIO_HALT_DONE status block is received, the buffer is filled with the contents of the Clear Confirm packet.

Execution Environment

The CIO_HALT operation can be called from the process environment only.

Return Values

A return code of -1 indicates an unsuccessful operation. The kernel sets the errno global variable to one of the following values:

EFAULT Indicates that an invalid address was specified.
EINVAL Indicates invalid values in the ext parameter buffer.
EIO Indicates that an error has occurred. The status field in the status_block structure indicates one of the following exception codes:

In addition, one of the following X.25-specific codes may be returned:

X25_BAD_PKT_TYPE Indicates that the packet type passed in the ext parameter is invalid. For session types SESSION_SVC_OUT or SESSION_SVC_IN, the packet type should be either PKT_CLEAR_REQ or PKT_CLEAR_CONFIRM.
X25_NO_LINK Indicates that the link is not connected.
X25_PROTOCOL Indicates that a protocol error occurred.

Implementation Specifics

The CIO_HALT operation functions with an X.25 Interface Co-Processor/2 that has been correctly configured for use on a qualified network. Consult the adapter specifications for more information on configuring the adapter and network qualifications.

Related Information

The x25sioctl entry point, x25sopen entry point.

The CIO_START x25sioctl X.25 Device Handler Operation.

Status Blocks for the X.25 Device Handler.


[ Previous | Next | Contents | Search ]