]> git.proxmox.com Git - mirror_frr.git/blobdiff - pbrd/pbr_nht.h
Merge pull request #4765 from opensourcerouting/defaults-v2
[mirror_frr.git] / pbrd / pbr_nht.h
index 2508f49e4b372afaac6b20ec20b9c4904f954462..4ef41cede7dd76a2fca02758e336787271cae2ce 100644 (file)
 #include <lib/zclient.h>
 #include <lib/nexthop_group.h>
 
+#include "pbr_map.h"
+
+#define PBR_NHC_NAMELEN PBR_MAP_NAMELEN + 10
+
 struct pbr_nexthop_group_cache {
-       char name[PBR_MAP_NAMELEN];
+       char name[PBR_NHC_NAMELEN];
 
        uint32_t table_id;
 
@@ -41,7 +45,7 @@ struct pbr_nexthop_group_cache {
 struct pbr_nexthop_cache {
        struct pbr_nexthop_group_cache *parent;
 
-       struct nexthop nexthop;
+       struct nexthop *nexthop;
 
        bool valid;
 };
@@ -52,9 +56,13 @@ extern void pbr_nht_write_table_range(struct vty *vty);
 extern void pbr_nht_set_tableid_range(uint32_t low, uint32_t high);
 
 /*
- * Get the next tableid to use for installation
+ * Get the next tableid to use for installation.
+ *
+ * peek
+ *    If set to true, retrieves the next ID without marking it used. The next
+ *    call will return the same ID.
  */
-extern uint32_t pbr_nht_get_next_tableid(void);
+extern uint32_t pbr_nht_get_next_tableid(bool peek);
 /*
  * Get the next rule number to use for installation
  */
@@ -76,12 +84,12 @@ extern void pbr_nhgroup_delete_cb(const char *name);
 extern bool pbr_nht_nexthop_valid(struct nexthop_group *nhg);
 extern bool pbr_nht_nexthop_group_valid(const char *name);
 
-extern void pbr_nht_add_group(const char *name);
+extern struct pbr_nexthop_group_cache *pbr_nht_add_group(const char *name);
 extern void pbr_nht_change_group(const char *name);
 extern void pbr_nht_delete_group(const char *name);
 
-extern void pbr_nht_add_individual_nexthop(const char *name, uint32_t seqno);
-extern void pbr_nht_delete_individual_nexthop(const char *name, uint32_t seqno);
+extern void pbr_nht_add_individual_nexthop(struct pbr_map_sequence *pbrms);
+extern void pbr_nht_delete_individual_nexthop(struct pbr_map_sequence *pbrms);
 /*
  * Given the tableid of the installed default
  * route, find the nexthop-group associated with
@@ -109,5 +117,10 @@ extern void pbr_nht_show_nexthop_group(struct vty *vty, const char *name);
  */
 extern void pbr_nht_nexthop_update(struct zapi_route *nhr);
 
+/*
+ * When we get a callback from zebra about an interface status update.
+ */
+extern void pbr_nht_nexthop_interface_update(struct interface *ifp);
+
 extern void pbr_nht_init(void);
 #endif