From: Asias He Date: Wed, 29 Jun 2011 08:47:21 +0000 (+0800) Subject: kvm tools: Add helper to return start address of TCP payload X-Git-Tag: next-20110824~3^2~171 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e051b5422ff7725e6024406b06664b4bae625b7e;p=karo-tx-linux.git 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 Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/include/kvm/uip.h b/tools/kvm/include/kvm/uip.h index 2ac48d7eb6f3..a3fd1b071a87 100644 --- a/tools/kvm/include/kvm/uip.h +++ b/tools/kvm/include/kvm/uip.h @@ -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);