Mostly cosmetic, with a few documentation bugs

MAINT_6_0
Stephane Bortzmeyer 17 years ago
parent f5c5e13541
commit 19b9484c8a

@ -1,5 +1,5 @@
dnl $Id$
AC_INIT(echoping, 6.0-BETA)
AC_INIT(echoping, 6.0-BETA, bortz@users.sourceforge.net)
AC_CANONICAL_HOST
AC_PROG_CC(cc gcc)
AC_LIBTOOL_DLOPEN

@ -195,7 +195,7 @@ AC_TRY_COMPILE(
#include <netinet/tcp.h>
],
[int foobar = SOL_TCP;],
[AC_DEFINE(TCP_INFO,,[TCP info from socket])
[AC_DEFINE(HAVE_TCP_INFO,,[TCP info from socket])
ac_have_tcp_info="yes"],
ac_have_tcp_info=no)
AC_MSG_RESULT($ac_have_tcp_info)
@ -203,7 +203,7 @@ AC_ARG_ENABLE(tcp_info,
[ --enable-tcp-info TCP info from socket],
[if test "$enableval" = "yes"; then
if test $ac_have_tcp_info = "yes"; then
AC_DEFINE(TCP_INFO,,[TCP info from socket])
AC_DEFINE(HAVE_TCP_INFO,,[TCP info from socket])
TCP_INFO=1
else
AC_MSG_WARN([No TCP info support on this system, request ignored])
@ -211,7 +211,7 @@ AC_ARG_ENABLE(tcp_info,
fi],
dnl Default: enable it if supported
if test $ac_have_tcp_info = "yes"; then
AC_DEFINE(TCP_INFO,,[TCP info])
AC_DEFINE(HAVE_TCP_INFO,,[TCP info])
TCP_INFO=1
fi)

@ -158,8 +158,8 @@ indicate the whole URL.
.IP echoping\ \-h\ http://www.example.com/\ cache.example.com:3128
Tests the remote Web proxy-cache and asks a Web page. Note that you must
indicate the whole URL.
.IP echoping\ -n\ 3\ -m\ whois\ foobar.example.com\ -r\ tao.example.org
Loads the whois plugin and query the host foobar.example.com. "-r
.IP echoping\ -n\ 3\ -m\ whois\ foobar.example.com\ -d\ tao.example.org
Loads the whois plugin and query the host foobar.example.com. "-d
tao.example.org" are options specific to the whois plugin.
.IP echoping\ -u\ \-P\ 0xa0\ foobar.example.com
Sends several UDP Echo packets with an IP Precedence of 5.

@ -392,6 +392,12 @@ main(argc, argv)
progname);
exit(1);
}
if (n_stddev && number <= 2) {
(void) fprintf(stderr,
"%s: Average and standard deviation are meaningless since you perform only two or less iteration(s).\n",
progname);
exit(1);
}
#if ! (defined(OPENSSL) || defined(GNUTLS))
if (ssl) {
(void) fprintf(stderr,
@ -690,7 +696,7 @@ main(argc, argv)
if (smtp) {
sendline = "QUIT\r\n"; /* Surprises some SMTP servers which log a
* frightening NOQUEUE. Anyone knows better?
* * See bug #1512776 */
* * * * See bug #1512776 */
} else
#endif
#ifdef ICP

@ -78,10 +78,10 @@ init(const int argc, const char **argv)
{"type", 't', POPT_ARG_STRING, &type_name, 0,
"Type of resources queried (A, MX, SOA, etc)",
"type"},
{"tcp", NULL, POPT_ARG_NONE, &use_tcp, 0,
{"tcp", (char) NULL, POPT_ARG_NONE, &use_tcp, 0,
"Use TCP for the request (virtual circuit)",
"tcp"},
{"no-recurse", NULL, POPT_ARG_NONE, &no_recurse, 0,
{"no-recurse", (char) NULL, POPT_ARG_NONE, &no_recurse, 0,
"Do not ask recursion",
"no-recurse"},
POPT_AUTOHELP POPT_TABLEEND
@ -148,11 +148,11 @@ start(struct addrinfo *res)
(void) memcpy((void *) &name_server_sockaddr_in,
&name_server_sockaddr, sizeof(struct sockaddr));
} else if (name_server_sockaddr.sa_family == AF_INET6) {
#ifdef HAVE_RES_EXT
/* TODO: the code for IPv6 servers is hopelessly broken. Start again
*/
fprintf(stderr,
"WARNING: IPv6 nameservers not really supported yet (experts may apply). Falling back to IPv4 and the default server. You may use -4, too\n");
#ifdef HAVE_RES_EXT
/* Converts a generic sockaddr to an IPv6 sockaddr_in6 */
(void) memcpy((void *) &name_server_sockaddr_in6,
&name_server_sockaddr, sizeof(struct sockaddr));

@ -32,6 +32,7 @@ echoping_dns \- echoping plugin which queries a DNS server
dns is an echoping plugin, fo testing the performances of DNS (RFC
1034 and 1035) servers.
.SH ARGUMENTS
.TP
.B request
A domain name
.SH OPTIONS

@ -33,14 +33,14 @@ echoping_postgresql \- echoping plugin which connects to a PostgreSQL RDBMS serv
.\" respectively.
postgresql is an echoping plugin to connect to PostgreSQL RDBMS servers.
.SH ARGUMENTS
.B [request]
.B [SQL-request]
The request to the PostgreSQL server (in SQL). Only SELECT are
supported. The default is 'SELECT now()'.
.TP
.SH OPTIONS
.TP
.B \-c, \-\-conninfo
Connection information for the Postgresql server. Something like 'host=foo dbname=bar'
Connection information for the Postgresql server. Something like 'dbname=bar'
.TP
.B \-r, \-\-readall
Read all the data sent by the Postgresql server

@ -22,8 +22,8 @@ echoping_whois \- echoping plugin which connects to a whois server
.RI [echoping\ options]
.RI -m\ whois
.B hostname
.RI -r\ request
.RI -d
.RI [-d]
.RI request
.SH DESCRIPTION
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
@ -31,10 +31,11 @@ echoping_whois \- echoping plugin which connects to a whois server
.\" respectively.
whois is an echoping plugin to connect to whois/nicname servers (see
RFC 3912).
.SH OPTIONS
.SH ARGUMENTS
.TP
.B \-r, \-\-request
.B request
The request to the whois server (typically a domain name)
.SH OPTIONS
.TP
.B \-d, \-\-dump
Dumps the result of the request

@ -101,15 +101,21 @@ tvstddev(out, number, average, results)
struct result *results;
{
int i;
struct timeval result, avg, var = null_timeval;
struct timeval result = null_timeval;
struct timeval avg = null_timeval;
#ifdef DEBUG
struct timeval var = null_timeval;
#endif
struct timeval large, small;
double d_offset, d_square, d_variance = 0;
*out = null_timeval;
for (i = 0; i < number; i++) {
if (results[i].valid == 1) {
result = results[i].timevalue;
/* printf ("value is %f (average is %f)\n", tv2double
* (result), tv2double (average)); */
#ifdef DEBUG
printf("DEBUG: Value is %f (average is %f)\n", tv2double
(result), tv2double(average));
#endif
avg = average;
if (tvcmp(&result, &avg) == -1) {
small = result;
@ -119,11 +125,15 @@ tvstddev(out, number, average, results)
small = avg;
}
tvsub(&large, &small);
/* printf ("abs offset is %f\n", tv2double (large)); */
#ifdef DEBUG
printf("abs offset is %f\n", tv2double(large));
#endif
d_offset = tv2double(large);
d_square = d_offset * d_offset;
d_variance += d_square;
/* printf ("variance is now %f\n", tv2double (var)); */
#ifdef DEBUG
printf("variance is now %f\n", tv2double(var));
#endif
}
}
result = double2tv(sqrt(d_variance / (double) number));

Loading…
Cancel
Save