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