Home
last modified time | relevance | path

Searched refs:ipHeader (Results 1 – 1 of 1) sorted by relevance

/packages/modules/DnsResolver/tests/
Dtun_forwarder.cpp245 const iphdr* const ipHeader = reinterpret_cast<iphdr*>(ipv4Packet.base()); in validateIpv4Packet() local
246 if (ipHeader->ihl < 5) { in validateIpv4Packet()
249 if (ipHeader->ihl * 4 > ipv4Packet.size()) { in validateIpv4Packet()
250 return Error() << "IP header length set too large: " << ipHeader->ihl; in validateIpv4Packet()
252 if (ipHeader->version != 4) { in validateIpv4Packet()
253 return Error() << "IP header version not 4: " << ipHeader->version; in validateIpv4Packet()
255 if (mRulesIpv4.find({ipHeader->saddr, ipHeader->daddr}) == mRulesIpv4.end()) { in validateIpv4Packet()
259 switch (ipHeader->protocol) { in validateIpv4Packet()
261 return validateUdpPacket(drop(ipv4Packet, ipHeader->ihl * 4)); in validateIpv4Packet()
263 return validateTcpPacket(drop(ipv4Packet, ipHeader->ihl * 4)); in validateIpv4Packet()
[all …]