ping.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _PING_H
#define _PING_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Maximum number of source route space. Please note that because of the API,
* we can only specify 8 gateways, the last address has to be the target
* address.
*/
#define MAX_GWS 9
/*
* This is the max it can be. But another limiting factor is the PMTU,
* so in any instance, it can be less than 127.
*/
#define MAX_GWS6 127
/* maximum of above two */
/* size of buffer to store the IPv4 gateway addresses */
#define TIMEFORMAT "%#.3g"
#define TIMEFORMAT_V "%#.*g"
/*
* For each target IP address we are going to probe, we store required info,
* such as address family, IP address of target, source IP address to use
* for that target address, and number of probes to send in the targetaddr
* structure.
* All target addresses are also linked to each other and used in
* scheduling probes. Each targetaddr structure identifies a batch of probes to
* send : where to send, how many to send. We capture state information, such as
* number of probes already sent (in this batch only), whether target replied
* as we probe it, whether we are done with probing this address (can happen
* in regular (!stats) mode when we get a reply for a probe sent in current
* batch), and starting sequence number which is used together with number of
* probes sent to determine if the incoming reply is for a probe we sent in
* current batch.
*/
struct targetaddr {
int family;
int num_probes; /* num of probes to send to this dst */
int num_sent; /* number of probes already sent */
/* still probing it */
/* for authenticating replies */
};
struct hostinfo {
char *name; /* hostname */
int family; /* address family */
int num_addr; /* number of addresses */
};
struct icmptype_table {
int type; /* ICMP type */
char *message; /* corresponding string message */
};
extern struct targetaddr *current_targetaddr;
extern int nreceived;
extern int nreceived_last_target;
extern int npackets;
extern int datalen;
extern int ident;
extern char *progname;
extern char *targethost;
extern long long tmax;
extern long long tmin;
extern int ts_flag;
extern boolean_t use_icmp_ts;
extern boolean_t send_reply;
#ifdef __cplusplus
}
#endif
#endif /* _PING_H */