mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-08-28 18:15:41 +00:00
kvm tools: Add helper to return start address of TCP payload
uip_tcp_payload() returns start address of TCP payload in a TCP package. Signed-off-by: Asias He <asias.hejun@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
@@ -222,6 +222,11 @@ static inline u16 uip_tcp_payloadlen(struct uip_tcp *tcp)
|
||||
return uip_tcp_len(tcp) - uip_tcp_hdrlen(tcp);
|
||||
}
|
||||
|
||||
static inline u8 *uip_tcp_payload(struct uip_tcp *tcp)
|
||||
{
|
||||
return (u8 *)&tcp->sport + uip_tcp_hdrlen(tcp);
|
||||
}
|
||||
|
||||
static inline u16 uip_eth_hdrlen(struct uip_eth *eth)
|
||||
{
|
||||
return sizeof(*eth);
|
||||
|
||||
Reference in New Issue
Block a user