Protocol type definitions and helper functions. More...

Detailed Description

Protocol type definitions and helper functions.

The protocol types are used with the GNRC communication interface, the Network interface API, the Network protocol registry, and the Packet to identify network protocols throughout the network stack.

To include a nettype into your build, use the corresponding pseudo-module e.g. to use GNRC_NETTYPE_IPV6 in your code, use

USEMODULE += gnrc_nettype_ipv6

Files

file  nettype.h
 Protocol type definitions.
 

Enumerations

enum  gnrc_nettype_t {
  GNRC_NETTYPE_NETIF = -1, GNRC_NETTYPE_UNDEF = 0, GNRC_NETTYPE_SIXLOWPAN, GNRC_NETTYPE_GOMACH,
  GNRC_NETTYPE_LWMAC, GNRC_NETTYPE_CUSTOM, GNRC_NETTYPE_IPV6, GNRC_NETTYPE_IPV6_EXT,
  GNRC_NETTYPE_ICMPV6, GNRC_NETTYPE_TCP, GNRC_NETTYPE_UDP, GNRC_NETTYPE_CCN,
  GNRC_NETTYPE_CCN_CHUNK, GNRC_NETTYPE_NDN, GNRC_NETTYPE_LORAWAN, GNRC_NETTYPE_TEST,
  GNRC_NETTYPE_NUMOF
}
 Definition of protocol types in the network stack. More...
 

Functions

static gnrc_nettype_t gnrc_nettype_from_ethertype (uint16_t type)
 Translates an Ether Type number to Protocol type. More...
 
static uint16_t gnrc_nettype_to_ethertype (gnrc_nettype_t type)
 Translates Protocol type to an Ether Type number. More...
 
static gnrc_nettype_t gnrc_nettype_from_protnum (uint8_t num)
 Translates a Protocol Number to Protocol type. More...
 
static uint8_t gnrc_nettype_to_protnum (gnrc_nettype_t type)
 Translates Protocol type to a Protocol Number. More...
 

Enumeration Type Documentation

◆ gnrc_nettype_t

Definition of protocol types in the network stack.

Note
Expand at will.
Enumerator
GNRC_NETTYPE_NETIF 

Protocol is as defined in gnrc_netif_hdr_t.

Not usable with Network protocol registry

GNRC_NETTYPE_UNDEF 

Protocol is undefined.

GNRC_NETTYPE_SIXLOWPAN 

Protocol is 6LoWPAN.

GNRC_NETTYPE_GOMACH 

Protocol is GoMacH.

GNRC_NETTYPE_LWMAC 

Protocol is lwMAC.

GNRC_NETTYPE_CUSTOM 

Custom ethertype.

GNRC_NETTYPE_IPV6 

Protocol is IPv6.

GNRC_NETTYPE_IPV6_EXT 

Protocol is IPv6 extension header.

GNRC_NETTYPE_ICMPV6 

Protocol is ICMPv6.

GNRC_NETTYPE_TCP 

Protocol is TCP.

GNRC_NETTYPE_UDP 

Protocol is UDP.

GNRC_NETTYPE_CCN 

Protocol is CCN.

GNRC_NETTYPE_CCN_CHUNK 

Protocol is CCN, packet contains a content chunk.

GNRC_NETTYPE_NDN 

Protocol is NDN.

GNRC_NETTYPE_LORAWAN 

Protocol is LoRaWAN.

GNRC_NETTYPE_NUMOF 

maximum number of available protocols

Definition at line 50 of file nettype.h.

Function Documentation

◆ gnrc_nettype_from_ethertype()

static gnrc_nettype_t gnrc_nettype_from_ethertype ( uint16_t  type)
inlinestatic

Translates an Ether Type number to Protocol type.

See also
IANA, ETHER TYPES
Parameters
[in]typeAn Ether Type number
Returns
The corresponding Protocol type to type.
GNRC_NETTYPE_UNDEF if type not translatable.

Definition at line 164 of file nettype.h.

◆ gnrc_nettype_from_protnum()

static gnrc_nettype_t gnrc_nettype_from_protnum ( uint8_t  num)
inlinestatic

Translates a Protocol Number to Protocol type.

See also
IANA, Assigned Internet Protocol Numbers
Parameters
[in]numA Protocol Number
Returns
The corresponding Protocol type to num.
GNRC_NETTYPE_UNDEF if num not translatable.

Definition at line 241 of file nettype.h.

◆ gnrc_nettype_to_ethertype()

static uint16_t gnrc_nettype_to_ethertype ( gnrc_nettype_t  type)
inlinestatic

Translates Protocol type to an Ether Type number.

See also
IANA, ETHER TYPES
Parameters
[in]typeA protocol type
Returns
The corresponding Ether Type number to type.
ETHERTYPE_RESERVED if type not translatable.

Definition at line 202 of file nettype.h.

◆ gnrc_nettype_to_protnum()

static uint8_t gnrc_nettype_to_protnum ( gnrc_nettype_t  type)
inlinestatic

Translates Protocol type to a Protocol Number.

See also
IANA, Assigned Internet Protocol Numbers
Parameters
[in]typeA protocol type
Returns
The corresponding Protocol Number to type.
PROTNUM_RESERVED if type not translatable.

Definition at line 286 of file nettype.h.