|
|
1.1 root 1: //
2: // nono
1.1.1.2 root 3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
1.1 root 5: //
6:
1.1.1.5 root 7: //
8: // ホストネットワークの tap ドライバ
9: //
10:
1.1 root 11: #pragma once
12:
13: #include "netdriver.h"
14:
15: class NetDriverTap : public NetDriver
16: {
1.1.1.2 root 17: using inherited = NetDriver;
1.1 root 18: public:
1.1.1.5 root 19: NetDriverTap(HostDevice *hostdev_, const std::string& devpath_);
1.1.1.2 root 20: ~NetDriverTap() override;
1.1 root 21:
1.1.1.4 root 22: bool InitDriver() override;
1.1.1.5 root 23: int Read(NetPacket *p) override;
24: void Write(const void *buf, int buflen) override;
1.1.1.4 root 25:
1.1.1.6 ! root 26: void MonitorUpdateMD(TextScreen&, int y) override;
1.1 root 27:
28: private:
1.1.1.3 root 29: #if defined(__linux__)
30: bool OpenLinux();
31: #endif
32: bool OpenDirect();
33: bool OpenNumbered();
34: bool OpenCloning();
35:
1.1.1.2 root 36: void Close();
1.1.1.3 root 37:
1.1.1.4 root 38: // デバイスファイルパス
39: std::string devpath {};
1.1 root 40: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.