FIB memory leak during recursive loop detection
[vpp.git] / src / plugins / nat / nat64_db.h
index 394ca87..7cda8b0 100644 (file)
@@ -127,10 +127,15 @@ typedef struct
  * @brief Initialize NAT64 DB.
  *
  * @param db NAT64 DB.
+ * @param bib_buckets Number of BIB hash buckets.
+ * @param bib_memory_size Memory size of BIB hash.
+ * @param st_buckets Number of session table hash buckets.
+ * @param st_memory_size Memory size of session table hash.
  *
  * @returns 0 on success, non-zero value otherwise.
  */
-int nat64_db_init (nat64_db_t * db);
+int nat64_db_init (nat64_db_t * db, u32 bib_buckets, u32 bib_memory_size,
+                  u32 st_buckets, u32 st_memory_size);
 
 /**
  * @brief Create new NAT64 BIB entry.
@@ -296,6 +301,27 @@ void nad64_db_st_free_expired (nat64_db_t * db, u32 now);
  */
 void nat64_db_free_out_addr (nat64_db_t * db, ip4_address_t * out_addr);
 
+/*
+ * @brief Get ST entry index.
+ *
+ * @param db NAT64 DB.
+ * @param ste ST entry.
+ *
+ * @return ST entry index on success, ~0 otherwise.
+ */
+u32 nat64_db_st_entry_get_index (nat64_db_t * db, nat64_db_st_entry_t * ste);
+
+/**
+ * @brief Get ST entry by index and protocol.
+ *
+ * @param db NAT64 DB.
+ * @param proto L4 protocol.
+ * @param bibe_index ST entry index.
+ *
+ * @return BIB entry if found.
+ */
+nat64_db_st_entry_t *nat64_db_st_entry_by_index (nat64_db_t * db,
+                                                u8 proto, u32 ste_index);
 #endif /* __included_nat64_db_h__ */
 
 /*