CONTENTS Title Page Copyright Page Preface 1 Overview of the VMS DECwindows Transport Layer 1.1 The Transport Layer Function 1.2 Transport Common/Specific Architecture 2 X11 Protocol Overview 2.1 Generating a Protocol Request 2.2 Xlib Output Buffering and Synchronization 2.3 Transporting the Protocol Request 2.4 Client Input 2.4.1 Handling Input 3 Transport Layer Architecture 3.1 Transport Layer Data Structures 3.1.1 XTPB Data Structure 3.1.2 IXTCC Data Structure 3.1.3 XTCC Data Structure 3.1.4 XTCB Data Structure 3.1.5 XTCQ Data Structure 3.1.6 XTDB Data Structure 3.1.7 XTFT Data Structure 3.2 Transport Layer Communication Queues 3.2.1 Transport Common/Specific Queue Relationship 3.2.2 Adding and Removing Buffers from the Queues 3.2.3 Communication Queue Notification Flags 3.2.4 Preventing Queue Access Conflict 3.2.4.1 Special-Case Queue Conditions 3.3 Transport-Common and Transport-Specific Components 3.3.1 Transport-Common Functions 3.3.1.1 Initializing the Transport-Common Layer 3.3.1.2 Attaching a Transport-Specific Layer 3.3.1.3 Opening a Connection 3.3.1.4 Getting and Setting Transport Attributes 3.3.1.5 Allocating Transport Memory 3.3.1.6 Common Transport Read Routines 3.3.1.7 Writing to the Transport 3.3.1.8 Transport Layer Timer Mechanism 3.3.1.9 Closing a Connection 3.3.2 Transport-Specific Functions 3.3.2.1 Initializing the Transport 3.3.3 Attaching the Specific Transport 3.3.3.1 Opening a Connection 3.3.3.2 Writing XTCBs to a Transport 3.3.3.3 Reading XTCBs from a Transport 3.3.3.4 Closing a Connection 3.3.3.5 The Transport-Specific Callback 4 Transport Walk-Through 5 Transport-Common Routines DECW$XPORT_ACCEPT_FAILED DECW$XPORT_ALLOC_INIT_QUEUES DECW$XPORT_ALLOC_PMEM DECW$XPORT_ATTACHED DECW$XPORT_ATTACH_LOST DECW$XPORT_CLOSE DECW$XPORT_COPY_AND_WRITE DECW$XPORT_DEALLOC_PMEM DECW$XPORT_DEALLOC_QUEUES DECW$$XPORT_FREE_INPUT DECW$XPORT_IN_NOTIFY_USER DECW$XPORT_REATTACH_FAILED DECW$XPORT_REFUSED_BY_SERVER DECW$XPORT_UNEXPECTED_MESSAG DECW$XPORT_UNKNOWN_LINK DECW$XPORT_VALIDATE_STRUCT DECW$XPORT_VALIDATE_STRUCT_JSB DECW$XPORT_VALIDATE_XTCB DECW$XPORT_VALIDATE_XTCB_JSB DECW$$XPORT_WRITE 6 Transport-Specific Routines 6.1 Condition Values CLOSE_AND_DEALLOCATE_AST DECW$TRANSPORT_INIT DETACH_AND_POLL FREE_INPUT_AST REATTACH_AST TRANSPORT_OPEN_CALLBACK TRANSPORT_READ_AST TRANSPORT_READ_QUEUE WRITE_AST XTFT$A_ATTACH_TRANSPORT XTFT$A_CLOSE XTFT$A_EXECUTE_FREE XTFT$A_EXECUTE_WRITE XTFT$A_FREE_INPUT_BUFFER XTFT$A_OPEN XTFT$A_RUNDOWN XTFT$A_WRITE XTFT$A_WRITE_USER 7 Transport Support Macros XPORT_IN_NOTIFY_SET XPORT_IN_NOTIFY_CLEAR XPORT_IN_NOTIFY_WAIT XPORT_IN_NOTIFY_SEND XPORT_OUT_NOTIFY_SET XPORT_OUT_NOTIFY_CLEAR XPORT_OUT_NOTIFY_WAIT XPORT_OUT_NOTIFY_SEND XPORT_XTCB_FILLED XPORT_XTCB_TOTAL XPORT_XTCB_FREE XPORT_WRITE_WAIT XPORT_WRITE_UNWAIT XPORT_ABORT_SEND XPORT_OUT_WRITE_ENABLE XPORT_OUT_WRITE_DISABLE XPORT_OUT_STATE_SRP XPORT_OUT_STATE_LRP XPORT_IN_STATE_SRP XPORT_IN_STATE_LRP XPORT_IN_FREE_ENABLE XPORT_IN_FREE_DISABLE VALIDATE_XTCC VALIDATE_USERW VALIDATE_USER 8 Writing Your Own Transport 8.1 Where to Begin 8.1.1 Identifying the Transport-Specific Shareable Image 8.2 Compiling and Linking Options for the Transport 8.3 Sample TCP/IP Transport Layer Implementation 8.3.1 TCP/IP Transport Layer Setup 8.3.2 Sample XTFT$A_EXECUTE_WRITE Routine 8.3.3 Sample XTFT$A_WRITE Routine 8.3.4 Sample WRITE_AST Routine 8.3.5 Sample XTFT$A_WRITE_USER Routine 8.3.6 Sample XTFT$A_EXECUTE_FREE Routine 8.3.7 Sample XTFT$A_FREE_INPUT_BUFFER Routine 8.3.8 Sample FREE_INPUT_AST Routine 8.3.9 Sample XTFT$A_CLOSE Routine 8.3.10 Sample CLOSE_AND_DEALLOCATE_AST Routine 8.3.11 Sample XTFT$A_OPEN Routine 8.3.12 Sample XTFT$A_ATTACH_TRANSPORT Routine 8.3.13 Sample TRANSPORT_READ_QUEUE Routine 8.3.14 Sample TRANSPORT_READ_AST Routine 8.3.15 Sample TRANSPORT_OPEN_CALLBACK Routine 8.3.16 Sample DETACH_AND_POLL Routine 8.3.17 Sample REATTACH_AST Routine 8.3.18 Sample XTFT$A_RUNDOWN Routine 8.3.19 Sample DECW$TRANSPORT_INIT Routine EXAMPLES 8-1 DEMO_BUILD.COM Procedure 8-2 TCP/IP Transport Layer Setup 8-3 Sample XTFT$A_EXECUTE_WRITE Routine 8-4 Sample XTFT$A_WRITE Routine 8-5 Sample WRITE_AST Routine 8-6 Sample XTFT$A_WRITE_USER Routine 8-7 Sample XTFT$A_EXECUTE_FREE Routine 8-8 Sample XTFT$A_FREE_INPUT_BUFFER Routine 8-9 Sample FREE_INPUT_AST Routine 8-10 Sample XTFT$A_CLOSE Routine 8-11 Sample CLOSE_AND_DEALLOCATE_AST Routine 8-12 Sample DECW$$TCPIP_OPEN Routine 8-13 Sample XTFT$A_ATTACH_TRANSPORT Routine 8-14 Sample TRANSPORT_READ_QUEUE Routine 8-15 Sample TRANSPORT_READ_AST Routine 8-16 Sample TRANSPORT_OPEN_CALLBACK Routine 8-17 Sample DETACH_AND_POLL Routine 8-18 Sample REATTACH_AST Routine 8-19 Sample XTFT$A_RUNDOWN Routine 8-20 Sample DECW$TRANSPORT_INIT Routine FIGURES 1-1 Remote Transport Connection 1-2 Local Transport Connection 2-1 Protocol Request Format 2-2 Output Buffer Containing a Protocol Request 3-1 Transport Attach Data Structures 3-2 Transport Connection Open Data Structures 3-3 Transport Connection Open XTCB Data Structures 3-4 Transport Data Structures 3-5 XTPB Data Structure 3-6 IXTCC Data Structure 3-7 XTCC Data Structure 3-8 XTCB Data Structure 3-9 XTCQ Data Structure 3-10 XTDB Data Structure 3-11 XTFT Data Structure 3-12 Transport Layer Communication Queues 3-13 Client/Server Communication Queue Views 3-14 Transport Common/Specific Connection 3-15 Transport Common/Specific Queues TABLES 3-1 Transport Layer Data Structures 3-2 XTPB Data Structure 3-3 XTPB Default Values 3-4 IXTCC Data Structure 3-5 XTCC Data Structure 3-6 XTCB Data Structure 3-7 XTCQ Data Structure 3-8 XTDB Data Structure 3-9 XTFT Data Structure 3-10 Transport Layer Communication Queues 3-11 Views for the Client/Server Communication Queue 3-12 Communication Queue Notification Flags 3-13 Transport Memory Allocation Routines 3-14 Transport Read Routines 3-15 Common Transport Write Routines 3-16 Transport-Specific Write Routines 3-17 Transport-Specific Read Routines 3-18 Transport-Specific Connection Close Routines 5-1 Transport-Common Routines 6-1 Transport-Specific Routines 7-1 Transport Support Macros