chiark / gitweb /
Allow admin clients to filter out async messages. Send notifications
[tripe] / tripe.h
diff --git a/tripe.h b/tripe.h
index 7de033d3326a7015a37064d535a80e5b70745cd0..320a2ca5218f91d4672aabf6e95a8f81ba4f2895 100644 (file)
--- a/tripe.h
+++ b/tripe.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
 /* -*-c-*-
  *
- * $Id: tripe.h,v 1.20 2004/04/18 18:08:11 mdw Exp $
+ * $Id$
  *
  * Main header file for TrIPE
  *
  *
  * Main header file for TrIPE
  *
@@ -292,7 +292,7 @@ typedef struct stats {
   unsigned long sz_in, sz_out;         /* Size of all data in and out */
   unsigned long sz_kxin, sz_kxout;     /* Size of key exchange messages */
   unsigned long sz_ipin, sz_ipout;     /* Size of encapsulated IP packets */
   unsigned long sz_in, sz_out;         /* Size of all data in and out */
   unsigned long sz_kxin, sz_kxout;     /* Size of key exchange messages */
   unsigned long sz_ipin, sz_ipout;     /* Size of encapsulated IP packets */
-  time_t t_start, t_last;              /* Time peer created, last recv */
+  time_t t_start, t_last, t_kx;                /* Time peer created, last pk, kx */
   unsigned long n_reject;              /* Number of rejected packets */
   unsigned long n_in, n_out;           /* Number of packets in and out */
   unsigned long n_kxin, n_kxout;       /* Number of key exchange packets */
   unsigned long n_reject;              /* Number of rejected packets */
   unsigned long n_in, n_out;           /* Number of packets in and out */
   unsigned long n_kxin, n_kxout;       /* Number of key exchange packets */
@@ -345,6 +345,17 @@ typedef struct admin {
 
 #define AF_DEAD 1u                     /* Destroy this admin block */
 #define AF_LOCK 2u                     /* Don't destroy it yet */
 
 #define AF_DEAD 1u                     /* Destroy this admin block */
 #define AF_LOCK 2u                     /* Don't destroy it yet */
+#define AF_NOTE 4u                     /* Catch notifications */
+#ifndef NTRACE
+  #define AF_TRACE 8u                  /* Catch tracing */
+#endif
+#define AF_WARN 16u                    /* Catch warning messages */
+
+#ifndef NTRACE
+#  define AF_ALLMSGS (AF_NOTE | AF_TRACE | AF_WARN)
+#else
+#  define AF_ALLMSGS (AF_NOTE | AF_WARN)
+#endif
 
 /*----- Global variables --------------------------------------------------*/
 
 
 /*----- Global variables --------------------------------------------------*/
 
@@ -651,16 +662,29 @@ extern int ksl_decrypt(keyset **/*ksroot*/, unsigned /*ty*/,
 
 extern void a_warn(const char */*fmt*/, ...);
 
 
 extern void a_warn(const char */*fmt*/, ...);
 
+/* --- @a_notify@ --- *
+ *
+ * Arguments:  @const char *fmt@ = pointer to format string
+ *             @...@ = other arguments
+ *
+ * Returns:    ---
+ *
+ * Use:                Sends a notification to interested admin connections.
+ */
+
+extern void a_notify(const char */*fmt*/, ...);
+
 /* --- @a_create@ --- *
  *
  * Arguments:  @int fd_in, fd_out@ = file descriptors to use
 /* --- @a_create@ --- *
  *
  * Arguments:  @int fd_in, fd_out@ = file descriptors to use
+ *             @unsigned f@ = initial flags to set
  *
  * Returns:    ---
  *
  * Use:                Creates a new admin connection.
  */
 
  *
  * Returns:    ---
  *
  * Use:                Creates a new admin connection.
  */
 
-extern void a_create(int /*fd_in*/, int /*fd_out*/);
+extern void a_create(int /*fd_in*/, int /*fd_out*/, unsigned /*f*/);
 
 /* --- @a_quit@ --- *
  *
 
 /* --- @a_quit@ --- *
  *