Add support for OFPFC_MODIFY Flow Mod command.
[openvswitch] / datapath / hwtable_dummy / hwtable_dummy.c
index e3e0eb411857914b7ae3c0c60363057f378acb9a..b78d364315efe07eb14cef5f31155c23572cdd4b 100644 (file)
@@ -97,6 +97,24 @@ static int table_dummy_insert(struct sw_table *swt, struct sw_flow *flow)
        return 0;
 }
 
+static int table_dummy_modify(struct sw_table *swt, 
+               const struct sw_flow_key *key,
+               const struct ofp_action *actions, int n_actions)
+{
+       struct sw_table_dummy *td = (struct sw_table_dummy *) swt;
+       struct sw_flow *flow;
+       unsigned int count = 0;
+
+       list_for_each_entry (flow, &td->flows, node) {
+               if (flow_matches_1wild(&flow->key, key)) {
+                       flow_replace_acts(flow, actions, n_actions);
+                       /* xxx Do whatever is necessary to modify the entry in hardware */
+                       count++;
+               }
+       }
+       return count;
+}
+
 
 static int do_delete(struct sw_table *swt, struct sw_flow *flow)
 {
@@ -233,6 +251,7 @@ static struct sw_table *table_dummy_create(void)
        swt = &td->swt;
        swt->lookup = table_dummy_lookup;
        swt->insert = table_dummy_insert;
+       swt->modify = table_dummy_modify;
        swt->delete = table_dummy_delete;
        swt->timeout = table_dummy_timeout;
        swt->destroy = table_dummy_destroy;