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#include <zephyr/net/net_ip.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
27#define IF_NAMESIZE NET_IFNAMSIZ
28
29#if !(defined(_IF_NAMEINDEX_DECLARED) || defined(__if_nameindex_defined)) || defined(__DOXYGEN__)
32 unsigned int if_index;
33 char *if_name;
34};
35#define _IF_NAMEINDEX_DECLARED
36#define __if_nameindex_defined
37#endif
38
47char *if_indextoname(unsigned int ifindex, char *ifname);
48
56
68
76unsigned int if_nametoindex(const char *ifname);
77
78
79#ifdef __cplusplus
80}
81#endif
82
83#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:31
unsigned int if_index
Numeric interface index.
Definition if.h:32
char * if_name
Interface name string.
Definition if.h:33