]> git.proxmox.com Git - mirror_frr.git/blob - lib/if.h
Merge pull request #9846 from idryzhov/lib-zebra-netns
[mirror_frr.git] / lib / if.h
1 /* Interface related header.
2 * Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
3 *
4 * This file is part of GNU Zebra.
5 *
6 * GNU Zebra is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published
8 * by the Free Software Foundation; either version 2, or (at your
9 * option) any 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 _ZEBRA_IF_H
22 #define _ZEBRA_IF_H
23
24 #include "zebra.h"
25 #include "linklist.h"
26 #include "memory.h"
27 #include "qobj.h"
28 #include "hook.h"
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 DECLARE_MTYPE(CONNECTED_LABEL);
35
36 /* Interface link-layer type, if known. Derived from:
37 *
38 * net/if_arp.h on various platforms - Linux especially.
39 * http://www.iana.org/assignments/arp-parameters/arp-parameters.xhtml
40 *
41 * Some of the more obviously defunct technologies left out.
42 */
43 enum zebra_link_type {
44 ZEBRA_LLT_UNKNOWN = 0,
45 ZEBRA_LLT_ETHER,
46 ZEBRA_LLT_EETHER,
47 ZEBRA_LLT_AX25,
48 ZEBRA_LLT_PRONET,
49 ZEBRA_LLT_IEEE802,
50 ZEBRA_LLT_ARCNET,
51 ZEBRA_LLT_APPLETLK,
52 ZEBRA_LLT_DLCI,
53 ZEBRA_LLT_ATM,
54 ZEBRA_LLT_METRICOM,
55 ZEBRA_LLT_IEEE1394,
56 ZEBRA_LLT_EUI64,
57 ZEBRA_LLT_INFINIBAND,
58 ZEBRA_LLT_SLIP,
59 ZEBRA_LLT_CSLIP,
60 ZEBRA_LLT_SLIP6,
61 ZEBRA_LLT_CSLIP6,
62 ZEBRA_LLT_RSRVD,
63 ZEBRA_LLT_ADAPT,
64 ZEBRA_LLT_ROSE,
65 ZEBRA_LLT_X25,
66 ZEBRA_LLT_PPP,
67 ZEBRA_LLT_CHDLC,
68 ZEBRA_LLT_LAPB,
69 ZEBRA_LLT_RAWHDLC,
70 ZEBRA_LLT_IPIP,
71 ZEBRA_LLT_IPIP6,
72 ZEBRA_LLT_FRAD,
73 ZEBRA_LLT_SKIP,
74 ZEBRA_LLT_LOOPBACK,
75 ZEBRA_LLT_LOCALTLK,
76 ZEBRA_LLT_FDDI,
77 ZEBRA_LLT_SIT,
78 ZEBRA_LLT_IPDDP,
79 ZEBRA_LLT_IPGRE,
80 ZEBRA_LLT_IP6GRE,
81 ZEBRA_LLT_PIMREG,
82 ZEBRA_LLT_HIPPI,
83 ZEBRA_LLT_ECONET,
84 ZEBRA_LLT_IRDA,
85 ZEBRA_LLT_FCPP,
86 ZEBRA_LLT_FCAL,
87 ZEBRA_LLT_FCPL,
88 ZEBRA_LLT_FCFABRIC,
89 ZEBRA_LLT_IEEE802_TR,
90 ZEBRA_LLT_IEEE80211,
91 ZEBRA_LLT_IEEE80211_RADIOTAP,
92 ZEBRA_LLT_IEEE802154,
93 ZEBRA_LLT_IEEE802154_PHY,
94 };
95
96 /*
97 Interface name length.
98
99 Linux define value in /usr/include/linux/if.h.
100 #define IFNAMSIZ 16
101
102 FreeBSD define value in /usr/include/net/if.h.
103 #define IFNAMSIZ 16
104 */
105
106 #define INTERFACE_NAMSIZ 20
107 #define INTERFACE_HWADDR_MAX 20
108
109 typedef signed int ifindex_t;
110
111 #ifdef HAVE_PROC_NET_DEV
112 struct if_stats {
113 unsigned long rx_packets; /* total packets received */
114 unsigned long tx_packets; /* total packets transmitted */
115 unsigned long rx_bytes; /* total bytes received */
116 unsigned long tx_bytes; /* total bytes transmitted */
117 unsigned long rx_errors; /* bad packets received */
118 unsigned long tx_errors; /* packet transmit problems */
119 unsigned long rx_dropped; /* no space in linux buffers */
120 unsigned long tx_dropped; /* no space available in linux */
121 unsigned long rx_multicast; /* multicast packets received */
122 unsigned long rx_compressed;
123 unsigned long tx_compressed;
124 unsigned long collisions;
125
126 /* detailed rx_errors: */
127 unsigned long rx_length_errors;
128 unsigned long rx_over_errors; /* receiver ring buff overflow */
129 unsigned long rx_crc_errors; /* recved pkt with crc error */
130 unsigned long rx_frame_errors; /* recv'd frame alignment error */
131 unsigned long rx_fifo_errors; /* recv'r fifo overrun */
132 unsigned long rx_missed_errors; /* receiver missed packet */
133 /* detailed tx_errors */
134 unsigned long tx_aborted_errors;
135 unsigned long tx_carrier_errors;
136 unsigned long tx_fifo_errors;
137 unsigned long tx_heartbeat_errors;
138 unsigned long tx_window_errors;
139 };
140 #endif /* HAVE_PROC_NET_DEV */
141
142 /* Here are "non-official" architectural constants. */
143 #define TE_EXT_MASK 0x0FFFFFFF
144 #define TE_EXT_ANORMAL 0x80000000
145 #define LOSS_PRECISION 0.000003
146 #define TE_MEGA_BIT 1000000
147 #define TE_BYTE 8
148 #define DEFAULT_BANDWIDTH 10000
149 #define MAX_CLASS_TYPE 8
150 #define MAX_PKT_LOSS 50.331642
151
152 /*
153 * Link Parameters Status:
154 * equal to 0: unset
155 * different from 0: set
156 */
157 #define LP_UNSET 0x0000
158 #define LP_TE_METRIC 0x0001
159 #define LP_MAX_BW 0x0002
160 #define LP_MAX_RSV_BW 0x0004
161 #define LP_UNRSV_BW 0x0008
162 #define LP_ADM_GRP 0x0010
163 #define LP_RMT_AS 0x0020
164 #define LP_DELAY 0x0040
165 #define LP_MM_DELAY 0x0080
166 #define LP_DELAY_VAR 0x0100
167 #define LP_PKT_LOSS 0x0200
168 #define LP_RES_BW 0x0400
169 #define LP_AVA_BW 0x0800
170 #define LP_USE_BW 0x1000
171
172 #define IS_PARAM_UNSET(lp, st) !(lp->lp_status & st)
173 #define IS_PARAM_SET(lp, st) (lp->lp_status & st)
174 #define IS_LINK_PARAMS_SET(lp) (lp->lp_status != LP_UNSET)
175
176 #define SET_PARAM(lp, st) (lp->lp_status) |= (st)
177 #define UNSET_PARAM(lp, st) (lp->lp_status) &= ~(st)
178 #define RESET_LINK_PARAM(lp) (lp->lp_status = LP_UNSET)
179
180 /* Link Parameters for Traffic Engineering */
181 struct if_link_params {
182 uint32_t lp_status; /* Status of Link Parameters: */
183 uint32_t te_metric; /* Traffic Engineering metric */
184 float default_bw;
185 float max_bw; /* Maximum Bandwidth */
186 float max_rsv_bw; /* Maximum Reservable Bandwidth */
187 float unrsv_bw[MAX_CLASS_TYPE]; /* Unreserved Bandwidth per Class Type
188 (8) */
189 uint32_t admin_grp; /* Administrative group */
190 uint32_t rmt_as; /* Remote AS number */
191 struct in_addr rmt_ip; /* Remote IP address */
192 uint32_t av_delay; /* Link Average Delay */
193 uint32_t min_delay; /* Link Min Delay */
194 uint32_t max_delay; /* Link Max Delay */
195 uint32_t delay_var; /* Link Delay Variation */
196 float pkt_loss; /* Link Packet Loss */
197 float res_bw; /* Residual Bandwidth */
198 float ava_bw; /* Available Bandwidth */
199 float use_bw; /* Utilized Bandwidth */
200 };
201
202 #define INTERFACE_LINK_PARAMS_SIZE sizeof(struct if_link_params)
203 #define HAS_LINK_PARAMS(ifp) ((ifp)->link_params != NULL)
204
205 /* Interface structure */
206 struct interface {
207 RB_ENTRY(interface) name_entry, index_entry;
208
209 /* Interface name. This should probably never be changed after the
210 interface is created, because the configuration info for this
211 interface
212 is associated with this structure. For that reason, the interface
213 should also never be deleted (to avoid losing configuration info).
214 To delete, just set ifindex to IFINDEX_INTERNAL to indicate that the
215 interface does not exist in the kernel.
216 */
217 char name[INTERFACE_NAMSIZ];
218
219 /* Interface index (should be IFINDEX_INTERNAL for non-kernel or
220 deleted interfaces).
221 WARNING: the ifindex needs to be changed using the if_set_index()
222 function. Failure to respect this will cause corruption in the data
223 structure used to store the interfaces and if_lookup_by_index() will
224 not work as expected.
225 */
226 ifindex_t ifindex;
227 ifindex_t oldifindex;
228
229 /*
230 * ifindex of parent interface, if any
231 */
232 ifindex_t link_ifindex;
233 #define IFINDEX_INTERNAL 0
234
235 /* Zebra internal interface status */
236 uint8_t status;
237 #define ZEBRA_INTERFACE_ACTIVE (1 << 0)
238 #define ZEBRA_INTERFACE_SUB (1 << 1)
239 #define ZEBRA_INTERFACE_LINKDETECTION (1 << 2)
240 #define ZEBRA_INTERFACE_VRF_LOOPBACK (1 << 3)
241
242 /* Interface flags. */
243 uint64_t flags;
244
245 /* Interface metric */
246 uint32_t metric;
247
248 /* Interface Speed in Mb/s */
249 uint32_t speed;
250
251 /* Interface MTU. */
252 unsigned int mtu; /* IPv4 MTU */
253 unsigned int
254 mtu6; /* IPv6 MTU - probably, but not necessarily same as mtu
255 */
256
257 /* Link-layer information and hardware address */
258 enum zebra_link_type ll_type;
259 uint8_t hw_addr[INTERFACE_HWADDR_MAX];
260 int hw_addr_len;
261
262 /* interface bandwidth, kbits */
263 unsigned int bandwidth;
264
265 /* Link parameters for Traffic Engineering */
266 struct if_link_params *link_params;
267
268 /* description of the interface. */
269 char *desc;
270
271 /* Distribute list. */
272 void *distribute_in;
273 void *distribute_out;
274
275 /* Connected address list. */
276 struct list *connected;
277
278 /* Neighbor connected address list. */
279 struct list *nbr_connected;
280
281 /* Daemon specific interface data pointer. */
282 void *info;
283
284 char ptm_enable; /* Should we look at ptm_status ? */
285 char ptm_status;
286
287 /* Statistics fileds. */
288 #ifdef HAVE_PROC_NET_DEV
289 struct if_stats stats;
290 #endif /* HAVE_PROC_NET_DEV */
291 #ifdef HAVE_NET_RT_IFLIST
292 struct if_data stats;
293 #endif /* HAVE_NET_RT_IFLIST */
294
295 struct route_node *node;
296
297 struct vrf *vrf;
298 vrf_id_t vrf_id;
299
300 /*
301 * Has the end users entered `interface XXXX` from the cli in some
302 * fashion?
303 */
304 bool configured;
305
306 QOBJ_FIELDS;
307 };
308
309 RB_HEAD(if_name_head, interface);
310 RB_PROTOTYPE(if_name_head, interface, name_entry, if_cmp_func)
311 RB_HEAD(if_index_head, interface);
312 RB_PROTOTYPE(if_index_head, interface, index_entry, if_cmp_index_func)
313 DECLARE_QOBJ_TYPE(interface);
314
315 #define IFNAME_RB_INSERT(vrf, ifp) \
316 ({ \
317 struct interface *_iz = \
318 RB_INSERT(if_name_head, &vrf->ifaces_by_name, (ifp)); \
319 if (_iz) \
320 flog_err( \
321 EC_LIB_INTERFACE, \
322 "%s(%s): corruption detected -- interface with this " \
323 "name exists already in VRF %u!", \
324 __func__, (ifp)->name, (ifp)->vrf_id); \
325 _iz; \
326 })
327
328 #define IFNAME_RB_REMOVE(vrf, ifp) \
329 ({ \
330 struct interface *_iz = \
331 RB_REMOVE(if_name_head, &vrf->ifaces_by_name, (ifp)); \
332 if (_iz == NULL) \
333 flog_err( \
334 EC_LIB_INTERFACE, \
335 "%s(%s): corruption detected -- interface with this " \
336 "name doesn't exist in VRF %u!", \
337 __func__, (ifp)->name, (ifp)->vrf_id); \
338 _iz; \
339 })
340
341
342 #define IFINDEX_RB_INSERT(vrf, ifp) \
343 ({ \
344 struct interface *_iz = RB_INSERT( \
345 if_index_head, &vrf->ifaces_by_index, (ifp)); \
346 if (_iz) \
347 flog_err( \
348 EC_LIB_INTERFACE, \
349 "%s(%u): corruption detected -- interface with this " \
350 "ifindex exists already in VRF %u!", \
351 __func__, (ifp)->ifindex, (ifp)->vrf_id); \
352 _iz; \
353 })
354
355 #define IFINDEX_RB_REMOVE(vrf, ifp) \
356 ({ \
357 struct interface *_iz = RB_REMOVE( \
358 if_index_head, &vrf->ifaces_by_index, (ifp)); \
359 if (_iz == NULL) \
360 flog_err( \
361 EC_LIB_INTERFACE, \
362 "%s(%u): corruption detected -- interface with this " \
363 "ifindex doesn't exist in VRF %u!", \
364 __func__, (ifp)->ifindex, (ifp)->vrf_id); \
365 _iz; \
366 })
367
368 #define FOR_ALL_INTERFACES(vrf, ifp) \
369 if (vrf) \
370 RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name)
371
372 #define FOR_ALL_INTERFACES_ADDRESSES(ifp, connected, node) \
373 for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, connected))
374
375 /* called from the library code whenever interfaces are created/deleted
376 * note: interfaces may not be fully realized at that point; also they
377 * may not exist in the system (ifindex = IFINDEX_INTERNAL)
378 *
379 * priority values are important here, daemons should be at 0 while modules
380 * can use 1000+ so they run after the daemon has initialised daemon-specific
381 * interface data
382 */
383 DECLARE_HOOK(if_add, (struct interface * ifp), (ifp));
384 DECLARE_KOOH(if_del, (struct interface * ifp), (ifp));
385
386 #define METRIC_MAX (~0)
387
388 /* Connected address structure. */
389 struct connected {
390 /* Attached interface. */
391 struct interface *ifp;
392
393 /* Flags for configuration. */
394 uint8_t conf;
395 #define ZEBRA_IFC_REAL (1 << 0)
396 #define ZEBRA_IFC_CONFIGURED (1 << 1)
397 #define ZEBRA_IFC_QUEUED (1 << 2)
398 #define ZEBRA_IFC_DOWN (1 << 3)
399 /*
400 The ZEBRA_IFC_REAL flag should be set if and only if this address
401 exists in the kernel and is actually usable. (A case where it exists
402 but
403 is not yet usable would be IPv6 with DAD)
404 The ZEBRA_IFC_CONFIGURED flag should be set if and only if this
405 address
406 was configured by the user from inside quagga.
407 The ZEBRA_IFC_QUEUED flag should be set if and only if the address
408 exists
409 in the kernel. It may and should be set although the address might
410 not be
411 usable yet. (compare with ZEBRA_IFC_REAL)
412 The ZEBRA_IFC_DOWN flag is used to record that an address is
413 present, but down/unavailable.
414 */
415
416 /* Flags for connected address. */
417 uint8_t flags;
418 #define ZEBRA_IFA_SECONDARY (1 << 0)
419 #define ZEBRA_IFA_PEER (1 << 1)
420 #define ZEBRA_IFA_UNNUMBERED (1 << 2)
421 /* N.B. the ZEBRA_IFA_PEER flag should be set if and only if
422 a peer address has been configured. If this flag is set,
423 the destination field must contain the peer address.
424 */
425
426 /* Address of connected network. */
427 struct prefix *address;
428
429 /* Peer address, if ZEBRA_IFA_PEER is set, otherwise NULL */
430 struct prefix *destination;
431
432 /* Label for Linux 2.2.X and upper. */
433 char *label;
434
435 /*
436 * Used for setting the connected route's cost. If the metric
437 * here is set to METRIC_MAX the connected route falls back to
438 * "struct interface"
439 */
440 uint32_t metric;
441 };
442
443 /* Nbr Connected address structure. */
444 struct nbr_connected {
445 /* Attached interface. */
446 struct interface *ifp;
447
448 /* Address of connected network. */
449 struct prefix *address;
450 };
451
452 /* Does the destination field contain a peer address? */
453 #define CONNECTED_PEER(C) CHECK_FLAG((C)->flags, ZEBRA_IFA_PEER)
454
455 /* Prefix to insert into the RIB */
456 #define CONNECTED_PREFIX(C) \
457 (CONNECTED_PEER(C) ? (C)->destination : (C)->address)
458
459 /* Identifying address. We guess that if there's a peer address, but the
460 local address is in the same prefix, then the local address may be unique. */
461 #define CONNECTED_ID(C) \
462 ((CONNECTED_PEER(C) && !prefix_match((C)->destination, (C)->address)) \
463 ? (C)->destination \
464 : (C)->address)
465
466 /* There are some interface flags which are only supported by some
467 operating system. */
468
469 #ifndef IFF_NOTRAILERS
470 #define IFF_NOTRAILERS 0x0
471 #endif /* IFF_NOTRAILERS */
472 #ifndef IFF_OACTIVE
473 #define IFF_OACTIVE 0x0
474 #endif /* IFF_OACTIVE */
475 #ifndef IFF_SIMPLEX
476 #define IFF_SIMPLEX 0x0
477 #endif /* IFF_SIMPLEX */
478 #ifndef IFF_LINK0
479 #define IFF_LINK0 0x0
480 #endif /* IFF_LINK0 */
481 #ifndef IFF_LINK1
482 #define IFF_LINK1 0x0
483 #endif /* IFF_LINK1 */
484 #ifndef IFF_LINK2
485 #define IFF_LINK2 0x0
486 #endif /* IFF_LINK2 */
487 #ifndef IFF_NOXMIT
488 #define IFF_NOXMIT 0x0
489 #endif /* IFF_NOXMIT */
490 #ifndef IFF_NORTEXCH
491 #define IFF_NORTEXCH 0x0
492 #endif /* IFF_NORTEXCH */
493 #ifndef IFF_IPV4
494 #define IFF_IPV4 0x0
495 #endif /* IFF_IPV4 */
496 #ifndef IFF_IPV6
497 #define IFF_IPV6 0x0
498 #endif /* IFF_IPV6 */
499 #ifndef IFF_VIRTUAL
500 #define IFF_VIRTUAL 0x0
501 #endif /* IFF_VIRTUAL */
502
503 /* Prototypes. */
504 extern int if_cmp_name_func(const char *p1, const char *p2);
505
506 /*
507 * Passing in VRF_UNKNOWN is a valid thing to do, unless we
508 * are creating a new interface.
509 *
510 * This is useful for vrf route-leaking. So more than anything
511 * else think before you use VRF_UNKNOWN
512 */
513 extern void if_update_to_new_vrf(struct interface *, vrf_id_t vrf_id);
514
515 extern struct interface *if_lookup_by_index(ifindex_t, vrf_id_t vrf_id);
516 extern struct interface *if_vrf_lookup_by_index_next(ifindex_t ifindex,
517 vrf_id_t vrf_id);
518 extern struct interface *if_lookup_by_index_all_vrf(ifindex_t);
519 extern struct interface *if_lookup_exact_address(const void *matchaddr,
520 int family, vrf_id_t vrf_id);
521 extern struct connected *if_lookup_address(const void *matchaddr, int family,
522 vrf_id_t vrf_id);
523 extern struct interface *if_lookup_prefix(const struct prefix *prefix,
524 vrf_id_t vrf_id);
525 size_t if_lookup_by_hwaddr(const uint8_t *hw_addr, size_t addrsz,
526 struct interface ***result, vrf_id_t vrf_id);
527
528 struct vrf;
529 extern struct interface *if_lookup_by_name_all_vrf(const char *ifname);
530 extern struct interface *if_lookup_by_name_vrf(const char *name, struct vrf *vrf);
531 extern struct interface *if_lookup_by_name(const char *ifname, vrf_id_t vrf_id);
532 extern struct interface *if_get_by_name(const char *ifname, vrf_id_t vrf_id,
533 const char *vrf_name);
534
535 /* Sets the index and adds to index list */
536 extern int if_set_index(struct interface *ifp, ifindex_t ifindex);
537
538 /* Delete the interface, but do not free the structure, and leave it in the
539 interface list. It is often advisable to leave the pseudo interface
540 structure because there may be configuration information attached. */
541 extern void if_delete_retain(struct interface *);
542
543 /* Delete and free the interface structure: calls if_delete_retain and then
544 deletes it from the interface list and frees the structure. */
545 extern void if_delete(struct interface **ifp);
546
547 extern int if_is_up(const struct interface *ifp);
548 extern int if_is_running(const struct interface *ifp);
549 extern int if_is_operative(const struct interface *ifp);
550 extern int if_is_no_ptm_operative(const struct interface *ifp);
551 extern int if_is_loopback(const struct interface *ifp);
552 extern int if_is_vrf(const struct interface *ifp);
553 extern bool if_is_loopback_or_vrf(const struct interface *ifp);
554 extern int if_is_broadcast(const struct interface *ifp);
555 extern int if_is_pointopoint(const struct interface *ifp);
556 extern int if_is_multicast(const struct interface *ifp);
557 extern void if_terminate(struct vrf *vrf);
558 extern void if_dump_all(void);
559 extern const char *if_flag_dump(unsigned long);
560 extern const char *if_link_type_str(enum zebra_link_type);
561
562 /* Please use ifindex2ifname instead of if_indextoname where possible;
563 ifindex2ifname uses internal interface info, whereas if_indextoname must
564 make a system call. */
565 extern const char *ifindex2ifname(ifindex_t, vrf_id_t vrf_id);
566
567 /* Please use ifname2ifindex instead of if_nametoindex where possible;
568 ifname2ifindex uses internal interface info, whereas if_nametoindex must
569 make a system call. */
570 extern ifindex_t ifname2ifindex(const char *ifname, vrf_id_t vrf_id);
571
572 /* Connected address functions. */
573 extern struct connected *connected_new(void);
574 extern void connected_free(struct connected **connected);
575 extern void connected_add(struct interface *, struct connected *);
576 extern struct connected *
577 connected_add_by_prefix(struct interface *, struct prefix *, struct prefix *);
578 extern struct connected *connected_delete_by_prefix(struct interface *,
579 struct prefix *);
580 extern struct connected *connected_lookup_prefix(struct interface *,
581 const struct prefix *);
582 extern struct connected *connected_lookup_prefix_exact(struct interface *,
583 const struct prefix *);
584 extern unsigned int connected_count_by_family(struct interface *, int family);
585 extern struct nbr_connected *nbr_connected_new(void);
586 extern void nbr_connected_free(struct nbr_connected *);
587 struct nbr_connected *nbr_connected_check(struct interface *, struct prefix *);
588 struct connected *connected_get_linklocal(struct interface *ifp);
589
590 /* link parameters */
591 struct if_link_params *if_link_params_get(struct interface *);
592 void if_link_params_free(struct interface *);
593
594 /* Northbound. */
595 struct vty;
596 extern void if_cmd_init(int (*config_write)(struct vty *));
597 extern void if_cmd_init_default(void);
598 extern void if_zapi_callbacks(int (*create)(struct interface *ifp),
599 int (*up)(struct interface *ifp),
600 int (*down)(struct interface *ifp),
601 int (*destroy)(struct interface *ifp));
602
603 extern void if_new_via_zapi(struct interface *ifp);
604 extern void if_up_via_zapi(struct interface *ifp);
605 extern void if_down_via_zapi(struct interface *ifp);
606 extern void if_destroy_via_zapi(struct interface *ifp);
607
608 extern const struct frr_yang_module_info frr_interface_info;
609
610 #ifdef __cplusplus
611 }
612 #endif
613
614 #endif /* _ZEBRA_IF_H */