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)
61#if IS_USED(MODULE_GNRC_NETIF_IPV6) || DOXYGEN
97int gnrc_netif_ipv6_addr_add_internal(
gnrc_netif_t *netif,
99 unsigned pfx_len, uint8_t flags);
111void gnrc_netif_ipv6_addr_remove_internal(
gnrc_netif_t *netif,
141static inline uint8_t gnrc_netif_ipv6_addr_get_state(
const gnrc_netif_t *netif,
157static inline uint8_t gnrc_netif_ipv6_addr_dad_trans(
const gnrc_netif_t *netif,
252int gnrc_netif_ipv6_group_join_internal(
gnrc_netif_t *netif,
265void gnrc_netif_ipv6_group_leave_internal(
gnrc_netif_t *netif,
294static inline void gnrc_netif_ipv6_bus_post(
gnrc_netif_t *netif,
int type,
297#ifdef MODULE_GNRC_NETIF_BUS
321static inline bool gnrc_netif_is_rtr(
const gnrc_netif_t *netif)
323 if (
IS_USED(MODULE_GNRC_IPV6_ROUTER)) {
344static inline bool gnrc_netif_is_rtr_adv(
const gnrc_netif_t *netif)
346 if (
IS_USED(MODULE_GNRC_IPV6_ROUTER)) {
382static inline bool gnrc_netif_is_6lo(
const gnrc_netif_t *netif)
385 IS_USED(MODULE_GNRC_SIXLOWPAN)) || \
386 IS_USED(MODULE_GNRC_SIXLOENC)) {
387 return gnrc_netif_dev_is_6lo(netif);
411static inline bool gnrc_netif_is_6ln(
const gnrc_netif_t *netif)
435static inline bool gnrc_netif_is_6lr(
const gnrc_netif_t *netif)
439 (
IS_USED(MODULE_GNRC_IPV6_ROUTER) ||
441 !
IS_USED(MODULE_GNRC_SIXLOWPAN))) {
442 return gnrc_netif_is_rtr(netif) && gnrc_netif_is_6ln(netif);
463static inline bool gnrc_netif_is_6lbr(
const gnrc_netif_t *netif)
467 gnrc_netif_is_6lr(netif);
516int gnrc_netif_eui64_from_addr(
const gnrc_netif_t *netif,
517 const uint8_t *addr,
size_t addr_len,
537#if GNRC_NETIF_L2ADDR_MAXLEN > 0
539 return gnrc_netif_eui64_from_addr(netif,
557#if IS_USED(MODULE_GNRC_NETIF_IPV6) || defined(DOXYGEN)
589int gnrc_netif_ipv6_iid_from_addr(
const gnrc_netif_t *netif,
590 const uint8_t *addr,
size_t addr_len,
617static inline int gnrc_netif_ipv6_iid_to_addr(
const gnrc_netif_t *netif,
618 const eui64_t *iid, uint8_t *addr)
645#if GNRC_NETIF_L2ADDR_MAXLEN > 0
647 return gnrc_netif_ipv6_iid_from_addr(netif,
684static inline int gnrc_netif_ndp_addr_len_from_l2ao(
gnrc_netif_t *netif,
706static inline int gnrc_netif_ipv6_group_to_l2_group(
gnrc_netif_t *netif,
735 uint32_t valid, uint32_t pref);
737#define gnrc_netif_ipv6_init_mtu(netif) (void)netif
738#define gnrc_netif_ipv6_iid_from_addr(netif, addr, addr_len, iid) (-ENOTSUP)
739#define gnrc_netif_ipv6_iid_to_addr(netif, iid, addr) (-ENOTSUP)
740#define gnrc_netif_ndp_addr_len_from_l2ao(netif, opt) (-ENOTSUP)
741#define gnrc_netif_ipv6_get_iid(netif, iid) (-ENOTSUP)
742#define gnrc_netif_ipv6_group_to_l2_group(netif, ipv6_group, l2_group) (-ENOTSUP)
#define assert(cond)
abort the program if assertion is false
#define GNRC_NETIF_FLAGS_IPV6_RTR_ADV
Network interface advertises itself as an IPv6 router (implies GNRC_NETIF_FLAGS_IPV6_FORWARDING to be...
#define GNRC_NETIF_FLAGS_HAS_L2ADDR
Network interface has link-layer address.
#define GNRC_NETIF_FLAGS_6LO_ABR
This interface acts as a 6Lo border router to the LLN.
#define GNRC_NETIF_FLAGS_IPV6_FORWARDING
Network interface is enabled for IPv6 forwarding.
#define GNRC_NETIF_FLAGS_6LN
This interface represents a 6Lo node (6LN) according to RFC 6775.
#define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_TENTATIVE
Tentative states (with encoded DAD retransmissions)
#define GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_MASK
Mask for the address' state.
Definition for GNRC's network interfaces.
#define ENOTSUP
Not supported (may be the same value as [EOPNOTSUPP]).
#define CONFIG_GNRC_IPV6_NIB_6LBR
enable features for 6Lo border router
#define CONFIG_GNRC_IPV6_NIB_6LR
enable features for 6Lo router
#define CONFIG_GNRC_IPV6_NIB_6LN
enable features for 6Lo node
static bool gnrc_netif_highlander(void)
Check if there can only be one gnrc_netif_t interface.
@ GNRC_NETIF_BUS_IPV6
provides gnrc_ipv6_event_t messages to subscribers
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_iid_to_addr(int dev_type, const eui64_t *iid, uint8_t *addr)
Converts an IPv6 IID to a hardware address.
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.
netopt_t
Global list of configuration options available throughout the network stack, e.g.
Configuration macro definitions for neighbor information base.
Link-layer helper function definitions.
Common macros and compiler attributes/pragmas configuration.
#define IS_USED(module)
Checks whether a module is being used or not.
#define IS_ACTIVE(macro)
Allows to verify a macro definition outside the preprocessor.
static int msg_bus_post(msg_bus_t *bus, uint8_t type, const void *arg)
Post a message to a bus.
Definition of global configuration options.
uint8_t addrs_flags[CONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF]
Flags for gnrc_netif_t::ipv6_addrs.
Representation of a network interface.
msg_bus_t bus[GNRC_NETIF_BUS_NUMOF]
Event Message Bus.
uint32_t flags
Flags for the interface.
uint8_t device_type
Device type.
uint8_t l2addr_len
Length in bytes of gnrc_netif_t::l2addr.
uint8_t l2addr[GNRC_NETIF_L2ADDR_MAXLEN]
The link-layer address currently used as the source address on this interface.
gnrc_netif_ipv6_t ipv6
IPv6 component.
General NDP option format.
Data type to represent an EUI-64.
Data type to represent an IPv6 address.