VMS DECwindows Transport Manual
3.2.1 XTPB Data Structure
When the transport layer is initialized, the transport-common code
creates a global transport parameter block (XTPB) data structure that
contains default parameters. The default parameters are inherited by
every network-specific transport that is subsequently attached. The
attached transport can override the defaults.
Three levels of XTPB data structures are eventually built:
- A global XTPB data structure
- A transport-specific XTPB data structure
- A connection-specific XTPB data structure
The contents of the global XTPB data structure are copied to the
transport-specific XTPB data structure when a transport is attached,
and from the transport-specific XTPB data structure to a
connection-specific XTPB data structure when a connection is
established. The server and Xlib can override this inheritance of XTPB
parameter values. After an XTPB has been created, changes to its
parent's values do not change its values.
All XTPB data structures are allocated from memory pages that have
user-mode read access/executive-mode write access (UREW) to protect
them from modification by any less privileged access mode.
The XTPB data structure is shown in Figure 3-9.
Figure 3-9 XTPB Data Structure
Table 3-7 shows the contents of the IXTCC data structure.
Table 3-7 IXTCC Data Structure
Field |
Use |
IXTCC$A_FLINK
|
Forward, absolute pointer to the next IXTCC in the XTDB's queue of
IXTCCs.
|
IXTCC$A_BLINK
|
Backward, absolute pointer to the previous IXTCC in the XTDB's queue of
IXTCCs.
|
IXTCC$W_SIZE
|
Length of IXTCC in bytes.
|
IXTCC$B_TYPE
|
Constant 255.
|
IXTCC$B_SUBTYPE
|
Constant DECW$C_DYN_IXTCC (8).
|
IXTCC$A_TCQ
|
Address of XTCQ used by this connection.
|
IXTCC$A_TPB
|
Address of XTPB private to this connection.
|
IXTCC$A_TDB
|
Address of XTDB that owns this connection.
|
IXTCC$A_TCC
|
Address of XTCC associated with this connection.
|
IXTCC$A_USER_REGION
|
Range of addresses allocated by DECW$XPORT_ALLOC_INIT_QUEUES.
|
IXTCC$A_BUFFER_REGION
|
Range of addresses for communication buffers.
|
IXTCC$L_ICI
|
Internal connection identifier. IXTCC$L_ICI is a protected copy of
XTCC$L_ICI.
|
IXTCC$A_IW_QUEUE
|
Address of input work queue in the XTCQ. For clients this is the event
work queue; for servers this is the request work queue.
|
IXTCC$A_IFS_QUEUE
|
Address of the small XTCB input free queue in the XTCQ.
|
IXTCC$A_IFL_QUEUE
|
Address of the large XTCB input free queue in the XTCQ.
|
IXTCC$A_OW_QUEUE
|
Address of the output work queue in the XTCQ. For clients this is the
request work queue; for servers this is the event work queue.
|
IXTCC$A_OFS_QUEUE
|
Address of the small XTCB output free queue in the XTCQ.
|
IXTCC$A_OFL_QUEUE
|
Address of the large XTCB output free queue in the XTCQ.
|
IXTCC$A_TCQ_FLAGS
|
Address of the flags longword in the XTCQ.
|
IXTCC$L_IWQ_FLAG
|
Bit position of the input work queue notification request flag in the
flags longword in the XTCQ.
|
IXTCC$L_IFSQ_FLAG
|
Bit position of the small XTCB input free queue notification request
flag.
|
IXTCC$L_IFLQ_FLAG
|
Bit position of the large XTCB input free queue notification request
flag.
|
IXTCC$L_OWQ_FLAG
|
Bit position of the output work queue notification request flag.
|
IXTCC$L_OFSQ_FLAG
|
Bit position of the small XTCB output free queue interest flag.
|
IXTCC$L_OFLQ_FLAG
|
Bit position of the large XTCB output free queue interest flag.
|
Pad
|
Reserved for use by Digital.
|
IXTCC$Q_XPORT_RESERVED
|
Quadword reserved for use by your specific transport.
|
IXTCC$L_DEC_RESERVED
|
Reserved for use by Digital.
|
IXTCC$A_XPORT_TABLE
|
Address of XTFT structure for this specific transport.
|
3.2.3 XTCC Data Structure
As described in Section 3.2.2, the transport communications context
(XTCC) data structure describes an established connection. The server
and Xlib use the XTCC to identify a connection when calling the
DECwindows transport layer. The XTCC structure exists during the
lifetime of a connection. This is a user-writable structure.
The XTCC data structure is shown in Figure 3-11.
Figure 3-11 XTCC Data Structure
Table 3-9 shows the contents of the XTCB data structure.
Table 3-9 XTCB Data Structure
Field |
Use |
XTCB$L_RFLINK
|
Forward, relative pointer to next XTCB in the queue.
|
XTCB$L_RBLINK
|
Backward, relative pointer to previous XTCB in the queue.
|
XTCB$W_SIZE
|
Length of XTCB in bytes.
|
XTCB$B_TYPE
|
Constant 255.
|
XTCB$B_SUBTYPE
|
Constant DECW$C_DYN_XTCB_SRP (3) or DECW$C_DYN_XTCB_LRP (4).
DECW$C_DYN_XTCB_SRP represents a small XTCB; DECW$C_DYN_XTCB_LRP
represents a large XTCB.
|
XTCB$W_IOSB
|
IOSB for use by specific transport when performing the requested I/O
operation with this XTCB.
|
XTCB$A_POINTER
|
Pointer to next unused byte in data area.
|
XTCB$L_LENGTH
|
Length, in bytes, of valid data in data area.
|
XTCB$T_DATA
|
Start of variable-length data area.
|
3.2.5 XTCQ Data Structure
The transport communication queue (XTCQ) data structure contains the
six per-connection communication queues and their state information.
The six per-connection communication queues, which are described in
more detail in Section 3.1, are as follows:
- Event Work Queue. Identified by the XTCQ$L_EW_RFLINK and
XTCQ$L_EW_RBLINK fields in the XTCQ.
- Event Free Queue (small and large). Identified by the
XTCQ$L_EFS_RFLINK, XTCQ$L_EFS_RBLINK, XTCQ$L_EFL_RFLINK, and
XTCQ$L_EFL_RBLINK fields in the XTCQ.
- Request Work Queue. Identified by the XTCQ$L_RW_RFLINK and
XTCQ$L_RW_RBLINK fields in the XTCQ.
- Request Free Queue (small and large). Identified by the
XTCQ$L_RFS_RFLINK, XTCQ$L_RFS_RBLINK, XTCQ$L_RFL_RFLINK, and
XTCQ$L_RFL_RBLINK fields in the XTCQ.
The XTCQ data structure exists during the lifetime of a connection and
is user-modifiable.
The XTCQ data structure is shown in Figure 3-13.
Figure 3-13 XTCQ Data Structure
Table 3-11 shows the contents of the XTDB data structure.
Table 3-11 XTDB Data Structure
Field |
Use |
XTDB$A_FLINK
|
Forward, absolute pointer to next XTDB in queue.
|
XTDB$A_BLINK
|
Backward, absolute pointer to previous XTDB in queue.
|
XTDB$W_SIZE
|
Length of XTDB in bytes.
|
XTDB$B_TYPE
|
Constant 255.
|
XTDB$B_SUBTYPE
|
Constant DECW$C_DYN_XTDB (5).
|
XTDB$L_FLAGS
|
See the following list.
|
The following fields are defined within XTDB$L_FLAGS: |
XTPB$V_MODE
|
Type of transport connection. Possible values are:
- DECW$K_XPORT_REMOTE_SERVER (0)
- DECW$K_XPORT_REMOTE_CLIENT (1)
- DECW$K_XPORT_LOCAL_SERVER (2)
- DECW$K_XPORT_LOCAL_CLIENT (3)
|
XTDB$V_ACTIVE
|
Specific transport image has been activated and is running.
|
XTDB$V_DYING
|
Specific transport is aborting and no further operations should be
allowed. Connections using this transport will be disconnected.
|
|
|
|
XTDB$A_TPB
|
Address of the transport-specific XTPB.
|
XTDB$L_REF_COUNT
|
Number of connections using this transport. Should be equivalent to the
number of IXTCCs enqueued on the IXTCC queue header.
|
XTDB$Q_RESERVED
|
Quadword reserved for use by your specific transport.
|
XTDB$L_DEC_RESERVED
|
Reserved for use by Digital.
|
XTDB$A_ITCC_FLINK
|
Absolute queue header for IXTCCs of connections using this transport.
|
XTDB$A_ITCC_BLINK
|
Absolute queue header for IXTCCs of connections using this transport.
|
XTDB$A_CONNECT_ABORT
|
Address of either the server or Xlib connection abort notification AST
routine. Called with one argument: the XTCC by reference.
|
XTDB$A_CONNECT_REQUEST
|
Address of the server's connection request notification AST routine.
Called with one argument: the XTCC by reference.
|
XTDB$L_FAMILY_NAME_LEN
|
Length of the transport name string.
|
XTDB$T_FAMILY_NAME
|
Contains the transport family name string (for example,
"DECNET" or "TCPIP"). The maximum size of the
family name is 16 bytes, as determined by the constant
XTDB$S_FAMILY_NAME. XTDB$S_FAMILY_NAME is defined in
DECW$EXAMPLES:XPORTEXAMPLEDEF.R32.
|
XTDB$A_XPORT_TABLE
|
Address of the XTFT structure for the specific transport. Returned as a
value of the DECW$TRANSPORT_INIT routine, which is provided as a global
name in every transport-specific image.
|
3.2.7 XTFT Data Structure
Each specific transport shareable image provides a set of
transport-specific routines that are used for all connections using
that transport. The transport function table (XTFT) data structure
contains the addresses of these routines. During a transport attach
operation, the transport-specific DECW$TRANSPORT_INIT routine
initializes and returns that transport's XTFT.
The XTFT data structure exists during the lifetime of a specific
transport and is accessible by the common transport. The XTFT data
structure is shown in Figure 3-15.
Figure 3-15 XTFT Data Structure
Table 3-12 shows the contents of the XTFT data structure.
Table 3-12 XTFT Data Structure
Field |
Use |
XTFT$L_REQUIRED0
|
Longword that must contain the value XTFT$K_REQUIRED0 (--1515870811
decimal).
|
XTFT$L_RESERVED0
|
Longword reserved for use by your specific transport.
|
XTFT$A_EXECUTE_WRITE
|
Address of execute-write routine.
|
XTFT$A_WRITE
|
Address of write routine.
|
XTFT$A_WRITE_USER
|
Address of write-user routine.
|
XTFT$A_EXECUTE_FREE
|
Address of execute-free routine.
|
XTFT$A_FREE_INPUT_BUFFER
|
Address of free-input routine.
|
XTFT$A_CLOSE
|
Address of close routine.
|
XTFT$A_OPEN
|
Address of open routine.
|
XTFT$A_ATTACH_TRANSPORT
|
Address of attach routine.
|
XTFT$A_RUNDOWN
|
Address of rundown routine.
|
XTFT$L_XTCC_LENGTH
|
Length, in bytes, of XTCCs used by this transport. Must be at least
XTCC$W_SIZE.
|
XTFT$L_XTPB_LENGTH
|
Length, in bytes, of XTPBs used by this transport. Must be at least
XTPB$W_SIZE.
|
XTFT$L_XTDB_LENGTH
|
Length, in bytes, of XTDBs used by this transport. Must be at least
XTDB$W_SIZE.
|
XTFT$L_IXTCC_LENGTH
|
Length, in bytes, of IXTCCs used by this transport. Must be at least
IXTCC$W_SIZE.
|
XTFT$L_REQUIRED1
|
Longword that must contain the value XTFT$K_REQUIRED1 (--1768515946
decimal).
|
3.3 Transport-Common and Transport-Specific Components
As described in Section 1.2, the transport layer is separated into
transport-common and transport-specific functions. The routines that
support the transport-common functions have names of the form
DECW$XPORT_xxx and provide the generic services needed by Xlib or the
server.
Some transport-common routines only select and call the correct
transport-specific routine. Other transport-common routines perform
substantial processing prior or subsequent to invoking the associated
transport-specific routine.
A special set of utility routines and macro definitions perform thread
suspension and resumption, global section mapping and maintenance,
queue maintenance, and communication between transport layer components
for use by transport layer developers. See Chapter 7 for more
information.
The transport-common routines call transport-specific routines that are
private to a particular transport service, such as DECnet. The
addresses of the transport-specific routines are contained in the XTFT
data structure and, along with VMS packaging requirements, comprise the
interface to which a transport developer must program.
3.3.1 Transport-Common Functions
The transport-common code performs the following functions:
- Initializes the transport-specific layer
- Attaches the transport-specific layer
- Opens a connection
- Gets and sets transport-common and per-connection attributes
- Allocates memory
- Reads from the input queue
- Writes to the output queue
- Closes a connection
- Outputs messages for debugging
- Provides buffer compression
Subsequent sections describe the transport-common functions.
3.3.1.1 Initializing the Transport-Common Layer
The DECW$XPORT_INITIALIZE routine is called before any other DECwindows
transport-common routine. Xlib and the server call the
DECW$XPORT_INITIALIZE routine to initialize the transport-common code.
The common transport knows whether it was called by Xlib or the server
by a caller_type argument that identifies the caller
as a client (DECW$K_XPORT_CLIENT) or as the server
(DECW$K_XPORT_SERVER).
DECW$XPORT_INITIALIZE initializes the global XTPB data structure, from
which other XTPB data structures inherit their default values. (See
Section 3.2.1.)
Transports and connections that are subsequently attached or opened
inherit the parameters set at initialization time unless they override
them in an itmlst argument to the
DECW$XPORT_INITIALIZE or DECW$XPORT_ATTACH_TRANSPORT routines. Both
Xlib and the server override some of these defaults.
The DECW$XPORT_INITIALIZE routine calls a transport-common routine to
load the global XTPB data structure with the attributes passed in the
itmlst argument.
The itmlst argument can specify the following
parameters:
- The address of a procedure to call when an input operation is
completed on the connection and input notification has been enabled
- The address of a procedure to call when an output operation is
completed on the connection and output notification has been enabled
- The size of the data area of the large communication buffers used
by transport
- The size of the data area of the small communication buffers used
by transport
- A value to be passed to the input notification routine
- A value to be passed to the output notification routine
- The number of the event flag to be set for input notification
- The number of the event flag to be set for output notification
- The number of seconds the default waiting procedures are allowed to
wait for output completion
- The number of seconds the default waiting procedures are allowed to
wait for input completion
3.3.1.2 Attaching a Transport-Specific Layer
On the client side of the connection, Xlib calls
DECW$XPORT_ATTACH_TRANSPORT to attach and initialize only those
transports to which it wants to connect. Xlib determines the transports
to attach and initialize as follows:
- If the call to the Xlib OPEN DISPLAY routine specifies a display
name, Xlib parses the display name to determine the transport to
initialize.
- If the call to the Xlib OPEN DISPLAY routine specifies a null
display name, Xlib uses the result of the last SET DISPLAY command to
determine the transport to initialize.
On the server side of the connection, the server must tell the common
transport which specific transports to attach and initialize. The
server uses the logical name DECW$SERVER_TRANSPORTS (see
SYS$MANAGER:DECW$PRIVATE_SERVER_SETUP.TEMPLATE) to accomplish this.
For example, DECW$SERVER_TRANSPORTS could translate to
DECNET,LOCAL,TCPIP. The server calls the common transport
DECW$XPORT_ATTACH_TRANSPORT routine for each transport identified by
the logical name. The transport_name argument
specifies the transport, such as DECNET.
DECW$XPORT_ATTACH_TRANSPORT needs a way to associate the transport name
specified in the transport_name argument with a
specific transport's image. When called by either Xlib or the server,
DECW$XPORT_ATTACH_TRANSPORT attempts to locate and activate an image
with a name in the form
SYS$SHARE:DECW$TRANSPORT_transport_name.EXE. If it
does not find one, DECW$XPORT_ATTACH_TRANSPORT looks for a name in the
form SYS$SHARE:DECW_TRANSPORT_transport_name.EXE.
For example, if DECW$XPORT_ATTACH_TRANSPORT could not find an image
with the name SYS$SHARE:DECW$TRANSPORT_FOO.EXE, it would look for
SYS$SHARE:DECW_TRANSPORT_FOO.EXE.
Note
Transport names that contain a dollar-sign ($) character, such as
SYS$SHARE:DECW$TRANSPORT_DECNET, are reserved for transport images
supplied by Digital.
Transport names that do not contain a dollar-sign ($) character are
reserved for third-party and customer transport images. These transport
names must be in the form
SYS$SHARE:DECW_TRANSPORT_transport_name.EXE.
|
If the image activation is successful, DECW$XPORT_ATTACH_TRANSPORT
builds an XTDB, initializes the common fields, and calls the
transport-specific DECW$TRANSPORT_INIT routine to complete the
initialization by initializing the XTFT data structure with the
addresses of the transport-specific routines.
Every transport-specific image
(SYS$SHARE:DECW$TRANSPORT_transport_name.EXE or
SYS$SHARE:DECW_TRANSPORT_transport_name.EXE) must
provide an implementation of DECW$TRANSPORT_INIT for its initialization
routine. A transfer vector to the DECW$TRANSPORT_INIT routine must be
placed in the first image section of the transport-specific image.
The DECW$XPORT_ATTACH_TRANSPORT routine performs the following
functions:
- Validates the transport_name argument.
- Checks to see if the transport-specific image is already attached.
- Builds the transport-specific image file name.
- Activates the transport-specific image.
- Calls the transport-specific DECW$TRANSPORT_INIT initialization
routine to get the address of the XTFT.
- Allocates memory for XTDB and XTPB. Copies the contents of the
global XTPB to the new XTPB.
- Attaches the XTPB to the XTDB and sets the XTDB attributes from the
itmlst argument.
- Fills in the XTDB contents, such as the transport family name.
- Enqueues the XTDB on the global XTDB queue.
- Calls the transport-specific attach routine,
XTFT$A_ATTACH_TRANSPORT, and returns the status.
|