Loading...
Searching...
No Matches

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 module of the same name in lower-case, e.g., to use GNRC_NETTYPE_IPV6 in your code, use:

USEMODULE += gnrc_nettype_ipv6

Modules

 gnrc_nettype_ccn
 Enables GNRC_NETTYPE_CCN and GNRC_NETTYPE_CCN_CHUNK.
 
 gnrc_nettype_gomac
 Enables GNRC_NETTYPE_GOMACH.
 
 gnrc_nettype_icmpv6
 Enables GNRC_NETTYPE_ICMPV6.
 
 gnrc_nettype_ipv6
 Enables GNRC_NETTYPE_IPV6.
 
 gnrc_nettype_ipv6_ext
 Enables GNRC_NETTYPE_IPV6_EXT.
 
 gnrc_nettype_lorawan
 Enables GNRC_NETTYPE_LORAWAN.
 
 gnrc_nettype_lwmac
 Enables GNRC_NETTYPE_LWMAC.
 
 gnrc_nettype_ndn
 Enables GNRC_NETTYPE_NDN.
 
 gnrc_nettype_sixlowpan
 Enables GNRC_NETTYPE_SIXLOWPAN.
 
 gnrc_nettype_tcp
 Enables GNRC_NETTYPE_TCP.
 
 gnrc_nettype_udp
 Enables GNRC_NETTYPE_UDP.
 

Files

file  nettype.h
 Protocol type definitions.
 

Enumerations

enum  gnrc_nettype_t {
  GNRC_NETTYPE_TX_SYNC = -3 , GNRC_NETTYPE_NETIF = -1 , GNRC_NETTYPE_UNDEF = 0 , GNRC_NETTYPE_GOMACH ,
  GNRC_NETTYPE_LWMAC , GNRC_NETTYPE_CUSTOM , GNRC_NETTYPE_SIXLOWPAN , GNRC_NETTYPE_IPV6 ,
  GNRC_NETTYPE_IPV6_EXT , GNRC_NETTYPE_ICMPV6 , GNRC_NETTYPE_CCN , GNRC_NETTYPE_CCN_CHUNK ,
  GNRC_NETTYPE_NDN , GNRC_NETTYPE_TCP , GNRC_NETTYPE_UDP , 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 gnrc_nettype_t.
 
static uint16_t gnrc_nettype_to_ethertype (gnrc_nettype_t type)
 Translates gnrc_nettype_t to an Ether Type number.
 
static gnrc_nettype_t gnrc_nettype_from_protnum (uint8_t num)
 Translates a Protocol Number to gnrc_nettype_t.
 
static uint8_t gnrc_nettype_to_protnum (gnrc_nettype_t type)
 Translates gnrc_nettype_t to a Protocol Number.
 

Enumeration Type Documentation

◆ gnrc_nettype_t

Definition of protocol types in the network stack.

Note
Expand at will.
Enumerator
GNRC_NETTYPE_TX_SYNC 

TX synchronization data for passing up error data or auxiliary data.

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_GOMACH 

Protocol is GoMacH.

Deprecated:
GoMacH was deprecated and will be removed after the 2024.10 release together with this protocol type.
GNRC_NETTYPE_LWMAC 

Protocol is lwMAC.

Deprecated:
LWMAC was deprecated and will be removed after the 2024.10 release together with this protocol type.
GNRC_NETTYPE_CUSTOM 

Custom ethertype.

GNRC_NETTYPE_SIXLOWPAN 

Protocol is 6LoWPAN.

GNRC_NETTYPE_IPV6 

Protocol is IPv6.

GNRC_NETTYPE_IPV6_EXT 

Protocol is IPv6 extension header.

GNRC_NETTYPE_ICMPV6 

Protocol is ICMPv6.

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_TCP 

Protocol is TCP.

GNRC_NETTYPE_UDP 

Protocol is UDP.

GNRC_NETTYPE_TEST 

Usable with test vectors.

GNRC_NETTYPE_NUMOF 

maximum number of available protocols

Definition at line 51 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 gnrc_nettype_t.

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

Definition at line 160 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 gnrc_nettype_t.

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

Definition at line 236 of file nettype.h.

◆ gnrc_nettype_to_ethertype()

static uint16_t gnrc_nettype_to_ethertype ( gnrc_nettype_t  type)
inlinestatic

Translates gnrc_nettype_t 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 197 of file nettype.h.

◆ gnrc_nettype_to_protnum()

static uint8_t gnrc_nettype_to_protnum ( gnrc_nettype_t  type)
inlinestatic

Translates gnrc_nettype_t 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 281 of file nettype.h.