b36448af8d9ef1ec088ac1650bc24fcb4f9aac24
[yaz-moved-to-github.git] / server / session.h
1 /*
2  * Copyright (C) 1994, Index Data I/S 
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: session.h,v $
7  * Revision 1.5  1995-04-20 15:13:01  quinn
8  * Cosmetic
9  *
10  * Revision 1.4  1995/04/10  10:23:39  quinn
11  * Some work to add scan and other things.
12  *
13  * Revision 1.3  1995/03/30  09:09:27  quinn
14  * Added state-handle and some support for asynchronous activities.
15  *
16  * Revision 1.2  1995/03/27  08:34:29  quinn
17  * Added dynamic server functionality.
18  * Released bindings to session.c (is now redundant)
19  *
20  * Revision 1.1  1995/03/14  10:28:02  quinn
21  * More work on demo server.
22  *
23  *
24  */
25
26 #ifndef SESSION_H
27 #define SESSION_H
28
29 #include <comstack.h>
30 #include <odr.h>
31 #include <oid.h>
32
33 /*
34  * association state.
35  */
36 typedef struct association
37 {
38     IOCHAN client_chan;           /* event-loop control */
39     COMSTACK client_link;         /* communication handle */
40     ODR decode;                   /* decoding stream */
41     ODR encode;                   /* encoding stream */
42     ODR print;                    /* printing stream (for -a) */
43     char *encode_buffer;          /* temporary holding of encoded data */
44     int encoded_len;              /* length of encoded data */
45     char *input_buffer;           /* input buffer (allocated by comstack) */
46     int input_buffer_len;         /* length (size) of buffer */
47     int input_apdu_len;           /* length of current incoming APDU */
48     oid_proto proto;              /* protocol (PROTO_Z3950/PROTO_SR) */
49     void *backend;                /* backend handle */
50
51     int preferredMessageSize;     /* session parameters */
52     int maximumRecordSize;
53 } association;
54
55 association *create_association(IOCHAN channel, COMSTACK link);
56 void destroy_association(association *h);
57 void ir_session(IOCHAN h, int event);
58
59 #endif