---
 ryu/ofproto/ofproto_v1_3_parser.py                 |  16 ++++--------
 .../of13/4-55-ofp_table_features_request.packet    | Bin 11072 -> 11128 bytes
 ryu/tests/packet_data_generator/src/x4.erl         |  14 +++++++++-
 .../4-55-ofp_table_features_request.packet.json    |  29 ++++++++++++++++++++-
 4 files changed, 46 insertions(+), 13 deletions(-)

diff --git a/ryu/ofproto/ofproto_v1_3_parser.py 
b/ryu/ofproto/ofproto_v1_3_parser.py
index 0ca4769..c05f90c 100644
--- a/ryu/ofproto/ofproto_v1_3_parser.py
+++ b/ryu/ofproto/ofproto_v1_3_parser.py
@@ -5126,7 +5126,7 @@ class OFPTableFeaturePropOxm(OFPTableFeatureProp):
 @OFPTableFeatureProp.register_type(ofproto.OFPTFPT_EXPERIMENTER_MISS)
 class OFPTableFeaturePropExperimenter(OFPTableFeatureProp):
     _DATA_ELEMENT_PACK_STR = '!I'
-    _PACK_STR = '!II'
+    _BODY_PACK_STR = '!II'
 
     def __init__(self, type_, experimenter=None, exp_type=None,
                  data=None, length=None):
@@ -5138,13 +5138,13 @@ class 
OFPTableFeaturePropExperimenter(OFPTableFeatureProp):
 
     @classmethod
     def _parse_prop(cls, buf):
-        (experimenter, exp_type) = struct.unpack_from(cls._PACK_STR, buf, 0)
+        (experimenter, exp_type) = struct.unpack_from(cls._BODY_PACK_STR, buf, 
0)
 
         # Parse trailing data, a list of 4-byte words
         length = len(buf)
         data = []
         pack_size = struct.calcsize(cls._DATA_ELEMENT_PACK_STR)
-        offset = struct.calcsize(cls._PACK_STR)
+        offset = struct.calcsize(cls._BODY_PACK_STR)
         while offset < length:
             (word,) = struct.unpack_from(cls._DATA_ELEMENT_PACK_STR,
                                          buf, offset)
@@ -5160,19 +5160,13 @@ class 
OFPTableFeaturePropExperimenter(OFPTableFeatureProp):
     def _serialize_prop(self):
         # experimenter, exp_type
         buf = bytearray()
-        msg_pack_into(self._PACK_STR, buf, 0, self.experimenter,
+        msg_pack_into(self._BODY_PACK_STR, buf, 0, self.experimenter,
                       self.exp_type)
 
         # data
         if len(self.data):
             ofproto_parser.msg_pack_into('!%dI' % len(self.data),
-                                         data_buf, len(buf), *self.data)
-
-        # pad
-        length = super(OFPTableFeaturePropExperimenter, self)._PACK_STR
-        length += len(buf)
-        pad_len = utils.round_up(length, 8) - length
-        ofproto_parser.msg_pack_into("%dx" % pad_len, buf, len(buf))
+                                         buf, len(buf), *self.data)
 
         return buf
 
diff --git a/ryu/tests/packet_data/of13/4-55-ofp_table_features_request.packet 
b/ryu/tests/packet_data/of13/4-55-ofp_table_features_request.packet
index 
3df8c649f84e42e05ba6bc35d79aa4d60ce94a31..52b9d3b1ab2b63a1019b4d9f0f402ff8a7d7c2f9
 100644
GIT binary patch
delta 88
zcmX>Q_9IM)MM%4X0R(s$7(o=vgpERBEaw0J0R<QsQb9r>0OSh*DG(o|j1kBef%2K4
MVjy~RI?GKp0L(59p8x;=

delta 32
jcmewnb|6fMMM&F$0R(s$7(o<E#73bomdy)TZm0nOZPNzR

diff --git a/ryu/tests/packet_data_generator/src/x4.erl 
b/ryu/tests/packet_data_generator/src/x4.erl
index 17852a2..32e641a 100644
--- a/ryu/tests/packet_data_generator/src/x4.erl
+++ b/ryu/tests/packet_data_generator/src/x4.erl
@@ -800,7 +800,19 @@ x() ->
                                   arp_tha,ipv6_src,ipv6_dst,ipv6_flabel,
                                   icmpv6_type,icmpv6_code,ipv6_nd_target,
                                   ipv6_nd_sll,ipv6_nd_tll,mpls_label,mpls_tc,
-                                  mpls_bos,pbb_isid]}]},
+                                  mpls_bos,pbb_isid]},
+                         #ofp_table_feature_prop_experimenter{
+                             experimenter = 101,
+                             exp_type = 0,
+                             data = <<>>},
+                         #ofp_table_feature_prop_experimenter{
+                             experimenter = 101,
+                             exp_type = 1,
+                             data = <<1:32>>},
+                         #ofp_table_feature_prop_experimenter{
+                             experimenter = 101,
+                             exp_type = 2,
+                             data = <<1:32,2:32>>}]},
                 #ofp_table_features{
                     table_id = 1,name = <<"Flow Table 0x01">>,
                     metadata_match = <<"\377\377\377\377\377\377\377\377">>,
diff --git 
a/ryu/tests/unit/ofproto/json/of13/4-55-ofp_table_features_request.packet.json 
b/ryu/tests/unit/ofproto/json/of13/4-55-ofp_table_features_request.packet.json
index 530eb14..5600298 100644
--- 
a/ryu/tests/unit/ofproto/json/of13/4-55-ofp_table_features_request.packet.json
+++ 
b/ryu/tests/unit/ofproto/json/of13/4-55-ofp_table_features_request.packet.json
@@ -4,7 +4,7 @@
          {
             "OFPTableFeaturesStats": {
                "config": 0, 
-               "length": 1112, 
+               "length": 1168, 
                "max_entries": 16777216, 
                "metadata_match": 18446744073709551615, 
                "metadata_write": 18446744073709551615, 
@@ -1591,6 +1591,33 @@
                         ], 
                         "type": 14
                      }
+                  },
+                  {
+                     "OFPTableFeaturePropExperimenter": {
+                         "length": 12, 
+                         "type": 65534, 
+                         "exp_type": 0, 
+                         "experimenter": 101, 
+                         "data": []
+                     }
+                  }, 
+                  {
+                     "OFPTableFeaturePropExperimenter": {
+                         "length": 16, 
+                         "type": 65534, 
+                         "exp_type": 1, 
+                         "experimenter": 101, 
+                         "data": [1]
+                     }
+                  }, 
+                  {
+                     "OFPTableFeaturePropExperimenter": {
+                         "length": 20, 
+                         "type": 65534, 
+                         "exp_type": 2, 
+                         "experimenter": 101, 
+                         "data": [1, 2]
+                     }
                   }
                ], 
                "table_id": 0
-- 
1.8.5.2


------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to