summaryrefslogtreecommitdiff
path: root/lib/command.c
AgeCommit message (Collapse)Author
2018-03-09lib: add new BGP VPN policy command nodeG. Paul Ziemba
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-09lib, vtysh: Start cli for nexthop-groupDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-06Merge pull request #1728 from mkanjari/evpn-bug-fixesPhilippe Guibert
Evpn bug fixes
2018-02-27lib: split logicalrouter and vrf netns featurePhilippe Guibert
This split is introducing logicalrouter.[ch] as the file that contains the vty commands to configure logical router feature. The split has as consequence that the backend of logical router is linux_netns.c formerly called ns.c. The same relationship exists between VRF and its backend which may be linux_netns.c file. The split is adapting ns and vrf fiels so as to : - clarify header - ensure that the daemon persepctive, the feature VRF or logical router is called instead of calling directly ns. - this implies that VRF will call NS apis, as logical router does. Also, like it is done for default NS and default VRF, the associated VRF is enabled first, before NETNS is enabled, so that zvrf->zns pointer is valid when NETNS discovery applies. Also, other_netns.c file is a stub handler that will be used for non linux systems. As NETNS feature is only used by Linux, some BSD systems may want to use the same backend API to benefit from NETNS. This is what that file has been done. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-02-08vtysh/lib: write domainname to config fileMitesh Kanjariya
Ticket: CM-19626 Review: CCR-7170 Testing: Manual Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-02*: silence '-Wchar-subscripts' warnings on NetBSDRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-01-30lib, pimd: Remove PIM_NODE as it is not neededDonald Sharp
The PIM_NODE command is only being used to display default vrf configuration. Move this into the vrf display and remove PIM_NODE. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-13Merge pull request #1436 from rtrlib/rpkiDonald Sharp
bgpd: Add RPKI/RTR support
2017-11-12lib: Fix command `copy running-config startup-config` to alias `write file`pogojotz
Fixes: #1412 Signed-off-by: Juergen Werner <pogojotz@gmx.net>
2017-11-10bgpd: Add RPKI/RTR supportMarcel Röthke
This commit adds support for the RTR protocol to receive ROA information from a RPKI cache server. That information can than be used to validate the BGP origin AS of IP prefixes. Both features are implemented using [rtrlib](http://rtrlib.realmv6.org/). Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
2017-10-24*: add missing \n in some help stringsRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-05*: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp
Convert the list_delete(struct list *) function to use struct list **. This is to allow the list pointer to be nulled. I keep running into uses of this list_delete function where we forget to set the returned pointer to NULL and attempt to use it and then experience a crash, usually after the developer has long since left the building. Let's make the api explicit in it setting the list pointer to null. Cynical Prediction: This code will expose a attempt to use the NULL'ed list pointer in some obscure bit of code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-05lib: Hash creation cleanupDonald Sharp
1) Some hash key functions where converting pointers directly to a 32 bit value via downcasting. Pointers are 64 bit on a majority of our platforms. 2) Some hashes were being created with 256 entries, downsize the hash creation size to more appropriate values. 3) Add hash names to hash creation so we can watch the hash via 'show debugging hashtable' Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-30*: fix styleQuentin Young
Fixes style nits introduced by recent pull requests. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-28Merge branch 'master' into dev-masterMitesh Kanjariya
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-25Handle hostname/domainname properly for FreeBSDMitesh Kanjariya
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-25Fix compilation errors for domainnameMitesh Kanjariya
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-25lib: Fix make check failuresMitesh Kanjariya
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-24lib: better warnings for install_elementDavid Lamparter
Also fixes misuse of vector_slot() - that one doesn't check for access beyond end of vector... And print node names in grammar sandbox "printall". Fixes: #543 Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-24lib: centralized memstats-at-exitDavid Lamparter
adds a new all-daemon "debug memstats-at-exit" command. Also saves memstats to a file in /tmp, useful if a long-running daemon is having weird issues (e.g. in a user install). Fixes: #437 Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-10lib: Fix multi instance ospfChirag Shah
ospfd crashes upon configuring multi-instance ospf i.e 'router ospf x'. ospfd can return CMD_NOT_MY_INSTANCE which is not supported in lib/commands Support two of the error codes CMD_NOT_MY_INSTANCE and CMD_WARNING_CONFIG_FAILED Signed-off-by: Chirag Shah <chirag@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-07-31lib: s/leychain/keychainQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-27lib: correct some node name typosQuentin Young
Signed-off-by: Quentin Young <qlyoung@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-22Revert "*: reindent pt. 2"David Lamparter
This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276. clang 5 is not widely available enough for people to indent with. This is particularly problematic when rebasing/adjusting branches. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17*: reindent pt. 2whitespace / reindent
w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
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 remote-tracking branch 'frr/master' into newline-reduxDavid Lamparter
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-14Merge remote-tracking branch 'frr/master' into newline-reduxDavid Lamparter
Lots of conflicts from CMD_WARNING_CONFIG_FAILED... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14*: remove VTYNL, part 3 of 6David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14*: remove VTYNL, part 1 of 6David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
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-13*: ditch vty_outln(), part 1 of 2David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
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-06lib: fix more docstringsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-01*: update hash_create(), hash_create_size()Quentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-01lib, vtysh: hashtable statisticsQuentin Young
Adds the ability to name hash tables, and a new cli command that will show various summary statistics for named hash tables. Statistics computed are - load factor - full load factor (see comments) - stddev of full load factor Standard deviation is computed by storing the sum of squares of bucket lengths. This is somewhat susceptible to overflow. On platforms where a double is 32 bits, placing 65535 or more elements into a hash table opens up the potential for overflow, depending on how they are arranged in buckets (which depends on the hash function). For example, placing 65535 elements into one hash bucket would cause ssq overflow, but distributing 40000000 elements evenly among 400000 buckets (100 elements per bucket) would not. These cases are extremely degenerate, so the vague possibility of overflow in an informational command is deemed an acceptable tradeoff for constant time calculation of variance without locks or compromising efficiency of actual table operations. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-01lib: add statistics for hash tablesQuentin Young
Adds a function that calculates various statistics on our implementation of a hash table. These are useful for evaluating performance. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>