chiark / gitweb /
Major overhaul. Separate functions for manipulating keysets from
[tripe] / tripe.h
diff --git a/tripe.h b/tripe.h
index 40ad1c1ef7e7cd6c4283221adf9a2c0c9e8d6e21..587c5d5ba3dd54419c3fb3939602674b9d6e23dd 100644 (file)
--- a/tripe.h
+++ b/tripe.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: tripe.h,v 1.2 2001/02/03 22:40:29 mdw Exp $
+ * $Id: tripe.h,v 1.4 2001/02/05 19:56:37 mdw Exp $
  *
  * Main header file for TrIPE
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: tripe.h,v $
+ * Revision 1.4  2001/02/05 19:56:37  mdw
+ * Sequence number protection, and BSD tunnels.
+ *
+ * Revision 1.3  2001/02/04 01:17:55  mdw
+ * Create a configuration header file to tidy up command lines.
+ *
  * Revision 1.2  2001/02/03 22:40:29  mdw
  * Put timer information into the entropy pool when packets are received
  * and on similar events.  Reseed the generator on the interval timer.
@@ -47,6 +53,8 @@
 
 /*----- Header files ------------------------------------------------------*/
 
+#include "config.h"
+
 #include <assert.h>
 #include <ctype.h>
 #include <errno.h>
@@ -215,8 +223,12 @@ typedef struct keyset {
 #endif
   gcipher *c;                          /* Keyset cipher for encryption */
   gmac *m;                             /* Keyset MAC for integrity */
+  uint32 oseq;                         /* Outbound sequence number */
+  uint32 iseq, iwin;                   /* Inbound sequence number */
 } keyset;
 
+#define KS_SEQWINSZ 32                 /* Bits in sequence number window */
+
 /* --- Key exchange --- *
  *
  * TrIPE uses the Wrestlers Protocol for its key exchange.  The Wrestlers
@@ -257,6 +269,10 @@ typedef struct tunnel {
 #if TUN_TYPE == TUN_UNET
   sel_file f;                          /* Selector for Usernet device */
   struct peer *p;                      /* Pointer to my peer */
+#elif TUN_TYPE == TUN_BSD
+  sel_file f;                          /* Selector for tunnel device */
+  struct peer *p;                      /* Pointer to my peer */
+  unsigned n;                          /* Number of my tunnel device */
 #else
 #  error "No support for this tunnel type"
 #endif