1/* BGP routing table
2   Copyright (C) 1998, 2001 Kunihiro Ishiguro
3
4This file is part of GNU Zebra.
5
6GNU Zebra is free software; you can redistribute it and/or modify it
7under the terms of the GNU General Public License as published by the
8Free Software Foundation; either version 2, or (at your option) any
9later version.
10
11GNU Zebra is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Zebra; see the file COPYING.  If not, write to the Free
18Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1902111-1307, USA.  */
20
21struct bgp_table
22{
23  struct bgp_node *top;
24};
25
26struct bgp_node
27{
28  struct prefix p;
29
30  struct bgp_table *table;
31  struct bgp_node *parent;
32  struct bgp_node *link[2];
33#define l_left   link[0]
34#define l_right  link[1]
35
36  unsigned int lock;
37
38  void *info;
39
40  struct bgp_adj_out *adj_out;
41
42  struct bgp_adj_in *adj_in;
43
44  void *aggregate;
45
46  struct bgp_node *prn;
47};
48
49struct bgp_table *bgp_table_init (void);
50void bgp_table_finish (struct bgp_table *);
51void bgp_unlock_node (struct bgp_node *node);
52void bgp_node_delete (struct bgp_node *node);
53struct bgp_node *bgp_table_top (struct bgp_table *);
54struct bgp_node *bgp_route_next (struct bgp_node *);
55struct bgp_node *bgp_route_next_until (struct bgp_node *, struct bgp_node *);
56struct bgp_node *bgp_node_get (struct bgp_table *, struct prefix *);
57struct bgp_node *bgp_node_lookup (struct bgp_table *, struct prefix *);
58struct bgp_node *bgp_lock_node (struct bgp_node *node);
59struct bgp_node *bgp_node_match (struct bgp_table *, struct prefix *);
60struct bgp_node *bgp_node_match_ipv4 (struct bgp_table *,
61					  struct in_addr *);
62#ifdef HAVE_IPV6
63struct bgp_node *bgp_node_match_ipv6 (struct bgp_table *,
64					  struct in6_addr *);
65#endif /* HAVE_IPV6 */
66