]>
Commit | Line | Data |
---|---|---|
b9368db9 | 1 | |
718e3744 | 2 | /* Interface function header. |
3 | * Copyright (C) 1999 Kunihiro Ishiguro | |
4 | * | |
5 | * This file is part of GNU Zebra. | |
6 | * | |
7 | * GNU Zebra is free software; you can redistribute it and/or modify it | |
8 | * under the terms of the GNU General Public License as published by the | |
9 | * Free Software Foundation; either version 2, or (at your option) any | |
10 | * later version. | |
11 | * | |
12 | * GNU Zebra is distributed in the hope that it will be useful, but | |
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * General Public License for more details. | |
16 | * | |
896014f4 DL |
17 | * You should have received a copy of the GNU General Public License along |
18 | * with this program; see the file COPYING; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
718e3744 | 20 | */ |
21 | ||
5b73a671 | 22 | #ifndef _ZEBRA_INTERFACE_H |
23 | #define _ZEBRA_INTERFACE_H | |
24 | ||
25 | #include "redistribute.h" | |
12f6fb97 | 26 | #include "vrf.h" |
2eb27eec | 27 | #include "hook.h" |
ce5160c0 | 28 | #include "bitfield.h" |
ca776988 | 29 | |
6675513d | 30 | #include "zebra/zebra_l2.h" |
5948f013 | 31 | #include "zebra/zebra_nhg_private.h" |
c36e442c | 32 | #include "zebra/zebra_router.h" |
6675513d | 33 | |
51e94aa7 EDP |
34 | #ifdef __cplusplus |
35 | extern "C" { | |
36 | #endif | |
37 | ||
718e3744 | 38 | /* For interface multicast configuration. */ |
39 | #define IF_ZEBRA_MULTICAST_UNSPEC 0 | |
40 | #define IF_ZEBRA_MULTICAST_ON 1 | |
41 | #define IF_ZEBRA_MULTICAST_OFF 2 | |
42 | ||
43 | /* For interface shutdown configuration. */ | |
bfac8dcd | 44 | #define IF_ZEBRA_SHUTDOWN_OFF 0 |
718e3744 | 45 | #define IF_ZEBRA_SHUTDOWN_ON 1 |
718e3744 | 46 | |
ce5160c0 AK |
47 | #define IF_VLAN_BITMAP_MAX 4096 |
48 | ||
d62a17ae | 49 | #if defined(HAVE_RTADV) |
6eb0c5ab | 50 | /* Router advertisement parameter. From RFC4861, RFC6275 and RFC4191. */ |
d62a17ae | 51 | struct rtadvconf { |
52 | /* A flag indicating whether or not the router sends periodic Router | |
53 | Advertisements and responds to Router Solicitations. | |
2951a7a4 | 54 | Default: false */ |
d62a17ae | 55 | int AdvSendAdvertisements; |
56 | ||
57 | /* The maximum time allowed between sending unsolicited multicast | |
58 | Router Advertisements from the interface, in milliseconds. | |
59 | MUST be no less than 70 ms [RFC6275 7.5] and no greater | |
60 | than 1800000 ms [RFC4861 6.2.1]. | |
61 | ||
62 | Default: 600000 milliseconds */ | |
63 | int MaxRtrAdvInterval; | |
7cee1bb1 | 64 | #define RTADV_MAX_RTR_ADV_INTERVAL 600000 |
718e3744 | 65 | |
d62a17ae | 66 | /* The minimum time allowed between sending unsolicited multicast |
67 | Router Advertisements from the interface, in milliseconds. | |
68 | MUST be no less than 30 ms [RFC6275 7.5]. | |
69 | MUST be no greater than .75 * MaxRtrAdvInterval. | |
718e3744 | 70 | |
d62a17ae | 71 | Default: 0.33 * MaxRtrAdvInterval */ |
72 | int MinRtrAdvInterval; /* This field is currently unused. */ | |
718e3744 | 73 | #define RTADV_MIN_RTR_ADV_INTERVAL (0.33 * RTADV_MAX_RTR_ADV_INTERVAL) |
74 | ||
d62a17ae | 75 | /* Unsolicited Router Advertisements' interval timer. */ |
76 | int AdvIntervalTimer; | |
718e3744 | 77 | |
2951a7a4 | 78 | /* The true/false value to be placed in the "Managed address |
d62a17ae | 79 | configuration" flag field in the Router Advertisement. See |
80 | [ADDRCONF]. | |
718e3744 | 81 | |
2951a7a4 | 82 | Default: false */ |
d62a17ae | 83 | int AdvManagedFlag; |
718e3744 | 84 | |
718e3744 | 85 | |
2951a7a4 | 86 | /* The true/false value to be placed in the "Other stateful |
d62a17ae | 87 | configuration" flag field in the Router Advertisement. See |
88 | [ADDRCONF]. | |
718e3744 | 89 | |
2951a7a4 | 90 | Default: false */ |
d62a17ae | 91 | int AdvOtherConfigFlag; |
718e3744 | 92 | |
d62a17ae | 93 | /* The value to be placed in MTU options sent by the router. A |
94 | value of zero indicates that no MTU options are sent. | |
718e3744 | 95 | |
d62a17ae | 96 | Default: 0 */ |
97 | int AdvLinkMTU; | |
718e3744 | 98 | |
718e3744 | 99 | |
d62a17ae | 100 | /* The value to be placed in the Reachable Time field in the Router |
101 | Advertisement messages sent by the router. The value zero means | |
102 | unspecified (by this router). MUST be no greater than 3,600,000 | |
103 | milliseconds (1 hour). | |
718e3744 | 104 | |
d62a17ae | 105 | Default: 0 */ |
d7c0a89a | 106 | uint32_t AdvReachableTime; |
d62a17ae | 107 | #define RTADV_MAX_REACHABLE_TIME 3600000 |
718e3744 | 108 | |
d62a17ae | 109 | /* The value to be placed in the Retrans Timer field in the Router |
110 | Advertisement messages sent by the router. The value zero means | |
111 | unspecified (by this router). | |
718e3744 | 112 | |
d62a17ae | 113 | Default: 0 */ |
114 | int AdvRetransTimer; | |
718e3744 | 115 | |
d62a17ae | 116 | /* The default value to be placed in the Cur Hop Limit field in the |
117 | Router Advertisement messages sent by the router. The value | |
118 | should be set to that current diameter of the Internet. The | |
119 | value zero means unspecified (by this router). | |
718e3744 | 120 | |
d62a17ae | 121 | Default: The value specified in the "Assigned Numbers" RFC |
122 | [ASSIGNED] that was in effect at the time of implementation. */ | |
123 | int AdvCurHopLimit; | |
fae01935 | 124 | #define RTADV_DEFAULT_HOPLIMIT 64 /* 64 hops */ |
718e3744 | 125 | |
d62a17ae | 126 | /* The value to be placed in the Router Lifetime field of Router |
127 | Advertisements sent from the interface, in seconds. MUST be | |
128 | either zero or between MaxRtrAdvInterval and 9000 seconds. A | |
129 | value of zero indicates that the router is not to be used as a | |
130 | default router. | |
718e3744 | 131 | |
d62a17ae | 132 | Default: 3 * MaxRtrAdvInterval */ |
133 | int AdvDefaultLifetime; | |
d660f698 | 134 | #define RTADV_MAX_RTRLIFETIME 9000 /* 2.5 hours */ |
718e3744 | 135 | |
d62a17ae | 136 | /* A list of prefixes to be placed in Prefix Information options in |
137 | Router Advertisement messages sent from the interface. | |
718e3744 | 138 | |
d62a17ae | 139 | Default: all prefixes that the router advertises via routing |
140 | protocols as being on-link for the interface from which the | |
141 | advertisement is sent. The link-local prefix SHOULD NOT be | |
142 | included in the list of advertised prefixes. */ | |
143 | struct list *AdvPrefixList; | |
7cee1bb1 | 144 | |
2951a7a4 | 145 | /* The true/false value to be placed in the "Home agent" |
d62a17ae | 146 | flag field in the Router Advertisement. See [RFC6275 7.1]. |
7cee1bb1 | 147 | |
2951a7a4 | 148 | Default: false */ |
d62a17ae | 149 | int AdvHomeAgentFlag; |
7cee1bb1 | 150 | #ifndef ND_RA_FLAG_HOME_AGENT |
151 | #define ND_RA_FLAG_HOME_AGENT 0x20 | |
152 | #endif | |
153 | ||
d62a17ae | 154 | /* The value to be placed in Home Agent Information option if Home |
155 | Flag is set. | |
156 | Default: 0 */ | |
157 | int HomeAgentPreference; | |
158 | ||
159 | /* The value to be placed in Home Agent Information option if Home | |
160 | Flag is set. Lifetime (seconds) MUST not be greater than 18.2 | |
161 | hours. | |
162 | The value 0 has special meaning: use of AdvDefaultLifetime value. | |
163 | ||
164 | Default: 0 */ | |
165 | int HomeAgentLifetime; | |
7cee1bb1 | 166 | #define RTADV_MAX_HALIFETIME 65520 /* 18.2 hours */ |
167 | ||
2951a7a4 | 168 | /* The true/false value to insert or not an Advertisement Interval |
d62a17ae | 169 | option. See [RFC 6275 7.3] |
7cee1bb1 | 170 | |
2951a7a4 | 171 | Default: false */ |
d62a17ae | 172 | int AdvIntervalOption; |
b60668d0 | 173 | |
d62a17ae | 174 | /* The value to be placed in the Default Router Preference field of |
175 | a router advertisement. See [RFC 4191 2.1 & 2.2] | |
b60668d0 | 176 | |
d62a17ae | 177 | Default: 0 (medium) */ |
178 | int DefaultPreference; | |
b60668d0 | 179 | #define RTADV_PREF_MEDIUM 0x0 /* Per RFC4191. */ |
6c9678b4 | 180 | |
3eb4fbb0 LS |
181 | /* |
182 | * List of recursive DNS servers to include in the RDNSS option. | |
183 | * See [RFC8106 5.1] | |
184 | * | |
185 | * Default: empty list; do not emit RDNSS option | |
186 | */ | |
187 | struct list *AdvRDNSSList; | |
188 | ||
189 | /* | |
190 | * List of DNS search domains to include in the DNSSL option. | |
191 | * See [RFC8106 5.2] | |
192 | * | |
193 | * Default: empty list; do not emit DNSSL option | |
194 | */ | |
195 | struct list *AdvDNSSLList; | |
196 | ||
adee8f21 DS |
197 | /* |
198 | * rfc4861 states RAs must be sent at least 3 seconds apart. | |
199 | * We allow faster retransmits to speed up convergence but can | |
200 | * turn that capability off to meet the rfc if needed. | |
201 | */ | |
202 | bool UseFastRexmit; /* True if fast rexmits are enabled */ | |
203 | ||
d7c0a89a | 204 | uint8_t inFastRexmit; /* True if we're rexmits faster than usual */ |
3ea48364 DS |
205 | |
206 | /* Track if RA was configured by BGP or by the Operator or both */ | |
d7c0a89a | 207 | uint8_t ra_configured; /* Was RA configured? */ |
3ea48364 DS |
208 | #define BGP_RA_CONFIGURED (1<<0) /* BGP configured RA? */ |
209 | #define VTY_RA_CONFIGURED (1<<1) /* Operator configured RA? */ | |
210 | #define VTY_RA_INTERVAL_CONFIGURED (1<<2) /* Operator configured RA interval */ | |
996c9314 LB |
211 | int NumFastReXmitsRemain; /* Loaded first with number of fast |
212 | rexmits to do */ | |
6c9678b4 DD |
213 | |
214 | #define RTADV_FAST_REXMIT_PERIOD 1 /* 1 sec */ | |
215 | #define RTADV_NUM_FAST_REXMITS 4 /* Fast Rexmit RA 4 times on certain events */ | |
718e3744 | 216 | }; |
217 | ||
3eb4fbb0 LS |
218 | struct rtadv_rdnss { |
219 | /* Address of recursive DNS server to advertise */ | |
220 | struct in6_addr addr; | |
221 | ||
222 | /* | |
223 | * Lifetime in seconds; all-ones means infinity, zero | |
224 | * stop using it. | |
225 | */ | |
226 | uint32_t lifetime; | |
227 | ||
228 | /* If lifetime not set, use a default of 3*MaxRtrAdvInterval */ | |
229 | int lifetime_set; | |
230 | }; | |
231 | ||
232 | /* | |
233 | * [RFC1035 2.3.4] sets the maximum length of a domain name (a sequence of | |
234 | * labels, each prefixed by a length octet) at 255 octets. | |
235 | */ | |
236 | #define RTADV_MAX_ENCODED_DOMAIN_NAME 255 | |
237 | ||
238 | struct rtadv_dnssl { | |
239 | /* Domain name without trailing root zone dot (NUL-terminated) */ | |
240 | char name[RTADV_MAX_ENCODED_DOMAIN_NAME - 1]; | |
241 | ||
242 | /* Name encoded as in [RFC1035 3.1] */ | |
243 | uint8_t encoded_name[RTADV_MAX_ENCODED_DOMAIN_NAME]; | |
244 | ||
245 | /* Actual length of encoded_name */ | |
246 | size_t encoded_len; | |
247 | ||
248 | /* Lifetime as for RDNSS */ | |
249 | uint32_t lifetime; | |
250 | int lifetime_set; | |
251 | }; | |
252 | ||
8da4e946 | 253 | #endif /* HAVE_RTADV */ |
718e3744 | 254 | |
6675513d | 255 | /* Zebra interface type - ones of interest. */ |
e6f2bec0 | 256 | enum zebra_iftype { |
7a38782a DL |
257 | ZEBRA_IF_OTHER = 0, /* Anything else */ |
258 | ZEBRA_IF_VXLAN, /* VxLAN interface */ | |
259 | ZEBRA_IF_VRF, /* VRF device */ | |
260 | ZEBRA_IF_BRIDGE, /* bridge device */ | |
261 | ZEBRA_IF_VLAN, /* VLAN sub-interface */ | |
262 | ZEBRA_IF_MACVLAN, /* MAC VLAN interface*/ | |
0e4864ea | 263 | ZEBRA_IF_VETH, /* VETH interface*/ |
b9368db9 DD |
264 | ZEBRA_IF_BOND, /* Bond */ |
265 | ZEBRA_IF_BOND_SLAVE, /* Bond */ | |
077c07cc | 266 | ZEBRA_IF_GRE, /* GRE interface */ |
e6f2bec0 | 267 | }; |
6675513d | 268 | |
269 | /* Zebra "slave" interface type */ | |
a81982fa | 270 | enum zebra_slave_iftype { |
d62a17ae | 271 | ZEBRA_IF_SLAVE_NONE, /* Not a slave */ |
272 | ZEBRA_IF_SLAVE_VRF, /* Member of a VRF */ | |
273 | ZEBRA_IF_SLAVE_BRIDGE, /* Member of a bridge */ | |
b9368db9 | 274 | ZEBRA_IF_SLAVE_BOND, /* Bond member */ |
d62a17ae | 275 | ZEBRA_IF_SLAVE_OTHER, /* Something else - e.g., bond slave */ |
a81982fa | 276 | }; |
6675513d | 277 | |
2eb27eec DL |
278 | struct irdp_interface; |
279 | ||
ce5160c0 AK |
280 | /* Ethernet segment info used for setting up EVPN multihoming */ |
281 | struct zebra_evpn_es; | |
282 | struct zebra_es_if_info { | |
325d694b | 283 | /* type-3 esi config */ |
ce5160c0 AK |
284 | struct ethaddr sysmac; |
285 | uint32_t lid; /* local-id; has to be unique per-ES-sysmac */ | |
325d694b AK |
286 | |
287 | esi_t esi; | |
288 | ||
1103c5c6 | 289 | uint16_t df_pref; |
00a7710c AK |
290 | uint8_t flags; |
291 | #define ZIF_CFG_ES_FLAG_BYPASS (1 << 0) | |
292 | ||
ce5160c0 AK |
293 | struct zebra_evpn_es *es; /* local ES */ |
294 | }; | |
295 | ||
c36e442c AK |
296 | enum zebra_if_flags { |
297 | /* device has been configured as an uplink for | |
298 | * EVPN multihoming | |
299 | */ | |
300 | ZIF_FLAG_EVPN_MH_UPLINK = (1 << 0), | |
301 | ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP = (1 << 1), | |
302 | ||
303 | /* Dataplane protodown-on */ | |
00a7710c AK |
304 | ZIF_FLAG_PROTODOWN = (1 << 2), |
305 | ||
306 | /* LACP bypass state is set by the dataplane on a bond member | |
307 | * and inherited by the bond (if one or more bond members are in | |
308 | * a bypass state the bond is placed in a bypass state) | |
309 | */ | |
310 | ZIF_FLAG_LACP_BYPASS = (1 << 3) | |
c36e442c AK |
311 | }; |
312 | ||
718e3744 | 313 | /* `zebra' daemon local interface structure. */ |
d62a17ae | 314 | struct zebra_if { |
ce5160c0 AK |
315 | /* back pointer to the interface */ |
316 | struct interface *ifp; | |
317 | ||
c36e442c AK |
318 | enum zebra_if_flags flags; |
319 | ||
d62a17ae | 320 | /* Shutdown configuration. */ |
d7c0a89a | 321 | uint8_t shutdown; |
718e3744 | 322 | |
d62a17ae | 323 | /* Multicast configuration. */ |
d7c0a89a | 324 | uint8_t multicast; |
718e3744 | 325 | |
d62a17ae | 326 | /* Router advertise configuration. */ |
d7c0a89a | 327 | uint8_t rtadv_enable; |
718e3744 | 328 | |
d62a17ae | 329 | /* Installed addresses chains tree. */ |
330 | struct route_table *ipv4_subnets; | |
eef1fe11 | 331 | |
fe593b78 | 332 | /* Nexthops pointing to this interface */ |
602fea61 SW |
333 | /** |
334 | * Any nexthop that we get should have an | |
335 | * interface. When an interface goes down, | |
336 | * we will use this list to update the nexthops | |
337 | * pointing to it with that info. | |
338 | */ | |
37c6708b | 339 | struct nhg_connected_tree_head nhg_dependents; |
602fea61 | 340 | |
d62a17ae | 341 | /* Information about up/down changes */ |
342 | unsigned int up_count; | |
343 | char up_last[QUAGGA_TIMESTAMP_LEN]; | |
344 | unsigned int down_count; | |
345 | char down_last[QUAGGA_TIMESTAMP_LEN]; | |
55ce4d3a | 346 | |
8da4e946 | 347 | #if defined(HAVE_RTADV) |
d62a17ae | 348 | struct rtadvconf rtadv; |
349 | unsigned int ra_sent, ra_rcvd; | |
8da4e946 | 350 | #endif /* HAVE_RTADV */ |
ca776988 | 351 | |
2eb27eec | 352 | struct irdp_interface *irdp; |
ca776988 | 353 | |
8ccc7e80 | 354 | #ifdef HAVE_STRUCT_SOCKADDR_DL |
d62a17ae | 355 | union { |
356 | /* note that sdl_storage is never accessed, it only exists to | |
357 | * make space. | |
358 | * all actual uses refer to sdl - but use sizeof(sdl_storage)! | |
359 | * this fits | |
360 | * best with C aliasing rules. */ | |
361 | struct sockaddr_dl sdl; | |
362 | struct sockaddr_storage sdl_storage; | |
363 | }; | |
8ccc7e80 TT |
364 | #endif |
365 | ||
d62a17ae | 366 | /* ptm enable configuration */ |
d7c0a89a | 367 | uint8_t ptm_enable; |
6675513d | 368 | |
d62a17ae | 369 | /* Zebra interface and "slave" interface type */ |
e6f2bec0 | 370 | enum zebra_iftype zif_type; |
a81982fa | 371 | enum zebra_slave_iftype zif_slave_type; |
6675513d | 372 | |
d62a17ae | 373 | /* Additional L2 info, depends on zif_type */ |
374 | union zebra_l2if_info l2info; | |
6675513d | 375 | |
d62a17ae | 376 | /* For members of a bridge, link to bridge. */ |
377 | /* Note: If additional fields become necessary, this can be modified to | |
378 | * be a pointer to a dynamically allocd struct. | |
379 | */ | |
380 | struct zebra_l2info_brslave brslave_info; | |
6675513d | 381 | |
b9368db9 | 382 | struct zebra_l2info_bondslave bondslave_info; |
c36e442c | 383 | struct zebra_l2info_bond bond_info; |
b9368db9 | 384 | |
ce5160c0 AK |
385 | /* ethernet segment */ |
386 | struct zebra_es_if_info es_info; | |
387 | ||
388 | /* bitmap of vlans associated with this interface */ | |
389 | bitfield_t vlan_bitmap; | |
390 | ||
c36e442c AK |
391 | /* An interface can be error-disabled if a protocol (such as EVPN or |
392 | * VRRP) detects a problem with keeping it operationally-up. | |
393 | * If any of the protodown bits are set protodown-on is programmed | |
394 | * in the dataplane. This results in a carrier/L1 down on the | |
395 | * physical device. | |
396 | */ | |
397 | enum protodown_reasons protodown_rc; | |
398 | ||
8b07f173 AK |
399 | /* list of zebra_mac entries using this interface as destination */ |
400 | struct list *mac_list; | |
401 | ||
d62a17ae | 402 | /* Link fields - for sub-interfaces. */ |
403 | ifindex_t link_ifindex; | |
404 | struct interface *link; | |
dc7b3cae DS |
405 | |
406 | struct thread *speed_update; | |
20089ae2 DS |
407 | |
408 | /* | |
409 | * Does this interface have a v6 to v4 ll neighbor entry | |
410 | * for bgp unnumbered? | |
411 | */ | |
412 | bool v6_2_v4_ll_neigh_entry; | |
ee98d1f1 | 413 | char neigh_mac[6]; |
20089ae2 | 414 | struct in6_addr v6_2_v4_ll_addr6; |
ba5165ec DS |
415 | |
416 | /* The description of the interface */ | |
417 | char *desc; | |
718e3744 | 418 | }; |
419 | ||
996c9314 | 420 | DECLARE_HOOK(zebra_if_extra_info, (struct vty * vty, struct interface *ifp), |
8451921b | 421 | (vty, ifp)); |
996c9314 | 422 | DECLARE_HOOK(zebra_if_config_wr, (struct vty * vty, struct interface *ifp), |
8451921b | 423 | (vty, ifp)); |
2eb27eec | 424 | |
d62a17ae | 425 | #define IS_ZEBRA_IF_VRF(ifp) \ |
426 | (((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_VRF) | |
427 | ||
428 | #define IS_ZEBRA_IF_BRIDGE(ifp) \ | |
429 | (((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_BRIDGE) | |
430 | ||
431 | #define IS_ZEBRA_IF_VLAN(ifp) \ | |
432 | (((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_VLAN) | |
433 | ||
434 | #define IS_ZEBRA_IF_VXLAN(ifp) \ | |
435 | (((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_VXLAN) | |
436 | ||
1a98c087 MK |
437 | #define IS_ZEBRA_IF_MACVLAN(ifp) \ |
438 | (((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_MACVLAN) | |
439 | ||
0e4864ea PG |
440 | #define IS_ZEBRA_IF_VETH(ifp) \ |
441 | (((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_VETH) | |
442 | ||
c36e442c AK |
443 | #define IS_ZEBRA_IF_BOND(ifp) \ |
444 | (((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_BOND) | |
445 | ||
077c07cc PG |
446 | #define IS_ZEBRA_IF_GRE(ifp) \ |
447 | (((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_GRE) | |
448 | ||
0e4864ea | 449 | #define IS_ZEBRA_IF_BRIDGE_SLAVE(ifp) \ |
d62a17ae | 450 | (((struct zebra_if *)(ifp->info))->zif_slave_type \ |
451 | == ZEBRA_IF_SLAVE_BRIDGE) | |
452 | ||
453 | #define IS_ZEBRA_IF_VRF_SLAVE(ifp) \ | |
454 | (((struct zebra_if *)(ifp->info))->zif_slave_type == ZEBRA_IF_SLAVE_VRF) | |
455 | ||
b9368db9 DD |
456 | #define IS_ZEBRA_IF_BOND_SLAVE(ifp) \ |
457 | (((struct zebra_if *)(ifp->info))->zif_slave_type \ | |
458 | == ZEBRA_IF_SLAVE_BOND) | |
459 | ||
05f7f5db DS |
460 | extern void zebra_if_init(void); |
461 | ||
d7c0a89a | 462 | extern struct interface *if_lookup_by_index_per_ns(struct zebra_ns *, uint32_t); |
d62a17ae | 463 | extern struct interface *if_lookup_by_name_per_ns(struct zebra_ns *, |
464 | const char *); | |
465 | extern struct interface *if_link_per_ns(struct zebra_ns *, struct interface *); | |
466 | extern const char *ifindex2ifname_per_ns(struct zebra_ns *, unsigned int); | |
467 | ||
468 | extern void if_unlink_per_ns(struct interface *); | |
ee98d1f1 DS |
469 | extern void if_nbr_mac_to_ipv4ll_neigh_update(struct interface *fip, |
470 | char mac[6], | |
471 | struct in6_addr *address, | |
472 | int add); | |
d62a17ae | 473 | extern void if_nbr_ipv6ll_to_ipv4ll_neigh_update(struct interface *ifp, |
474 | struct in6_addr *address, | |
475 | int add); | |
476 | extern void if_nbr_ipv6ll_to_ipv4ll_neigh_del_all(struct interface *ifp); | |
477 | extern void if_delete_update(struct interface *ifp); | |
478 | extern void if_add_update(struct interface *ifp); | |
479 | extern void if_up(struct interface *); | |
480 | extern void if_down(struct interface *); | |
481 | extern void if_refresh(struct interface *); | |
482 | extern void if_flags_update(struct interface *, uint64_t); | |
483 | extern int if_subnet_add(struct interface *, struct connected *); | |
484 | extern int if_subnet_delete(struct interface *, struct connected *); | |
485 | extern int ipv6_address_configured(struct interface *ifp); | |
486 | extern void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id); | |
680c278f PG |
487 | extern void zebra_if_update_link(struct interface *ifp, ifindex_t link_ifindex, |
488 | ns_id_t ns_id); | |
357b150d | 489 | extern void zebra_if_update_all_links(struct zebra_ns *zns); |
c3bd894e | 490 | extern void zebra_if_set_protodown(struct interface *ifp, bool down); |
09268680 CS |
491 | extern int if_ip_address_install(struct interface *ifp, struct prefix *prefix, |
492 | const char *label, struct prefix *pp); | |
493 | extern int if_ipv6_address_install(struct interface *ifp, struct prefix *prefix, | |
494 | const char *label); | |
495 | extern int if_ip_address_uinstall(struct interface *ifp, struct prefix *prefix); | |
496 | extern int if_shutdown(struct interface *ifp); | |
497 | extern int if_no_shutdown(struct interface *ifp); | |
498 | extern int if_multicast_set(struct interface *ifp); | |
499 | extern int if_multicast_unset(struct interface *ifp); | |
500 | extern int if_linkdetect(struct interface *ifp, bool detect); | |
501 | extern void if_addr_wakeup(struct interface *ifp); | |
d62a17ae | 502 | |
fe593b78 SW |
503 | /* Nexthop group connected functions */ |
504 | extern void if_nhg_dependents_add(struct interface *ifp, | |
505 | struct nhg_hash_entry *nhe); | |
506 | extern void if_nhg_dependents_del(struct interface *ifp, | |
507 | struct nhg_hash_entry *nhe); | |
508 | extern unsigned int if_nhg_dependents_count(const struct interface *ifp); | |
509 | extern bool if_nhg_dependents_is_empty(const struct interface *ifp); | |
602fea61 | 510 | |
d62a17ae | 511 | extern void vrf_add_update(struct vrf *vrfp); |
c36e442c AK |
512 | extern void zebra_l2_map_slave_to_bond(struct zebra_if *zif, vrf_id_t vrf); |
513 | extern void zebra_l2_unmap_slave_from_bond(struct zebra_if *zif); | |
904e9b05 MS |
514 | extern const char *zebra_protodown_rc_str(enum protodown_reasons protodown_rc, |
515 | char *pd_buf, uint32_t pd_buf_len); | |
d166308b | 516 | void zebra_if_addr_update_ctx(struct zebra_dplane_ctx *ctx); |
12f6fb97 | 517 | |
718e3744 | 518 | #ifdef HAVE_PROC_NET_DEV |
d62a17ae | 519 | extern void ifstat_update_proc(void); |
718e3744 | 520 | #endif /* HAVE_PROC_NET_DEV */ |
521 | #ifdef HAVE_NET_RT_IFLIST | |
d62a17ae | 522 | extern void ifstat_update_sysctl(void); |
718e3744 | 523 | |
524 | #endif /* HAVE_NET_RT_IFLIST */ | |
525 | #ifdef HAVE_PROC_NET_DEV | |
d62a17ae | 526 | extern int interface_list_proc(void); |
718e3744 | 527 | #endif /* HAVE_PROC_NET_DEV */ |
528 | #ifdef HAVE_PROC_NET_IF_INET6 | |
d62a17ae | 529 | extern int ifaddr_proc_ipv6(void); |
718e3744 | 530 | #endif /* HAVE_PROC_NET_IF_INET6 */ |
531 | ||
51e94aa7 EDP |
532 | #ifdef __cplusplus |
533 | } | |
534 | #endif | |
535 | ||
5b73a671 | 536 | #endif /* _ZEBRA_INTERFACE_H */ |