blob: 425f6153769e438e24424f22d02d8ae98f9ae05e [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/*
hasso508e53e2004-05-18 18:57:06 +00002 * Copyright (C) 2003 Yasuhiro Ohara
paul718e3742002-12-13 20:15:29 +00003 *
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"
27
paul718e3742002-12-13 20:15:29 +000028struct ospf6_lsdb
29{
hasso6452df02004-08-15 05:52:07 +000030 void *data; /* data structure that holds this lsdb */
paul718e3742002-12-13 20:15:29 +000031 struct route_table *table;
32 u_int32_t count;
hasso508e53e2004-05-18 18:57:06 +000033 void (*hook_add) (struct ospf6_lsa *);
34 void (*hook_remove) (struct ospf6_lsa *);
paul718e3742002-12-13 20:15:29 +000035};
36
paul718e3742002-12-13 20:15:29 +000037/* Function Prototypes */
Paul Jakma6ac29a52008-08-15 13:45:30 +010038extern struct ospf6_lsdb *ospf6_lsdb_create (void *data);
39extern void ospf6_lsdb_delete (struct ospf6_lsdb *lsdb);
paul718e3742002-12-13 20:15:29 +000040
Paul Jakma6ac29a52008-08-15 13:45:30 +010041extern 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);
44extern 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);
paul718e3742002-12-13 20:15:29 +000047
Paul Jakma6ac29a52008-08-15 13:45:30 +010048extern void ospf6_lsdb_add (struct ospf6_lsa *lsa, struct ospf6_lsdb *lsdb);
49extern void ospf6_lsdb_remove (struct ospf6_lsa *lsa, struct ospf6_lsdb *lsdb);
hasso508e53e2004-05-18 18:57:06 +000050
Paul Jakma6ac29a52008-08-15 13:45:30 +010051extern struct ospf6_lsa *ospf6_lsdb_head (struct ospf6_lsdb *lsdb);
52extern struct ospf6_lsa *ospf6_lsdb_next (struct ospf6_lsa *lsa);
hasso508e53e2004-05-18 18:57:06 +000053
Paul Jakma6ac29a52008-08-15 13:45:30 +010054extern struct ospf6_lsa *ospf6_lsdb_type_router_head (u_int16_t type,
hasso508e53e2004-05-18 18:57:06 +000055 u_int32_t adv_router,
56 struct ospf6_lsdb *lsdb);
Paul Jakma6ac29a52008-08-15 13:45:30 +010057extern struct ospf6_lsa *ospf6_lsdb_type_router_next (u_int16_t type,
hasso508e53e2004-05-18 18:57:06 +000058 u_int32_t adv_router,
59 struct ospf6_lsa *lsa);
60
Paul Jakma6ac29a52008-08-15 13:45:30 +010061extern struct ospf6_lsa *ospf6_lsdb_type_head (u_int16_t type,
62 struct ospf6_lsdb *lsdb);
63extern struct ospf6_lsa *ospf6_lsdb_type_next (u_int16_t type,
64 struct ospf6_lsa *lsa);
hasso508e53e2004-05-18 18:57:06 +000065
Paul Jakma6ac29a52008-08-15 13:45:30 +010066extern void ospf6_lsdb_remove_all (struct ospf6_lsdb *lsdb);
Dinesh Dutta765eb92013-08-24 07:55:14 +000067extern void ospf6_lsdb_lsa_unlock (struct ospf6_lsa *lsa);
paul718e3742002-12-13 20:15:29 +000068
Paul Jakma7bef33c2014-09-19 15:35:15 +010069enum ospf_lsdb_show_level {
70 OSPF6_LSDB_SHOW_LEVEL_NORMAL = 0,
71 OSPF6_LSDB_SHOW_LEVEL_DETAIL,
72 OSPF6_LSDB_SHOW_LEVEL_INTERNAL,
73 OSPF6_LSDB_SHOW_LEVEL_DUMP,
74};
paul718e3742002-12-13 20:15:29 +000075
Paul Jakma7bef33c2014-09-19 15:35:15 +010076extern void ospf6_lsdb_show (struct vty *vty,
77 enum ospf_lsdb_show_level level, u_int16_t *type,
Paul Jakma6ac29a52008-08-15 13:45:30 +010078 u_int32_t *id, u_int32_t *adv_router,
79 struct ospf6_lsdb *lsdb);
hasso049207c2004-08-04 20:02:13 +000080
Paul Jakma6ac29a52008-08-15 13:45:30 +010081extern u_int32_t ospf6_new_ls_id (u_int16_t type, u_int32_t adv_router,
82 struct ospf6_lsdb *lsdb);
83extern u_int32_t ospf6_new_ls_seqnum (u_int16_t type, u_int32_t id,
84 u_int32_t adv_router,
85 struct ospf6_lsdb *lsdb);
Dinesh Dutta765eb92013-08-24 07:55:14 +000086extern int ospf6_lsdb_maxage_remover (struct ospf6_lsdb *lsdb);
paul718e3742002-12-13 20:15:29 +000087
88#endif /* OSPF6_LSDB_H */