test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yufen Mo <yufengx.mo@intel.com>
To: dts@dpdk.org
Cc: yufengmx <yufengx.mo@intel.com>
Subject: [dts] [PATCH V3 1/2] add sctp/gre format support in framework/packet module
Date: Thu, 18 Aug 2016 14:25:13 +0800	[thread overview]
Message-ID: <1471501514-25051-2-git-send-email-yufengx.mo@intel.com> (raw)
In-Reply-To: <1471501514-25051-1-git-send-email-yufengx.mo@intel.com>

From: yufengmx <yufengx.mo@intel.com>


Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 framework/packet.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/framework/packet.py b/framework/packet.py
index 6c892e5..93d6879 100755
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -276,12 +276,24 @@ class scapy(object):
         if chksum is not None:
             pkt_layer.chksum = chksum
 
+    def sctp(self, pkt_layer, src=53, dst=53, len=None, chksum=None):
+        pkt_layer.sport = src
+        pkt_layer.dport = dst
+        if len is not None:
+            pkt_layer.len = len
+        if chksum is not None:
+            pkt_layer.chksum = chksum
+
     def raw(self, pkt_layer, payload=None):
         if payload is not None:
             pkt_layer.load = ''
             for hex1, hex2 in payload:
                 pkt_layer.load += struct.pack("=B", int('%s%s' %(hex1, hex2), 16))
 
+    def gre(self, pkt_layer, proto=None):
+        if proto is not None:
+            pkt_layer.proto = proto
+
     def vxlan(self, pkt_layer, vni=0):
         pkt_layer.vni = vni
 
@@ -472,9 +484,11 @@ class Packet(object):
             'VLAN': 'vlan',
             'ETAG': 'etag',
             'IP': 'ipv4',
+            'IPv4-TUNNEL':'inner_ipv4',
             'IPihl': 'ipv4ihl',
             'IPFRAG': 'ipv4_ext',
             'IPv6': 'ipv6',
+            'IPv6-TUNNEL':'inner_ipv6',
             'IPv6FRAG': 'ipv6_frag',
             'IPv6EXT': 'ipv6_ext',
             'IPv6EXT2': 'ipv6_ext2',
@@ -593,6 +607,12 @@ class Packet(object):
     def _config_layer_tcp(self, pkt_layer, config):
         return self.pktgen.tcp(pkt_layer, **config)
 
+    def _config_layer_sctp(self, pkt_layer, config):
+        return self.pktgen.sctp(pkt_layer, **config)
+
+    def _config_layer_gre(self, pkt_layer, config):
+        return self.pktgen.gre(pkt_layer, **config)
+
     def _config_layer_raw(self, pkt_layer, config):
         return self.pktgen.raw(pkt_layer, **config)
 
-- 
1.9.3

  reply	other threads:[~2016-08-18  6:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-18  6:25 [dts] [PATCH V3 0/2] IPGRE: update automation testing script Yufen Mo
2016-08-18  6:25 ` Yufen Mo [this message]
2016-08-18  6:25 ` [dts] [PATCH V3 2/2] Ipgre: upload " Yufen Mo
  -- strict thread matches above, loose matches on Subject: below --
2016-08-15  3:23 [dts] [PATCH V3 0/2] IPGRE: update " Yufen Mo
2016-08-15  3:23 ` [dts] [PATCH V3 1/2] add sctp/gre format support in framework/packet module Yufen Mo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1471501514-25051-2-git-send-email-yufengx.mo@intel.com \
    --to=yufengx.mo@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).