]> git.proxmox.com Git - mirror_frr.git/blame - bgpd/bgp_table.h
[solaris] version depend files, auto-generate. Start zebra when needed.
[mirror_frr.git] / bgpd / bgp_table.h
CommitLineData
718e3744 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
00d252cb 21#ifndef _QUAGGA_BGP_TABLE_H
22#define _QUAGGA_BGP_TABLE_H
23
fee0f4c6 24typedef enum
25{
26 BGP_TABLE_MAIN,
27 BGP_TABLE_RSCLIENT,
28} bgp_table_t;
29
718e3744 30struct bgp_table
31{
fee0f4c6 32 bgp_table_t type;
33
34 /* The owner of this 'bgp_table' structure. */
35 void *owner;
36
718e3744 37 struct bgp_node *top;
38};
39
40struct bgp_node
41{
42 struct prefix p;
43
44 struct bgp_table *table;
45 struct bgp_node *parent;
46 struct bgp_node *link[2];
47#define l_left link[0]
48#define l_right link[1]
49
50 unsigned int lock;
51
52 void *info;
53
54 struct bgp_adj_out *adj_out;
55
56 struct bgp_adj_in *adj_in;
57
58 void *aggregate;
59
60 struct bgp_node *prn;
200df115 61
62 u_char flags;
63#define BGP_NODE_PROCESS_SCHEDULED (1 << 0)
718e3744 64};
65
94f2b392 66extern struct bgp_table *bgp_table_init (void);
67extern void bgp_table_finish (struct bgp_table *);
68extern void bgp_unlock_node (struct bgp_node *node);
69extern void bgp_node_delete (struct bgp_node *node);
70extern struct bgp_node *bgp_table_top (struct bgp_table *);
71extern struct bgp_node *bgp_route_next (struct bgp_node *);
72extern struct bgp_node *bgp_route_next_until (struct bgp_node *, struct bgp_node *);
73extern struct bgp_node *bgp_node_get (struct bgp_table *, struct prefix *);
74extern struct bgp_node *bgp_node_lookup (struct bgp_table *, struct prefix *);
75extern struct bgp_node *bgp_lock_node (struct bgp_node *node);
76extern struct bgp_node *bgp_node_match (struct bgp_table *, struct prefix *);
77extern struct bgp_node *bgp_node_match_ipv4 (struct bgp_table *,
718e3744 78 struct in_addr *);
79#ifdef HAVE_IPV6
94f2b392 80extern struct bgp_node *bgp_node_match_ipv6 (struct bgp_table *,
718e3744 81 struct in6_addr *);
82#endif /* HAVE_IPV6 */
00d252cb 83
84#endif /* _QUAGGA_BGP_TABLE_H */