summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2019-12-09lib,zebra: add api to enforce nexthop sort order when copyingMark Stapp
Add an api that creates a copy of a list of nexthops and enforces the canonical sort ordering; consolidate some nhg code to avoid copy-and-paste. The zebra dplane uses that api when a plugin sets up a list of nexthops, ensuring that the plugin's list is ordered when it's processed in zebra. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-09lib: add ipaddr_isset()Quentin Young
Compare ip address against 0 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-12-09lib: Add weight to nexthop for nexthop-group nexthopsDonald Sharp
Add the ability to read in the weight of a nexthop and store/handle it appropriately nexthop-group BLUE nexthop 192.168.201.44 weight 33 nexthop 192.168.201.45 weight 66 nexthop 192.168.201.46 weight 99 Is appropriately read in and handled as appropriate. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-09lib, zebra: Allow for encode/decode of nexthop weight in pass downDonald Sharp
Add code to encode/decode the nexthop weight when we pass it down into zebra. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-09lib, zebra: Allow for installation of a weighted nexthopDonald Sharp
Linux has the idea of allowing a weight to be sent down as part of a nexthop group to allow the kernel to weight particular nexthop paths a bit more or less than others. See: http://tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.rpdb.multiple-links.html Allow for installation into the kernel using the weight attribute associated with the nexthop. This code is foundational in that it just sets up the ability to do this, we do not use it yet. Further commits will allow for the pass through of this data from upper level protocols. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-07Merge pull request #5498 from mjstapp/sharp_with_labelsDonald Sharp
lib,sharpd: support labelled nexthop-groups in sharpd
2019-12-06Merge pull request #4765 from opensourcerouting/defaults-v2Donald Sharp
lib/*: new config defaults system, v2
2019-12-06lib,sharpd: support labelled nexthop-groups in sharpdMark Stapp
Update sharpd's zapi client code to support labelled nexthops if they're present in a nexthop-group. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-06Merge pull request #5332 from mjstapp/remove_zapi_label_flagDonald Sharp
*: revise zapi nexthop encoding
2019-12-06*: revise zapi nexthop encodingMark Stapp
Use a per-nexthop flag to indicate the presence of labels; add some utility zapi encode/decode apis for nexthops; use the zapi apis more consistently. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-06lib: use const in several stream lib apisMark Stapp
Add some const to some stream apis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-06Merge pull request #5438 from sworleys/PBR-FixesRenato Westphal
pbrd: Assorted Fixes
2019-12-06Merge pull request #5439 from mjstapp/nhg_add_labelsRenato Westphal
lib: support labelled nexthops in nexthop_groups
2019-12-06ospfd: use new defaults mechanism (v2)David Lamparter
Some preprocessor constants converted to enums to make the names usable in the preprocessor. v2: better isolation between core and vty code to make future northbound conversion easier. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06bgpd: use new defaults system (v2)David Lamparter
This moves all the DFLT_BGP_* stuff over to the new defaults mechanism. bgp_timers_nondefault() added to get better file-scoping. v2: moved everything into bgp_vty.c so that the core BGP code is independent of the CLI-specific defaults. This should make the future northbound conversion easier. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06lib/defaults: add bool variable supportDavid Lamparter
(I hadn't initially added this because I thought it superfluous, but it kinda makes things nicer.) Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06lib: new defaults logicDavid Lamparter
Since we've been writing out "frr version" and "frr defaults" for about a year and a half now, we can now actually use them to manage defaults. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06lib: add frr_version_cmp()David Lamparter
This just compares 2 version strings. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06lib: rename memory_vty.c to lib_vty.cDavid Lamparter
And memory_init() to lib_cmd_init(). Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06Merge pull request #5464 from qlyoung/fix-bgp-prefix-orf-heap-overflowDonatas Abraitis
lib: fix heap buf overflow when adding prefix orf
2019-12-04Merge pull request #5416 from mjstapp/re_nhe_pointerDonald Sharp
lib,zebra: use shared nexthop-group in route_entry
2019-12-04lib,zebra: use nhg_hash_entry pointer in route_entryMark Stapp
Replace the existing list of nexthops (via a nexthop_group struct) in the route_entry with a direct pointer to zebra's new shared group (from zebra_nhg.h). This allows more direct access to that shared group and the info it carries. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-03lib: support labelled nexthops in nexthop_groupsMark Stapp
Add support for labelled nexthops in nexthop-group vtysh configuration. Also update the PBR doc where the cli is described. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-03lib: Add zapi_rule_notify_owner2str() functionStephen Worley
Add a function for converting the zapi_rule_notify_owner enum type to a string for ease of use. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-12-03lib: fix heap buf overflow when adding prefix orfQuentin Young
Don't lose your way Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-02Merge pull request #5444 from opensourcerouting/show-candidate-fixDonald Sharp
lib: fix display of candidate configurations
2019-12-02*: generously apply constDavid Lamparter
const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-29lib: fix display of candidate configurationsRenato Westphal
Commit 5e6a9350c16 implemented an optimization where candidate configurations are validated only before being displayed. The validation is done only to create default child nodes (due to how libyang works) and any possible error is ignored (candidate configurations can be invalid/incomplete). The problem is that we were calling lyd_validate() only when the CLI "with-defaults" option was used. But some cli_show() callbacks assume that default nodes exist and can crash when displaying a candidate configuration that isn't validated. To fix this, call lyd_validate() before displaying candidate configuration even when "with-defaults" is not used (that was a micro-optimization that shouldn't have been done). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-11-30*: make frr_yang_module_info constDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-30*: make all route_map_rule_cmd constDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-30lib: make cmd_element & qobj_type constDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-30lib: gcc 4.x workaround v2 for frr_interface_infoDavid Lamparter
The previous workaround only works for -O0, at higher optimization levels gcc reorders the statements in the file global scope which breaks the asm statement :(. Fixes: #4563 Fixes: #5074 Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-27Merge pull request #5435 from opensourcerouting/gcc4-vla-sizeQuentin Young
lib: add gcc 4.x workaround for frr_interface_info
2019-11-26lib: add gcc 4.x workaround for frr_interface_infoDavid Lamparter
gcc 4.x does not properly support structs with variable length array members. Specifically, for global variables, it completely ignores the array, coming up with a size much smaller than what is correct. This is broken for both sizeof() as well as ELF object size. This breaks for frr_interface_info since this variable is in some cases copy relocated by the linker. (The linker does this to make the address of the variable a "constant" for the main program.) This copying uses the ELF object size, thereby copying only the non-array part of the struct. Breakage ensues... (This fix is a bit ugly, but it's limited to very old gcc, and it's better than changing the array to "nodes[1000]" and wasting memory...) Fixes: #4563 Fixes: #5074 Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-22lib: add some nexthop ctorsMark Stapp
Add some apis that allocate and init nexthop objects from various kinds of arguments: ip addrs, interfaces, blackhole types. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-11-22bgpd: evpn pip handle svi ip routeChirag Shah
By default announct Self Type-2 routes with system IP as nexthop and system MAC as nexthop. An API to check type-2 is self route via checking ipv4/ipv6 address from connected interfaces list. An API to extract RMAC and nexthop for type-2 routes based on advertise-svi-ip knob is enabled. When advertise-pip is enabled/disabled, trigger type-2 route update. For self type-2 routes to use anycast or individual (rmac, nexthop) addresses. Ticket:CM-26190 Reviewed By: Testing Done: Enable 'advertise-svi-ip' knob in bgp default instance. the vrf instance svi ip is advertised with nexthop as default instance router-id and RMAC as system MAC. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-22Merge pull request #5328 from satheeshkarra/pim_mlagMark Stapp
pimd, lib, zebra : PIM MLAG Support
2019-11-19Merge pull request #5224 from manuhalo/fix_frr_reload_pathsQuentin Young
Fixes and extensions to frr_reload.py
2019-11-19zebra,pim : Fixing Review comments in PIM_MLAGSatheesh Kumar K
Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-11-19lib: no filter operations fix on appropriate access-list namePhilippe Guibert
some vty no operations were not removing the entry of the access-list, since the access-list name was not retrieved correctly. the index was not correct for 'no ipv6 access-list WORD' operations, but also for one 'no access-list WORD [..] any' operation. PR=66244 Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Acked-by: Alain Ritoux <alain.ritoux@6wind.com>
2019-11-13Zebra: adding support for Zebra MLAG FunctionalitySatheesh Kumar K
This includes: 1. Processing client Registrations for MLAG 2. storing client Interests for MLAG updates 3. Opening communication channel to MLAG with First client reg 4. Closing Communication channel with last client De-reg 5. Spawning a new thread for handling MLAG updates peocessing 6. adding Test code 7. advertising MLAG Updates to clients based on their interests Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-11-13pimd, lib: adding support for MLAG Message processing at PIMSatheesh Kumar K
This includes: 1. Defining message formats 2. Stream Decoding after receiving the message at PIM 3. Handling MLAG UP & Down Notifications Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-11-13pimd : Add support for MLAG Register & Un-registerSatheesh Kumar K
when ever a FRR Client wants to send any data to another node using MLAG Channel, uses below mechanisam. 1. sends a MLAG Registration to zebra with interested messages that it is intended to receive from peer. 2. In response to this request, Zebra opens communication channel with MLAG. and also in Rx. diretion zebra forwards only those messages which client shown interest during registration 3. when client is no-longer interested in communicating with MLAG, client posts De-register to Zebra 4. if this is the last client which is interested for MLAG Communication, zebra closes the channel. why PIM Needs MLAG Communication ================================ 1. In general on LAN Networks elecetd DR will send the Join towards Multicast RP in case of a LHR and Register in case of FHR. 2. But in case DR Goes down, traffic will be re-converged only after the New DR is elected, but this can take time based on Hold Timer to detect the DR down. 3. this can be optimised by using MLAG Mecganisam. 4. and also Traffic can be forwarded more efficiently by knowing the cost towards RP using MLAG Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-11-12Merge pull request #5209 from ton31337/feature/banner_motd_from_inputRenato Westphal
vtysh: Add an option to set banner motd from an input
2019-11-02lib, ospfd, zebra: Convert interface_delete to take double pointerDonald Sharp
When free'ing the interface pointer, set it to NULL. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-02*: Convert connected_free to a double pointerDonald Sharp
Set the connected pointer to set the pointer to NULL. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-02*: Convert prefix_free to double pointerDonald Sharp
Have the prefix_free code take a double pointer to free the data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-31vtysh: Add an option to set banner motd from an inputDonatas Abraitis
This allows to set motd from an input instead of creating a file. Example: root@exit2-debian-9:~/frr# telnet 127.0.0.1 2605 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. Hello, this is bgpd User Access Verification Password: exit2-debian-9> enable exit2-debian-9# sh run Current configuration: ! frr version 7.3-dev-MyOwnFRRVersion frr defaults traditional ! hostname exit2-debian-9 password belekas log file /var/log/frr/labas.log log syslog informational banner motd line Hello, this is bgpd ! ! ! line vty ! end exit2-debian-9# Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-10-29vrrpd: only count ipv4 addresses on check startGhasem Naddaf
Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>