From 641346c15c0091d59259f6acc5f8789efe16c937 Mon Sep 17 00:00:00 2001 From: B3n30 Date: Sun, 9 Jul 2017 10:40:11 +0200 Subject: Network: Enable to send WifiPackets --- src/network/room_member.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/network/room_member.h') diff --git a/src/network/room_member.h b/src/network/room_member.h index f8bdbaea8..d23f5d4b6 100644 --- a/src/network/room_member.h +++ b/src/network/room_member.h @@ -12,6 +12,18 @@ namespace Network { +/// Information about the received WiFi packets. +/// Acts as our own 802.11 header. +struct WifiPacket { + enum class PacketType { Beacon, Data, Management }; + PacketType type; ///< The type of 802.11 frame, Beacon / Data. + std::vector data; ///< Raw 802.11 frame data, starting at the management frame header + /// for management frames. + MacAddress transmitter_address; ///< Mac address of the transmitter. + MacAddress destination_address; ///< Mac address of the receiver. + uint8_t channel; ///< WiFi channel where this frame was transmitted. +}; + /** * This is what a client [person joining a server] would use. * It also has to be used if you host a game yourself (You'd create both, a Room and a @@ -69,6 +81,12 @@ public: void Join(const std::string& nickname, const char* server_addr = "127.0.0.1", const u16 serverPort = DefaultRoomPort, const u16 clientPort = 0); + /** + * Sends a WiFi packet to the room. + * @param packet The WiFi packet to send. + */ + void SendWifiPacket(const WifiPacket& packet); + /** * Leaves the current room. */ -- cgit v1.2.3