summaryrefslogtreecommitdiff
path: root/lib/zclient.h
AgeCommit message (Collapse)Author
2018-05-25zebra: add pbr objects fail_remove value into notificationPhilippe Guibert
After PBR or BGP sends back a request for sending a rule/ipset/ipset entry/iptable delete, there may be issue in deleting it. A notification is sent back with a new value indicating that the removal failed. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-12Merge pull request #2124 from donaldsharp/missedRuss White
bgpd, zebra: Handle EVPN router MAC per next hop
2018-04-30bgpd: handle configuration of iptables with zebraPhilippe Guibert
The API for filling in an IPTABLE_ADD and IPTABLE_DELETE message. Also, the API is handling the notification callback, so as to know if zebra managed to add or delete the relevant iptable entry. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-26bgpd, zebra: Handle EVPN router MAC per next hopvivek
Ensure that when EVPN routes are installed into zebra, the router MAC is passed per next hop and appropriately handled. This is required for proper multipath operation. Ticket: CM-18999 Reviewed By: Testing Done: Verified failed scenario, other manual tests Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2018-04-18zebra: Add pass up through zapi what zebra is capable of handlingDonald Sharp
Zebra is starting to have some run-time capabilites that would be useful to pass up to the higher level protocols so that they can act in an appropriate manner when needed. Send the ecmp value zebra is being run with and whether or not we believe mpls is enabled in the kernel or not. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-16lib: enhance pbr_rule structure for zapi encode and for common usagePhilippe Guibert
The pbr_rule structure is derived from zebra_pbr_rule, and is defined, so that a zclient will be able to encode the zebra_pbr_rule to send ADD_RULE or DEL_RULE command. Also, the same structure can be used by other daemons to derive a structure ( this will be the case for zebra_pbr_rule). Adding to this, an encoding function is defined, and will be used by remote daemon to encode that message. Those definitions are moved in new file pbr.h file. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-16zebra: add IPTABLE_ADD and IPTABLE_DEL commands in zapiPhilippe Guibert
Those messages permit a remote daemon to configure an iptable entry. A structure is defined that maps to an iptable entry. More specifically, this structure proposes to associate fwmark, and a table ID. Adding to the configuration, the initialisation of iptables hash list is done into zebra netnamespace. Also a hook for notifying the sender that the iptables has been correctly set is done. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-16zebra: handling notifications upon ipset creation/destruction donePhilippe Guibert
Once ipset entries are injected in the kernel, the relevant daemon is informed with a zebra message sent back. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-16lib: add ZEBRA IPSET definesPhilippe Guibert
ZEBRA IPSET defines are added for creating/deleting ipset contexts. Ans also create ipset hash sets. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-16zebra: handle entry pointfs for ipset creation/destructionPhilippe Guibert
IPset and IPset entries structures are introduced. Those entries reflect the ipset structures and ipset hash sets that will be created on the kernel. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-11bgpd: dynamic mpls label poolG. Paul Ziemba
MPLS label pool backed by allocations from the zebra label manager. A caller requests a label (e.g., in support of an "auto" label specification in the CLI) via lp_get(), supplying a unique ID and a callback function. The callback function is invoked at a later time with the unique ID and a label value to inform the requestor of the assigned label. Requestors may release their labels back to the pool via lp_release(). The label pool is stocked with labels allocated by the zebra label manager. The interaction with zebra is asynchronous so that bgpd is not blocked while awaiting a label allocation from zebra. The label pool implementation allows for bgpd operation before (or without) zebra, and gracefully handles loss and reconnection of zebra. Of course, before initial connection with zebra, no labels are assigned to requestors. If the zebra connection is lost and regained, callbacks to requestors will invalidate old assignments and then assign new labels. Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-04-03*: Only test CONFDATE when VERSION_TYPE_DEV definedLou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-29lib: add framework for allocating routing table identifier IDsPhilippe Guibert
The library changes add 3 new messages to exchange between daemons and ZEBRA. - ZEBRA_TABLE_MANAGER_CONNECT, - ZEBRA_GET_TABLE_CHUNK, - ZEBRA_RELEASE_TABLE_CHUNK, the need is that routing tables identifier are shared by various services. For the current case, policy routing enhancements are planned to be used in FRR. Poliy routing relies on routing tables identifiers from kernels. It will be mainly used by the future policy based routing daemon, but not only. In the flowspec case, the BGP will need also to inject policy routing information into specific routing tables. For that, the proposal is made to let zebra give the appropriate range that is needed for all daemons. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-12lib, zebra: slight cleanup after rebaseQuentin Young
Rebased zapi-cleanup, needs a bit of poking. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-12lib: zclient.h style fixesQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-12lib, zebra: use existing zapi header structQuentin Young
Nobody uses it, but it's got the same definition. Move the parser function into zclient.c and use it. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-09lib, zebra: Add Rule insertion success/failure messagesDonald Sharp
Add code to allow rule insertion notifications to be sent back up the stack. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-09lib, zebra: Add rule encodingDonald Sharp
Add some code to pass the rule we want installed into the kernel. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-09lib, zebra: Allow zapi to send down the tableidDonald Sharp
Allow the calling daemon to pass down what table-id we want to use to install the route. Useful for PBR. The vrf id passed must be the VRF_DEFAULT else this value is ignored. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-08*: Add code to notify on route removal statusDonald Sharp
If a interested party removes one of it's routes let it know that it has happened as asked for. Add a ZAPI_ROUTE_REMOVED to the send of the route_notify_owner Add a ZAPI_ROUTE_REMOVE_FAIL to the send of the route_notify_owner Add code in sharpd to notice this and to allow it to keep track of routes removed for that invocation and give timing results. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-07lib: Increase zapi buffer sizeDonald Sharp
The buffer size is currently 4k. Increase x4 times to allow for bigger messages to be sent over the zapi. The current size sufficient for most cases, but there are a couple of cases with installing data to the kernel ip rules where we will quickly hit this 4k size limit. I forsee flowspec getting close to this limit as well. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2018-02-23*: Modify notify_owner to route_notify_ownerDonald Sharp
In the future we are going to have a rule_notify_owner so make the distinction between the two types of notification clearer. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-23*: Add tableid the route entry was sent toDonald Sharp
Add for the southbound pass back the route entries tableid used for installation. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-14lib, sharpd, zebra: Update the zapi_vrf_label call to add afiDonald Sharp
Add the ability to pass in an afi to zebra. zebra_vrf keeps track of the afi/label tuple and then does the right thing before we call down. AF_MPLS does not care about v4 or v6 it just knows label and what device to use for lookup. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-08bgpd, lib, sharpd, zebra: Use MPLS_LABEL_NONEDonald Sharp
Modify mpls.h to rename MPLS_LABEL_ILLEGAL to be MPLS_LABEL_NONE. Fix all pre-existing code that used MPLS_LABEL_ILLEGAL. Modify the zapi vrf label message to use MPLS_LABEL_NONE as the signal to remove label associated with a vrf. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-08lib, sharpd, zebra: Add new enum for lsp type and pass it through.Donald Sharp
Add the ability to pass the lsp owner type through the zapi and in addition add a new label type for the sharp protocol for testing. Finally modify zebra_mpls.h to not have defaults specified for the enum. That way when we add a new LSP type the compile fails and the person doing the addition knows where he has to touch shit. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-08*: Make code use a consisten definition of labelsDonald Sharp
Turns out we had 3 different ways to define labels all of them overlapping with the same meanings. Consolidate to 1. This one choosen is consistent naming wise with what the *bsd and linux kernels use. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-08lib, zebra: Add new api to specify a label associated with the vrfDonald Sharp
For L3VPN's we need to create a label associated with the specified vrf to be installed into the kernel to allow a pop and lookup operation. The new api is: zclient_send_vrf_label(struct zclient *zclient, vrf_id_t vrf_id, mpls_label_t label); For the specified vrf_id associate the specified label for a pop and lookup operation for forwarding. To setup a POP and Forward use MPLS_LABEL_IMPLICIT_NULL If the same label is passed in we ignore the call. If the label is different we update entry. If the label is MPLS_LABEL_NONE we remove the entry. This sets up the api. Future commits will have the functionality to actually install into the kernel. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-08*: Track vrfs per nexthop not per route entryDonald Sharp
Track the vfrs on a per nexthop basis instead of on a per route entry basis. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-08Merge pull request #1654 from mkanjari/evpn-symm-routing-enhancementsPhilippe Guibert
Evpn symmetric routing enhancements
2018-02-05bgpd, lib, pimd: Make nexthop_update decoding commonDonald Sharp
Create a zapi_nexthop_update_decode function that both pim and bgp use to decode the message from zebra. There probably could be further optimizations but I opted to keep the code as similiar as is possible between the originals because they both make some assumptions about code flow that I do not fully understand yet. The real goal here is that I want to create a new user of the nexthop tracking code from a higher level daemon and I see no need to re-implement this damn code again for a 3rd time. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-23Merge pull request #1665 from donaldsharp/nexthop_labelsRuss White
Cleanup some zclient code
2018-01-23bgpd: advertise VNI subnetMitesh Kanjariya
In EVPN symmetric routing, not all subnets are presents everywhere. We have multiple scenarios where a host might not get learned locally. 1. GARP miss 2. SVI down/up 3. Silent host We need a mechanism to resolve such hosts. In order to achieve this, we will be advertising a subnet route from a box and that box will help in resolving the ARP to such hosts. Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23bgpd/zebra/lib: Add Default Gateway extended communityMitesh Kanjariya
1. Added default gw extended community 2. code modification to handle sticky-mac/default-gw-mac as they go together 3. show command support for newly added extended community 4. State in zebra to reflect if a mac/neigh is default gateway 5. show command enhancement to refelect the same in zebra commands Ticket: CM-17428 Review: CCR-6580 Testing: Manual Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23Merge pull request #1618 from donaldsharp/zebra_startup_orderingPhilippe Guibert
zebra route-leaking for static routes
2018-01-22bgpd, lib, pimd: Abstract commands for nexthop trackingDonald Sharp
Abstract the code that sends the zapi message into zebra for the turn on/off of nexthop tracking for a prefix. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-22lib: increase vrf_id from 16 bit to 32 bit identifierPhilippe Guibert
This is a preparatory work for configuring vrf/frr over netns vrf structure is being changed to 32 bit, and the VRF will have the possibility to have a backend made up of NETNS. Let's put some history. Initially the 32 bit was because one wanted to map on vrf_id both the VRFLITE and the NSID. Initially, one would have liked to make zebra configure at the same time both vrf lite and vrf from netns in a flat way. From the show running perspective, one would have had both kind of vrfs, thatone would configure on the same way. however, it leads to inconsistencies in concepts, because it mixes vrf vrf with vrf, and vrf is not always mapped with netns. For instance, logical-router could also be used with netns. In that case, it would not be possible to map vrf with netns. There was an other reason why 32 bit is proposed. this is because some systems handle NSID to 32 bits. As vrf lite exists only on Linux, there are other systems that would like to use an other vrf backend than vrf lite. The netns backend for vrf will be used for that too. for instance, for windows or freebsd, some similar netns concept exists; so it will be easier to reuse netns backend for vrf, than reusing vrflite backend for vrf. This commit is here to extend vrf_id to 32 bits. Following commits in a second step will help in enable a VRF backend. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-01-12lib: Increment zapi version numberDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12*: Send/receive the nexthop vrf_idDonald Sharp
Modify the code to send and receive to/from zebra the nexthops vrf_id. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12lib: Add notice of when we can remove some deprecated code.Donald Sharp
The zapi_ipv4_route, zapi_ipv6_route and zapi_ipv4_route_ipv6_nexthop functions are deprecated. Add notice of when we can remove the deprecated code from the system. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-14bgpd: program nh/rmac entriesmitesh
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14zebra, lib: zebra changes for symmetric routing supportMitesh Kanjariya
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-11-27*: Make zapi route install Notifications optionalDonald Sharp
Allow the higher level protocol to specify if it would like to receive notifications about it's routes that it has installed. I've purposely made it part of zclient_new_notify because we need to track the routes on a per daemon basis only. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-27lib, zebra: Add ability to notify to Routing Protocols Success/FailureDonald Sharp
Provide ZAPI code that can pass to an upper level protocol what happened to it's route on install. There are these notifications: 1) ZAPI_ROUTE_FAIL_INSTALL - The route attempted to be installed did not work. 2) ZAPI_ROUTE_BETTER_ADMIN_WON - A route that was installed has become un-installed due to another routing protocol installing a better admin distance 3) ZAPI_ROUTE_INSTALLED - The route specified has been installed Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-13lib: Pass the safi as a uint8_tDonald Sharp
The safi encode/decode is using 2 bytes, which may cause problems on some platforms. Let's assume that a safi is a uint8_t and work accordingly. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23*: Modify zclient_init to require privs dataDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-30*: fix styleQuentin Young
Fixes style nits introduced by recent pull requests. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-28*: remove ZEBRA_FLAG_{BLACKHOLE,REJECT} from APIDavid Lamparter
FLAG_BLACKHOLE is used for different things in different places. remove it from the zclient API, instead indicate blackholes as proper nexthops inside the message. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>