summaryrefslogtreecommitdiff
path: root/lib/frrstr.c
AgeCommit message (Collapse)Author
2023-12-28lib: northbound: improve xpath functionalityChristian Hopps
Allow user to leave keys off of a list entry node at the end of the xpath. This will return all list entries. Previously there was no way to just get the list entries. One had to leave off the last list entry node which would then return all list nodes as well as all the siblings at the same level. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-06mgmtd: simplify xpath registriesChristian Hopps
- 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>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-11-07lib: Add PCRE2 supportDonatas Abraitis
Some results: ``` ==== PCRE ==== % ./a.out "^65001" "65001" comparing: ^65001 / 65001 ret status: 0 [14:31] donatas-pc donatas /home/donatas % ./a.out "^65001_" "65001" comparing: ^65001_ / 65001 ret status: 0 ===== PCRE2 ===== % ./a.out "^65001" "65001" comparing: ^65001 / 65001 ret status: 0 [14:30] donatas-pc donatas /home/donatas % ./a.out "^65001_" "65001" comparing: ^65001_ / 65001 ret status: 1 ``` Seems that if using PCRE2, we need to escape outer `()` chars and `|`. Sounds like a bug. But this is only with some older PCRE2 versions. With >= 10.36, I wasn't able to reproduce this, everything is fine and working as expected. Adding _FRR_PCRE2_POSIX definition because pcre2posix.h does not have include's guard. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2021-08-12lib: add frrstr_hex to hexdump buffersQuentin Young
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-02-16lib: Fix so that `--enable-pcreposix` actually compilesDonald Sharp
The `--enable-pcreposix` configure option was not actually compiling properly. Follow pre-existing pattern for inclusion of regex.h or the pcreposix.h header. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-06*: fix ctype (isalpha & co.) castsDavid Lamparter
The correct cast for these is (unsigned char), because "char" could be signed and thus have some negative value. isalpha & co. expect an int arg that is positive, i.e. 0-255. So we need to cast to (unsigned char) when calling any of these. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-05-23lib: replace begins_with, add frrstr_endswithQuentin Young
* Change 'begins_with' to 'frrstr_startswith' for consistency * Add suffix checker, frrstr_endswith() * Update vtysh to use the new function Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-06lib: add string replace functionQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25*: return bool from boolean functionsQuentin Young
Not 1 or 0. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-08*: fix config.h/zebra.h include orderDavid Lamparter
config.h (or, transitively, zebra.h) must be the first include file listed for autoconf things like _GNU_SOURCE and _POSIX_C_SOURCE to work correctly. Signed-off-by: David Lamparter <equinox@diac24.net>
2018-06-20Merge pull request #2495 from pacovn/fixme_all_digitRuss White
bgpd, lib, ospfd, zebra: all_digit moved to frrstr
2018-06-19bgpd, lib, ospfd, zebra: all_digit moved to frrstrpaco
This solves a pending FIXME Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-15lib: uninitialized variable (Coverity 1469898)paco
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-06lib: fix static analysis issues, use regfree()Quentin Young
* Fix potential NULL dereference * Fix use of uninitialized value * Fix leaking memory by not freeing regex_t * Fix extra \n when using empty regex filter * Clean up still-reachable hook memory * Handle nonexistent pager Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-06*: style for | supportQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-06vtysh: add | supportQuentin Young
* Rewrite pager implementation * Replace fprintf() with vty_out() * Modify vty_out() for better vtysh support * Remove static global outputfile var * Remove fp argument from many vtysh functions * Add some docs for stuff along the way Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-06lib: add string utilitiesQuentin Young
I see lots of the same code being copy-pasted and slightly tweaked for string processing all over the codebase. Time to start aggregating these pieces into something consistent and correct. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>