/* begincopyright Copyright (c) 1988, 1989, 1992 Xerox Corporation. All rights reserved. Use and copying of this software and preparation of derivative works based upon this software are permitted. Any distribution of this software or derivative works must comply with all applicable United States export control laws. This software is made available AS IS, and Xerox Corporation makes no warranty about the software, its performance or its conformity to any specification. Any person obtaining a copy of this software is requested to send their name and post office or electronic mail address to: PCR Coordinator Xerox PARC 3333 Coyote Hill Rd. Palo Alto, CA endcopyright */ /* * * ThreadsTLI.h * * Tim Diebert: November 21, 1989 5:52:05 pm PST * Michael Plass: February 18, 1992 9:49:23 am PST * * * This is a collection of definitions and functions to deal with XNS * SPP streams. It doesn't rely upon the TLI library functions. * */ /* I really hesitate to add this include, but its contents are needed * for this file to live on its own. The include can be left out if * religion plays a part in your mind. */ #include #include /**** Type definitions */ union xns_net { u_char c_net[4]; u_short s_net[2]; }; union xns_host { u_char c_host[6]; u_short s_host[3]; }; union xns_socket { u_char c_socket[2]; u_short s_socket; }; struct xns_addr { union xns_net x_net; union xns_host x_host; union xns_socket x_socket; }; /* In order to bypass using the TLI libraries, since they maintain * global state, it will be necessary to pass around something other * than a file descriptor. The following defines the data structure * for holding the state that was originally held as global state * by the TLI code. */ struct conn_data { unsigned cd_flags; /* flags */ int cd_rcvsize; /* rcv buffer size */ char * cd_rcvbuf; /* rcv buffer */ int cd_ctlsize; /* ctl buffer size */ char * cd_ctlbuf; /* ctl buffer */ char * cd_lookdbuf; /* look data buffer */ char * cd_lookcbuf; /* look ctl buffer */ int cd_lookdsize; /* look data buf size */ int cd_lookcsize; /* look ctl buf size */ int cd_maxpsz; /* TIDU size */ long cd_servtype; /* service type */ int cd_lookflg; /* buffered look flag */ int cd_fd; /* the fd normally returned by TLI */ int cd_errno; /* the global errno from TLI */ struct t_info cd_info; /* filled in on the call to XR_T_Open */ }; typedef struct conn_data conn_data_t;