]>
Commit | Line | Data |
---|---|---|
718e3744 | 1 | /* |
508e53e2 | 2 | * Copyright (C) 2003 Yasuhiro Ohara |
718e3744 | 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 | * | |
896014f4 DL |
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 | |
718e3744 | 19 | */ |
20 | ||
21 | #ifndef OSPF6_INTERFACE_H | |
22 | #define OSPF6_INTERFACE_H | |
23 | ||
ae19c240 | 24 | #include "qobj.h" |
3012671f | 25 | #include "hook.h" |
508e53e2 | 26 | #include "if.h" |
718e3744 | 27 | |
508e53e2 | 28 | /* Debug option */ |
29 | extern unsigned char conf_debug_ospf6_interface; | |
d62a17ae | 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) | |
718e3744 | 33 | |
508e53e2 | 34 | /* Interface structure */ |
d62a17ae | 35 | struct ospf6_interface { |
36 | /* IF info from zebra */ | |
37 | struct interface *interface; | |
718e3744 | 38 | |
d62a17ae | 39 | /* back pointer */ |
40 | struct ospf6_area *area; | |
718e3744 | 41 | |
d62a17ae | 42 | /* list of ospf6 neighbor */ |
43 | struct list *neighbor_list; | |
718e3744 | 44 | |
d62a17ae | 45 | /* linklocal address of this I/F */ |
46 | struct in6_addr *linklocal_addr; | |
718e3744 | 47 | |
d62a17ae | 48 | /* Interface ID; use interface->ifindex */ |
718e3744 | 49 | |
d62a17ae | 50 | /* ospf6 instance id */ |
d7c0a89a | 51 | uint8_t instance_id; |
718e3744 | 52 | |
d62a17ae | 53 | /* I/F transmission delay */ |
d7c0a89a | 54 | uint32_t transdelay; |
718e3744 | 55 | |
d62a17ae | 56 | /* Network Type */ |
d7c0a89a | 57 | uint8_t type; |
5aeb4f3c | 58 | bool type_cfg; |
c5926a92 | 59 | |
d62a17ae | 60 | /* Router Priority */ |
d7c0a89a | 61 | uint8_t priority; |
718e3744 | 62 | |
d62a17ae | 63 | /* Time Interval */ |
d7c0a89a QY |
64 | uint16_t hello_interval; |
65 | uint16_t dead_interval; | |
66 | uint32_t rxmt_interval; | |
718e3744 | 67 | |
d7c0a89a | 68 | uint32_t state_change; |
3bc4f84e | 69 | |
d62a17ae | 70 | /* Cost */ |
d7c0a89a | 71 | uint32_t cost; |
718e3744 | 72 | |
d62a17ae | 73 | /* I/F MTU */ |
d7c0a89a | 74 | uint32_t ifmtu; |
718e3744 | 75 | |
d62a17ae | 76 | /* Configured MTU */ |
d7c0a89a | 77 | uint32_t c_ifmtu; |
0c7ef48a | 78 | |
d62a17ae | 79 | /* Interface State */ |
d7c0a89a | 80 | uint8_t state; |
718e3744 | 81 | |
d62a17ae | 82 | /* Interface socket setting trial counter, resets on success */ |
d7c0a89a | 83 | uint8_t sso_try_cnt; |
f80003b0 | 84 | struct thread *thread_sso; |
8e370bfa | 85 | |
d62a17ae | 86 | /* OSPF6 Interface flag */ |
87 | char flag; | |
718e3744 | 88 | |
d62a17ae | 89 | /* MTU mismatch check */ |
d7c0a89a | 90 | uint8_t mtu_ignore; |
d42306d9 | 91 | |
d62a17ae | 92 | /* Decision of DR Election */ |
858f9c08 DL |
93 | in_addr_t drouter; |
94 | in_addr_t bdrouter; | |
95 | in_addr_t prev_drouter; | |
96 | in_addr_t prev_bdrouter; | |
718e3744 | 97 | |
d62a17ae | 98 | /* Linklocal LSA Database: includes Link-LSA */ |
99 | struct ospf6_lsdb *lsdb; | |
100 | struct ospf6_lsdb *lsdb_self; | |
718e3744 | 101 | |
d62a17ae | 102 | struct ospf6_lsdb *lsupdate_list; |
103 | struct ospf6_lsdb *lsack_list; | |
718e3744 | 104 | |
d62a17ae | 105 | /* Ongoing Tasks */ |
106 | struct thread *thread_send_hello; | |
107 | struct thread *thread_send_lsupdate; | |
108 | struct thread *thread_send_lsack; | |
718e3744 | 109 | |
d62a17ae | 110 | struct thread *thread_network_lsa; |
111 | struct thread *thread_link_lsa; | |
112 | struct thread *thread_intra_prefix_lsa; | |
76249532 | 113 | struct thread *thread_as_extern_lsa; |
9ae41e31 | 114 | struct thread *thread_wait_timer; |
718e3744 | 115 | |
d62a17ae | 116 | struct ospf6_route_table *route_connected; |
718e3744 | 117 | |
d62a17ae | 118 | /* prefix-list name to filter connected prefix */ |
119 | char *plist_name; | |
7f342629 | 120 | |
d62a17ae | 121 | /* BFD information */ |
122 | void *bfd_info; | |
ae19c240 | 123 | |
43855e3d | 124 | /* Statistics Fields */ |
d7c0a89a QY |
125 | uint32_t hello_in; |
126 | uint32_t hello_out; | |
127 | uint32_t db_desc_in; | |
128 | uint32_t db_desc_out; | |
129 | uint32_t ls_req_in; | |
130 | uint32_t ls_req_out; | |
131 | uint32_t ls_upd_in; | |
132 | uint32_t ls_upd_out; | |
133 | uint32_t ls_ack_in; | |
134 | uint32_t ls_ack_out; | |
135 | uint32_t discarded; | |
43855e3d | 136 | |
d62a17ae | 137 | QOBJ_FIELDS |
718e3744 | 138 | }; |
ae19c240 | 139 | DECLARE_QOBJ_TYPE(ospf6_interface) |
718e3744 | 140 | |
508e53e2 | 141 | /* interface state */ |
142 | #define OSPF6_INTERFACE_NONE 0 | |
143 | #define OSPF6_INTERFACE_DOWN 1 | |
144 | #define OSPF6_INTERFACE_LOOPBACK 2 | |
145 | #define OSPF6_INTERFACE_WAITING 3 | |
146 | #define OSPF6_INTERFACE_POINTTOPOINT 4 | |
147 | #define OSPF6_INTERFACE_DROTHER 5 | |
148 | #define OSPF6_INTERFACE_BDR 6 | |
149 | #define OSPF6_INTERFACE_DR 7 | |
150 | #define OSPF6_INTERFACE_MAX 8 | |
151 | ||
2b64873d | 152 | extern const char *const ospf6_interface_state_str[]; |
718e3744 | 153 | |
508e53e2 | 154 | /* flags */ |
155 | #define OSPF6_INTERFACE_DISABLE 0x01 | |
156 | #define OSPF6_INTERFACE_PASSIVE 0x02 | |
c19543b2 | 157 | #define OSPF6_INTERFACE_NOAUTOCOST 0x04 |
718e3744 | 158 | |
b51a3a31 VT |
159 | /* default values */ |
160 | #define OSPF6_INTERFACE_HELLO_INTERVAL 10 | |
161 | #define OSPF6_INTERFACE_DEAD_INTERVAL 40 | |
162 | #define OSPF6_INTERFACE_RXMT_INTERVAL 5 | |
163 | #define OSPF6_INTERFACE_COST 1 | |
164 | #define OSPF6_INTERFACE_PRIORITY 1 | |
165 | #define OSPF6_INTERFACE_TRANSDELAY 1 | |
166 | #define OSPF6_INTERFACE_INSTANCE_ID 0 | |
70bd3c43 DS |
167 | #define OSPF6_INTERFACE_BANDWIDTH 10000 /* Mbps */ |
168 | #define OSPF6_REFERENCE_BANDWIDTH 100000 /* Mbps */ | |
8e370bfa DS |
169 | #define OSPF6_INTERFACE_SSO_RETRY_INT 1 |
170 | #define OSPF6_INTERFACE_SSO_RETRY_MAX 5 | |
b51a3a31 | 171 | |
718e3744 | 172 | /* Function Prototypes */ |
173 | ||
c5d28568 K |
174 | extern struct ospf6_interface * |
175 | ospf6_interface_lookup_by_ifindex(ifindex_t, vrf_id_t vrf_id); | |
d62a17ae | 176 | extern struct ospf6_interface *ospf6_interface_create(struct interface *); |
177 | extern void ospf6_interface_delete(struct ospf6_interface *); | |
718e3744 | 178 | |
d62a17ae | 179 | extern void ospf6_interface_enable(struct ospf6_interface *); |
180 | extern void ospf6_interface_disable(struct ospf6_interface *); | |
718e3744 | 181 | |
d62a17ae | 182 | extern void ospf6_interface_if_add(struct interface *); |
d62a17ae | 183 | extern void ospf6_interface_state_update(struct interface *); |
184 | extern void ospf6_interface_connected_route_update(struct interface *); | |
508e53e2 | 185 | |
186 | /* interface event */ | |
d62a17ae | 187 | extern int interface_up(struct thread *); |
188 | extern int interface_down(struct thread *); | |
189 | extern int wait_timer(struct thread *); | |
190 | extern int backup_seen(struct thread *); | |
191 | extern int neighbor_change(struct thread *); | |
718e3744 | 192 | |
d62a17ae | 193 | extern void ospf6_interface_init(void); |
718e3744 | 194 | |
d62a17ae | 195 | extern void install_element_ospf6_clear_interface(void); |
a1b11f9b | 196 | |
d62a17ae | 197 | extern int config_write_ospf6_debug_interface(struct vty *vty); |
198 | extern void install_element_ospf6_debug_interface(void); | |
718e3744 | 199 | |
3012671f | 200 | DECLARE_HOOK(ospf6_interface_change, |
d62a17ae | 201 | (struct ospf6_interface * oi, int state, int old_state), |
202 | (oi, state, old_state)) | |
3012671f | 203 | |
718e3744 | 204 | #endif /* OSPF6_INTERFACE_H */ |