]> git.proxmox.com Git - mirror_frr.git/blobdiff - ripngd/ripngd.h
zebra: Allow ns delete to happen after under/over flow checks
[mirror_frr.git] / ripngd / ripngd.h
index c9bcd8b0e04e1767bb0b8333ec18190d5b6d3bc8..5b32374ace87238f08127ea0a80c941ba628ce02 100644 (file)
 #define RIPNG_METRIC_NEXTHOP          0xff
 #define RIPNG_GROUP              "ff02::9"
 
-/* RIPng timers. */
-#define RIPNG_UPDATE_TIMER_DEFAULT      30
-#define RIPNG_TIMEOUT_TIMER_DEFAULT    180
-#define RIPNG_GARBAGE_TIMER_DEFAULT    120
-
 /* RIPng peer timeout value. */
 #define RIPNG_PEER_TIMER_DEFAULT       180
 
@@ -77,9 +72,6 @@
 #define RIPNG_DEFAULT_ACCEPT_NONE        1
 #define RIPNG_DEFAULT_ACCEPT             2
 
-/* Default value for "default-metric" command. */
-#define RIPNG_DEFAULT_METRIC_DEFAULT     1
-
 /* For max RTE calculation. */
 #ifndef IPV6_HDRLEN
 #define IPV6_HDRLEN 40
@@ -101,11 +93,11 @@ struct ripng {
        /* RIPng Parameters.*/
        uint8_t command;
        uint8_t version;
-       unsigned long update_time;
-       unsigned long timeout_time;
-       unsigned long garbage_time;
+       uint16_t update_time;
+       uint16_t timeout_time;
+       uint16_t garbage_time;
        int max_mtu;
-       int default_metric;
+       uint8_t default_metric;
 
        /* Input/output buffer of RIPng. */
        struct stream *ibuf;
@@ -114,12 +106,6 @@ struct ripng {
        /* RIPng routing information base. */
        struct agg_table *table;
 
-       /* RIPng only static route information. */
-       struct agg_table *route;
-
-       /* RIPng aggregate route information. */
-       struct agg_table *aggregate;
-
        /* RIPng threads. */
        struct thread *t_read;
        struct thread *t_write;
@@ -139,8 +125,8 @@ struct ripng {
        struct {
                char *name;
                struct route_map *map;
-               int metric_config;
-               uint32_t metric;
+               bool metric_config;
+               uint8_t metric;
        } route_map[ZEBRA_ROUTE_MAX];
 };
 
@@ -250,7 +236,6 @@ struct ripng_interface {
 
        /* Split horizon flag. */
        split_horizon_policy_t split_horizon;
-       split_horizon_policy_t split_horizon_default;
 
 /* For filter type slot. */
 #define RIPNG_FILTER_IN  0
@@ -328,30 +313,46 @@ 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 list *peer_list;
 extern struct zebra_privs_t ripngd_privs;
 extern struct thread_master *master;
 
 /* Prototypes. */
 extern void ripng_init(void);
-extern void ripng_reset(void);
 extern void ripng_clean(void);
 extern void ripng_clean_network(void);
 extern void ripng_interface_clean(void);
-extern void ripng_interface_reset(void);
+extern int ripng_enable_network_add(struct prefix *p);
+extern int ripng_enable_network_delete(struct prefix *p);
+extern int ripng_enable_if_add(const char *ifname);
+extern int ripng_enable_if_delete(const char *ifname);
+extern int ripng_passive_interface_set(const char *ifname);
+extern int ripng_passive_interface_unset(const char *ifname);
 extern void ripng_passive_interface_clean(void);
 extern void ripng_if_init(void);
 extern void ripng_route_map_init(void);
-extern void ripng_route_map_reset(void);
 extern void ripng_terminate(void);
 /* zclient_init() is done by ripng_zebra.c:zebra_init() */
 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_redistribute_conf_update(int type);
+extern void ripng_redistribute_conf_delete(int type);
 
 extern void ripng_peer_init(void);
 extern void ripng_peer_update(struct sockaddr_in6 *, uint8_t);
@@ -361,12 +362,18 @@ 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 int ripng_route_rte(struct ripng_info *rinfo);
 extern struct ripng_info *ripng_info_new(void);
 extern void ripng_info_free(struct ripng_info *rinfo);
 extern void ripng_event(enum ripng_event, int);
@@ -386,7 +393,7 @@ extern void ripng_zebra_ipv6_delete(struct agg_node *node);
 
 extern void ripng_redistribute_clean(void);
 extern int ripng_redistribute_check(int);
-extern void ripng_redistribute_write(struct vty *, int);
+extern void ripng_redistribute_write(struct vty *);
 
 extern int ripng_write_rte(int num, struct stream *s, struct prefix_ipv6 *p,
                           struct in6_addr *nexthop, uint16_t tag,
@@ -412,7 +419,7 @@ extern int ripng_interface_address_delete(int command, struct zclient *,
 
 extern int ripng_create(int socket);
 extern int ripng_make_socket(void);
-extern int ripng_network_write(struct vty *, int);
+extern int ripng_network_write(struct vty *);
 
 extern struct ripng_info *ripng_ecmp_add(struct ripng_info *);
 extern struct ripng_info *ripng_ecmp_replace(struct ripng_info *);