Home
last modified time | relevance | path

Searched refs:iphdr (Results 1 - 25 of 56) sorted by relevance

123

/third_party/lwip/src/core/ipv4/
H A Dip4.c310 * @param iphdr the IP header of the input packet
314 ip4_forward(struct pbuf *p, struct ip_hdr *iphdr, struct netif *inp) argument
352 IPH_TTL_SET(iphdr, IPH_TTL(iphdr) - 1);
354 if (IPH_TTL(iphdr) == 0) {
358 if (IPH_PROTO(iphdr) != IP_PROTO_ICMP) {
366 if (IPH_CHKSUM(iphdr) >= PP_HTONS(0xffffU - 0x100)) {
367 IPH_CHKSUM_SET(iphdr, (u16_t)(IPH_CHKSUM(iphdr) + PP_HTONS(0x100) + 1));
369 IPH_CHKSUM_SET(iphdr, (u16_
461 const struct ip_hdr *iphdr; global() local
886 struct ip_hdr *iphdr; global() local
1141 struct ip_hdr *iphdr = (struct ip_hdr *)p->payload; global() local
[all...]
H A Dicmp.c212 struct ip_hdr *iphdr = (struct ip_hdr *)p->payload; in icmp_input() local
213 ip4_addr_copy(iphdr->src, *src); in icmp_input()
214 ip4_addr_copy(iphdr->dest, *ip4_current_src_addr()); in icmp_input()
235 IPH_TTL_SET(iphdr, ICMP_TTL); in icmp_input()
236 IPH_CHKSUM_SET(iphdr, 0); in icmp_input()
239 IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, hlen)); in icmp_input()
343 struct ip_hdr *iphdr; in icmp_send_response() local
369 iphdr = (struct ip_hdr *)p->payload; in icmp_send_response()
371 ip4_addr_debug_print_val(ICMP_DEBUG, iphdr in icmp_send_response()
[all...]
H A Dip4_frag.c185 SMEMCPY(p->payload, &ipr->iphdr, IP_HLEN); in ip_reass_free_complete_datagram()
265 if (!IP_ADDRESSES_AND_ID_MATCH(&r->iphdr, fraghdr)) { in ip_reass_remove_oldest_datagram()
328 SMEMCPY(&(ipr->iphdr), fraghdr, IP_HLEN); in ip_reass_enqueue_new_datagram()
578 if (IP_ADDRESSES_AND_ID_MATCH(&ipr->iphdr, fraghdr)) { in ip4_reass()
595 ((lwip_ntohs(IPH_OFFSET(&ipr->iphdr)) & IP_OFFMASK) != 0)) { in ip4_reass()
596 /* ipr->iphdr is not the header from the first fragment, but fraghdr is in ip4_reass()
597 * -> copy fraghdr into ipr->iphdr since we want to have the header in ip4_reass()
600 SMEMCPY(&ipr->iphdr, fraghdr, IP_HLEN); in ip4_reass()
648 SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN); in ip4_reass()
769 struct ip_hdr *iphdr; in ip4_frag() local
[all...]
/third_party/lwip/test/unit/ip4/
H A Dtest_ip4.c29 struct ip_hdr *iphdr = (struct ip_hdr *)p->payload; in create_ip4_input_fragment() local
30 IPH_VHL_SET(iphdr, 4, sizeof(struct ip_hdr) / 4); in create_ip4_input_fragment()
31 IPH_TOS_SET(iphdr, 0); in create_ip4_input_fragment()
32 IPH_LEN_SET(iphdr, lwip_htons(p->tot_len)); in create_ip4_input_fragment()
33 IPH_ID_SET(iphdr, lwip_htons(ip_id)); in create_ip4_input_fragment()
35 IPH_OFFSET_SET(iphdr, lwip_htons(start / 8)); in create_ip4_input_fragment()
37 IPH_OFFSET_SET(iphdr, lwip_htons((start / 8) | IP_MF)); in create_ip4_input_fragment()
39 IPH_TTL_SET(iphdr, 5); in create_ip4_input_fragment()
40 IPH_PROTO_SET(iphdr, IP_PROTO_UDP); in create_ip4_input_fragment()
41 IPH_CHKSUM_SET(iphdr, in create_ip4_input_fragment()
[all...]
/foundation/communication/netmanager_base/services/netmanagernative/include/netsys/
H A Dclatd_packet_converter.h48 int32_t ConvertV4TpPacket(int pos, const iphdr *ipHeader, ip6_hdr *ip6Header, size_t tpLen, uint8_t v6TpProtocol);
50 int32_t ConvertV6TpPacket(int pos, const ip6_hdr *ip6Header, iphdr *ipHeader, size_t tpLen, uint8_t v4TpProtocol);
51 bool IsV4PacketValid(const iphdr *ipHeader, size_t packetSize);
53 void WriteIpv6Header(ip6_hdr *ip6Header, uint8_t tpProtocol, const iphdr *ipHeader);
54 void WriteIpv4Header(iphdr *ipHeader, uint8_t tpProtocol, const ip6_hdr *ip6Header);
57 size_t WriteFragHeader(ip6_frag *ip6FragHeader, ip6_hdr *ip6Header, const iphdr *ipHeader);
58 void ProcessFragHeader(const ip6_frag *ip6FragHeader, iphdr *ipHeader, uint8_t &v6TpProtocol,
60 uint32_t CalV4PseudoHeaderChecksum(const iphdr *ipHeader, uint16_t tpLen, uint8_t tpProtocol);
/foundation/communication/netmanager_base/services/netmanagernative/bpf/include/netfirewall/
H A Dnetfirewall_utils.h41 #define L4_NHOFF(ipv4) (L3_NHOFF + ((ipv4) ? sizeof(struct iphdr) : sizeof(struct ipv6hdr)))
63 struct iphdr iph = { 0 }; in is_l4_protocol()
64 bpf_skb_load_bytes(skb, l3_nhoff, &iph, sizeof(struct iphdr)); in is_l4_protocol()
126 struct iphdr iph = { 0 }; in load_l4_protocol()
127 bpf_skb_load_bytes(skb, l3_nhoff, &iph, sizeof(struct iphdr)); in load_l4_protocol()
157 struct iphdr iph = { 0 }; in load_l3_v4_addrs()
158 bpf_skb_load_bytes(skb, l3_nhoff, &iph, sizeof(struct iphdr)); in load_l3_v4_addrs()
/third_party/lwip/test/unit/tcp/
H A Dtcp_helper.c52 struct ip_hdr* iphdr; in tcp_create_segment_wnd() local
70 iphdr = (struct ip_hdr*)p->payload; in tcp_create_segment_wnd()
72 iphdr->dest.addr = ip_2_ip4(dst_ip)->addr; in tcp_create_segment_wnd()
73 iphdr->src.addr = ip_2_ip4(src_ip)->addr; in tcp_create_segment_wnd()
74 IPH_VHL_SET(iphdr, 4, IP_HLEN / 4); in tcp_create_segment_wnd()
75 IPH_TOS_SET(iphdr, 0); in tcp_create_segment_wnd()
76 IPH_LEN_SET(iphdr, htons(p->tot_len)); in tcp_create_segment_wnd()
77 IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN)); in tcp_create_segment_wnd()
256 struct ip_hdr *iphdr in test_tcp_input() local
[all...]
/device/soc/hisilicon/hi3861v100/sdk_liteos/third_party/lwip_sack/include/lwip/
H A Dip6_frag.h82 #define IPV6_FRAG_SRC(ipr) ((ipr)->iphdr->src)
83 #define IPV6_FRAG_DEST(ipr) ((ipr)->iphdr->dest)
92 struct ip6_hdr *iphdr; /* pointer to the first (original) IPv6 header */ member
H A Dnat64.h90 * iphdr : ip header
97 int nat64_ip4_input(struct pbuf *p, struct ip_hdr *iphdr, const struct netif *inp);
108 * iphdr : ip header
115 int nat64_ip6_input(struct pbuf *p, struct ip6_hdr *iphdr, const struct netif *inp);
H A Dip4_frag.h64 struct ip_hdr iphdr; member
H A Dip4.h120 err_t ip4_iphdr_chksum(struct ip_hdr *iphdr, struct netif *netif, u16_t *chksum);
/third_party/lwip/src/include/lwip/
H A Dip6_frag.h83 #define IPV6_FRAG_SRC(ipr) ((ipr)->iphdr->src)
84 #define IPV6_FRAG_DEST(ipr) ((ipr)->iphdr->dest)
93 struct ip6_hdr *iphdr; /* pointer to the first (original) IPv6 header */ member
H A Dip4_frag.h64 struct ip_hdr iphdr; member
/foundation/communication/netmanager_base/services/netmanagernative/src/netsys/
H A Dclatd_packet_converter.cpp88 const iphdr *ipHeader = reinterpret_cast<const iphdr *>(inputPacket); in ConvertV4Packet()
120 int32_t ClatdPacketConverter::ConvertV4TpPacket(int pos, const iphdr *ipHeader, ip6_hdr *ip6Header, size_t tpLen, in ConvertV4TpPacket()
166 iphdr ipHeader; in ConvertV6Packet()
168 iovBufLens_[pos] = sizeof(iphdr); in ConvertV6Packet()
192 ipHeader.check = CalChecksum(&ipHeader, sizeof(iphdr)); in ConvertV6Packet()
200 int32_t ClatdPacketConverter::ConvertV6TpPacket(int pos, const ip6_hdr *ip6Header, iphdr *ipHeader, size_t tpLen, in ConvertV6TpPacket()
231 ipHeader->check = CalChecksum(ipHeader, sizeof(iphdr)); in ConvertV6TpPacket()
236 bool ClatdPacketConverter::IsV4PacketValid(const iphdr *ipHeader, size_t packetSize) in IsV4PacketValid()
238 if (packetSize < sizeof(iphdr)) { in IsV4PacketValid()
[all...]
/third_party/lwip/src/netif/ppp/
H A Ddemand.c325 unsigned iphdr; local
342 iphdr = (pkt->data[4] & 15) << 2;
350 pkt_checksum = *((unsigned short *) (pkt->data+10+iphdr));
363 pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr));
393 *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum;
396 *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum;
409 ntohs(*( (short *) (pkt->data+iphdr+4))),
411 ntohs(*( (short *) (pkt->data+iphdr+6))));
/third_party/lwip/src/core/ipv6/
H A Dip6_frag.c188 if (pbuf_header_force(p, (s16_t)((u8_t*)p->payload - (u8_t*)ipr->iphdr))) { in ip6_reass_free_complete_datagram()
385 ipr->iphdr = ip_data.current_ip6_header; in ip6_reass()
532 ipr->iphdr = ip_data.current_ip6_header; in ip6_reass()
629 MEMMOVE((u8_t*)ipr->iphdr + sizeof(struct ip6_frag_hdr), ipr->iphdr, in ip6_reass()
630 (size_t)((u8_t*)p->payload - (u8_t*)ipr->iphdr)); in ip6_reass()
633 iphdr_ptr = (struct ip6_hdr*)((u8_t*)ipr->iphdr + in ip6_reass()
H A Dip6.c414 * @param iphdr the IPv6 header of the input packet
418 ip6_forward(struct pbuf *p, struct ip6_hdr *iphdr, struct netif *inp) argument
445 if (IP6H_NEXTH(iphdr) != IP6_NEXTH_ICMP6) {
477 IP6H_HOPLIM_SET(iphdr, IP6H_HOPLIM(iphdr) - 1);
479 if (IP6H_HOPLIM(iphdr) == 0) {
482 if (IP6H_NEXTH(iphdr) != IP6_NEXTH_ICMP6) {
493 if (IP6H_NEXTH(iphdr) != IP6_NEXTH_ICMP6) {
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/ap/
H A Dfils_hlp.c161 struct iphdr *iph; in fils_dhcp_handler()
482 const struct iphdr *iph; in fils_process_hlp_udp()
488 iph = (const struct iphdr *) pos; in fils_process_hlp_udp()
513 const struct iphdr *iph; in fils_process_hlp_ip()
518 iph = (const struct iphdr *) pos; in fils_process_hlp_ip()
/third_party/ltp/testcases/network/stress/ns-tools/
H A Dns-icmpv4_sender.c359 pkt_size = sizeof(struct iphdr) /* IP header */ in create_clean_packet()
367 pkt.hdr.ihl = sizeof(struct iphdr) / 4; in create_clean_packet()
390 sizeof(struct iphdr)); in create_clean_packet()
523 calc_checksum((u_int16_t *) & (pkt->hdr), sizeof(struct iphdr)); in thrust_fakes()
H A Dns-icmp_redirector.c390 +sizeof(struct iphdr) /* IPv4 header */ in return_icmp4_redirect()
406 sndip_p->hdr.ihl = sizeof(struct iphdr) / 4; in return_icmp4_redirect()
417 sizeof(struct iphdr)); in return_icmp4_redirect()
/foundation/communication/dhcp/test/unittest/services/dhcp_client/
H A Ddhcp_socket_test.cpp163 count = sizeof(struct iphdr) + sizeof(struct udphdr) - 1; in HWTEST_F()
166 count = sizeof(struct iphdr) + sizeof(struct udphdr); in HWTEST_F()
/foundation/communication/netmanager_base/test/netmanagernative/unittest/netsys_manager_test/
H A Dclatd_packet_converter_test.cpp184 MOCK_METHOD3(WriteFragHeader, size_t(ip6_frag *ip6FragHeader, ip6_hdr *ip6Header, const iphdr *ipHeader));
412 iphdr ipHeader{}; in HWTEST_F()
425 iphdr ipHeader{}; in HWTEST_F()
438 iphdr ipHeader{}; in HWTEST_F()
451 iphdr ipHeader{}; in HWTEST_F()
566 iphdr ipHeader; in HWTEST_F()
/third_party/libbpf/src/
H A Dbpf_helper_defs.h44 struct iphdr;
2508 * *iph_len* contains **sizeof**\ (**struct iphdr**) or
2735 * *iph_len* contains **sizeof**\ (**struct iphdr**) or
4595 static __s64 (*bpf_tcp_raw_gen_syncookie_ipv4)(struct iphdr *iph, struct tcphdr *th, __u32 th_len) = (void *) 204;
4640 static long (*bpf_tcp_raw_check_syncookie_ipv4)(struct iphdr *iph, struct tcphdr *th) = (void *) 206;
/device/soc/hisilicon/hi3861v100/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libc/musl/include/netinet/
H A Dip.h24 struct iphdr { struct
/third_party/musl/porting/liteos_a/kernel/include/netinet/
H A Dip.h24 struct iphdr { struct

Completed in 21 milliseconds

123