[PATCH v2 16/31] kvm tools: Add helper to return start address of TCP payload

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



uip_tcp_payload() returns start address of TCP payload in a TCP package.

Signed-off-by: Asias He <asias.hejun@xxxxxxxxx>
---
 tools/kvm/include/kvm/uip.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/include/kvm/uip.h b/tools/kvm/include/kvm/uip.h
index 2ac48d7..a3fd1b0 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);
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux