User`s guide

4: Application Interface
DC 900-1516D 77
4.3.3.1 ATTACH Command
The ATTACH command creates a session between your program and the protocol soft-
ware on the ICP.
The following values must be placed in the ICP header of the
ATTACH command:
Command field =
DLI_ICP_CMD_ATTACH
Status field = hex 4000 (this tells the ICP to swap bytes for VMS systems)
Params[0] = read node number
Some protocols may require you to fill in fields in the protocol header portion of the
ATTACH command with such things as access mode and protocol type. Consult your
protocol programmers guide for details.
Your program can read the
ATTACH response by posting a QIO read to the node num-
ber you supplied in the
ATTACH command. The two most important values to read
from the
ATTACH response are the status field of the ICP header and the session ID
field of the protocol header. The status field contains
0 if the ATTACH command was
successful and an error code if it was unsuccessful. If the
ATTACH was successful, the
session ID field contains a number associated with this session. This number must be
placed in the session ID field of all subsequent writes to this session.