]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/routemap.h
lib: Fix Spelling mistake
[mirror_frr.git] / lib / routemap.h
index 43af8dbcfe347c07d9685f21c05f06a64790b653..a193e325360c675be31041665fd3b47bf68ac572 100644 (file)
@@ -87,8 +87,10 @@ struct route_map_rule_cmd {
        const char *str;
 
        /* Function for value set or match. */
-       route_map_result_t (*func_apply)(void *, struct prefix *,
-                                        route_map_object_t, void *);
+       route_map_result_t (*func_apply)(void *rule,
+                                        const struct prefix *prefix,
+                                        route_map_object_t type,
+                                        void *object);
 
        /* Compile argument and return result as void *. */
        void *(*func_compile)(const char *);
@@ -98,13 +100,13 @@ struct route_map_rule_cmd {
 };
 
 /* Route map apply error. */
-enum {
-       /* Route map rule is missing. */
-       RMAP_RULE_MISSING = 1,
+enum { RMAP_COMPILE_SUCCESS,
 
-       /* Route map rule can't compile */
-       RMAP_COMPILE_ERROR
-};
+       /* Route map rule is missing. */
+       RMAP_RULE_MISSING,
+
+       /* Route map rule can't compile */
+       RMAP_COMPILE_ERROR };
 
 /* Route map rule list. */
 struct route_map_rule_list {
@@ -158,8 +160,8 @@ struct route_map {
        struct route_map *prev;
 
        /* Maintain update info */
-       int to_be_processed; /* True if modification isn't acted on yet */
-       int deleted;     /* If 1, then this node will be deleted */
+       bool to_be_processed; /* True if modification isn't acted on yet */
+       bool deleted;         /* If 1, then this node will be deleted */
 
        QOBJ_FIELDS
 };
@@ -167,6 +169,12 @@ 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. */
@@ -192,7 +200,15 @@ extern int route_map_delete_set(struct route_map_index *index,
 /* Install rule command to the match list. */
 extern void route_map_install_match(struct route_map_rule_cmd *cmd);
 
-/* Install rule command to the set list. */
+/*
+ * Install rule command to the set list.
+ *
+ * When installing a particular item, Allow a difference of handling
+ * of bad cli inputted(return NULL) -vs- this particular daemon cannot use
+ * this form of the command(return a pointer and handle it appropriately
+ * in the apply command).  See 'set metric' command
+ * as it is handled in ripd/ripngd and ospfd.
+ */
 extern void route_map_install_set(struct route_map_rule_cmd *cmd);
 
 /* Lookup route map by name. */
@@ -200,16 +216,15 @@ extern struct route_map *route_map_lookup_by_name(const char *name);
 
 /* Apply route map to the object. */
 extern route_map_result_t route_map_apply(struct route_map *map,
-                                         struct prefix *,
+                                         const struct prefix *prefix,
                                          route_map_object_t object_type,
                                          void *object);
 
 extern void route_map_add_hook(void (*func)(const char *));
 extern void route_map_delete_hook(void (*func)(const char *));
 extern void route_map_event_hook(void (*func)(route_map_event_t, const char *));
-extern int route_map_mark_updated(const char *name, int deleted);
-extern int route_map_clear_updated(struct route_map *rmap);
-extern void route_map_walk_update_list(int (*update_fn)(char *name));
+extern int route_map_mark_updated(const char *name);
+extern void route_map_walk_update_list(void (*update_fn)(char *name));
 extern void route_map_upd8_dependency(route_map_event_t type, const char *arg,
                                      const char *rmap_name);
 extern void route_map_notify_dependencies(const char *affected_name,