Return separate counts of TID reqs that succeed and result in error
[trust_router.git] / include / mon_internal.h
index 29ea514..281e05b 100644 (file)
 #include <talloc.h>
 #include <stdint.h>
 #include <jansson.h>
-#include <gmodule.h>
+#include <glib.h>
 #include <gssapi.h>
 #include <trust_router/tid.h>
 #include <trp_internal.h>
 #include <tr_gss_names.h>
 #include <tr_gss_client.h>
 #include <tr_name_internal.h>
-#include <trust_router/tr_dh.h>
 #include <mon.h>
 
 /* Typedefs */
@@ -79,7 +78,6 @@ enum mon_rc {
 
 enum mon_cmd {
   MON_CMD_UNKNOWN=0,
-  MON_CMD_RECONFIGURE,
   MON_CMD_SHOW
 };
 
@@ -99,9 +97,10 @@ enum mon_opt_type {
 
   // System statistics
   OPT_TYPE_SHOW_UPTIME,
-  OPT_TYPE_SHOW_TID_REQ_COUNT,
-  OPT_TYPE_SHOW_TID_REQ_ERR_COUNT,
-  OPT_TYPE_SHOW_TID_REQ_PENDING,
+  OPT_TYPE_SHOW_TID_REQS_PROCESSED,
+  OPT_TYPE_SHOW_TID_REQS_FAILED,
+  OPT_TYPE_SHOW_TID_ERROR_COUNT,
+  OPT_TYPE_SHOW_TID_REQS_PENDING,
 
   // Dynamic trust router state
   OPT_TYPE_SHOW_ROUTES,
@@ -129,7 +128,7 @@ struct mon_resp {
 /* Monitoring server instance */
 struct mons_instance {
   const char *hostname;
-  unsigned int port;
+  int mon_port;
   TR_GSS_NAMES *authorized_gss_names;
   TIDS_INSTANCE *tids;
   TRPS_INSTANCE *trps;
@@ -180,16 +179,20 @@ MON_RESP * mon_resp_decode(TALLOC_CTX *mem_ctx, json_t *resp_json);
 
 /* mons.c */
 MONS_INSTANCE *mons_new(TALLOC_CTX *mem_ctx);
-int mons_get_listener(MONS_INSTANCE *mons, MONS_REQ_FUNC *req_handler, MONS_AUTH_FUNC *auth_handler, const char *hostname,
-                      unsigned int port, void *cookie, int *fd_out, size_t max_fd);
+int mons_get_listener(MONS_INSTANCE *mons,
+                      MONS_REQ_FUNC *req_handler,
+                      MONS_AUTH_FUNC *auth_handler,
+                      const char *hostname,
+                      int port,
+                      void *cookie,
+                      int *fd_out,
+                      size_t max_fd);
 int mons_accept(MONS_INSTANCE *mons, int listen);
 
 /* monc.c */
 MONC_INSTANCE *monc_new(TALLOC_CTX *mem_ctx);
 void monc_free(MONC_INSTANCE *monc);
-DH *monc_get_dh(MONC_INSTANCE *inst);
-DH *monc_set_dh(MONC_INSTANCE *inst, DH *dh);
-int monc_open_connection(MONC_INSTANCE *monc, const char *server, unsigned int port);
+int monc_open_connection(MONC_INSTANCE *monc, const char *server, int port);
 MON_RESP *monc_send_request(TALLOC_CTX *mem_ctx, MONC_INSTANCE *monc, MON_REQ *req);
 
 #endif //TRUST_ROUTER_MON_REQ_H