]> git.proxmox.com Git - mirror_frr.git/blob - ospf6d/ospf6_interface.h
isisd: The RFC states that v6 addresses are limited to 16 in a hello packet
[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 uint8_t instance_id;
52
53 /* I/F transmission delay */
54 uint32_t transdelay;
55
56 /* Network Type */
57 uint8_t type;
58
59 /* Router Priority */
60 uint8_t priority;
61
62 /* Time Interval */
63 uint16_t hello_interval;
64 uint16_t dead_interval;
65 uint32_t rxmt_interval;
66
67 uint32_t state_change;
68
69 /* Cost */
70 uint32_t cost;
71
72 /* I/F MTU */
73 uint32_t ifmtu;
74
75 /* Configured MTU */
76 uint32_t c_ifmtu;
77
78 /* Interface State */
79 uint8_t state;
80
81 /* Interface socket setting trial counter, resets on success */
82 uint8_t sso_try_cnt;
83 struct thread *thread_sso;
84
85 /* OSPF6 Interface flag */
86 char flag;
87
88 /* MTU mismatch check */
89 uint8_t mtu_ignore;
90
91 /* Decision of DR Election */
92 uint32_t drouter;
93 uint32_t bdrouter;
94 uint32_t prev_drouter;
95 uint32_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 struct thread *thread_as_extern_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 /* Statistics Fields */
123 uint32_t hello_in;
124 uint32_t hello_out;
125 uint32_t db_desc_in;
126 uint32_t db_desc_out;
127 uint32_t ls_req_in;
128 uint32_t ls_req_out;
129 uint32_t ls_upd_in;
130 uint32_t ls_upd_out;
131 uint32_t ls_ack_in;
132 uint32_t ls_ack_out;
133 uint32_t discarded;
134
135 QOBJ_FIELDS
136 };
137 DECLARE_QOBJ_TYPE(ospf6_interface)
138
139 /* interface state */
140 #define OSPF6_INTERFACE_NONE 0
141 #define OSPF6_INTERFACE_DOWN 1
142 #define OSPF6_INTERFACE_LOOPBACK 2
143 #define OSPF6_INTERFACE_WAITING 3
144 #define OSPF6_INTERFACE_POINTTOPOINT 4
145 #define OSPF6_INTERFACE_DROTHER 5
146 #define OSPF6_INTERFACE_BDR 6
147 #define OSPF6_INTERFACE_DR 7
148 #define OSPF6_INTERFACE_MAX 8
149
150 extern const char *ospf6_interface_state_str[];
151
152 /* flags */
153 #define OSPF6_INTERFACE_DISABLE 0x01
154 #define OSPF6_INTERFACE_PASSIVE 0x02
155 #define OSPF6_INTERFACE_NOAUTOCOST 0x04
156
157 /* default values */
158 #define OSPF6_INTERFACE_HELLO_INTERVAL 10
159 #define OSPF6_INTERFACE_DEAD_INTERVAL 40
160 #define OSPF6_INTERFACE_RXMT_INTERVAL 5
161 #define OSPF6_INTERFACE_COST 1
162 #define OSPF6_INTERFACE_PRIORITY 1
163 #define OSPF6_INTERFACE_TRANSDELAY 1
164 #define OSPF6_INTERFACE_INSTANCE_ID 0
165 #define OSPF6_INTERFACE_BANDWIDTH 10000 /* Mbps */
166 #define OSPF6_REFERENCE_BANDWIDTH 100000 /* Mbps */
167 #define OSPF6_INTERFACE_SSO_RETRY_INT 1
168 #define OSPF6_INTERFACE_SSO_RETRY_MAX 5
169
170 /* Function Prototypes */
171
172 extern struct ospf6_interface *ospf6_interface_lookup_by_ifindex(ifindex_t);
173 extern struct ospf6_interface *ospf6_interface_create(struct interface *);
174 extern void ospf6_interface_delete(struct ospf6_interface *);
175
176 extern void ospf6_interface_enable(struct ospf6_interface *);
177 extern void ospf6_interface_disable(struct ospf6_interface *);
178
179 extern void ospf6_interface_if_add(struct interface *);
180 extern void ospf6_interface_state_update(struct interface *);
181 extern void ospf6_interface_connected_route_update(struct interface *);
182
183 /* interface event */
184 extern int interface_up(struct thread *);
185 extern int interface_down(struct thread *);
186 extern int wait_timer(struct thread *);
187 extern int backup_seen(struct thread *);
188 extern int neighbor_change(struct thread *);
189
190 extern void ospf6_interface_init(void);
191
192 extern void install_element_ospf6_clear_interface(void);
193
194 extern int config_write_ospf6_debug_interface(struct vty *vty);
195 extern void install_element_ospf6_debug_interface(void);
196
197 DECLARE_HOOK(ospf6_interface_change,
198 (struct ospf6_interface * oi, int state, int old_state),
199 (oi, state, old_state))
200
201 #endif /* OSPF6_INTERFACE_H */