2015-04-01 17:35:23 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2015-08-17 15:41:29 +02:00
|
|
|
* @defgroup net_gnrc_icmpv6_echo ICMPv6 echo messages
|
|
|
|
* @ingroup net_gnrc_icmpv6
|
2015-04-01 17:35:23 +02:00
|
|
|
* @brief ICMPv6 echo request and reply
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief ICMPv6 echo message definitions
|
|
|
|
*
|
|
|
|
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
|
|
|
|
*/
|
2017-05-23 18:19:52 +02:00
|
|
|
#ifndef NET_GNRC_ICMPV6_ECHO_H
|
|
|
|
#define NET_GNRC_ICMPV6_ECHO_H
|
2015-04-01 17:35:23 +02:00
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
#include "byteorder.h"
|
2017-11-24 18:11:10 +01:00
|
|
|
#include "net/gnrc/netif.h"
|
2015-08-09 23:53:40 +02:00
|
|
|
#include "net/ipv6/hdr.h"
|
2015-04-01 17:35:23 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Builds an ICMPv6 echo message of type @p type for sending.
|
|
|
|
*
|
|
|
|
* @param[in] type Type of the echo message. Expected to be either
|
2015-08-10 13:22:24 +02:00
|
|
|
* ICMPV6_ECHO_REQ or ICMPV6_ECHO_REP.
|
2015-04-01 17:35:23 +02:00
|
|
|
* @param[in] id ID for the echo message in host byte-order
|
|
|
|
* @param[in] seq Sequence number for the echo message in host byte-order
|
|
|
|
* @param[in] data Payload for the echo message
|
|
|
|
* @param[in] data_len Length of @p data
|
|
|
|
*
|
|
|
|
* @return The echo message on success
|
|
|
|
* @return NULL, on failure
|
|
|
|
*/
|
2015-08-17 15:41:29 +02:00
|
|
|
gnrc_pktsnip_t *gnrc_icmpv6_echo_build(uint8_t type, uint16_t id, uint16_t seq,
|
|
|
|
uint8_t *data, size_t data_len);
|
2015-04-01 17:35:23 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief ICMPv6 echo request handler
|
|
|
|
*
|
2017-11-24 18:11:10 +01:00
|
|
|
* @param[in] netif The interface the echo request was received on.
|
2015-04-01 17:35:23 +02:00
|
|
|
* @param[in] ipv6_hdr The IPv6 header of the echo request.
|
|
|
|
* @param[in] echo The Echo Request message.
|
2015-08-09 23:53:40 +02:00
|
|
|
* @param[in] len Length of the echo request message (ipv6_hdr_t::len
|
2015-04-01 17:35:23 +02:00
|
|
|
* of @p ipv6_hdr minus length of extension headers).
|
|
|
|
*/
|
2017-11-24 18:11:10 +01:00
|
|
|
void gnrc_icmpv6_echo_req_handle(gnrc_netif_t *netif, ipv6_hdr_t *ipv6_hdr,
|
2015-08-17 15:41:29 +02:00
|
|
|
icmpv6_echo_t *echo, uint16_t len);
|
2015-04-01 17:35:23 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-05-23 18:19:52 +02:00
|
|
|
#endif /* NET_GNRC_ICMPV6_ECHO_H */
|
2015-04-01 17:35:23 +02:00
|
|
|
/** @} */
|