41 bBroadcastMode_(false),
57 "TRANSPORTI %03d EthernetTransport::%s len %zd < min eth header len %d",
77 switch(u16ethProtocol)
87 "TRANSPORTI %03d EthernetTransport::%s ipv4, len %zu < min len %d",
111 "TRANSPORTI %03d EthernetTransport::%s ipv6, len %zu < min len %d",
134 ERROR_LEVEL,
"TRANSPORTI %03d EthernetTransport::%s arp, len %zu < len %d",
153 DEBUG_LEVEL,
"TRANSPORTI %03d EthernetTransport::%s allow unknown protocol %02X",
167 NEMId & rNemDestination,
168 std::uint8_t & rDspc)
173 switch(u16ethProtocol)
263 "TRANSPORTI %03d EthernetTransport::%s allow unknown protocol %02X",
312 switch(u16ethProtocol)
338 const std::uint8_t icmpv6Type = pICMP6Header->
u8Type;
355 std::lock_guard<std::mutex> m(mutex_);
357 const auto iter = macCache_.find(addr);
360 if(iter == macCache_.end())
362 macCache_.insert(std::make_pair(addr, nemId));
366 "TRANSPORTI %03d ARPCache::%s added cache entry %s to nem %hu",
374 if(iter->second != nemId)
378 "TRANSPORTI %03d ARPCache::%s updated cache entry %s from nem %hu to nem %hu",
382 iter->second, nemId);
384 iter->second = nemId;
393 std::lock_guard<std::mutex> m(mutex_);
395 const auto iter = macCache_.find(*pEtherAddr);
398 if(iter == macCache_.end())
402 "TRANSPORTI %03d EthernetTransport::%s no nem found for %s, using broadcast mac address",
413 "TRANSPORTI %03d EthernetTransport::%s nem %hu found for %s, using %hu",
const std::uint16_t ETH_P_ARP
Ethernet arp protocol.
const std::uint16_t ETH_P_IPV6
Ethernet ipv6 protocol.
struct EtherAddrWords words
Base class for all transports.
#define LOGGER_VERBOSE_LOGGING(logger, level, fmt, args...)
std::uint16_t get_code(const EtherArpHeader *arp)
constexpr NEMId NEM_BROADCAST_MAC_ADDRESS
std::uint16_t get_protocol(const EtherHeader *eth)
virtual int parseFrame(const Utils::EtherHeader *pEthHeader, EMANE::NEMId &dst, std::uint8_t &dscp)
const std::uint16_t ETHARP_HEADER_LEN
Ethernet Arp header length.
std::uint16_t ethaddr4_to_id(const EtherAddr *addr)
const std::uint16_t ETH_ARPOP_REPLY
Ethernet arp reply.
Definition of the ethernet frame address as an array of 6 bytes or set of 3 words.
const EtherAddr * get_srchwaddr(const EtherArpHeader *arp)
const std::uint8_t IP6_ICMP_NEIGH_ADVERT
IPv6 ICMP Neighbor Advertisement.
EMANE::NEMId lookupArpCache(const Utils::EtherAddr *pEthAddr)
const std::uint16_t IPV4_HEADER_LEN
ipv4 header len without options
void addEntry(const Utils::EtherAddr &addr, EMANE::NEMId nemId)
std::uint16_t ethaddr6_to_id(const EtherAddr *addr)
const std::uint16_t ETH_ARPOP_REQUEST
Ethernet arp request.
virtual int verifyFrame(const void *buf, size_t len)
std::string ethaddr_to_string(const EtherAddr *addr)
const std::uint8_t IPV6_P_ICMP
IPv6 ICMP Protocol.
std::uint8_t get_dscp(const Ip4Header *ip)
EthernetTransport(EMANE::NEMId id, EMANE::PlatformServiceProvider *pPlatformService)
const std::uint16_t ETH_HEADER_LEN
Ethernet header length.
#define LOGGER_STANDARD_LOGGING(logger, level, fmt, args...)
void updateArpCache(const Utils::EtherHeader *pEthHeader, EMANE::NEMId nemId)
const std::uint8_t IP6_ICMP_NEIGH_SOLICIT
IPv6 ICMP Neighbor Soliciation.
const std::uint16_t ETH_P_IPV4
Ethernet ipv4 protocol.
const std::uint16_t IPV6_HEADER_LEN
ipv6 header len