summaryrefslogtreecommitdiff
path: root/vrrpd/vrrp_vty.c
AgeCommit message (Collapse)Author
2024-09-01*: Create termtable specific temp memoryDonald Sharp
When trying to track down a MTYPE_TMP memory leak it's harder to search for it when you happen to have some usage of ttable_dump. Let's just give it it's own memory type so that we can avoid confusion in the future. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-27lib: common debug status outputIgor Ryzhov
Implement common code for debug status output and remove daemon-specific code that is duplicated everywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-08-27lib: common debug config outputIgor Ryzhov
Implement common code for debug config output and remove daemon-specific code that is duplicated everywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-23lib: remove leaf-list xpath hack from northboundIgor Ryzhov
Currently, when editing a leaf-list, `nb_candidate_edit` expects to receive it's xpath without a predicate and the value in a separate argument, and then creates the full xpath. This hack is complicated, because it depends on the operation and on the caller being a backend or not. Instead, let's require to always include the predicate in a leaf-list xpath. Update all the usages in the code accordingly. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-11-29lib: all: remove './' from xpath 22% speedupChristian Hopps
fixes #8299 Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-19vrrpd: add priority field into interface jsonSindhu Parvathi Gopinathan
'Priority' attribute is missing in "show vrrp interface <intf> json" output. Whereas it is there in non-json output. It has been added now in show vrrp interface json output. Before Fix: ``` vrrp1# show vrrp interface swp5.101 json [ { "vrid":2, "version":3, "autoconfigured":false, "shutdown":false, "preemptMode":true, "acceptMode":true, "interface":"swp5.101", "advertisementInterval":1000, "v4":{ "interface":"vrrp4-11-2", "vmac":"00:00:5e:00:01:02", "primaryAddress":"50.0.0.2", "status":"Master", "effectivePriority":110, "masterAdverInterval":1000, "skewTime":570, "masterDownInterval":3570, "stats":{ "adverTx":248456, "adverRx":1, "garpTx":1, "transitions":2 }, "addresses":[ "50.0.0.1" ] }, "v6":{ "interface":"vrrp6-11-2", "vmac":"00:00:5e:00:02:02", "primaryAddress":"fe80::7f1:49e7:768c:aa73", "status":"Master", "effectivePriority":110, "masterAdverInterval":1000, "skewTime":570, "masterDownInterval":3570, "stats":{ "adverTx":248455, "adverRx":1, "neighborAdverTx":1, "transitions":2 }, "addresses":[ "2001:50::1" ] } } ] vrrp1# ``` After Fix: ``` vrrp1# show vrrp interface swp5.101 json [ { "vrid":2, "version":3, "autoconfigured":false, "shutdown":false, "preemptMode":true, "acceptMode":true, "interface":"swp5.101", "advertisementInterval":1000, "priority":110, ====> priority added into json output "v4":{ "interface":"vrrp4-11-2", "vmac":"00:00:5e:00:01:02", "primaryAddress":"50.0.0.2", "status":"Master", "effectivePriority":110, "masterAdverInterval":1000, "skewTime":570, "masterDownInterval":3570, "stats":{ "adverTx":15, "adverRx":4, "garpTx":1, "transitions":2 }, "addresses":[ "50.0.0.1" ] }, "v6":{ "interface":"vrrp6-11-2", "vmac":"00:00:5e:00:02:02", "primaryAddress":"fe80::7f1:49e7:768c:aa73", "status":"Master", "effectivePriority":110, "masterAdverInterval":1000, "skewTime":570, "masterDownInterval":3570, "stats":{ "adverTx":13, "adverRx":5, "neighborAdverTx":1, "transitions":2 }, "addresses":[ "2001:50::1" ] } } ] ``` Ticket:#3502432 Issue:3502432 Testing: UT done Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.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>
2022-11-25vrrpd: add IPv4 pseudoheader option for VRRPv3Siger Yang
This commit adds a new option to control whether a VRRPv3 group accepts / computes its checksum with a prepended IPv4 pseudoheader. This should improve interoperability with other devices. Signed-off-by: Siger Yang <siger.yang@outlook.com>
2022-10-26build, vtysh: extract vtysh commands from .xrefDavid Lamparter
Rather than running selected source files through the preprocessor and a bunch of perl regex'ing to get the list of all DEFUNs, use the data collected in frr.xref. This not only eliminates issues we've been having with preprocessor failures due to nonexistent header files, but is also much faster. Where extract.pl would take 5s, this now finishes in 0.2s. And since this is a non-parallelizable build step towards the end of the build (dependent on a lot of other things being done already), the speedup is actually noticeable. Also files containing CLI no longer need to be listed in `vtysh_scan` since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL` checks are equally obsolete. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-13Merge pull request #12066 from opensourcerouting/cleanup-cli-xrefDonald Sharp
*: clean up various CLI-related bits
2022-10-07*: Create and use infrastructure to show debugs in libDonald Sharp
There are lib debugs being set but never show up in `show debug` commands because there was no way to show that they were being used. Add a bit of infrastructure to allow this and then use it for `debug route-map` Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-06*: fix some malformed CLI docstringsDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-22vrrpd: Fix display of 'Master Advertisement interval'Rajesh Varatharaj
VRRP as per RFC 5798 'Master Advertisement interval' field refers to the advertisement interval, we received the last time we got an Advertisement from a peer who wasn't us, who was in the master state. This could be clarified by making the field name 'Master Advertisement interval (rx)',and when we're in the Master state, we put (stale) after the interval. Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
2021-10-25*: fix interface config write in NB-converted daemonsIgor Ryzhov
When writing the config from the NB-converted daemon, we must not rely on the operational data. This commit changes the output of the interface configuration to use only config data. As the code is the same for all daemons, move it to the lib and remove all the duplicated code. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-13lib: northbound cli show/cmd functions must not modify data nodesIgor Ryzhov
To ensure this, add a const modifier to functions' arguments. Would be great do this initially and avoid this large code change, but better late than never. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-26lib: remove unused argument from vrf_cmd_initIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-07-29*: cleanup interface node installationIgor Ryzhov
The only difference in daemons' interface node definition is the config write function. No need to define the node in every daemon, just pass the callback as an argument to a library function and define the node there. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-21lib: remove vrf-interface config when removing the VRFIgor Ryzhov
If we have the following configuration: ``` vrf red smth exit-vrf ! interface red vrf red smth ``` And we delete the VRF using "no vrf red" command, we end up with: ``` interface red smth ``` Interface config is preserved but moved to the default VRF. This is not an expected behavior. We should remove the interface config when the VRF is deleted. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-13lib: adapt to version 2 of libyangChristian Hopps
Compile with v2.0.0 tag of `libyang2` branch of: https://github.com/CESNET/libyang staticd init load time of 10k routes now 6s vs ly1 time of 150s Signed-off-by: Christian Hopps <chopps@labn.net>
2020-10-02*: move "show debugging ..." commands to enable nodeIgor Ryzhov
Use the same node for "show debugging" commands in all daemons. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-02*: move "debug ..." commands to enable nodeIgor Ryzhov
Use the same node for "debug" commands in all daemons. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-08-03*: introduce DEFPY_YANG & friendsRenato Westphal
DEFPY_YANG will allow the CLI to identify which commands are YANG-modeled or not before executing them. This is going to be useful for the upcoming configuration back-off timer work that needs to commit pending configuration changes before executing a command that isn't YANG-modeled. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-07-26vrrpd: Make clang 11 happyDonald Sharp
Recent changes to remove PRIu... in commit: 6cde4b45528e52819c803de92d10d4be3abddf29 causes clang 11 to be unhappy, with length of field warnings. Modify the offending code to compile properly using that compiler. I've tested against clang 11 and gcc 9.3 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-07-14*: remove PRI[udx](8|16|32)David Lamparter
These are completely pointless and break coccinelle string replacements. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --pri8-16-32 `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: move CLI node names to cmd_node->nameDavid Lamparter
And again for the name. Why on earth would we centralize this, just so people can forget to update it? Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: move CLI parent data to cmd_node->parent_nodeDavid Lamparter
Same as before, instead of shoving this into a big central list we can just put the parent node in cmd_node. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove second parameter on install_node()David Lamparter
There is really no reason to not put this in the cmd_node. And while we're add it, rename from pointless ".func" to ".config_write". [v2: fix forgotten ldpd config_write] Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove cmd_node->vtyshDavid Lamparter
The only nodes that have this as 0 don't have a "->func" anyway, so the entire thing is really just pointless. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: clean up cmd_node initializersDavid Lamparter
... and use named assignments everywhere (so I can change the struct.) Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-09vrrpd, yang: cleanup vrrp nb conversionQuentin Young
- Use correct units and conversions in model & code - Fix incorrect CLI help string for V6 virtual addrs - Fix nb get-entry callback for virtual router - Fix a couple style nits - Simplify some CLI code - Remove unused code - Remove unused YANG definitions - Update sighup() to handle reloads - Update interface level config writer to use NB callbacks - Add simplified `no` forms for priority and advertisement-interval commands Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-09vrrpd: northbound conversionQuentin Young
Convert VRRPD to use the northbound API. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-10-17vrrpd: use CS2MS instead of constant 10 everywhereGhasem Naddaf
Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com> vrrpd: use CS2MS instead of constant 10 everywhere Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>
2019-09-19*: Add infrastructure to support zapi interface callbacksDonald Sharp
Start the conversion to allow zapi interface callbacks to be controlled like vrf creation/destruction/change callbacks. This will allow us to consolidate control into the interface.c instead of having each daemon read the stream and react accordingly. This will hopefully reduce a bunch of cut-n-paste stuff Create 4 new callback functions that will be controlled by lib/if.c create -> A upper level protocol receives an interface creation event The ifp is brand spanking newly created in the system. up -> A upper level protocol receives a interface up event This means the interface is up and ready to go. down -> A upper level protocol receives a interface down destroy -> A upper level protocol receives a destroy event This means to delete the pointers associated with it. At this point this is just boilerplate setup for future commits. There is no new functionality. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-21vrrpd: use MTYPE_STATICDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-05-17vrrpd, zebra: fix checkpatch warningsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: add 'show vrrp summary' commandQuentin Young
Shows a brief summary table of all VRRP routers Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: fix magnitude error when removing adver_intQuentin Young
When resetting advertisement interval back to the default, we were dividing centiseconds by 10 instead of milliseconds. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: convert defaults command to millisecondsQuentin Young
Missed this in the conversion from centiseconds to milliseconds. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd, lib: style fixesQuentin Young
Fixup: * Blank lines after declarations * Trailing whitespace * Braces and parentheses Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: display configured adv int in json outputQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: change all user facing times to msQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: display primary address in json outputQuentin Young
And also, fill in the non-json output with a :: for the v6 primary since we're letting the operating system select which one it wants to use and we don't actually know what our primary address is. Another thing to revisit in the future... Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: disallow setting priority = 255Quentin Young
Assuming we fix our automatic detection method in the future, we won't be able to revert this back to disallowing 255 without breaking user configs. Let's just disallow it now, there's no functional difference still. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: allow user to set priority = 255Quentin Young
Too many problems with implicit ownership determination via duplicate address assignment. Will revisit that in the future. For now, allow user to specify 255 as a priority value. This is functionally no different than any other priority value; it just serves as a self-documenting way of saying you want one router to always be master. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: fix sign compare on armelQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: add more debugging infoQuentin Young
* Add reason why we are discarding adverts * Add primary IP to show vrrp output Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: fix unsigned - signed cmpQuentin Young
For some reason this warning only shows up on armel Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: check start for manual v6 addr addQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: allow configuring global defaultsQuentin Young
Allow configuring the following as global defaults: - Priority - Advertisement interval - Preempt mode - Administrative shutdown Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: add statistics collectionQuentin Young
Collect and display the following: - Advertisement Tx/Rx - GARP Tx/Rx - NDISC Tx/Rx - # transitions Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>