nRF5 SDK for Thread v0.9.0
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
ICMPv6

This module includes functions that control ICMPv6 communication. More...

Data Structures

struct  otIcmp6Header
 
struct  otIcmp6Handler
 

Macros

#define OT_ICMP6_HEADER_DATA_SIZE   4
 Size of an message specific data of ICMPv6 Header.
 

Typedefs

typedef enum otIcmp6Type otIcmp6Type
 
typedef enum otIcmp6Code otIcmp6Code
 
typedef struct otIcmp6Header otIcmp6Header
 
typedef void(* otIcmp6ReceiveCallback )(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otIcmp6Header *aIcmpHeader)
 
typedef struct otIcmp6Handler otIcmp6Handler
 

Enumerations

enum  otIcmp6Type { kIcmp6TypeDstUnreach = 1, kIcmp6TypeEchoRequest = 128, kIcmp6TypeEchoReply = 129 }
 
enum  otIcmp6Code { kIcmp6CodeDstUnreachNoRoute = 0 }
 

Functions

bool otIcmp6IsEchoEnabled (otInstance *aInstance)
 
void otIcmp6SetEchoEnabled (otInstance *aInstance, bool aEnabled)
 
ThreadError otIcmp6RegisterHandler (otInstance *aInstance, otIcmp6Handler *aHandler)
 
ThreadError otIcmp6SendEchoRequest (otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, uint16_t aIdentifier)
 

Variables

OT_TOOL_PACKED_BEGIN struct
otIp6Address 
OT_TOOL_PACKED_END
 

Detailed Description

This module includes functions that control ICMPv6 communication.

Typedef Documentation

typedef enum otIcmp6Code otIcmp6Code

ICMPv6 Message Codes

This structure implements ICMPv6 message handler.

typedef void(* otIcmp6ReceiveCallback)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otIcmp6Header *aIcmpHeader)

This callback allows OpenThread to inform the application of a received ICMPv6 message.

Parameters
[in]aContextA pointer to arbitrary context information.
[in]aMessageA pointer to the received message.
[in]aMessageInfoA pointer to message information associated with aMessage.
[in]aIcmpHeaderA pointer to the received ICMPv6 header.
typedef enum otIcmp6Type otIcmp6Type

ICMPv6 Message Types

Enumeration Type Documentation

ICMPv6 Message Codes

Enumerator
kIcmp6CodeDstUnreachNoRoute 

Destination Unreachable No Route.

ICMPv6 Message Types

Enumerator
kIcmp6TypeDstUnreach 

Destination Unreachable.

kIcmp6TypeEchoRequest 

Echo Request.

kIcmp6TypeEchoReply 

Echo Reply.

Function Documentation

bool otIcmp6IsEchoEnabled ( otInstance *  aInstance)

This function indicates whether or not ICMPv6 Echo processing is enabled.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Return values
TRUEICMPv6 Echo processing is enabled.
FALSEICMPv6 Echo processing is disabled.
ThreadError otIcmp6RegisterHandler ( otInstance *  aInstance,
otIcmp6Handler aHandler 
)

This function registers a handler to provide received ICMPv6 messages.

Note
A handler structure aHandler has to be stored in persistant (static) memory. OpenThread does not make a copy of handler structure.
Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aHandlerA pointer to a handler conitaining callback that is called when an ICMPv6 message is received.
ThreadError otIcmp6SendEchoRequest ( otInstance *  aInstance,
otMessage aMessage,
const otMessageInfo aMessageInfo,
uint16_t  aIdentifier 
)

This function sends an ICMPv6 Echo Request via the Thread interface.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aMessageA pointer to the message buffer containing the ICMPv6 payload.
[in]aMessageInfoA reference to message information associated with aMessage.
[in]aIdentifierAn identifier to aid in matching Echo Replies to this Echo Request. May be zero.
void otIcmp6SetEchoEnabled ( otInstance *  aInstance,
bool  aEnabled 
)

This function sets whether or not ICMPv6 Echo processing is enabled.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aEnabledTRUE to enable ICMPv6 Echo processing, FALSE otherwise.

Documentation feedback | Developer Zone | Subscribe | Updated