]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd, lib, ospfd, zebra: all_digit moved to frrstr
authorpaco <paco@voltanet.io>
Tue, 19 Jun 2018 15:59:53 +0000 (17:59 +0200)
committerpaco <paco@voltanet.io>
Tue, 19 Jun 2018 15:59:53 +0000 (17:59 +0200)
This solves a pending FIXME

Signed-off-by: F. Aragon <paco@voltanet.io>
bgpd/bgp_rd.c
bgpd/bgp_routemap.c
bgpd/bgp_vty.c
lib/frrstr.c
lib/frrstr.h
lib/prefix.c
lib/prefix.h
ospfd/ospf_routemap.c
zebra/zebra_routemap.c

index 356a949d691c0a79b3e08907536e1072cef917d3..77f5aade5f0cad0f300c07549df2a478ff10e435 100644 (file)
@@ -27,6 +27,7 @@
 #include "memory.h"
 #include "stream.h"
 #include "filter.h"
+#include "frrstr.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_rd.h"
index cbacd6b4f28cac71fde3c9c6266fcd0a305381a0..6462392096394523d968679ae967c6d20b722f6d 100644 (file)
@@ -37,6 +37,7 @@
 #include "sockunion.h"
 #include "hash.h"
 #include "queue.h"
+#include "frrstr.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_table.h"
index f0fc3a89e9ff654ee2128962ff7703e0e4c2e2f3..4e0f7155baff92d3832435504aba736b07cc6cb9 100644 (file)
@@ -34,6 +34,7 @@
 #include "hash.h"
 #include "queue.h"
 #include "filter.h"
+#include "frrstr.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_advertise.h"
index d003590ba6d2b0937bf000bf53da618059d43226..1f0849566a822b8d34a9cabc5762779ed2c29e45 100644 (file)
@@ -158,3 +158,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;
+}
index 24547711221618a7c981ab9876ba99a3540183ee..891a3f337ca98da88542c7392dfd2218dc3d0fab 100644 (file)
@@ -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_ */
index b129665e7b46c041418ba2e3965900efb3477afc..751f20cb83ebfa89e9da2d13d8f2d73ebf98bb84 100644 (file)
@@ -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)
 {
index f5dbb22f79282c51d00ee42f80e7a1eba5d3696b..4247569137dd4a4b5a3e3e917e9e6c0190d670ad 100644 (file)
@@ -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. */
index ca711aa42f1b8c39e5bc2ec8228a425526a53919..f3271acfa2ae1d76eb91b091e7f2eb44f5815d29 100644 (file)
@@ -32,6 +32,7 @@
 #include "log.h"
 #include "plist.h"
 #include "vrf.h"
+#include "frrstr.h"
 
 #include "ospfd/ospfd.h"
 #include "ospfd/ospf_asbr.h"
index 10ba88880a8935363f93d59715a9aecc6181371e..7afa2f853e909ffccfc48b0e0f6bb2cbccf0abed 100644 (file)
@@ -31,6 +31,7 @@
 #include "plist.h"
 #include "nexthop.h"
 #include "vrf.h"
+#include "frrstr.h"
 
 #include "zebra/zserv.h"
 #include "zebra/redistribute.h"