2 * Copyright (C) 2003 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.
22 #ifndef OSPF6_INTERFACE_H
23 #define OSPF6_INTERFACE_H
28 extern unsigned char conf_debug_ospf6_interface
;
29 #define OSPF6_DEBUG_INTERFACE_ON() \
30 (conf_debug_ospf6_interface = 1)
31 #define OSPF6_DEBUG_INTERFACE_OFF() \
32 (conf_debug_ospf6_interface = 0)
33 #define IS_OSPF6_DEBUG_INTERFACE \
34 (conf_debug_ospf6_interface)
36 /* Interface structure */
37 struct ospf6_interface
39 /* IF info from zebra */
40 struct interface
*interface
;
43 struct ospf6_area
*area
;
45 /* list of ospf6 neighbor */
46 struct list
*neighbor_list
;
48 /* linklocal address of this I/F */
49 struct in6_addr
*linklocal_addr
;
51 /* Interface ID; use interface->ifindex */
53 /* ospf6 instance id */
56 /* I/F transmission delay */
63 u_int16_t hello_interval
;
64 u_int16_t dead_interval
;
65 u_int32_t rxmt_interval
;
76 /* OSPF6 Interface flag */
79 /* Decision of DR Election */
82 u_int32_t prev_drouter
;
83 u_int32_t prev_bdrouter
;
85 /* Linklocal LSA Database: includes Link-LSA */
86 struct ospf6_lsdb
*lsdb
;
87 struct ospf6_lsdb
*lsdb_self
;
89 struct ospf6_lsdb
*lsupdate_list
;
90 struct ospf6_lsdb
*lsack_list
;
93 struct thread
*thread_send_hello
;
94 struct thread
*thread_send_lsupdate
;
95 struct thread
*thread_send_lsack
;
97 struct thread
*thread_network_lsa
;
98 struct thread
*thread_link_lsa
;
99 struct thread
*thread_intra_prefix_lsa
;
101 struct ospf6_route_table
*route_connected
;
103 /* prefix-list name to filter connected prefix */
107 /* interface state */
108 #define OSPF6_INTERFACE_NONE 0
109 #define OSPF6_INTERFACE_DOWN 1
110 #define OSPF6_INTERFACE_LOOPBACK 2
111 #define OSPF6_INTERFACE_WAITING 3
112 #define OSPF6_INTERFACE_POINTTOPOINT 4
113 #define OSPF6_INTERFACE_DROTHER 5
114 #define OSPF6_INTERFACE_BDR 6
115 #define OSPF6_INTERFACE_DR 7
116 #define OSPF6_INTERFACE_MAX 8
118 extern const char *ospf6_interface_state_str
[];
121 #define OSPF6_INTERFACE_DISABLE 0x01
122 #define OSPF6_INTERFACE_PASSIVE 0x02
125 /* Function Prototypes */
127 extern struct ospf6_interface
*ospf6_interface_lookup_by_ifindex (int);
128 extern struct ospf6_interface
*ospf6_interface_create (struct interface
*);
129 extern void ospf6_interface_delete (struct ospf6_interface
*);
131 extern void ospf6_interface_enable (struct ospf6_interface
*);
132 extern void ospf6_interface_disable (struct ospf6_interface
*);
134 extern void ospf6_interface_if_add (struct interface
*);
135 extern void ospf6_interface_if_del (struct interface
*);
136 extern void ospf6_interface_state_update (struct interface
*);
137 extern void ospf6_interface_connected_route_update (struct interface
*);
139 /* interface event */
140 extern int interface_up (struct thread
*);
141 extern int interface_down (struct thread
*);
142 extern int wait_timer (struct thread
*);
143 extern int backup_seen (struct thread
*);
144 extern int neighbor_change (struct thread
*);
146 extern void ospf6_interface_init (void);
148 extern int config_write_ospf6_debug_interface (struct vty
*vty
);
149 extern void install_element_ospf6_debug_interface (void);
151 #endif /* OSPF6_INTERFACE_H */