chiark / gitweb /
Support Linux TUN/TAP device. Fix some bugs.
[tripe] / tripe.h
diff --git a/tripe.h b/tripe.h
index 420a6fdf61ccb57f167291e02bd114935b2a6d04..069840e7358d623218aa83072261b5d4e565b7f3 100644 (file)
--- a/tripe.h
+++ b/tripe.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: tripe.h,v 1.11 2002/01/13 14:57:42 mdw Exp $
+ * $Id: tripe.h,v 1.12 2003/04/06 10:25:17 mdw Exp $
  *
  * Main header file for TrIPE
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: tripe.h,v $
+ * Revision 1.12  2003/04/06 10:25:17  mdw
+ * Support Linux TUN/TAP device.  Fix some bugs.
+ *
  * Revision 1.11  2002/01/13 14:57:42  mdw
  * Fix crap typo.
  *
 #include <arpa/inet.h>
 #include <netdb.h>
 
+#if TUN_TYPE == TUN_LINUX
+#  include <linux/if.h>
+#  include <linux/if_tun.h>
+#endif
+
 #include <pwd.h>
 #include <grp.h>
 
 #define TUN_NOTDEF 0
 #define TUN_UNET 1
 #define TUN_BSD 2
+#define TUN_LINUX 3
 
 /* --- Trace flags --- */
 
@@ -376,9 +385,13 @@ enum {
  */
 
 typedef struct tunnel {
-#if TUN_TYPE == TUN_UNET
+#if TUN_TYPE == TUN_UNET 
   sel_file f;                          /* Selector for Usernet device */
   struct peer *p;                      /* Pointer to my peer */
+#elif TUN_TYPE == TUN_LINUX
+  sel_file f;                          /* Selector for TUN/TAP device */
+  struct peer *p;                      /* Pointer to my peer */
+  char ifn[IFNAMSIZ];                  /* Interface name buffer */
 #elif TUN_TYPE == TUN_BSD
   sel_file f;                          /* Selector for tunnel device */
   struct peer *p;                      /* Pointer to my peer */