summaryrefslogtreecommitdiff
path: root/zebra/zserv.c
AgeCommit message (Collapse)Author
2022-08-24zebra: Convert time to uint64_t for zclient data structuresDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-20*: frr_with_mutex change to follow our standardDonald Sharp
convert: frr_with_mutex(..) to: frr_with_mutex (..) To make all our code agree with what clang-format is going to produce Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-02*: Fix spelling of GracefullDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-17zebra: Expand v4/v6 route spaceDonald Sharp
At some scale we eventually run out of room displaying v4/v6 route totals for `show zebra client summ`: janelle# show zebra client summ Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes -------------------------------------------------------------------------------- bgp 04w0d18h 00:00:19 00:01:2411729127/4052681 2037786/903094 This total over ran the space in just a little over a week of uptime. Expand to have a bit more room. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-07zebra: Display how long zebra is expected to wait for GRDonald Sharp
When a client sends to zebra that GR mode is being turned on. The client also passes down the time zebra should hold onto the routes. Display this time with the output of the `show zebra client` command as well. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-07zebra: GR data was being printed 2 times for `show zebra client`Donald Sharp
When issuing the `show zebra client` command data about Graceful Restart state is being printed 2 times. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-21zebra: On client shutdown cleanup any vrf labels associated with itDonald Sharp
When a vrf label is created by a client and the client disconnects we should clean up any vrf labels associated with that client. eva# show mpls table Inbound Label Type Nexthop Outbound Label ----------------------------------------------- 1000 SHARP RED - eva# exit sharpd@eva ~/f/zebra (label_destruction)> ps -ef | grep frr root 4017793 1 0 13:57 ? 00:00:00 /usr/lib/frr/watchfrr -d -F datacenter --log file:/var/log/frr/watchfrr.log --log-level debug zebra bgpd ospfd isisd pimd eigrpd sharpd staticd frr 4017824 1 0 13:57 ? 00:00:00 /usr/lib/frr/zebra -d -F datacenter --log file:/tmp/zebra.log -r --graceful_restart 60 -A 127.0.0.1 -s 90000000 frr 4017829 1 0 13:57 ? 00:00:00 /usr/lib/frr/bgpd -d -F datacenter -M rpki -A 127.0.0.1 frr 4017836 1 0 13:57 ? 00:00:00 /usr/lib/frr/ospfd -d -F datacenter -A 127.0.0.1 frr 4017839 1 0 13:57 ? 00:00:00 /usr/lib/frr/isisd -d -F datacenter -A 127.0.0.1 frr 4017842 1 0 13:57 ? 00:00:00 /usr/lib/frr/pimd -d -F datacenter -A 127.0.0.1 frr 4017865 1 0 13:57 ? 00:00:00 /usr/lib/frr/eigrpd -d -F datacenter -A 127.0.0.1 frr 4017869 1 0 13:57 ? 00:00:00 /usr/lib/frr/sharpd -d -F datacenter -A 127.0.0.1 frr 4017888 1 0 13:57 ? 00:00:00 /usr/lib/frr/staticd -d -F datacenter -A 127.0.0.1 sharpd 4018624 3938423 0 14:02 pts/10 00:00:00 grep --color=auto frr sharpd@eva ~/f/zebra (label_destruction)> sudo kill -9 4017869 sharpd@eva ~/f/zebra (label_destruction)> sudo vtysh -c "show mpls table" sharpd@eva ~/f/zebra (label_destruction)> Fixes: #1787 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-06-10zebra: Move individual lines to table in `show zebra client` commandDonald Sharp
Move some individual add/delete lines to the table format in the `show zebra client` command Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-06-10zebra: Add message counts for `show zebra client`Donald Sharp
There were counters FRR was keeping but never displaying. Add them in. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-23*: drop zassert.hDavid Lamparter
It's not actually working properly... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-09zebra: link layer config and notification, implementation in zebraPhilippe Guibert
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>
2021-02-04zebra: Display instance id as part of `show zebra client summ`Donald Sharp
When displaying `show zebra client summ` when we have instances running, display the instance number as well. New Output: sharpd@eva ~/frr7 (instance_data)> vtysh -c "show zebra client summ" Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes -------------------------------------------------------------------------------- ospf[1] 00:00:02 00:00:02 00:00:02 0/0 0/0 ospf[5] 00:00:02 00:00:02 00:00:02 0/0 0/0 sharp 00:00:02 00:00:02 00:00:02 0/0 0/0 static 00:00:02 00:00:02 00:00:02 0/0 0/0 Routes column shows (added+updated)/deleted Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-10zebra: Allow `show zebra client` to give clues about route update statusDonald Sharp
When entering `show zebra client` allow the display of the client->notify_status for route updates. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-07zebra: Adding zapi client close notificationKaren Schoener
When zebra detects a client close, send a zapi client close notification. Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-10-22:* Convert prefix2str to %pFXDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-09-28zebra: handle proto NHG uninstall client disconnectStephen Worley
Add code to handle proto-based NHG uninstalling after the owning client disconnects. This is handled the same way as rib_score_proto() but for now we are ignoring instance. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-08-25zebra: remove fuzzing stuffJakub Urbańczyk
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>
2020-08-10Merge pull request #6483 from sylane/router-id-v6Donald Sharp
zebra: add IPv6 router-id
2020-08-05zebra: Ethernet segment management and support for MAC-ECMPAnuradha Karuppiah
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>
2020-07-17zebra: add IPv6 router-idSebastien Merle
* 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>
2020-06-10sharpd,zebra: unicast support for zapi messagesMark Stapp
Distinguish between unicast and broadcast opaque messages in zebra handler code. Add cli and internal api changes to have sharpd send unicast opaque messages. Add opaque cli commands to the sharp user doc. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-02zebra: add zserv_send_batch apiMark Stapp
Add a zserv api to send a batch (a fifo) of messages to a zapi client. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-02zebra: don't print stale text if no GR infoMark Stapp
Don't print GR show output header if no GR info is present for a zapi client. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-02zebra: call zapi message handler with a batchMark Stapp
The zapi code processes a batch of incoming messages, using a fifo. Hand the entire batch into the main zebra handling code, and let it loop through the individual messages. Divert the special OPAQUE messages from the normal processing flow, and offer them to the new zebra_opaque module instead. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-02zebra: add lock and busy counter for zclientsMark Stapp
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>
2020-05-28zebra, lib: bugfix on zebra packet debuggingWesley Coakley
`debug zebra packet detail` dumps the full message whereas it had been dropping exactly 10 bytes, the size of the zebra header Signed-off-by: Wesley Coakley <wcoakley@cumulusnetworks.com>
2020-04-16lib,zebra: add a session id for zapi sessionsMark Stapp
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>
2020-04-14zebra: use %u for unsigned when printing countersQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-03-09lib, *: add a common time interval formatting apiMark Stapp
Add a common api that formats a time interval into a string with different output for short and longer intervals. We do this in several places, for cli/ui output. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-03-05Merge pull request #5916 from mjstapp/fix_gmtimeQuentin Young
*: use gmtime_r exclusively
2020-03-05*: use gmtime_r, localtime_r exclusivelyMark Stapp
Stop using gmtime() or localtime() everywhere. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-02-21Zebra: Zebra gr dynamic client handling.Santosh P K
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>
2020-01-30zebra: Handling of connection disconnect and connect with GR.Santosh P K
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>
2020-01-30zebra: Header file changes and show commands.Santosh P K
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>
2020-01-15zebra: fix redist memleak on client disconnectQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-11-22zebra: Fix `show zebra client` display to handle columns rightDonald Sharp
Before: Type Add Update Del ================================================== IPv4 11539033 272 10751107 IPv6 1122106 43 1047081 After: Type Add Update Del ================================================== IPv4 10517740 64 9729917 IPv6 1016590 8 941567 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-22zebra: Adjust column display of `show zebra client summ` for openfabricDonald Sharp
The openfabric daemon has a longer name than anticipated for `show zebra client summary` adjust to allow it to fit without making columns all blomped. Before: robot# show zebra client summ Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes -------------------------------------------------------------------------------- static 00:00:06 00:00:06 00:00:06 4/0 0/0 openfabric 00:00:06 00:00:06 00:00:06 0/0 0/0 After: [sharpd@robot frr4]$ vtysh -c "show zebra client summ" Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes -------------------------------------------------------------------------------- static 00:02:16 00:02:16 00:02:16 4/0 0/0 openfabric 00:02:16 00:02:16 00:02:16 0/0 0/0 Signed-off-by: Donald Sharp <sharpd@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-09-03*: frr_elevate_privs -> frr_with_privsDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-09-03lib: add frr_with_mutex() block-wrapperDavid Lamparter
frr_with_mutex(...) { ... } locks and automatically unlocks the listed mutex(es) when the block is exited. This adds a bit of safety against forgetting the unlock in error paths & co. and makes the code a slight bit more readable. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-07-10zebra: label manager refactorEmanuele Di Pascale
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>
2019-06-15zebra: Fuzzing code has gotten a bit out of dateDonald Sharp
Update the fuzzing code to compile again. 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-06doc, zebra: Remove "table X" commandDonald Sharp
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>
2019-05-03zebra: fix zapi msg debugging dumpsQuentin Young
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>
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-04-08*: setting the socket send/recv buffer sizes doesn't need elevated privsRenato Westphal
The less code running under elevated privileges the better. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-03-27zebra: When shutting down actually close the socketDonald Sharp
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>
2019-02-10zebra: Update zserv debug messages to give a bit more useful infoDonald Sharp
When we schedule a packet for future handling, list the packet type so that we can see what we are getting with debugs. Also note which client and how many packets we received from that client. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>