]>
Commit | Line | Data |
---|---|---|
718e3744 | 1 | /* Interface related header. |
896014f4 DL |
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 | */ | |
718e3744 | 20 | |
21 | #ifndef _ZEBRA_IF_H | |
22 | #define _ZEBRA_IF_H | |
23 | ||
b892f1dd | 24 | #include "zebra.h" |
718e3744 | 25 | #include "linklist.h" |
4a1ab8e4 | 26 | #include "memory.h" |
e80e7cce | 27 | #include "qobj.h" |
4a1ab8e4 DL |
28 | |
29 | DECLARE_MTYPE(IF) | |
30 | DECLARE_MTYPE(CONNECTED_LABEL) | |
718e3744 | 31 | |
8ccc7e80 TT |
32 | /* Interface link-layer type, if known. Derived from: |
33 | * | |
34 | * net/if_arp.h on various platforms - Linux especially. | |
35 | * http://www.iana.org/assignments/arp-parameters/arp-parameters.xhtml | |
36 | * | |
37 | * Some of the more obviously defunct technologies left out. | |
38 | */ | |
39 | enum zebra_link_type { | |
d62a17ae | 40 | ZEBRA_LLT_UNKNOWN = 0, |
41 | ZEBRA_LLT_ETHER, | |
42 | ZEBRA_LLT_EETHER, | |
43 | ZEBRA_LLT_AX25, | |
44 | ZEBRA_LLT_PRONET, | |
45 | ZEBRA_LLT_IEEE802, | |
46 | ZEBRA_LLT_ARCNET, | |
47 | ZEBRA_LLT_APPLETLK, | |
48 | ZEBRA_LLT_DLCI, | |
49 | ZEBRA_LLT_ATM, | |
50 | ZEBRA_LLT_METRICOM, | |
51 | ZEBRA_LLT_IEEE1394, | |
52 | ZEBRA_LLT_EUI64, | |
53 | ZEBRA_LLT_INFINIBAND, | |
54 | ZEBRA_LLT_SLIP, | |
55 | ZEBRA_LLT_CSLIP, | |
56 | ZEBRA_LLT_SLIP6, | |
57 | ZEBRA_LLT_CSLIP6, | |
58 | ZEBRA_LLT_RSRVD, | |
59 | ZEBRA_LLT_ADAPT, | |
60 | ZEBRA_LLT_ROSE, | |
61 | ZEBRA_LLT_X25, | |
62 | ZEBRA_LLT_PPP, | |
63 | ZEBRA_LLT_CHDLC, | |
64 | ZEBRA_LLT_LAPB, | |
65 | ZEBRA_LLT_RAWHDLC, | |
66 | ZEBRA_LLT_IPIP, | |
67 | ZEBRA_LLT_IPIP6, | |
68 | ZEBRA_LLT_FRAD, | |
69 | ZEBRA_LLT_SKIP, | |
70 | ZEBRA_LLT_LOOPBACK, | |
71 | ZEBRA_LLT_LOCALTLK, | |
72 | ZEBRA_LLT_FDDI, | |
73 | ZEBRA_LLT_SIT, | |
74 | ZEBRA_LLT_IPDDP, | |
75 | ZEBRA_LLT_IPGRE, | |
76 | ZEBRA_LLT_IP6GRE, | |
77 | ZEBRA_LLT_PIMREG, | |
78 | ZEBRA_LLT_HIPPI, | |
79 | ZEBRA_LLT_ECONET, | |
80 | ZEBRA_LLT_IRDA, | |
81 | ZEBRA_LLT_FCPP, | |
82 | ZEBRA_LLT_FCAL, | |
83 | ZEBRA_LLT_FCPL, | |
84 | ZEBRA_LLT_FCFABRIC, | |
85 | ZEBRA_LLT_IEEE802_TR, | |
86 | ZEBRA_LLT_IEEE80211, | |
87 | ZEBRA_LLT_IEEE80211_RADIOTAP, | |
88 | ZEBRA_LLT_IEEE802154, | |
89 | ZEBRA_LLT_IEEE802154_PHY, | |
8ccc7e80 TT |
90 | }; |
91 | ||
718e3744 | 92 | /* |
93 | Interface name length. | |
94 | ||
95 | Linux define value in /usr/include/linux/if.h. | |
96 | #define IFNAMSIZ 16 | |
97 | ||
98 | FreeBSD define value in /usr/include/net/if.h. | |
99 | #define IFNAMSIZ 16 | |
100 | */ | |
101 | ||
102 | #define INTERFACE_NAMSIZ 20 | |
103 | #define INTERFACE_HWADDR_MAX 20 | |
104 | ||
b892f1dd PJ |
105 | typedef signed int ifindex_t; |
106 | ||
718e3744 | 107 | #ifdef HAVE_PROC_NET_DEV |
d62a17ae | 108 | struct if_stats { |
109 | unsigned long rx_packets; /* total packets received */ | |
110 | unsigned long tx_packets; /* total packets transmitted */ | |
111 | unsigned long rx_bytes; /* total bytes received */ | |
112 | unsigned long tx_bytes; /* total bytes transmitted */ | |
113 | unsigned long rx_errors; /* bad packets received */ | |
114 | unsigned long tx_errors; /* packet transmit problems */ | |
115 | unsigned long rx_dropped; /* no space in linux buffers */ | |
116 | unsigned long tx_dropped; /* no space available in linux */ | |
117 | unsigned long rx_multicast; /* multicast packets received */ | |
118 | unsigned long rx_compressed; | |
119 | unsigned long tx_compressed; | |
120 | unsigned long collisions; | |
121 | ||
122 | /* detailed rx_errors: */ | |
123 | unsigned long rx_length_errors; | |
124 | unsigned long rx_over_errors; /* receiver ring buff overflow */ | |
125 | unsigned long rx_crc_errors; /* recved pkt with crc error */ | |
126 | unsigned long rx_frame_errors; /* recv'd frame alignment error */ | |
127 | unsigned long rx_fifo_errors; /* recv'r fifo overrun */ | |
128 | unsigned long rx_missed_errors; /* receiver missed packet */ | |
129 | /* detailed tx_errors */ | |
130 | unsigned long tx_aborted_errors; | |
131 | unsigned long tx_carrier_errors; | |
132 | unsigned long tx_fifo_errors; | |
133 | unsigned long tx_heartbeat_errors; | |
134 | unsigned long tx_window_errors; | |
718e3744 | 135 | }; |
136 | #endif /* HAVE_PROC_NET_DEV */ | |
137 | ||
16f1b9ee OD |
138 | /* Here are "non-official" architectural constants. */ |
139 | #define TE_EXT_MASK 0x0FFFFFFF | |
140 | #define TE_EXT_ANORMAL 0x80000000 | |
141 | #define LOSS_PRECISION 0.000003 | |
142 | #define TE_KILO_BIT 1000 | |
143 | #define TE_BYTE 8 | |
144 | #define DEFAULT_BANDWIDTH 10000 | |
145 | #define MAX_CLASS_TYPE 8 | |
146 | #define MAX_PKT_LOSS 50.331642 | |
147 | ||
daf0a4d2 OD |
148 | /* |
149 | * Link Parameters Status: | |
150 | * equal to 0: unset | |
151 | * different from 0: set | |
152 | */ | |
16f1b9ee | 153 | #define LP_UNSET 0x0000 |
daf0a4d2 | 154 | #define LP_TE_METRIC 0x0001 |
16f1b9ee OD |
155 | #define LP_MAX_BW 0x0002 |
156 | #define LP_MAX_RSV_BW 0x0004 | |
157 | #define LP_UNRSV_BW 0x0008 | |
158 | #define LP_ADM_GRP 0x0010 | |
159 | #define LP_RMT_AS 0x0020 | |
160 | #define LP_DELAY 0x0040 | |
161 | #define LP_MM_DELAY 0x0080 | |
162 | #define LP_DELAY_VAR 0x0100 | |
163 | #define LP_PKT_LOSS 0x0200 | |
164 | #define LP_RES_BW 0x0400 | |
165 | #define LP_AVA_BW 0x0800 | |
166 | #define LP_USE_BW 0x1000 | |
167 | ||
168 | #define IS_PARAM_UNSET(lp, st) !(lp->lp_status & st) | |
169 | #define IS_PARAM_SET(lp, st) (lp->lp_status & st) | |
170 | #define IS_LINK_PARAMS_SET(lp) (lp->lp_status != LP_UNSET) | |
171 | ||
172 | #define SET_PARAM(lp, st) (lp->lp_status) |= (st) | |
173 | #define UNSET_PARAM(lp, st) (lp->lp_status) &= ~(st) | |
174 | #define RESET_LINK_PARAM(lp) (lp->lp_status = LP_UNSET) | |
175 | ||
176 | /* Link Parameters for Traffic Engineering */ | |
177 | struct if_link_params { | |
d62a17ae | 178 | u_int32_t lp_status; /* Status of Link Parameters: */ |
179 | u_int32_t te_metric; /* Traffic Engineering metric */ | |
180 | float default_bw; | |
181 | float max_bw; /* Maximum Bandwidth */ | |
182 | float max_rsv_bw; /* Maximum Reservable Bandwidth */ | |
183 | float unrsv_bw[MAX_CLASS_TYPE]; /* Unreserved Bandwidth per Class Type | |
184 | (8) */ | |
185 | u_int32_t admin_grp; /* Administrative group */ | |
186 | u_int32_t rmt_as; /* Remote AS number */ | |
187 | struct in_addr rmt_ip; /* Remote IP address */ | |
188 | u_int32_t av_delay; /* Link Average Delay */ | |
189 | u_int32_t min_delay; /* Link Min Delay */ | |
190 | u_int32_t max_delay; /* Link Max Delay */ | |
191 | u_int32_t delay_var; /* Link Delay Variation */ | |
192 | float pkt_loss; /* Link Packet Loss */ | |
193 | float res_bw; /* Residual Bandwidth */ | |
194 | float ava_bw; /* Available Bandwidth */ | |
195 | float use_bw; /* Utilized Bandwidth */ | |
16f1b9ee OD |
196 | }; |
197 | ||
198 | #define INTERFACE_LINK_PARAMS_SIZE sizeof(struct if_link_params) | |
199 | #define HAS_LINK_PARAMS(ifp) ((ifp)->link_params != NULL) | |
200 | ||
718e3744 | 201 | /* Interface structure */ |
d62a17ae | 202 | struct interface { |
203 | /* Interface name. This should probably never be changed after the | |
204 | interface is created, because the configuration info for this | |
205 | interface | |
206 | is associated with this structure. For that reason, the interface | |
207 | should also never be deleted (to avoid losing configuration info). | |
208 | To delete, just set ifindex to IFINDEX_INTERNAL to indicate that the | |
209 | interface does not exist in the kernel. | |
210 | */ | |
211 | char name[INTERFACE_NAMSIZ + 1]; | |
212 | ||
213 | /* Interface index (should be IFINDEX_INTERNAL for non-kernel or | |
214 | deleted interfaces). */ | |
215 | ifindex_t ifindex; | |
d2fc8896 | 216 | #define IFINDEX_INTERNAL 0 |
b892f1dd | 217 | #define IFINDEX_DELETED INT_MAX |
718e3744 | 218 | |
d62a17ae | 219 | /* Zebra internal interface status */ |
220 | u_char status; | |
718e3744 | 221 | #define ZEBRA_INTERFACE_ACTIVE (1 << 0) |
222 | #define ZEBRA_INTERFACE_SUB (1 << 1) | |
2e3b2e47 | 223 | #define ZEBRA_INTERFACE_LINKDETECTION (1 << 2) |
c23af4d3 | 224 | #define ZEBRA_INTERFACE_VRF_LOOPBACK (1 << 3) |
525c1839 | 225 | |
d62a17ae | 226 | /* Interface flags. */ |
227 | uint64_t flags; | |
718e3744 | 228 | |
d62a17ae | 229 | /* Interface metric */ |
230 | uint32_t metric; | |
718e3744 | 231 | |
d62a17ae | 232 | /* Interface Speed in Mb/s */ |
233 | uint32_t speed; | |
2d7f0d76 | 234 | |
d62a17ae | 235 | /* Interface MTU. */ |
236 | unsigned int mtu; /* IPv4 MTU */ | |
237 | unsigned int | |
238 | mtu6; /* IPv6 MTU - probably, but not neccessarily same as mtu | |
9d303b37 | 239 | */ |
718e3744 | 240 | |
d62a17ae | 241 | /* Link-layer information and hardware address */ |
242 | enum zebra_link_type ll_type; | |
243 | u_char hw_addr[INTERFACE_HWADDR_MAX]; | |
244 | int hw_addr_len; | |
718e3744 | 245 | |
d62a17ae | 246 | /* interface bandwidth, kbits */ |
247 | unsigned int bandwidth; | |
16f1b9ee | 248 | |
d62a17ae | 249 | /* Link parameters for Traffic Engineering */ |
250 | struct if_link_params *link_params; | |
718e3744 | 251 | |
d62a17ae | 252 | /* description of the interface. */ |
253 | char *desc; | |
718e3744 | 254 | |
d62a17ae | 255 | /* Distribute list. */ |
256 | void *distribute_in; | |
257 | void *distribute_out; | |
718e3744 | 258 | |
d62a17ae | 259 | /* Connected address list. */ |
260 | struct list *connected; | |
a80beece | 261 | |
d62a17ae | 262 | /* Neighbor connected address list. */ |
263 | struct list *nbr_connected; | |
718e3744 | 264 | |
d62a17ae | 265 | /* Daemon specific interface data pointer. */ |
266 | void *info; | |
244c1cdc | 267 | |
d62a17ae | 268 | char ptm_enable; /* Should we look at ptm_status ? */ |
269 | char ptm_status; | |
270 | ||
271 | /* Statistics fileds. */ | |
718e3744 | 272 | #ifdef HAVE_PROC_NET_DEV |
d62a17ae | 273 | struct if_stats stats; |
274 | #endif /* HAVE_PROC_NET_DEV */ | |
718e3744 | 275 | #ifdef HAVE_NET_RT_IFLIST |
d62a17ae | 276 | struct if_data stats; |
718e3744 | 277 | #endif /* HAVE_NET_RT_IFLIST */ |
3968dbf8 | 278 | |
d62a17ae | 279 | struct route_node *node; |
280 | vrf_id_t vrf_id; | |
e80e7cce | 281 | |
d62a17ae | 282 | QOBJ_FIELDS |
718e3744 | 283 | }; |
e80e7cce | 284 | DECLARE_QOBJ_TYPE(interface) |
718e3744 | 285 | |
286 | /* Connected address structure. */ | |
d62a17ae | 287 | struct connected { |
288 | /* Attached interface. */ | |
289 | struct interface *ifp; | |
718e3744 | 290 | |
d62a17ae | 291 | /* Flags for configuration. */ |
292 | u_char conf; | |
718e3744 | 293 | #define ZEBRA_IFC_REAL (1 << 0) |
294 | #define ZEBRA_IFC_CONFIGURED (1 << 1) | |
f7f740fe | 295 | #define ZEBRA_IFC_QUEUED (1 << 2) |
d62a17ae | 296 | /* |
297 | The ZEBRA_IFC_REAL flag should be set if and only if this address | |
298 | exists in the kernel and is actually usable. (A case where it exists | |
299 | but | |
300 | is not yet usable would be IPv6 with DAD) | |
301 | The ZEBRA_IFC_CONFIGURED flag should be set if and only if this | |
302 | address | |
303 | was configured by the user from inside quagga. | |
304 | The ZEBRA_IFC_QUEUED flag should be set if and only if the address | |
305 | exists | |
306 | in the kernel. It may and should be set although the address might | |
307 | not be | |
308 | usable yet. (compare with ZEBRA_IFC_REAL) | |
309 | */ | |
310 | ||
311 | /* Flags for connected address. */ | |
312 | u_char flags; | |
e4529636 AS |
313 | #define ZEBRA_IFA_SECONDARY (1 << 0) |
314 | #define ZEBRA_IFA_PEER (1 << 1) | |
525c1839 | 315 | #define ZEBRA_IFA_UNNUMBERED (1 << 2) |
d62a17ae | 316 | /* N.B. the ZEBRA_IFA_PEER flag should be set if and only if |
317 | a peer address has been configured. If this flag is set, | |
318 | the destination field must contain the peer address. | |
319 | Otherwise, if this flag is not set, the destination address | |
320 | will either contain a broadcast address or be NULL. | |
321 | */ | |
322 | ||
323 | /* Address of connected network. */ | |
324 | struct prefix *address; | |
325 | ||
326 | /* Peer or Broadcast address, depending on whether ZEBRA_IFA_PEER is | |
327 | set. | |
328 | Note: destination may be NULL if ZEBRA_IFA_PEER is not set. */ | |
329 | struct prefix *destination; | |
330 | ||
331 | /* Label for Linux 2.2.X and upper. */ | |
332 | char *label; | |
718e3744 | 333 | }; |
334 | ||
a80beece | 335 | /* Nbr Connected address structure. */ |
d62a17ae | 336 | struct nbr_connected { |
337 | /* Attached interface. */ | |
338 | struct interface *ifp; | |
a80beece | 339 | |
d62a17ae | 340 | /* Address of connected network. */ |
341 | struct prefix *address; | |
a80beece DS |
342 | }; |
343 | ||
e4529636 AS |
344 | /* Does the destination field contain a peer address? */ |
345 | #define CONNECTED_PEER(C) CHECK_FLAG((C)->flags, ZEBRA_IFA_PEER) | |
346 | ||
347 | /* Prefix to insert into the RIB */ | |
d62a17ae | 348 | #define CONNECTED_PREFIX(C) \ |
e4529636 | 349 | (CONNECTED_PEER(C) ? (C)->destination : (C)->address) |
3fb9cd6e | 350 | |
e4529636 AS |
351 | /* Identifying address. We guess that if there's a peer address, but the |
352 | local address is in the same prefix, then the local address may be unique. */ | |
d62a17ae | 353 | #define CONNECTED_ID(C) \ |
354 | ((CONNECTED_PEER(C) && !prefix_match((C)->destination, (C)->address)) \ | |
355 | ? (C)->destination \ | |
356 | : (C)->address) | |
3fb9cd6e | 357 | |
718e3744 | 358 | /* Interface hook sort. */ |
359 | #define IF_NEW_HOOK 0 | |
360 | #define IF_DELETE_HOOK 1 | |
361 | ||
362 | /* There are some interface flags which are only supported by some | |
363 | operating system. */ | |
364 | ||
365 | #ifndef IFF_NOTRAILERS | |
366 | #define IFF_NOTRAILERS 0x0 | |
367 | #endif /* IFF_NOTRAILERS */ | |
368 | #ifndef IFF_OACTIVE | |
369 | #define IFF_OACTIVE 0x0 | |
370 | #endif /* IFF_OACTIVE */ | |
371 | #ifndef IFF_SIMPLEX | |
372 | #define IFF_SIMPLEX 0x0 | |
373 | #endif /* IFF_SIMPLEX */ | |
374 | #ifndef IFF_LINK0 | |
375 | #define IFF_LINK0 0x0 | |
376 | #endif /* IFF_LINK0 */ | |
377 | #ifndef IFF_LINK1 | |
378 | #define IFF_LINK1 0x0 | |
379 | #endif /* IFF_LINK1 */ | |
380 | #ifndef IFF_LINK2 | |
381 | #define IFF_LINK2 0x0 | |
382 | #endif /* IFF_LINK2 */ | |
4ba9b924 | 383 | #ifndef IFF_NOXMIT |
384 | #define IFF_NOXMIT 0x0 | |
385 | #endif /* IFF_NOXMIT */ | |
386 | #ifndef IFF_NORTEXCH | |
387 | #define IFF_NORTEXCH 0x0 | |
388 | #endif /* IFF_NORTEXCH */ | |
389 | #ifndef IFF_IPV4 | |
390 | #define IFF_IPV4 0x0 | |
391 | #endif /* IFF_IPV4 */ | |
392 | #ifndef IFF_IPV6 | |
393 | #define IFF_IPV6 0x0 | |
394 | #endif /* IFF_IPV6 */ | |
395 | #ifndef IFF_VIRTUAL | |
396 | #define IFF_VIRTUAL 0x0 | |
397 | #endif /* IFF_VIRTUAL */ | |
718e3744 | 398 | |
399 | /* Prototypes. */ | |
d62a17ae | 400 | extern int if_cmp_name_func(char *, char *); |
401 | ||
402 | extern void if_update_to_new_vrf(struct interface *, vrf_id_t vrf_id); | |
403 | extern struct interface *if_create(const char *name, int namelen, | |
404 | vrf_id_t vrf_id); | |
405 | extern struct interface *if_lookup_by_index(ifindex_t, vrf_id_t vrf_id); | |
406 | extern struct interface *if_lookup_exact_address(void *matchaddr, int family, | |
407 | vrf_id_t vrf_id); | |
408 | extern struct connected *if_lookup_address(void *matchaddr, int family, | |
409 | vrf_id_t vrf_id); | |
410 | extern struct interface *if_lookup_prefix(struct prefix *prefix, | |
411 | vrf_id_t vrf_id); | |
8736158a | 412 | |
92a57eb2 | 413 | /* These 3 functions are to be used when the ifname argument is terminated |
08dbfb69 | 414 | by a '\0' character: */ |
d62a17ae | 415 | extern struct interface *if_lookup_by_name_all_vrf(const char *ifname); |
416 | extern struct interface *if_lookup_by_name(const char *ifname, vrf_id_t vrf_id); | |
417 | extern struct interface *if_get_by_name(const char *ifname, vrf_id_t vrf_id); | |
8736158a | 418 | |
08dbfb69 | 419 | /* For these 2 functions, the namelen argument should be the precise length |
420 | of the ifname string (not counting any optional trailing '\0' character). | |
421 | In most cases, strnlen should be used to calculate the namelen value. */ | |
fa787f91 | 422 | extern struct interface *if_lookup_by_name_len(const char *ifname, |
d62a17ae | 423 | size_t namelen, vrf_id_t vrf_id); |
424 | extern struct interface *if_get_by_name_len(const char *ifname, size_t namelen, | |
425 | vrf_id_t vrf_id, int vty); | |
a349198f | 426 | |
427 | ||
d2fc8896 | 428 | /* Delete the interface, but do not free the structure, and leave it in the |
d62a17ae | 429 | interface list. It is often advisable to leave the pseudo interface |
d2fc8896 | 430 | structure because there may be configuration information attached. */ |
d62a17ae | 431 | extern void if_delete_retain(struct interface *); |
d2fc8896 | 432 | |
433 | /* Delete and free the interface structure: calls if_delete_retain and then | |
434 | deletes it from the interface list and frees the structure. */ | |
d62a17ae | 435 | extern void if_delete(struct interface *); |
436 | ||
437 | extern int if_is_up(struct interface *); | |
438 | extern int if_is_running(struct interface *); | |
439 | extern int if_is_operative(struct interface *); | |
440 | extern int if_is_no_ptm_operative(struct interface *); | |
441 | extern int if_is_loopback(struct interface *); | |
442 | extern int if_is_broadcast(struct interface *); | |
443 | extern int if_is_pointopoint(struct interface *); | |
444 | extern int if_is_multicast(struct interface *); | |
445 | extern void if_add_hook(int, int (*)(struct interface *)); | |
446 | extern void if_init(struct list **); | |
447 | extern void if_cmd_init(void); | |
448 | extern void if_terminate(struct list **); | |
449 | extern void if_dump_all(void); | |
847947f2 | 450 | extern const char *if_flag_dump(unsigned long); |
d62a17ae | 451 | extern const char *if_link_type_str(enum zebra_link_type); |
718e3744 | 452 | |
d2fc8896 | 453 | /* Please use ifindex2ifname instead of if_indextoname where possible; |
454 | ifindex2ifname uses internal interface info, whereas if_indextoname must | |
455 | make a system call. */ | |
d62a17ae | 456 | extern const char *ifindex2ifname(ifindex_t, vrf_id_t vrf_id); |
d2fc8896 | 457 | |
458 | /* Please use ifname2ifindex instead of if_nametoindex where possible; | |
459 | ifname2ifindex uses internal interface info, whereas if_nametoindex must | |
460 | make a system call. */ | |
128c2be2 | 461 | extern ifindex_t ifname2ifindex(const char *ifname, vrf_id_t vrf_id); |
d2fc8896 | 462 | |
718e3744 | 463 | /* Connected address functions. */ |
d62a17ae | 464 | extern struct connected *connected_new(void); |
465 | extern void connected_free(struct connected *); | |
466 | extern void connected_add(struct interface *, struct connected *); | |
467 | extern struct connected * | |
468 | connected_add_by_prefix(struct interface *, struct prefix *, struct prefix *); | |
469 | extern struct connected *connected_delete_by_prefix(struct interface *, | |
470 | struct prefix *); | |
471 | extern struct connected *connected_lookup_prefix(struct interface *, | |
472 | struct prefix *); | |
473 | extern struct connected *connected_lookup_prefix_exact(struct interface *, | |
474 | struct prefix *); | |
475 | extern struct nbr_connected *nbr_connected_new(void); | |
476 | extern void nbr_connected_free(struct nbr_connected *); | |
477 | struct nbr_connected *nbr_connected_check(struct interface *, struct prefix *); | |
718e3744 | 478 | |
16f1b9ee | 479 | /* link parameters */ |
d62a17ae | 480 | struct if_link_params *if_link_params_get(struct interface *); |
481 | void if_link_params_free(struct interface *); | |
16f1b9ee | 482 | |
718e3744 | 483 | #endif /* _ZEBRA_IF_H */ |