All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
ICMPv6 echo messages

ICMPv6 echo request and reply More...

Detailed Description

ICMPv6 echo request and reply

Files

file  echo.h
 ICMPv6 echo message definitions.
 

Typedefs

typedef int(* gnrc_icmpv6_echo_rsp_handle_cb_t) (gnrc_pktsnip_t *pkt, int corrupt, uint32_t rtt_us, void *ctx)
 ICMPv6 echo response callback.
 

Functions

gnrc_pktsnip_tgnrc_icmpv6_echo_build (uint8_t type, uint16_t id, uint16_t seq, uint8_t *data, size_t data_len)
 Builds an ICMPv6 echo message of type type for sending.
 
void gnrc_icmpv6_echo_req_handle (gnrc_netif_t *netif, ipv6_hdr_t *ipv6_hdr, icmpv6_echo_t *echo, uint16_t len)
 ICMPv6 echo request handler.
 
int gnrc_icmpv6_echo_send (const gnrc_netif_t *netif, const ipv6_addr_t *addr, uint16_t id, uint16_t seq, uint8_t ttl, size_t len)
 Send out ICMPv6 echo request.
 
int gnrc_icmpv6_echo_rsp_handle (gnrc_pktsnip_t *pkt, size_t len, gnrc_icmpv6_echo_rsp_handle_cb_t cb, void *ctx)
 Parse ICMPv6 echo response.
 

Typedef Documentation

◆ gnrc_icmpv6_echo_rsp_handle_cb_t

typedef int(* gnrc_icmpv6_echo_rsp_handle_cb_t) (gnrc_pktsnip_t *pkt, int corrupt, uint32_t rtt_us, void *ctx)

ICMPv6 echo response callback.

Parameters
[in]pktPacket containing the ICMPv6 response
[in]corruptOffset of corrupt payload, -1 if no corruption detected
[in]rtt_usround-trip-time in µs (0 if this information is not available)
[in]ctxUser supplied context
Returns
0 on success
<0 on error

Definition at line 90 of file echo.h.

Function Documentation

◆ gnrc_icmpv6_echo_build()

gnrc_pktsnip_t * gnrc_icmpv6_echo_build ( uint8_t type,
uint16_t id,
uint16_t seq,
uint8_t * data,
size_t data_len )

Builds an ICMPv6 echo message of type type for sending.

Parameters
[in]typeType of the echo message. Expected to be either ICMPV6_ECHO_REQ or ICMPV6_ECHO_REP.
[in]idID for the echo message in host byte-order
[in]seqSequence number for the echo message in host byte-order
[in]dataPayload for the echo message
[in]data_lenLength of data
Returns
The echo message on success
NULL, on failure

◆ gnrc_icmpv6_echo_req_handle()

void gnrc_icmpv6_echo_req_handle ( gnrc_netif_t * netif,
ipv6_hdr_t * ipv6_hdr,
icmpv6_echo_t * echo,
uint16_t len )

ICMPv6 echo request handler.

Parameters
[in]netifThe interface the echo request was received on.
[in]ipv6_hdrThe IPv6 header of the echo request.
[in]echoThe Echo Request message.
[in]lenLength of the echo request message (ipv6_hdr_t::len of ipv6_hdr minus length of extension headers).

◆ gnrc_icmpv6_echo_rsp_handle()

int gnrc_icmpv6_echo_rsp_handle ( gnrc_pktsnip_t * pkt,
size_t len,
gnrc_icmpv6_echo_rsp_handle_cb_t cb,
void * ctx )

Parse ICMPv6 echo response.

Parameters
[in]pktIncoming ICMPv6 packet
[in]lenExpected echo response payload length
[in]cbCallback function to execute
[in]ctxCallback function context
Returns
0 on success
<0 on error

◆ gnrc_icmpv6_echo_send()

int gnrc_icmpv6_echo_send ( const gnrc_netif_t * netif,
const ipv6_addr_t * addr,
uint16_t id,
uint16_t seq,
uint8_t ttl,
size_t len )

Send out ICMPv6 echo request.

Parameters
[in]netifThe interface the echo request should be sent on.
[in]addrThe destination address of the echo request
[in]idID for the echo message in host byte-order
[in]seqSequence number for the echo message in host byte-order
[in]ttlHop limit of the echo request
[in]lenLength of the payload
Returns
0 on success
<0 on error