Skip to content

Commit

Permalink
oxm_fields: Add comments
Browse files Browse the repository at this point in the history
Signed-off-by: YAMAMOTO Takashi <[email protected]>
Signed-off-by: FUJITA Tomonori <[email protected]>
  • Loading branch information
yamt authored and fujita committed Oct 14, 2014
1 parent dcf6ddd commit 73e336e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ryu/ofproto/oxm_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 73e336e

Please sign in to comment.