summaryrefslogtreecommitdiff
path: root/ospfd/ospf_routemap.c
diff options
context:
space:
mode:
authorpaul <paul>2005-05-06 21:37:42 +0000
committerpaul <paul>2005-05-06 21:37:42 +0000
commit4dadc291e56195886fd047690ded9686f4e013fa (patch)
treeea7c0690912d2b7d0c487f6855960e768fff1b6e /ospfd/ospf_routemap.c
parent69e10adaf28d4e116c38db2648786557fe131828 (diff)
2005-05-06 Paul Jakma <paul.jakma@sun.com>
* (general) extern and static qualifiers added. unspecified arguments in definitions fixed, typically they should be 'void'. function casts added for callbacks. Guards added to headers which lacked them. Proper headers included rather than relying on incomplete definitions. gcc noreturn function attribute where appropriate. * ospf_opaque.c: remove the private definition of ospf_lsa's ospf_lsa_refresh_delay. * ospf_lsa.h: export ospf_lsa_refresh_delay * ospf_packet.c: (ospf_make_md5_digest) make *auth_key const, correct thing to do - removes need for the casts later. * ospf_vty.c: Use vty.h's VTY_GET_INTEGER rather than ospf_vty's home-brewed versions, shuts up several warnings. * ospf_vty.h: remove VTY_GET_UINT32. VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX moved to lib/vty.h. * ospf_zebra.c: (ospf_distribute_list_update_timer) hacky overloading of the THREAD_ARG pointer should at least use uintptr_t.
Diffstat (limited to 'ospfd/ospf_routemap.c')
-rw-r--r--ospfd/ospf_routemap.c60
1 files changed, 29 insertions, 31 deletions
diff --git a/ospfd/ospf_routemap.c b/ospfd/ospf_routemap.c
index 074a2dea..6c89b22a 100644
--- a/ospfd/ospf_routemap.c
+++ b/ospfd/ospf_routemap.c
@@ -40,7 +40,7 @@
#include "ospfd/ospf_zebra.h"
/* Hook function for updating route_map assignment. */
-void
+static void
ospf_route_map_update (const char *name)
{
struct ospf *ospf;
@@ -73,7 +73,7 @@ ospf_route_map_update (const char *name)
}
}
-void
+static void
ospf_route_map_event (route_map_event_t event, const char *name)
{
struct ospf *ospf;
@@ -96,7 +96,7 @@ ospf_route_map_event (route_map_event_t event, const char *name)
}
/* Delete rip route map rule. */
-int
+static int
ospf_route_match_delete (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
@@ -121,7 +121,7 @@ ospf_route_match_delete (struct vty *vty, struct route_map_index *index,
return CMD_SUCCESS;
}
-int
+static int
ospf_route_match_add (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
@@ -146,7 +146,7 @@ ospf_route_match_add (struct vty *vty, struct route_map_index *index,
return CMD_SUCCESS;
}
-int
+static int
ospf_route_set_add (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
@@ -172,7 +172,7 @@ ospf_route_set_add (struct vty *vty, struct route_map_index *index,
}
/* Delete rip route map rule. */
-int
+static int
ospf_route_set_delete (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
@@ -199,7 +199,7 @@ ospf_route_set_delete (struct vty *vty, struct route_map_index *index,
/* `match ip netxthop ' */
/* Match function return 1 if match is success else return zero. */
-route_map_result_t
+static route_map_result_t
route_match_ip_nexthop (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
@@ -225,14 +225,14 @@ route_match_ip_nexthop (void *rule, struct prefix *prefix,
/* Route map `ip next-hop' match statement. `arg' should be
access-list name. */
-void *
+static void *
route_match_ip_nexthop_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
/* Free route map's compiled `ip address' value. */
-void
+static void
route_match_ip_nexthop_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
@@ -249,7 +249,7 @@ struct route_map_rule_cmd route_match_ip_nexthop_cmd =
/* `match ip next-hop prefix-list PREFIX_LIST' */
-route_map_result_t
+static route_map_result_t
route_match_ip_next_hop_prefix_list (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
@@ -273,13 +273,13 @@ route_match_ip_next_hop_prefix_list (void *rule, struct prefix *prefix,
return RMAP_NOMATCH;
}
-void *
+static void *
route_match_ip_next_hop_prefix_list_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
-void
+static void
route_match_ip_next_hop_prefix_list_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
@@ -296,7 +296,7 @@ struct route_map_rule_cmd route_match_ip_next_hop_prefix_list_cmd =
/* `match ip address IP_ACCESS_LIST' */
/* Match function should return 1 if match is success else return
zero. */
-route_map_result_t
+static route_map_result_t
route_match_ip_address (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
@@ -317,14 +317,14 @@ route_match_ip_address (void *rule, struct prefix *prefix,
/* Route map `ip address' match statement. `arg' should be
access-list name. */
-void *
+static void *
route_match_ip_address_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
/* Free route map's compiled `ip address' value. */
-void
+static void
route_match_ip_address_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
@@ -340,7 +340,7 @@ struct route_map_rule_cmd route_match_ip_address_cmd =
};
/* `match ip address prefix-list PREFIX_LIST' */
-route_map_result_t
+static route_map_result_t
route_match_ip_address_prefix_list (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
@@ -358,13 +358,13 @@ route_match_ip_address_prefix_list (void *rule, struct prefix *prefix,
return RMAP_NOMATCH;
}
-void *
+static void *
route_match_ip_address_prefix_list_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
-void
+static void
route_match_ip_address_prefix_list_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
@@ -381,7 +381,7 @@ struct route_map_rule_cmd route_match_ip_address_prefix_list_cmd =
/* `match interface IFNAME' */
/* Match function should 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)
{
@@ -403,14 +403,14 @@ route_match_interface (void *rule, struct prefix *prefix,
/* Route map `interface' match statement. `arg' should be
interface name. */
-void *
+static void *
route_match_interface_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
/* Free route map's compiled `interface' value. */
-void
+static void
route_match_interface_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
@@ -427,7 +427,7 @@ struct route_map_rule_cmd route_match_interface_cmd =
/* `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)
{
@@ -447,7 +447,7 @@ route_set_metric (void *rule, struct prefix *prefix,
}
/* set metric compilation. */
-void *
+static void *
route_set_metric_compile (const char *arg)
{
u_int32_t *metric;
@@ -463,7 +463,7 @@ route_set_metric_compile (const char *arg)
}
/* Free route map's compiled `set metric' value. */
-void
+static void
route_set_metric_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
@@ -480,7 +480,7 @@ struct route_map_rule_cmd route_set_metric_cmd =
/* `set metric-type TYPE' */
/* Set metric-type to attribute. */
-route_map_result_t
+static route_map_result_t
route_set_metric_type (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
@@ -500,7 +500,7 @@ route_set_metric_type (void *rule, struct prefix *prefix,
}
/* set metric-type compilation. */
-void *
+static void *
route_set_metric_type_compile (const char *arg)
{
u_int32_t *metric_type;
@@ -520,7 +520,7 @@ route_set_metric_type_compile (const char *arg)
}
/* Free route map's compiled `set metric-type' value. */
-void
+static void
route_set_metric_type_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
@@ -760,11 +760,9 @@ DEFUN (set_metric_type,
"OSPF[6] external type 2 metric\n")
{
if (strcmp (argv[0], "1") == 0)
- return ospf_route_set_add (vty, vty->index, "metric-type",
- (char *) "type-1");
+ return ospf_route_set_add (vty, vty->index, "metric-type", "type-1");
if (strcmp (argv[0], "2") == 0)
- return ospf_route_set_add (vty, vty->index, "metric-type",
- (char *) "type-2");
+ return ospf_route_set_add (vty, vty->index, "metric-type", "type-2");
return ospf_route_set_add (vty, vty->index, "metric-type", argv[0]);
}