56 if((u32Src == 0) && (u32Dst == 0) && (u16Len == 0) && (u8TOS == 0) && (u8TTL == 0) && (rules.empty()))
73 std::uint16_t u16Type)
107 if(u8TOS_ && (pHdr->
u8Ipv4tos != u8TOS_))
122 const int offset = ((pHdr->
u8Ipv4vhl & 0x0F) << 2);
124 return std::find_if(
rules_.begin(),
127 std::placeholders::_1,
128 static_cast<const std::uint8_t *>(buf) + offset,
~EthernetProtocolIPv4Rule()
std::list< IPProtocolRule * > IPProtocolRules
virtual bool match(const void *buf, std::size_t len, std::uint16_t u16Type)=0
const std::uint16_t IPV4_HEADER_LEN
ipv4 header len without options
constexpr std::uint16_t HTONS(std::uint16_t x)
EthernetProtocolIPv4Rule(std::uint32_t u32Src, std::uint32_t u32Dst, std::uint16_t u16Len, std::uint8_t u8TOS, std::uint8_t u8TTL, const IPProtocolRules &rules)
bool match(const void *buf, std::size_t len, std::uint16_t u16Type) override
const std::uint16_t ETH_P_IPV4
Ethernet ipv4 protocol.