summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWAMOTO Toshihiro <iwamoto@valinux.co.jp>2015-05-29 12:16:02 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-06-02 09:14:19 +0900
commit2b09bd0faf7ce90a149a4a5945a93d45fbb3e276 (patch)
tree09241f2c6331a71b90c737c6988545d18570a7d6
parent50769ac83724ff4ed2952c8d70c4f7fa44792589 (diff)
packet_data_generator2: Generate conjunction packets
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/tests/packet_data_generator2/gen.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/ryu/tests/packet_data_generator2/gen.c b/ryu/tests/packet_data_generator2/gen.c
index 5319501d..11d4c498 100644
--- a/ryu/tests/packet_data_generator2/gen.c
+++ b/ryu/tests/packet_data_generator2/gen.c
@@ -151,6 +151,63 @@ flow_mod(enum ofputil_protocol proto)
}
struct ofpbuf *
+flow_mod_match_conj(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 = 3;
+ fm.new_cookie = htonll(0x123456789abcdef0);
+ fm.cookie_mask = OVS_BE64_MAX;
+ fm.importance = 0x9878;
+
+ match_init_catchall(&fm.match);
+ match_set_conj_id(&fm.match, 0xabcdef);
+
+ 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 *
+flow_mod_conjunction(enum ofputil_protocol proto)
+{
+ struct ofputil_flow_mod fm;
+ struct ofpbuf acts;
+ struct ofpact_conjunction *a_conj;
+
+ memset(&fm, 0, sizeof(fm));
+ fm.command = OFPFC_ADD;
+ fm.table_id = 4;
+ fm.new_cookie = htonll(0x123456789abcdef0);
+ fm.cookie_mask = OVS_BE64_MAX;
+ fm.importance = 0x9878;
+
+ fill_match(&fm.match);
+
+ ofpbuf_init(&acts, 64);
+ a_conj = ofpact_put_CONJUNCTION(&acts);
+ a_conj->id = 0xabcdef;
+ a_conj->clause = 1;
+ a_conj->n_clauses = 2;
+
+ 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;
@@ -210,6 +267,10 @@ const struct message messages[] = {
((const struct protocol_version *[]){&p13, &p15, NULL})),
M(flow_mod,
((const struct protocol_version *[]){&p13, &p15, NULL})),
+ M(flow_mod_match_conj,
+ ((const struct protocol_version *[]){&p13, &p15, NULL})),
+ M(flow_mod_conjunction,
+ ((const struct protocol_version *[]){&p13, &p15, NULL})),
M(bundle_ctrl,
((const struct protocol_version *[]){&p15, NULL})),
M(bundle_add,