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:
Asias He
2011-06-29 16:47:21 +08:00
committed by Will Deacon
parent 34be5efa92
commit d5768d2dff
+5
View File
@@ -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);