#include "sockunion.h"
#include "ripngd/ripngd.h"
-\f
+
struct rip_metric_modifier
{
enum
u_char metric;
};
-\f
-int
+
+static int
ripng_route_match_add (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
switch (ret)
{
case RMAP_RULE_MISSING:
- vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
+ vty_out (vty, "RIPng Can't find rule.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
case RMAP_COMPILE_ERROR:
- vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
+ vty_out (vty, "RIPng Argument is malformed.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
}
}
return CMD_SUCCESS;
}
-int
+static int
ripng_route_match_delete (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
switch (ret)
{
case RMAP_RULE_MISSING:
- vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
+ vty_out (vty, "RIPng Can't find rule.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
case RMAP_COMPILE_ERROR:
- vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
+ vty_out (vty, "RIPng Argument is malformed.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
}
}
return CMD_SUCCESS;
}
-int
+static int
ripng_route_set_add (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
switch (ret)
{
case RMAP_RULE_MISSING:
- vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
+ vty_out (vty, "RIPng Can't find rule.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
case RMAP_COMPILE_ERROR:
- vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
+ vty_out (vty, "RIPng Argument is malformed.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
}
}
return CMD_SUCCESS;
}
-int
+static int
ripng_route_set_delete (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
switch (ret)
{
case RMAP_RULE_MISSING:
- vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
+ vty_out (vty, "RIPng Can't find rule.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
case RMAP_COMPILE_ERROR:
- vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
+ vty_out (vty, "RIPng Argument is malformed.%s", VTY_NEWLINE);
return CMD_WARNING;
- break;
}
}
return CMD_SUCCESS;
}
-\f
+
/* `match metric METRIC' */
/* Match function return 1 if match is success else return zero. */
-route_map_result_t
+static route_map_result_t
route_match_metric (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
}
/* Route map `match metric' match statement. `arg' is METRIC value */
-void *
+static void *
route_match_metric_compile (const char *arg)
{
u_int32_t *metric;
}
/* Free route map's compiled `match metric' value. */
-void
+static void
route_match_metric_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
}
/* Route map commands for metric matching. */
-struct route_map_rule_cmd route_match_metric_cmd =
+static struct route_map_rule_cmd route_match_metric_cmd =
{
"metric",
route_match_metric,
route_match_metric_compile,
route_match_metric_free
};
-\f
+
/* `match interface IFNAME' */
/* Match function return 1 if match is success else return zero. */
-route_map_result_t
+static route_map_result_t
route_match_interface (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
}
/* Route map `match interface' match statement. `arg' is IFNAME value */
-void *
+static void *
route_match_interface_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
-void
+static void
route_match_interface_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_interface_cmd =
+static struct route_map_rule_cmd route_match_interface_cmd =
{
"interface",
route_match_interface,
/* `match tag TAG' */
/* Match function return 1 if match is success else return zero. */
-route_map_result_t
+static route_map_result_t
route_match_tag (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
}
/* Route map `match tag' match statement. `arg' is TAG value */
-void *
+static void *
route_match_tag_compile (const char *arg)
{
u_short *tag;
}
/* Free route map's compiled `match tag' value. */
-void
+static void
route_match_tag_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
}
/* Route map commands for tag matching. */
-struct route_map_rule_cmd route_match_tag_cmd =
+static struct route_map_rule_cmd route_match_tag_cmd =
{
"tag",
route_match_tag,
route_match_tag_compile,
route_match_tag_free
};
-\f
+
/* `set metric METRIC' */
/* Set metric to attribute. */
-route_map_result_t
+static route_map_result_t
route_set_metric (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
}
/* set metric compilation. */
-void *
+static void *
route_set_metric_compile (const char *arg)
{
int len;
}
/* Free route map's compiled `set metric' value. */
-void
+static void
route_set_metric_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_set_metric_cmd =
+static struct route_map_rule_cmd route_set_metric_cmd =
{
"metric",
route_set_metric,
/* `set ipv6 next-hop local IP_ADDRESS' */
/* Set nexthop to object. ojbect must be pointer to struct attr. */
-route_map_result_t
+static route_map_result_t
route_set_ipv6_nexthop_local (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
/* Route map `ipv6 nexthop local' compile function. Given string is converted
to struct in6_addr structure. */
-void *
+static void *
route_set_ipv6_nexthop_local_compile (const char *arg)
{
int ret;
struct in6_addr *address;
- address = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (struct in_addr));
+ address = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (struct in6_addr));
ret = inet_pton (AF_INET6, arg, address);
}
/* Free route map's compiled `ipv6 nexthop local' value. */
-void
+static void
route_set_ipv6_nexthop_local_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
}
/* Route map commands for ipv6 nexthop local set. */
-struct route_map_rule_cmd route_set_ipv6_nexthop_local_cmd =
+static struct route_map_rule_cmd route_set_ipv6_nexthop_local_cmd =
{
"ipv6 next-hop local",
route_set_ipv6_nexthop_local,
/* `set tag TAG' */
/* Set tag to object. ojbect must be pointer to struct attr. */
-route_map_result_t
+static route_map_result_t
route_set_tag (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
/* Route map `tag' compile function. Given string is converted
to u_short. */
-void *
+static void *
route_set_tag_compile (const char *arg)
{
u_short *tag;
}
/* Free route map's compiled `ip nexthop' value. */
-void
+static void
route_set_tag_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
}
/* Route map commands for tag set. */
-struct route_map_rule_cmd route_set_tag_cmd =
+static struct route_map_rule_cmd route_set_tag_cmd =
{
"tag",
route_set_tag,
route_set_tag_compile,
route_set_tag_free
};
-\f
+
#define MATCH_STR "Match values from routing table\n"
#define SET_STR "Set values in destination routing protocol\n"
DEFUN (match_tag,
match_tag_cmd,
- "match tag <0-65535>",
+ "match tag <1-65535>",
MATCH_STR
"Match tag of route\n"
"Metric value\n")
ALIAS (no_match_tag,
no_match_tag_val_cmd,
- "no match tag <0-65535>",
+ "no match tag <1-65535>",
NO_STR
MATCH_STR
"Match tag of route\n"
return CMD_WARNING;
}
+ if (!IN6_IS_ADDR_LINKLOCAL(&su.sin6.sin6_addr))
+ {
+ vty_out (vty, "%% Invalid link-local nexthop address%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
return ripng_route_set_add (vty, vty->index, "ipv6 next-hop local", argv[0]);
}
DEFUN (set_tag,
set_tag_cmd,
- "set tag <0-65535>",
+ "set tag <1-65535>",
SET_STR
"Tag value for routing protocol\n"
"Tag value\n")
ALIAS (no_set_tag,
no_set_tag_val_cmd,
- "no set tag <0-65535>",
+ "no set tag <1-65535>",
NO_STR
SET_STR
"Tag value for routing protocol\n"