|
|
1.1 root 1: //
2: // nono
3: // Copyright (C) 2021 nono project
4: // Licensed under nono-license.txt
5: //
6:
1.1.1.2 root 7: //
8: // ホストネットワークの AF_PACKET ドライバ
9: // (Linux 専用)
10: //
1.1 root 11:
12: #pragma once
13:
14: #include "netdriver.h"
15: #include <sys/socket.h>
16: #include <netpacket/packet.h>
17: #include <net/ethernet.h>
18:
19: class NetDriverAFPacket : public NetDriver
20: {
21: using inherited = NetDriver;
22: public:
1.1.1.2 root 23: NetDriverAFPacket(HostDevice *hostdev_, const std::string& ifname_);
1.1 root 24: ~NetDriverAFPacket() override;
25:
1.1.1.4 root 26: bool InitDriver(bool startup) override;
1.1.1.2 root 27: int Read(NetPacket *p) override;
28: void Write(const void *buf, int buflen) override;
1.1 root 29:
1.1.1.5 ! root 30: void MonitorScreenMD(TextScreen&, int y) override;
1.1 root 31:
32: private:
33: void Close();
34:
1.1.1.2 root 35: // インタフェース番号を返す
1.1 root 36: int SelectInterface();
37:
38: sockaddr_ll sll {};
39: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.