From patchwork Thu Jun 30 08:41:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 932292 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 p5U8iqaT003783 for ; Thu, 30 Jun 2011 08:44:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758847Ab1F3Iou (ORCPT ); Thu, 30 Jun 2011 04:44:50 -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 S1758793Ab1F3Iot (ORCPT ); Thu, 30 Jun 2011 04:44:49 -0400 Received: by mail-iy0-f174.google.com with SMTP id 12so1722525iyb.19 for ; Thu, 30 Jun 2011 01:44:48 -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=334GVDLrw/t06v6hsTl+6TZ795ESzAnWukCWDYqRVtA=; b=eOi0C2aJ3UZnOPM7a4A/J4iiryRKC03VDFLSfg7HgHUSi06XBgBNePFiP/i1v9kA+t FX/6IwZAVcLQ8OP/XTGlx2Ss6BE1hOVDZbOTbvnuDreehWxDPwbChXqD32P6Ctjw/HLL 7IdofYssBfsAq8HeNZsL/eoVQgcz81sDEtaws= Received: by 10.42.197.199 with SMTP id el7mr1794586icb.237.1309423488841; Thu, 30 Jun 2011 01:44:48 -0700 (PDT) Received: from localhost.localdomain ([219.224.169.130]) by mx.google.com with ESMTPS id d6sm1967338icx.1.2011.06.30.01.44.44 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 30 Jun 2011 01:44:48 -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 14/31] kvm tools: Introduce struct uip_tcp_socket Date: Thu, 30 Jun 2011 16:41:02 +0800 Message-Id: <1309423279-3093-15-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:52 +0000 (UTC) struct uip_tcp_socket is used to present every session between guest and remote host. Signed-off-by: Asias He --- tools/kvm/include/kvm/uip.h | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/tools/kvm/include/kvm/uip.h b/tools/kvm/include/kvm/uip.h index 1368694..a772fdf 100644 --- a/tools/kvm/include/kvm/uip.h +++ b/tools/kvm/include/kvm/uip.h @@ -153,6 +153,28 @@ struct uip_udp_socket { int fd; }; +struct uip_tcp_socket { + struct sockaddr_in addr; + struct list_head list; + struct uip_info *info; + pthread_mutex_t *lock; + pthread_t thread; + u32 dport, sport; + u32 guest_acked; + /* + * Initial Sequence Number + */ + u32 isn_server; + u32 isn_guest; + u32 ack_server; + u32 seq_server; + int write_done; + int read_done; + u32 dip, sip; + u8 *payload; + int fd; +}; + struct uip_tx_arg { struct virtio_net_hdr *vnet; struct uip_info *info;