Table of Contents
There are two major data structures associated with the transport independent portion of this interface. Additional data structures may be used internally by each transport.
Each transport supported has an entry in the transport table. The transport table is an array of Xtransport records. Each record contains all the entry points for a single transport. This record is defined as:
typedef struct _Xtransport {
char *TransName;
int flags;
XtransConnInfo (*OpenCOTSClient)(
struct _Xtransport *, /* transport */
char *, /* protocol */
char *, /* host */
char * /* port */
);
XtransConnInfo (*OpenCOTSServer)(
struct _Xtransport *, /* transport */
char *, /* protocol */
char *, /* host */
char * /* port */
);
XtransConnInfo (*OpenCLTSClient)(
struct _Xtransport *, /* transport */
char *, /* protocol */
char *, /* host */
char * /* port */
);
XtransConnInfo (*OpenCLTSServer)(
struct _Xtransport *, /* transport */
char *, /* protocol */
char *, /* host */
char * /* port */
);
int (*SetOption)(
XtransConnInfo, /* connection */
int, /* option */
int /* arg */
);
int (*CreateListener)(
XtransConnInfo, /* connection */
char *, /* port */
int /* flags */
);
int (*ResetListener)(
XtransConnInfo /* connection */
);
XtransConnInfo (*Accept)(
XtransConnInfo /* connection */
);
int (*Connect)(
XtransConnInfo, /* connection */
char *, /* host */
char * /* port */
);
int (*BytesReadable)(
XtransConnInfo, /* connection */
BytesReadable_t * /* pend */
);
int (*Read)(
XtransConnInfo, /* connection */
char *, /* buf */
int /* size */
);
int (*Write)(
XtransConnInfo, /* connection */
char *, /* buf */
int /* size */
);
int (*Readv)(
XtransConnInfo, /* connection */
struct iovec *, /* buf */
int /* size */
);
int (*Writev)(
XtransConnInfo, /* connection */
struct iovec *, /* buf */
int /* size */
);
int (*Disconnect)(
XtransConnInfo /* connection */
);
int (*Close)(
XtransConnInfo /* connection */
);
} Xtransport;
typedef struct _Xtransport {
char *TransName;
int flags;
XtransConnInfo (*OpenCOTSClient)(
struct _Xtransport *, /* transport */
char *, /* protocol */
char *, /* host */
char * /* port */
);
XtransConnInfo (*OpenCOTSServer)(
struct _Xtransport *, /* transport */
char *, /* protocol */
char *, /* host */
char * /* port */
);
XtransConnInfo (*OpenCLTSClient)(
struct _Xtransport *, /* transport */
char *, /* protocol */
char *, /* host */
char * /* port */
);
XtransConnInfo (*OpenCLTSServer)(
struct _Xtransport *, /* transport */
char *, /* protocol */
char *, /* host */
char * /* port */
);
int (*SetOption)(
XtransConnInfo, /* connection */
int, /* option */
int /* arg */
);
int (*CreateListener)(
XtransConnInfo, /* connection */
char *, /* port */
int /* flags */
);
int (*ResetListener)(
XtransConnInfo /* connection */
);
XtransConnInfo (*Accept)(
XtransConnInfo /* connection */
);
int (*Connect)(
XtransConnInfo, /* connection */
char *, /* host */
char * /* port */
);
int (*BytesReadable)(
XtransConnInfo, /* connection */
BytesReadable_t * /* pend */
);
int (*Read)(
XtransConnInfo, /* connection */
char *, /* buf */
int /* size */
);
int (*Write)(
XtransConnInfo, /* connection */
char *, /* buf */
int /* size */
);
int (*Readv)(
XtransConnInfo, /* connection */
struct iovec *, /* buf */
int /* size */
);
int (*Writev)(
XtransConnInfo, /* connection */
struct iovec *, /* buf */
int /* size */
);
int (*Disconnect)(
XtransConnInfo /* connection */
);
int (*Close)(
XtransConnInfo /* connection */
);
} Xtransport;
The flags
field can contain an OR of
the following masks:
TRANS_ALIAS | indicates that this record is providing an alias, and should not be used to create a listener. |
TRANS_LOCAL | indicates that this is a LOCALCONN transport. |
TRANS_ABSTRACT | indicates that a local connection transport uses the abstract socket namespace. |
Some additional flags may be set in the flags
field by the library while it is running:
TRANS_DISABLED | indicates that this transport has been disabled. |
TRANS_NOLISTEN | indicates that servers should not open new listeners using this transport. |
TRANS_NOUNLINK | set by a transport backend to indicate that the endpoints for its connection should not be unlinked. |
Each connection will have an opaque XtransConnInfo transport connection object allocated for it. This record contains information specific to the connection. The record is defined as:
typedef struct _XtransConnInfo *XtransConnInfo;
struct _XtransConnInfo {
struct _Xtransport *transptr;
char *priv;
int flags;
int fd;
int family;
char *addr;
int addrlen;
char *peeraddr;
int peeraddrlen;
};
typedef struct _XtransConnInfo *XtransConnInfo;
struct _XtransConnInfo {
struct _Xtransport *transptr;
char *priv;
int flags;
int fd;
int family;
char *addr;
int addrlen;
char *peeraddr;
int peeraddrlen;
};