summaryrefslogtreecommitdiff
path: root/lib/command.h
AgeCommit message (Collapse)Author
2017-08-28lib: new APIs for get/set system hostname/domainnameMitesh Kanjariya
1. Change hostname_get to cmd_hostname_get 2. Change domainname_get to cmd_domainname_get 3. New API to set domainname 3. Provide a CLI command to set domainname Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-24provide/use API to get hostname/domainnameMitesh Kanjariya
Set default hostname in frr to unix hostname. Provide APIs to get the hostname/domaninanme Use this APIs where needed Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-24lib/bgpd: provide/use API to get hostname/domainnameMitesh Kanjariya
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-09Merge branch 'frr/pull/822' ("EVPN fixes")David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-09zebra: add support for static pseudowiresRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-08bgpd, lib, vtysh: Added support for mac filtering in route-mapsMitesh Kanjariya
1. Added support to create mac filters 2. Enabled route-map commands for EVPN address family 3. Provision to add mac filters under match clause in route-maps Ticket: CM-16349 Review: CCR-6190 Unit-test: Manual (logs attached to ticket) Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-04ospfd: Fix MI-OSPF configuraton clisChirag Shah
Multi-Instance OSPF configuration CLI would fail because first client return error upon seeing qobj_index being 0. With new marco generate new error code to return from each instance (vtysh client) and if the command is intended for given instance, its qobj_index would be nonzero and process the command and push correct ospf context. Other instance would return the error. On vtysh end, check all instance return an error log a message to a file. Testing Done: Verfied various MI-OSPF configuration CLI with multi instances. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-07-26lib, vtysh: add `find COMMAND`Quentin Young
Substring search through all defined commands in all nodes. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-26lib: add CLI node namesQuentin Young
Adds an array of descriptive names for each CLI node, plus a runtime check to make sure folks don't forget to update it. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
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-07-14Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attrDonald Sharp
2017-07-14Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attrDonald Sharp
2017-07-14lib, vtysh: remove now-useless newline argDavid Lamparter
It's always \n now, hooray. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14Merge pull request #808 from qlyoung/vtysh-termcolsRuss White
lib, vtysh: pretty-print variable autocompletions
2017-07-13vtysh: return non-zero for configuration failuresDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> This allows frr-reload.py (or anything else that scripts via vtysh) to know if the vtysh command worked or hit an error.
2017-07-13lib, vtysh: pretty-print variable autocompletionsQuentin Young
Pretty-prints variable autocompletions by breaking them up into multiple lines, indenting them consistently and respecting the column width of the terminal. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-12bgpd: Additional configuration for EVPNvivek
Implement configuration options for EVPN. The configuration options include VNI configuration with RD and Import and Export Route Targets. Also, display the EVPN configuration. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-07-11bgpd: --enable-multipath=256 setting is ignoredDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Restoring some code that was unintentionally removed when we were migrating to Quentin's parser.
2017-06-14python: clidef.pyDavid Lamparter
Adds "DEFPY()" which invokes an additional layer of preprocessing, so that we get pre-parsed and named function arguments for the CLI. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-30Merge remote-tracking branch 'origin/master' into babelDonald Sharp
2017-05-23lib: remove BGP_ENCAP(V6)_NODELou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
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>
2017-05-15lib: cli: autocomplete variablesDavid Lamparter
Shows known values in the appropriate naming domain when the user hits <?> or <Tab>. This patch only works in the telnet CLI, the next patch adds vtysh support. Included completions: - interface names - route-map names - prefix-list names Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15lib: parser: split off & rename graph handlingDavid Lamparter
Put core CLI graph stuff in lib/command_graph.[ch] and consistently prefix all function names with "cmd_". Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15lib: parser: add named variables in CLIDavid Lamparter
struct cmd_token now has a "varname" field which is derived from the DEFUN's string definition. It can be manually specified with "$name" after some token, e.g. "foo WORD$var". A later commit adds code to automatically fill the value if nothing is specified. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-13*: Initial Import of Babeld into FRRDonald Sharp
This is a direct copy of: https://github.com/boutier/quagga-merge From the branch babel-merge I copied the babeld directory into FRR and then fixed up everything to compile. Babeld at this point in time when run will more than likely crash and burn in it's interfactions with zebra. I might have messed up the cli, which will need to be looked at extract.pl.in and vtysh.c need to be fixed up. Additionally we probably need to work on DEFUN_NOSH conversion in babeld as well This code comes from: Matthieu Boutier <boutier@irif.fr> Juliusz Chroboczek <jch@irif.fr> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-02Merge branch 'master' into EIGRPDonald Sharp
2017-04-15lib, bgpd: Remove UNDEFINED_NODEDonald Sharp
Remove the UNDEFINED_NODE as that it's implementation breaks our ability in BGP to figure out where we are by allowing default: in the switch statement. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-06bgpd: labeled unicast configDon Slice
Implement support for activating the labeled-unicast address family in BGP and relevant configuration for this address family. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2017-03-08eigrp: Initial CommitDonald Sharp
Please Note, I will be redoing this commit message with more information. Additionally I will rework the lib/* changes into their own commits. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-14lib: define BGP_EVPN_NODEPhilippe Guibert
This define introduces bgp sub node address-family evpn. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2017-02-10lib: track name of command in cmd_elementDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-10lib: parser: rewrite token deduplicationDavid Lamparter
Merge the parsed graph into the existing one as a separate step. This makes it possible to merge identical subgraphs, which is used e.g. in bgpd for <A.B.C.D|X:X::X:X|WORD> neighbor names. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-08lib: remove unused cmd_concat_strvec()David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-31lib/tests: add cmd_hostname_set()David Lamparter
To make it possible for testcli to get a clean memory management bill. (Note: XFREE() is NULL-safe, just like free().) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-25Merge pull request #101 from LabNConsulting/working/master/patch-set/3-vrfDonald Sharp
Master version of basic vrf commands & some other missed fixes
2017-01-25Merge pull request #105 from opensourcerouting/cli_merge_step_prepDonald Sharp
Prepare for split-off cli parser "merge" step
2017-01-25lib: parser: fix memory managementDavid Lamparter
command.c had: DEFINE_MTYPE_STATIC(LIB, CMD_TOKENS, "Command desc") while command_match.c had: DEFINE_MTYPE_STATIC(LIB, CMD_TOKENS, "Command Tokens") ... which means that there are 2 distinct MTYPE_CMD_TOKENS. (The description text being different does not matter, even with the same text it'd be 2 distinct types.) command_match.c allocates token->arg in command_match_r() while command.c frees it in del_cmd_token(). Therefore with each command being executed, the allocation count goes up on one, down on the other. => clean up parser allocation counting. Also, use separate MTYPEs for the different fields in struct cmd_token. Fixes: #108 / ee9216cf ("lib, ripngd: clean up merge leftovers") Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Cc: Quentin Young <qlyoung@cumulusnetworks.com>
2017-01-23grammar_sandbox: add into daemons if DEV_BUILDDavid Lamparter
Also adds "grammar access <node>" to test/dump an existing command node (e.g. BGP_NODE). Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-23lib: parser: track matching FORK_TKN & JOIN_TKNDavid Lamparter
This associates pairs of FORK and JOIN tokens, so the merge function can identify where a subgraph begins and ends. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-23lib: parser: simplify OPTION_TKN & SELECTOR_TKNDavid Lamparter
These are functionally identical as "fork" tokens. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-22bgpd: add vrf-policy config using existing vnc codeLou Berger
add add/clear vrf prefix + Modified for FRR master parser Signed-off-by: Lou Berger <lberger@labn.net>
2016-12-16lib: parser: move allowrepeat to cmd_tokenDavid Lamparter
struct graph_node isn't quite the right place to control matcher behaviour. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-01lib: remove misleading copy/del_cmd_elementDavid Lamparter
struct cmd_element items are static global variables, they are never allocated, copied or freed. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-01lib: move command_parse_format prototypeDavid Lamparter
The function prototype for command_parse_format() is better left in command.h, so that the bison-generated header file doesn't need to be included for that. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-01lib: make DEFUN foobar_cmd symbols staticDavid Lamparter
These are not externally referenced anymore; this reduces the symbol count of libzebra by quite a bit. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-01*: make DEFUN installations file-localDavid Lamparter
This moves all install_element calls into the file where the DEFUNs are located. This fixes several small related bugs: - ospf6d wasn't installing a "no interface FOO" command - zebra had a useless copy of "interface FOO" - pimd's copy of "interface FOO" was not setting qobj_index, which means "description LINE" commands would fail with an error The next commit will do the actual act of making "foo_cmd" static. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-11-23vtysh: fix some macro breakageDavid Lamparter
vtysh's extract.pl script doesn't cope with install_element(var, ) where "var" is not one of the FOO_NODE constants. Also, the future defun_lex tool doesn't deal well with preprocessor expansions in the same regard. This tries simplifying out some of these. lib/distribute.c needs further thinking. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-11-17lib, ospf6d: Change SECONDS_STR to be more genericQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-12Merge branch 'cmaster-next' into vtysh-grammarQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Conflicts: lib/command.c lib/vty.c