Ejemplo n.º 1
0
ofl_err
flow_table_flow_mod(struct flow_table *table, struct ofl_msg_flow_mod *mod, bool *match_kept, bool *insts_kept) {
    switch (mod->command) {
        case (OFPFC_ADD): {
            bool overlap = ((mod->flags & OFPFF_CHECK_OVERLAP) != 0);
            return flow_table_add(table, mod, overlap, match_kept, insts_kept);
        }
        case (OFPFC_MODIFY): {
            return flow_table_modify(table, mod, false, insts_kept);
        }
        case (OFPFC_MODIFY_STRICT): {
            return flow_table_modify(table, mod, true, insts_kept);
        }
        case (OFPFC_DELETE): {
            return flow_table_delete(table, mod, false);
        }
        case (OFPFC_DELETE_STRICT): {
            return flow_table_delete(table, mod, true);
        }
        default: {
            return ofl_error(OFPET_FLOW_MOD_FAILED, OFPFMFC_BAD_COMMAND);
        }
    }
}
Ejemplo n.º 2
0
/* Cleanup routine */
void cleanup_module()
{
    nf_unregister_hook(&nfho_post);

    // delete flow_table (free copied stacks here)
    flow_table_delete(flow_table);
    kfree(flow_table);

    // delete routing table (free stacks here)
    routing_table_delete(routing_table);
    kfree(routing_table);

    // delete the /proc file
    delete_routes_proc_entry();
    delete_stats_proc_entry();

    pr_debug("mod_vlan: Exiting\n");
}