2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2015-11-03 19:00:30 +01:00
|
|
|
/*
|
|
|
|
* Prefix list internal definitions.
|
|
|
|
* Copyright (C) 1999 Kunihiro Ishiguro
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _QUAGGA_PLIST_INT_H
|
|
|
|
#define _QUAGGA_PLIST_INT_H
|
|
|
|
|
2019-02-07 23:10:31 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-11-03 19:00:30 +01:00
|
|
|
struct pltrie_table;
|
|
|
|
|
2022-03-09 02:52:45 +01:00
|
|
|
PREDECL_RBTREE_UNIQ(plist);
|
|
|
|
|
2015-11-03 19:00:30 +01:00
|
|
|
struct prefix_list {
|
|
|
|
char *name;
|
|
|
|
char *desc;
|
|
|
|
|
|
|
|
struct prefix_master *master;
|
|
|
|
|
|
|
|
int count;
|
|
|
|
int rangecount;
|
|
|
|
|
2022-03-09 02:52:45 +01:00
|
|
|
struct plist_item plist_item;
|
|
|
|
|
2015-11-03 19:00:30 +01:00
|
|
|
struct prefix_list_entry *head;
|
|
|
|
struct prefix_list_entry *tail;
|
|
|
|
|
|
|
|
struct pltrie_table *trie;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Each prefix-list's entry. */
|
|
|
|
struct prefix_list_entry {
|
2018-04-29 18:40:12 +02:00
|
|
|
int64_t seq;
|
2015-11-03 19:00:30 +01:00
|
|
|
|
|
|
|
int le;
|
|
|
|
int ge;
|
|
|
|
|
|
|
|
enum prefix_list_type type;
|
|
|
|
|
2020-04-16 10:15:35 +02:00
|
|
|
bool any;
|
2015-11-03 19:00:30 +01:00
|
|
|
struct prefix prefix;
|
|
|
|
|
|
|
|
unsigned long refcnt;
|
|
|
|
unsigned long hitcnt;
|
|
|
|
|
2019-11-12 00:21:25 +01:00
|
|
|
struct prefix_list *pl;
|
|
|
|
|
2015-11-03 19:00:30 +01:00
|
|
|
struct prefix_list_entry *next;
|
|
|
|
struct prefix_list_entry *prev;
|
|
|
|
|
|
|
|
/* up the chain for best match search */
|
|
|
|
struct prefix_list_entry *next_best;
|
2020-05-01 15:34:03 +02:00
|
|
|
|
|
|
|
/* Flag to track trie/list installation status. */
|
|
|
|
bool installed;
|
2015-11-03 19:00:30 +01:00
|
|
|
};
|
|
|
|
|
2020-05-01 15:34:03 +02:00
|
|
|
extern void prefix_list_entry_free(struct prefix_list_entry *pentry);
|
2020-05-02 03:14:00 +02:00
|
|
|
extern void prefix_list_entry_delete2(struct prefix_list_entry *ple);
|
2020-05-01 15:34:03 +02:00
|
|
|
extern void prefix_list_entry_update_start(struct prefix_list_entry *ple);
|
|
|
|
extern void prefix_list_entry_update_finish(struct prefix_list_entry *ple);
|
|
|
|
|
2019-02-07 23:10:31 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-11-03 19:00:30 +01:00
|
|
|
#endif /* _QUAGGA_PLIST_INT_H */
|