#include <zebra.h>
#include <netinet/ip.h>
+#include "lib/memory.h"
#include "lib/hash.h"
#include "lib/hook.h"
#include "lib/if.h"
#include "lib/linklist.h"
+#include "lib/northbound.h"
#include "lib/privs.h"
#include "lib/stream.h"
#include "lib/thread.h"
#define VRRP_LOGPFX_FAM "[%s] "
/* Default defaults */
+#define VRRP_XPATH_FULL "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group"
+#define VRRP_XPATH "./frr-vrrpd:vrrp/vrrp-group"
#define VRRP_DEFAULT_PRIORITY 100
#define VRRP_DEFAULT_ADVINT 100
#define VRRP_DEFAULT_PREEMPT true
/* User compatibility constant */
#define CS2MS 10
+DECLARE_MGROUP(VRRPD)
+
+/* Northbound */
+extern const struct frr_yang_module_info frr_vrrpd_info;
+
/* Configured defaults */
struct vrrp_defaults {
+ uint8_t version;
uint8_t priority;
uint16_t advertisement_interval;
bool preempt_mode;
/*
* Add an IPvX address to a VRRP Virtual Router.
*
- * r
+ * vr
* Virtual Router to add IPvx address to
*
* ip
* -1 on error
* 0 otherwise
*/
-int vrrp_add_ip(struct vrrp_router *r, struct ipaddr *ip);
+int vrrp_add_ip(struct vrrp_vrouter *vr, struct ipaddr *ip);
/*
* Add an IPv4 address to a VRRP Virtual Router.
/*
* Remove an IP address from a VRRP Virtual Router.
*
- * r
+ * vr
* Virtual Router to remove IP address from
*
* ip
* -1 on error
* 0 otherwise
*/
-int vrrp_del_ip(struct vrrp_router *r, struct ipaddr *ip);
+int vrrp_del_ip(struct vrrp_vrouter *vr, struct ipaddr *ip);
/*
* Remove an IPv4 address from a VRRP Virtual Router.
#define VRRP_EVENT_STARTUP 0
#define VRRP_EVENT_SHUTDOWN 1
-extern const char *vrrp_state_names[3];
-extern const char *vrrp_event_names[2];
+extern const char *const vrrp_state_names[3];
/*
* This hook called whenever the state of a Virtual Router changes, after the
/* Other ------------------------------------------------------------------- */
-/*
- * Write interface block-level configuration to vty.
- *
- * vty
- * vty to write config to
- *
- * Returns:
- * # of lines written
- */
-int vrrp_config_write_interface(struct vty *vty);
-
/*
* Write global level configuration to vty.
*
/*
* Find VRRP Virtual Router by Virtual Router ID
*/
-struct vrrp_vrouter *vrrp_lookup(struct interface *ifp, uint8_t vrid);
+struct vrrp_vrouter *vrrp_lookup(const struct interface *ifp, uint8_t vrid);
#endif /* __VRRP_H__ */