diff options
author | YAMAMOTO Takashi <yamamoto@valinux.co.jp> | 2015-01-16 17:20:00 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-19 00:51:55 +0900 |
commit | 0d3ccc94577bd262bf8d2095d61dde3f7140ec4b (patch) | |
tree | b7a0d793a432e8ffb50cd8ab810dd76ebf28b147 | |
parent | 95d3a075fbc61288206f60f72fd8d7c4383c0cb7 (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.py | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/ryu/ofproto/oxm_fields.py b/ryu/ofproto/oxm_fields.py index 15f351c0..98460226 100644 --- a/ryu/ofproto/oxm_fields.py +++ b/ryu/ofproto/oxm_fields.py @@ -24,6 +24,32 @@ # value and mask are on-wire bytes. # mask is None if no mask. +# There are three type of OXM/NXM headers. +# +# 32-bit OXM/NXM header +# +-------------------------------+-------------+-+---------------+ +# | class | field |m| length | +# +-------------------------------+-------------+-+---------------+ +# +# 64-bit experimenter OXM header +# +-------------------------------+-------------+-+---------------+ +# | class (OFPXMC_EXPERIMENTER) | field |m| length | +# +-------------------------------+-------------+-+---------------+ +# | experimenter ID | +# +---------------------------------------------------------------+ +# +# ONF EXT-256 style experimenter OXM header +# +-------------------------------+-------------+-+---------------+ +# | class (OFPXMC_EXPERIMENTER) | ????? |m| length | +# +-------------------------------+-------------+-+---------------+ +# | experimenter ID (ONF_EXPERIMENTER_ID) | +# +-------------------------------+-------------------------------+ +# | exp_type | +# +-------------------------------+ +# +# Note: According to blp@nicira, EXT-256 will be rectified. +# https://www.mail-archive.com/dev%40openvswitch.org/msg37644.html + import itertools import struct import ofproto_common @@ -252,8 +278,6 @@ def parse(mod, buf, offset): if exp_id == ofproto_common.ONF_EXPERIMENTER_ID: # XXX # This block implements EXT-256 style experimenter OXM. - # However, according to blp, the extension will be rectified. - # https://www.mail-archive.com/dev%40openvswitch.org/msg37644.html onf_exp_type_pack_str = '!H' (exp_type, ) = struct.unpack_from(onf_exp_type_pack_str, buf, offset + hdr_len + exp_hdr_len) @@ -281,6 +305,8 @@ def parse(mod, buf, offset): def serialize(mod, n, value, mask, buf, offset): exp_hdr = bytearray() if isinstance(n, tuple): + # XXX + # This block implements EXT-256 style experimenter OXM. (cls, exp_type) = n desc = mod._oxm_field_desc(n) assert issubclass(cls, _Experimenter) |