netif.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
3  * Copyright (C) 2017 Freie Universit├Ąt Berlin
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
33 #ifndef NET_NETIF_H
34 #define NET_NETIF_H
35 
36 #include <stdint.h>
37 
38 #include "list.h"
39 #include "net/netopt.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
48 #ifndef NETIF_NAMELENMAX
49 #define NETIF_NAMELENMAX (8U)
50 #endif
51 
57 typedef struct {
59 } netif_t;
60 
72 netif_t *netif_iter(netif_t *last);
73 
90 int netif_get_name(netif_t *netif, char *name);
91 
104 netif_t *netif_get_by_name(const char *name);
105 
120 int netif_get_opt(netif_t *netif, netopt_t opt, uint16_t context,
121  void *value, size_t max_len);
122 
137 int netif_set_opt(netif_t *netif, netopt_t opt, uint16_t context,
138  void *value, size_t value_len);
139 
140 
151 int netif_register(netif_t *netif);
152 
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 #endif /* NET_NETIF_H */
158 
list_node_t node
Pointer to the next interface.
Definition: netif.h:58
int netif_get_opt(netif_t *netif, netopt_t opt, uint16_t context, void *value, size_t max_len)
Gets option from an interface.
Network interface descriptor.
Definition: netif.h:57
int netif_set_opt(netif_t *netif, netopt_t opt, uint16_t context, void *value, size_t value_len)
Sets option to an interface.
netif_t * netif_get_by_name(const char *name)
Gets interface by name.
netopt_t
Global list of configuration options available throughout the network stack, e.g. ...
Definition: netopt.h:59
Intrusive linked list.
netif_t * netif_iter(netif_t *last)
Iterator for the interfaces.
int netif_register(netif_t *netif)
Registers a network interface in the global interface list.
List node structure.
Definition: list.h:40
Definition of global configuration options.
int netif_get_name(netif_t *netif, char *name)
Gets name of an interface.