summaryrefslogtreecommitdiff
path: root/lib/command_match.h
AgeCommit message (Collapse)Author
2023-08-05vtysh: remove unused cmd_filter_typeIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
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>
2021-10-05lib: fix spelling nits in more lib filesewlumpkin
Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
2019-02-11lib: rename enum to avoid conflictRenato Westphal
Two different definitions of "enum filter_type" exist in libfrr: one in lib/filter.h and other in lib/command_match.h. Rename one of them to resolve a conflict that happens when both headers are included by the same file. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-11lib: add extern "C" {} blocks to all libfrr headersRenato Westphal
These are necessary to use functions defined in these headers from C++. Signed-off-by: David Lamparter <equinox@diac24.net> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-11-12lib, vtysh: Fix memory leaks, change cmd_element to constQuentin Young
Fix a few memory issues: * Not freeing tab-completions upon input match failure * Invalid write when null-terminating tab-completions * Not freeing argv[] itself in additinon to elements * Use XFREE() instead of free() as appropriate * Not freeing final token of an [option] during parsing Make a few minor changes to CLI internals: * Improve documentation on matching & completion functions * Only make one copy of cmd_token's when building argv, instead of three * Don't make a copy of the matching cmd_element Make one major(ish) change to CLI internals: * Change all pointers to struct cmd_element to const Code outside of the core CLI units should never have an occasion to modify the internal state of the command system. Doing so could easily amount to having a CLI interface that changes during runtime, and could conceivably lead to security issues. Explicitly disallowing this removes any chance of confusion. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-02lib: explicitly support the case of empty input for completionsQuentin Young
When the user tab- or ?-completes when the character prior to the position of the cursor is a space, completion logic is passed null. Explicitly handle this case instead of using partly_match, which has special logic associated with it to allow abbreviating certain tokens. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-13lib: Move string completions out of command_match.cQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-07lib: Continue matching system refactorQuentin Young
Most things back to working, all CLI units refactored to use improved graph implementation. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-11lib: Refactor CLI interface function namesQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-10lib: Add completion string convenience functionsQuentin Young
And set END_GN default text to <cr>, and scrub a coupld of extraneous files Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-08lib: Code cleanup, formatting, & headersQuentin Young
Gnu-style code, add copyright headers, cleanup some random style issues, shuffle around code into relevant units, add docs. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-03lib: Implement status variableQuentin Young
Matcher now keeps track of why it failed Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-01lib: Add partial completion supportQuentin Young
Completions now include nodes that the input partially matches as well as the children of nodes those that the input exactly matches. Also some minor cleanup and bugfixes. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-29lib: Cleanup some memory issues in CLIQuentin Young
Various memory leaks have been fixed and the quagga memory macros are in use. Also consolidated the argv and matching code into one graph traversal. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-27lib: Add matching and argv supportQuentin Young
Queries may be run against DFA's to find matching cmd_element, and argument lists may be constructed. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-22lib: Reorganize some matching stuffQuentin Young
Introduce new node type, END_GN, and remove is_leaf flags. Reorganize command_match.c & remove internal functions from command_match.h. Start rewriting command.h in command_new.h with changes for new backend. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-21lib: Mostly complete matcherQuentin Young
Input matching and completions works. Still some rough edges. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-19lib: Break up functions, begin matcherQuentin Young
Moved test hook out of command.c into vtysh.c, renamed graph modules, added matching code Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>