summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2020-04-16lib: suppress formatting on yang.c module arraynb_conversionsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-16lib: fix style nit in yang_wrappers.cQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
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>
2020-04-16lib: convert vrf cmd to northbound config callbackChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16lib: vrf northbound callbacksChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16lib: yang defination for basic frr-routingvdhingra
Yang files for basic frr-routing used by other daemons like staticd and pim Co-authored-by: Santosh P K <sapk@vmware.com> Co-authored-by: vishaldhingra <vdhingra@vmware.com> Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2020-04-16*: add frr-vrf yang module in makefileChirag Shah
lib: Adding frr-vrf yang module to common place so it can be accessed from all frr modules. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-14Merge pull request #5510 from opensourcerouting/dplane-fpm-netlinkMark Stapp
zebra: netlink FPM interface using zebra data plane
2020-04-14Merge pull request #5812 from pguibert6WIND/bgp_stats_allDonald Sharp
Bgp stats all
2020-04-14zebra: data plane FPM add support RMAC VNIRafael Zalamena
Store VNI information in the data plane context so we can use it to build the FPM netlink update with that information later. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-14Merge pull request #6221 from opensourcerouting/defaults-fix-version-cmpDonatas Abraitis
lib/defaults: fix version number comparison
2020-04-14lib/defaults: don't use "static" in a weird wayDavid Lamparter
This didn't break anything but it's not really correct either. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-14lib/defaults: more bool confusionDavid Lamparter
Sigh. Initializing a bool to -1 gives 1. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-14Merge pull request #5988 from xThaid/zebra_vrf_logsDavid Lamparter
zebra: Add vrf name and id to debugs
2020-04-13lib: fix SA warning in vrf creation zapi handlerQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-13lib: fix if_set_valueQuentin Young
Something in there is wrong and causing test failures. Moving it back to how it was; we'll stil assert if the message was wrong, just in a different place now. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-13lib: work around enum issue in old gccQuentin Young
I'd like to keep the explicit check here, but since underlying type of enum is implementation defined, theres some inconsistency using -Wall -Werror in older compilers here Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-13lib: re-add accidentally deleted pfx family setQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-13lib: improve sanity check on vrf backend valueQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-13lib: handle failure to change ifindexQuentin Young
This fixes a theoretical bug that could occur when trying to change an ifindex on an interface to that of an existing interface. We would remove the interface from the ifindex tree, and change the ifindex, but when we tried to reinsert the interface, the insert would fail. It was impossible to know if this failed due to the insertion / deletion macros capturing the result value of the underlying BSD tree macros. So we would effectively delete the interface. Instead of failing on insert, we just check if the prospective ifindex already exists and return -1 if it does. Macros have been changed to statement expressions so the result can be checked, and bubbled up. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-13lib: more zclient fixes; str termination, vrfs...Quentin Young
* Don't crash if we get a request to create an existing VRF * Ensure interface & vrf names are null terminated...again Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-13lib: don't crash on iface add for unknown vrfQuentin Young
If Zebra sends us an interface add notification with a garbage VRF we crash on an assert(vrf_get(vrf_id, NULL)); let's not Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-13lib: ensure iface name is null terminatedQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-13lib: handle bogus VRF backend typeQuentin Young
And use an enum... Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-13lib: make all zclient.[ch] stream funcs safeQuentin Young
Use STREAM_GET* variants of stream getters, which all have non-assert error paths. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-13lib: add STREAM_GETQ, STREAM_GETFQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-13lib: remove unnecessary null checksQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-12zebra: Add vrf name and id to debugsJakub Urbańczyk
In some places we log the interface but not the vfr the interface is in. In others we only output the vrf id, which can be difficult for human to read. This commit makes zebra debugs more vrf aware. Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
2020-04-08*: Do not cast to the same typeDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-07lib: support replacement in the nexthop-group cliMark Stapp
Use more limited matching logic so that nexthops within a nexthop-group are unique based only on vrf, type, and gateway. Treat configuration of a nexthop that matches an existing nexthop as a replace operation. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-03lib: consolidate flexible array hack in a single placeRenato Westphal
Old gcc versions (< 5.x) have a bug that prevents C99 flexible arrays from working properly on shared libraries. We already have a hack in place to work around this problem, but it needs to be replicated in every declaration of a frr_yang_module_info variable within libfrr. This clearly isn't a good solution if we consider that many more libfrr YANG modules are about to come in the future. This commit introduces a different workaround that operates within the northbound layer itself, such that implementers of libfrr YANG modules won't need to worry about this problem anymore. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-03lib, tools: silence harmless warnings in the northbound toolsRenato Westphal
Our two northbound tools don't have embedded YANG modules like the other FRR binaries. As such, ly_ctx_set_module_imp_clb() shouldn't be called when the YANG subsystem it being initialized by a northbound tool. To make that possible, add a new "embedded_modules" parameter to the yang_init() function to control whether libyang should look for embedded modules or not. With this fix, "gen_northbound_callbacks" and "gen_yang_deviations" won't emit "YANG model X not embedded, trying external file" warnings anymore. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-03-31Merge pull request #5183 from opensourcerouting/zebra-route-map-nbQuentin Young
yang/zebra: migrate route map to northbound
2020-03-31Merge pull request #6093 from LabNConsulting/working/lb/no-birdsDavid Lamparter
*: use the current project name (FRRouting)
2020-03-31lib: add json api to encode double valuesPhilippe Guibert
this api can be used to encode double values. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-03-30lib: defer grpc plugin initialization to post forkQuentin Young
When using the GRPC northbound plugin, initialization occurs at the frr_late_init hook. This is called before fork() when daemonizing (using -d). Because the GRPC library internally creates threads, this means our threads go away in the child process, so GRPC doesn't work when used with -d. Rectify this situation by deferring plugin init to after fork by scheduling a task on the threadmaster, since those are executed by the child. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-03-30Merge pull request #5901 from mjstapp/backup_nh_prepStephen Worley
zebra, lib: Backup nexthop (path) prep work
2020-03-29tests: use printfrr-based printf()David Lamparter
Just a small hack to use printfrr() in tests, since otherwise the redefined PRId64 trips some warnings. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-29*: fix format string warningsDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-29lib: prepare for plugin-based frr_format checkDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-29Merge pull request #6101 from sarav511/vty_crashDavid Lamparter
vtysh: Crash during show running-config