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$ dnl $Id$
AC_INIT(echoping, 6.0-BETA) AC_INIT(echoping, 6.0-BETA, bortz@users.sourceforge.net)
AC_CANONICAL_HOST AC_CANONICAL_HOST
AC_PROG_CC(cc gcc) AC_PROG_CC(cc gcc)
AC_LIBTOOL_DLOPEN AC_LIBTOOL_DLOPEN

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

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

@ -392,6 +392,12 @@ main(argc, argv)
progname); progname);
exit(1); 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 ! (defined(OPENSSL) || defined(GNUTLS))
if (ssl) { if (ssl) {
(void) fprintf(stderr, (void) fprintf(stderr,
@ -690,7 +696,7 @@ main(argc, argv)
if (smtp) { if (smtp) {
sendline = "QUIT\r\n"; /* Surprises some SMTP servers which log a sendline = "QUIT\r\n"; /* Surprises some SMTP servers which log a
* frightening NOQUEUE. Anyone knows better? * frightening NOQUEUE. Anyone knows better?
* * See bug #1512776 */ * * * * See bug #1512776 */
} else } else
#endif #endif
#ifdef ICP #ifdef ICP

@ -78,10 +78,10 @@ init(const int argc, const char **argv)
{"type", 't', POPT_ARG_STRING, &type_name, 0, {"type", 't', POPT_ARG_STRING, &type_name, 0,
"Type of resources queried (A, MX, SOA, etc)", "Type of resources queried (A, MX, SOA, etc)",
"type"}, "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)", "Use TCP for the request (virtual circuit)",
"tcp"}, "tcp"},
{"no-recurse", NULL, POPT_ARG_NONE, &no_recurse, 0, {"no-recurse", (char) NULL, POPT_ARG_NONE, &no_recurse, 0,
"Do not ask recursion", "Do not ask recursion",
"no-recurse"}, "no-recurse"},
POPT_AUTOHELP POPT_TABLEEND POPT_AUTOHELP POPT_TABLEEND
@ -148,11 +148,11 @@ start(struct addrinfo *res)
(void) memcpy((void *) &name_server_sockaddr_in, (void) memcpy((void *) &name_server_sockaddr_in,
&name_server_sockaddr, sizeof(struct sockaddr)); &name_server_sockaddr, sizeof(struct sockaddr));
} else if (name_server_sockaddr.sa_family == AF_INET6) { } else if (name_server_sockaddr.sa_family == AF_INET6) {
#ifdef HAVE_RES_EXT
/* TODO: the code for IPv6 servers is hopelessly broken. Start again /* TODO: the code for IPv6 servers is hopelessly broken. Start again
*/ */
fprintf(stderr, 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"); "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 */ /* Converts a generic sockaddr to an IPv6 sockaddr_in6 */
(void) memcpy((void *) &name_server_sockaddr_in6, (void) memcpy((void *) &name_server_sockaddr_in6,
&name_server_sockaddr, sizeof(struct sockaddr)); &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 dns is an echoping plugin, fo testing the performances of DNS (RFC
1034 and 1035) servers. 1034 and 1035) servers.
.SH ARGUMENTS .SH ARGUMENTS
.TP
.B request .B request
A domain name A domain name
.SH OPTIONS .SH OPTIONS

@ -33,14 +33,14 @@ echoping_postgresql \- echoping plugin which connects to a PostgreSQL RDBMS serv
.\" respectively. .\" respectively.
postgresql is an echoping plugin to connect to PostgreSQL RDBMS servers. postgresql is an echoping plugin to connect to PostgreSQL RDBMS servers.
.SH ARGUMENTS .SH ARGUMENTS
.B [request] .B [SQL-request]
The request to the PostgreSQL server (in SQL). Only SELECT are The request to the PostgreSQL server (in SQL). Only SELECT are
supported. The default is 'SELECT now()'. supported. The default is 'SELECT now()'.
.TP .TP
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \-c, \-\-conninfo .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 .TP
.B \-r, \-\-readall .B \-r, \-\-readall
Read all the data sent by the Postgresql server 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 [echoping\ options]
.RI -m\ whois .RI -m\ whois
.B hostname .B hostname
.RI -r\ request .RI [-d]
.RI -d .RI request
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and .\" 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. .\" respectively.
whois is an echoping plugin to connect to whois/nicname servers (see whois is an echoping plugin to connect to whois/nicname servers (see
RFC 3912). RFC 3912).
.SH OPTIONS .SH ARGUMENTS
.TP .TP
.B \-r, \-\-request .B request
The request to the whois server (typically a domain name) The request to the whois server (typically a domain name)
.SH OPTIONS
.TP .TP
.B \-d, \-\-dump .B \-d, \-\-dump
Dumps the result of the request Dumps the result of the request

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

Loading…
Cancel
Save