summaryrefslogtreecommitdiff
path: root/ripngd/ripngd.h
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2018-11-29 02:27:16 -0200
committerRenato Westphal <renato@opensourcerouting.org>2018-12-03 13:47:58 -0200
commitb09956ca5184a5daff87e144efb935d21504518e (patch)
tree544f5694e427fec358879058c12dd92892f8660c /ripngd/ripngd.h
parentcc48702b20fa8a6d69e52c1770a741b755828a02 (diff)
ripngd: retrofit the 'offset-list' command to the new northbound model
Remove the ripng_offset_list_set() and ripng_offset_list_unset() functions since they set/unset multiple configuration options at the same time. The northbound callbacks need to set/unset configuration options individually. The frr-ripngd YANG module models the "offset-list" command using a list keyed by the 'interface' and 'direction' leafs. One important detail is that the IFNAME parameter is optional, and when it's not present it means we want to match all interfaces. This is modeled using an interface name of '*' since list keys are mandatory leafs by definition in YANG. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripngd/ripngd.h')
-rw-r--r--ripngd/ripngd.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/ripngd/ripngd.h b/ripngd/ripngd.h
index 95a0b25253..fd2ae4ad32 100644
--- a/ripngd/ripngd.h
+++ b/ripngd/ripngd.h
@@ -325,6 +325,20 @@ enum ripng_event {
} \
} while (0)
+#define RIPNG_OFFSET_LIST_IN 0
+#define RIPNG_OFFSET_LIST_OUT 1
+#define RIPNG_OFFSET_LIST_MAX 2
+
+struct ripng_offset_list {
+ char *ifname;
+
+ struct {
+ char *alist_name;
+ /* struct access_list *alist; */
+ uint8_t metric;
+ } direct[RIPNG_OFFSET_LIST_MAX];
+};
+
/* Extern variables. */
extern struct ripng *ripng;
extern struct zebra_privs_t ripngd_privs;
@@ -350,9 +364,6 @@ extern void ripng_terminate(void);
extern void zebra_init(struct thread_master *);
extern void ripng_zebra_stop(void);
extern void ripng_zclient_reset(void);
-extern void ripng_offset_init(void);
-
-extern int config_write_ripng_offset_list(struct vty *);
extern void ripng_peer_init(void);
extern void ripng_peer_update(struct sockaddr_in6 *, uint8_t);
@@ -362,10 +373,15 @@ extern void ripng_peer_display(struct vty *);
extern struct ripng_peer *ripng_peer_lookup(struct in6_addr *);
extern struct ripng_peer *ripng_peer_lookup_next(struct in6_addr *);
+extern struct ripng_offset_list *ripng_offset_list_new(const char *ifname);
+extern void ripng_offset_list_del(struct ripng_offset_list *offset);
+extern struct ripng_offset_list *ripng_offset_list_lookup(const char *ifname);
+extern struct ripng_offset_list *ripng_offset_list_lookup(const char *ifname);
extern int ripng_offset_list_apply_in(struct prefix_ipv6 *, struct interface *,
uint8_t *);
extern int ripng_offset_list_apply_out(struct prefix_ipv6 *, struct interface *,
uint8_t *);
+extern void ripng_offset_init(void);
extern void ripng_offset_clean(void);
extern struct ripng_info *ripng_info_new(void);