]> git.proxmox.com Git - mirror_frr.git/blame - lib/plist_int.h
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / lib / plist_int.h
CommitLineData
acddc0ed 1// SPDX-License-Identifier: GPL-2.0-or-later
814e24c4
DS
2/*
3 * Prefix list internal definitions.
4 * Copyright (C) 1999 Kunihiro Ishiguro
814e24c4
DS
5 */
6
7#ifndef _QUAGGA_PLIST_INT_H
8#define _QUAGGA_PLIST_INT_H
9
5e244469
RW
10#ifdef __cplusplus
11extern "C" {
12#endif
13
814e24c4
DS
14struct pltrie_table;
15
e92508a7
DS
16PREDECL_RBTREE_UNIQ(plist);
17
d62a17ae 18struct prefix_list {
19 char *name;
20 char *desc;
814e24c4 21
d62a17ae 22 struct prefix_master *master;
814e24c4 23
d62a17ae 24 int count;
25 int rangecount;
814e24c4 26
e92508a7
DS
27 struct plist_item plist_item;
28
d62a17ae 29 struct prefix_list_entry *head;
30 struct prefix_list_entry *tail;
814e24c4 31
d62a17ae 32 struct pltrie_table *trie;
814e24c4
DS
33};
34
35/* Each prefix-list's entry. */
d62a17ae 36struct prefix_list_entry {
24512fbd 37 int64_t seq;
814e24c4 38
d62a17ae 39 int le;
40 int ge;
814e24c4 41
d62a17ae 42 enum prefix_list_type type;
814e24c4 43
d3f6c580 44 bool any;
d62a17ae 45 struct prefix prefix;
814e24c4 46
d62a17ae 47 unsigned long refcnt;
48 unsigned long hitcnt;
814e24c4 49
2fb71798
RZ
50 struct prefix_list *pl;
51
d62a17ae 52 struct prefix_list_entry *next;
53 struct prefix_list_entry *prev;
814e24c4 54
d62a17ae 55 /* up the chain for best match search */
56 struct prefix_list_entry *next_best;
a7b28218
RZ
57
58 /* Flag to track trie/list installation status. */
59 bool installed;
814e24c4
DS
60};
61
a7b28218 62extern void prefix_list_entry_free(struct prefix_list_entry *pentry);
81b50422 63extern void prefix_list_entry_delete2(struct prefix_list_entry *ple);
a7b28218
RZ
64extern void prefix_list_entry_update_start(struct prefix_list_entry *ple);
65extern void prefix_list_entry_update_finish(struct prefix_list_entry *ple);
66
5e244469
RW
67#ifdef __cplusplus
68}
69#endif
70
814e24c4 71#endif /* _QUAGGA_PLIST_INT_H */