Added state-handle and some support for asynchronous activities.
[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.3  1995-03-30 09:09:27  quinn
8  * Added state-handle and some support for asynchronous activities.
9  *
10  * Revision 1.2  1995/03/27  08:34:29  quinn
11  * Added dynamic server functionality.
12  * Released bindings to session.c (is now redundant)
13  *
14  * Revision 1.1  1995/03/14  10:28:02  quinn
15  * More work on demo server.
16  *
17  *
18  */
19
20 #ifndef SESSION_H
21 #define SESSION_H
22
23 #include <comstack.h>
24 #include <odr.h>
25 #include <oid.h>
26
27 typedef struct association
28 {
29     /* comms-related handles */
30     IOCHAN client_chan;
31     COMSTACK client_link;
32     ODR decode;
33     ODR encode;
34     char *encode_buffer;
35     int encoded_len;
36     char *input_buffer;
37     int input_buffer_len;
38     int input_apdu_len;
39     int state;
40     oid_proto proto;
41     void *backend;
42 #define ASSOC_UNINIT       0
43 #define ASSOC_IDLE         1
44
45     /* session parameters */
46     int preferredMessageSize;
47     int maximumRecordSize;
48 } association;
49
50 association *create_association(IOCHAN channel, COMSTACK link);
51 void destroy_association(association *h);
52 void ir_session(IOCHAN h, int event);
53
54 #endif