X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/410c8acf139e945dce28bbc0c8b17dcfd0815643..a7880467f330b9824be66934fc5cb00508bf0229:/tripe.h diff --git a/tripe.h b/tripe.h index 171f23ab..587c5d5b 100644 --- a/tripe.h +++ b/tripe.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: tripe.h,v 1.1 2001/02/03 20:26:37 mdw Exp $ + * $Id: tripe.h,v 1.4 2001/02/05 19:56:37 mdw Exp $ * * Main header file for TrIPE * @@ -29,6 +29,16 @@ /*----- 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. + * * Revision 1.1 2001/02/03 20:26:37 mdw * Initial checkin. * @@ -43,6 +53,8 @@ /*----- Header files ------------------------------------------------------*/ +#include "config.h" + #include #include #include @@ -211,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 @@ -253,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 @@ -303,6 +323,10 @@ extern const trace_opt tr_opts[]; /* Trace options array */ extern unsigned tr_flags; /* Trace options flags */ #endif +/*----- Other macros ------------------------------------------------------*/ + +#define TIMER noise_timer(RAND_GLOBAL) + /*----- Key management ----------------------------------------------------*/ /* --- @km_interval@ --- *