* 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
| 100 | * The new ID of the packet. |
| 101 | */ |
| 102 | static inline void |
| 103 | update_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. |
no outgoing calls
no test coverage detected