#pragma once #include #include #if !defined(LINUX) #include #else // LINUX #include // Used for raw sockets #include // Used for raw sockets #include // Used for raw sockets #endif // LINUX #include #include #include #include #include // Used for raw sockets #include "TLayer.hh" #include "Params.hh" class OCTETSTRING; class PORT; class RawSocketLayer : public Layer, public PORT { Params _params; int _socket; std::string _time_key; struct ifreq _if_interface; struct ifreq _if_mac_addr; std::vector _mac_src; std::vector _mac_bc; std::vector _eth_type; public: RawSocketLayer(const std::string& p_type, const std::string& param); virtual ~RawSocketLayer(); virtual void sendData(OCTETSTRING& data, Params& params); virtual void receiveData(OCTETSTRING& data, Params& info); void Handle_Fd_Event_Readable(int fd); }; // End of class RawSocketLayer