]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Add two helpers to return UDP {header, total} length
authorAsias He <asias.hejun@gmail.com>
Wed, 29 Jun 2011 08:47:14 +0000 (16:47 +0800)
committerPekka Enberg <penberg@kernel.org>
Thu, 30 Jun 2011 07:42:30 +0000 (10:42 +0300)
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/include/kvm/uip.h

index 473b9c74c1af7f8f85cccfe43496cd60a8f825b9..e79cc4ba5cad5a2de8e1a026c7d456253e746700 100644 (file)
@@ -141,6 +141,16 @@ static inline u16 uip_ip_len(struct uip_ip *ip)
        return htons(ip->len);
 }
 
+static inline u16 uip_udp_hdrlen(struct uip_udp *udp)
+{
+       return 8;
+}
+
+static inline u16 uip_udp_len(struct uip_udp *udp)
+{
+       return ntohs(udp->len);
+}
+
 int uip_tx_do_ipv4_icmp(struct uip_tx_arg *arg);
 int uip_tx_do_ipv4(struct uip_tx_arg *arg);
 int uip_tx_do_arp(struct uip_tx_arg *arg);