summaryrefslogtreecommitdiff
path: root/lib/routemap.h
diff options
context:
space:
mode:
authorSarita Patra <saritap@vmware.com>2020-10-30 00:38:41 -0700
committerIgor Ryzhov <iryzhov@nfware.com>2021-03-30 22:58:42 +0300
commitd5d737a2df8cf18f7b76dcb8a634961513d1d0fa (patch)
treea16be1a1403157ba74bb84199089ff75233eaddf /lib/routemap.h
parentb702f424455b208cd4171f84048c65ec8a349184 (diff)
lib: Modifications to route-map NB
This commit introduces the changes to the library route-map north-bound callback implementation in order to align it to the modified yang definitions. Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com> Signed-off-by: Sarita Patra <saritap@vmware.com>
Diffstat (limited to 'lib/routemap.h')
-rw-r--r--lib/routemap.h529
1 files changed, 360 insertions, 169 deletions
diff --git a/lib/routemap.h b/lib/routemap.h
index f1791405db..6385193bbf 100644
--- a/lib/routemap.h
+++ b/lib/routemap.h
@@ -229,6 +229,144 @@ struct route_map {
};
DECLARE_QOBJ_TYPE(route_map);
+/* Route-map match conditions */
+#define IS_MATCH_INTERFACE(C) \
+ (strmatch(C, "frr-route-map:interface"))
+#define IS_MATCH_IPv4_ADDRESS_LIST(C) \
+ (strmatch(C, "frr-route-map:ipv4-address-list"))
+#define IS_MATCH_IPv6_ADDRESS_LIST(C) \
+ (strmatch(C, "frr-route-map:ipv6-address-list"))
+#define IS_MATCH_IPv4_NEXTHOP_LIST(C) \
+ (strmatch(C, "frr-route-map:ipv4-next-hop-list"))
+#define IS_MATCH_IPv4_PREFIX_LIST(C) \
+ (strmatch(C, "frr-route-map:ipv4-prefix-list"))
+#define IS_MATCH_IPv6_PREFIX_LIST(C) \
+ (strmatch(C, "frr-route-map:ipv6-prefix-list"))
+#define IS_MATCH_IPv4_NEXTHOP_PREFIX_LIST(C) \
+ (strmatch(C, "frr-route-map:ipv4-next-hop-prefix-list"))
+#define IS_MATCH_IPv4_NEXTHOP_TYPE(C) \
+ (strmatch(C, "frr-route-map:ipv4-next-hop-type"))
+#define IS_MATCH_IPv6_NEXTHOP_TYPE(C) \
+ (strmatch(C, "frr-route-map:ipv6-next-hop-type"))
+#define IS_MATCH_METRIC(C) \
+ (strmatch(C, "frr-route-map:match-metric"))
+#define IS_MATCH_TAG(C) (strmatch(C, "frr-route-map:match-tag"))
+/* Zebra route-map match conditions */
+#define IS_MATCH_IPv4_PREFIX_LEN(C) \
+ (strmatch(C, "frr-zebra-route-map:ipv4-prefix-length"))
+#define IS_MATCH_IPv6_PREFIX_LEN(C) \
+ (strmatch(C, "frr-zebra-route-map:ipv6-prefix-length"))
+#define IS_MATCH_IPv4_NH_PREFIX_LEN(C) \
+ (strmatch(C, "frr-zebra-route-map:ipv4-next-hop-prefix-length"))
+#define IS_MATCH_SRC_PROTO(C) \
+ (strmatch(C, "frr-zebra-route-map:source-protocol"))
+#define IS_MATCH_SRC_INSTANCE(C) \
+ (strmatch(C, "frr-zebra-route-map:source-instance"))
+/* BGP route-map match conditions */
+#define IS_MATCH_LOCAL_PREF(C) \
+ (strmatch(C, "frr-bgp-route-map:match-local-preference"))
+#define IS_MATCH_ORIGIN(C) \
+ (strmatch(C, "frr-bgp-route-map:match-origin"))
+#define IS_MATCH_RPKI(C) (strmatch(C, "frr-bgp-route-map:rpki"))
+#define IS_MATCH_PROBABILITY(C) \
+ (strmatch(C, "frr-bgp-route-map:probability"))
+#define IS_MATCH_SRC_VRF(C) \
+ (strmatch(C, "frr-bgp-route-map:source-vrf"))
+#define IS_MATCH_PEER(C) (strmatch(C, "frr-bgp-route-map:peer"))
+#define IS_MATCH_AS_LIST(C) \
+ (strmatch(C, "frr-bgp-route-map:as-path-list"))
+#define IS_MATCH_MAC_LIST(C) \
+ (strmatch(C, "frr-bgp-route-map:mac-address-list"))
+#define IS_MATCH_EVPN_ROUTE_TYPE(C) \
+ (strmatch(C, "frr-bgp-route-map:evpn-route-type"))
+#define IS_MATCH_EVPN_DEFAULT_ROUTE(C) \
+ (strmatch(C, "frr-bgp-route-map:evpn-default-route"))
+#define IS_MATCH_EVPN_VNI(C) \
+ (strmatch(C, "frr-bgp-route-map:evpn-vni"))
+#define IS_MATCH_EVPN_DEFAULT_ROUTE(C) \
+ (strmatch(C, "frr-bgp-route-map:evpn-default-route"))
+#define IS_MATCH_EVPN_RD(C) \
+ (strmatch(C, "frr-bgp-route-map:evpn-rd"))
+#define IS_MATCH_ROUTE_SRC(C) \
+ (strmatch(C, "frr-bgp-route-map:ip-route-source"))
+#define IS_MATCH_ROUTE_SRC_PL(C) \
+ (strmatch(C, "frr-bgp-route-map:ip-route-source-prefix-list"))
+#define IS_MATCH_COMMUNITY(C) \
+ (strmatch(C, "frr-bgp-route-map:match-community"))
+#define IS_MATCH_LCOMMUNITY(C) \
+ (strmatch(C, "frr-bgp-route-map:match-large-community"))
+#define IS_MATCH_EXTCOMMUNITY(C) \
+ (strmatch(C, "frr-bgp-route-map:match-extcommunity"))
+#define IS_MATCH_IPV4_NH(C) \
+ (strmatch(C, "frr-bgp-route-map:ipv4-nexthop"))
+#define IS_MATCH_IPV6_NH(C) \
+ (strmatch(C, "frr-bgp-route-map:ipv6-nexthop"))
+
+/* Route-map set actions */
+#define IS_SET_IPv4_NH(A) \
+ (strmatch(A, "frr-route-map:ipv4-next-hop"))
+#define IS_SET_IPv6_NH(A) \
+ (strmatch(A, "frr-route-map:ipv6-next-hop"))
+#define IS_SET_METRIC(A) \
+ (strmatch(A, "frr-route-map:set-metric"))
+#define IS_SET_TAG(A) (strmatch(A, "frr-route-map:set-tag"))
+#define IS_SET_SR_TE_COLOR(A) \
+ (strmatch(A, "frr-route-map:set-sr-te-color"))
+/* Zebra route-map set actions */
+#define IS_SET_SRC(A) \
+ (strmatch(A, "frr-zebra-route-map:src-address"))
+/* OSPF route-map set actions */
+#define IS_SET_METRIC_TYPE(A) \
+ (strmatch(A, "frr-ospf-route-map:metric-type"))
+#define IS_SET_FORWARDING_ADDR(A) \
+ (strmatch(A, "frr-ospf6-route-map:forwarding-address"))
+/* BGP route-map_set actions */
+#define IS_SET_WEIGHT(A) \
+ (strmatch(A, "frr-bgp-route-map:weight"))
+#define IS_SET_TABLE(A) (strmatch(A, "frr-bgp-route-map:table"))
+#define IS_SET_LOCAL_PREF(A) \
+ (strmatch(A, "frr-bgp-route-map:set-local-preference"))
+#define IS_SET_LABEL_INDEX(A) \
+ (strmatch(A, "frr-bgp-route-map:label-index"))
+#define IS_SET_DISTANCE(A) \
+ (strmatch(A, "frr-bgp-route-map:distance"))
+#define IS_SET_ORIGIN(A) \
+ (strmatch(A, "frr-bgp-route-map:set-origin"))
+#define IS_SET_ATOMIC_AGGREGATE(A) \
+ (strmatch(A, "frr-bgp-route-map:atomic-aggregate"))
+#define IS_SET_ORIGINATOR_ID(A) \
+ (strmatch(A, "frr-bgp-route-map:originator-id"))
+#define IS_SET_COMM_LIST_DEL(A) \
+ (strmatch(A, "frr-bgp-route-map:comm-list-delete"))
+#define IS_SET_LCOMM_LIST_DEL(A) \
+ (strmatch(A, "frr-bgp-route-map:large-comm-list-delete"))
+#define IS_SET_LCOMMUNITY(A) \
+ (strmatch(A, "frr-bgp-route-map:set-large-community"))
+#define IS_SET_COMMUNITY(A) \
+ (strmatch(A, "frr-bgp-route-map:set-community"))
+#define IS_SET_EXTCOMMUNITY_RT(A) \
+ (strmatch(A, "frr-bgp-route-map:set-extcommunity-rt"))
+#define IS_SET_EXTCOMMUNITY_SOO(A) \
+ (strmatch(A, "frr-bgp-route-map:set-extcommunity-soo"))
+#define IS_SET_AGGREGATOR(A) \
+ (strmatch(A, "frr-bgp-route-map:aggregator"))
+#define IS_SET_AS_PREPEND(A) \
+ (strmatch(A, "frr-bgp-route-map:as-path-prepend"))
+#define IS_SET_AS_EXCLUDE(A) \
+ (strmatch(A, "frr-bgp-route-map:as-path-exclude"))
+#define IS_SET_IPV6_NH_GLOBAL(A) \
+ (strmatch(A, "frr-bgp-route-map:ipv6-nexthop-global"))
+#define IS_SET_IPV6_VPN_NH(A) \
+ (strmatch(A, "frr-bgp-route-map:ipv6-vpn-address"))
+#define IS_SET_IPV6_PEER_ADDR(A) \
+ (strmatch(A, "frr-bgp-route-map:ipv6-peer-address"))
+#define IS_SET_IPV6_PREFER_GLOBAL(A) \
+ (strmatch(A, "frr-bgp-route-map:ipv6-prefer-global"))
+#define IS_SET_IPV4_VPN_NH(A) \
+ (strmatch(A, "frr-bgp-route-map:ipv4-vpn-address"))
+#define IS_SET_BGP_IPV4_NH(A) \
+ (strmatch(A, "frr-bgp-route-map:set-ipv4-nexthop"))
+
/* Prototypes. */
extern void route_map_init(void);
@@ -310,150 +448,186 @@ extern void
route_map_notify_pentry_dependencies(const char *affected_name,
struct prefix_list_entry *pentry,
route_map_event_t event);
-extern int generic_match_add(struct vty *vty, struct route_map_index *index,
+extern int generic_match_add(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
-
-extern int generic_match_delete(struct vty *vty, struct route_map_index *index,
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
+extern int generic_match_delete(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
-extern int generic_set_add(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg);
-extern int generic_set_delete(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
+
+extern int generic_set_add(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len);
+extern int generic_set_delete(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len);
/* match interface */
extern void route_map_match_interface_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* no match interface */
extern void route_map_no_match_interface_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* match ip address */
extern void route_map_match_ip_address_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* no match ip address */
extern void route_map_no_match_ip_address_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* match ip address prefix list */
extern void route_map_match_ip_address_prefix_list_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* no match ip address prefix list */
extern void route_map_no_match_ip_address_prefix_list_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* match ip next hop */
extern void route_map_match_ip_next_hop_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* no match ip next hop */
extern void route_map_no_match_ip_next_hop_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* match ip next hop prefix list */
extern void route_map_match_ip_next_hop_prefix_list_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* no match ip next hop prefix list */
extern void route_map_no_match_ip_next_hop_prefix_list_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* match ip next hop type */
extern void route_map_match_ip_next_hop_type_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* no match ip next hop type */
extern void route_map_no_match_ip_next_hop_type_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* match ipv6 address */
extern void route_map_match_ipv6_address_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* no match ipv6 address */
extern void route_map_no_match_ipv6_address_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* match ipv6 address prefix list */
extern void route_map_match_ipv6_address_prefix_list_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* no match ipv6 address prefix list */
extern void route_map_no_match_ipv6_address_prefix_list_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* match ipv6 next-hop type */
extern void route_map_match_ipv6_next_hop_type_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* no match ipv6 next-hop type */
extern void route_map_no_match_ipv6_next_hop_type_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* match metric */
extern void route_map_match_metric_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* no match metric */
extern void route_map_no_match_metric_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* match tag */
extern void route_map_match_tag_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* no match tag */
extern void route_map_no_match_tag_hook(int (*func)(
- struct vty *vty, struct route_map_index *index, const char *command,
- const char *arg, route_map_event_t type));
+ struct route_map_index *index, const char *command,
+ const char *arg, route_map_event_t type,
+ char *errmsg, size_t errmsg_len));
/* set sr-te color */
extern void route_map_set_srte_color_hook(
- int (*func)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg));
+ int (*func)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len));
/* no set sr-te color */
extern void route_map_no_set_srte_color_hook(
- int (*func)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg));
+ int (*func)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len));
/* set ip nexthop */
extern void route_map_set_ip_nexthop_hook(
- int (*func)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg));
+ int (*func)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len));
/* no set ip nexthop */
extern void route_map_no_set_ip_nexthop_hook(
- int (*func)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg));
+ int (*func)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len));
/* set ipv6 nexthop local */
extern void route_map_set_ipv6_nexthop_local_hook(
- int (*func)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg));
+ int (*func)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len));
/* no set ipv6 nexthop local */
extern void route_map_no_set_ipv6_nexthop_local_hook(
- int (*func)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg));
+ int (*func)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len));
/* set metric */
-extern void route_map_set_metric_hook(int (*func)(struct vty *vty,
- struct route_map_index *index,
+extern void route_map_set_metric_hook(int (*func)(struct route_map_index *index,
const char *command,
- const char *arg));
+ const char *arg,
+ char *errmsg,
+ size_t errmsg_len));
/* no set metric */
extern void route_map_no_set_metric_hook(
- int (*func)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg));
+ int (*func)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len));
/* set tag */
-extern void route_map_set_tag_hook(int (*func)(struct vty *vty,
- struct route_map_index *index,
+extern void route_map_set_tag_hook(int (*func)(struct route_map_index *index,
const char *command,
- const char *arg));
+ const char *arg,
+ char *errmsg,
+ size_t errmsg_len));
/* no set tag */
-extern void route_map_no_set_tag_hook(int (*func)(struct vty *vty,
- struct route_map_index *index,
+extern void route_map_no_set_tag_hook(int (*func)(struct route_map_index *index,
const char *command,
- const char *arg));
+ const char *arg,
+ char *errmsg,
+ size_t errmsg_len));
extern void *route_map_rule_tag_compile(const char *arg);
extern void route_map_rule_tag_free(void *rule);
@@ -467,181 +641,200 @@ extern void route_map_counter_decrement(struct route_map *map);
/* Route map hooks data structure. */
struct route_map_match_set_hooks {
/* match interface */
- int (*match_interface)(struct vty *vty, struct route_map_index *index,
+ int (*match_interface)(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* no match interface */
- int (*no_match_interface)(struct vty *vty,
- struct route_map_index *index,
+ int (*no_match_interface)(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* match ip address */
- int (*match_ip_address)(struct vty *vty, struct route_map_index *index,
+ int (*match_ip_address)(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* no match ip address */
- int (*no_match_ip_address)(struct vty *vty,
- struct route_map_index *index,
+ int (*no_match_ip_address)(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* match ip address prefix list */
- int (*match_ip_address_prefix_list)(struct vty *vty,
- struct route_map_index *index,
+ int (*match_ip_address_prefix_list)(struct route_map_index *index,
const char *command,
const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* no match ip address prefix list */
- int (*no_match_ip_address_prefix_list)(struct vty *vty,
- struct route_map_index *index,
+ int (*no_match_ip_address_prefix_list)(struct route_map_index *index,
const char *command,
const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* match ip next hop */
- int (*match_ip_next_hop)(struct vty *vty, struct route_map_index *index,
+ int (*match_ip_next_hop)(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* no match ip next hop */
- int (*no_match_ip_next_hop)(struct vty *vty,
- struct route_map_index *index,
+ int (*no_match_ip_next_hop)(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* match ip next hop prefix list */
- int (*match_ip_next_hop_prefix_list)(struct vty *vty,
- struct route_map_index *index,
+ int (*match_ip_next_hop_prefix_list)(struct route_map_index *index,
const char *command,
const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* no match ip next hop prefix list */
- int (*no_match_ip_next_hop_prefix_list)(struct vty *vty,
- struct route_map_index *index,
+ int (*no_match_ip_next_hop_prefix_list)(struct route_map_index *index,
const char *command,
const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg,
+ size_t errmsg_len);
/* match ip next-hop type */
- int (*match_ip_next_hop_type)(struct vty *vty,
- struct route_map_index *index,
- const char *command,
- const char *arg,
- route_map_event_t type);
+ int (*match_ip_next_hop_type)(struct route_map_index *index,
+ const char *command,
+ const char *arg,
+ route_map_event_t type,
+ char *errmsg,
+ size_t errmsg_len);
/* no match ip next-hop type */
- int (*no_match_ip_next_hop_type)(struct vty *vty,
- struct route_map_index *index,
- const char *command,
- const char *arg,
- route_map_event_t type);
+ int (*no_match_ip_next_hop_type)(struct route_map_index *index,
+ const char *command,
+ const char *arg,
+ route_map_event_t type,
+ char *errmsg,
+ size_t errmsg_len);
/* match ipv6 address */
- int (*match_ipv6_address)(struct vty *vty,
- struct route_map_index *index,
+ int (*match_ipv6_address)(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* no match ipv6 address */
- int (*no_match_ipv6_address)(struct vty *vty,
- struct route_map_index *index,
+ int (*no_match_ipv6_address)(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* match ipv6 address prefix list */
- int (*match_ipv6_address_prefix_list)(struct vty *vty,
- struct route_map_index *index,
+ int (*match_ipv6_address_prefix_list)(struct route_map_index *index,
const char *command,
const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* no match ipv6 address prefix list */
- int (*no_match_ipv6_address_prefix_list)(struct vty *vty,
- struct route_map_index *index,
+ int (*no_match_ipv6_address_prefix_list)(struct route_map_index *index,
const char *command,
const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg,
+ size_t errmsg_len);
/* match ipv6 next-hop type */
- int (*match_ipv6_next_hop_type)(struct vty *vty,
- struct route_map_index *index,
+ int (*match_ipv6_next_hop_type)(struct route_map_index *index,
const char *command,
const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* no match ipv6 next-hop type */
- int (*no_match_ipv6_next_hop_type)(struct vty *vty,
- struct route_map_index *index,
+ int (*no_match_ipv6_next_hop_type)(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* match metric */
- int (*match_metric)(struct vty *vty, struct route_map_index *index,
+ int (*match_metric)(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* no match metric */
- int (*no_match_metric)(struct vty *vty, struct route_map_index *index,
+ int (*no_match_metric)(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* match tag */
- int (*match_tag)(struct vty *vty, struct route_map_index *index,
+ int (*match_tag)(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* no match tag */
- int (*no_match_tag)(struct vty *vty, struct route_map_index *index,
+ int (*no_match_tag)(struct route_map_index *index,
const char *command, const char *arg,
- route_map_event_t type);
+ route_map_event_t type,
+ char *errmsg, size_t errmsg_len);
/* set sr-te color */
- int (*set_srte_color)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg);
+ int (*set_srte_color)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len);
/* no set sr-te color */
- int (*no_set_srte_color)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg);
+ int (*no_set_srte_color)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len);
/* set ip nexthop */
- int (*set_ip_nexthop)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg);
+ int (*set_ip_nexthop)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len);
/* no set ip nexthop */
- int (*no_set_ip_nexthop)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg);
+ int (*no_set_ip_nexthop)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len);
/* set ipv6 nexthop local */
- int (*set_ipv6_nexthop_local)(struct vty *vty,
- struct route_map_index *index,
- const char *command, const char *arg);
+ int (*set_ipv6_nexthop_local)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len);
/* no set ipv6 nexthop local */
- int (*no_set_ipv6_nexthop_local)(struct vty *vty,
- struct route_map_index *index,
- const char *command, const char *arg);
+ int (*no_set_ipv6_nexthop_local)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len);
/* set metric */
- int (*set_metric)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg);
+ int (*set_metric)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len);
/* no set metric */
- int (*no_set_metric)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg);
+ int (*no_set_metric)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len);
/* set tag */
- int (*set_tag)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg);
+ int (*set_tag)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len);
/* no set tag */
- int (*no_set_tag)(struct vty *vty, struct route_map_index *index,
- const char *command, const char *arg);
+ int (*no_set_tag)(struct route_map_index *index,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len);
};
extern struct route_map_match_set_hooks rmap_match_set_hook;
@@ -666,15 +859,13 @@ extern struct route_map_index *route_map_index_get(struct route_map *map,
extern void route_map_index_delete(struct route_map_index *index, int notify);
/* routemap_northbound.c */
-typedef int (*routemap_match_hook_fun)(struct vty *vty,
- struct route_map_index *rmi,
+typedef int (*routemap_match_hook_fun)(struct route_map_index *rmi,
const char *command, const char *arg,
- route_map_event_t event);
-
-typedef int (*routemap_set_hook_fun)(struct vty *vty,
- struct route_map_index *rmi,
- const char *command, const char *arg);
-
+ route_map_event_t event,
+ char *errmsg, size_t errmsg_len);
+typedef int (*routemap_set_hook_fun)(struct route_map_index *rmi,
+ const char *command, const char *arg,
+ char *errmsg, size_t errmsg_len);
struct routemap_hook_context {
struct route_map_index *rhc_rmi;
const char *rhc_rule;