diff options
author | YAMAMOTO Takashi <yamamoto@valinux.co.jp> | 2015-04-07 15:44:37 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-04-08 15:46:17 +0900 |
commit | afb153f175d15e0ded8ea688cf78f51eeb31138a (patch) | |
tree | a2a38da8e9c57e761d7cd53e3795993c026b9b97 | |
parent | 3e48d82c62bef59f32892d36353585dfb4a8d191 (diff) |
packet_data_generator2: Add flow_mod
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/tests/packet_data_generator2/gen.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ryu/tests/packet_data_generator2/gen.c b/ryu/tests/packet_data_generator2/gen.c index 449f23a7..e41aba00 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), }; |