Nordic Internet Control Message Protocol Application Interface for Nordic's IPv6 stack. More...
Data Structures |
|
| struct | icmp6_ns_param_t |
| struct | icmp6_error_message_param_t |
|
Parameters associated with error message in receive and transmit paths.
More...
|
|
Macros |
|
| #define | ICMP6_ECHO_REQUEST_PAYLOAD_OFFSET 8 |
Typedefs |
|
| typedef uint32_t(* | icmp6_receive_callback_t )( iot_interface_t *p_interface, ipv6_header_t *p_ip_header, icmp6_header_t *p_icmp_header, uint32_t process_result, iot_pbuffer_t *p_rx_packet) |
|
ICMPv6 data RX callback.
More...
|
|
Functions |
|
| uint32_t | icmp6_error_message (const iot_interface_t *p_interface, const ipv6_addr_t *p_src_addr, const ipv6_addr_t *p_dest_addr, const icmp6_error_message_param_t *p_param) |
|
Sends ICMPv6 Error Message as defined in RFC 4443.
More...
|
|
| uint32_t | icmp6_echo_request (const iot_interface_t *p_interface, const ipv6_addr_t *p_src_addr, const ipv6_addr_t *p_dest_addr, iot_pbuffer_t *p_request) |
|
Sends ICMPv6 echo request as defined in RFC4443.
More...
|
|
| uint32_t | icmp6_rs_send (const iot_interface_t *p_interface, const ipv6_addr_t *p_src_addr, const ipv6_addr_t *p_dest_addr) |
|
Sends router solicitation message defined in RFC6775.
More...
|
|
| uint32_t | icmp6_ns_send (const iot_interface_t *p_interface, const ipv6_addr_t *p_src_addr, const ipv6_addr_t *p_dest_addr, const icmp6_ns_param_t *p_ns_param) |
|
Sends neighbour solicitation message defined in RFC6775.
More...
|
|
| uint32_t | icmp6_receive_register ( icmp6_receive_callback_t cb) |
|
Registers the callback function for echo reply.
More...
|
|
Detailed Description
Nordic Internet Control Message Protocol Application Interface for Nordic's IPv6 stack.
This module provides basic features related to ICMPv6 support.
Macro Definition Documentation
| #define ICMP6_ECHO_REQUEST_PAYLOAD_OFFSET 8 |
Offset of echo request payload from ICMPv6 header.
Typedef Documentation
| typedef uint32_t(* icmp6_receive_callback_t)( iot_interface_t *p_interface, ipv6_header_t *p_ip_header, icmp6_header_t *p_icmp_header, uint32_t process_result, iot_pbuffer_t *p_rx_packet) |
ICMPv6 data RX callback.
Asynchronous callback used to notify the application of ICMP packets received. By default, the application is not notified through ICMP of messages related to ECHO requests or any errors. However, these notifications can easily be enabled by defining either the ICMP6_ENABLE_ND6_MESSAGES_TO_APPLICATION or the ICMP6_ENABLE_ALL_MESSAGES_TO_APPLICATION if the application should handle them.
- Parameters
-
[in] p_interface Pointer to the IPv6 interface from where the ICMP packet was received. [in] p_ip_header Pointer to the IP header of the ICMP packet received. [in] p_icmp_header Pointer to the ICMP header of the received packet. [in] process_result Notifies the application if the ICMP packet was processed successfully or if an error occurred, for example, if the packet was malformed. [in] p_rx_packet Packet buffer containing the packet received. p_rx_packet->p_payload contains the ICMP payload.
- Return values
-
A provision for the application to notify the module of whether the received packet was processed successfully by application. The application may take ownership of the received packet by returning IOT_IPV6_ERR_PENDING, in which case the application must take care to free it using iot_pbuffer_free .
Function Documentation
| uint32_t icmp6_echo_request | ( | const iot_interface_t * | p_interface , |
| const ipv6_addr_t * | p_src_addr , | ||
| const ipv6_addr_t * | p_dest_addr , | ||
| iot_pbuffer_t * | p_request | ||
| ) |
Sends ICMPv6 echo request as defined in RFC4443.
API used to send an ICMPv6 echo request packet to a specific destination address. The user can decide how much additional data must be sent.
The application calling the function should allocate a packet before, with the type set to ICMP6_PACKET_TYPE in the allocation parameter.
The application should pack the payload at ICMP6_ECHO_REQUEST_PAYLOAD_OFFSET. ID, Sequence number, ICMP Code, type checksum, etc. are filled in by the module.
The application shall not free the allocated packet buffer if the procedure was successful, to ensure that no data copies are needed when transmitting a packet.
- Parameters
-
[in] p_interface Pointer to the IPv6 interface to send the ICMP packet. [in] p_src_addr IPv6 source address from where the echo request is sent. [in] p_dest_addr IPv6 destination address to where the echo request is sent. [in] p_request Packet buffer containing the echo request.
- Return values
-
NRF_SUCCESS If the send request was successful.
| uint32_t icmp6_error_message | ( | const iot_interface_t * | p_interface , |
| const ipv6_addr_t * | p_src_addr , | ||
| const ipv6_addr_t * | p_dest_addr , | ||
| const icmp6_error_message_param_t * | p_param | ||
| ) |
Sends ICMPv6 Error Message as defined in RFC 4443.
API to send messages categorized under error messages. See ICMPv6 error messages. and RFC 4443 for valid types.
- Parameters
-
[in] p_interface Identifies the interface on which the procedure was requested. Shall not be NULL. [in] p_src_addr Source IPv6 address to be used for the request. Shall not be NULL. [in] p_dest_addr Destination IPv6 address to which the message send is requested. Shall not be NULL. [in] p_param Parameters describing Type, code, invoking packet information any additional details associated with the error message.
- Return values
-
NRF_SUCCESS If the send request was successful, else, an error code indicating reason for failure.
| uint32_t icmp6_ns_send | ( | const iot_interface_t * | p_interface , |
| const ipv6_addr_t * | p_src_addr , | ||
| const ipv6_addr_t * | p_dest_addr , | ||
| const icmp6_ns_param_t * | p_ns_param | ||
| ) |
Sends neighbour solicitation message defined in RFC6775.
API used to send a neighbor discovery message of type Neighbor Solicitation to a specific destination address.
The function internally tries to allocate a packet buffer. EUI-64 used in the SLLAO and ARO options is taken from the interface parameter defined in the ipv6_init() function.
- Parameters
-
[in] p_interface Pointer to the IPv6 interface to send the ICMP packet. [in] p_src_addr IPv6 source address from where the neighbor solicitation message is sent. [in] p_dest_addr IPv6 destination address to where the neighbor solicitation message is sent. [in] p_ns_param Neighbor discovery parameters.
- Return values
-
NRF_SUCCESS If the send request was successful.
| uint32_t icmp6_receive_register | ( | icmp6_receive_callback_t | cb | ) |
Registers the callback function for echo reply.
API used to register callback to indicate the ICMP echo reply packet. Could be not used.
Neighbor discovery related messages are not relayed to the application by default. However, this can be enabled by using the ICMP6_ENABLE_ND6_MESSAGES_TO_APPLICATION configuration parameter.
- Parameters
-
[in] cb Handler called when an ICMP packet is received.
- Return values
-
NRF_SUCCESS If the registration was successful.
| uint32_t icmp6_rs_send | ( | const iot_interface_t * | p_interface , |
| const ipv6_addr_t * | p_src_addr , | ||
| const ipv6_addr_t * | p_dest_addr | ||
| ) |
Sends router solicitation message defined in RFC6775.
API used to send a neighbor discovery message of type Router Solicitation to a specific destination address. If no address is known, the user should send the message to all routers' address (FF02::1).
The function internally tries to allocate a packet buffer. EUI-64 used in the SLLAO option is taken from the interface parameter defined in the ipv6_init() function.
- Parameters
-
[in] p_interface Pointer to the IPv6 interface to send the ICMP packet. [in] p_src_addr IPv6 source address from where the router solicitation message is sent. [in] p_dest_addr IPv6 destination address to where the router solicitation message is sent.
- Return values
-
NRF_SUCCESS If the send request was successful.