+ IOCHAN client_chan; /* event-loop control */
+ COMSTACK client_link; /* communication handle */
+ ODR decode; /* decoding stream */
+ ODR encode; /* encoding stream */
+ ODR print; /* printing stream (for -a) */
+ char *encode_buffer; /* temporary buffer for encoded data */
+ int encoded_len; /* length of encoded data */
+ char *input_buffer; /* input buffer (allocated by comstack) */
+ int input_buffer_len; /* length (size) of buffer */
+ int input_apdu_len; /* length of current incoming APDU */
+ oid_proto proto; /* protocol (PROTO_Z3950/PROTO_SR) */
+ void *backend; /* backend handle */
+ request_q incoming; /* Q of incoming PDUs */
+ request_q outgoing; /* Q of outgoing data buffers (enc. PDUs) */
+ enum
+ {
+ ASSOC_NEW, /* not initialized yet */
+ ASSOC_UP, /* normal operation */
+ ASSOC_DEAD /* dead. Close if input arrives */
+ } state;