]> git.proxmox.com Git - mirror_frr.git/blob - ospf6d/ospf6_interface.h
Merge branch 'master' into pim_5549
[mirror_frr.git] / ospf6d / ospf6_interface.h
1 /*
2 * Copyright (C) 2003 Yasuhiro Ohara
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_INTERFACE_H
23 #define OSPF6_INTERFACE_H
24
25 #include "qobj.h"
26 #include "hook.h"
27 #include "if.h"
28
29 /* Debug option */
30 extern unsigned char conf_debug_ospf6_interface;
31 #define OSPF6_DEBUG_INTERFACE_ON() \
32 (conf_debug_ospf6_interface = 1)
33 #define OSPF6_DEBUG_INTERFACE_OFF() \
34 (conf_debug_ospf6_interface = 0)
35 #define IS_OSPF6_DEBUG_INTERFACE \
36 (conf_debug_ospf6_interface)
37
38 /* Interface structure */
39 struct ospf6_interface
40 {
41 /* IF info from zebra */
42 struct interface *interface;
43
44 /* back pointer */
45 struct ospf6_area *area;
46
47 /* list of ospf6 neighbor */
48 struct list *neighbor_list;
49
50 /* linklocal address of this I/F */
51 struct in6_addr *linklocal_addr;
52
53 /* Interface ID; use interface->ifindex */
54
55 /* ospf6 instance id */
56 u_char instance_id;
57
58 /* I/F transmission delay */
59 u_int32_t transdelay;
60
61 /* Network Type */
62 u_char type;
63
64 /* Router Priority */
65 u_char priority;
66
67 /* Time Interval */
68 u_int16_t hello_interval;
69 u_int16_t dead_interval;
70 u_int32_t rxmt_interval;
71
72 u_int32_t state_change;
73
74 /* Cost */
75 u_int32_t cost;
76
77 /* I/F MTU */
78 u_int32_t ifmtu;
79
80 /* Interface State */
81 u_char state;
82
83 /* Interface socket setting trial counter, resets on success */
84 u_char sso_try_cnt;
85
86 /* OSPF6 Interface flag */
87 char flag;
88
89 /* MTU mismatch check */
90 u_char mtu_ignore;
91
92 /* Decision of DR Election */
93 u_int32_t drouter;
94 u_int32_t bdrouter;
95 u_int32_t prev_drouter;
96 u_int32_t prev_bdrouter;
97
98 /* Linklocal LSA Database: includes Link-LSA */
99 struct ospf6_lsdb *lsdb;
100 struct ospf6_lsdb *lsdb_self;
101
102 struct ospf6_lsdb *lsupdate_list;
103 struct ospf6_lsdb *lsack_list;
104
105 /* Ongoing Tasks */
106 struct thread *thread_send_hello;
107 struct thread *thread_send_lsupdate;
108 struct thread *thread_send_lsack;
109
110 struct thread *thread_network_lsa;
111 struct thread *thread_link_lsa;
112 struct thread *thread_intra_prefix_lsa;
113
114 struct ospf6_route_table *route_connected;
115
116 /* prefix-list name to filter connected prefix */
117 char *plist_name;
118
119 /* BFD information */
120 void *bfd_info;
121
122 QOBJ_FIELDS
123 };
124 DECLARE_QOBJ_TYPE(ospf6_interface)
125
126 /* interface state */
127 #define OSPF6_INTERFACE_NONE 0
128 #define OSPF6_INTERFACE_DOWN 1
129 #define OSPF6_INTERFACE_LOOPBACK 2
130 #define OSPF6_INTERFACE_WAITING 3
131 #define OSPF6_INTERFACE_POINTTOPOINT 4
132 #define OSPF6_INTERFACE_DROTHER 5
133 #define OSPF6_INTERFACE_BDR 6
134 #define OSPF6_INTERFACE_DR 7
135 #define OSPF6_INTERFACE_MAX 8
136
137 extern const char *ospf6_interface_state_str[];
138
139 /* flags */
140 #define OSPF6_INTERFACE_DISABLE 0x01
141 #define OSPF6_INTERFACE_PASSIVE 0x02
142 #define OSPF6_INTERFACE_NOAUTOCOST 0x04
143
144 /* default values */
145 #define OSPF6_INTERFACE_HELLO_INTERVAL 10
146 #define OSPF6_INTERFACE_DEAD_INTERVAL 40
147 #define OSPF6_INTERFACE_RXMT_INTERVAL 5
148 #define OSPF6_INTERFACE_COST 1
149 #define OSPF6_INTERFACE_PRIORITY 1
150 #define OSPF6_INTERFACE_TRANSDELAY 1
151 #define OSPF6_INTERFACE_INSTANCE_ID 0
152 #define OSPF6_INTERFACE_BANDWIDTH 10000 /* Mbps */
153 #define OSPF6_REFERENCE_BANDWIDTH 100000 /* Mbps */
154 #define OSPF6_INTERFACE_SSO_RETRY_INT 1
155 #define OSPF6_INTERFACE_SSO_RETRY_MAX 5
156
157
158 /* Function Prototypes */
159
160 extern struct ospf6_interface *ospf6_interface_lookup_by_ifindex (ifindex_t);
161 extern struct ospf6_interface *ospf6_interface_create (struct interface *);
162 extern void ospf6_interface_delete (struct ospf6_interface *);
163
164 extern void ospf6_interface_enable (struct ospf6_interface *);
165 extern void ospf6_interface_disable (struct ospf6_interface *);
166
167 extern void ospf6_interface_if_add (struct interface *);
168 extern void ospf6_interface_if_del (struct interface *);
169 extern void ospf6_interface_state_update (struct interface *);
170 extern void ospf6_interface_connected_route_update (struct interface *);
171
172 /* interface event */
173 extern int interface_up (struct thread *);
174 extern int interface_down (struct thread *);
175 extern int wait_timer (struct thread *);
176 extern int backup_seen (struct thread *);
177 extern int neighbor_change (struct thread *);
178
179 extern void ospf6_interface_init (void);
180
181 extern void install_element_ospf6_clear_interface (void);
182
183 extern int config_write_ospf6_debug_interface (struct vty *vty);
184 extern void install_element_ospf6_debug_interface (void);
185
186 DECLARE_HOOK(ospf6_interface_change,
187 (struct ospf6_interface *oi, int state, int old_state),
188 (oi, state, old_state))
189
190 #endif /* OSPF6_INTERFACE_H */