MCPcopy Create free account
hub / github.com/F-Stack/f-stack / update_ipv4_header

Function update_ipv4_header

dpdk/lib/gso/gso_common.h:102–111  ·  view source on GitHub ↗

* Internal function which updates the IPv4 header of a packet, following * segmentation. This is required to update the header's 'total_length' field, * to reflect the reduced length of the now-segmented packet. Furthermore, the * header's 'packet_id' field must be updated to reflect the new ID of the * now-segmented packet. * * @param pkt * The packet containing the IPv4 header. * @param

Source from the content-addressed store, hash-verified

100 * The new ID of the packet.
101 */
102static inline void
103update_ipv4_header(struct rte_mbuf *pkt, uint16_t l3_offset, uint16_t id)
104{
105 struct rte_ipv4_hdr *ipv4_hdr;
106
107 ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
108 l3_offset);
109 ipv4_hdr->total_length = rte_cpu_to_be_16(pkt->pkt_len - l3_offset);
110 ipv4_hdr->packet_id = rte_cpu_to_be_16(id);
111}
112
113/**
114 * Internal function which divides the input packet into small segments.

Callers 3

update_ipv4_tcp_headersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected