]>
Commit | Line | Data |
---|---|---|
718e3744 | 1 | /* |
508e53e2 | 2 | * Copyright (C) 2003 Yasuhiro Ohara |
718e3744 | 3 | * |
4 | * This file is part of GNU Zebra. | |
5 | * | |
6 | * GNU Zebra is free software; you can redistribute it and/or modify it | |
7 | * under the terms of the GNU General Public License as published by the | |
8 | * Free Software Foundation; either version 2, or (at your option) any | |
9 | * later version. | |
10 | * | |
11 | * GNU Zebra is distributed in the hope that it will be useful, but | |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | * General Public License for more details. | |
15 | * | |
896014f4 DL |
16 | * You should have received a copy of the GNU General Public License along |
17 | * with this program; see the file COPYING; if not, write to the Free Software | |
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
718e3744 | 19 | */ |
20 | ||
21 | #ifndef OSPF6_LSDB_H | |
22 | #define OSPF6_LSDB_H | |
23 | ||
24 | #include "prefix.h" | |
25 | #include "table.h" | |
c3c0ac83 | 26 | #include "ospf6_route.h" |
718e3744 | 27 | |
718e3744 | 28 | struct ospf6_lsdb |
29 | { | |
6452df09 | 30 | void *data; /* data structure that holds this lsdb */ |
718e3744 | 31 | struct route_table *table; |
32 | u_int32_t count; | |
508e53e2 | 33 | void (*hook_add) (struct ospf6_lsa *); |
34 | void (*hook_remove) (struct ospf6_lsa *); | |
718e3744 | 35 | }; |
36 | ||
718e3744 | 37 | /* Function Prototypes */ |
6ac29a51 PJ |
38 | extern struct ospf6_lsdb *ospf6_lsdb_create (void *data); |
39 | extern void ospf6_lsdb_delete (struct ospf6_lsdb *lsdb); | |
718e3744 | 40 | |
6ac29a51 PJ |
41 | extern struct ospf6_lsa *ospf6_lsdb_lookup (u_int16_t type, u_int32_t id, |
42 | u_int32_t adv_router, | |
43 | struct ospf6_lsdb *lsdb); | |
44 | extern struct ospf6_lsa *ospf6_lsdb_lookup_next (u_int16_t type, u_int32_t id, | |
45 | u_int32_t adv_router, | |
46 | struct ospf6_lsdb *lsdb); | |
718e3744 | 47 | |
6ac29a51 PJ |
48 | extern void ospf6_lsdb_add (struct ospf6_lsa *lsa, struct ospf6_lsdb *lsdb); |
49 | extern void ospf6_lsdb_remove (struct ospf6_lsa *lsa, struct ospf6_lsdb *lsdb); | |
718e3744 | 50 | |
6ac29a51 PJ |
51 | extern struct ospf6_lsa *ospf6_lsdb_head (struct ospf6_lsdb *lsdb); |
52 | extern struct ospf6_lsa *ospf6_lsdb_next (struct ospf6_lsa *lsa); | |
49dd8e37 DL |
53 | #define ALL_LSDB(lsdb, lsa) \ |
54 | lsa = ospf6_lsdb_head(lsdb); lsa; \ | |
55 | lsa = ospf6_lsdb_next(lsa) | |
718e3744 | 56 | |
6ac29a51 | 57 | extern struct ospf6_lsa *ospf6_lsdb_type_router_head (u_int16_t type, |
508e53e2 | 58 | u_int32_t adv_router, |
59 | struct ospf6_lsdb *lsdb); | |
6ac29a51 | 60 | extern struct ospf6_lsa *ospf6_lsdb_type_router_next (u_int16_t type, |
508e53e2 | 61 | u_int32_t adv_router, |
62 | struct ospf6_lsa *lsa); | |
49dd8e37 DL |
63 | #define ALL_LSDB_TYPED_ADVRTR(lsdb, type, adv_router, lsa) \ |
64 | lsa = ospf6_lsdb_type_router_head(type, adv_router, lsdb); lsa; \ | |
65 | lsa = ospf6_lsdb_type_router_next(type, adv_router, lsa) | |
508e53e2 | 66 | |
6ac29a51 PJ |
67 | extern struct ospf6_lsa *ospf6_lsdb_type_head (u_int16_t type, |
68 | struct ospf6_lsdb *lsdb); | |
69 | extern struct ospf6_lsa *ospf6_lsdb_type_next (u_int16_t type, | |
70 | struct ospf6_lsa *lsa); | |
49dd8e37 DL |
71 | #define ALL_LSDB_TYPED(lsdb, type, lsa) \ |
72 | lsa = ospf6_lsdb_type_head(type, lsdb); lsa; \ | |
73 | lsa = ospf6_lsdb_type_next(type, lsa) | |
718e3744 | 74 | |
6ac29a51 | 75 | extern void ospf6_lsdb_remove_all (struct ospf6_lsdb *lsdb); |
a765eb93 | 76 | extern void ospf6_lsdb_lsa_unlock (struct ospf6_lsa *lsa); |
718e3744 | 77 | |
f58c5fbd PJ |
78 | enum ospf_lsdb_show_level { |
79 | OSPF6_LSDB_SHOW_LEVEL_NORMAL = 0, | |
80 | OSPF6_LSDB_SHOW_LEVEL_DETAIL, | |
81 | OSPF6_LSDB_SHOW_LEVEL_INTERNAL, | |
82 | OSPF6_LSDB_SHOW_LEVEL_DUMP, | |
83 | }; | |
049207c3 | 84 | |
f58c5fbd PJ |
85 | extern void ospf6_lsdb_show (struct vty *vty, |
86 | enum ospf_lsdb_show_level level, u_int16_t *type, | |
6ac29a51 PJ |
87 | u_int32_t *id, u_int32_t *adv_router, |
88 | struct ospf6_lsdb *lsdb); | |
718e3744 | 89 | |
6ac29a51 PJ |
90 | extern u_int32_t ospf6_new_ls_id (u_int16_t type, u_int32_t adv_router, |
91 | struct ospf6_lsdb *lsdb); | |
92 | extern u_int32_t ospf6_new_ls_seqnum (u_int16_t type, u_int32_t id, | |
93 | u_int32_t adv_router, | |
94 | struct ospf6_lsdb *lsdb); | |
a765eb93 | 95 | extern int ospf6_lsdb_maxage_remover (struct ospf6_lsdb *lsdb); |
718e3744 | 96 | |
97 | #endif /* OSPF6_LSDB_H */ |