Some of ofputil_encode_xxx functions does not fill in
the correct value for the length field in the ofp header.
Fix it up before writing out the message to a file.
NOTE: For Open vSwitch, ofconn_send() fixes it up before
sending out the message to the peer.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Datapath#ports is kept for compatibility with the previous openflow versions (< 1.3). Datapath#ports is not updated when received EventOFPPortStatus. This behavior may confuse users. Wherefore, showing warning message when the user accesses to Datapath#ports with the currently openflow versions (>= 1.3) is friendly.
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
We use syntaxes which can be used only in Python2 at many locations. But we should reduce the use of the syntaxes. This patch serves syntax level compatibility with Python3. However, for full compatibility is required still a lot of work because many API changes are made between 2 to 3.
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
A motivation of this change is a better modularity.
I.e. Make packet lib independent from ofproto.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Invalid error code OFPQCFC_EPERM should be OFPSCFC_EPERM instead.
This is EXT-208 that was included in Openflow v1.3.1.
OFPSCFC_EPERM is backported to ofproto_v1_2 so that any new or updated
application could consistently use OFPSCFC_EPERM to handle all protocol
versions.
OFPQCFC_EPERM is left in ofproto_v1_2 and ofproto_v1_3 definitions for
backward compatibility.
Signed-off-by: Shu Shen <shu.shen@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Work done:
- The baseline is copied over from ofproto_v1_4.py and
ofproto_v1_4_parser.py and into ofproto_v1_5.py and
ofproto_v1_5_parser.py respectively.
- Most of structs, enums, and pack strings in ofproto_v1_5.py has been
updated to spec. Exception is oxs_fields has not been done yet.
- ofproto_v1_5_parser.py has not been updated except those necessary to
allow run_tests.sh to complete successfully
- ofproto_protocol.py imports ofproto_v1_5 and ofproto_v1_5_parser now
- oxm_fields.py is updated for OFPXMC_PACKET_REGS
- Tests are updated to include Openflow v1.5 when it's obvious. But not
much work has been done to acutally test v1.5 yet. I also found tests
for v1.4 are scarce.
TODO:
- Add oxs_fields support. It shall be similar to oxm_fields
- Update and implement ofproto_v1_5_parser.py
- More tests, tests, tests.
Signed-off-by: Shu Shen <shu.shen@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Following Open vSwitch, introduce "dp_hash" OXM for testing.
>From their commit log: (commit 508a933809f8a8ede4fb93f1c1e3212799efc16a)
> Testing experimenter OXM is tricky because I do not know of any in
> widespread use. Two ONF proposals use experimenter OXMs: EXT-256 and
> EXT-233. EXT-256 is not suitable to implement for testing because its use
> of experimenter OXM is wrong and will be changed. EXT-233 is not suitable
> to implement for testing because it requires adding a new field to struct
> flow and I am not yet convinced that that field and the feature that it
> supports is worth having in Open vSwitch. Thus, this commit assigns an
> experimenter OXM code point to an existing OVS field that is currently
> restricted from use by controllers, "dp_hash", and uses that for testing.
> Because controllers cannot use it, this leaves future versions of OVS free
> to drop the support for the experimenter OXM for this field without causing
> backward compatibility problems.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, when VLAN ID match field is specified,
ofctl_v1_[23] is compatible with only match combination 1) of
the following three match combinations.
This patch makes it possible to set the all three combinations.
Match combinations for VLAN ID :
1) To match only packets with VLAN tag and VID equal value
2) To match only packets without a VLAN tag
3) To match only packets with a VLAN tag regardless of its value
In order to set the match combinations 2) or 3), please describe
"dl_vlan" field as hexadecimal string value like as follows.
Before applying this patch:
{"dl_vlan": 3 } # int
After applying this patch:
{"dl_vlan": 3 } # int (same as before applying)
{"dl_vlan": "0x0000"} # hexadecimal string without mask
{"dl_vlan": "0x1000/0x1000"} # hexadecimal string with mask
NOTE: When "dl_vlan" field is described as decimal int value,
OFPVID_PRESENT(0x1000) bit is automatically applied.
OTOH, OFPVID_PRESENT(0x1000) bit is NOT automatically applied
to hexadecimal string value.
For curl command examples, please refer to the following page in Ryu-documentation.
http://ryu.readthedocs.org/en/latest/app/ofctl_rest.html#example-of-vlan-id-match-field
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reported by Ian Y. Choi on ryu-devel.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
I'm not quite sure how it happens to work with the current
test environment. But the current coding doesn't work when
running via testr probably due to different PYTHONPATH.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To make this able to run via testr.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>