summaryrefslogtreecommitdiff
path: root/lib/command_match.c
AgeCommit message (Collapse)Author
2016-09-20Merge remote-tracking branch 'origin/cmaster-next' into vtysh-grammarDonald Sharp
2016-09-19lib: Initial refactor pass on CLI backendQuentin Young
Shotgun commit: * Remove shim sources from Makefile.am * Move new types to command.c / command.h * Rewrite command.c / command.h * Refactor shim types to real types in matcher and parser * Initial refactor pass on vty.c Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-13lib: Fix memory leak in ipv6_prefix_matchQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-13lib: Fix various memory leaksQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-13lib: Fix memory leak in matcherQuentin Young
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-13lib: Fix various matching bugsQuentin Young
Missed a copy, disambigs forgot to walkback Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-08lib: Fix dangling pointer in matcherQuentin 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-10lib: Fix broken disambiguation on leader tokensQuentin Young
Fix incorrect assumption that the set of first tokens of all commands are perfectly unambiguous Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-09lib: Remove unnecessary node pointerQuentin Young
Selector and option heads had pointers to their ends, but this turned out to be unnecessary Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-09lib: Fix various minor bugsQuentin Young
- cmd_make_strvec returns null pointer if str begins with a '#' - disallow options nested options - NULL out state variable in parser - flip backwards comparison - fix memory leak in lexer 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-05lib: Improve matching disambiguationQuentin Young
Disambiguation logic now compares full paths instead of defaulting to an ambiguous match if the heads cannot be disambiguated Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-04lib: Unrefactor to signed long long for rangesQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-04lib: Add support for negative rangesQuentin Young
And convert range delimiters to signed int Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-03lib: Fix use after free in matcherQuentin Young
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-03lib: Implement full command disambiguation logicQuentin Young
Disambiguation is smarter and somewhat more compact. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-02lib: Reorganize command matcherQuentin Young
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-08-01lib: Fix OOB range parses, variable matchesQuentin Young
Variables now allow strings beginning with numbers to match, ranges and numbers are now long long to fix OOB parses resulting in integer wraparounds. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-01lib: Fixed bad node copy, modified token regexQuentin Young
When building argv for matched command, only the last node was being copied to argv; the rest were added by reference. Additionally the regex for certain tokens was too restrictive and disallowed characters allowed by the old parser; these have been reinstated. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-08-01lib: Add partial matching supportQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-29lib: Retab command_match.cQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-07-29lib: Re-add partial IPV4 matching supportQuentin Young
Also removed debugging output for matcher. 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: Improve argv constructionQuentin Young
Fixed a variety of failure cases and wrote a nice doc string. Reverted add_node doc string to correct explanation of procedure. 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-26lib: Incremental matching improvementQuentin Young
Shotgun changes to matching system 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>