From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 71067C322 for ; Tue, 16 Jun 2015 07:33:01 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 15 Jun 2015 22:33:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,623,1427785200"; d="scan'208";a="588563864" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 15 Jun 2015 22:33:00 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t5G5WwF4032055; Tue, 16 Jun 2015 13:32:58 +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 t5G5WuCR014624; Tue, 16 Jun 2015 13:32:58 +0800 Received: (from huilongx@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t5G5WuS8014620; Tue, 16 Jun 2015 13:32:56 +0800 From: "huilong,xu" To: dts@dpdk.org Date: Tue, 16 Jun 2015 13:32:49 +0800 Message-Id: <1434432771-14576-3-git-send-email-huilongx.xu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1434432771-14576-1-git-send-email-huilongx.xu@intel.com> References: <1434432771-14576-1-git-send-email-huilongx.xu@intel.com> Subject: [dts] [PATCH V3 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: Tue, 16 Jun 2015 05:33:01 -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