posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
if.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Linaro Limited
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
17#ifndef ZEPHYR_INCLUDE_POSIX_NET_IF_H_
18#define ZEPHYR_INCLUDE_POSIX_NET_IF_H_
19
20#ifdef CONFIG_NET_INTERFACE_NAME_LEN
22#define IF_NAMESIZE CONFIG_NET_INTERFACE_NAME_LEN
23#else
24#define IF_NAMESIZE 1
25#endif
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
33 unsigned int if_index;
34 char *if_name;
35};
36
45char *if_indextoname(unsigned int ifindex, char *ifname);
46
54
65
72unsigned int if_nametoindex(const char *ifname);
73
74
75#ifdef __cplusplus
76}
77#endif
78
79#endif /* ZEPHYR_INCLUDE_POSIX_NET_IF_H_ */
void if_freenameindex(struct if_nameindex *ptr)
Free a list returned by if_nameindex().
char * if_indextoname(unsigned int ifindex, char *ifname)
Map a network interface index to its name.
unsigned int if_nametoindex(const char *ifname)
Map a network interface name to its index.
Network interface name-to-index mapping.
Definition if.h:32
unsigned int if_index
Numeric interface index.
Definition if.h:33
char * if_name
Interface name string.
Definition if.h:34