+static int table_hash_modify(struct sw_table *swt,
+ const struct sw_flow_key *key,
+ const struct ofp_action *actions, int n_actions)
+{
+ struct sw_table_hash *th = (struct sw_table_hash *) swt;
+ unsigned int count = 0;
+
+ if (key->wildcards == 0) {
+ struct sw_flow **bucket = find_bucket(swt, key);
+ struct sw_flow *flow = *bucket;
+ if (flow && flow_matches_1wild(&flow->key, key)) {
+ flow_replace_acts(flow, actions, n_actions);
+ count = 1;
+ }
+ } else {
+ unsigned int i;
+
+ for (i = 0; i <= th->bucket_mask; i++) {
+ struct sw_flow **bucket = &th->buckets[i];
+ struct sw_flow *flow = *bucket;
+ if (flow && flow_matches_1wild(&flow->key, key)) {
+ flow_replace_acts(flow, actions, n_actions);
+ count++;
+ }
+ }
+ }
+ return count;
+}
+