Ping utility. More...
Go to the source code of this file.
Data Structures | |
struct | PingContext |
Ping context. More... | |
Macros | |
#define | PING_SUPPORT ENABLED |
#define | PING_DEFAULT_TIMEOUT 1000 |
#define | PING_MAX_DATA_SIZE 32 |
#define | PING_BUFFER_SIZE (sizeof(IcmpEchoMessage) + PING_MAX_DATA_SIZE) |
Functions | |
error_t | ping (NetInterface *interface, const IpAddr *targetIpAddr, size_t size, uint8_t ttl, systime_t timeout, systime_t *rtt) |
Test the reachability of a host. More... | |
void | pingInit (PingContext *context) |
Initialize ping context. More... | |
error_t | pingSetTimeout (PingContext *context, systime_t timeout) |
Set timeout value. More... | |
error_t | pingBindToInterface (PingContext *context, NetInterface *interface) |
Select a particular network interface. More... | |
error_t | pingSendRequest (PingContext *context, const IpAddr *targetIpAddr, size_t size, uint8_t ttl) |
Send an ICMP Echo Request message. More... | |
error_t | pingWaitForReply (PingContext *context, IpAddr *targetIpAddr, systime_t *rtt) |
Wait for a matching ICMP Echo Reply message. More... | |
void | pingRelease (PingContext *context) |
Release ping context. More... | |
Detailed Description
Ping utility.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file ping.h.
Macro Definition Documentation
◆ PING_BUFFER_SIZE
#define PING_BUFFER_SIZE (sizeof(IcmpEchoMessage) + PING_MAX_DATA_SIZE) |
◆ PING_DEFAULT_TIMEOUT
◆ PING_MAX_DATA_SIZE
◆ PING_SUPPORT
Function Documentation
◆ ping()
error_t ping | ( | NetInterface * | interface, |
const IpAddr * | targetIpAddr, | ||
size_t | size, | ||
uint8_t | ttl, | ||
systime_t | timeout, | ||
systime_t * | rtt | ||
) |
Test the reachability of a host.
Ping operates by sending an ICMP Echo Request message to the target host and waiting for an ICMP Echo Reply message
- Parameters
-
[in] interface Underlying network interface (optional parameter) [in] targetIpAddr IP address of the host to reach [in] size Size of the data payload in bytes [in] ttl Time-To-Live value to be used [in] timeout Maximum time to wait before giving up [out] rtt Round-trip time (optional parameter)
- Returns
- Error code
◆ pingBindToInterface()
error_t pingBindToInterface | ( | PingContext * | context, |
NetInterface * | interface | ||
) |
◆ pingInit()
void pingInit | ( | PingContext * | context | ) |
◆ pingRelease()
void pingRelease | ( | PingContext * | context | ) |
◆ pingSendRequest()
error_t pingSendRequest | ( | PingContext * | context, |
const IpAddr * | targetIpAddr, | ||
size_t | size, | ||
uint8_t | ttl | ||
) |
◆ pingSetTimeout()
error_t pingSetTimeout | ( | PingContext * | context, |
systime_t | timeout | ||
) |
◆ pingWaitForReply()
error_t pingWaitForReply | ( | PingContext * | context, |
IpAddr * | targetIpAddr, | ||
systime_t * | rtt | ||
) |