#pragma once #include #include #if (OSTYPE == linux) #include // Used for raw sockets #else #endif #include #include #include #include // Used for raw sockets #if (OSTYPE == linux) #include // Used for raw sockets #include // Used for raw sockets #else #endif #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; OCTETSTRING _mac_src; OCTETSTRING _mac_bc; OCTETSTRING _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