From patchwork Thu Jun 30 08:40:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 932242 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 p5U8iWJ1031627 for ; Thu, 30 Jun 2011 08:44:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755868Ab1F3Io0 (ORCPT ); Thu, 30 Jun 2011 04:44:26 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:43568 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751611Ab1F3IoW (ORCPT ); Thu, 30 Jun 2011 04:44:22 -0400 Received: by mail-iw0-f174.google.com with SMTP id 6so1718423iwn.19 for ; Thu, 30 Jun 2011 01:44:22 -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=LNkTyE3hyM8FxKRNQU8PGUB1g2t9+PT83hshTdHt0g0=; b=Y1fa+ADqxzj9VHI1U8+ZQVdoYGOo/tT9MGSvEeufI9x/O/ez5HB013A4Jd6GuEj+Vv 1SQEUaORABMR+JJUjC7DggAaD0U5sLybH2C4p/34HITJa6nhpMPWkrWWucoOxhz1K+qu iqyDLPV2ww62nwejTx1T4eUH+h3uFy6K5Zvjg= Received: by 10.42.244.200 with SMTP id lr8mr1733529icb.481.1309423462020; Thu, 30 Jun 2011 01:44:22 -0700 (PDT) Received: from localhost.localdomain ([219.224.169.130]) by mx.google.com with ESMTPS id d6sm1967338icx.1.2011.06.30.01.44.18 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 30 Jun 2011 01:44:21 -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 08/31] kvm tools: Introduce struct uip_udp_socket Date: Thu, 30 Jun 2011 16:40:56 +0800 Message-Id: <1309423279-3093-9-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:32 +0000 (UTC) struct uip_udp_socket is used to present every "connection" between guest and remote host. Signed-off-by: Asias He --- tools/kvm/include/kvm/uip.h | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/tools/kvm/include/kvm/uip.h b/tools/kvm/include/kvm/uip.h index 35c7c23..473b9c7 100644 --- a/tools/kvm/include/kvm/uip.h +++ b/tools/kvm/include/kvm/uip.h @@ -114,6 +114,15 @@ struct uip_buf { int id; }; +struct uip_udp_socket { + struct sockaddr_in addr; + struct list_head list; + pthread_mutex_t *lock; + u32 dport, sport; + u32 dip, sip; + int fd; +}; + struct uip_tx_arg { struct virtio_net_hdr *vnet; struct uip_info *info;