]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/routemap.h
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / lib / routemap.h
index 0f7c391f84e44247a67c5d4dcdac1b187dda102f..463aa91725a98b64b10a7516c9a5320fb641af7c 100644 (file)
@@ -142,6 +142,9 @@ struct route_map_index {
        struct route_map_index *next;
        struct route_map_index *prev;
 
+       /* Keep track how many times we've try to apply */
+       uint64_t applied;
+
        QOBJ_FIELDS
 };
 DECLARE_QOBJ_TYPE(route_map_index)
@@ -163,12 +166,21 @@ struct route_map {
        bool to_be_processed; /* True if modification isn't acted on yet */
        bool deleted;         /* If 1, then this node will be deleted */
 
+       /* How many times have we applied this route-map */
+       uint64_t applied;
+
        QOBJ_FIELDS
 };
 DECLARE_QOBJ_TYPE(route_map)
 
 /* Prototypes. */
 extern void route_map_init(void);
+
+/*
+ * This should only be called on shutdown
+ * Additionally this function sets the hooks to NULL
+ * before any processing is done.
+ */
 extern void route_map_finish(void);
 
 /* Add match statement to route map. */
@@ -208,6 +220,9 @@ extern void route_map_install_set(struct route_map_rule_cmd *cmd);
 /* Lookup route map by name. */
 extern struct route_map *route_map_lookup_by_name(const char *name);
 
+/* Simple helper to warn if route-map does not exist. */
+struct route_map *route_map_lookup_warn_noexist(struct vty *vty, const char *name);
+
 /* Apply route map to the object. */
 extern route_map_result_t route_map_apply(struct route_map *map,
                                          const struct prefix *prefix,
@@ -277,6 +292,14 @@ extern void route_map_match_ip_next_hop_prefix_list_hook(int (*func)(
 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));
+/* 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));
+/* 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));
 /* match ipv6 address */
 extern void route_map_match_ipv6_address_hook(int (*func)(
        struct vty *vty, struct route_map_index *index, const char *command,
@@ -293,6 +316,14 @@ extern void route_map_match_ipv6_address_prefix_list_hook(int (*func)(
 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));
+/* 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));
+/* 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));
 /* match metric */
 extern void route_map_match_metric_hook(int (*func)(
        struct vty *vty, struct route_map_index *index, const char *command,