mirror of
https://git.savannah.gnu.org/git/inetutils.git
synced 2026-01-26 16:29:08 +08:00
* ping/ping_impl.h, ping/ping.h, ping/ping_common.h,
ping/ping6.h (ping_stat, PEV_RESPONSE, PEV_DUPLICATE, PEV_NOECHO,
PING_INTERVAL, PING_CKTABSIZE, MAXWAIT, OPT_FLOOD, OPT_INTERVAL,
OPT_NUMERIC, OPT_QUIET, OPT_RROUTE, OPT_VERBOSE, PING_TIMING,
PING_HEADER_LEN, PING_DATALEN): Moved all these common macros and
structures from ping_impl.h , ping6.h and ping_ping.h to ping_common.h.
Removed PING_INTERVAL.
* ping/ping6.c (ping_run): Used PING_SET_INTERVAL similar to
libping.c and used PING_DEFAULT_INTERVAL in place of PING_INTERVAL.
* ping/libping.c (ping_set_datalen): Removed.
* ping/libping.c, ping/ping_common.c (_ping_freebuf, ping_unset_data):
Moved _ping_freebuf, ping_unset_data from libping.c to ping_common.c.
* ping/ping6.c (ping_run): Free memory with call to ping_unset_data.
40 lines
1.5 KiB
C
40 lines
1.5 KiB
C
/* Copyright (C) 1998, 2007 Free Software Foundation, Inc.
|
|
|
|
This file is part of GNU Inetutils.
|
|
|
|
GNU Inetutils 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 3, or (at your option)
|
|
any later version.
|
|
|
|
GNU Inetutils is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR 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 GNU Inetutils; see the file COPYING. If not, write
|
|
to the Free Software Foundation, Inc., 51 Franklin Street,
|
|
Fifth Floor, Boston, MA 02110-1301 USA. */
|
|
|
|
#include "ping_common.h"
|
|
|
|
#define USE_IPV6 0
|
|
|
|
#define _C_BIT(p,bit) (p)->ping_cktab[(bit)>>3] /* byte in ck array */
|
|
#define _C_MASK(bit) (1 << ((bit) & 0x07))
|
|
|
|
#define _PING_SET(p,bit) (_C_BIT (p,bit) |= _C_MASK (bit))
|
|
#define _PING_CLR(p,bit) (_C_BIT (p,bit) &= (~_C_MASK (bit)))
|
|
#define _PING_TST(p,bit) (_C_BIT (p,bit) & _C_MASK (bit))
|
|
|
|
PING *ping_init (int type, int ident);
|
|
void ping_reset (PING * p);
|
|
void ping_set_type (PING * p, int type);
|
|
void ping_set_packetsize (PING * ping, size_t size);
|
|
int ping_set_dest (PING * ping, char *host);
|
|
int ping_set_pattern (PING * p, int len, u_char * pat);
|
|
void ping_set_event_handler (PING * ping, ping_efp fp, void *closure);
|
|
int ping_recv (PING * p);
|
|
int ping_xmit (PING * p);
|