congestvpn/TunDevice.hpp

23 lines
537 B
C++
Raw Normal View History

2020-06-02 13:08:23 +02:00
#pragma once
#include <string>
#include "util.hpp"
class TunDevice {
public:
class InitializationError : public MsgException {
public:
InitializationError(const std::string& msg, int code=0)
: MsgException(msg, code) {}
};
TunDevice(const std::string& dev);
~TunDevice();
const std::string& get_dev_name() const { return _dev_name; }
int get_fd() const { return _fd; }
private:
int _fd;
std::string _dev_name;
};