struct pipeline *
pipeline_create(struct datapath *dp) {
    struct pipeline *pl;
    int i;

    pl = xmalloc(sizeof(struct pipeline));
    for (i=0; i<PIPELINE_TABLES; i++) {
        pl->tables[i] = flow_table_create(dp, i);
    }
    pl->dp = dp;

    return pl;
}
예제 #2
0
/* Initialization routine */
int init_module()
{
    nfho_post.hook     = process_pkt_post_routing;      /* Handler function */
    nfho_post.hooknum  = NF_INET_POST_ROUTING;
    nfho_post.pf       = AF_INET;
    nfho_post.priority = NF_IP_PRI_LAST;

    pr_debug("mod_vlan: Loading\n");
    // Create a flow_table [flow_match, vlan_stack]
    flow_table = flow_table_create(DEFAULT_FLOW_TABLE_SIZE);

    // Create a routing table [dst_ip, list_of_stacks]
    routing_table = routing_table_create(4096);

    // Create a proc file to read routing table from kulfi
    create_new_routes_proc_entry(routes_proc_entry);
    create_new_stats_proc_entry(stats_proc_entry);

    nf_register_hook(&nfho_post);

    return 0;
}