summaryrefslogtreecommitdiff
path: root/vrrpd/vrrp_zebra.c
AgeCommit message (Collapse)Author
2023-11-22*: convert `struct interface->connected` to DLISTDavid Lamparter
Replace `struct list *` with `DLIST(if_connected, ...)`. NB: while converting this, I found multiple places using connected prefixes assuming they were IPv4 without checking: - vrrpd/vrrp.c: vrrp_socket() - zebra/irdp_interface.c: irdp_get_prefix(), irdp_if_start(), irdp_advert_off() (these fixes are really hard to split off into separate commits as that would require going back and reapplying the change but with the old list handling) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-11-02lib: convert if_zapi_callbacks into actual hooksDavid Lamparter
...so that multiple functions can be subscribed. The create/destroy hooks are renamed to real/unreal because that's what they *actually* signal. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-22*: cleanup ifp->vrf_idIgor Ryzhov
Since f60a1188 we store a pointer to the VRF in the interface structure. There's no need anymore to store a separate vrf_id field. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-20*: convert zclient callbacks to tableDavid Lamparter
This removes a giant `switch { }` block from lib/zclient.c and harmonizes all zclient callback function types to be the same (some had a subset of the args, some had a void return, now they all have ZAPI_CALLBACK_ARGS and int return.) Apart from getting rid of the giant switch, this is a minor security benefit since the function pointers are now in a `const` array, so they can't be overwritten by e.g. heap overflows for code execution anymore. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-11-15*: Convert all usage of zclient_send_message to new enumDonald Sharp
The `enum zclient_send_status` enum needs to be extended throughout the code base to use the new states and to fix up places where we tested against the return value being non zero. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-15vrrpd: Convert to using %pFXPat Ruddy
Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-03-05*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-12-09vrrpd: add vrf supportQuentin Young
Signed-off-by: Quentin Young <qlyoung@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-19*: Add infrastructure to support zapi interface callbacksDonald Sharp
Start the conversion to allow zapi interface callbacks to be controlled like vrf creation/destruction/change callbacks. This will allow us to consolidate control into the interface.c instead of having each daemon read the stream and react accordingly. This will hopefully reduce a bunch of cut-n-paste stuff Create 4 new callback functions that will be controlled by lib/if.c create -> A upper level protocol receives an interface creation event The ifp is brand spanking newly created in the system. up -> A upper level protocol receives a interface up event This means the interface is up and ready to go. down -> A upper level protocol receives a interface down destroy -> A upper level protocol receives a destroy event This means to delete the pointers associated with it. At this point this is just boilerplate setup for future commits. There is no new functionality. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-02vrrpd: add more dbg logs around interfacesQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-07-29vrrpd: set interface ifindex to internal upon interface deletionQuentin Young
That fix line should have been in a different place. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-07-08vrrpd: set interface ifindex to internal upon deletionQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17lib, vrrpd: define & use ZEBRA_ROUTE_VRRPQuentin Young
Allow Zebra to know our protocol name. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd, lib: style fixesQuentin Young
Fixup: * Blank lines after declarations * Trailing whitespace * Braces and parentheses Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: don't update interface addrs on ifupQuentin Young
Updating interface addresses on autoconfigured VRRP instances when we receive notification that an interface is up will cause us to delete that VRRP instance because Zebra deletes all interface addresses when an interfaces goes down so when it comes back up it has no addresses which causes us to delete the instance, then Zebra subsequently sends us the addresses which causes the instance to get recreated, however in a non-owner scenario this will merely cause us to start in Backup, wait a while, transition to Master, protodown off our interface, get an interface up notification, delete all our ip addresses, destroy ourselves, receive address notifications, recreate ourselves, reenter Backup and cycle through it all over again. So we just have to assume that no addresses went away since this interface was last up. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: enable vrrp zebra debuggingQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: interface trackingQuentin Young
* Dynamically bind interfaces when they become available * Automatically start VRRP sessions when their interfaces are added or come up * Automatically shut down VRRP sessions when their interfaces are deleted or go down * Automatically unbind interfaces when they are deleted Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: autoconfig support, continuedQuentin Young
* Add support for interface up/down + address add/del events when using autoconfigure mode * Add autoconfig information to show command Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: autoconfig supportQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: protodown macvlan in backup stateQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: fix headersQuentin Young
* Add include guards where missing * Add include guard comments where missing * Fix copyright notices * Sort includes Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: send ND Router AdvertisementsQuentin Young
Send ND Router Advertisements when IPv6 VR is in Master state. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: zebra connectionsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: initial commitQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>