summaryrefslogtreecommitdiff
path: root/lib/frrstr.c
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2023-07-08 23:11:15 -0400
committerChristian Hopps <chopps@labn.net>2023-11-06 17:44:58 -0500
commita65cda16b28bc84b052636118823082de9600cfc (patch)
tree975a1abb64919cc9a9c201b8c50ef7602bd72483 /lib/frrstr.c
parente1b2381f40132650f1c0a2285432c0d00aef7383 (diff)
mgmtd: simplify xpath registries
- move from client id indexed array of uints for register info per client to a u64 bitmask. - add bit walking FOREACH macro Walk the client IDs whose bits are set in a mask. Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/frrstr.c')
-rw-r--r--lib/frrstr.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/frrstr.c b/lib/frrstr.c
index e5440c5093..bb112afef7 100644
--- a/lib/frrstr.c
+++ b/lib/frrstr.c
@@ -3,6 +3,7 @@
* FRR string processing utilities.
* Copyright (C) 2018 Cumulus Networks, Inc.
* Quentin Young
+ * Copyright (c) 2023, LabN Consulting, L.L.C.
*/
#include "zebra.h"
@@ -225,3 +226,26 @@ char *frrstr_hex(char *buff, size_t bufsiz, const uint8_t *str, size_t num)
return buff;
}
+
+const char *frrstr_skip_over_char(const char *s, int skipc)
+{
+ int c, quote = 0;
+
+ while ((c = *s++)) {
+ if (c == '\\') {
+ if (!*s++)
+ return NULL;
+ continue;
+ }
+ if (quote) {
+ if (c == quote)
+ quote = 0;
+ continue;
+ }
+ if (c == skipc)
+ return s;
+ if (c == '"' || c == '\'')
+ quote = c;
+ }
+ return NULL;
+}