From patchwork Sun Jul 17 08:56:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 982902 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6H8xISA023321 for ; Sun, 17 Jul 2011 08:59:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753460Ab1GQI7L (ORCPT ); Sun, 17 Jul 2011 04:59:11 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:63499 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752130Ab1GQI7H (ORCPT ); Sun, 17 Jul 2011 04:59:07 -0400 Received: by mail-iw0-f174.google.com with SMTP id 6so2294615iwn.19 for ; Sun, 17 Jul 2011 01:59:06 -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=oAewK4vx5foZShLFYRX5x2XczCEiuQ+IZvVBVPFMtJk=; b=gHkTnndFfhl/nFKW83BbCtJuCgE25GugXRsbBIYloEEJBbiqAv30rUEDAQu+GVQtha 8dcPHvbjIuuu2SUiXpfJug6jrLrSKlzL110s945iPCLoQmsDT+VWG/Z5mh9TL2kjop01 GZs8wBRaD8mD2WoSYISbqVzDbDBxXgeo1fHuM= Received: by 10.42.133.8 with SMTP id f8mr6435374ict.176.1310893146940; Sun, 17 Jul 2011 01:59:06 -0700 (PDT) Received: from localhost.localdomain ([219.224.169.130]) by mx.google.com with ESMTPS id us2sm3593680icb.19.2011.07.17.01.59.03 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Jul 2011 01:59:06 -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 02/16] kvm tools: Introduce struct uip_dhcp Date: Sun, 17 Jul 2011 16:56:50 +0800 Message-Id: <1310893024-21615-3-git-send-email-asias.hejun@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1310893024-21615-1-git-send-email-asias.hejun@gmail.com> References: <1310893024-21615-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 (demeter2.kernel.org [140.211.167.43]); Sun, 17 Jul 2011 08:59:18 +0000 (UTC) struct uip_dhcp is used to present DHCP package Signed-off-by: Asias He --- tools/kvm/include/kvm/uip.h | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/tools/kvm/include/kvm/uip.h b/tools/kvm/include/kvm/uip.h index 8333004..c414267 100644 --- a/tools/kvm/include/kvm/uip.h +++ b/tools/kvm/include/kvm/uip.h @@ -29,6 +29,12 @@ #define UIP_TCP_FLAG_ACK 16 #define UIP_TCP_FLAG_URG 32 +#define UIP_DHCP_VENDOR_SPECIFIC_LEN 312 +#define UIP_DHCP_MACPAD_LEN 10 +#define UIP_DHCP_HOSTNAME_LEN 64 +#define UIP_DHCP_FILENAME_LEN 128 +#define UIP_DHCP_MAGIC_COOKIE_LEN 4 +#define UIP_DHCP_OPTION_LEN (UIP_DHCP_VENDOR_SPECIFIC_LEN - UIP_DHCP_MAGIC_COOKIE_LEN) /* * IP package maxium len == 64 KBytes * IP header == 20 Bytes @@ -126,6 +132,27 @@ struct uip_pseudo_hdr { u16 len; } __attribute__((packed)); +struct uip_dhcp { + struct uip_udp udp; + u8 msg_type; + u8 hardware_type; + u8 hardware_len; + u8 hops; + u32 id; + u16 time; + u16 flg; + u32 client_ip; + u32 your_ip; + u32 server_ip; + u32 agent_ip; + struct uip_eth_addr client_mac; + u8 pad[UIP_DHCP_MACPAD_LEN]; + u8 server_hostname[UIP_DHCP_HOSTNAME_LEN]; + u8 boot_filename[UIP_DHCP_FILENAME_LEN]; + u32 magic_cookie; + u8 option[UIP_DHCP_OPTION_LEN]; +} __attribute__((packed)); + struct uip_info { struct list_head udp_socket_head; struct list_head tcp_socket_head;