summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2010-11-30 22:35:00 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2010-11-30 22:35:00 +0100
commitd04d1d78c04b60a406bc5a24c004264f43af520f (patch)
tree2abef984326a8ddb48e1378914beadda75865d0e /common
parent525d75316848f79208101e48a54e21396464c98b (diff)
downloadeurephia-d04d1d78c04b60a406bc5a24c004264f43af520f.tar.gz
eurephia-d04d1d78c04b60a406bc5a24c004264f43af520f.tar.xz
eurephia-d04d1d78c04b60a406bc5a24c004264f43af520f.zip
Implemented detection of OpenVPN tunnel device type
This will later be used to be able to support OpenVPN in tun mode as well as the now only supported tap mode. It will first try to detect the tunnel type based on the 'dev_type' environment variable if available. If not, it will try to figure it out based on the device name. If this fails, it is possible to force the eurephia to a specific device type by setting the openvpn_devtype config variable. Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to 'common')
-rw-r--r--common/eurephia_context.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/eurephia_context.h b/common/eurephia_context.h
index e323c45..d7c1bae 100644
--- a/common/eurephia_context.h
+++ b/common/eurephia_context.h
@@ -45,12 +45,21 @@
#define SIZE_PWDCACHE_SALT 2048 /**< Defines the size of the in-memory password salt */
/**
+ * OpenVPN tunnel types
+ */
+typedef enum OVPN_tunnelType_e { tuntype_UNKN, /**< Unknwown */
+ tuntype_TAP, /**< OpenVPN is used with --dev tap */
+ tuntype_TUN /**< OpenVPN is used with --dev tun */
+} OVPN_tunnelType;
+
+/**
* main structure for the eurephia module context
* - the same context structure is used for all OpenVPN sessions
*/
typedef struct {
void *eurephia_driver; /**< Pointer to the eurephia database drivers handler */
void *eurephia_fw_intf; /**< Pointer to the eurephia firewall interface handler */
+ OVPN_tunnelType tuntype;/**< Type of OpenVPN tunnel - TUN or TAP */
eDBconn *dbc; /**< Pointer to an eurephia database connection */
#ifdef EUREPHIA_FWINTF
eurephiaFWINTF *fwcfg; /**< Pointer to the firewall configuration */