Watt-32 tcp/ip  2.2 dev-rel.10
Data Structures | Functions | Variables
pcping.c File Reference

Go to the source code of this file.

Data Structures

struct  ping_cache


int W32_CALL _ping (DWORD host, DWORD countnum, const BYTE *pattern, size_t len)
 Format and send an ICMP echo request (ping). More...
static int MS_CDECL compare (const struct ping_cache *a, const struct ping_cache *b)
 Compare two entries in ping-cache.
void W32_CALL add_ping (DWORD host, DWORD time, DWORD number)
 Add an ICMP echo reply to the ping-cache.
DWORD W32_CALL _chk_ping (DWORD host, DWORD *number)
 Check for ICMP echo reply in ping-cache. More...


static struct ping_cache pcache [10]

Detailed Description

Simple ping client.

Definition in file pcping.c.

Function Documentation

DWORD W32_CALL _chk_ping ( DWORD  host,
DWORD *  number 

Check for ICMP echo reply in ping-cache.

Return values
replytime in system ticks.
(DWORD)-1on failure

Definition at line 169 of file pcping.c.

int W32_CALL _ping ( DWORD  host,
DWORD  countnum,
const BYTE *  pattern,
size_t  len 

Format and send an ICMP echo request (ping).

  • countnum is the ICMP index value.
  • pattern optional data that will be sent.
  • len length of pattern data.
    Return values
    0if ARP fails or error in lower layer.
    if pattern or len is 0, only an 12 byte ICMP echo header will be sent.
    Sends fragments if needed.

Definition at line 45 of file pcping.c.

References _arp_resolve(), _default_tos, _eth_formatpacket(), set_timeout(), and sin_mask.