summaryrefslogtreecommitdiff
path: root/vrrpd/vrrp.h
AgeCommit message (Collapse)Author
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert `struct event_master` to `struct event_loop`Donald Sharp
Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert struct thread_master to struct event_master and it's ilkDonald Sharp
Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
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>
2022-11-25vrrpd: add IPv4 pseudoheader option for VRRPv3Siger Yang
This commit adds a new option to control whether a VRRPv3 group accepts / computes its checksum with a prepended IPv4 pseudoheader. This should improve interoperability with other devices. Signed-off-by: Siger Yang <siger.yang@outlook.com>
2021-03-17*: require semicolon after DEFINE_MTYPE & coDavid Lamparter
Back when I put this together in 2015, ISO C11 was still reasonably new and we couldn't require it just yet. Without ISO C11, there is no "good" way (only bad hacks) to require a semicolon after a macro that ends with a function definition. And if you added one anyway, you'd get "spurious semicolon" warnings on some compilers... With C11, `_Static_assert()` at the end of a macro will make it so that the semicolon is properly required, consumed, and not warned about. Consistently requiring semicolons after "file-level" macros matches Linux kernel coding style and helps some editors against mis-syntax'ing these macros. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-09vrrpd, yang: cleanup vrrp nb conversionQuentin Young
- Use correct units and conversions in model & code - Fix incorrect CLI help string for V6 virtual addrs - Fix nb get-entry callback for virtual router - Fix a couple style nits - Simplify some CLI code - Remove unused code - Remove unused YANG definitions - Update sighup() to handle reloads - Update interface level config writer to use NB callbacks - Add simplified `no` forms for priority and advertisement-interval commands Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-09vrrpd: northbound conversionQuentin Young
Convert VRRPD to use the northbound API. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-09vrrpd: const vrrp_lookup()Quentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-09vrrpd: make vrrp_[add|del]_ip not insaneQuentin Young
For some reason I made these functions require you to pass the correct (v4 or v6) router when we could determine it from the type of address passed; fix this Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-02*: generously apply constDavid Lamparter
const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-21vrrpd: use MTYPE_STATICDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-05-17vrrpd: gracefully shutdown on SIGTERM / SIGINTQuentin Young
Handle kill signals by gracefully destroying all of our VRRP instances. If any of them are in Master state, send an advert with 0 priority to notify Backup routers we are going down. 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: change all user facing times to msQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: clean up loggingQuentin Young
* Always include address family when available * Log advertisement decodes on one line Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: delay sending adverts/garp/una for iface upQuentin Young
When transitioning to Master from Backup, wait until Zebra sets the macvlan device to protodown off before transmitting advertisements, gratuitous ARPs, or Unsolicited Neighbor Advertisements. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: allow configuring global defaultsQuentin Young
Allow configuring the following as global defaults: - Priority - Advertisement interval - Preempt mode - Administrative shutdown Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: add statistics collectionQuentin Young
Collect and display the following: - Advertisement Tx/Rx - GARP Tx/Rx - NDISC Tx/Rx - # transitions 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: add support for configuration writingQuentin Young
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: add support for VRRPv2Quentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: handle address deletion, don't accept dupesQuentin Young
* Do nothing if user tries to add the same IP twice * Implement deletion of IPs * Deactivate virtual router if all IPs are deleted * Deduplicate add / remove code Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: same VRID, different interfaceQuentin Young
Identify VRRP instances by the 2-tuple (ifp, vrid) instead of by VRID, allowing the same instance to be configured on different interfaces. 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: implement `no` variants of commandsQuentin Young
Except removing v4/v6 addresses Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: compute VRRPv3 checksumQuentin Young
Correctly compute VRRPv3 checksum. Pseudoheaders are used for both IPv4 and IPv6. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: handle incoming advertisementsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: add initial macvlan supportQuentin Young
* Search for macvlan interfaces with the appropriate name and MAC address when starting up a new VRRP instance * Split VRRP socket into two; one for Tx, one for Rx * Bind Tx socket to the macvlan subinterface so our VRRP advertisements go out with the correct MAC address * Send ARP requests from this macvlan subinterface * Improve error messaging Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: read and validate vrrp advertisementsQuentin Young
* Validate IPvX headers and packet contents * Remove filter of non-255 TTL IPv4 packets; better to receive, log and drop them ourselves * Set outgoing packet TTL / hop limit to 255 * Use existing sockopt functions Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: ipv6 supportQuentin Young
Add initial support for IPv6. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: elect self to Master when owning v4 addressQuentin Young
If the primary address is v4, and we own the address on our configured interface, set ourselves to Master. This introduces the concept of a separate priority value used to store the configured vs effective priority. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: improve loggingQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: clean up configuration code, fix skew bugQuentin Young
* Update vrrp.[ch] file header to be more accurate * Make vrrp_update_times() private again * Add times reset function and use it * Add priority and advertisement interval setter functions and use them * Add command to change advertisement interval * Allow showing all VRRP instances * Improve doc comments on functions * Add ability to shutdown router * Reorganize vrrp.h * Add doc comments to vrrp.h * Fix bug where Skew_time was not used to compute Master_Down_Interval Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: config commands, enable ARPQuentin Young
* Allow configuring priority * Allow configuring IPv4 addresses * Add show command for vrouters * Fix hash comparison function * Fix ARP packetization bugs * Enable sending of gratuitous ARP 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: interface supportQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: implement gratuitous ARPQuentin Young
Implement gratuitous ARP functionality. Ethernet only. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: initial commitQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>