yaid.c: Time out idle connections after 30s.
[yaid] / yaid.h
diff --git a/yaid.h b/yaid.h
index 126c201..daae4f6 100644 (file)
--- a/yaid.h
+++ b/yaid.h
 #include <stdio.h>
 #include <string.h>
 #include <string.h>
+#include <time.h>
 
 #include <sys/types.h>
+#include <sys/time.h>
 #include <unistd.h>
 #include <fcntl.h>
 
@@ -282,12 +284,18 @@ struct action {
   } u;
 };
 
+/* A user pattern matches a user if the uid is within the given bounds. */
+struct userpat {
+  unsigned lo, hi;
+};
+
 /* A policy rule: if the query matches the pattern, then perform the
  * action.
  */
 struct policy {
   const struct addrops *ao;
   struct sockpat sp[NDIR];
+  struct userpat up;
   struct action act;
 };
 #define POLICY_INIT(a) { .act.act = a }