]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/id_alloc.c
Merge pull request #5793 from ton31337/fix/formatting_show_bgp_summary_failed
[mirror_frr.git] / lib / id_alloc.c
index b4d37dbdcfa05092e9dfa3b72d55ba257482c204..7c7f2c46898602a4b9414aaa8b75bc2228f6d810 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "id_alloc.h"
 
 #include "log.h"
@@ -42,7 +46,7 @@ DEFINE_MTYPE_STATIC(LIB, IDALLOC_POOL, "ID Number temporary holding pool entry")
 
 #define DIR_MASK    ((1<<IDALLOC_DIR_BITS)-1)
 #define SUBDIR_MASK ((1<<IDALLOC_SUBDIR_BITS)-1)
-#define PAGE_MASK   ((1<<IDALLOC_PAGE_BITS)-1)
+#define FRR_ID_PAGE_MASK ((1<<IDALLOC_PAGE_BITS)-1)
 #define WORD_MASK   ((1<<IDALLOC_WORD_BITS)-1)
 #define OFFSET_MASK ((1<<IDALLOC_OFFSET_BITS)-1)
 
@@ -50,13 +54,13 @@ DEFINE_MTYPE_STATIC(LIB, IDALLOC_POOL, "ID Number temporary holding pool entry")
                      IDALLOC_PAGE_BITS + IDALLOC_SUBDIR_BITS)
 #define SUBDIR_SHIFT (IDALLOC_OFFSET_BITS + IDALLOC_WORD_BITS + \
                      IDALLOC_PAGE_BITS)
-#define PAGE_SHIFT   (IDALLOC_OFFSET_BITS + IDALLOC_WORD_BITS)
+#define FRR_ID_PAGE_SHIFT (IDALLOC_OFFSET_BITS + IDALLOC_WORD_BITS)
 #define WORD_SHIFT   (IDALLOC_OFFSET_BITS)
 #define OFFSET_SHIFT (0)
 
 #define ID_DIR(id)    ((id >> DIR_SHIFT)    & DIR_MASK)
 #define ID_SUBDIR(id) ((id >> SUBDIR_SHIFT) & SUBDIR_MASK)
-#define ID_PAGE(id)   ((id >> PAGE_SHIFT)   & PAGE_MASK)
+#define ID_PAGE(id)   ((id >> FRR_ID_PAGE_SHIFT) & FRR_ID_PAGE_MASK)
 #define ID_WORD(id)   ((id >> WORD_SHIFT)   & WORD_MASK)
 #define ID_OFFSET(id) ((id >> OFFSET_SHIFT) & OFFSET_MASK)
 
@@ -98,7 +102,7 @@ static struct id_alloc_page *find_or_create_page(struct id_alloc *alloc,
                page->base_value = id;
                subdir->sublevels[ID_PAGE(id)] = page;
 
-               alloc->capacity += 1 << PAGE_SHIFT;
+               alloc->capacity += 1 << FRR_ID_PAGE_SHIFT;
                page->next_has_free = alloc->has_free;
                alloc->has_free = page;
        } else if (page != NULL && create) {