From 935339f9d59335a422257c843343fb9001cab5b7 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 20 Jan 2009 17:45:39 +0000 Subject: safer handling of registry functions some cleanup --- src/deviceConfig.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/deviceConfig.hpp') diff --git a/src/deviceConfig.hpp b/src/deviceConfig.hpp index 44978d0..a3dbe74 100644 --- a/src/deviceConfig.hpp +++ b/src/deviceConfig.hpp @@ -44,6 +44,7 @@ public: { mtu_ = mtu; type_ = TYPE_UNDEF; +#ifndef _MSC_VER if(dev_type != "") { if(!dev_type.compare(0,3,"tun")) type_ = TYPE_TUN; @@ -56,6 +57,15 @@ public: else if(!dev_name.compare(0,3,"tap")) type_ = TYPE_TAP; } +#else + if(dev_type == "") + throw std::runtime_error("Device type must be specified on Windows"); + + if(dev_type == "tun") + type_ = TYPE_TUN; + else if(dev_type == "tap") + type_ = TYPE_TAP; +#endif if(ifcfg_lp != "") local_.setNetworkAddress(ipv4, ifcfg_lp.c_str()); -- cgit v1.2.3