summaryrefslogtreecommitdiffstats
path: root/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #6347 from opensourcerouting/llvm-callgraphQuentin Young2020-05-051-1/+1
|\ | | | | tools: LLVM-based call graphs
| * build: add LLVM bitcode targetsDavid Lamparter2020-05-051-1/+1
| | | | | | | | | | | | | | Just an easy way to produce LLVM .bc (bitcode) files. Not used during normal builds. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | lib: make hook.h cpp-compatibleQuentin Young2020-05-051-1/+1
|/ | | | | | | Some CPP compilers don't support these designated initializers, since we're just zero initializing don't need em Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: update the CLI xpath index when exiting from the VRF nodeRenato Westphal2020-04-291-1/+1
| | | | | | | | | | All custom "exit-*" commands that exit from a YANG-modeled CLI node need to use cmd_exit() to ensure the CLI xpath index (vty->xpath_index) will be updated accordingly. Fixes #6316. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Merge pull request #6299 from ton31337/fix/access-list_deletionDonald Sharp2020-04-291-4/+5
|\ | | | | lib: Delete the entire access-list only if there are no more entries
| * lib: Delete the entire access-list only if there are no more entriesDonatas Abraitis2020-04-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * lib: Convert access_list_empty to boolDonatas Abraitis2020-04-271-3/+3
| | | | | | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* | Revert "vtysh: fix searching commands in parent nodes"Donald Sharp2020-04-281-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | lib/zlog: fix printfrr format attributeDavid Lamparter2020-04-271-1/+1
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: fix first headerDavid Lamparter2020-04-271-0/+2
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | build: make clippy Makefile rules nicerDavid Lamparter2020-04-271-14/+9
| | | | | | | | | | | | | | 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>
* | build: use VPATH for vtysh_scanDavid Lamparter2020-04-271-13/+13
|/ | | | | | No need to put $(top_srcdir) everywhere. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge pull request #6249 from chiragshah6/yang_nb5Rafael Zalamena2020-04-242-0/+32
|\ | | | | lib: yang wrapper for date-and-time
| * lib: yang wrapper for date-and-timeChirag Shah2020-04-222-0/+32
| | | | | | | | Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* | Merge pull request #6279 from opensourcerouting/nb-cb-argsDonald Sharp2020-04-248-531/+614
|\ \ | | | | | | *: change the signature of the northbound callbacks to be more flexible
| * | *: change the signature of the northbound callbacks to be more flexibleRenato Westphal2020-04-237-448/+494
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | lib: create a wrapper function for all northbound callbacksRenato Westphal2020-04-232-94/+131
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge pull request #6262 from qlyoung/remove-sprintfDavid Lamparter2020-04-239-29/+36
|\ \ \
| * | | pimd, lib: suppress compiler warnings on snprintfQuentin Young2020-04-211-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | truncation warnings on old compilers Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
| * | | *: use appropriate buffer sizes, specifiersQuentin Young2020-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
| * | | *: manually remove some more sprintfQuentin Young2020-04-213-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | Take care of some more complicated cases by hand Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
| * | | *: sprintf -> snprintfQuentin Young2020-04-217-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | lib, zebra: add missing extern "C" {} blocks to new header filesRenato Westphal2020-04-2315-0/+120
| |/ / |/| | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | | Merge pull request #6265 from patrasar/pim-yangQuentin Young2020-04-221-0/+2
|\ \ \ | |_|/ |/| | yang: Defining yang files for pim
| * | yang: Defining yang files for pimSarita Patra2020-04-221-0/+2
| | | | | | | | | | | | Signed-off-by: Sarita Patra <saritap@vmware.com>
* | | lib/frrcu: make C++ compatibleDavid Lamparter2020-04-211-1/+0
| | | | | | | | | | | | | | | | | | | | | ... 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>
* | | lib/atomlist: make C++ compatibleDavid Lamparter2020-04-212-11/+17
| | | | | | | | | | | | | | | | | | ... by using `atomic_atomptr_t`. Other ideas seemed worse. Signed-off-by: David Lamparter <equinox@diac24.net>
* | | lib/zlog: fix coverity warningDavid Lamparter2020-04-201-2/+1
|/ / | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Merge pull request #6251 from opensourcerouting/cs-ignoreDonald Sharp2020-04-206-5/+29
|\ \ | |/ |/| *: make coverity scan ignore random() calls
| * *: replace all random() callsRafael Zalamena2020-04-186-5/+29
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #6256 from qlyoung/pimd-no-strcpyDavid Lamparter2020-04-181-2/+4
|\ \
| * | lib: don't use strcpyQuentin Young2020-04-181-2/+4
| |/ | | | | | | | | | | >:( Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | lib: dont null check bitfield pointer before freeQuentin Young2020-04-181-4/+2
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | lib: clear data pointer in bf_freeMark Stapp2020-04-171-0/+1
|/ | | | | | Help avoid double-free by clearing data pointer. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* lib: prefix must be a valid pointer at this pointDonald Sharp2020-04-171-0/+1
| | | | | | | 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>
* Merge pull request #6247 from FRRouting/nb_conversionsDonald Sharp2020-04-179-12/+398
|\ | | | | Merge nb_converions branch to master
| * lib: suppress formatting on yang.c module arrayQuentin Young2020-04-161-0/+2
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
| * lib: fix style nit in yang_wrappers.cQuentin Young2020-04-161-1/+1
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
| * lib: increase xpath maxlenChirag Shah2020-04-161-1/+1
| | | | | | | | | | | | | | Certain xpath are well 256 characters, increasing to 512. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
| * lib: remove gcc 4.x workaround for nb structureChirag Shah2020-04-161-1/+0
| | | | | | | | | | | | | | | | | | | | 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>
| * lib: add interface operational northbound callbackChirag Shah2020-04-162-0/+156
| | | | | | | | Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
| * yang: add ietf interface yang modelChirag Shah2020-04-161-0/+1
| | | | | | | | | | | | | | Add ietf interface yant model. Also include it in the makefile. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
| * yang: igmp yang definitionSarita Patra2020-04-161-0/+1
| | | | | | | | | | | | | | | | | | 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>
| * lib: yang wrapper nexthop type to strChirag Shah2020-04-162-0/+30
| | | | | | | | Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
| * lib: add yang wrapper for type emptyChirag Shah2020-04-162-0/+11
| | | | | | | | Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
| * lib:api to convert mac to yang objectChirag Shah2020-04-162-0/+19
| | | | | | | | Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
| * yang: add zebra model in makefileChirag Shah2020-04-161-0/+1
| | | | | | | | Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
| * *: frr nexthop yang in makefileChirag Shah2020-04-161-0/+1
| | | | | | | | Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
| * lib: convert vrf cmd to northbound config callbackChirag Shah2020-04-161-11/+26
| | | | | | | | Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
| * lib: vrf northbound callbacksChirag Shah2020-04-163-0/+148
| | | | | | | | Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>