Added support for multi-homed YAZ frontend server. A backend config
[yaz-moved-to-github.git] / src / session.h
index f9c42e3..69402ab 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Copyright (C) 1995-2004, Index Data
+ * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: session.h,v 1.2 2004-10-15 00:19:00 adam Exp $
+ * $Id: session.h,v 1.5 2005-02-01 14:46:47 adam Exp $
  */
 /**
  * \file session.h
 #ifndef SESSION_H
 #define SESSION_H
 
-#include <sys/types.h>
 #include <yaz/comstack.h>
 #include <yaz/odr.h>
 #include <yaz/oid.h>
 #include <yaz/proto.h>
+#include <yaz/backend.h>
 #include "eventl.h"
 
+struct gfs_server {
+    statserv_options_block cb;
+    char *host;
+    int port;
+    struct gfs_server *next;
+};
+
 typedef enum {
-       REQUEST_IDLE,    /* the request is just sitting in the queue */
-       REQUEST_PENDING  /* operation pending (b'end processing or network I/O*/
-       /* this list will have more elements when acc/res control is added */
+    REQUEST_IDLE,    /* the request is just sitting in the queue */
+    REQUEST_PENDING  /* operation pending (b'end processing or network I/O*/
+    /* this list will have more elements when acc/res control is added */
 } request_state;
 
 typedef struct request
@@ -89,9 +96,11 @@ typedef struct association
     unsigned cs_accept_mask;
 
     struct bend_initrequest *init;
+    statserv_options_block *last_control;
 } association;
 
-association *create_association(IOCHAN channel, COMSTACK link);
+association *create_association(IOCHAN channel, COMSTACK link,
+                               const char *apdufile);
 void destroy_association(association *h);
 void ir_session(IOCHAN h, int event);
 
@@ -106,4 +115,6 @@ void request_release(request *r);
 
 int statserv_must_terminate(void);
 
+int control_association(association *assoc, const char *host, int force);
+
 #endif