From patchwork Thu Jun 30 08:40:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 932252 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5U8iWJ2031627 for ; Thu, 30 Jun 2011 08:44:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758777Ab1F3Io3 (ORCPT ); Thu, 30 Jun 2011 04:44:29 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:59621 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758767Ab1F3Io0 (ORCPT ); Thu, 30 Jun 2011 04:44:26 -0400 Received: by mail-iy0-f174.google.com with SMTP id 12so1722525iyb.19 for ; Thu, 30 Jun 2011 01:44:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=RgADw/qKzNe9vDpuAEgXEjZ1GMb5mFvZolg7Sbhyku8=; b=SX0nQR29sJinGtP99pN0FM196TKuQOBTVjfH+kNQs+DhWDjQFtuaA/dMx6Y+M6Thm2 /DHzpoDdImjuH7JDucEi/ZNm8Bz0I/tvhvFJH23zkYcRShUDUao0mqtH/aZk8xKgYysX 0/nwcX6GCyAVbycZZht+9czmSMqLcVm7W3J4s= Received: by 10.42.108.68 with SMTP id g4mr2034103icp.410.1309423466310; Thu, 30 Jun 2011 01:44:26 -0700 (PDT) Received: from localhost.localdomain ([219.224.169.130]) by mx.google.com with ESMTPS id d6sm1967338icx.1.2011.06.30.01.44.22 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 30 Jun 2011 01:44:25 -0700 (PDT) From: Asias He To: Pekka Enberg Cc: Cyrill Gorcunov , Ingo Molnar , Sasha Levin , Prasad Joshi , kvm@vger.kernel.org, Asias He Subject: [PATCH v2 09/31] kvm tools: Add two helpers to return UDP {header, total} length Date: Thu, 30 Jun 2011 16:40:57 +0800 Message-Id: <1309423279-3093-10-git-send-email-asias.hejun@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1309423279-3093-1-git-send-email-asias.hejun@gmail.com> References: <1309423279-3093-1-git-send-email-asias.hejun@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 30 Jun 2011 08:44:33 +0000 (UTC) Signed-off-by: Asias He --- tools/kvm/include/kvm/uip.h | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/tools/kvm/include/kvm/uip.h b/tools/kvm/include/kvm/uip.h index 473b9c7..e79cc4b 100644 --- a/tools/kvm/include/kvm/uip.h +++ b/tools/kvm/include/kvm/uip.h @@ -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);