Exemple #1
0
static s32 isis_route_match_add (struct vty *vty, struct route_map_index *index, s8 *command, s8 *arg)
{
    s32 ret;

    ret = route_map_add_match(index, command, arg);
    if (ret)
    {
        switch (ret)
        {
            case RMAP_RULE_MISSING:
                vty_out(vty, "%% Can't find rule.\r\n");
                return CMD_WARNING;
            case RMAP_COMPILE_ERROR:
                vty_out(vty, "%% Argument is malformed.\r\n");
                return CMD_WARNING;
        }
    }

    return CMD_SUCCESS;
}
Exemple #2
0
/* Add eigrp route map rule. */
static int eigrp_route_match_add(struct vty *vty, struct route_map_index *index,
				 const char *command, const char *arg)
{
	int ret;
	ret = route_map_add_match(index, command, arg, type);
	switch (ret) {
	case RMAP_RULE_MISSING:
		vty_out(vty, "%% Can't find rule.\n");
		return CMD_WARNING_CONFIG_FAILED;
		break;
	case RMAP_COMPILE_ERROR:
		vty_out(vty, "%% Argument is malformed.\n");
		return CMD_WARNING_CONFIG_FAILED;
		break;
	case RMAP_COMPILE_SUCCESS:
		break;
	}

	return CMD_SUCCESS;
}
Exemple #3
0
/* Add zebra route map rule */
static int
zebra_route_match_add(struct vty *vty, struct route_map_index *index,
                      const char *command, const char *arg)
{
    int ret;

    ret = route_map_add_match(index, command, arg);
    if (ret) {
        switch (ret) {
        case RMAP_RULE_MISSING:
            vty_out(vty, "%% Can't find rule.%s", VTY_NEWLINE);
            return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
            vty_out(vty, "%% Argument is malformed.%s",
                    VTY_NEWLINE);
            return CMD_WARNING;
        }
    }
    return CMD_SUCCESS;
}