23 lines
537 B
C++
23 lines
537 B
C++
#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;
|
|
};
|