The friendly Operating System for the Internet of Things
netif.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
25 #ifndef GNRC_NETIF_H
26 #define GNRC_NETIF_H
27 
28 #include <stdlib.h>
29 #include <stdbool.h>
30 #include "kernel_types.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
39 #ifndef GNRC_NETIF_NUMOF
40 #define GNRC_NETIF_NUMOF (1)
41 #endif
42 
49 typedef void (*gnrc_netif_op_t)(kernel_pid_t pid);
50 
58 typedef struct {
60  gnrc_netif_op_t remove;
62 
66 void gnrc_netif_init(void);
67 
77 
84 
93 size_t gnrc_netif_get(kernel_pid_t *netifs);
94 
104 
122 char *gnrc_netif_addr_to_str(char *out, size_t out_len, const uint8_t *addr,
123  size_t addr_len);
124 
139 size_t gnrc_netif_addr_from_str(uint8_t *out, size_t out_len, const char *str);
140 
141 #ifdef __cplusplus
142 }
143 #endif
144 
145 #endif /* GNRC_NETIF_H */
146 
void(* gnrc_netif_op_t)(kernel_pid_t pid)
The add/remove operation to set network layer protocol specific options for an interface.
Definition: netif.h:49
Types used by the kernel.
int16_t kernel_pid_t
Unique process identifier.
Definition: kernel_types.h:83
size_t gnrc_netif_get(kernel_pid_t *netifs)
Get all active interfaces.
The add and remove handlers to set network layer protocol specific options for an interface...
Definition: netif.h:58
void gnrc_netif_init(void)
Initializes module.
void gnrc_netif_remove(kernel_pid_t pid)
Removes a thread as interface.
char * gnrc_netif_addr_to_str(char *out, size_t out_len, const uint8_t *addr, size_t addr_len)
Converts a hardware address to a human readable string.
int gnrc_netif_add(kernel_pid_t pid)
Adds a thread as interface.
gnrc_netif_op_t add
The add operation.
Definition: netif.h:59
stdlib.h wrapper for MSP430
bool gnrc_netif_exist(kernel_pid_t pid)
Check if an interface exist.
size_t gnrc_netif_addr_from_str(uint8_t *out, size_t out_len, const char *str)
Parses a string of colon-separated hexadecimals to a hardware address.