21 #ifndef NET_GNRC_NETIF_INTERNAL_H
22 #define NET_GNRC_NETIF_INTERNAL_H
30 #ifdef MODULE_GNRC_IPV6_NIB
41 #define GNRC_NETIF_PKTQ_DEQUEUE_MSG (0x1233)
46 #define NETDEV_MSG_TYPE_EVENT (0x1234)
66 #if IS_USED(MODULE_GNRC_NETIF_IPV6) || DOXYGEN
102 int gnrc_netif_ipv6_addr_add_internal(
gnrc_netif_t *netif,
104 unsigned pfx_len, uint8_t flags);
116 void gnrc_netif_ipv6_addr_remove_internal(
gnrc_netif_t *netif,
147 static inline uint8_t gnrc_netif_ipv6_addr_get_state(
const gnrc_netif_t *netif,
163 static inline uint8_t gnrc_netif_ipv6_addr_dad_trans(
const gnrc_netif_t *netif,
258 int gnrc_netif_ipv6_group_join_internal(
gnrc_netif_t *netif,
271 void gnrc_netif_ipv6_group_leave_internal(
gnrc_netif_t *netif,
300 static inline void gnrc_netif_ipv6_bus_post(
gnrc_netif_t *netif,
int type,
303 #ifdef MODULE_GNRC_NETIF_BUS
327 static inline bool gnrc_netif_is_rtr(
const gnrc_netif_t *netif)
329 if (
IS_USED(MODULE_GNRC_IPV6_ROUTER)) {
350 static inline bool gnrc_netif_is_rtr_adv(
const gnrc_netif_t *netif)
352 if (
IS_USED(MODULE_GNRC_IPV6_ROUTER)) {
388 static inline bool gnrc_netif_is_6lo(
const gnrc_netif_t *netif)
391 IS_USED(MODULE_GNRC_SIXLOWPAN)) || \
392 IS_USED(MODULE_GNRC_SIXLOENC)) {
393 return gnrc_netif_dev_is_6lo(netif);
417 static inline bool gnrc_netif_is_6ln(
const gnrc_netif_t *netif)
441 static inline bool gnrc_netif_is_6lr(
const gnrc_netif_t *netif)
445 (
IS_USED(MODULE_GNRC_IPV6_ROUTER) ||
447 !
IS_USED(MODULE_GNRC_SIXLOWPAN))) {
448 return gnrc_netif_is_rtr(netif) && gnrc_netif_is_6ln(netif);
469 static inline bool gnrc_netif_is_6lbr(
const gnrc_netif_t *netif)
473 gnrc_netif_is_6lr(netif);
522 int gnrc_netif_eui64_from_addr(
const gnrc_netif_t *netif,
523 const uint8_t *addr,
size_t addr_len,
543 #if GNRC_NETIF_L2ADDR_MAXLEN > 0
545 return gnrc_netif_eui64_from_addr(netif,
563 #if IS_USED(MODULE_GNRC_NETIF_IPV6) || defined(DOXYGEN)
595 int gnrc_netif_ipv6_iid_from_addr(
const gnrc_netif_t *netif,
596 const uint8_t *addr,
size_t addr_len,
623 static inline int gnrc_netif_ipv6_iid_to_addr(
const gnrc_netif_t *netif,
624 const eui64_t *iid, uint8_t *addr)
651 #if GNRC_NETIF_L2ADDR_MAXLEN > 0
653 return gnrc_netif_ipv6_iid_from_addr(netif,
690 static inline int gnrc_netif_ndp_addr_len_from_l2ao(
gnrc_netif_t *netif,
712 static inline int gnrc_netif_ipv6_group_to_l2_group(
gnrc_netif_t *netif,
720 #define gnrc_netif_ipv6_init_mtu(netif) (void)netif
721 #define gnrc_netif_ipv6_iid_from_addr(netif, addr, addr_len, iid) (-ENOTSUP)
722 #define gnrc_netif_ipv6_iid_to_addr(netif, iid, addr) (-ENOTSUP)
723 #define gnrc_netif_ndp_addr_len_from_l2ao(netif, opt) (-ENOTSUP)
724 #define gnrc_netif_ipv6_get_iid(netif, iid) (-ENOTSUP)
725 #define gnrc_netif_ipv6_group_to_l2_group(netif, ipv6_group, l2_group) (-ENOTSUP)
#define CONFIG_GNRC_IPV6_NIB_6LR
enable features for 6Lo router
netopt_t
Global list of configuration options available throughout the network stack, e.g.
#define GNRC_NETIF_FLAGS_IPV6_RTR_ADV
Network interface advertises itself as an IPv6 router (implies GNRC_NETIF_FLAGS_IPV6_FORWARDING to be...
#define ENOTSUP
Not supported (may be the same value as [EOPNOTSUPP]).
Link-layer helper function definitions.
#define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_MASK
Mask for the address' state.
#define GNRC_NETIF_FLAGS_6LN
This interface represents a 6Lo node (6LN) according to RFC 6775.
#define CONFIG_GNRC_IPV6_NIB_6LBR
enable features for 6Lo border router
Common macros and compiler attributes/pragmas configuration.
#define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_TENTATIVE
Tentative states (with encoded DAD retransmissions)
#define assert(cond)
abort the program if assertion is false
Data type to represent an IPv6 address.
Definition of global configuration options.
static int msg_bus_post(msg_bus_t *bus, uint8_t type, const void *arg)
Post a message to a bus.
static bool gnrc_netif_highlander(void)
Check if there can only be one gnrc_netif_t interface.
uint8_t addrs_flags[CONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF]
Flags for gnrc_netif_t::ipv6_addrs.
uint32_t flags
Flags for the interface.
#define CONFIG_GNRC_IPV6_NIB_6LN
enable features for 6Lo node
gnrc_netif_ipv6_t ipv6
IPv6 component.
Representation of a network interface.
Configuration macro definitions for neighbor information base.
#define GNRC_NETIF_FLAGS_HAS_L2ADDR
Network interface has link-layer address.
#define IS_ACTIVE(macro)
Allows to verify a macro definition outside the preprocessor.
uint8_t l2addr[GNRC_NETIF_L2ADDR_MAXLEN]
The link-layer address currently used as the source address on this interface.
int l2util_ndp_addr_len_from_l2ao(int dev_type, const ndp_opt_t *opt)
Derives the length of the link-layer address in an NDP link-layer address option from that option's l...
int l2util_ipv6_group_to_l2_group(int dev_type, const ipv6_addr_t *ipv6_group, uint8_t *l2_group)
Converts an IPv6 multicast address to a multicast address of the respective link layer.
#define GNRC_NETIF_FLAGS_6LO_ABR
This interface acts as a 6Lo border router to the LLN.
#define IS_USED(module)
Checks whether a module is being used or not. Can be used in C conditionals.
Data type to represent an EUI-64.
Definition for GNRC's network interfaces.
uint8_t device_type
Device type.
@ GNRC_NETIF_BUS_IPV6
provides gnrc_ipv6_event_t messages to subscribers
#define GNRC_NETIF_FLAGS_IPV6_FORWARDING
Network interface is enabled for IPv6 forwarding.
uint8_t l2addr_len
Length in bytes of gnrc_netif_t::l2addr.
General NDP option format.
int l2util_ipv6_iid_to_addr(int dev_type, const eui64_t *iid, uint8_t *addr)
Converts an IPv6 IID to a hardware address.
msg_bus_t bus[GNRC_NETIF_BUS_NUMOF]
Event Message Bus.