Lines Matching refs:ipv4_hdr
44 struct net_ipv4_hdr *ipv4_hdr; in net_ipv4_create_full() local
46 ipv4_hdr = (struct net_ipv4_hdr *)net_pkt_get_data(pkt, &ipv4_access); in net_ipv4_create_full()
47 if (!ipv4_hdr) { in net_ipv4_create_full()
51 ipv4_hdr->vhl = 0x45; in net_ipv4_create_full()
52 ipv4_hdr->tos = tos; in net_ipv4_create_full()
53 ipv4_hdr->len = 0U; in net_ipv4_create_full()
54 ipv4_hdr->id[0] = id >> 8; in net_ipv4_create_full()
55 ipv4_hdr->id[1] = id; in net_ipv4_create_full()
56 ipv4_hdr->offset[0] = (offset >> 8) | (flags << 5); in net_ipv4_create_full()
57 ipv4_hdr->offset[1] = offset; in net_ipv4_create_full()
59 ipv4_hdr->ttl = net_pkt_ipv4_ttl(pkt); in net_ipv4_create_full()
60 if (ipv4_hdr->ttl == 0U) { in net_ipv4_create_full()
63 ipv4_hdr->ttl = in net_ipv4_create_full()
66 ipv4_hdr->ttl = net_if_ipv4_get_mcast_ttl(net_pkt_iface(pkt)); in net_ipv4_create_full()
70 ipv4_hdr->ttl = in net_ipv4_create_full()
73 ipv4_hdr->ttl = net_if_ipv4_get_ttl(net_pkt_iface(pkt)); in net_ipv4_create_full()
78 ipv4_hdr->proto = 0U; in net_ipv4_create_full()
79 ipv4_hdr->chksum = 0U; in net_ipv4_create_full()
81 net_ipv4_addr_copy_raw(ipv4_hdr->dst, (uint8_t *)dst); in net_ipv4_create_full()
82 net_ipv4_addr_copy_raw(ipv4_hdr->src, (uint8_t *)src); in net_ipv4_create_full()
111 struct net_ipv4_hdr *ipv4_hdr; in net_ipv4_finalize() local
115 ipv4_hdr = (struct net_ipv4_hdr *)net_pkt_get_data(pkt, &ipv4_access); in net_ipv4_finalize()
116 if (!ipv4_hdr) { in net_ipv4_finalize()
122 ipv4_hdr->vhl = 0x40 | (0x0F & in net_ipv4_finalize()
128 ipv4_hdr->len = htons(net_pkt_get_len(pkt)); in net_ipv4_finalize()
129 ipv4_hdr->proto = next_header_proto; in net_ipv4_finalize()
132 ipv4_hdr->chksum = net_calc_chksum_ipv4(pkt); in net_ipv4_finalize()