diff options
author | Yuichi Ito <ito.yuichi0@gmail.com> | 2014-06-23 14:39:12 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-06-23 17:10:24 +0900 |
commit | 6942189d8f37affa01745405dfa1abf03486985f (patch) | |
tree | 7fc3dcf6f22dc290f4f47eb1ac87ae5ec29928b4 | |
parent | 63451ce0a2dc5181aaee6366441911d2a08fd031 (diff) |
sw test tool: Modify conditions of ofp_packet_in_reason
OF 1.4.0 spec (B.14.2 More descriptive reasons for packet-in) says:
The main change is that the the "output action" reason OFPR_ACTION is effectively split into four reasons,
"apply-action", "action-set", "group bucket" and "packet-out", representing the four distinct context
where this action is used.
A set of reason values for ofp_packet_in message in OF 1.3.3 is:
enum ofp_packet_in_reason {
OFPR_NO_MATCH = 0, /* No matching flow (table-miss flow entry). */
OFPR_ACTION = 1, /* Action explicitly output to controller. */
OFPR_INVALID_TTL = 2, /* Packet has invalid TTL */
};
And a new set of reason values for ofp_packet_in message in OF 1.4.0 is:
enum ofp_packet_in_reason {
OFPR_TABLE_MISS = 0, /* No matching flow (table-miss flow entry). */
OFPR_APPLY_ACTION = 1, /* Output to controller in apply-actions. */
OFPR_INVALID_TTL = 2, /* Packet has invalid TTL */
OFPR_ACTION_SET = 3, /* Output to controller in action set. */
OFPR_GROUP = 4, /* Output to controller in group bucket. */
OFPR_PACKET_OUT = 5, /* Output to controller in packet-out. */
};
Therefore, "reason != OFPR_ACTION" means "reason == OFPR_NOMATCH or reason == OFPR_INVALID_TTL".
NOTE: OFPR_TABLE_MISS is defined as OFPR_NO_MATCH in ryu.ofproto.ofproto_v1_4.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/tests/switch/tester.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ryu/tests/switch/tester.py b/ryu/tests/switch/tester.py index a59205ed..98788a92 100644 --- a/ryu/tests/switch/tester.py +++ b/ryu/tests/switch/tester.py @@ -642,7 +642,8 @@ class OfTester(app_manager.RyuApp): if msg.datapath.id != pkt_in_src_model.dp.id: pkt_type = 'packet-in' err_msg = 'SW[dpid=%s]' % dpid_lib.dpid_to_str(msg.datapath.id) - elif msg.reason != ofproto_v1_3.OFPR_ACTION: + elif msg.reason == msg.datapath.ofproto.OFPR_NO_MATCH or \ + msg.reason == msg.datapath.ofproto.OFPR_INVALID_TTL: pkt_type = 'packet-in' err_msg = 'OFPPacketIn[reason=%d]' % msg.reason elif repr(msg.data) != repr(model_pkt): |