Home
last modified time | relevance | path

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

/packages/modules/Connectivity/bpf_progs/
Dclatd.c96 if (ntohs(ip6->payload_len) > 0xFFFF - sizeof(struct iphdr)) return TC_ACT_PIPE; in nat64()
116 __u16 tot_len = ntohs(ip6->payload_len) + sizeof(struct iphdr); // cannot overflow, see above in nat64()
139 if (tot_len < sizeof(struct iphdr)) return TC_ACT_PIPE; in nat64()
164 struct iphdr ip = { in nat64()
166 .ihl = sizeof(struct iphdr) / sizeof(__u32), // u4 in nat64()
245 try_make_writable(skb, l2_header_size + sizeof(struct iphdr)); in nat64()
253 if (data + l2_header_size + sizeof(struct iphdr) > data_end) return TC_ACT_SHOT; in nat64()
262 *(struct iphdr*)(new_eth + 1) = ip; in nat64()
265 *(struct iphdr*)data = ip; in nat64()
307 try_make_writable(skb, sizeof(struct iphdr));
[all …]
Dtest.c64 struct iphdr *ip = data + hsize;
65 hsize += sizeof(struct iphdr);
Dtest@mainline.c64 struct iphdr *ip = data + hsize;
65 hsize += sizeof(struct iphdr);
DdscpPolicy.c37 #define IP4_OFFSET(field, header) ((header) + offsetof(struct iphdr, field))
68 const struct iphdr* const iph = (void*)(eth + 1); in DEFINE_BPF_MAP_GRW()
69 hdr_size = l2_header_size + sizeof(struct iphdr); in DEFINE_BPF_MAP_GRW()
Doffload.c59 #define IP4_HLEN sizeof(struct iphdr)
69 #define IP4_OFFSET(field) offsetof(struct iphdr, field)
364 struct ethhdr* eth, struct iphdr* ip, const struct rawip_bool rawip, in do_forward4_bottom()
456 const int tcp4_overhead = sizeof(struct iphdr) + sizeof(struct tcphdr) + 12; in do_forward4_bottom()
580 struct iphdr* ip = is_ethernet ? (void*)(eth + 1) : data; in do_forward4()
Doffload@mainline.c59 #define IP4_HLEN sizeof(struct iphdr)
69 #define IP4_OFFSET(field) offsetof(struct iphdr, field)
364 struct ethhdr* eth, struct iphdr* ip, const struct rawip_bool rawip, in do_forward4_bottom()
456 const int tcp4_overhead = sizeof(struct iphdr) + sizeof(struct tcphdr) + 12; in do_forward4_bottom()
580 struct iphdr* ip = is_ethernet ? (void*)(eth + 1) : data; in do_forward4()
Dbpf_net_helpers.h33 #define IP4_OFFSET(field) offsetof(struct iphdr, field)
Dnetd.c200 int ip_overhead = (is_ipv6 ? sizeof(struct ipv6hdr) : sizeof(struct iphdr)); \ in DEFINE_BPF_MAP_RO_NETD()
/packages/modules/Connectivity/clatd/
Dtranslate.h47 void fill_ip_header(struct iphdr *ip_targ, uint16_t payload_len, uint8_t protocol,
50 const struct iphdr *old_header);
61 const struct iphdr *old_header);
62 uint8_t parse_frag_header(const struct ip6_frag *frag_hdr, struct iphdr *ip_targ);
66 const struct iphdr *old_header);
67 uint8_t parse_frag_header(const struct ip6_frag *frag_hdr, struct iphdr *ip_targ);
Dclatd_test.cpp187 int is_ipv4_fragment(struct iphdr *ip) { in is_ipv4_fragment()
201 int ipv4_fragment_offset(struct iphdr *ip) { in ipv4_fragment_offset()
217 struct iphdr *ip = (struct iphdr *)packet; in check_packet()
296 struct iphdr *ip = nullptr; in reassemble_packet()
312 struct iphdr *ip_orig = (struct iphdr *)packet; in reassemble_packet()
322 ip = (struct iphdr *)reassembled; in reassemble_packet()
409 struct iphdr *ip = (struct iphdr *)packet; in fix_udp_checksum()
525 struct iphdr *ip; in get_transport_checksum()
533 ip = (struct iphdr *)packet; in get_transport_checksum()
613 ASSERT_EQ(sizeof(struct iphdr), sizeof(v4_header)) << "Test IPv4 header: incorrect length\n"; in TEST_F()
[all …]
Ddump.h29 void dump_ip(struct iphdr *header);
31 void dump_udp(const struct udphdr *udp, const struct iphdr *ip, const uint8_t *payload,
33 void dump_tcp(const struct tcphdr *tcp, const struct iphdr *ip, const uint8_t *payload,
Dtranslate.c124 void fill_ip_header(struct iphdr *ip, uint16_t payload_len, uint8_t protocol, in fill_ip_header()
127 memset(ip, 0, sizeof(struct iphdr)); in fill_ip_header()
132 ip->tot_len = htons(sizeof(struct iphdr) + payload_len); in fill_ip_header()
159 const struct iphdr *old_header) { in fill_ip6_header()
180 const struct iphdr *old_header) { in maybe_fill_frag_header()
208 uint8_t parse_frag_header(const struct ip6_frag *frag_hdr, struct iphdr *ip_targ) { in parse_frag_header()
497 char iphdr[sizeof(struct ip6_hdr)]; in translate_packet() local
507 { iphdr, 0 }, // IP header. in translate_packet()
Dipv6.c79 struct iphdr *ip_targ = (struct iphdr *)out[pos].iov_base; in ipv6_packet()
122 out[pos].iov_len = sizeof(struct iphdr); in ipv6_packet()
176 ip_targ->check = ip_checksum(ip_targ, sizeof(struct iphdr)); in ipv6_packet()
Dipv4.c58 const struct iphdr *header = (struct iphdr *)packet; in ipv4_packet()
68 if (len < sizeof(struct iphdr)) { in ipv4_packet()
Ddump.c42 void dump_ip(struct iphdr *header) { in dump_ip()
151 void dump_udp(const struct udphdr *udp, const struct iphdr *ip, const uint8_t *payload, in dump_udp()
209 void dump_tcp(const struct tcphdr *tcp, const struct iphdr *ip, const uint8_t *payload, in dump_tcp()
/packages/modules/Connectivity/staticlibs/native/bpf_headers/include/bpf/
DBpfClassic.h95 _Static_assert(field_sizeof(struct iphdr, field) == 1, "field of wrong size"); \
96 offsetof(iphdr, field); \
102 _Static_assert(field_sizeof(struct iphdr, field) == 2, "field of wrong size"); \
103 offsetof(iphdr, field); \
109 _Static_assert(field_sizeof(struct iphdr, field) == 4, "field of wrong size"); \
110 offsetof(iphdr, field); \
/packages/modules/DnsResolver/tests/
Dtun_forwarder.cpp47 static constexpr ssize_t IP4_HDRLEN = sizeof(struct iphdr);
245 const iphdr* const ipHeader = reinterpret_cast<iphdr*>(ipv4Packet.base()); in validateIpv4Packet()
327 iphdr* ipHeader = reinterpret_cast<iphdr*>(ipv4Packet.base()); in translateIpv4Packet()
343 ipHeader->check = ip_checksum(ipHeader, sizeof(struct iphdr)); in translateIpv4Packet()
/packages/modules/Connectivity/staticlibs/native/ip_checksum/
Dchecksum.h27 uint32_t ipv4_pseudo_header_checksum(const struct iphdr* ip, uint16_t len);
Dchecksum.c100 uint32_t ipv4_pseudo_header_checksum(const struct iphdr* ip, uint16_t len) { in ipv4_pseudo_header_checksum()