From 31c330838aaa247fd7b156b020df2ce95858f8e1 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 9 May 2008 18:52:28 +0000 Subject: small cleanup --- src/deviceConfig.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/deviceConfig.hpp') diff --git a/src/deviceConfig.hpp b/src/deviceConfig.hpp index 22fb5d8..efec0bb 100644 --- a/src/deviceConfig.hpp +++ b/src/deviceConfig.hpp @@ -39,6 +39,12 @@ class DeviceConfig { public: DeviceConfig(const char* dev_name ,const char* dev_type, const char* ifcfg_lp, const char* ifcfg_rnmp) + { + guess_type(dev_name, dev_type); + } + +private: + void guess_type(const char* dev_name, const char* dev_type) { type_ = TYPE_UNDEF; if(dev_type) { @@ -47,17 +53,14 @@ public: else if(!strncmp(dev_type, "tap", 3)) type_ = TYPE_TAP; } - else if(dev_name) - { + else if(dev_name) { if(!strncmp(dev_name, "tun", 3)) type_ = TYPE_TUN; else if(!strncmp(dev_name, "tap", 3)) type_ = TYPE_TAP; } - } -private: device_type_t type_; friend class TunDevice; -- cgit v1.2.3