X-Git-Url: https://git.syn-net.org/debian/?p=anytun.git;a=blobdiff_plain;f=src%2FtunDevice.h;h=8b2d6137a0e79f6bf7c038678dfcaed8e288451d;hp=8b400a917a088f9bc72a8f9070ee0d009ac6fd9e;hb=ef0cacf2508418915d3f64b04003be3c13fed3cc;hpb=ece844834d2cecc028ce81ca283f5d441088580e diff --git a/src/tunDevice.h b/src/tunDevice.h index 8b400a9..8b2d613 100644 --- a/src/tunDevice.h +++ b/src/tunDevice.h @@ -11,7 +11,7 @@ * tunneling and relaying of packets of any protocol. * * - * Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, + * Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, * Christian Pointner * * This file is part of Anytun. @@ -45,37 +45,41 @@ class TunDevice { public: - TunDevice(std::string dev,std::string dev_type, std::string ifcfg_addr, u_int16_t ifcfg_prefix); + TunDevice(std::string dev,std::string dev_type, std::string ifcfg_addr, uint16_t ifcfg_prefix); ~TunDevice(); - - int read(u_int8_t* buf, u_int32_t len); - int write(u_int8_t* buf, u_int32_t len); + + int read(uint8_t* buf, uint32_t len); + int write(uint8_t* buf, uint32_t len); const char* getActualName() const { return actual_name_.c_str(); } const char* getActualNode() const { return actual_node_.c_str(); } - device_type_t getType() const { return conf_.type_; } + device_type_t getType() const { return conf_.type_; } void waitUntilReady(); - const char* getTypeString() const - { + const char* getTypeString() const { #ifndef _MSC_VER if(fd_ < 0) #else if(handle_ == INVALID_HANDLE_VALUE) #endif return ""; - - switch(conf_.type_) - { - case TYPE_UNDEF: return "undef"; break; - case TYPE_TUN: return "tun"; break; - case TYPE_TAP: return "tap"; break; + + switch(conf_.type_) { + case TYPE_UNDEF: + return "undef"; + break; + case TYPE_TUN: + return "tun"; + break; + case TYPE_TAP: + return "tap"; + break; } return ""; } private: - void operator=(const TunDevice &src); - TunDevice(const TunDevice &src); + void operator=(const TunDevice& src); + TunDevice(const TunDevice& src); void init_post(); void do_ifconfig(); @@ -86,14 +90,14 @@ private: #else bool getAdapter(std::string const& dev_name); DWORD performIoControl(DWORD controlCode, LPVOID inBuffer, DWORD inBufferSize, - LPVOID outBuffer, DWORD outBufferSize); + LPVOID outBuffer, DWORD outBufferSize); HANDLE handle_; OVERLAPPED roverlapped_, woverlapped_; #endif DeviceConfig conf_; #ifndef _MSC_VER - SysExec * sys_exec_; + SysExec* sys_exec_; #endif bool with_pi_; std::string actual_name_;