diff options
author | Christian Pointner <equinox@anytun.org> | 2008-11-26 10:47:14 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2008-11-26 10:47:14 +0000 |
commit | f5afa7efbc1ff915e733e8d1474777de80534345 (patch) | |
tree | 0e698a8e0ce8792f58f6d965d58334c26621b20c /src/deviceConfig.hpp | |
parent | anyrtpproxy: options parser support ipv6 now (diff) |
cleaned tunDevice code
Diffstat (limited to 'src/deviceConfig.hpp')
-rw-r--r-- | src/deviceConfig.hpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/deviceConfig.hpp b/src/deviceConfig.hpp index f3b6f5e..44978d0 100644 --- a/src/deviceConfig.hpp +++ b/src/deviceConfig.hpp @@ -40,27 +40,27 @@ enum device_type_t { TYPE_UNDEF, TYPE_TUN, TYPE_TAP }; class DeviceConfig { public: - DeviceConfig(const char* dev_name ,const char* dev_type, const char* ifcfg_lp, const char* ifcfg_rnmp, u_int16_t mtu) + DeviceConfig(std::string dev_name ,std::string dev_type, std::string ifcfg_lp, std::string ifcfg_rnmp, u_int16_t mtu) { mtu_ = mtu; type_ = TYPE_UNDEF; - if(dev_type) { - if(!strncmp(dev_type, "tun", 3)) + if(dev_type != "") { + if(!dev_type.compare(0,3,"tun")) type_ = TYPE_TUN; - else if(!strncmp(dev_type, "tap", 3)) + else if (!dev_type.compare(0,3,"tap")) type_ = TYPE_TAP; } - else if(dev_name) { - if(!strncmp(dev_name, "tun", 3)) + else if(dev_name != "") { + if(!dev_name.compare(0,3,"tun")) type_ = TYPE_TUN; - else if(!strncmp(dev_name, "tap", 3)) + else if(!dev_name.compare(0,3,"tap")) type_ = TYPE_TAP; } - if(ifcfg_lp) - local_.setNetworkAddress(ipv4, ifcfg_lp); - if(ifcfg_rnmp) - remote_netmask_.setNetworkAddress(ipv4, ifcfg_rnmp); + if(ifcfg_lp != "") + local_.setNetworkAddress(ipv4, ifcfg_lp.c_str()); + if(ifcfg_rnmp != "") + remote_netmask_.setNetworkAddress(ipv4, ifcfg_rnmp.c_str()); } private: |