summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>2014-10-14 12:28:39 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-10-14 13:34:25 +0900
commit73e336e74ea1de79b82f3bec47f9fb97e3aaf5fd (patch)
treecab9eb5e2550a9e7e1268fadb8599fbbc0630675
parentdcf6ddd8283f5ede4c5a1be51b1ba8968a0ab299 (diff)
oxm_fields: Add comments
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/ofproto/oxm_fields.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ryu/ofproto/oxm_fields.py b/ryu/ofproto/oxm_fields.py
index 6c1565ab..4aa390ee 100644
--- a/ryu/ofproto/oxm_fields.py
+++ b/ryu/ofproto/oxm_fields.py
@@ -225,6 +225,7 @@ def parse(mod, buf, offset):
oxm_len = mod.oxm_tlv_header_extract_length(header)
oxm_class = oxm_type >> 7
if oxm_class == OFPXMC_EXPERIMENTER:
+ # Experimenter OXMs have 64-bit header. (vs 32-bit for other OXMs)
exp_hdr_pack_str = '!I' # experimenter_id
(exp_id, ) = struct.unpack_from(exp_hdr_pack_str, buf,
offset + hdr_len)
@@ -242,6 +243,8 @@ def parse(mod, buf, offset):
else:
num = oxm_type
exp_hdr_len = 0
+ # Note: OXM payload length (oxm_len) includes Experimenter ID (exp_hdr_len)
+ # for experimenter OXMs.
value_offset = offset + hdr_len + exp_hdr_len
value_len = oxm_len - exp_hdr_len
value_pack_str = '!%ds' % value_len