HP OpenVMS Systems Documentation |
VMS DECwindows Transport Manual
XPORT_OUT_WRITE_DISABLE
Sets the write disable flag. FormatXPORT_OUT_WRITE_DISABLE xtcc RETURNS
Arguments
DescriptionThe XPORT_OUT_WRITE_DISABLE macro sets the write disable flag for this connection and returns true (1) if it was set or false (0) if it was clear. XPORT_OUT_STATE_SRP
Marks a switch to the use of SRPs for output and returns true (1) if an LRP was being used. FormatXPORT_OUT_STATE_SRP xtcc RETURNS
Arguments
DescriptionThe XPORT_OUT_STATE_SRP macro tests to see if the XTCC$V_LRP_ON_OUTPUT bit was set, and then clears it. XPORT_OUT_STATE_SRP marks a switch to the use of SRPs for output and returns true (1) if an LRP was being used. XPORT_OUT_STATE_LRP
Marks a switch to the use of LRPs for output and returns true (1) if an SRP was being used. FormatXPORT_OUT_STATE_LRP xtcc RETURNS
Arguments
DescriptionThe XPORT_OUT_STATE_LRP macro tests to see if the XTCC$V_LRP_ON_OUTPUT bit was clear, and then sets it. XPORT_OUT_STATE_SRP marks a switch to the use of LRPs for output and returns true (1) if an SRP was being used. XPORT_IN_STATE_SRP
Marks a switch to the use of SRPs for input and returns true (1) if an LRP was being used. FormatXPORT_IN_STATE_SRP xtcc RETURNS
Arguments
DescriptionThe XPORT_IN_STATE_SRP macro tests to see if the XTCC$V_LRP_ON_INPUT bit was set, and then clears it. XPORT_IN_STATE_SRP marks a switch to the use of SRPs for input and returns true (1) if an LRP was being used. XPORT_IN_STATE_LRP
Marks a switch to the use of LRPs for input and returns true (1) if an SRP was being used. FormatXPORT_IN_STATE_LRP xtcc RETURNS
Arguments
DescriptionThe XPORT_IN_STATE_LRP macro tests to see if the XTCC$V_LRP_ON_INPUT bit was clear, and then sets it. XPORT_IN_STATE_SRP marks a switch to the use of LRPs for input and returns true (1) if an SRP was being used. XPORT_IN_FREE_ENABLE
Clears the free disable flag for this connection type of queue and returns (1) if it was clear or (0) if it was set. FormatXPORT_IN_FREE_ENABLE xtcc, type RETURNS
Arguments
DescriptionThe XPORT_IN_FREE_ENABLE macro tests the XTCC$L_IFSQ_FLAG flag or the XTCC$L_IFLQ_FLAG flag (depending on the type argument) to see if it is clear, and then clears it. XPORT_IN_FREE_ENABLE returns true (1) if the free disable flag was clear or false (0) if it was set. XPORT_IN_FREE_DISABLE
Sets the free disable flag for this connection and type of queue and returns (1) if it was set or (0) if clear. FormatXPORT_IN_FREE_DISABLE xtcc, type RETURNS
Arguments
DescriptionThe XPORT_IN_FREE_ENABLE macro tests the XTCC$L_IFSQ_FLAG flag or the XTCC$L_IFLQ_FLAG flag (depending on the type argument) to see if it is set, and then sets it. XPORT_IN_FREE_ENABLE returns true (1) if the free disable flag was set or false (0) if it was clear. VALIDATE_XTCC
Validates an XTCC and returns the IXTCC. Formatstatus_return=VALIDATE_XTCC xtcc, ixtcc RETURNS
Arguments
DescriptionThe VALIDATE_XTCC macro calls the transport-common DECW$XPORT_VALIDATE_STRUCT_JSB routine to validate an XTCC. If the XTCC ID is known and is valid, VALIDATE_XTCC returns the previously registered address of the IXTCC data structure in the ixtcc argument. Condition Values ReturnedAny DECW$XPORT_VALIDATE_STRUCT_JSB condition value. VALIDATE_USERW
Checks a user buffer for write access. Formatstatus_return=VALIDATE_USERW bufadr, buflen RETURNS
Arguments
DescriptionThe VALIDATE_USERW macro checks the user-supplied buffer for write access and returns a status. Condition Values Returned
VALIDATE_USER
Checks a user buffer for read access. Formatstatus_return=VALIDATE_USER bufadr, buflen RETURNS
Arguments
DescriptionThe VALIDATE_USERW macro checks the user-supplied buffer for read access and returns a status. Condition Values Returned
Chapter 8
|
This chapter describes how to write the transport-specific routines only. Modifications to the existing transport-common routines are not recommended or supported. |
Depending upon your implementation, you will probably find that the routines that initialize a transport and establish a connection require the most modification. The following routines are included in this group:
You may also find that routines that primarily insert and remove buffers from the queues, such as XTFT$A_EXECUTE_FREE, can be used with minimal changes.
The sample transport layer described in this chapter uses the $QIO/AST completion interface. If the lower-level transport on which you are building uses the $QIO/AST completion interface, you should check the $QIO function codes to make sure that they are applicable in your implementation.
If the lower-level transport on which you are building does not use the
$QIO/AST completion interface and instead waits for read operations to
complete, the server may spend a substantial amount of time waiting.
8.2 Example TCP/IP Transport Layer Implementation
The code examples in this section implement a sample TCP/IP DECwindows
transport layer.
8.2.1 TCP/IP Transport Layer Setup
Example 8-1 shows module and data structure declarations, macro and literal definitions, and external definitions that are used in the TCP/IP implementation.
| Example 8-1 TCP/IP Transport Layer Setup |
|---|
.
.
.
%TITLE 'XPORT_EXAMPLE - Example TCP/IP Communication Library'
MODULE XPORT_EXAMPLE (
IDENT = 'V3.0',
ADDRESSING_MODE(EXTERNAL = GENERAL,
NONEXTERNAL = WORD_RELATIVE )
) =
BEGIN
(1)
LIBRARY 'SYS$LIBRARY:STARLET' ;
REQUIRE 'SYS$LIBRARY:UCX$INETDEF.R32' ;
REQUIRE 'SRC$:XPORTEXAMPLEDEF.R32' ;
REQUIRE 'SYS$LIBRARY:DECW$XPORTMAC.R32' ;
REQUIRE 'SYS$LIBRARY:DECW$XPORTMSG.R32' ;
(2) FORWARD ROUTINE
DECW$$TCPIP_EXECUTE_WRITE,
DECW$$TCPIP_WRITE,
WRITE_AST : NOVALUE,
DECW$$TCPIP_WRITE_USER,
DECW$$TCPIP_EXECUTE_FREE,
DECW$$TCPIP_FREE_INPUT_BUFFER,
FREE_INPUT_AST : NOVALUE,
DECW$$TCPIP_ATTACH_TRANSPORT,
PARSE_INTERNET_ADDRESS,
DECW$$TCPIP_CLOSE,
CLOSE_AND_DEALLOCATE_AST : NOVALUE,
DECW$$TCPIP_OPEN,
OPEN_AST1 : NOVALUE,
OPEN_AST2 : NOVALUE,
OPEN_AST3 : NOVALUE,
TRANSPORT_READ_QUEUE,
TRANSPORT_READ_AST : NOVALUE,
TRANSPORT_OPEN_CALLBACK : NOVALUE,
DETACH_AND_POLL : NOVALUE,
REATTACH_AST : NOVALUE,
DECW$$TCPIP_RUNDOWN : NOVALUE ,
DECW$TRANSPORT_INIT ;
(3) MACRO
XPORT_FAO(control_string) =
BEGIN
EXTERNAL ROUTINE
DECW$XPORT_FAO;
LOCAL
xport_fao_control_string_desc : $BBLOCK [DSC$K_S_BLN]
xport_fao_control_string_desc [DSC$W_LENGTH] =
%CHARCOUNT( control_string );
xport_fao_control_string_desc [DSC$A_POINTER] =
UPLIT( control_string );
DECW$XPORT_FAO
(
xport_fao_control_string_desc
%IF NOT %NULL(%REMAINING)
%THEN
,%REMAINING
%FI
)
END
%,
inet_dev_str = 'UCX$DEVICE' %,
inet_local_node = 'UCX$INET_HOST' %,
swap_long( val ) = ( ( (val ^ 24) AND %X'FF000000') OR ( (val ^ 8 )
AND %X'FF0000') OR ( (val ^ -8) AND %X'FF00') OR ( (val ^ -24 )
AND %X'FF') ) %,
swap_short( val ) = ( ( (val ^ 8) AND %X'FF00') OR ( (val ^ -8) AND %X'FF') ) %,
xtcc_status( xtcc, status ) =
IF NOT .xtcc [xtcc$v_err_sts_valid]
THEN
BEGIN
xtcc [xtcc$l_err_status] = status ;
xtcc [xtcc$v_err_sts_valid] = 1 ;
END %,
load_desc( desc, string ) = BEGIN desc [0] = %CHARCOUNT( string ) ;
desc [1] = UPLIT( string ) ; END % ;
(4) LITERAL
REATTACH_INTERVAL_SECS = 60,
USER_WRITE_BY_COPY = 1,
ASYNC_EFN = 31,
WRITE_MAXIMUM_LENGTH = 32768,
INET_NODE_NAME_LEN = 256
BASE_TCP_PORT = 6000 ;
(5) OWN
reattach_timer_id : INITIAL( 0 ),
reattach_timer_delta : VECTOR[2] INITIAL( 0, 0 ),
inet_dev_desc : VECTOR[2],
tcpip_tft : $BBLOCK [xtft$c_length],
tcpip_tdb : REF $BBLOCK,
local_node : $BBLOCK [INET_NODE_NAME_LEN],
lnn_desc : $BBLOCK [DSC$S_DSCDEF1] ;
(6) EXTERNAL ROUTINE
DECW$$XPORT_FREE_INPUT,
DECW$XPORT_READ_COMPLETE,
DECW$$XPORT_WRITE,
DECW$$XPORT_OPEN_COMPLETE,
DECW$XPORT_CLOSE,
DECW$XPORT_FREE_INPUT_BUFFER,
DECW$XPORT_COPY_AND_WRITE,
DECW$XPORT_ALLOC_INIT_QUEUES,
DECW$XPORT_DEALLOC_QUEUES,
DECW$XPORT_ALLOC_PMEM,
DECW$XPORT_DEALLOC_PMEM : NOVALUE,
DECW$XPORT_VALIDATE_STRUCT,
DECW$XPORT_VALIDATE_STRUCT_JSB : L_VALIDATE_STRUCT,
DECW$XPORT_ACCEPT_FAILED,
DECW$XPORT_ATTACHED,
DECW$XPORT_ATTACH_LOST,
DECW$XPORT_REATTACH_FAILED,
DECW$XPORT_REFUSED_BY_SERVER ;
.
.
.
|
| Previous | Next | Contents | Index |