]> git.proxmox.com Git - mirror_frr.git/blob - lib/routemap.h
Merge pull request #5778 from ton31337/fix/add_doc_for_ebgp_connected_route_check
[mirror_frr.git] / lib / routemap.h
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 *
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
19 */
20
21 #ifndef _ZEBRA_ROUTEMAP_H
22 #define _ZEBRA_ROUTEMAP_H
23
24 #include "prefix.h"
25 #include "memory.h"
26 #include "qobj.h"
27 #include "vty.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 DECLARE_MTYPE(ROUTE_MAP_NAME)
34 DECLARE_MTYPE(ROUTE_MAP_RULE)
35 DECLARE_MTYPE(ROUTE_MAP_COMPILED)
36
37 /* Route map's type. */
38 enum route_map_type { RMAP_PERMIT, RMAP_DENY, RMAP_ANY };
39
40 typedef enum {
41 RMAP_DENYMATCH,
42 RMAP_PERMITMATCH
43 } route_map_result_t;
44
45 /*
46 * Route-map match or set result "Eg: match evpn vni xx"
47 * route-map match cmd always returns match/nomatch/noop
48 * match--> found a match
49 * nomatch--> didnt find a match
50 * noop--> not applicable
51 * route-map set retuns okay/error
52 * okay --> set was successful
53 * error --> set was not successful
54 */
55 enum route_map_cmd_result_t {
56 /*
57 * route-map match cmd results
58 */
59 RMAP_MATCH,
60 RMAP_NOMATCH,
61 RMAP_NOOP,
62 /*
63 * route-map set cmd results
64 */
65 RMAP_OKAY,
66 RMAP_ERROR
67 };
68
69
70 typedef enum {
71 RMAP_RIP,
72 RMAP_RIPNG,
73 RMAP_OSPF,
74 RMAP_OSPF6,
75 RMAP_BGP,
76 RMAP_ZEBRA,
77 RMAP_ISIS,
78 } route_map_object_t;
79
80 typedef enum { RMAP_EXIT, RMAP_GOTO, RMAP_NEXT } route_map_end_t;
81
82 typedef enum {
83 RMAP_EVENT_SET_ADDED,
84 RMAP_EVENT_SET_DELETED,
85 RMAP_EVENT_SET_REPLACED,
86 RMAP_EVENT_MATCH_ADDED,
87 RMAP_EVENT_MATCH_DELETED,
88 RMAP_EVENT_MATCH_REPLACED,
89 RMAP_EVENT_INDEX_ADDED,
90 RMAP_EVENT_INDEX_DELETED,
91 RMAP_EVENT_CALL_ADDED, /* call to another routemap added */
92 RMAP_EVENT_CALL_DELETED,
93 RMAP_EVENT_PLIST_ADDED,
94 RMAP_EVENT_PLIST_DELETED,
95 RMAP_EVENT_CLIST_ADDED,
96 RMAP_EVENT_CLIST_DELETED,
97 RMAP_EVENT_ECLIST_ADDED,
98 RMAP_EVENT_ECLIST_DELETED,
99 RMAP_EVENT_LLIST_ADDED,
100 RMAP_EVENT_LLIST_DELETED,
101 RMAP_EVENT_ASLIST_ADDED,
102 RMAP_EVENT_ASLIST_DELETED,
103 RMAP_EVENT_FILTER_ADDED,
104 RMAP_EVENT_FILTER_DELETED,
105 } route_map_event_t;
106
107 /* Depth limit in RMAP recursion using RMAP_CALL. */
108 #define RMAP_RECURSION_LIMIT 10
109
110 /* Route map rule structure for matching and setting. */
111 struct route_map_rule_cmd {
112 /* Route map rule name (e.g. as-path, metric) */
113 const char *str;
114
115 /* Function for value set or match. */
116 enum route_map_cmd_result_t (*func_apply)(void *rule,
117 const struct prefix *prefix,
118 route_map_object_t type,
119 void *object);
120
121 /* Compile argument and return result as void *. */
122 void *(*func_compile)(const char *);
123
124 /* Free allocated value by func_compile (). */
125 void (*func_free)(void *);
126
127 /** To get the rule key after Compilation **/
128 void *(*func_get_rmap_rule_key)(void *val);
129 };
130
131 /* Route map apply error. */
132 enum rmap_compile_rets {
133 RMAP_COMPILE_SUCCESS,
134
135 /* Route map rule is missing. */
136 RMAP_RULE_MISSING,
137
138 /* Route map rule can't compile */
139 RMAP_COMPILE_ERROR,
140
141 };
142
143 /* Route map rule. This rule has both `match' rule and `set' rule. */
144 struct route_map_rule {
145 /* Rule type. */
146 const struct route_map_rule_cmd *cmd;
147
148 /* For pretty printing. */
149 char *rule_str;
150
151 /* Pre-compiled match rule. */
152 void *value;
153
154 /* Linked list. */
155 struct route_map_rule *next;
156 struct route_map_rule *prev;
157 };
158
159 /* Route map rule list. */
160 struct route_map_rule_list {
161 struct route_map_rule *head;
162 struct route_map_rule *tail;
163 };
164
165 /* Forward struct declaration: the complete can be found later this file. */
166 struct routemap_hook_context;
167
168 /* Route map index structure. */
169 struct route_map_index {
170 struct route_map *map;
171 char *description;
172
173 /* Preference of this route map rule. */
174 int pref;
175
176 /* Route map type permit or deny. */
177 enum route_map_type type;
178
179 /* Do we follow old rules, or hop forward? */
180 route_map_end_t exitpolicy;
181
182 /* If we're using "GOTO", to where do we go? */
183 int nextpref;
184
185 /* If we're using "CALL", to which route-map do ew go? */
186 char *nextrm;
187
188 /* Matching rule list. */
189 struct route_map_rule_list match_list;
190 struct route_map_rule_list set_list;
191
192 /* Make linked list. */
193 struct route_map_index *next;
194 struct route_map_index *prev;
195
196 /* Keep track how many times we've try to apply */
197 uint64_t applied;
198 uint64_t applied_clear;
199
200 /* List of match/sets contexts. */
201 TAILQ_HEAD(, routemap_hook_context) rhclist;
202
203 QOBJ_FIELDS
204 };
205 DECLARE_QOBJ_TYPE(route_map_index)
206
207 /* Route map list structure. */
208 struct route_map {
209 /* Name of route map. */
210 char *name;
211
212 /* Route map's rule. */
213 struct route_map_index *head;
214 struct route_map_index *tail;
215
216 /* Make linked list. */
217 struct route_map *next;
218 struct route_map *prev;
219
220 /* Maintain update info */
221 bool to_be_processed; /* True if modification isn't acted on yet */
222 bool deleted; /* If 1, then this node will be deleted */
223
224 /* How many times have we applied this route-map */
225 uint64_t applied;
226 uint64_t applied_clear;
227
228 /* Counter to track active usage of this route-map */
229 uint16_t use_count;
230
231 QOBJ_FIELDS
232 };
233 DECLARE_QOBJ_TYPE(route_map)
234
235 /* Prototypes. */
236 extern void route_map_init(void);
237
238 /*
239 * This should only be called on shutdown
240 * Additionally this function sets the hooks to NULL
241 * before any processing is done.
242 */
243 extern void route_map_finish(void);
244
245 /* Add match statement to route map. */
246 extern enum rmap_compile_rets route_map_add_match(struct route_map_index *index,
247 const char *match_name,
248 const char *match_arg,
249 route_map_event_t type);
250
251 /* Delete specified route match rule. */
252 extern enum rmap_compile_rets
253 route_map_delete_match(struct route_map_index *index,
254 const char *match_name, const char *match_arg,
255 route_map_event_t type);
256
257 extern const char *route_map_get_match_arg(struct route_map_index *index,
258 const char *match_name);
259
260 /* Add route-map set statement to the route map. */
261 extern enum rmap_compile_rets route_map_add_set(struct route_map_index *index,
262 const char *set_name,
263 const char *set_arg);
264
265 /* Delete route map set rule. */
266 extern enum rmap_compile_rets
267 route_map_delete_set(struct route_map_index *index,
268 const char *set_name, const char *set_arg);
269
270 /* Install rule command to the match list. */
271 extern void route_map_install_match(const struct route_map_rule_cmd *cmd);
272
273 /*
274 * Install rule command to the set list.
275 *
276 * When installing a particular item, Allow a difference of handling
277 * of bad cli inputted(return NULL) -vs- this particular daemon cannot use
278 * this form of the command(return a pointer and handle it appropriately
279 * in the apply command). See 'set metric' command
280 * as it is handled in ripd/ripngd and ospfd.
281 */
282 extern void route_map_install_set(const struct route_map_rule_cmd *cmd);
283
284 /* Lookup route map by name. */
285 extern struct route_map *route_map_lookup_by_name(const char *name);
286
287 /* Simple helper to warn if route-map does not exist. */
288 struct route_map *route_map_lookup_warn_noexist(struct vty *vty, const char *name);
289
290 /* Apply route map to the object. */
291 extern route_map_result_t route_map_apply(struct route_map *map,
292 const struct prefix *prefix,
293 route_map_object_t object_type,
294 void *object);
295
296 extern void route_map_add_hook(void (*func)(const char *));
297 extern void route_map_delete_hook(void (*func)(const char *));
298
299 /*
300 * This is the callback for when something has changed about a
301 * route-map. The interested parties can register to receive
302 * this data.
303 *
304 * name - Is the name of the changed route-map
305 */
306 extern void route_map_event_hook(void (*func)(const char *name));
307 extern int route_map_mark_updated(const char *name);
308 extern void route_map_walk_update_list(void (*update_fn)(char *name));
309 extern void route_map_upd8_dependency(route_map_event_t type, const char *arg,
310 const char *rmap_name);
311 extern void route_map_notify_dependencies(const char *affected_name,
312 route_map_event_t event);
313
314 extern int generic_match_add(struct vty *vty, struct route_map_index *index,
315 const char *command, const char *arg,
316 route_map_event_t type);
317
318 extern int generic_match_delete(struct vty *vty, struct route_map_index *index,
319 const char *command, const char *arg,
320 route_map_event_t type);
321 extern int generic_set_add(struct vty *vty, struct route_map_index *index,
322 const char *command, const char *arg);
323 extern int generic_set_delete(struct vty *vty, struct route_map_index *index,
324 const char *command, const char *arg);
325
326
327 /* match interface */
328 extern void route_map_match_interface_hook(int (*func)(
329 struct vty *vty, struct route_map_index *index, const char *command,
330 const char *arg, route_map_event_t type));
331 /* no match interface */
332 extern void route_map_no_match_interface_hook(int (*func)(
333 struct vty *vty, struct route_map_index *index, const char *command,
334 const char *arg, route_map_event_t type));
335 /* match ip address */
336 extern void route_map_match_ip_address_hook(int (*func)(
337 struct vty *vty, struct route_map_index *index, const char *command,
338 const char *arg, route_map_event_t type));
339 /* no match ip address */
340 extern void route_map_no_match_ip_address_hook(int (*func)(
341 struct vty *vty, struct route_map_index *index, const char *command,
342 const char *arg, route_map_event_t type));
343 /* match ip address prefix list */
344 extern void route_map_match_ip_address_prefix_list_hook(int (*func)(
345 struct vty *vty, struct route_map_index *index, const char *command,
346 const char *arg, route_map_event_t type));
347 /* no match ip address prefix list */
348 extern void route_map_no_match_ip_address_prefix_list_hook(int (*func)(
349 struct vty *vty, struct route_map_index *index, const char *command,
350 const char *arg, route_map_event_t type));
351 /* match ip next hop */
352 extern void route_map_match_ip_next_hop_hook(int (*func)(
353 struct vty *vty, struct route_map_index *index, const char *command,
354 const char *arg, route_map_event_t type));
355 /* no match ip next hop */
356 extern void route_map_no_match_ip_next_hop_hook(int (*func)(
357 struct vty *vty, struct route_map_index *index, const char *command,
358 const char *arg, route_map_event_t type));
359 /* match ip next hop prefix list */
360 extern void route_map_match_ip_next_hop_prefix_list_hook(int (*func)(
361 struct vty *vty, struct route_map_index *index, const char *command,
362 const char *arg, route_map_event_t type));
363 /* no match ip next hop prefix list */
364 extern void route_map_no_match_ip_next_hop_prefix_list_hook(int (*func)(
365 struct vty *vty, struct route_map_index *index, const char *command,
366 const char *arg, route_map_event_t type));
367 /* match ip next hop type */
368 extern void route_map_match_ip_next_hop_type_hook(int (*func)(
369 struct vty *vty, struct route_map_index *index, const char *command,
370 const char *arg, route_map_event_t type));
371 /* no match ip next hop type */
372 extern void route_map_no_match_ip_next_hop_type_hook(int (*func)(
373 struct vty *vty, struct route_map_index *index, const char *command,
374 const char *arg, route_map_event_t type));
375 /* match ipv6 address */
376 extern void route_map_match_ipv6_address_hook(int (*func)(
377 struct vty *vty, struct route_map_index *index, const char *command,
378 const char *arg, route_map_event_t type));
379 /* no match ipv6 address */
380 extern void route_map_no_match_ipv6_address_hook(int (*func)(
381 struct vty *vty, struct route_map_index *index, const char *command,
382 const char *arg, route_map_event_t type));
383 /* match ipv6 address prefix list */
384 extern void route_map_match_ipv6_address_prefix_list_hook(int (*func)(
385 struct vty *vty, struct route_map_index *index, const char *command,
386 const char *arg, route_map_event_t type));
387 /* no match ipv6 address prefix list */
388 extern void route_map_no_match_ipv6_address_prefix_list_hook(int (*func)(
389 struct vty *vty, struct route_map_index *index, const char *command,
390 const char *arg, route_map_event_t type));
391 /* match ipv6 next-hop type */
392 extern void route_map_match_ipv6_next_hop_type_hook(int (*func)(
393 struct vty *vty, struct route_map_index *index, const char *command,
394 const char *arg, route_map_event_t type));
395 /* no match ipv6 next-hop type */
396 extern void route_map_no_match_ipv6_next_hop_type_hook(int (*func)(
397 struct vty *vty, struct route_map_index *index, const char *command,
398 const char *arg, route_map_event_t type));
399 /* match metric */
400 extern void route_map_match_metric_hook(int (*func)(
401 struct vty *vty, struct route_map_index *index, const char *command,
402 const char *arg, route_map_event_t type));
403 /* no match metric */
404 extern void route_map_no_match_metric_hook(int (*func)(
405 struct vty *vty, struct route_map_index *index, const char *command,
406 const char *arg, route_map_event_t type));
407 /* match tag */
408 extern void route_map_match_tag_hook(int (*func)(
409 struct vty *vty, struct route_map_index *index, const char *command,
410 const char *arg, route_map_event_t type));
411 /* no match tag */
412 extern void route_map_no_match_tag_hook(int (*func)(
413 struct vty *vty, struct route_map_index *index, const char *command,
414 const char *arg, route_map_event_t type));
415 /* set ip nexthop */
416 extern void route_map_set_ip_nexthop_hook(
417 int (*func)(struct vty *vty, struct route_map_index *index,
418 const char *command, const char *arg));
419 /* no set ip nexthop */
420 extern void route_map_no_set_ip_nexthop_hook(
421 int (*func)(struct vty *vty, struct route_map_index *index,
422 const char *command, const char *arg));
423 /* set ipv6 nexthop local */
424 extern void route_map_set_ipv6_nexthop_local_hook(
425 int (*func)(struct vty *vty, struct route_map_index *index,
426 const char *command, const char *arg));
427 /* no set ipv6 nexthop local */
428 extern void route_map_no_set_ipv6_nexthop_local_hook(
429 int (*func)(struct vty *vty, struct route_map_index *index,
430 const char *command, const char *arg));
431 /* set metric */
432 extern void route_map_set_metric_hook(int (*func)(struct vty *vty,
433 struct route_map_index *index,
434 const char *command,
435 const char *arg));
436 /* no set metric */
437 extern void route_map_no_set_metric_hook(
438 int (*func)(struct vty *vty, struct route_map_index *index,
439 const char *command, const char *arg));
440 /* set tag */
441 extern void route_map_set_tag_hook(int (*func)(struct vty *vty,
442 struct route_map_index *index,
443 const char *command,
444 const char *arg));
445 /* no set tag */
446 extern void route_map_no_set_tag_hook(int (*func)(struct vty *vty,
447 struct route_map_index *index,
448 const char *command,
449 const char *arg));
450
451 extern void *route_map_rule_tag_compile(const char *arg);
452 extern void route_map_rule_tag_free(void *rule);
453
454 /* Increment the route-map used counter */
455 extern void route_map_counter_increment(struct route_map *map);
456
457 /* Decrement the route-map used counter */
458 extern void route_map_counter_decrement(struct route_map *map);
459
460 /* Route map hooks data structure. */
461 struct route_map_match_set_hooks {
462 /* match interface */
463 int (*match_interface)(struct vty *vty, struct route_map_index *index,
464 const char *command, const char *arg,
465 route_map_event_t type);
466
467 /* no match interface */
468 int (*no_match_interface)(struct vty *vty,
469 struct route_map_index *index,
470 const char *command, const char *arg,
471 route_map_event_t type);
472
473 /* match ip address */
474 int (*match_ip_address)(struct vty *vty, struct route_map_index *index,
475 const char *command, const char *arg,
476 route_map_event_t type);
477
478 /* no match ip address */
479 int (*no_match_ip_address)(struct vty *vty,
480 struct route_map_index *index,
481 const char *command, const char *arg,
482 route_map_event_t type);
483
484 /* match ip address prefix list */
485 int (*match_ip_address_prefix_list)(struct vty *vty,
486 struct route_map_index *index,
487 const char *command,
488 const char *arg,
489 route_map_event_t type);
490
491 /* no match ip address prefix list */
492 int (*no_match_ip_address_prefix_list)(struct vty *vty,
493 struct route_map_index *index,
494 const char *command,
495 const char *arg,
496 route_map_event_t type);
497
498 /* match ip next hop */
499 int (*match_ip_next_hop)(struct vty *vty, struct route_map_index *index,
500 const char *command, const char *arg,
501 route_map_event_t type);
502
503 /* no match ip next hop */
504 int (*no_match_ip_next_hop)(struct vty *vty,
505 struct route_map_index *index,
506 const char *command, const char *arg,
507 route_map_event_t type);
508
509 /* match ip next hop prefix list */
510 int (*match_ip_next_hop_prefix_list)(struct vty *vty,
511 struct route_map_index *index,
512 const char *command,
513 const char *arg,
514 route_map_event_t type);
515
516 /* no match ip next hop prefix list */
517 int (*no_match_ip_next_hop_prefix_list)(struct vty *vty,
518 struct route_map_index *index,
519 const char *command,
520 const char *arg,
521 route_map_event_t type);
522
523 /* match ip next-hop type */
524 int (*match_ip_next_hop_type)(struct vty *vty,
525 struct route_map_index *index,
526 const char *command,
527 const char *arg,
528 route_map_event_t type);
529
530 /* no match ip next-hop type */
531 int (*no_match_ip_next_hop_type)(struct vty *vty,
532 struct route_map_index *index,
533 const char *command,
534 const char *arg,
535 route_map_event_t type);
536
537 /* match ipv6 address */
538 int (*match_ipv6_address)(struct vty *vty,
539 struct route_map_index *index,
540 const char *command, const char *arg,
541 route_map_event_t type);
542
543 /* no match ipv6 address */
544 int (*no_match_ipv6_address)(struct vty *vty,
545 struct route_map_index *index,
546 const char *command, const char *arg,
547 route_map_event_t type);
548
549
550 /* match ipv6 address prefix list */
551 int (*match_ipv6_address_prefix_list)(struct vty *vty,
552 struct route_map_index *index,
553 const char *command,
554 const char *arg,
555 route_map_event_t type);
556
557 /* no match ipv6 address prefix list */
558 int (*no_match_ipv6_address_prefix_list)(struct vty *vty,
559 struct route_map_index *index,
560 const char *command,
561 const char *arg,
562 route_map_event_t type);
563
564 /* match ipv6 next-hop type */
565 int (*match_ipv6_next_hop_type)(struct vty *vty,
566 struct route_map_index *index,
567 const char *command,
568 const char *arg,
569 route_map_event_t type);
570
571 /* no match ipv6 next-hop type */
572 int (*no_match_ipv6_next_hop_type)(struct vty *vty,
573 struct route_map_index *index,
574 const char *command, const char *arg,
575 route_map_event_t type);
576
577 /* match metric */
578 int (*match_metric)(struct vty *vty, struct route_map_index *index,
579 const char *command, const char *arg,
580 route_map_event_t type);
581
582 /* no match metric */
583 int (*no_match_metric)(struct vty *vty, struct route_map_index *index,
584 const char *command, const char *arg,
585 route_map_event_t type);
586
587 /* match tag */
588 int (*match_tag)(struct vty *vty, struct route_map_index *index,
589 const char *command, const char *arg,
590 route_map_event_t type);
591
592 /* no match tag */
593 int (*no_match_tag)(struct vty *vty, struct route_map_index *index,
594 const char *command, const char *arg,
595 route_map_event_t type);
596
597 /* set ip nexthop */
598 int (*set_ip_nexthop)(struct vty *vty, struct route_map_index *index,
599 const char *command, const char *arg);
600
601 /* no set ip nexthop */
602 int (*no_set_ip_nexthop)(struct vty *vty, struct route_map_index *index,
603 const char *command, const char *arg);
604
605 /* set ipv6 nexthop local */
606 int (*set_ipv6_nexthop_local)(struct vty *vty,
607 struct route_map_index *index,
608 const char *command, const char *arg);
609
610 /* no set ipv6 nexthop local */
611 int (*no_set_ipv6_nexthop_local)(struct vty *vty,
612 struct route_map_index *index,
613 const char *command, const char *arg);
614
615 /* set metric */
616 int (*set_metric)(struct vty *vty, struct route_map_index *index,
617 const char *command, const char *arg);
618
619 /* no set metric */
620 int (*no_set_metric)(struct vty *vty, struct route_map_index *index,
621 const char *command, const char *arg);
622
623 /* set tag */
624 int (*set_tag)(struct vty *vty, struct route_map_index *index,
625 const char *command, const char *arg);
626
627 /* no set tag */
628 int (*no_set_tag)(struct vty *vty, struct route_map_index *index,
629 const char *command, const char *arg);
630 };
631
632 extern struct route_map_match_set_hooks rmap_match_set_hook;
633
634 /* Making route map list. */
635 struct route_map_list {
636 struct route_map *head;
637 struct route_map *tail;
638
639 void (*add_hook)(const char *);
640 void (*delete_hook)(const char *);
641 void (*event_hook)(const char *);
642 };
643
644 extern struct route_map_list route_map_master;
645
646 extern struct route_map *route_map_get(const char *name);
647 extern void route_map_delete(struct route_map *map);
648 extern struct route_map_index *route_map_index_get(struct route_map *map,
649 enum route_map_type type,
650 int pref);
651 extern void route_map_index_delete(struct route_map_index *index, int notify);
652
653 /* routemap_northbound.c */
654 typedef int (*routemap_match_hook_fun)(struct vty *vty,
655 struct route_map_index *rmi,
656 const char *command, const char *arg,
657 route_map_event_t event);
658
659 typedef int (*routemap_set_hook_fun)(struct vty *vty,
660 struct route_map_index *rmi,
661 const char *command, const char *arg);
662
663 struct routemap_hook_context {
664 struct route_map_index *rhc_rmi;
665 const char *rhc_rule;
666 route_map_event_t rhc_event;
667 routemap_set_hook_fun rhc_shook;
668 routemap_match_hook_fun rhc_mhook;
669 TAILQ_ENTRY(routemap_hook_context) rhc_entry;
670 };
671
672 int lib_route_map_entry_match_destroy(enum nb_event event,
673 const struct lyd_node *dnode);
674 int lib_route_map_entry_set_destroy(enum nb_event event,
675 const struct lyd_node *dnode);
676
677 struct routemap_hook_context *
678 routemap_hook_context_insert(struct route_map_index *rmi);
679 void routemap_hook_context_free(struct routemap_hook_context *rhc);
680
681 extern const struct frr_yang_module_info frr_route_map_info;
682
683 /* routemap_cli.c */
684 extern void route_map_instance_show(struct vty *vty, struct lyd_node *dnode,
685 bool show_defaults);
686 extern void route_map_instance_show_end(struct vty *vty,
687 struct lyd_node *dnode);
688 extern void route_map_condition_show(struct vty *vty, struct lyd_node *dnode,
689 bool show_defaults);
690 extern void route_map_action_show(struct vty *vty, struct lyd_node *dnode,
691 bool show_defaults);
692 extern void route_map_exit_policy_show(struct vty *vty, struct lyd_node *dnode,
693 bool show_defaults);
694 extern void route_map_call_show(struct vty *vty, struct lyd_node *dnode,
695 bool show_defaults);
696 extern void route_map_description_show(struct vty *vty,
697 struct lyd_node *dnode,
698 bool show_defaults);
699 extern void route_map_cli_init(void);
700
701 #ifdef __cplusplus
702 }
703 #endif
704
705 #endif /* _ZEBRA_ROUTEMAP_H */