/* Add eigrp route map rule. */ static int eigrp_route_set_add(struct vty *vty, struct route_map_index *index, const char *command, const char *arg) { int ret; ret = route_map_add_set(index, command, arg); switch (ret) { case RMAP_RULE_MISSING: vty_out(vty, "%% Can't find rule.\n"); return CMD_WARNING_CONFIG_FAILED; break; case RMAP_COMPILE_ERROR: /* * rip, ripng and other protocols share the set metric command * but only values from 0 to 16 are valid for rip and ripng * if metric is out of range for rip and ripng, it is * not for other protocols. Do not return an error */ if (strcmp(command, "metric")) { vty_out(vty, "%% Argument is malformed.\n"); return CMD_WARNING_CONFIG_FAILED; } break; case RMAP_COMPILE_SUCCESS: break; } return CMD_SUCCESS; }
/* Add rip route map rule. */ static int rip_route_set_add (struct vty *vty, struct route_map_index *index, const char *command, const char *arg) { int ret; ret = route_map_add_set (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: /* rip, ripng and other protocols share the set metric command but only values from 0 to 16 are valid for rip and ripng if metric is out of range for rip and ripng, it is not for other protocols. Do not return an error */ if (strcmp(command, "metric")) { vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE); return CMD_WARNING; } } } return CMD_SUCCESS; }
static s32 isis_route_set_add(struct vty *vty, struct route_map_index *index, s8 *command, s8 *arg) { s32 ret; ret = route_map_add_set(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; }
/* Add zebra route map rule. */ static int zebra_route_set_add(struct vty *vty, struct route_map_index *index, const char *command, const char *arg) { int ret; ret = route_map_add_set(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; }