Starting over
This commit is contained in:
9
lib/BUILD
Normal file
9
lib/BUILD
Normal file
@@ -0,0 +1,9 @@
|
||||
cc_library(
|
||||
name = "tun_tap_device_lib",
|
||||
hdrs = [
|
||||
"tun_tap_device.h",
|
||||
],
|
||||
srcs = [
|
||||
"tun_tap_device.cc",
|
||||
],
|
||||
)
|
||||
1
lib/tun_tap_device.cc
Normal file
1
lib/tun_tap_device.cc
Normal file
@@ -0,0 +1 @@
|
||||
#include "lib/tun_tap_device.h"
|
||||
21
lib/tun_tap_device.h
Normal file
21
lib/tun_tap_device.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <string>
|
||||
|
||||
#include <linux/if_tun.h>
|
||||
|
||||
class TapTunDevice {
|
||||
public:
|
||||
static const auto kTunFormat = IFF_TUN;
|
||||
static const auto kTapFormat = IFF_TAP;
|
||||
static const auto kNoPacketInfo = IFF_NO_PI;
|
||||
|
||||
TapTunDevice(const std::string& name, uint64_t flags);
|
||||
TapTunDevice(uint64_t flags);
|
||||
|
||||
const std::string& Name() {
|
||||
return name_;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string name_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user