예제 #1
0
/**
 * @name fab_route_get
 *
 * @brief Get a fabric route
 */
GSList *
fab_route_get(void *rt_service, int src_sw, int dst_sw,
              fab_route_t *froute)
{
    GSList *route = NULL;

    if (!fab_ctx->use_ecmp || !froute) {
        if (!(route = mul_route_get(rt_service, src_sw, dst_sw))) {
            return NULL;
        }
    } else {
        if (!(route = mul_route_get_mp(rt_service, src_sw, dst_sw,
                                       froute, fab_mp_select))) {
            return NULL;
        }
    }

    if (!g_slist_find_custom(route, froute, (GCompareFunc)fab_route_elem_valid)) {
        mul_destroy_route(route);
        return NULL;
    }
    
    return route;
}
예제 #2
0
       show_fab_route_cmd,
        "show fabric-route <0-1024> to <0-1024>",
        SHOW_STR
        "Route between OF nodes\n"
        "source switch node-id\n"
        "to\n"
        "destination switch node-id\n")
{
    int src_aliasid;
    int dst_aliasid;
    GSList *iroute = NULL;

    src_aliasid = atoi(argv[0]);
    dst_aliasid = atoi(argv[1]);

    iroute = mul_route_get(fab_ctx->route_service, src_aliasid, dst_aliasid);
    if (!iroute) {
        vty_out(vty, "No route found%s", VTY_NEWLINE);
        return CMD_SUCCESS;         
    }

    vty_out (vty,
            "-------------------------------------------"
            "----------------------------------%s",
            VTY_NEWLINE);

    mul_route_path_traverse(iroute, fab_dump_per_route_elem, vty);

    vty_out(vty, "%s", VTY_NEWLINE);

    vty_out (vty,