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 Adaption layer for GNRC on top of Netdev, the Network protocol registry, and the Packet to identify network protocols throughout the network stack.

Files

file  nettype.h
 Protocol type definitions.
 

Enumerations

enum  gnrc_nettype_t {
  GNRC_NETTYPE_IOVEC = -2, GNRC_NETTYPE_NETIF = -1, GNRC_NETTYPE_UNDEF = 0, GNRC_NETTYPE_SIXLOWPAN,
  GNRC_NETTYPE_IPV6, GNRC_NETTYPE_ICMPV6, 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 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_IOVEC 

Not so much protocol but data type that is passed to network devices using the netdev interface.

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_IPV6 

Protocol is IPv6.

GNRC_NETTYPE_ICMPV6 

Protocol is ICMPv6.

GNRC_NETTYPE_UDP 

Protocol is UDP.

GNRC_NETTYPE_NUMOF 

maximum number of available protocols

Definition at line 42 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 132 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 186 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 159 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 231 of file nettype.h.