icmpv6: remove superfluous header build functions

This commit is contained in:
Oleg Hahm 2015-08-22 14:32:12 +02:00
parent 07f24ffb38
commit a0b3021f60
2 changed files with 2 additions and 45 deletions

View File

@ -46,49 +46,6 @@ extern "C" {
gnrc_pktsnip_t *gnrc_icmpv6_echo_build(uint8_t type, uint16_t id, uint16_t seq, gnrc_pktsnip_t *gnrc_icmpv6_echo_build(uint8_t type, uint16_t id, uint16_t seq,
uint8_t *data, size_t data_len); uint8_t *data, size_t data_len);
/**
* @brief Builds an ICMPv6 echo request for sending.
*
* @see <a href="https://tools.ietf.org/html/rfc4443#section-4.1">
* RFC 4443, section 4.1
* </a>
*
* @param[in] id ID for the echo request in host byte-order
* @param[in] seq Sequence number for the echo request in host byte-order
* @param[in] data Payload for the echo request
* @param[in] data_len Length of @p data
*
* @return The echo request message on success
* @return NULL, on failure
*/
static inline gnrc_pktsnip_t *gnrc_icmpv6_echo_req_build(uint16_t id, uint16_t seq,
uint8_t *data, size_t data_len)
{
return gnrc_icmpv6_echo_build(ICMPV6_ECHO_REQ, id, seq, data, data_len);
}
/**
* @brief Builds an ICMPv6 echo reply for sending.
*
* @see <a href="https://tools.ietf.org/html/rfc4443#section-4.2">
* RFC 4443, section 4.2
* </a>
*
* @param[in] id ID for the echo reply in host byte-order
* @param[in] seq Sequence number for the echo reply in host byte-order
* @param[in] data Payload for the echo reply
* @param[in] data_len Length of @p data
*
* @return The echo reply message on success
* @return NULL, on failure
*/
static inline gnrc_pktsnip_t *gnrc_icmpv6_echo_rep_build(uint16_t id, uint16_t seq,
uint8_t *data, size_t data_len)
{
return gnrc_icmpv6_echo_build(ICMPV6_ECHO_REP, id, seq, data, data_len);
}
/** /**
* @brief ICMPv6 echo request handler * @brief ICMPv6 echo request handler
* *

View File

@ -215,8 +215,8 @@ int _icmpv6_ping(int argc, char **argv)
gnrc_pktsnip_t *pkt; gnrc_pktsnip_t *pkt;
timex_t start, stop, timeout = { 5, 0 }; timex_t start, stop, timeout = { 5, 0 };
pkt = gnrc_icmpv6_echo_req_build(id, ++max_seq_expected, NULL, pkt = gnrc_icmpv6_echo_build(ICMPV6_ECHO_REQ, id, ++max_seq_expected,
payload_len); NULL, payload_len);
if (pkt == NULL) { if (pkt == NULL) {
puts("error: packet buffer full"); puts("error: packet buffer full");