summaryrefslogtreecommitdiff
path: root/tunDevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tunDevice.cpp')
-rw-r--r--tunDevice.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tunDevice.cpp b/tunDevice.cpp
index e4cc5af..8898c7f 100644
--- a/tunDevice.cpp
+++ b/tunDevice.cpp
@@ -140,7 +140,20 @@ char* TunDevice::getActualName()
return dev_->actual_name;
}
-char* TunDevice::getType()
+u_int32_t TunDevice::getType()
+{
+ if(!dev_)
+ return TYPE_UNDEF;
+
+ switch(dev_->type)
+ {
+ case DEV_TYPE_TUN: return TYPE_TUN;
+ case DEV_TYPE_TAP: return TYPE_TAP;
+ }
+ return TYPE_UNDEF;
+}
+
+char* TunDevice::getTypeString()
{
if(!dev_)
return NULL;