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

Function update_tcp_header

dpdk/lib/gso/gso_common.h:74–86  ·  view source on GitHub ↗

* Internal function which updates the TCP header of a packet, following * segmentation. This is required to update the header's 'sent' sequence * number, and also to clear 'PSH' and 'FIN' flags for non-tail segments. * * @param pkt * The packet containing the TCP header. * @param l4_offset * The offset of the TCP header from the start of the packet. * @param sent_seq * The sent sequenc

Source from the content-addressed store, hash-verified

72 * Indicates whether or not this is a tail segment.
73 */
74static inline void
75update_tcp_header(struct rte_mbuf *pkt, uint16_t l4_offset, uint32_t sent_seq,
76 uint8_t non_tail)
77{
78 struct rte_tcp_hdr *tcp_hdr;
79
80 tcp_hdr = (struct rte_tcp_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
81 l4_offset);
82 tcp_hdr->sent_seq = rte_cpu_to_be_32(sent_seq);
83 if (likely(non_tail))
84 tcp_hdr->tcp_flags &= (~(TCP_HDR_PSH_MASK |
85 TCP_HDR_FIN_MASK));
86}
87
88/**
89 * Internal function which updates the IPv4 header of a packet, following

Callers 2

update_ipv4_tcp_headersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected