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