diff options
author | Christian Pointner <equinox@anytun.org> | 2009-01-20 17:45:39 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2009-01-20 17:45:39 +0000 |
commit | 935339f9d59335a422257c843343fb9001cab5b7 (patch) | |
tree | ba58d300597648a456562280828df7ed5e7e92d8 /src/deviceConfig.hpp | |
parent | further cleanup for system execution (diff) |
safer handling of registry functions
some cleanup
Diffstat (limited to 'src/deviceConfig.hpp')
-rw-r--r-- | src/deviceConfig.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
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()); |