From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 6A08CBDC2 for ; Thu, 4 Jun 2015 08:04:13 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 03 Jun 2015 23:04:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,551,1427785200"; d="scan'208";a="736840690" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 03 Jun 2015 23:04:12 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t5464Ab0009750; Thu, 4 Jun 2015 14:04:10 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t54648M5001752; Thu, 4 Jun 2015 14:04:10 +0800 Received: (from huilongx@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t54648x7001748; Thu, 4 Jun 2015 14:04:08 +0800 From: "huilong,xu" To: dts@dpdk.org Date: Thu, 4 Jun 2015 14:04:00 +0800 Message-Id: <1433397841-1704-3-git-send-email-huilongx.xu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1433397841-1704-1-git-send-email-huilongx.xu@intel.com> References: <1433397841-1704-1-git-send-email-huilongx.xu@intel.com> Subject: [dts] [PATCH V1 3/4] add nvgre protocol for scapy X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2015 06:04:13 -0000 From: huilong xu used function: 1. copy ./dep/nvgre.py to fedor layers in python install path eg: python2.7 default path: /usr/lib/python2.7/site-packages/scapy/layers/ 2. update scapy config file add "nvgre" to vlaue "load_layers" in scapy config file. eg: python2.7 default config file: /usr/lib/python2.7/site-packages/scapy/config.py Signed-off-by: huilong xu --- dep/nvgre.py | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) create mode 100644 dep/nvgre.py diff --git a/dep/nvgre.py b/dep/nvgre.py new file mode 100644 index 0000000..d844bd1 --- /dev/null +++ b/dep/nvgre.py @@ -0,0 +1,33 @@ +## This file is part of Scapy +## +## Copyright (C) Min Cao + +""" +NVGRE (Network Virtual GRE). +""" + +from scapy.packet import * +from scapy.fields import * +from scapy.layers.inet import UDP,IP +from scapy.layers.l2 import Ether + +IPPROTO_NVGRE=47 + +class NVGRE(Packet): + name = "Network Virtual GRE" + fields_desc = [BitField("c", 0, 1), + BitField("r", 0, 1), + BitField("k", 1, 1), + BitField("s", 0, 1), + BitField("reserved0", 0, 9), + BitField("ver", 0, 3), + XShortField("protocoltype", 0x6558), + X3BytesField("TNI", 1), + ByteField("reserved1", 0)] + def mysummary(self): + return self.sprintf("NVGRE (tni=%NVGRE.tni%)") + + +bind_layers(IP, NVGRE, proto=IPPROTO_NVGRE) +bind_layers(NVGRE, Ether) + -- 1.7.4.4