[lib] remove autogenerated file, update .cvsignore
[jleu-quagga.git] / lib / table.h
blob45ec606793c95e770593cd4b7b89f3a210b849ab
1 /*
2 * Routing Table
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
10 * later version.
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
20 * 02111-1307, USA.
23 #ifndef _ZEBRA_TABLE_H
24 #define _ZEBRA_TABLE_H
26 /* Routing table top structure. */
27 struct route_table
29 struct route_node *top;
32 /* Each routing entry. */
33 struct route_node
35 /* Actual prefix of this radix. */
36 struct prefix p;
38 /* Tree link. */
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 */
46 unsigned int lock;
48 /* Each node of route. */
49 void *info;
51 /* Aggregation. */
52 void *aggregate;
55 /* Prototypes. */
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 *,
63 struct route_node *);
64 extern struct route_node *route_node_get (struct route_table *,
65 struct prefix *);
66 extern struct route_node *route_node_lookup (struct route_table *,
67 struct prefix *);
68 extern struct route_node *route_lock_node (struct route_node *node);
69 extern struct route_node *route_node_match (struct route_table *,
70 struct prefix *);
71 extern struct route_node *route_node_match_ipv4 (struct route_table *,
72 struct in_addr *);
73 #ifdef HAVE_IPV6
74 extern struct route_node *route_node_match_ipv6 (struct route_table *,
75 struct in6_addr *);
76 #endif /* HAVE_IPV6 */
78 #endif /* _ZEBRA_TABLE_H */