]> git.proxmox.com Git - mirror_frr.git/blame - lib/routemap.h
Merge pull request #12708 from donaldsharp/no_notification
[mirror_frr.git] / lib / routemap.h
CommitLineData
718e3744 1/* Route map function.
2 * Copyright (C) 1998 Kunihiro Ishiguro
3 *
4 * This file is part of GNU Zebra.
5 *
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
896014f4
DL
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
718e3744 19 */
20
21#ifndef _ZEBRA_ROUTEMAP_H
22#define _ZEBRA_ROUTEMAP_H
23
88711d8a 24#include "typesafe.h"
24873f0c 25#include "prefix.h"
4a1ab8e4 26#include "memory.h"
e80e7cce 27#include "qobj.h"
0a538fc9 28#include "vty.h"
49a08bb0
NT
29#include "lib/plist.h"
30#include "lib/plist_int.h"
0a538fc9 31
5e244469
RW
32#ifdef __cplusplus
33extern "C" {
34#endif
35
bf8d3d6a
DL
36DECLARE_MTYPE(ROUTE_MAP_NAME);
37DECLARE_MTYPE(ROUTE_MAP_RULE);
38DECLARE_MTYPE(ROUTE_MAP_COMPILED);
24873f0c 39
718e3744 40/* Route map's type. */
d62a17ae 41enum route_map_type { RMAP_PERMIT, RMAP_DENY, RMAP_ANY };
42
43typedef enum {
d62a17ae 44 RMAP_DENYMATCH,
b68885f9 45 RMAP_PERMITMATCH
718e3744 46} route_map_result_t;
47
b68885f9
LK
48/*
49 * Route-map match or set result "Eg: match evpn vni xx"
50 * route-map match cmd always returns match/nomatch/noop
51 * match--> found a match
52 * nomatch--> didnt find a match
53 * noop--> not applicable
54 * route-map set retuns okay/error
55 * okay --> set was successful
56 * error --> set was not successful
57 */
58enum route_map_cmd_result_t {
59 /*
60 * route-map match cmd results
61 */
62 RMAP_MATCH,
63 RMAP_NOMATCH,
64 RMAP_NOOP,
65 /*
66 * route-map set cmd results
67 */
68 RMAP_OKAY,
69 RMAP_ERROR
70};
71
d62a17ae 72typedef enum { RMAP_EXIT, RMAP_GOTO, RMAP_NEXT } route_map_end_t;
73
74typedef enum {
75 RMAP_EVENT_SET_ADDED,
76 RMAP_EVENT_SET_DELETED,
77 RMAP_EVENT_SET_REPLACED,
78 RMAP_EVENT_MATCH_ADDED,
79 RMAP_EVENT_MATCH_DELETED,
80 RMAP_EVENT_MATCH_REPLACED,
81 RMAP_EVENT_INDEX_ADDED,
82 RMAP_EVENT_INDEX_DELETED,
83 RMAP_EVENT_CALL_ADDED, /* call to another routemap added */
84 RMAP_EVENT_CALL_DELETED,
85 RMAP_EVENT_PLIST_ADDED,
86 RMAP_EVENT_PLIST_DELETED,
87 RMAP_EVENT_CLIST_ADDED,
88 RMAP_EVENT_CLIST_DELETED,
89 RMAP_EVENT_ECLIST_ADDED,
90 RMAP_EVENT_ECLIST_DELETED,
91 RMAP_EVENT_LLIST_ADDED,
92 RMAP_EVENT_LLIST_DELETED,
93 RMAP_EVENT_ASLIST_ADDED,
94 RMAP_EVENT_ASLIST_DELETED,
95 RMAP_EVENT_FILTER_ADDED,
96 RMAP_EVENT_FILTER_DELETED,
718e3744 97} route_map_event_t;
98
fee0f4c6 99/* Depth limit in RMAP recursion using RMAP_CALL. */
100#define RMAP_RECURSION_LIMIT 10
101
718e3744 102/* Route map rule structure for matching and setting. */
d62a17ae 103struct route_map_rule_cmd {
104 /* Route map rule name (e.g. as-path, metric) */
105 const char *str;
718e3744 106
d62a17ae 107 /* Function for value set or match. */
b68885f9
LK
108 enum route_map_cmd_result_t (*func_apply)(void *rule,
109 const struct prefix *prefix,
b68885f9 110 void *object);
718e3744 111
d62a17ae 112 /* Compile argument and return result as void *. */
113 void *(*func_compile)(const char *);
718e3744 114
d62a17ae 115 /* Free allocated value by func_compile (). */
116 void (*func_free)(void *);
909f3d56 117
118 /** To get the rule key after Compilation **/
119 void *(*func_get_rmap_rule_key)(void *val);
718e3744 120};
121
122/* Route map apply error. */
cda7187d 123enum rmap_compile_rets {
e2c8d6ce 124 RMAP_COMPILE_SUCCESS,
9ca25fed 125
e2c8d6ce
NT
126 /* Route map rule is missing. */
127 RMAP_RULE_MISSING,
718e3744 128
e2c8d6ce
NT
129 /* Route map rule can't compile */
130 RMAP_COMPILE_ERROR,
131
e2c8d6ce 132};
718e3744 133
a7282663
RZ
134/* Route map rule. This rule has both `match' rule and `set' rule. */
135struct route_map_rule {
136 /* Rule type. */
137 const struct route_map_rule_cmd *cmd;
138
139 /* For pretty printing. */
140 char *rule_str;
141
142 /* Pre-compiled match rule. */
143 void *value;
144
145 /* Linked list. */
146 struct route_map_rule *next;
147 struct route_map_rule *prev;
148};
149
718e3744 150/* Route map rule list. */
d62a17ae 151struct route_map_rule_list {
152 struct route_map_rule *head;
153 struct route_map_rule *tail;
718e3744 154};
155
54a35ff4
RZ
156/* Forward struct declaration: the complete can be found later this file. */
157struct routemap_hook_context;
158
718e3744 159/* Route map index structure. */
d62a17ae 160struct route_map_index {
161 struct route_map *map;
162 char *description;
718e3744 163
d62a17ae 164 /* Preference of this route map rule. */
165 int pref;
718e3744 166
d62a17ae 167 /* Route map type permit or deny. */
168 enum route_map_type type;
718e3744 169
d62a17ae 170 /* Do we follow old rules, or hop forward? */
171 route_map_end_t exitpolicy;
718e3744 172
d62a17ae 173 /* If we're using "GOTO", to where do we go? */
174 int nextpref;
718e3744 175
d62a17ae 176 /* If we're using "CALL", to which route-map do ew go? */
177 char *nextrm;
fee0f4c6 178
d62a17ae 179 /* Matching rule list. */
180 struct route_map_rule_list match_list;
181 struct route_map_rule_list set_list;
718e3744 182
d62a17ae 183 /* Make linked list. */
184 struct route_map_index *next;
185 struct route_map_index *prev;
e80e7cce 186
279b0607
DS
187 /* Keep track how many times we've try to apply */
188 uint64_t applied;
1fa30509 189 uint64_t applied_clear;
279b0607 190
54a35ff4
RZ
191 /* List of match/sets contexts. */
192 TAILQ_HEAD(, routemap_hook_context) rhclist;
193
96244aca 194 QOBJ_FIELDS;
718e3744 195};
96244aca 196DECLARE_QOBJ_TYPE(route_map_index);
718e3744 197
f71ed6df
YR
198/* route map maximum length. Not strictly the maximum xpath length but cannot be
199 * greater
200 */
201#define RMAP_NAME_MAXLEN XPATH_MAXLEN
202
718e3744 203/* Route map list structure. */
d62a17ae 204struct route_map {
205 /* Name of route map. */
206 char *name;
718e3744 207
d62a17ae 208 /* Route map's rule. */
209 struct route_map_index *head;
210 struct route_map_index *tail;
718e3744 211
d62a17ae 212 /* Make linked list. */
213 struct route_map *next;
214 struct route_map *prev;
518f0eb1 215
d62a17ae 216 /* Maintain update info */
e4694d0d
DS
217 bool to_be_processed; /* True if modification isn't acted on yet */
218 bool deleted; /* If 1, then this node will be deleted */
49a08bb0 219 bool optimization_disabled;
e80e7cce 220
279b0607
DS
221 /* How many times have we applied this route-map */
222 uint64_t applied;
1fa30509 223 uint64_t applied_clear;
279b0607 224
4a2a09d0 225 /* Counter to track active usage of this route-map */
226 uint16_t use_count;
227
49a08bb0
NT
228 /* Tables to maintain IPv4 and IPv6 prefixes from
229 * the prefix-list match clause.
230 */
231 struct route_table *ipv4_prefix_table;
232 struct route_table *ipv6_prefix_table;
233
96244aca 234 QOBJ_FIELDS;
718e3744 235};
96244aca 236DECLARE_QOBJ_TYPE(route_map);
718e3744 237
d5d737a2
SP
238/* Route-map match conditions */
239#define IS_MATCH_INTERFACE(C) \
240 (strmatch(C, "frr-route-map:interface"))
241#define IS_MATCH_IPv4_ADDRESS_LIST(C) \
242 (strmatch(C, "frr-route-map:ipv4-address-list"))
243#define IS_MATCH_IPv6_ADDRESS_LIST(C) \
244 (strmatch(C, "frr-route-map:ipv6-address-list"))
245#define IS_MATCH_IPv4_NEXTHOP_LIST(C) \
246 (strmatch(C, "frr-route-map:ipv4-next-hop-list"))
bc63ba98
DA
247#define IS_MATCH_IPv6_NEXTHOP_LIST(C) \
248 (strmatch(C, "frr-route-map:ipv6-next-hop-list"))
d5d737a2
SP
249#define IS_MATCH_IPv4_PREFIX_LIST(C) \
250 (strmatch(C, "frr-route-map:ipv4-prefix-list"))
251#define IS_MATCH_IPv6_PREFIX_LIST(C) \
252 (strmatch(C, "frr-route-map:ipv6-prefix-list"))
253#define IS_MATCH_IPv4_NEXTHOP_PREFIX_LIST(C) \
254 (strmatch(C, "frr-route-map:ipv4-next-hop-prefix-list"))
82f191a2
DA
255#define IS_MATCH_IPv6_NEXTHOP_PREFIX_LIST(C) \
256 (strmatch(C, "frr-route-map:ipv6-next-hop-prefix-list"))
d5d737a2
SP
257#define IS_MATCH_IPv4_NEXTHOP_TYPE(C) \
258 (strmatch(C, "frr-route-map:ipv4-next-hop-type"))
259#define IS_MATCH_IPv6_NEXTHOP_TYPE(C) \
260 (strmatch(C, "frr-route-map:ipv6-next-hop-type"))
261#define IS_MATCH_METRIC(C) \
262 (strmatch(C, "frr-route-map:match-metric"))
263#define IS_MATCH_TAG(C) (strmatch(C, "frr-route-map:match-tag"))
264/* Zebra route-map match conditions */
265#define IS_MATCH_IPv4_PREFIX_LEN(C) \
266 (strmatch(C, "frr-zebra-route-map:ipv4-prefix-length"))
267#define IS_MATCH_IPv6_PREFIX_LEN(C) \
268 (strmatch(C, "frr-zebra-route-map:ipv6-prefix-length"))
269#define IS_MATCH_IPv4_NH_PREFIX_LEN(C) \
270 (strmatch(C, "frr-zebra-route-map:ipv4-next-hop-prefix-length"))
271#define IS_MATCH_SRC_PROTO(C) \
272 (strmatch(C, "frr-zebra-route-map:source-protocol"))
273#define IS_MATCH_SRC_INSTANCE(C) \
274 (strmatch(C, "frr-zebra-route-map:source-instance"))
275/* BGP route-map match conditions */
276#define IS_MATCH_LOCAL_PREF(C) \
277 (strmatch(C, "frr-bgp-route-map:match-local-preference"))
2690f18c 278#define IS_MATCH_ALIAS(C) (strmatch(C, "frr-bgp-route-map:match-alias"))
49ecb8b8 279#define IS_MATCH_SCRIPT(C) (strmatch(C, "frr-bgp-route-map:match-script"))
d5d737a2
SP
280#define IS_MATCH_ORIGIN(C) \
281 (strmatch(C, "frr-bgp-route-map:match-origin"))
282#define IS_MATCH_RPKI(C) (strmatch(C, "frr-bgp-route-map:rpki"))
324e8b1f
DA
283#define IS_MATCH_RPKI_EXTCOMMUNITY(C) \
284 (strmatch(C, "frr-bgp-route-map:rpki-extcommunity"))
d5d737a2
SP
285#define IS_MATCH_PROBABILITY(C) \
286 (strmatch(C, "frr-bgp-route-map:probability"))
287#define IS_MATCH_SRC_VRF(C) \
288 (strmatch(C, "frr-bgp-route-map:source-vrf"))
289#define IS_MATCH_PEER(C) (strmatch(C, "frr-bgp-route-map:peer"))
290#define IS_MATCH_AS_LIST(C) \
291 (strmatch(C, "frr-bgp-route-map:as-path-list"))
292#define IS_MATCH_MAC_LIST(C) \
293 (strmatch(C, "frr-bgp-route-map:mac-address-list"))
294#define IS_MATCH_EVPN_ROUTE_TYPE(C) \
295 (strmatch(C, "frr-bgp-route-map:evpn-route-type"))
296#define IS_MATCH_EVPN_DEFAULT_ROUTE(C) \
297 (strmatch(C, "frr-bgp-route-map:evpn-default-route"))
298#define IS_MATCH_EVPN_VNI(C) \
299 (strmatch(C, "frr-bgp-route-map:evpn-vni"))
300#define IS_MATCH_EVPN_DEFAULT_ROUTE(C) \
301 (strmatch(C, "frr-bgp-route-map:evpn-default-route"))
302#define IS_MATCH_EVPN_RD(C) \
303 (strmatch(C, "frr-bgp-route-map:evpn-rd"))
304#define IS_MATCH_ROUTE_SRC(C) \
305 (strmatch(C, "frr-bgp-route-map:ip-route-source"))
306#define IS_MATCH_ROUTE_SRC_PL(C) \
307 (strmatch(C, "frr-bgp-route-map:ip-route-source-prefix-list"))
308#define IS_MATCH_COMMUNITY(C) \
309 (strmatch(C, "frr-bgp-route-map:match-community"))
310#define IS_MATCH_LCOMMUNITY(C) \
311 (strmatch(C, "frr-bgp-route-map:match-large-community"))
312#define IS_MATCH_EXTCOMMUNITY(C) \
313 (strmatch(C, "frr-bgp-route-map:match-extcommunity"))
314#define IS_MATCH_IPV4_NH(C) \
315 (strmatch(C, "frr-bgp-route-map:ipv4-nexthop"))
316#define IS_MATCH_IPV6_NH(C) \
317 (strmatch(C, "frr-bgp-route-map:ipv6-nexthop"))
318
319/* Route-map set actions */
320#define IS_SET_IPv4_NH(A) \
321 (strmatch(A, "frr-route-map:ipv4-next-hop"))
322#define IS_SET_IPv6_NH(A) \
323 (strmatch(A, "frr-route-map:ipv6-next-hop"))
324#define IS_SET_METRIC(A) \
325 (strmatch(A, "frr-route-map:set-metric"))
326#define IS_SET_TAG(A) (strmatch(A, "frr-route-map:set-tag"))
327#define IS_SET_SR_TE_COLOR(A) \
328 (strmatch(A, "frr-route-map:set-sr-te-color"))
329/* Zebra route-map set actions */
330#define IS_SET_SRC(A) \
331 (strmatch(A, "frr-zebra-route-map:src-address"))
332/* OSPF route-map set actions */
333#define IS_SET_METRIC_TYPE(A) \
334 (strmatch(A, "frr-ospf-route-map:metric-type"))
335#define IS_SET_FORWARDING_ADDR(A) \
336 (strmatch(A, "frr-ospf6-route-map:forwarding-address"))
337/* BGP route-map_set actions */
338#define IS_SET_WEIGHT(A) \
339 (strmatch(A, "frr-bgp-route-map:weight"))
340#define IS_SET_TABLE(A) (strmatch(A, "frr-bgp-route-map:table"))
341#define IS_SET_LOCAL_PREF(A) \
342 (strmatch(A, "frr-bgp-route-map:set-local-preference"))
343#define IS_SET_LABEL_INDEX(A) \
344 (strmatch(A, "frr-bgp-route-map:label-index"))
345#define IS_SET_DISTANCE(A) \
346 (strmatch(A, "frr-bgp-route-map:distance"))
347#define IS_SET_ORIGIN(A) \
348 (strmatch(A, "frr-bgp-route-map:set-origin"))
349#define IS_SET_ATOMIC_AGGREGATE(A) \
350 (strmatch(A, "frr-bgp-route-map:atomic-aggregate"))
97a52c82 351#define IS_SET_AIGP_METRIC(A) (strmatch(A, "frr-bgp-route-map:aigp-metric"))
d5d737a2
SP
352#define IS_SET_ORIGINATOR_ID(A) \
353 (strmatch(A, "frr-bgp-route-map:originator-id"))
354#define IS_SET_COMM_LIST_DEL(A) \
355 (strmatch(A, "frr-bgp-route-map:comm-list-delete"))
356#define IS_SET_LCOMM_LIST_DEL(A) \
357 (strmatch(A, "frr-bgp-route-map:large-comm-list-delete"))
358#define IS_SET_LCOMMUNITY(A) \
359 (strmatch(A, "frr-bgp-route-map:set-large-community"))
360#define IS_SET_COMMUNITY(A) \
361 (strmatch(A, "frr-bgp-route-map:set-community"))
bb4dcdd1
DA
362#define IS_SET_EXTCOMMUNITY_NONE(A) \
363 (strmatch(A, "frr-bgp-route-map:set-extcommunity-none"))
d5d737a2
SP
364#define IS_SET_EXTCOMMUNITY_RT(A) \
365 (strmatch(A, "frr-bgp-route-map:set-extcommunity-rt"))
366#define IS_SET_EXTCOMMUNITY_SOO(A) \
367 (strmatch(A, "frr-bgp-route-map:set-extcommunity-soo"))
71bdae66
DA
368#define IS_SET_EXTCOMMUNITY_LB(A) \
369 (strmatch(A, "frr-bgp-route-map:set-extcommunity-lb"))
d5d737a2
SP
370#define IS_SET_AGGREGATOR(A) \
371 (strmatch(A, "frr-bgp-route-map:aggregator"))
372#define IS_SET_AS_PREPEND(A) \
373 (strmatch(A, "frr-bgp-route-map:as-path-prepend"))
374#define IS_SET_AS_EXCLUDE(A) \
375 (strmatch(A, "frr-bgp-route-map:as-path-exclude"))
77e3d821 376#define IS_SET_AS_REPLACE(A) (strmatch(A, "frr-bgp-route-map:as-path-replace"))
d5d737a2
SP
377#define IS_SET_IPV6_NH_GLOBAL(A) \
378 (strmatch(A, "frr-bgp-route-map:ipv6-nexthop-global"))
379#define IS_SET_IPV6_VPN_NH(A) \
380 (strmatch(A, "frr-bgp-route-map:ipv6-vpn-address"))
381#define IS_SET_IPV6_PEER_ADDR(A) \
382 (strmatch(A, "frr-bgp-route-map:ipv6-peer-address"))
383#define IS_SET_IPV6_PREFER_GLOBAL(A) \
384 (strmatch(A, "frr-bgp-route-map:ipv6-prefer-global"))
385#define IS_SET_IPV4_VPN_NH(A) \
386 (strmatch(A, "frr-bgp-route-map:ipv4-vpn-address"))
387#define IS_SET_BGP_IPV4_NH(A) \
388 (strmatch(A, "frr-bgp-route-map:set-ipv4-nexthop"))
d0a4ee60
AD
389#define IS_SET_BGP_EVPN_GATEWAY_IP_IPV4(A) \
390 (strmatch(A, "frr-bgp-route-map:set-evpn-gateway-ip-ipv4"))
391#define IS_SET_BGP_EVPN_GATEWAY_IP_IPV6(A) \
392 (strmatch(A, "frr-bgp-route-map:set-evpn-gateway-ip-ipv6"))
1bb550b6
PG
393#define IS_SET_BGP_L3VPN_NEXTHOP_ENCAPSULATION(A) \
394 (strmatch(A, "frr-bgp-route-map:set-l3vpn-nexthop-encapsulation"))
d5d737a2 395
14b06691
IR
396enum ecommunity_lb_type {
397 EXPLICIT_BANDWIDTH,
398 CUMULATIVE_BANDWIDTH,
399 COMPUTED_BANDWIDTH
400};
401
718e3744 402/* Prototypes. */
d62a17ae 403extern void route_map_init(void);
8619629a
DS
404
405/*
406 * This should only be called on shutdown
407 * Additionally this function sets the hooks to NULL
408 * before any processing is done.
409 */
d62a17ae 410extern void route_map_finish(void);
718e3744 411
412/* Add match statement to route map. */
cda7187d
DS
413extern enum rmap_compile_rets route_map_add_match(struct route_map_index *index,
414 const char *match_name,
415 const char *match_arg,
416 route_map_event_t type);
718e3744 417
418/* Delete specified route match rule. */
cda7187d
DS
419extern enum rmap_compile_rets
420route_map_delete_match(struct route_map_index *index,
909f3d56 421 const char *match_name, const char *match_arg,
422 route_map_event_t type);
718e3744 423
d62a17ae 424extern const char *route_map_get_match_arg(struct route_map_index *index,
425 const char *match_name);
518f0eb1 426
718e3744 427/* Add route-map set statement to the route map. */
cda7187d
DS
428extern enum rmap_compile_rets route_map_add_set(struct route_map_index *index,
429 const char *set_name,
430 const char *set_arg);
718e3744 431
432/* Delete route map set rule. */
cda7187d
DS
433extern enum rmap_compile_rets
434route_map_delete_set(struct route_map_index *index,
435 const char *set_name, const char *set_arg);
718e3744 436
88711d8a
DL
437/* struct route_map_rule_cmd is kept const in order to not have writable
438 * function pointers (which is a security benefit.) Hence, below struct is
439 * used as proxy for hashing these for by-name lookup.
440 */
441
442PREDECL_HASH(rmap_cmd_name);
443
444struct route_map_rule_cmd_proxy {
445 struct rmap_cmd_name_item itm;
446 const struct route_map_rule_cmd *cmd;
447};
448
449/* ... and just automatically create a proxy struct for each call location
450 * to route_map_install_{match,set} to avoid unnecessarily added boilerplate
451 * for each route-map user
452 */
453
454#define route_map_install_match(c) \
455 do { \
456 static struct route_map_rule_cmd_proxy proxy = {.cmd = c}; \
457 _route_map_install_match(&proxy); \
458 } while (0)
459
460#define route_map_install_set(c) \
461 do { \
462 static struct route_map_rule_cmd_proxy proxy = {.cmd = c}; \
463 _route_map_install_set(&proxy); \
464 } while (0)
465
718e3744 466/* Install rule command to the match list. */
88711d8a 467extern void _route_map_install_match(struct route_map_rule_cmd_proxy *proxy);
718e3744 468
6a74c5f9
DS
469/*
470 * Install rule command to the set list.
471 *
472 * When installing a particular item, Allow a difference of handling
473 * of bad cli inputted(return NULL) -vs- this particular daemon cannot use
474 * this form of the command(return a pointer and handle it appropriately
475 * in the apply command). See 'set metric' command
476 * as it is handled in ripd/ripngd and ospfd.
477 */
88711d8a 478extern void _route_map_install_set(struct route_map_rule_cmd_proxy *proxy);
718e3744 479
480/* Lookup route map by name. */
d62a17ae 481extern struct route_map *route_map_lookup_by_name(const char *name);
718e3744 482
1de27621
DA
483/* Simple helper to warn if route-map does not exist. */
484struct route_map *route_map_lookup_warn_noexist(struct vty *vty, const char *name);
485
718e3744 486/* Apply route map to the object. */
c2125847
IR
487extern route_map_result_t route_map_apply_ext(struct route_map *map,
488 const struct prefix *prefix,
489 void *match_object,
a633fb57 490 void *set_object, int *pref);
c2125847 491#define route_map_apply(map, prefix, object) \
a633fb57 492 route_map_apply_ext(map, prefix, object, object, NULL)
d62a17ae 493
494extern void route_map_add_hook(void (*func)(const char *));
495extern void route_map_delete_hook(void (*func)(const char *));
097b5973
DS
496
497/*
498 * This is the callback for when something has changed about a
499 * route-map. The interested parties can register to receive
500 * this data.
501 *
502 * name - Is the name of the changed route-map
503 */
504extern void route_map_event_hook(void (*func)(const char *name));
7096e938 505extern int route_map_mark_updated(const char *name);
46a69f10 506extern void route_map_walk_update_list(void (*update_fn)(char *name));
d62a17ae 507extern void route_map_upd8_dependency(route_map_event_t type, const char *arg,
508 const char *rmap_name);
509extern void route_map_notify_dependencies(const char *affected_name,
510 route_map_event_t event);
2d26f094
NT
511extern void
512route_map_notify_pentry_dependencies(const char *affected_name,
513 struct prefix_list_entry *pentry,
514 route_map_event_t event);
d5d737a2 515extern int generic_match_add(struct route_map_index *index,
d62a17ae 516 const char *command, const char *arg,
d5d737a2
SP
517 route_map_event_t type,
518 char *errmsg, size_t errmsg_len);
519extern int generic_match_delete(struct route_map_index *index,
d62a17ae 520 const char *command, const char *arg,
d5d737a2
SP
521 route_map_event_t type,
522 char *errmsg, size_t errmsg_len);
523
524extern int generic_set_add(struct route_map_index *index,
525 const char *command, const char *arg,
526 char *errmsg, size_t errmsg_len);
527extern int generic_set_delete(struct route_map_index *index,
528 const char *command, const char *arg,
529 char *errmsg, size_t errmsg_len);
82f97584
DW
530
531
532/* match interface */
d62a17ae 533extern void route_map_match_interface_hook(int (*func)(
d5d737a2
SP
534 struct route_map_index *index, const char *command,
535 const char *arg, route_map_event_t type,
536 char *errmsg, size_t errmsg_len));
82f97584 537/* no match interface */
d62a17ae 538extern void route_map_no_match_interface_hook(int (*func)(
d5d737a2
SP
539 struct route_map_index *index, const char *command,
540 const char *arg, route_map_event_t type,
541 char *errmsg, size_t errmsg_len));
82f97584 542/* match ip address */
d62a17ae 543extern void route_map_match_ip_address_hook(int (*func)(
d5d737a2
SP
544 struct route_map_index *index, const char *command,
545 const char *arg, route_map_event_t type,
546 char *errmsg, size_t errmsg_len));
82f97584 547/* no match ip address */
d62a17ae 548extern void route_map_no_match_ip_address_hook(int (*func)(
d5d737a2
SP
549 struct route_map_index *index, const char *command,
550 const char *arg, route_map_event_t type,
551 char *errmsg, size_t errmsg_len));
82f97584 552/* match ip address prefix list */
d62a17ae 553extern void route_map_match_ip_address_prefix_list_hook(int (*func)(
d5d737a2
SP
554 struct route_map_index *index, const char *command,
555 const char *arg, route_map_event_t type,
556 char *errmsg, size_t errmsg_len));
82f97584 557/* no match ip address prefix list */
d62a17ae 558extern void route_map_no_match_ip_address_prefix_list_hook(int (*func)(
d5d737a2
SP
559 struct route_map_index *index, const char *command,
560 const char *arg, route_map_event_t type,
561 char *errmsg, size_t errmsg_len));
82f97584 562/* match ip next hop */
d62a17ae 563extern void route_map_match_ip_next_hop_hook(int (*func)(
d5d737a2
SP
564 struct route_map_index *index, const char *command,
565 const char *arg, route_map_event_t type,
566 char *errmsg, size_t errmsg_len));
82f97584 567/* no match ip next hop */
d62a17ae 568extern void route_map_no_match_ip_next_hop_hook(int (*func)(
bc63ba98
DA
569 struct route_map_index *index, const char *command, const char *arg,
570 route_map_event_t type, char *errmsg, size_t errmsg_len));
571/* match ipv6 next hop */
572extern void route_map_match_ipv6_next_hop_hook(int (*func)(
573 struct route_map_index *index, const char *command, const char *arg,
574 route_map_event_t type, char *errmsg, size_t errmsg_len));
575/* no match ipv6 next hop */
576extern void route_map_no_match_ipv6_next_hop_hook(int (*func)(
577 struct route_map_index *index, const char *command, const char *arg,
578 route_map_event_t type, char *errmsg, size_t errmsg_len));
82f97584 579/* match ip next hop prefix list */
d62a17ae 580extern void route_map_match_ip_next_hop_prefix_list_hook(int (*func)(
d5d737a2
SP
581 struct route_map_index *index, const char *command,
582 const char *arg, route_map_event_t type,
583 char *errmsg, size_t errmsg_len));
82f97584 584/* no match ip next hop prefix list */
d62a17ae 585extern void route_map_no_match_ip_next_hop_prefix_list_hook(int (*func)(
d5d737a2
SP
586 struct route_map_index *index, const char *command,
587 const char *arg, route_map_event_t type,
588 char *errmsg, size_t errmsg_len));
61ad901e
DA
589/* match ip next hop type */
590extern void route_map_match_ip_next_hop_type_hook(int (*func)(
d5d737a2
SP
591 struct route_map_index *index, const char *command,
592 const char *arg, route_map_event_t type,
593 char *errmsg, size_t errmsg_len));
61ad901e
DA
594/* no match ip next hop type */
595extern void route_map_no_match_ip_next_hop_type_hook(int (*func)(
d5d737a2
SP
596 struct route_map_index *index, const char *command,
597 const char *arg, route_map_event_t type,
598 char *errmsg, size_t errmsg_len));
82f97584 599/* match ipv6 address */
d62a17ae 600extern void route_map_match_ipv6_address_hook(int (*func)(
d5d737a2
SP
601 struct route_map_index *index, const char *command,
602 const char *arg, route_map_event_t type,
603 char *errmsg, size_t errmsg_len));
82f97584 604/* no match ipv6 address */
d62a17ae 605extern void route_map_no_match_ipv6_address_hook(int (*func)(
d5d737a2
SP
606 struct route_map_index *index, const char *command,
607 const char *arg, route_map_event_t type,
608 char *errmsg, size_t errmsg_len));
82f97584 609/* match ipv6 address prefix list */
d62a17ae 610extern void route_map_match_ipv6_address_prefix_list_hook(int (*func)(
d5d737a2
SP
611 struct route_map_index *index, const char *command,
612 const char *arg, route_map_event_t type,
613 char *errmsg, size_t errmsg_len));
82f97584 614/* no match ipv6 address prefix list */
d62a17ae 615extern void route_map_no_match_ipv6_address_prefix_list_hook(int (*func)(
d5d737a2
SP
616 struct route_map_index *index, const char *command,
617 const char *arg, route_map_event_t type,
618 char *errmsg, size_t errmsg_len));
61ad901e
DA
619/* match ipv6 next-hop type */
620extern void route_map_match_ipv6_next_hop_type_hook(int (*func)(
d5d737a2
SP
621 struct route_map_index *index, const char *command,
622 const char *arg, route_map_event_t type,
623 char *errmsg, size_t errmsg_len));
61ad901e
DA
624/* no match ipv6 next-hop type */
625extern void route_map_no_match_ipv6_next_hop_type_hook(int (*func)(
d5d737a2
SP
626 struct route_map_index *index, const char *command,
627 const char *arg, route_map_event_t type,
628 char *errmsg, size_t errmsg_len));
82f191a2
DA
629/* match ipv6 next-hop prefix-list */
630extern void route_map_match_ipv6_next_hop_prefix_list_hook(int (*func)(
631 struct route_map_index *index, const char *command, const char *arg,
632 route_map_event_t type, char *errmsg, size_t errmsg_len));
633/* no match ipv6 next-hop prefix-list */
634extern void route_map_no_match_ipv6_next_hop_prefix_list_hook(int (*func)(
635 struct route_map_index *index, const char *command, const char *arg,
636 route_map_event_t type, char *errmsg, size_t errmsg_len));
82f97584 637/* match metric */
d62a17ae 638extern void route_map_match_metric_hook(int (*func)(
d5d737a2
SP
639 struct route_map_index *index, const char *command,
640 const char *arg, route_map_event_t type,
641 char *errmsg, size_t errmsg_len));
82f97584 642/* no match metric */
d62a17ae 643extern void route_map_no_match_metric_hook(int (*func)(
d5d737a2
SP
644 struct route_map_index *index, const char *command,
645 const char *arg, route_map_event_t type,
646 char *errmsg, size_t errmsg_len));
82f97584 647/* match tag */
d62a17ae 648extern void route_map_match_tag_hook(int (*func)(
d5d737a2
SP
649 struct route_map_index *index, const char *command,
650 const char *arg, route_map_event_t type,
651 char *errmsg, size_t errmsg_len));
82f97584 652/* no match tag */
d62a17ae 653extern void route_map_no_match_tag_hook(int (*func)(
d5d737a2
SP
654 struct route_map_index *index, const char *command,
655 const char *arg, route_map_event_t type,
656 char *errmsg, size_t errmsg_len));
31f937fb
SM
657/* set sr-te color */
658extern void route_map_set_srte_color_hook(
d5d737a2
SP
659 int (*func)(struct route_map_index *index,
660 const char *command, const char *arg,
661 char *errmsg, size_t errmsg_len));
31f937fb
SM
662/* no set sr-te color */
663extern void route_map_no_set_srte_color_hook(
d5d737a2
SP
664 int (*func)(struct route_map_index *index,
665 const char *command, const char *arg,
666 char *errmsg, size_t errmsg_len));
82f97584 667/* set ip nexthop */
d62a17ae 668extern void route_map_set_ip_nexthop_hook(
d5d737a2
SP
669 int (*func)(struct route_map_index *index,
670 const char *command, const char *arg,
671 char *errmsg, size_t errmsg_len));
82f97584 672/* no set ip nexthop */
d62a17ae 673extern void route_map_no_set_ip_nexthop_hook(
d5d737a2
SP
674 int (*func)(struct route_map_index *index,
675 const char *command, const char *arg,
676 char *errmsg, size_t errmsg_len));
82f97584 677/* set ipv6 nexthop local */
d62a17ae 678extern void route_map_set_ipv6_nexthop_local_hook(
d5d737a2
SP
679 int (*func)(struct route_map_index *index,
680 const char *command, const char *arg,
681 char *errmsg, size_t errmsg_len));
82f97584 682/* no set ipv6 nexthop local */
d62a17ae 683extern void route_map_no_set_ipv6_nexthop_local_hook(
d5d737a2
SP
684 int (*func)(struct route_map_index *index,
685 const char *command, const char *arg,
686 char *errmsg, size_t errmsg_len));
82f97584 687/* set metric */
d5d737a2 688extern void route_map_set_metric_hook(int (*func)(struct route_map_index *index,
d62a17ae 689 const char *command,
d5d737a2
SP
690 const char *arg,
691 char *errmsg,
692 size_t errmsg_len));
82f97584 693/* no set metric */
d62a17ae 694extern void route_map_no_set_metric_hook(
d5d737a2
SP
695 int (*func)(struct route_map_index *index,
696 const char *command, const char *arg,
697 char *errmsg, size_t errmsg_len));
82f97584 698/* set tag */
d5d737a2 699extern void route_map_set_tag_hook(int (*func)(struct route_map_index *index,
d62a17ae 700 const char *command,
d5d737a2
SP
701 const char *arg,
702 char *errmsg,
703 size_t errmsg_len));
82f97584 704/* no set tag */
d5d737a2 705extern void route_map_no_set_tag_hook(int (*func)(struct route_map_index *index,
d62a17ae 706 const char *command,
d5d737a2
SP
707 const char *arg,
708 char *errmsg,
709 size_t errmsg_len));
e52702f2 710
d62a17ae 711extern void *route_map_rule_tag_compile(const char *arg);
712extern void route_map_rule_tag_free(void *rule);
dc9ffce8 713
4a2a09d0 714/* Increment the route-map used counter */
715extern void route_map_counter_increment(struct route_map *map);
716
717/* Decrement the route-map used counter */
718extern void route_map_counter_decrement(struct route_map *map);
719
a7282663
RZ
720/* Route map hooks data structure. */
721struct route_map_match_set_hooks {
722 /* match interface */
d5d737a2 723 int (*match_interface)(struct route_map_index *index,
a7282663 724 const char *command, const char *arg,
d5d737a2
SP
725 route_map_event_t type,
726 char *errmsg, size_t errmsg_len);
a7282663
RZ
727
728 /* no match interface */
d5d737a2 729 int (*no_match_interface)(struct route_map_index *index,
a7282663 730 const char *command, const char *arg,
d5d737a2
SP
731 route_map_event_t type,
732 char *errmsg, size_t errmsg_len);
a7282663
RZ
733
734 /* match ip address */
d5d737a2 735 int (*match_ip_address)(struct route_map_index *index,
a7282663 736 const char *command, const char *arg,
d5d737a2
SP
737 route_map_event_t type,
738 char *errmsg, size_t errmsg_len);
a7282663
RZ
739
740 /* no match ip address */
d5d737a2 741 int (*no_match_ip_address)(struct route_map_index *index,
a7282663 742 const char *command, const char *arg,
d5d737a2
SP
743 route_map_event_t type,
744 char *errmsg, size_t errmsg_len);
a7282663
RZ
745
746 /* match ip address prefix list */
d5d737a2 747 int (*match_ip_address_prefix_list)(struct route_map_index *index,
a7282663
RZ
748 const char *command,
749 const char *arg,
d5d737a2
SP
750 route_map_event_t type,
751 char *errmsg, size_t errmsg_len);
a7282663
RZ
752
753 /* no match ip address prefix list */
d5d737a2 754 int (*no_match_ip_address_prefix_list)(struct route_map_index *index,
a7282663
RZ
755 const char *command,
756 const char *arg,
d5d737a2
SP
757 route_map_event_t type,
758 char *errmsg, size_t errmsg_len);
a7282663
RZ
759
760 /* match ip next hop */
d5d737a2 761 int (*match_ip_next_hop)(struct route_map_index *index,
a7282663 762 const char *command, const char *arg,
d5d737a2
SP
763 route_map_event_t type,
764 char *errmsg, size_t errmsg_len);
a7282663
RZ
765
766 /* no match ip next hop */
d5d737a2 767 int (*no_match_ip_next_hop)(struct route_map_index *index,
a7282663 768 const char *command, const char *arg,
d5d737a2
SP
769 route_map_event_t type,
770 char *errmsg, size_t errmsg_len);
a7282663 771
bc63ba98
DA
772 /* match ipv6 next hop */
773 int (*match_ipv6_next_hop)(struct route_map_index *index,
774 const char *command, const char *arg,
775 route_map_event_t type, char *errmsg,
776 size_t errmsg_len);
777
778 /* no match ipv6 next hop */
779 int (*no_match_ipv6_next_hop)(struct route_map_index *index,
780 const char *command, const char *arg,
781 route_map_event_t type, char *errmsg,
782 size_t errmsg_len);
783
82f191a2
DA
784 /* match ipv6 next hop prefix-list */
785 int (*match_ipv6_next_hop_prefix_list)(struct route_map_index *index,
786 const char *command,
787 const char *arg,
788 route_map_event_t type,
789 char *errmsg, size_t errmsg_len);
790
791 /* no match ipv6 next-hop prefix-list */
792 int (*no_match_ipv6_next_hop_prefix_list)(struct route_map_index *index,
793 const char *command,
794 const char *arg,
795 route_map_event_t type,
796 char *errmsg,
797 size_t errmsg_len);
798
a7282663 799 /* match ip next hop prefix list */
d5d737a2 800 int (*match_ip_next_hop_prefix_list)(struct route_map_index *index,
a7282663
RZ
801 const char *command,
802 const char *arg,
d5d737a2
SP
803 route_map_event_t type,
804 char *errmsg, size_t errmsg_len);
a7282663
RZ
805
806 /* no match ip next hop prefix list */
d5d737a2 807 int (*no_match_ip_next_hop_prefix_list)(struct route_map_index *index,
a7282663
RZ
808 const char *command,
809 const char *arg,
d5d737a2
SP
810 route_map_event_t type,
811 char *errmsg,
812 size_t errmsg_len);
a7282663
RZ
813
814 /* match ip next-hop type */
d5d737a2
SP
815 int (*match_ip_next_hop_type)(struct route_map_index *index,
816 const char *command,
817 const char *arg,
818 route_map_event_t type,
819 char *errmsg,
820 size_t errmsg_len);
a7282663
RZ
821
822 /* no match ip next-hop type */
d5d737a2
SP
823 int (*no_match_ip_next_hop_type)(struct route_map_index *index,
824 const char *command,
825 const char *arg,
826 route_map_event_t type,
827 char *errmsg,
828 size_t errmsg_len);
a7282663
RZ
829
830 /* match ipv6 address */
d5d737a2 831 int (*match_ipv6_address)(struct route_map_index *index,
a7282663 832 const char *command, const char *arg,
d5d737a2
SP
833 route_map_event_t type,
834 char *errmsg, size_t errmsg_len);
a7282663
RZ
835
836 /* no match ipv6 address */
d5d737a2 837 int (*no_match_ipv6_address)(struct route_map_index *index,
a7282663 838 const char *command, const char *arg,
d5d737a2
SP
839 route_map_event_t type,
840 char *errmsg, size_t errmsg_len);
a7282663
RZ
841
842
843 /* match ipv6 address prefix list */
d5d737a2 844 int (*match_ipv6_address_prefix_list)(struct route_map_index *index,
a7282663
RZ
845 const char *command,
846 const char *arg,
d5d737a2
SP
847 route_map_event_t type,
848 char *errmsg, size_t errmsg_len);
a7282663
RZ
849
850 /* no match ipv6 address prefix list */
d5d737a2 851 int (*no_match_ipv6_address_prefix_list)(struct route_map_index *index,
a7282663
RZ
852 const char *command,
853 const char *arg,
d5d737a2
SP
854 route_map_event_t type,
855 char *errmsg,
856 size_t errmsg_len);
a7282663
RZ
857
858 /* match ipv6 next-hop type */
d5d737a2 859 int (*match_ipv6_next_hop_type)(struct route_map_index *index,
a7282663
RZ
860 const char *command,
861 const char *arg,
d5d737a2
SP
862 route_map_event_t type,
863 char *errmsg, size_t errmsg_len);
a7282663
RZ
864
865 /* no match ipv6 next-hop type */
d5d737a2 866 int (*no_match_ipv6_next_hop_type)(struct route_map_index *index,
a7282663 867 const char *command, const char *arg,
d5d737a2
SP
868 route_map_event_t type,
869 char *errmsg, size_t errmsg_len);
a7282663
RZ
870
871 /* match metric */
d5d737a2 872 int (*match_metric)(struct route_map_index *index,
a7282663 873 const char *command, const char *arg,
d5d737a2
SP
874 route_map_event_t type,
875 char *errmsg, size_t errmsg_len);
a7282663
RZ
876
877 /* no match metric */
d5d737a2 878 int (*no_match_metric)(struct route_map_index *index,
a7282663 879 const char *command, const char *arg,
d5d737a2
SP
880 route_map_event_t type,
881 char *errmsg, size_t errmsg_len);
a7282663
RZ
882
883 /* match tag */
d5d737a2 884 int (*match_tag)(struct route_map_index *index,
a7282663 885 const char *command, const char *arg,
d5d737a2
SP
886 route_map_event_t type,
887 char *errmsg, size_t errmsg_len);
a7282663
RZ
888
889 /* no match tag */
d5d737a2 890 int (*no_match_tag)(struct route_map_index *index,
a7282663 891 const char *command, const char *arg,
d5d737a2
SP
892 route_map_event_t type,
893 char *errmsg, size_t errmsg_len);
a7282663 894
31f937fb 895 /* set sr-te color */
d5d737a2
SP
896 int (*set_srte_color)(struct route_map_index *index,
897 const char *command, const char *arg,
898 char *errmsg, size_t errmsg_len);
31f937fb
SM
899
900 /* no set sr-te color */
d5d737a2
SP
901 int (*no_set_srte_color)(struct route_map_index *index,
902 const char *command, const char *arg,
903 char *errmsg, size_t errmsg_len);
31f937fb 904
a7282663 905 /* set ip nexthop */
d5d737a2
SP
906 int (*set_ip_nexthop)(struct route_map_index *index,
907 const char *command, const char *arg,
908 char *errmsg, size_t errmsg_len);
a7282663
RZ
909
910 /* no set ip nexthop */
d5d737a2
SP
911 int (*no_set_ip_nexthop)(struct route_map_index *index,
912 const char *command, const char *arg,
913 char *errmsg, size_t errmsg_len);
a7282663
RZ
914
915 /* set ipv6 nexthop local */
d5d737a2
SP
916 int (*set_ipv6_nexthop_local)(struct route_map_index *index,
917 const char *command, const char *arg,
918 char *errmsg, size_t errmsg_len);
a7282663
RZ
919
920 /* no set ipv6 nexthop local */
d5d737a2
SP
921 int (*no_set_ipv6_nexthop_local)(struct route_map_index *index,
922 const char *command, const char *arg,
923 char *errmsg, size_t errmsg_len);
a7282663
RZ
924
925 /* set metric */
d5d737a2
SP
926 int (*set_metric)(struct route_map_index *index,
927 const char *command, const char *arg,
928 char *errmsg, size_t errmsg_len);
a7282663
RZ
929
930 /* no set metric */
d5d737a2
SP
931 int (*no_set_metric)(struct route_map_index *index,
932 const char *command, const char *arg,
933 char *errmsg, size_t errmsg_len);
a7282663
RZ
934
935 /* set tag */
d5d737a2
SP
936 int (*set_tag)(struct route_map_index *index,
937 const char *command, const char *arg,
938 char *errmsg, size_t errmsg_len);
a7282663
RZ
939
940 /* no set tag */
d5d737a2
SP
941 int (*no_set_tag)(struct route_map_index *index,
942 const char *command, const char *arg,
943 char *errmsg, size_t errmsg_len);
a7282663
RZ
944};
945
946extern struct route_map_match_set_hooks rmap_match_set_hook;
947
948/* Making route map list. */
949struct route_map_list {
950 struct route_map *head;
951 struct route_map *tail;
952
953 void (*add_hook)(const char *);
954 void (*delete_hook)(const char *);
955 void (*event_hook)(const char *);
956};
957
958extern struct route_map_list route_map_master;
959
960extern struct route_map *route_map_get(const char *name);
961extern void route_map_delete(struct route_map *map);
962extern struct route_map_index *route_map_index_get(struct route_map *map,
963 enum route_map_type type,
964 int pref);
965extern void route_map_index_delete(struct route_map_index *index, int notify);
966
686d244f 967/* routemap_northbound.c */
d5d737a2 968typedef int (*routemap_match_hook_fun)(struct route_map_index *rmi,
686d244f 969 const char *command, const char *arg,
d5d737a2
SP
970 route_map_event_t event,
971 char *errmsg, size_t errmsg_len);
972typedef int (*routemap_set_hook_fun)(struct route_map_index *rmi,
973 const char *command, const char *arg,
974 char *errmsg, size_t errmsg_len);
686d244f
RZ
975struct routemap_hook_context {
976 struct route_map_index *rhc_rmi;
977 const char *rhc_rule;
978 route_map_event_t rhc_event;
979 routemap_set_hook_fun rhc_shook;
980 routemap_match_hook_fun rhc_mhook;
54a35ff4 981 TAILQ_ENTRY(routemap_hook_context) rhc_entry;
686d244f
RZ
982};
983
60ee8be1
RW
984int lib_route_map_entry_match_destroy(struct nb_cb_destroy_args *args);
985int lib_route_map_entry_set_destroy(struct nb_cb_destroy_args *args);
2b3e4807 986
54a35ff4
RZ
987struct routemap_hook_context *
988routemap_hook_context_insert(struct route_map_index *rmi);
989void routemap_hook_context_free(struct routemap_hook_context *rhc);
990
686d244f
RZ
991extern const struct frr_yang_module_info frr_route_map_info;
992
2b3e4807 993/* routemap_cli.c */
25605051
IR
994extern int route_map_instance_cmp(const struct lyd_node *dnode1,
995 const struct lyd_node *dnode2);
996extern void route_map_instance_show(struct vty *vty,
997 const struct lyd_node *dnode,
2b3e4807
RZ
998 bool show_defaults);
999extern void route_map_instance_show_end(struct vty *vty,
25605051
IR
1000 const struct lyd_node *dnode);
1001extern void route_map_condition_show(struct vty *vty,
1002 const struct lyd_node *dnode,
2b3e4807 1003 bool show_defaults);
25605051 1004extern void route_map_action_show(struct vty *vty, const struct lyd_node *dnode,
2b3e4807 1005 bool show_defaults);
25605051
IR
1006extern void route_map_exit_policy_show(struct vty *vty,
1007 const struct lyd_node *dnode,
2b3e4807 1008 bool show_defaults);
25605051 1009extern void route_map_call_show(struct vty *vty, const struct lyd_node *dnode,
2b3e4807
RZ
1010 bool show_defaults);
1011extern void route_map_description_show(struct vty *vty,
25605051 1012 const struct lyd_node *dnode,
2b3e4807 1013 bool show_defaults);
38133c4a 1014extern void route_map_optimization_disabled_show(struct vty *vty,
25605051 1015 const struct lyd_node *dnode,
38133c4a 1016 bool show_defaults);
2b3e4807
RZ
1017extern void route_map_cli_init(void);
1018
cf00164b
DS
1019extern void route_map_show_debug(struct vty *vty);
1020
5e244469
RW
1021#ifdef __cplusplus
1022}
1023#endif
1024
718e3744 1025#endif /* _ZEBRA_ROUTEMAP_H */