11 #include "RtosSemaphore.hpp"
15 friend class NetUdpSocket;
16 friend class NetTcpSocket;
18 static const uint16_t TIMEOUT_SLOT_RESOLVING = 20;
19 static const uint16_t RETRIES_SLOT_RESOLVING = 3;
20 static const uint16_t TIMEOUT_SLOT_VALID = 60 * 600;
21 typedef enum : uint16_t {
30 typedef struct tagSlot {
33 NetDefs::IP_ADDR ipAddr;
34 NetDefs::MAC_ADDR macAddr;
39 }__attribute__((packed)) SLOT;
41 static SLOT sSlots[NET_CFG_MAX_ARP_ENTRIES];
43 static SLOT* getFreeSlot();
44 static SLOT* getWaitingSlot(const NetDefs::IP_ADDR ipAddr);
45 static
bool checkCache(const NetDefs::IP_ADDR& ipAddr, NetDefs::MAC_ADDR& macAddr);
49 static
void processFrame(NetDefs::FRAME& frame, NetDefs::ARP_HEADER& header);
50 static
void send(NetDefs::FRAME& frame, const NetDefs::MAC_ADDR& macDst, const NetDefs::IP_ADDR& ipDst, const NetDefs::ARP_OPERATION op);
51 static
void swapHeader(NetDefs::ARP_HEADER& header);
52 static
bool resolve(NetDefs::IP_ADDR ipAddr, NetDefs::MAC_ADDR& macAddr);