diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2018-05-09 06:35:00 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2018-10-27 20:16:12 +0200 |
commit | 8c942f65062ac96978fb9c058875a4a602f66dcf (patch) | |
tree | edb539ba4fc9e2768455b4bbe2fb49b1d373a649 /ripd/ripd.h | |
parent | ripd: retrofit the 'network' command to the new northbound model (diff) | |
download | frr-8c942f65062ac96978fb9c058875a4a602f66dcf.tar.xz frr-8c942f65062ac96978fb9c058875a4a602f66dcf.zip |
ripd: retrofit the 'offset-list' command to the new northbound model
Remove the rip_offset_list_set() and rip_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-ripd 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 key lists are mandatory by definition in YANG.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripd/ripd.h')
-rw-r--r-- | ripd/ripd.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/ripd/ripd.h b/ripd/ripd.h index 9bd9f53f2..4378f75af 100644 --- a/ripd/ripd.h +++ b/ripd/ripd.h @@ -367,6 +367,20 @@ enum rip_event { /* Macro for timer turn off. */ #define RIP_TIMER_OFF(X) THREAD_TIMER_OFF(X) +#define RIP_OFFSET_LIST_IN 0 +#define RIP_OFFSET_LIST_OUT 1 +#define RIP_OFFSET_LIST_MAX 2 + +struct rip_offset_list { + char *ifname; + + struct { + char *alist_name; + /* struct access_list *alist; */ + uint8_t metric; + } direct[RIP_OFFSET_LIST_MAX]; +}; + /* Prototypes. */ extern void rip_init(void); extern void rip_reset(void); @@ -382,7 +396,6 @@ extern void rip_route_map_reset(void); extern void rip_zclient_init(struct thread_master *); extern void rip_zclient_stop(void); extern void rip_zclient_reset(void); -extern void rip_offset_init(void); extern int if_check_address(struct in_addr addr); extern int rip_create(int socket); @@ -414,7 +427,6 @@ extern void rip_distribute_update_interface(struct interface *); extern void rip_if_rmap_update_interface(struct interface *); extern int config_write_rip_network(struct vty *, int); -extern int config_write_rip_offset_list(struct vty *); extern int config_write_rip_redistribute(struct vty *, int); extern void rip_peer_init(void); @@ -425,12 +437,6 @@ extern void rip_peer_display(struct vty *); extern struct rip_peer *rip_peer_lookup(struct in_addr *); extern struct rip_peer *rip_peer_lookup_next(struct in_addr *); -extern int rip_offset_list_apply_in(struct prefix_ipv4 *, struct interface *, - uint32_t *); -extern int rip_offset_list_apply_out(struct prefix_ipv4 *, struct interface *, - uint32_t *); -extern void rip_offset_clean(void); - extern void rip_info_free(struct rip_info *); extern struct rip_distance *rip_distance_new(void); extern void rip_distance_free(struct rip_distance *rdistance); @@ -441,6 +447,16 @@ extern struct rip_info *rip_ecmp_add(struct rip_info *); extern struct rip_info *rip_ecmp_replace(struct rip_info *); extern struct rip_info *rip_ecmp_delete(struct rip_info *); +extern struct rip_offset_list *rip_offset_list_new(const char *ifname); +extern void offset_list_del(struct rip_offset_list *offset); +extern struct rip_offset_list *rip_offset_list_lookup(const char *ifname); +extern int rip_offset_list_apply_in(struct prefix_ipv4 *, struct interface *, + uint32_t *); +extern int rip_offset_list_apply_out(struct prefix_ipv4 *, struct interface *, + uint32_t *); +extern void rip_offset_init(void); +extern void rip_offset_clean(void); + /* There is only one rip strucutre. */ extern struct rip *rip; |