Further work on tids and monitoring, tids appears to work again
[trust_router.git] / include / tid_internal.h
index 525e671..c5ecdc8 100644 (file)
 #ifndef TID_INTERNAL_H
 #define TID_INTERNAL_H
 #include <glib.h>
-#include <trust_router/tid.h>
 
+#include <tr_rp.h>
+#include <trust_router/tid.h>
 #include <jansson.h>
 
 struct tid_srvr_blk {
-  struct in_addr aaa_server_addr;
+  TID_SRVR_BLK *next;
+  char *aaa_server_addr;
   TR_NAME *key_name;
   DH *aaa_server_dh;           /* AAA server's public dh information */
   GTimeVal key_expiration; /**< absolute time at which key expires*/
-  json_t *path;/**< Path of trust routers that the request traversed*/
+  TID_PATH *path;/**< Path of trust routers that the request traversed*/
 };
 
 struct tid_resp {
@@ -56,7 +58,6 @@ struct tid_resp {
   TR_CONSTRAINT_SET *cons;
   TR_NAME *orig_coi;
   TID_SRVR_BLK *servers;               /* array of servers */
-  size_t num_servers;
   json_t *error_path; /**< Path that a request generating an error traveled*/
 };
 
@@ -64,6 +65,7 @@ struct tid_req {
   struct tid_req *next_req;
   int resp_sent;
   int conn;
+  int free_conn; /* free conn and gss ctx*/
   gss_ctx_id_t gssctx;
   int resp_rcvd;
   TR_NAME *rp_realm;
@@ -80,7 +82,7 @@ struct tid_req {
 };
 
 struct tidc_instance {
-  TID_REQ *req_list;
+  // TID_REQ *req_list;
   // TBD -- Do we still need a separate private key */
   // char *priv_key;
   // int priv_len;
@@ -95,14 +97,26 @@ struct tids_instance {
   TIDS_REQ_FUNC *req_handler;
   tids_auth_func *auth_handler;
   void *cookie;
-  uint16_t tids_port;
+  unsigned int tids_port;
+  TR_NAME *gss_name;           /* GSS name client used for authentication */
 };
 
-
 /** Decrement a reference to #json when this tid_req is cleaned up. A
     new reference is not created; in effect the caller is handing a
     reference they already hold to the TID_REQ.*/
 void tid_req_cleanup_json(TID_REQ *, json_t *json);
 
 int tid_req_add_path(TID_REQ *, const char *this_system, unsigned port);
+
+TID_SRVR_BLK *tid_srvr_blk_new(TALLOC_CTX *mem_ctx);
+void tid_srvr_blk_free(TID_SRVR_BLK *srvr);
+TID_SRVR_BLK *tid_srvr_blk_dup(TALLOC_CTX *mem_ctx, TID_SRVR_BLK *srvr);
+TID_SRVR_BLK *tid_srvr_blk_add_func(TID_SRVR_BLK *head, TID_SRVR_BLK *new);
+#define tid_srvr_blk_add(head, new) ((head)=tid_srvr_blk_add_func((head),(new)))
+void tid_srvr_blk_set_path(TID_SRVR_BLK *block, TID_PATH *path);
+
+TID_RC tid_resp_cpy(TID_RESP *dst, TID_RESP *src);
+void tid_resp_set_cons(TID_RESP *resp, TR_CONSTRAINT_SET *cons);
+void tid_resp_set_error_path(TID_RESP *resp, json_t *ep);
+
 #endif