summaryrefslogtreecommitdiffstats
path: root/zebra/zserv.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* zebra: link layer config and notification, implementation in zebraPhilippe Guibert2021-04-091-0/+3
| | | | | | | | | | | | | zebra implements zebra api for configuring link layer information. that can be an arp entry (for ipv4) or ipv6 neighbor discovery entry. This can also be an ipv4/ipv6 entry associated to an underlay ipv4 address, as it is used in gre point to multipoint interfaces. this api will also be used as monitoring. an hash list is instantiated into zebra (this is the vrf bitmap). each client interested in those entries in a specific vrf, will listen for following messages: entries added, removed, or who-has messages. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* zebra: remove fuzzing stuffJakub Urbańczyk2020-08-251-4/+0
| | | | | | | | | The fuzzing code that is in the master branch is outdated and unused, so it is worth to remove it to improve readablity of the code. All the code related to the fuzzing is in the `fuzz` branch. Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
* Merge pull request #6483 from sylane/router-id-v6Donald Sharp2020-08-101-1/+1
|\ | | | | zebra: add IPv6 router-id
| * zebra: add IPv6 router-idSebastien Merle2020-07-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add a vrf sub-command `[no] ipv6 router-id X:X::X:X`. * add command `[no] ipv6 router-id X:X::X:X [vrf NAME]` for backward compatibility. * add a vrf sub-command `[no] ip router-id A.B.C.D` and make the old one without `ip` an alias for it. * add a command `[no] ip router-id A.B.C.D [vrf NAME]` for backward comptibility and make the old one without `ip` an alias for it. * add command `show ip router-id [vrf NAME]` and make the old one without `ip` an alias for it. * add command `show ipv6 router-id [vrf NAME]`. * add ZAPI commands `ZEBRA_ROUTER_ID_V6_ADD`, `ZEBRA_ROUTER_ID_V6_DELETE` and `ZEBRA_ROUTER_ID_V6_UPDATE` for deamons to get notified of the IPv6 router-id. * update zebra documentation. Signed-off-by: Sebastien Merle <sebastien@netdef.org>
* | zebra: Ethernet segment management and support for MAC-ECMPAnuradha Karuppiah2020-08-051-0/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Local ethernet segments are configured in zebra by attaching a local-es-id and sys-mac to a access interface - >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ! interface hostbond1 evpn mh es-id 1 evpn mh es-sys-mac 00:00:00:00:01:11 ! >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> This info is then sent to BGP and used for the generation of EAD-per-ES routes. 2. Access VLANs associated with an (ES) access port are translated into ES-EVI objects and sent to BGP. This is used by BGP for the generation of EAD-EVI routes. 3. Remote ESs are imported by BGP and sent to zebra. A list of VTEPs is maintained per-remote ES in zebra. This list is used for the creation of the L2-NHG that is used for forwarding traffic. 4. MAC entries with a non-zero ESI destination use the L2-NHG associated with the ESI for forwarding traffic over the VxLAN overlay. Please see zebra_evpn_mh.h for the datastruct organization details. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
* zebra: add zserv_send_batch apiMark Stapp2020-06-021-0/+11
| | | | | | | Add a zserv api to send a batch (a fifo) of messages to a zapi client. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: add lock and busy counter for zclientsMark Stapp2020-06-021-1/+30
| | | | | | | | Add a mutex used to manage the list of zclients. Add a busy counter to the zapi client session, so that we can use a client session from another pthread. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: avoid using c++ keywords in headersEmanuele Di Pascale2020-05-141-1/+1
| | | | | | | to make sure that c++ code can include them, avoid using reserved keywords like 'delete' or 'new'. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* lib,zebra: add a session id for zapi sessionsMark Stapp2020-04-161-1/+20
| | | | | | | | | | 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>
* Merge pull request #5925 from volta-networks/synchronous_clientRenato Westphal2020-03-261-0/+3
|\ | | | | zebra: synchronous client queues accumulate messages from zebra
| * zebra: Synchronous client queues accumulate messages from zebra.Karen Schoener2020-03-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zebra is currently sending messages on interface add/delete/update, VRF add/delete, and interface address change - regardless of whether its clients had requested them. This is problematic for lde and isis, which only listens to label chunk messages, and only when it is waiting for one (synchronous client). The effect is the that messages accumulate on the lde synchronous message queue. With this change: - Zebra does not send unsolicited messages to synchronous clients. - Synchronous clients send a ZEBRA_HELLO to zebra. The ZEBRA_HELLO contains a new boolean field: sychronous. - LDP and PIM have been updated to send a ZEBRA_HELLO for their synchronous clients. Signed-off-by: Karen Schoener <karen@voltanet.io>
* | treewide: add attribute to functions that do not returnRuben Kerkhof2020-03-191-1/+1
|/ | | | Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
* Zebra: Zebra gr dynamic client handling.Santosh P K2020-02-211-0/+4
| | | | | | | | | | | When a client connects to zebra with GR capabilities and then restarts, it might disconnect again even before hello is sent leading zebra cores. GR should be supported only for dynamic neighbor who are capable of restarting. Signed-off-by: Santosh P K <sapk@vmware.com>
* zebra: Capabality and stale route handling for GR client.Santosh P K2020-01-311-0/+4
| | | | | | | | | Handling capability received from client. It may contain GR enable/disable, Stale time changes, RIB update complete for given AFi, ASAFI and instance. It also has changes for stale route handling. Signed-off-by: Santosh P K <sapk@vmware.com>
* zebra: Handling of connection disconnect and connect with GR.Santosh P K2020-01-301-0/+6
| | | | | | | | | | | Zebra will have special handling for clients with GR enabled. When client disconnects with GR enabled, then a stale client will be created and its RIB will be retained till stale timer or client comes up and updated its RIB. Co-authored-by: Santosh P K <sapk@vmware.com> Co-authored-by: Soman K S <somanks@vmware.com> Signed-off-by: Santosh P K <sapk@vmware.com>
* zebra: Header file changes and show commands.Santosh P K2020-01-301-2/+49
| | | | | | | | | | | Adding header files changes where structure to hold received graceful restart info from client is defined. Also there are changes for show commands where exisiting commands are extended. Co-authored-by: Santosh P K <sapk@vmware.com> Co-authored-by: Soman K S <somanks@vmware.com> Signed-off-by: Santosh P K <sapk@vmware.com>
* lib,zebra: add zapi msg top level error handlingStephen Worley2020-01-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add error handling for top level failures (not able to execute command, unable to find vrf for command, etc.) With this error handling we add a new zapi message type of ZEBRA_ERROR used when we are unable to properly handle a zapi command and pass it down into the lower level code. In the event of this, we reply with a message of type enum zebra_error_types containing the error type. The sent packet will look like so: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Length | Marker | Version | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | VRF ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Command | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ERROR TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Also add appropriate hooks for clients to subscribe to for handling these types of errors. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
* Zebra: adding support for Zebra MLAG FunctionalitySatheesh Kumar K2019-11-141-0/+7
| | | | | | | | | | | | | This includes: 1. Processing client Registrations for MLAG 2. storing client Interests for MLAG updates 3. Opening communication channel to MLAG with First client reg 4. Closing Communication channel with last client De-reg 5. Spawning a new thread for handling MLAG updates peocessing 6. adding Test code 7. advertising MLAG Updates to clients based on their interests Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
* Revert "Merge pull request #4885 from satheeshkarra/pim_mlag"Quentin Young2019-10-141-7/+0
| | | | | This reverts commit d563896dada99f3474d428f928786cbfde936fee, reversing changes made to 09ea1a40386f02a13cdb0462cc55af0d03f0c277.
* Zebra: adding support for Zebra MLAG FunctionalitySatheesh Kumar K2019-09-241-0/+7
| | | | | | | | | | | | | This includes: 1. Processing client Registrations for MLAG 2. storing client Interests for MLAG updates 3. Opening communication channel to MLAG with First client reg 4. Closing Communication channel with last client De-reg 5. Spawning a new thread for handling MLAG updates peocessing 6. adding Test code 7. advertising MLAG Updates to clients based on their interests Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
* zebra: label manager refactorEmanuele Di Pascale2019-07-101-1/+0
| | | | | | | | | | | | | | | | | | in order to both streamline the code and allow users to define their own specialized versions of the LM api handlers, define hooks for the 4 main primitives offered by the label manager (i.e. connect, disconnect, get_chunk and release_chunk), and have the existing code be run in response to a hook_call. Additionally, have the responses to the requesting daemon be callable from an external API. Note that the proxy version of the label manager was a source of issues and hardly used in practice. With the new hooks, users with more complex requirements can simply plug in their own code to handle label distribution remotely, so there is no longer a reason to maintain this code. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* zebra: Move multipath_num into zrouterDonald Sharp2019-05-141-2/+0
| | | | | | | The multipath_num variable is a property of zebra_router, so move it there. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* doc, zebra: Remove "table X" commandDonald Sharp2019-05-061-3/+0
| | | | | | | | | This command is broken and has been broken since the introduction of vrf's. Since no-one has complained it is safe to assume that there is no call for this specialized linux command. Remove from the system with extreme prejudice. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: fix zapi msg debugging dumpsQuentin Young2019-05-031-0/+16
| | | | | | | | | | When we switched to a pthread per client, we lost the ability to correlate zapi message debugs with their handlers in zlog, because the message was logged when it was read off the zapi socket and not right before it was processed. Move the zapi msg hexdump to happen right before we call the message handler. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib, zebra: changes to propagate vxlan mcast SG entries to pimdAnuradha Karuppiah2019-04-201-0/+2
| | | | | | | | 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>
* zebra: When shutting down actually close the socketDonald Sharp2019-03-271-0/+7
| | | | | | | | When shutting down and we have a very large table to shutdown and after we've intentionally closed all the client connections close the zebra zserv client socket. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* add cplusplus guards to all zebra headersEmanuele Di Pascale2019-03-251-0/+8
| | | | Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* zebra: Remove zclient->idinfo restrictionsDonald Sharp2019-02-051-3/+0
| | | | | | | | | | | | | | | | | | | | | The restricting of data about interfaces was both inconsistent in application and allowed protocol developers to get into states where they did not have the expected data about an interface that they thought that they would. These restrictions and inconsistencies keep causing bugs that have to be sorted through. The latest iteration of this bug was that commit: f20b478ef3d25e153939516a473bb2e80603cbd5 Has caused pim to not receive interface up notifications( but it knows the interface is back in the vrf and it knows the relevant ip addresses on the interface as they were changed as part of an ifdown/ifup cycle ). Remove this restriction and allow the interface events to be propagated to all clients. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Remove `struct zebra_t`Donald Sharp2019-01-311-4/+0
| | | | | | This structure is unused anymore and does not belong in zserv.h Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Move packets_to_process to zrouterDonald Sharp2019-01-311-2/+0
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Move lsp_process_q to zrouterDonald Sharp2019-01-311-3/+0
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Move the mq data structure to zrouterDonald Sharp2019-01-311-2/+0
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Move ribq from zebrad to zrouterDonald Sharp2019-01-311-4/+0
| | | | | | | The zrouter should own this data structure and it should not be defined in zserv.h Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Move rtm_table_default to zrouterDonald Sharp2019-01-311-3/+0
| | | | | | The zrouter should own this particular piece of data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Make zebrad.sock zserv.c private dataDonald Sharp2019-01-311-3/+0
| | | | | | | The zebra.sock data is the listener socket for the zapi protocol. The rest of the zebra router does not need to see this data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Move client_list to the zebra_router data structureDonald Sharp2019-01-311-2/+0
| | | | | | | The client_list should be owned by the zebra_router data structure as that it is part of global state information. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Move the master thread handler to the zrouter structureDonald Sharp2019-01-311-2/+0
| | | | | | | | The master thread handler is really part of the zrouter structure. So let's move it over to that. Eventually zserv.h will only be used for zapi messages. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib, zebra: add AFI parameter to the ZEBRA_REDISTRIBUTE_DEFAULT_* messagesRenato Westphal2019-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | 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>
* zebra: reduce rib workqueue retry timeoutMark Stapp2018-12-191-1/+1
| | | | | | | | Reduce the zebra rib workqueue retry timeout, used when the queue towards the zebra dataplane has reached its limit. Lowering the value was reported to improve update throughput on some platforms. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* Merge pull request #3463 from mjstapp/zserv_eventDonald Sharp2018-12-141-0/+3
|\ | | | | zebra: make incoming zserv message-processing a singleton event
| * zebra: make incoming zserv message-processing a singleton eventMark Stapp2018-12-131-0/+3
| | | | | | | | | | | | | | | | | | Stop creating individual, one-time events as each batch of incoming zserv/zapi messages is processed - use a singleton event so that the incoming message activity is more fair if the zebra main pthread has other events to run. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* | zebra: use a small retry timeout for the rib workqueueMark Stapp2018-12-131-0/+1
|/ | | | | | | | | | In the zebra rib processing workqueue, set a small timeout so that we will wait a short time if the queue into the async dataplane is full. This helps avoid a situation where the zebra main pthread constantly retries rib work without giving the dataplane pthread a chance to make progress. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* *: only use 32-bit atomicsQuentin Young2018-11-191-2/+2
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: Add counting to nexthop register/unregister eventsDonald Sharp2018-10-311-0/+4
| | | | | | | Add a bit of code to note how many register/unregister nht events we have had. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: support zebra shutdown and cleanupMark Stapp2018-10-251-0/+3
| | | | | | | | | Dplane support for zebra's route cleanup during shutdown (clean shutdown via SIGINT, anyway.) The dplane has the opportunity to process incoming updates, and then triggers final cleanup in zebra's main thread. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: dont delete pthreads from under themselvesQuentin Young2018-07-311-0/+15
| | | | | | | | | * Rename some things to be less confusing * Convert client close function to take a client struct rather than a task * Extern client close function and use it when handling SIGTERM Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: fix race condition in i/o pthread shutdownQuentin Young2018-05-291-3/+0
| | | | | | | | | I mistakenly used an external mechanism to cause a pthread to shut itself down instead of using the one built into frr_pthread.[ch]. This created a race condition whereby a pthread could schedule work onto a dead pthread and cause it to reanimate. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: misc fixes, perf improvementsQuentin Young2018-05-291-1/+1
| | | | | | | | | | | * Coalesce multiple write() syscalls into one * Write larger chunks * Decrease default read limit to 1000 * Remove unnecessary operations from hot loop (zserv_write) * Move cross-schedule out of obuf lock * Use atomic ops to update atomic variable Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: don't send data after closing connectionQuentin Young2018-05-291-0/+3
| | | | | | | Cancelling threads is nice but they can potentially be scheduled again after cancellation without an explicit check. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: fix write task collisionQuentin Young2018-05-291-1/+0
| | | | | | | | Only one I/O task can be scheduled per file descriptor. Having two separate tasks for buffer filling and buffer flushing was breaking that invariant and causing messages to never be written. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>