summaryrefslogtreecommitdiff
path: root/lib/zclient.h
AgeCommit message (Collapse)Author
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-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-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-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-10-15lib, zebra: Fix last write command writtenDonald Sharp
With commit: a9ff90c41b0a95195d19d451ee83eb460e1599d0 the vrf_id_t was changed from a uint16_t to a uint32_t Zebra tracked the last command sent to it's peer via peeking into the data it was sending to each client ( since we had lost the idea of what the command was when it was time to track the data ). Add a define to track this and add a bit of verbiage to the code to allow us to notice when we screw with the header again so that this is just fixed correctly when it happens again. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-14Revert "Merge pull request #4885 from satheeshkarra/pim_mlag"Quentin Young
This reverts commit d563896dada99f3474d428f928786cbfde936fee, reversing changes made to 09ea1a40386f02a13cdb0462cc55af0d03f0c277.
2019-10-14Merge pull request #4885 from satheeshkarra/pim_mlagJafar Al-Gharaibeh
pimd, lib, Zebra: PIM MLAG Support
2019-09-24pimd, 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-09-19lib: delete interface if you can in upper level protocolDonald Sharp
In an upper level protocol, delete the interface on notification about deletion. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Convert zapi->interface_delete to ifp callbackDonald Sharp
Convert the callback of the interface_delete to the new ifp callback. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Convert interface_down to interface down callbackDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Convert from ->interface_up to the interface callbackDonald Sharp
For all the places we have a zclient->interface_up convert them to use the interface ifp_up callback instead. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Switch all zclient->interface_add to interface create callbackDonald Sharp
Switch the zclient->interface_add functionality to have everyone use the interface create callback in lib/if.c Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-16pimd : 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-09-10lib, zebra: add new MPLS zapi message with route replace semanticsRenato Westphal
This new message makes it possible to install/reinstall LSPs with multiple nexthops using a single ZAPI message. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-09-06lib, zebra: enhance the MPLS zapi messagesRenato Westphal
* Add ability to specify the nexthop type; * Add ability to install or not a FTN (in addition to an LSP). These two additions will be useful to install local SR Prefix-SIDs configured with the no-PHP option. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-09-06zebra: identify MPLS FTNs by route type and instanceRenato Westphal
Use the route type and instance instead of the route distance to identify MPLS FTNs. This is a more robust approach since the routing daemons can modify the distance of their announced routes via configuration, which can cause inconsistencies. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-09-06lib: introduce encode/decode functions for the MPLS zapi messagesRenato Westphal
Do this for the following reasons: * Improve modularity of the code by separating the decoding of the ZAPI messages from their processing; * Create an API that is easier to use by the client daemons. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-07-15Merge pull request #4635 from AnuradhaKaruppiah/evpn-pim-replayJafar Al-Gharaibeh
pimd, zebra: request for replay of VxLAN SG entries on pimd startup
2019-07-10lib, zebra: support label chunk requests for SRGBEmanuele Di Pascale
For SRGB, we need to support chunk requests starting at a specific point in the label space, rather than just asking for any sufficiently large chunk. To this purpose, we extend the label manager api to request a chunk with a base value; if the base is set to 0, the label manager will behave as it currently does, i.e. fetching the first free chunk big enough to satisfy the request. update all the existing calls to get chunks from the label manager so that they use MPLS_LABEL_BASE_ANY as the base for the requested chunk Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-07-03pimd, zebra: request for replay of SG entries on startupAnuradha Karuppiah
zvni setup in zebra is controlled via bgpd i.e. advertise_all_vni from bgpd triggers this setup. As a part of zvni creation we may need to setup BUM mcast SG entries which are propagated to pimd for MDT setup. Now pimd may not be present at the time of zvni creation or may restart post zvni creation so we need a mechanism to replay (on pimd startup) and to cleanup (on pimd stop). This is addressed via zebra_vxlan_sg_replay and zebra_evpn_pim_cfg_clean_up. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-06-02lib: Move zebra_size_t to zclient.h who should own itDonald Sharp
The zebra_size_t type needs to be owned by zclient.h since it is part of the zapi protocol. Move it to where the structure belongs. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-02lib: Move ZEBRA_HEADER_MARKER to header it belongs inDonald Sharp
The ZEBRA_HEADER_MARKER is part of the zapi protocol Move it to the zclient.h header. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-02lib: Move zclient flags to zclient.hDonald Sharp
zebra.h had some defined flags that were being used as part of the route encode/decode functionality. These belong in the zclient.h code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-31lib, zebra: Ensure route encoding has enough spaceDonald Sharp
When you have compiled FRR with a large multipath number then encoding large ecmp routes between zebra and the routing daemons. There exists a theoritical size of multipath that will cause the encoding to be larger than the ZEBRA_MAX_PACKET_SIZ. In the cases where we have allocated streams that will encode routes then let's ensure that whatever size we have will auto-fit what we say we can send. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-17vrrpd: protodown macvlan in backup stateQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-03*: use ZAPI_CALLBACK_ARGS macro for zapi handlersQuentin Young
This macro: - Marks ZAPI callbacks for readability - Standardizes argument names - Makes it simple to add ZAPI arguments in the future - Ensures proper types - Looks better - Shortens function declarations Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-03lib: define ZAPI_CALLBACK_ARGS macroQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-04-20lib, zebra: changes to propagate vxlan mcast SG entries to pimdAnuradha Karuppiah
These updates act as triggers to pimd to - 1. join the MDT for rxing VxLAN encapsulated BUM traffic 2. register the local-vtep-ip as a source for the MDT Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-02-06lib: advertise svi ip as macip opcodeChirag Shah
This change is used to send configue changes for advertise svi address as macip (type-2) route. Ticket:CM-23782 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-01-26*: The onlink attribute should be owned by the nexthop not the route.Donald Sharp
The onlink attribute was being passed from upper level protocols as an attribute of the route *not* the individual nexthop. When we pass this data to the kernel, we treat the onlink as a attribute of the nexthop. This commit modifies the code base to allow us to pass the ONLINK attribute as an attribute of the nexthop. This commit also fixes static routes that have multiple nexthops some onlink and some not. ip route 4.5.6.7/32 192.168.41.1 eveth1 onlink ip route 4.5.6.7/32 192.168.42.2 S>* 4.5.6.7/32 [1/0] via 192.168.41.1, eveth1 onlink, 00:03:04 * via 192.168.42.2, eveth2, 00:03:04 sharpd@robot ~/frr2> sudo ip netns exec EVA ip route show 4.5.6.7 proto 196 metric 20 nexthop via 192.168.41.1 dev eveth1 weight 1 onlink nexthop via 192.168.42.2 dev eveth2 weight 1 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-25zebra: propagate inactive neigh deletes to bgpdAnuradha Karuppiah
When a local neigh is added with a MAC that is remote or absent the neigh is kept in zebra as local/in-active. But not propagated to bgpd. Similarly when an inactive neigh is deleted the del-msg is not propagated to bgpd. Without this change bgp and zebra would fall out of sync as that bgp would not know to rerun bestpath and for it to reinstall a known remote path for the mac-ip in question. To fix this we now propagate inactive neigh deletes to bgpd. Ticket: CM-23018 Testing Done: 1. evpn-min 2. manually triggered the out-of-sync state and verified the fix Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-01-18lib: use the correct VRF ID when parsing INTERFACE_LINK_PARAMS messagesRenato Westphal
Bug found during code inspection. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-01-14lib, zebra: add AFI parameter to the ZEBRA_REDISTRIBUTE_DEFAULT_* messagesRenato Westphal
Some daemons like ospfd and isisd have the ability to advertise a default route to their peers only if one exists in the RIB. This is what the "default-information originate" commands do when used without the "always" parameter. For that to work, these daemons use the ZEBRA_REDISTRIBUTE_DEFAULT_ADD message to request default route information to zebra. The problem is that this message didn't have an AFI parameter, so a default route from any address-family would satisfy the requests from both daemons (e.g. ::/0 would trigger ospfd to advertise a default route to its peers, and 0.0.0.0/0 would trigger isisd to advertise a default route to its IPv6 peers). Fix this by adding an AFI parameter to the ZEBRA_REDISTRIBUTE_DEFAULT_{ADD,DELETE} messages and making the corresponding code changes. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-01-04lib, zebra: On startup send mlag role as part of the capabilitiesDonald Sharp
On startup send the mlag role as part of the capabilities to the end protocol. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-20bgpd, zebra: auto assign labels from label pool to regular prefixes in BGP ↵Anton Degtyarev
labeled unicast This commit is the last missing piece to complete BGP LU support in bgpd. To this moment, bgpd (and zebra) supported auto label assignment only for prefixes leaked from VRFs to vpn and for MPLS SR prefixes. This adds auto label assignment to other routes types in bgpd. The following enhancements have been made: * bgp_route.c:bgp_process_main_one() now sets implicit-null local_label to all local, aggregate and redistributed routes. * bgp_route.c:bgp_process_main_one() now will request a label from the label pool for any prefix that loses the label for some reason (for example, when the static label assignment config is removed) * bgp_label.c:bgp_reg_dereg_for_label() now requests labels from label pool for routes which have no associated label index * zebra_mpls.c:zebra_mpls_fec_register() now expects both label and label_index from the calling function, one of which must be set to MPLS_INVALID_LABEL or MPLS_INVALID_LABEL_INDEX, based on this it will decide how to register the provided FEC. Signed-off-by: Anton Degtyarev <anton@cumulusnetworks.com>
2018-11-17zebra: dup addr detect zapi changesChirag Shah
EVPN Duplicate Address Detection (DAD) zapi information Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17bgpd: dup addr detect config cliChirag Shah
Duplicate address detection configuration clis under bgp l2vpn evpn config mode. - Enabled/Disable (global knob) for feature. - Configure cli for duplicate detection action freeze and freze until time (auto-recovery). Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-12*: Replace zclient_new with zclient_new_notifyDonald Sharp
It's been a year since we added the new optional parameters to instantiation. Let's switch over to the new name. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-11lib, zebra: Allow the specification of BUM floodingDonald Sharp
Allow the modification of whether or not we will allow BUM flooding on the vxlan bridge. To do this allow the upper level protocol to specify via the ZEBRA_VXLAN_FLOOD_CONTROL zapi message. If flooding is disabled then BUM traffic will not be forwarded to other VTEP's. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-18bgpd, doc, ldpd, lib, tests, zebra: LM fixespaco
Corrections so that the BGP daemon can work with the label manager properly through a label-manager proxy. Details: - Correction so the BGP daemon behind a proxy label manager gets the range correctly (-I added to the BGP daemon, to set the daemon instance id) - For the BGP case, added an asynchronous label manager connect command so the labels get recycled in case of a BGP daemon reconnection. With this, BGPd and LDPd would behave similarly. Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-04lib: Remove dead codeDonald Sharp
The ZEBRA_IPV4_ROUTE_IPV6_NEXTHOP_ADD zapi message has no creators and no handlers. Let's just remove. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-24doc, lib, zebra: Remove deprecated encode and decode functionalityDonald Sharp
The ZEBRA_IPV4_ROUTE_[ADD|DELETE] and ZEBRA_IPV6_ROUTE_[ADD|DELETE] functionality has been deprecated for a year now, let's remove this code from the system. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-08bfdd: re-route PTM-BFD daemon messagesRafael Zalamena
When `bfdd` is enabled - which it is by default - re-route the PTM-BFD messages to the FRR's internal BFD daemon instead of the external PTM daemon. This will help the migration of BFD implementations and avoid duplicating code. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-07-24Merge pull request #2665 from chiragshah6/evpn_devRuss White
bgpd: support evpn nd ext community
2018-07-17bgpd: support evpn nd ext communityChirag Shah
EVPN ND ext community support NA flag R-bit, to have proxy ND. Set R-bit in EVPN NA if a given router is default gateway or there is a local router attached, which can be determine based on local neighbor entry. Implement BGP ext community attribute to generate and parse R-bit and pass along zebra to program neigh entry in kernel. Upon receiving MAC/IP update with community type 0x06 and sub_type 0x08, pass the R-bit to zebra to program neigh entry. Set NTF_ROUTER in neigh entry and inform kernel to do proxy NA for EVPN. Ref: https://tools.ietf.org/html/draft-ietf-bess-evpn-na-flags-01 Ticket:CM-21712, CM-21711 Reviewed By: Testing Done: Configure Local vni enabled L3 Gateway, which would act as router, checked show evpn arp-cache vni x ip <ip of svi> on originated and remote VTEPs. "Router" flag is set. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-07-10lib: remove VERSION_TYPE_DEV from CONFDATE checksLou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2018-05-30bgpd, lib: Cleanup CI warnings from systemDonald Sharp
Make the CI system happy. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-30*: support for evpn type-4 routemitesh
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>