bool flow_entry_hard_timeout(struct flow_entry *entry) { bool timeout; timeout = (entry->remove_at != 0) && (time_msec() > entry->remove_at); if (timeout) { flow_entry_remove(entry, OFPRR_HARD_TIMEOUT); } return timeout; }
/* Handles flow mod messages with DELETE command. */ static ofl_err flow_table_delete(struct flow_table *table, struct ofl_msg_flow_mod *mod, bool strict) { struct flow_entry *entry, *next; LIST_FOR_EACH_SAFE (entry, next, struct flow_entry, match_node, &table->match_entries) { if (flow_entry_matches(entry, mod, strict, true/*check_cookie*/)) { flow_entry_remove(entry, OFPRR_DELETE); } } return 0; }
bool flow_entry_idle_timeout(struct flow_entry *entry) { bool timeout; timeout = (entry->stats->idle_timeout != 0) && (time_msec() > entry->last_used + entry->stats->idle_timeout * 1000); if (timeout) { flow_entry_remove(entry, OFPRR_IDLE_TIMEOUT); } return timeout; }
void group_entry_destroy(struct group_entry *entry) { struct flow_ref_entry *ref, *next; // remove all referencing flows LIST_FOR_EACH_SAFE(ref, next, struct flow_ref_entry, node, &entry->flow_refs) { flow_entry_remove(ref->entry, OFPRR_GROUP_DELETE); // Note: the flow_ref_entryf will be destroyed after a chain of calls in flow_entry_remove // no point in decreasing stats counter, as the group is destroyed anyway } ofl_structs_free_group_desc_stats(entry->desc, entry->dp->exp); ofl_structs_free_group_stats(entry->stats); free(entry->data); free(entry); }
void meter_entry_destroy(struct meter_entry *entry) { struct flow_ref_entry *ref, *next; // remove all referencing flows LIST_FOR_EACH_SAFE(ref, next, struct flow_ref_entry, node, &entry->flow_refs) { flow_entry_remove(ref->entry, OFPRR_METER_DELETE);// METER_DELETE ??????? // Note: the flow_ref_entryf will be destroyed after a chain of calls in flow_entry_remove } OFL_UTILS_FREE_ARR_FUN(entry->config->bands, entry->config->meter_bands_num, ofl_structs_free_meter_bands); free(entry->config); OFL_UTILS_FREE_ARR(entry->stats->band_stats, entry->stats->meter_bands_num); free(entry->stats); free(entry); }