summaryrefslogtreecommitdiff
path: root/ripd/ripd.h
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2021-10-14 12:12:37 -0300
committerRafael Zalamena <rzalamena@opensourcerouting.org>2023-04-19 09:15:01 -0300
commitc262df828b2475632f590c256db677b424d868c7 (patch)
tree85a8ab1e5ff016e9cdc28e18f91d263a207c8d32 /ripd/ripd.h
parentfec51f2e2be021108dc1de4dd1ea89516082eaf7 (diff)
ripd: support BFD integration
Implement RIP peer monitoring with BFD. RFC 5882 Generic Application of Bidirectional Forwarding Detection (BFD), Section 10.3 Interactions with RIP. Co-authored-by: Renato Westphal <renato@opensourcerouting.org> Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'ripd/ripd.h')
-rw-r--r--ripd/ripd.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/ripd/ripd.h b/ripd/ripd.h
index 176a3bfc37..bba3c28069 100644
--- a/ripd/ripd.h
+++ b/ripd/ripd.h
@@ -10,6 +10,7 @@
#include "nexthop.h"
#include "distribute.h"
#include "memory.h"
+#include "bfd.h"
/* RIP version number. */
#define RIPv1 1
@@ -182,6 +183,9 @@ struct rip {
/* RIP queries. */
long queries;
} counters;
+
+ /* Default BFD profile to use with BFD sessions. */
+ char *default_bfd_profile;
};
RB_HEAD(rip_instance_head, rip);
RB_PROTOTYPE(rip_instance_head, rip, entry, rip_instance_compare)
@@ -265,6 +269,9 @@ struct rip_interface {
/* Parent routing instance. */
struct rip *rip;
+ /* Interface data from zebra. */
+ struct interface *ifp;
+
/* RIP is enabled on this interface. */
int enable_network;
int enable_interface;
@@ -318,6 +325,12 @@ struct rip_interface {
/* Passive interface. */
int passive;
+
+ /* BFD information. */
+ struct {
+ bool enabled;
+ char *profile;
+ } bfd;
};
/* RIP peer information. */
@@ -325,6 +338,9 @@ struct rip_peer {
/* Parent routing instance. */
struct rip *rip;
+ /* Back-pointer to RIP interface. */
+ struct rip_interface *ri;
+
/* Peer address. */
struct in_addr addr;
@@ -343,6 +359,9 @@ struct rip_peer {
/* Timeout thread. */
struct event *t_timeout;
+
+ /* BFD information */
+ struct bfd_session_params *bfd_session;
};
struct rip_distance {
@@ -461,16 +480,20 @@ extern void rip_if_rmap_update_interface(struct interface *ifp);
extern int rip_show_network_config(struct vty *vty, struct rip *rip);
extern void rip_show_redistribute_config(struct vty *vty, struct rip *rip);
-extern void rip_peer_update(struct rip *rip, struct sockaddr_in *from,
- uint8_t version);
-extern void rip_peer_bad_route(struct rip *rip, struct sockaddr_in *from);
-extern void rip_peer_bad_packet(struct rip *rip, struct sockaddr_in *from);
+extern void rip_peer_free(struct rip_peer *peer);
+extern void rip_peer_update(struct rip *rip, struct rip_interface *ri,
+ struct sockaddr_in *from, uint8_t version);
+extern void rip_peer_bad_route(struct rip *rip, struct rip_interface *ri,
+ struct sockaddr_in *from);
+extern void rip_peer_bad_packet(struct rip *rip, struct rip_interface *ri,
+ struct sockaddr_in *from);
extern void rip_peer_display(struct vty *vty, struct rip *rip);
extern struct rip_peer *rip_peer_lookup(struct rip *rip, struct in_addr *addr);
extern struct rip_peer *rip_peer_lookup_next(struct rip *rip,
struct in_addr *addr);
extern int rip_peer_list_cmp(struct rip_peer *p1, struct rip_peer *p2);
extern void rip_peer_list_del(void *arg);
+void rip_peer_delete_routes(const struct rip_peer *peer);
extern void rip_info_free(struct rip_info *);
extern struct rip *rip_info_get_instance(const struct rip_info *rinfo);