summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2020-04-30isisd: add support for segment routingRenato Westphal
This is an implementation of the IS-IS SR draft [1] for FRR. The following features are supported: * IPv4 and IPv6 Prefix-SIDs; * IPv4 and IPv6 Adj-SIDs and LAN-Adj-SIDs; * Index and absolute labels; * The no-php and explicit-null Prefix-SID flags; * Full integration with the Label Manager. Known limitations: * No support for Anycast-SIDs; * No support for the SID/Label Binding TLV (required for LDP interop). * No support for persistent Adj-SIDs; * No support for multiple SRGBs. [1] draft-ietf-isis-segment-routing-extensions-25 Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-30lib: constify a few parameters of helper functionsRenato Westphal
Parameters should be const whenever possible to improve code readability and remove the need to cast away the constness of const arguments. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-29Merge pull request #6299 from ton31337/fix/access-list_deletionDonald Sharp
lib: Delete the entire access-list only if there are no more entries
2020-04-28Revert "vtysh: fix searching commands in parent nodes"Donald Sharp
This reverts commit d741915ecdcf8930ccb3bd23eec1da2f0d000483. This is because it breaks this behavior: router ospf6 <commands> ! int enp39s0 <more commands> ! This is a very legal set of commands and completely destroys the ability to do this. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-27lib: Delete the entire access-list only if there are no more entriesDonatas Abraitis
When you enter the access-list with the same sequence number but with a different prefix AND access-list has only a single entry, then the entry is deleted and the whole access-list is deleted. That means that "replace entry" never be re-inserted. With fix: ``` ~# vtysh -c 'c' -c 'access-list 1 seq 10 permit 127.0.0.10/32' ~# vtysh -c 'sh run' | grep access-list access-list 1 seq 10 permit 127.0.0.10/32 ~# vtysh -c 'c' -c 'access-list 1 seq 10 permit 127.0.0.20/32' ~# vtysh -c 'sh run' | grep access-list access-list 1 seq 10 permit 127.0.0.20/32 ~# vtysh -c 'c' -c 'access-list 1 seq 11 permit 127.0.0.11/32' ~# vtysh -c 'sh run' | grep access-list access-list 1 seq 10 permit 127.0.0.20/32 access-list 1 seq 11 permit 127.0.0.11/32 ~# vtysh -c 'c' -c 'no access-list 1 seq 10 permit 127.0.0.20/32' ~# vtysh -c 'sh run' | grep access-list access-list 1 seq 11 permit 127.0.0.11/32 ~# ``` Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-27lib: Convert access_list_empty to boolDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-27lib/zlog: fix printfrr format attributeDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27*: fix first headerDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27build: make clippy Makefile rules nicerDavid Lamparter
These are easy to get subtly wrong, and doing so can cause nondeterministic failures when racing in parallel builds. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27build: use VPATH for vtysh_scanDavid Lamparter
No need to put $(top_srcdir) everywhere. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-24Merge pull request #6249 from chiragshah6/yang_nb5Rafael Zalamena
lib: yang wrapper for date-and-time
2020-04-24Merge pull request #6279 from opensourcerouting/nb-cb-argsDonald Sharp
*: change the signature of the northbound callbacks to be more flexible
2020-04-23Merge pull request #6262 from qlyoung/remove-sprintfDavid Lamparter
2020-04-23*: change the signature of the northbound callbacks to be more flexibleRenato Westphal
Having a fixed set of parameters for each northbound callback isn't a good idea since it makes it difficult to add new parameters whenever that becomes necessary, as several hundreds or thousands of existing callbacks need to be updated accordingly. To remediate this issue, this commit changes the signature of all northbound callbacks to have a single parameter: a pointer to a 'nb_cb_x_args' structure (where x is different for each type of callback). These structures encapsulate all real parameters (both input and output) the callbacks need to have access to. And adding a new parameter to a given callback is as simple as adding a new field to the corresponding 'nb_cb_x_args' structure, without needing to update any instance of that callback in any daemon. This commit includes a .cocci semantic patch that can be used to update old code to the new format automatically. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-23lib: create a wrapper function for all northbound callbacksRenato Westphal
The intention here is to keep the code more organized. These wrappers should be used by the northbound clients only, and never directly by any YANG backend code. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-22lib, zebra: add missing extern "C" {} blocks to new header filesRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-22Merge pull request #6265 from patrasar/pim-yangQuentin Young
yang: Defining yang files for pim
2020-04-22yang: Defining yang files for pimSarita Patra
Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-04-22lib: yang wrapper for date-and-timeChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-21lib/frrcu: make C++ compatibleDavid Lamparter
... by dropping seqlock.h from the header's includes; it's only needed in the C code in frrcu.c. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-21lib/atomlist: make C++ compatibleDavid Lamparter
... by using `atomic_atomptr_t`. Other ideas seemed worse. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-21pimd, lib: suppress compiler warnings on snprintfQuentin Young
truncation warnings on old compilers Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20*: use appropriate buffer sizes, specifiersQuentin Young
- Fix 1 byte overflow when showing GR info in bgpd - Use PATH_MAX for path buffers - Use unsigned specifiers for uint16_t's in zebra pbr Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20*: manually remove some more sprintfQuentin Young
Take care of some more complicated cases by hand Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20*: sprintf -> snprintfQuentin Young
Replace sprintf with snprintf where straightforward to do so. - sprintf's into local scope buffers of known size are replaced with the equivalent snprintf call - snprintf's into local scope buffers of known size that use the buffer size expression now use sizeof(buffer) - sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp buffer followed by strlcat Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20lib/zlog: fix coverity warningDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-20Merge pull request #6251 from opensourcerouting/cs-ignoreDonald Sharp
*: make coverity scan ignore random() calls
2020-04-18Merge pull request #6256 from qlyoung/pimd-no-strcpyDavid Lamparter
2020-04-17lib: dont null check bitfield pointer before freeQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-17lib: don't use strcpyQuentin Young
>:( Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-17*: replace all random() callsRafael Zalamena
Replace all `random()` calls with a function called `frr_weak_random()` and make it clear that it is only supposed to be used for weak random applications. Use the annotation described by the Coverity Scan documentation to ignore `random()` call warnings. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-17lib: clear data pointer in bf_freeMark Stapp
Help avoid double-free by clearing data pointer. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-16lib: prefix must be a valid pointer at this pointDonald Sharp
Coverity does not understand how our CLI works. Make it happy that we have tested it's existence Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-16Merge pull request #6247 from FRRouting/nb_conversionsDonald Sharp
Merge nb_converions branch to master
2020-04-16Merge pull request #6135 from opensourcerouting/cli-node-cleanupDonald Sharp
*: clean up the mess that is CLI command nodes
2020-04-16Merge pull request #6239 from ton31337/fix/uint8_t_to_bool_for_anyQuentin Young
bgpd, lib: Use bool instead of uint8_t for community/prefix-list "any"
2020-04-16lib: suppress formatting on yang.c module arraynb_conversionsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-16Merge pull request #6224 from mjstapp/zclient_session_idOlivier Dugeon
lib,zebra: add a session id for zapi sessions
2020-04-16lib: fix style nit in yang_wrappers.cQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-16lib,zebra: add a session id for zapi sessionsMark Stapp
Distinguish zapi sessions, for daemons who use more than one, by adding a session id. The tuple of proto + instance is not adequate to support clients who use multiple zapi sessions. Include the id in the client show output if it's present. Add a bit of info about this to the developer doc. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-16lib: increase xpath maxlenChirag Shah
Certain xpath are well 256 characters, increasing to 512. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16lib: remove gcc 4.x workaround for nb structureChirag Shah
Remove gcc 4.x workaround for variable size array as gcc check moved to header file. In lib/northbound.h : struct frr_yang_module_info made size 1000 for gcc 4.x, where maximum 1000 nodes can fit. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16lib: add interface operational northbound callbackChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16yang: add ietf interface yang modelChirag Shah
Add ietf interface yant model. Also include it in the makefile. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16yang: igmp yang definitionSarita Patra
Defined frr-igmp.yang file for IGMP protocol. Co-authored-by: Sarita Patra <saritap@vmware.com> Co-authored-by: Santosh P K <sapk@vmware.com> Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-04-16lib: yang wrapper nexthop type to strChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16lib: add yang wrapper for type emptyChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16lib:api to convert mac to yang objectChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16yang: add zebra model in makefileChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16*: frr nexthop yang in makefileChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>