2 * Copyright (C) 2001 Yasuhiro Ohara
4 * This file is part of GNU Zebra.
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
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.
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.
25 #include "ospf6_dump.h"
29 struct ospf6_hook
*prev
;
30 struct ospf6_hook
*next
;
33 int (*hook_add
) (void *);
34 int (*hook_change
) (void *);
35 int (*hook_remove
) (void *);
38 struct ospf6_hook_master
41 struct ospf6_hook
*head
;
42 struct ospf6_hook
*tail
;
46 #define CALL_HOOKS(master,hookname,hookstr,data) \
48 struct ospf6_hook *hook;\
49 for (hook = (master)->head; hook; hook = hook->next)\
53 if (IS_OSPF6_DUMP_HOOK)\
54 zlog_info ("HOOK: Call %s hook: %s", (hookstr), hook->name);\
55 (*(hook->hookname)) (data);\
59 #define CALL_ADD_HOOK(master,data) \
60 { CALL_HOOKS ((master), hook_add, "ADD", (data)) }
61 #define CALL_CHANGE_HOOK(master,data) \
62 { CALL_HOOKS ((master), hook_change, "CHANGE", (data)) }
63 #define CALL_REMOVE_HOOK(master,data) \
64 { CALL_HOOKS ((master), hook_remove, "REMOVE", (data)) }
66 #define IS_HOOK_SET(hook) \
67 ((hook)->hook_add || (hook)->hook_change || (hook)->hook_remove)
69 extern struct ospf6_hook_master neighbor_hook
;
70 extern struct ospf6_hook_master interface_hook
;
71 extern struct ospf6_hook_master area_hook
;
72 extern struct ospf6_hook_master top_hook
;
73 extern struct ospf6_hook_master database_hook
;
74 extern struct ospf6_hook_master intra_topology_hook
;
75 extern struct ospf6_hook_master inter_topology_hook
;
76 extern struct ospf6_hook_master route_hook
;
77 extern struct ospf6_hook_master redistribute_hook
;
79 void ospf6_hook_register (struct ospf6_hook
*,
80 struct ospf6_hook_master
*);
81 void ospf6_hook_unregister (struct ospf6_hook
*,
82 struct ospf6_hook_master
*);
83 void ospf6_hook_unregister_all (struct ospf6_hook_master
*);
84 void ospf6_hook_init ();
86 #endif /*OSPF6_HOOK_H*/