summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/frrstr.c8
-rw-r--r--lib/frrstr.h11
-rw-r--r--lib/pbr.h6
-rw-r--r--lib/prefix.c11
-rw-r--r--lib/prefix.h1
-rw-r--r--lib/routemap.c6
-rw-r--r--lib/routemap.h5
7 files changed, 30 insertions, 18 deletions
diff --git a/lib/frrstr.c b/lib/frrstr.c
index 82c0ad7730..715e67b868 100644
--- a/lib/frrstr.c
+++ b/lib/frrstr.c
@@ -161,3 +161,11 @@ bool begins_with(const char *str, const char *prefix)
return strncmp(str, prefix, lenprefix) == 0;
}
+
+int all_digit(const char *str)
+{
+ for (; *str != '\0'; str++)
+ if (!isdigit((int)*str))
+ return 0;
+ return 1;
+}
diff --git a/lib/frrstr.h b/lib/frrstr.h
index 2454771122..891a3f337c 100644
--- a/lib/frrstr.h
+++ b/lib/frrstr.h
@@ -97,4 +97,15 @@ void frrstr_strvec_free(vector v);
*/
bool begins_with(const char *str, const char *prefix);
+/*
+ * Check the string only contains digit characters.
+ *
+ * str
+ * string to check for digits
+ *
+ * Returns:
+ * 1 str only contains digit characters, 0 otherwise
+ */
+int all_digit(const char *str);
+
#endif /* _FRRSTR_H_ */
diff --git a/lib/pbr.h b/lib/pbr.h
index 401cfb0813..1704d8d37e 100644
--- a/lib/pbr.h
+++ b/lib/pbr.h
@@ -20,6 +20,12 @@
#ifndef _PBR_H
#define _PBR_H
+#include <zebra.h>
+#include "stream.h"
+#include "prefix.h"
+
+#define PBR_STR "Policy Based Routing\n"
+
/*
* A PBR filter
*
diff --git a/lib/prefix.c b/lib/prefix.c
index b129665e7b..751f20cb83 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -1373,17 +1373,6 @@ void prefix_free(struct prefix *p)
XFREE(MTYPE_PREFIX, p);
}
-/* Utility function. Check the string only contains digit
- * character.
- * FIXME str.[c|h] would be better place for this function. */
-int all_digit(const char *str)
-{
- for (; *str != '\0'; str++)
- if (!isdigit((int)*str))
- return 0;
- return 1;
-}
-
/* Utility function to convert ipv4 prefixes to Classful prefixes */
void apply_classful_mask_ipv4(struct prefix_ipv4 *p)
{
diff --git a/lib/prefix.h b/lib/prefix.h
index f5dbb22f79..4247569137 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -458,7 +458,6 @@ static inline int ipv6_martian(struct in6_addr *addr)
return 0;
}
-extern int all_digit(const char *);
extern int macstr2prefix_evpn(const char *str, struct prefix_evpn *p);
/* NOTE: This routine expects the address argument in network byte order. */
diff --git a/lib/routemap.c b/lib/routemap.c
index 892b19dac5..056c793454 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -751,7 +751,7 @@ struct route_map *route_map_lookup_by_name(const char *name)
return map;
}
-int route_map_mark_updated(const char *name, int del_later)
+int route_map_mark_updated(const char *name)
{
struct route_map *map;
int ret = -1;
@@ -781,7 +781,7 @@ int route_map_mark_updated(const char *name, int del_later)
return (ret);
}
-int route_map_clear_updated(struct route_map *map)
+static int route_map_clear_updated(struct route_map *map)
{
int ret = -1;
@@ -807,7 +807,7 @@ static struct route_map *route_map_get(const char *name)
return map;
}
-void route_map_walk_update_list(int (*route_map_update_fn)(char *name))
+void route_map_walk_update_list(void (*route_map_update_fn)(char *name))
{
struct route_map *node;
struct route_map *nnode = NULL;
diff --git a/lib/routemap.h b/lib/routemap.h
index 990c7fa72f..0aeba7e1f6 100644
--- a/lib/routemap.h
+++ b/lib/routemap.h
@@ -215,9 +215,8 @@ extern route_map_result_t route_map_apply(struct route_map *map,
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,