From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 2C1E1106B for ; Tue, 16 Jun 2015 08:17:32 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 15 Jun 2015 23:17:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,624,1427785200"; d="scan'208";a="508953011" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 15 Jun 2015 23:17:30 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t5G6HSMR018960; Tue, 16 Jun 2015 14:17:28 +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 t5G6HQ2s015732; Tue, 16 Jun 2015 14:17:28 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t5G6HQAR015728; Tue, 16 Jun 2015 14:17:26 +0800 From: Yong Liu To: dts@dpdk.org Date: Tue, 16 Jun 2015 14:17:23 +0800 Message-Id: <1434435443-15696-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dts] [PATCH] add scapy vxlan layer script 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 06:17:32 -0000 From: Marvin Liu diff --git a/dep/vxlan.py b/dep/vxlan.py new file mode 100644 index 0000000..e50d4b4 --- /dev/null +++ b/dep/vxlan.py @@ -0,0 +1,33 @@ +''' +Created on Jul 29, 2014 + +@author: yliu86 +''' +from scapy.packet import * +from scapy.fields import * +from scapy.layers.inet import UDP, IP +from scapy.layers.dns import DNS +from scapy.layers.l2 import Ether + +vxlanmagic = "0x8" + + +class Vxlan(Packet): + name = "Virtual eXtensible Local Area Network" + fields_desc = [ByteField("flag", 8), + X3BytesField("reserved1", 0), + X3BytesField("vni", 0), + ByteField("reserved2", 0)] + + def guess_payload_class(self, payload): + if self.flag == vxlanmagic: + return Vxlan + else: + return Packet.guess_payload_class(self, payload) + + def mysummary(self): + return self.sprintf("VXLAN (vni=%VXLAN.vni%)") + +split_layers(UDP, DNS, sport=53) +bind_layers(UDP, Vxlan, dport=4789) +bind_layers(Vxlan, Ether) -- 1.9.3