]>
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 | * | |
16 | * You should have received a copy of the GNU General Public License | |
17 | * along with GNU Zebra; see the file COPYING. If not, write to the | |
18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
19 | * Boston, MA 02111-1307, USA. | |
20 | */ | |
21 | ||
22 | #ifndef OSPF6_LSDB_H | |
23 | #define OSPF6_LSDB_H | |
24 | ||
25 | #include "prefix.h" | |
26 | #include "table.h" | |
c3c0ac83 | 27 | #include "ospf6_route.h" |
718e3744 | 28 | |
718e3744 | 29 | struct ospf6_lsdb |
30 | { | |
6452df09 | 31 | void *data; /* data structure that holds this lsdb */ |
718e3744 | 32 | struct route_table *table; |
33 | u_int32_t count; | |
508e53e2 | 34 | void (*hook_add) (struct ospf6_lsa *); |
35 | void (*hook_remove) (struct ospf6_lsa *); | |
718e3744 | 36 | }; |
37 | ||
718e3744 | 38 | /* Function Prototypes */ |
6ac29a51 PJ |
39 | extern struct ospf6_lsdb *ospf6_lsdb_create (void *data); |
40 | extern void ospf6_lsdb_delete (struct ospf6_lsdb *lsdb); | |
718e3744 | 41 | |
6ac29a51 PJ |
42 | extern struct ospf6_lsa *ospf6_lsdb_lookup (u_int16_t type, u_int32_t id, |
43 | u_int32_t adv_router, | |
44 | struct ospf6_lsdb *lsdb); | |
45 | extern struct ospf6_lsa *ospf6_lsdb_lookup_next (u_int16_t type, u_int32_t id, | |
46 | u_int32_t adv_router, | |
47 | struct ospf6_lsdb *lsdb); | |
718e3744 | 48 | |
6ac29a51 PJ |
49 | extern void ospf6_lsdb_add (struct ospf6_lsa *lsa, struct ospf6_lsdb *lsdb); |
50 | extern void ospf6_lsdb_remove (struct ospf6_lsa *lsa, struct ospf6_lsdb *lsdb); | |
718e3744 | 51 | |
6ac29a51 PJ |
52 | extern struct ospf6_lsa *ospf6_lsdb_head (struct ospf6_lsdb *lsdb); |
53 | extern struct ospf6_lsa *ospf6_lsdb_next (struct ospf6_lsa *lsa); | |
718e3744 | 54 | |
6ac29a51 | 55 | extern struct ospf6_lsa *ospf6_lsdb_type_router_head (u_int16_t type, |
508e53e2 | 56 | u_int32_t adv_router, |
57 | struct ospf6_lsdb *lsdb); | |
6ac29a51 | 58 | extern struct ospf6_lsa *ospf6_lsdb_type_router_next (u_int16_t type, |
508e53e2 | 59 | u_int32_t adv_router, |
60 | struct ospf6_lsa *lsa); | |
61 | ||
6ac29a51 PJ |
62 | extern struct ospf6_lsa *ospf6_lsdb_type_head (u_int16_t type, |
63 | struct ospf6_lsdb *lsdb); | |
64 | extern struct ospf6_lsa *ospf6_lsdb_type_next (u_int16_t type, | |
65 | struct ospf6_lsa *lsa); | |
718e3744 | 66 | |
6ac29a51 | 67 | extern void ospf6_lsdb_remove_all (struct ospf6_lsdb *lsdb); |
a765eb93 | 68 | extern void ospf6_lsdb_lsa_unlock (struct ospf6_lsa *lsa); |
718e3744 | 69 | |
049207c3 | 70 | #define OSPF6_LSDB_SHOW_LEVEL_NORMAL 0 |
71 | #define OSPF6_LSDB_SHOW_LEVEL_DETAIL 1 | |
72 | #define OSPF6_LSDB_SHOW_LEVEL_INTERNAL 2 | |
73 | #define OSPF6_LSDB_SHOW_LEVEL_DUMP 3 | |
74 | ||
6ac29a51 PJ |
75 | extern void ospf6_lsdb_show (struct vty *vty, int level, u_int16_t *type, |
76 | u_int32_t *id, u_int32_t *adv_router, | |
77 | struct ospf6_lsdb *lsdb); | |
718e3744 | 78 | |
6ac29a51 PJ |
79 | extern u_int32_t ospf6_new_ls_id (u_int16_t type, u_int32_t adv_router, |
80 | struct ospf6_lsdb *lsdb); | |
c3c0ac83 DS |
81 | extern u_int32_t ospf6_new_range_ls_id (struct ospf6_route_table *range_table); |
82 | extern void ospf6_release_range_ls_id (struct ospf6_route_table *range_table, | |
83 | u_int32_t id); | |
6ac29a51 PJ |
84 | extern u_int32_t ospf6_new_ls_seqnum (u_int16_t type, u_int32_t id, |
85 | u_int32_t adv_router, | |
86 | struct ospf6_lsdb *lsdb); | |
a765eb93 | 87 | extern int ospf6_lsdb_maxage_remover (struct ospf6_lsdb *lsdb); |
718e3744 | 88 | |
89 | #endif /* OSPF6_LSDB_H */ |