3 * Copyright (C) 1998 Kunihiro Ishiguro
5 * This file is part of GNU Zebra.
7 * GNU Zebra is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
12 * GNU Zebra is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Zebra; see the file COPYING. If not, write to the Free
19 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23 #ifndef _ZEBRA_TABLE_H
24 #define _ZEBRA_TABLE_H
26 /* Routing table top structure. */
29 struct route_node
*top
;
32 /* Each routing entry. */
35 /* Actual prefix of this radix. */
39 struct route_table
*table
;
40 struct route_node
*parent
;
41 struct route_node
*link
[2];
42 #define l_left link[0]
43 #define l_right link[1]
45 /* Lock of this radix */
48 /* Each node of route. */
56 extern struct route_table
*route_table_init (void);
57 extern void route_table_finish (struct route_table
*);
58 extern void route_unlock_node (struct route_node
*node
);
59 extern void route_node_delete (struct route_node
*node
);
60 extern struct route_node
*route_top (struct route_table
*);
61 extern struct route_node
*route_next (struct route_node
*);
62 extern struct route_node
*route_next_until (struct route_node
*,
64 extern struct route_node
*route_node_get (struct route_table
*,
66 extern struct route_node
*route_node_lookup (struct route_table
*,
68 extern struct route_node
*route_lock_node (struct route_node
*node
);
69 extern struct route_node
*route_node_match (struct route_table
*,
71 extern struct route_node
*route_node_match_ipv4 (struct route_table
*,
74 extern struct route_node
*route_node_match_ipv6 (struct route_table
*,
76 #endif /* HAVE_IPV6 */
78 #endif /* _ZEBRA_TABLE_H */