Signed-off-by: YAMAMOTO Takashi <[email protected]>
---
ryu/tests/packet_data_generator2/gen.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/ryu/tests/packet_data_generator2/gen.c
b/ryu/tests/packet_data_generator2/gen.c
index 449f23a..e41aba0 100644
--- a/ryu/tests/packet_data_generator2/gen.c
+++ b/ryu/tests/packet_data_generator2/gen.c
@@ -78,6 +78,35 @@ packet_in(enum ofputil_protocol proto)
}
struct ofpbuf *
+flow_mod(enum ofputil_protocol proto)
+{
+ struct ofputil_flow_mod fm;
+ struct ofpbuf acts;
+ struct ofpact_ipv4 *a_set_field;
+ struct ofpact_goto_table *a_goto;
+
+ memset(&fm, 0, sizeof(fm));
+ fm.command = OFPFC_ADD;
+ fm.table_id = 2;
+ fm.new_cookie = htonll(0x123456789abcdef0);
+ fm.cookie_mask = OVS_BE64_MAX;
+ fm.importance = 0x9878;
+
+ fill_match(&fm.match);
+
+ ofpbuf_init(&acts, 64);
+ ofpact_put_STRIP_VLAN(&acts);
+ a_set_field = ofpact_put_SET_IPV4_DST(&acts);
+ a_set_field->ipv4 = inet_addr("192.168.2.9");
+ a_goto = ofpact_put_GOTO_TABLE(&acts);
+ a_goto->table_id = 100;
+
+ fm.ofpacts = acts.data;
+ fm.ofpacts_len = acts.size;
+ return ofputil_encode_flow_mod(&fm, proto);
+}
+
+struct ofpbuf *
bundle_ctrl(enum ofputil_protocol proto)
{
struct ofputil_bundle_ctrl_msg msg;
@@ -116,6 +145,7 @@ struct message {
const struct message messages[] = {
M(packet_in),
+ M(flow_mod),
M(bundle_ctrl),
};
--
2.1.0
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel