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