Compare commits

..

1 Commits

Author SHA1 Message Date
Stephane Bortzmeyer 1c32c4dea3 TAG Release 6.0.0 17 years ago

@ -1,65 +0,0 @@
echoping
========
echoping **was** a small program to test (approximatively) performances of a remote host by sending it requests such as HTTP requests.
echoping is **no longer** maintained. This repository is for
historical interest only.
To use it, simply:
```
% echoping machine.somewhere.org
```
or use the options before the machine name (see the man page).
See the DETAILS file for various traps when benchmarking networks, specially with this program.
In any case, be polite: don't bother the remote host with many repeated requests, especially with large size. Ask for permission if you often test hosts which aren't yours.
Current features:
* plugins, so you can extend echoping with any protocol you like and/or use,
* Supports IPv6 as well as IPv4,
* Supports IDN (Unicode domain names like café.gennic.net),
* uses the protocols echo, discard, chargen or HTTP,
* can use cryptographic connections with HTTP,
* uses UDP instead of TCP for the protocols which accept it (like echo),
* can repeat the test and display various measures about it,
Examples of output:
```
(Simple test with 1000 bytes echo TCP packets)
% echoping -v -s 1000 mycisco
This is echoping, version 5.0.0.
Trying to connect to internet address 172.21.0.14 7 to transmit 1000 bytes...
Connected...
TCP Latency: 0.003165 seconds
Sent (1000 bytes)...
Application Latency: 0.322183 seconds
1000 bytes read from server.
Checked
Elapsed time: 0.326960 seconds
(Repeated tests with average / mean and median displayed.)
% echoping -n 10 faraway-machine
[...]
Minimum time: 6.722336 seconds (38 bytes per sec.)
Maximum time: 17.975060 seconds (14 bytes per sec.)
Average time: 10.873267 seconds (24 bytes per sec.)
Standard deviation: 3.102793
Median time: 9.218506 seconds (28 bytes per sec.)
(Testing a Web server with an HTTP request for its home page.)
% echoping -h / mywww
Elapsed time: 0.686792 seconds
```
The exit status is set if there is any problem, so you can use echoping to test repeatedly a Web server, to be sure it runs fine (SmokePing does it).

@ -1,11 +1,3 @@
6.1 (NOT YET)
DO NOT FORGET maintenance branch
6.0.1 (2007-04-04)
* Bug fixes only
6.0.0 (2007-03-26)
* Plugins: several plugins (whois, postgresql, dns) are now

@ -1,20 +0,0 @@
This file stores a few small tips for developers.
=== Starting from a fresh copy ===
When you have just retrieved echoping via Subversion (this does not
apply to regular tarballs), you must first create all the files
required by the autotools. You need these autotools (autoconf,
automake and libtool) and then:
./recreate-autofiles
=== Merging from a maintenance branch back into the trunk ===
If you have fixed bugs in a branch and want to merge them into the
trunk as well:
cd /where/is/the/trunk
svn merge -r N:M ../branches/MAINT_X_Y
$Id$

File diff suppressed because it is too large Load Diff

@ -60,11 +60,6 @@ echoping in 32bits. With gcc:
CFLAGS=-m32 ./configure --config-cache
make
If your make program is not in the PATH (for instance, on Solaris, it
is typically installed in /usr/ccs/bin/make), the simplest trick is:
./configure --config-cache MAKE=/your/path/to/make
Standard "autoconf/configure" options are supported such as --prefix
to set the installation root directory.

@ -5,7 +5,6 @@
bin_PROGRAMS = echoping
man_MANS = echoping.1
echoping_SOURCES = echoping.c error.c readline.c writen.c util.c http.c icp.c HTParse.c echoping.h icp.h HTParse.h smtp.c
pkginclude_HEADERS = echoping.h compilation.h
echoping_LDADD =
echoping_LDFLAGS = -export-dynamic
DOCS=DETAILS PLUGINS
@ -60,12 +59,12 @@ debug:
$(MAKE) DEBUG=1 CFLAGS='-g -O0'
upload:
@echo "Have you updated configure-common.ac and ChangeLog and committed?"
@echo "Then, have you ran \"make distcheck\" and tagged everything?"
@echo "Have you updated ChangeLog and tagged everything?"
@echo "[Tag is 'svn copy -m \"TAG Release x.y.z\" ${SVN_REPO}/trunk ${SVN_REPO}/tags/RELEASE_x_y_z']"
@echo "If so, make upload-force"
upload-force: dist
scp $(distdir).tar.gz bortzmeyer@ftp.internatif.org:'~ftp/pub/unix/echoping'
rm -f upload.log
ncftpput -d upload.log upload.sourceforge.net /incoming $(distdir).tar.gz

@ -12,8 +12,7 @@ hostname=foo.bar". Plugins using these libraries will have to use the
raw interface. The host name given as argument is ignored.
[Do note there is *no* interface where the TCP connection and shutdown
are done by echoping. (See bug #1694510) They are always performed by
the plugin.]
are done by echoping. They are always performed by the plugin.]
You indicate to echoping wether you use the raw interface or the
cooked one by returning a port name or NULL from the init() function.
@ -49,7 +48,7 @@ void terminate ()
Start your plugin source code with:
#define IN_PLUGIN
#include <echoping/echoping.h>
#include "/wherever/echoping/is/installed/echoping.h"
You can look at random.c, the simplest plugin, and whois.c, the
simplest which still does something useful.

@ -64,7 +64,7 @@ http://echoping.sourceforge.net/
The distribution is from:
http://sourceforge.net/project/showfiles.php?group_id=4581
ftp://ftp.internatif.org/pub/unix/echoping
Stephane Bortzmeyer <bortz@users.sourceforge.net>. October 1995 for the
first version.

@ -1,3 +1,3 @@
#define COMPILATION_OPTIONS "@PACKAGE_NAME@ @PACKAGE_VERSION@ compiled with @CC@ on @hostname@ (@host@)\n at @compil_date@ with options:\nCFLAGS= @CFLAGS@\nLDFLAGS= @LDFLAGS@\n@compil_options@\n\nPlugins are searched in @plugins_dir@."
#define COMPILATION_OPTIONS "@PACKAGE_NAME@ @PACKAGE_VERSION@ compiled with @CC@ on @hostname@ (@host@)\n at @compil_date@ with options:\n@compil_options@\n\nPlugins are searched in @plugins_dir@."
/* $Id$ */

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

@ -6,10 +6,6 @@ m4_include(configure-common.ac)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
dnl Checking size of ints, we often need it for binary protocols like ICP
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
dnl User options
dnl http://sources.redhat.com/ml/automake-prs/2001-q3/msg00033.html
max_iterations_specified=0
@ -92,21 +88,14 @@ AC_ARG_WITH(ssl,
AC_ARG_WITH(gnutls,
[ --with-gnutls[=DIR] SSL/TLS crypt support (needs GNU TLS), the argument DIR should not be necessary],dnl
[if test "$withval" != "no"; then
if test "$withval" = "yes"; then
PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.0.0],
[
echo "GnuTLS found"
AC_DEFINE(GNUTLS,,[Crypto (TLS) support])
GNUTLS=1
CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
LIBS="$LIBS $LIBGNUTLS_LIBS"
],)
else
AC_DEFINE(GNUTLS,,[Crypto (TLS) support])
GNUTLS=1
GNUTLSROOT=$withval
LDFLAGS="${LDFLAGS} -L$GNUTLSROOT/lib -lgnutls"
CPPFLAGS="${CPPFLAGS} -I$GNUTLSROOT/include"
AC_DEFINE(GNUTLS,,[Crypto (TLS) support])
GNUTLS=1
CPPFLAGS="${CPPFLAGS} `libgnutls-config --cflags`"
LDFLAGS="${LDFLAGS} `libgnutls-config --libs`"
if test "$withval" != "yes"; then
GNUTLSROOT=$withval
LDFLAGS="${LDFLAGS} -L$GNUTLSROOT/lib"
CPPFLAGS="${CPPFLAGS} -I$GNUTLSROOT/include"
fi
fi],
dnl Default: disable it
@ -281,33 +270,6 @@ AC_ARG_ENABLE(priority,
PRIORITY=1
fi)
dnl SCTP, RFC 4960, feature request #1676608
AC_MSG_CHECKING([SCTP])
AC_TRY_COMPILE(
[#include <sys/types.h>
#include <netinet/in.h>
],
[int foobar = IPPROTO_SCTP;],
[AC_DEFINE(HAVE_SCTP,,[SCTP support])
ac_have_sctp="yes"],
ac_have_sctp="no")
AC_MSG_RESULT($ac_have_sctp)
AC_ARG_ENABLE(sctp,
[ --enable-sctp SCTP (Stream Control Transmission Protocol) support],
[if test "$enableval" = "yes"; then
if test $ac_have_sctp = "yes"; then
AC_DEFINE(HAVE_SCTP,,[Stream Control Transmission Protocol support])
SCTP=1
else
AC_MSG_WARN([No SCTP support on this system, request ignored])
fi
fi],
dnl Default: enable it if supported
if test $ac_have_sctp = "yes"; then
AC_DEFINE(HAVE_SCTP,,[Stream Control Transmission Protocol support])
SCTP=1
fi)
if test "$GCC" = yes; then
CFLAGS="$CFLAGS -Wall"
fi
@ -339,7 +301,6 @@ else
fi
AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$plugins_dir", [Directory where the plugins will be installed])
AC_SUBST(plugins_dir)
# TODO: make distcheck complains here that "plugins" does not exist???
echo $plugins_dir > plugins/dir
AC_CONFIG_SUBDIRS(plugins)
@ -366,7 +327,6 @@ DISPLAY_SETTING(GNUTLS)
DISPLAY_SETTING(SMTP)
DISPLAY_SETTING(LIBIDN)
DISPLAY_SETTING(TOS)
DISPLAY_SETTING(SCTP)
DISPLAY_SETTING(PRIORITY)
compil_date=`date +%Y-%m-%d`

@ -21,91 +21,91 @@
void
domquery_usage(char *msg)
{
fprintf(stderr, "%s\n", msg);
poptPrintUsage(poptcon, stderr, 0);
err_quit(" domain");
fprintf(stderr, "%s\n", msg);
poptPrintUsage(poptcon, stderr, 0);
err_quit(" domain");
}
char *
init(int argc, char **argv)
{
int value;
xmlrpc_value *result;
xmlrpc_bool free, read_contacts;
xmlrpc_int32 reason;
char *msg, *hostname;
struct poptOption options[] = {
{"read-contacts", 'c', POPT_ARG_NONE, &read_contacts, 0,
"Read also the contacts of the domain [NOT IMPLEMENTED]",
""},
POPT_AUTOHELP POPT_TABLEEND
};
poptcon = poptGetContext(NULL, argc, argv, options, POPT_CONTEXT_KEEP_FIRST);
while ((value = poptGetNextOpt(poptcon)) > 0) {
if (value < -1) {
sprintf(msg, "%s: %s",
poptBadOption(poptcon, POPT_BADOPTION_NOALIAS),
poptStrerror(value));
domquery_usage(msg);
}
}
hostname = (char *) poptGetArg(poptcon); /* Not used */
domain = (char *) poptGetArg(poptcon);
if (domain == NULL || !strcmp(domain, ""))
domquery_usage("Mandatory request missing");
return NULL;
int value;
xmlrpc_value *result;
xmlrpc_bool free, read_contacts;
xmlrpc_int32 reason;
char *msg, *hostname;
struct poptOption options[] = {
{"read-contacts", 'c', POPT_ARG_NONE, &read_contacts, 0,
"Read also the contacts of the domain [NOT IMPLEMENTED]",
""},
POPT_AUTOHELP POPT_TABLEEND
};
poptcon = poptGetContext(NULL, argc, argv, options, POPT_CONTEXT_KEEP_FIRST);
while ((value = poptGetNextOpt(poptcon)) > 0) {
if (value < -1) {
sprintf(msg, "%s: %s",
poptBadOption(poptcon, POPT_BADOPTION_NOALIAS),
poptStrerror(value));
domquery_usage(msg);
}
}
hostname = (char *) poptGetArg(poptcon); /* Not used */
domain = (char *) poptGetArg(poptcon);
if (domain == NULL || !strcmp(domain, ""))
domquery_usage("Mandatory request missing");
return NULL;
}
void
start_raw()
{
/* Start up our XML-RPC client library. */
xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, CLIENT_NAME, CLIENT_VERSION);
/* Start up our XML-RPC client library. */
xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, CLIENT_NAME, CLIENT_VERSION);
/* Initialize our error-handling environment. */
xmlrpc_env_init(&env);
/* Initialize our error-handling environment. */
xmlrpc_env_init(&env);
printf("env initialized\n");
printf("env initialized\n");
}
int
execute()
{
xmlrpc_value *result;
xmlrpc_value *domain_h;
xmlrpc_int32 found;
xmlrpc_value *error;
/* char *dst; dst = HTAnchor_findAddress(ENDPOINT); */
printf("Ready to call\n");
/* Call the server */
result = xmlrpc_client_call(&env, ENDPOINT, "domquery", "(s)", domain);
die_if_fault_occurred(&env);
printf("Call done, now parsing\n");
xmlrpc_parse_value(&env, result, "{s:i,*}", "found", &found);
die_if_fault_occurred(&env);
if (found) {
printf("%s is there\n", domain);
xmlrpc_parse_value(&env, result, "{s:S,i,s:A,*}", "domain",
&domain_h, "found", &found, "error", &error);
die_if_fault_occurred(&env);
}
/* Dispose of our result value. */
xmlrpc_DECREF(result);
return 0;
xmlrpc_value *result;
xmlrpc_value *domain_h;
xmlrpc_int32 found;
xmlrpc_value *error;
/* char *dst; dst = HTAnchor_findAddress(ENDPOINT); */
printf("Ready to call\n");
/* Call the server */
result = xmlrpc_client_call(&env, ENDPOINT, "domquery", "(s)", domain);
die_if_fault_occurred(&env);
printf("Call done, now parsing\n");
xmlrpc_parse_value(&env, result, "{s:i,*}", "found", &found);
die_if_fault_occurred(&env);
if (found) {
printf("%s is there\n", domain);
xmlrpc_parse_value(&env, result, "{s:S,i,s:A,*}", "domain",
&domain_h, "found", &found, "error", &error);
die_if_fault_occurred(&env);
}
/* Dispose of our result value. */
xmlrpc_DECREF(result);
return 0;
}
void
terminate()
{
/* Clean up our error-handling environment. */
xmlrpc_env_clean(&env);
/* Clean up our error-handling environment. */
xmlrpc_env_clean(&env);
/* Shutdown our XML-RPC client library. */
xmlrpc_client_cleanup();
/* Shutdown our XML-RPC client library. */
xmlrpc_client_cleanup();
}

@ -16,65 +16,65 @@
void
die_if_fault_occurred(xmlrpc_env * env)
{
if (env->fault_occurred) {
fprintf(stderr, "XML-RPC Fault: %s (%d)\n",
env->fault_string, env->fault_code);
exit(1);
}
if (env->fault_occurred) {
fprintf(stderr, "XML-RPC Fault: %s (%d)\n",
env->fault_string, env->fault_code);
exit(1);
}
}
int
main(int argc, char **argv)
{
int value;
xmlrpc_value *result;
xmlrpc_bool free, read_contacts;
xmlrpc_int32 reason;
xmlrpc_value *domain_h;
xmlrpc_int32 found;
xmlrpc_value *error;
xmlrpc_env env;
char *domain;
char *date, *holder;
int value;
xmlrpc_value *result;
xmlrpc_bool free, read_contacts;
xmlrpc_int32 reason;
xmlrpc_value *domain_h;
xmlrpc_int32 found;
xmlrpc_value *error;
xmlrpc_env env;
char *domain;
char *date, *holder;
if (argc != 2) {
fprintf(stderr, "Usage: %s domain\n", argv[0]);
exit(1);
}
if (argc != 2) {
fprintf(stderr, "Usage: %s domain\n", argv[0]);
exit(1);
}
domain = argv[1];
domain = argv[1];
/* Start up our XML-RPC client library. */
xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, CLIENT_NAME, CLIENT_VERSION);
/* Start up our XML-RPC client library. */
xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, CLIENT_NAME, CLIENT_VERSION);
/* Initialize our error-handling environment. */
xmlrpc_env_init(&env);
/* Initialize our error-handling environment. */
xmlrpc_env_init(&env);
/* Call the server */
result = xmlrpc_client_call(&env, ENDPOINT, "domquery", "(s)", domain);
die_if_fault_occurred(&env);
/* Call the server */
result = xmlrpc_client_call(&env, ENDPOINT, "domquery", "(s)", domain);
die_if_fault_occurred(&env);
xmlrpc_parse_value(&env, result, "{s:i,*}", "found", &found);
die_if_fault_occurred(&env);
if (found) {
printf("%s is there\n", domain);
xmlrpc_parse_value(&env, result, "{s:S,s:i,s:A,*}", "domain",
&domain_h, "found", &found, "error", &error);
die_if_fault_occurred(&env);
/* printf ("Type of domain: %d\n", xmlrpc_value_type(domain_h)); */
xmlrpc_parse_value(&env, domain_h, "{s:s,s:s,*}", "registered",
&date, "org", &holder);
die_if_fault_occurred(&env);
printf("Registered on %s by %s\n", date, holder);
} else {
printf("Unknown domain %s\n", domain);
}
/* Dispose of our result value. */
xmlrpc_DECREF(result);
/* Clean up our error-handling environment. */
xmlrpc_env_clean(&env);
xmlrpc_parse_value(&env, result, "{s:i,*}", "found", &found);
die_if_fault_occurred(&env);
if (found) {
printf("%s is there\n", domain);
xmlrpc_parse_value(&env, result, "{s:S,s:i,s:A,*}", "domain",
&domain_h, "found", &found, "error", &error);
die_if_fault_occurred(&env);
/* printf ("Type of domain: %d\n", xmlrpc_value_type(domain_h)); */
xmlrpc_parse_value(&env, domain_h, "{s:s,s:s,*}", "registered",
&date, "org", &holder);
die_if_fault_occurred(&env);
printf("Registered on %s by %s\n", date, holder);
} else {
printf("Unknown domain %s\n", domain);
}
/* Dispose of our result value. */
xmlrpc_DECREF(result);
/* Clean up our error-handling environment. */
xmlrpc_env_clean(&env);
/* Shutdown our XML-RPC client library. */
xmlrpc_client_cleanup();
/* Shutdown our XML-RPC client library. */
xmlrpc_client_cleanup();
}

@ -6,7 +6,8 @@
void
die_if_fault_occurred(xmlrpc_env * env)
{
if (env->fault_occurred) {
err_quit("XML-RPC Fault: %s (%d)\n", env->fault_string, env->fault_code);
}
if (env->fault_occurred) {
err_quit("XML-RPC Fault: %s (%d)\n",
env->fault_string, env->fault_code);
}
}

@ -1,4 +1,4 @@
XCFLAGS=-Wall -O0 -g -fPIC ${CFLAGS}
CCFLAGS=-Wall -O0 -g -fPIC
LDFLAGS=-shared
OBJECTS=daytime.o
@ -6,7 +6,7 @@ OBJECTS=daytime.o
all: daytime.so
%.o: %.c
${CC} ${XCFLAGS} -c -o $@ $<
${CC} ${CCFLAGS} -c -o $@ $<
%.so: %.o
${CC} ${LDFLAGS} -o $@ $<

@ -5,7 +5,7 @@
*/
#define IN_PLUGIN
#include <echoping/echoping.h>
#include "../../echoping.h"
struct addrinfo daytime_server;
int sockfd;
@ -14,38 +14,39 @@ echoping_options options;
char *
init(const int argc, const char **argv, echoping_options global_options)
{
if (global_options.udp)
err_quit("Sorry, UDP is not yet compatible with this daytime plugin");
options = global_options;
return "daytime";
if (global_options.udp)
err_quit
("Sorry, UDP is not yet compatible with this daytime plugin");
options = global_options;
return "daytime";
}
void
start(struct addrinfo *res)
{
daytime_server = *res;
daytime_server = *res;
}
int
execute()
{
int nr;
FILE *file;
int nr;
FILE *file;
#define MAX 256
char recvline[MAX];
if ((sockfd =
socket(daytime_server.ai_family, daytime_server.ai_socktype,
daytime_server.ai_protocol)) < 0)
err_sys("Can't open socket");
if (connect(sockfd, daytime_server.ai_addr, daytime_server.ai_addrlen) < 0)
err_sys("Can't connect to server");
if ((file = fdopen(sockfd, "r")) == NULL)
err_sys("Cannot fdopen");
nr = readline(file, recvline, MAX, 1);
if (options.verbose)
printf("%s", recvline);
close(sockfd);
return 1;
char recvline[MAX];
if ((sockfd =
socket(daytime_server.ai_family, daytime_server.ai_socktype,
daytime_server.ai_protocol)) < 0)
err_sys("Can't open socket");
if (connect(sockfd, daytime_server.ai_addr, daytime_server.ai_addrlen) < 0)
err_sys("Can't connect to server");
if ((file = fdopen(sockfd, "r")) == NULL)
err_sys("Cannot fdopen");
nr = readline(file, recvline, MAX, 1);
if (options.verbose)
printf("%s", recvline);
close(sockfd);
return 1;
}
void

@ -1,58 +0,0 @@
#!/bin/sh
# Dangerous. Use only if you know what you do.
# Linux-only
# Configure the Linux traffic control to lose packets, in order to test
# echoping.
# http://linux-net.osdl.org/index.php/Netem
DEVICE="tap0"
PROTOCOL="udp"
DEST_PORTS="7 53"
# In percent
LOSS=20
# In milli-seconds
DELAY=40
CLEAN_FIRST="YES"
USE_IPTABLES="YES"
# Do not touch afterwards
INTERESTING="4"
PLAIN="0"
if [ ! -z "$CLEAN_FIRST" ]; then
tc qdisc del dev ${DEVICE} root
iptables -t mangle -F INPUT
iptables -t mangle -F OUTPUT
fi
tc qdisc add dev ${DEVICE} root handle 1: prio
tc qdisc add dev ${DEVICE} parent 1:2 handle ${INTERESTING}: \
netem delay ${DELAY}ms loss ${LOSS}%
#tc qdisc add dev ${DEVICE} parent ${INTERESTING}:1 \
# tbf rate 20kbit buffer 1600 limit 3000
if [ -z "$USE_IPTABLES" ] || [ "$USE_IPTABLES" = "NO" ]; then
for port in ${DEST_PORTS}; do
# Note: $PROTOCOL is ignored...
tc filter add dev ${DEVICE} protocol ip parent 1:0 prio 2 u32 \
match ip dport ${port} 0xffff flowid 10:5
done
else
tc filter add dev ${DEVICE} protocol ip parent 1:0 prio 2 \
handle ${INTERESTING} fw flowid 10:5
# Not perfect: it seems all ports are affected :-(
for port in ${DEST_PORTS}; do
# Ingress
iptables -t mangle -A INPUT -i ${DEVICE} -p ${PROTOCOL} --sport ${port} \
-j MARK --set-mark ${INTERESTING}
# Egress
iptables -t mangle -A OUTPUT -o ${DEVICE} -p ${PROTOCOL} --dport ${port} \
-j MARK --set-mark ${INTERESTING}
done
fi

@ -1,5 +0,0 @@
pkglib_LTLIBRARIES = smallservices.la
smallservices_la_SOURCES = small-services.c
smallservices_la_LDFLAGS = -module

@ -1,10 +0,0 @@
small-services is an echoping plugin which implements the following
network services:
* echo (RFC 862)
* discard (RFC 863)
* chargen (RFC 864)
As of today (2007-12-21), these services are in the main echoping tree
but the idea is to move them to this plugin in the future. See
echoping Feature Request #1694557 at Sourceforge.

@ -1,9 +0,0 @@
dnl $Id: configure.ac 377 2007-03-12 20:48:05Z bortz $
AC_INIT(small-services, 0.0-BETA)
AC_PROG_CC(cc gcc)
AC_PROG_LIBTOOL
AM_INIT_AUTOMAKE(foreign)
AC_CONFIG_HEADERS(config.h)
AC_OUTPUT(Makefile)

@ -1,58 +0,0 @@
/*
*
* $Id: daytime.c 395 2007-04-04 19:26:19Z bortz $
*/
#define IN_PLUGIN
#include <echoping/echoping.h>
struct addrinfo smallservices_server;
int sockfd;
echoping_options options;
char *
init(const int argc, const char **argv, echoping_options global_options)
{
options = global_options;
/* TODO: the service returned must depend on the options */
return "echo";
}
void
start(struct addrinfo *res)
{
smallservices_server = *res;
}
int
execute()
{
int nr;
#define MAX 256
#define TEST_STRING "test"
char result[MAX];
if ((sockfd =
socket(smallservices_server.ai_family, smallservices_server.ai_socktype,
smallservices_server.ai_protocol)) < 0)
err_sys("Can't open socket");
if (connect
(sockfd, smallservices_server.ai_addr, smallservices_server.ai_addrlen) < 0)
err_sys("Can't connect to server");
if (write(sockfd, TEST_STRING, strlen(TEST_STRING)) != strlen(TEST_STRING))
err_sys("Cannot write");
nr = read(sockfd, result, strlen(TEST_STRING));
if (nr != strlen(TEST_STRING))
err_sys("Cannot read (only %i bytes)", nr); /* TODO: the server may send
* the result in chunks, we
* should loop */
if (strcmp(result, TEST_STRING) != 0)
err_sys("Result \"%s\" is different from test string \"%s\"",
result, TEST_STRING);
close(sockfd);
return 1;
}
void
terminate()
{
}

@ -14,11 +14,10 @@ echoping \- tests a remote host with TCP or UDP
.RI [-c]
.RI [-d]
.RI [-u]
.RI [-T]
.RI [-s size]
.RI [-n number]
.RI [-w delay]
.RI [-h url-or-path]
.RI [-h url]
.RI [-R]
.RI [-i url]
.RI [-p priority]
@ -49,7 +48,7 @@ to use it (carefully) to measure Web performances.
.SH ARGUMENT
.IP hostname[:port]
Name (or address) of the server to test. For HTTP, you can specify a
port number. For HTTP and IPv6, you can use RFC 3986 syntax (you will
port number. For HTTP and IPv6, you can use RFC 2732 syntax (you will
probably need to escape the brackets from the shell). The name can be
an IDN (Unicode domain name).
@ -81,18 +80,17 @@ Number of seconds to wait a reply before giving up. For TCP, this is the
maximum number of seconds for the whole connection (setup and data exchange).
.IP -u
Use UDP instead of TCP
.IP -T
Use SCTP instead of TCP
.IP -d
Use the "discard" service instead of echo
.IP -c
Use the "chargen" service instead of echo
.IP -h\ url-or-path
.IP -h\ url
Use the HTTP protocol (instead of echo) for the given URL. If the
hostname is the Web server, the argument has to
be a path, a relative URL (for instance '/' or '/pics/foobar.gif'). If the
hostname is a proxy/cache like Squid, the argument has to
be an absolute URL.
hostname is the Web server, the URL has to
be a relative one (for instance '/' or '/pics/foobar.gif') because HTTP 1.0
servers will not understand a request for an absolute URL. If the
hostname is a proxy/cache like Squid, the URL has to
be an absolute one.
.IP -R
Accept HTTP status codes 3xx (redirections) as normal responses (the
default is to regard them as errors)

File diff suppressed because it is too large Load Diff

@ -10,8 +10,9 @@
#define DEFLINE 256
#define UDPMAX 65535
/* Mostly for HTTP */
#ifdef HTTP
#define MAXTOREAD 150000
#endif
#ifdef SMTP
#define MAXSMTP 1024
#define MAXSMTPLINES 30

@ -7,9 +7,9 @@ Release: 1
Copyright: GNU
Group: Utilities/Network
Packager: Stephane Bortzmeyer <bortz@users.sourceforge.net>
Source: https://github.com/bortzmeyer/echoping/archive/master.zip
Source: ftp://ftp.internatif.org/pub/unix/echoping/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Url: http://bortzmeyer.github.io/echoping/
Url: http://echoping.sourceforge.net
Prefix: /usr/local
# Requires: openssl
# BuildRequires: openssl-devel openssl

@ -7,7 +7,7 @@
void
my_perror()
{
fprintf(stderr, " %s\n", sys_err_str());
fprintf(stderr, " %s\n", sys_err_str());
}
/*
@ -22,18 +22,18 @@ my_perror()
void
err_ret(char *str, ...)
{
va_list args;
va_list args;
va_start(args, str);
vfprintf(stderr, str, args);
va_end(args);
va_start(args, str);
vfprintf(stderr, str, args);
va_end(args);
my_perror();
my_perror();
fflush(stdout);
fflush(stderr);
fflush(stdout);
fflush(stderr);
return;
return;
}
/*
@ -49,14 +49,14 @@ err_ret(char *str, ...)
void
err_quit(char *str, ...)
{
va_list args;
va_list args;
va_start(args, str);
vfprintf(stderr, str, args);
fputc('\n', stderr);
va_end(args);
va_start(args, str);
vfprintf(stderr, str, args);
fputc('\n', stderr);
va_end(args);
exit(1);
exit(1);
}
/*
@ -73,23 +73,23 @@ err_quit(char *str, ...)
void
err_sys(char *str, ...)
{
va_list args;
va_list args;
va_start(args, str);
vfprintf(stderr, str, args);
va_end(args);
va_start(args, str);
vfprintf(stderr, str, args);
va_end(args);
my_perror();
my_perror();
exit(1);
exit(1);
}
void
usage(poptContext context)
{
poptPrintUsage(context, stderr, 0);
fprintf(stderr, " hostname [plugin-options...]\n");
exit(1);
poptPrintUsage(context, stderr, 0);
fprintf(stderr, " hostname [plugin-options...]\n");
exit(1);
}
/*
@ -105,12 +105,12 @@ usage(poptContext context)
char *
sys_err_str()
{
static char msgstr[200];
if (errno != 0) {
sprintf(msgstr, "(%s)", strerror(errno));
} else {
msgstr[0] = '\0';
}
return (msgstr);
static char msgstr[200];
if (errno != 0) {
sprintf(msgstr, "(%s)", strerror(errno));
} else {
msgstr[0] = '\0';
}
return (msgstr);
}

@ -11,143 +11,139 @@ char big_recvline[MAXTOREAD];
char *
make_http_sendline(char *url, char *host, int port, int nocache)
{
short sport = (short) port;
int size = 350; /* Enough? RFC 2616, section 3.2.1 says 255 should
* be enough, although there is no hard limit. We
* reserve more because there * are the protocol
* elements, the HTTP headers, etc */
char *sendline = (char *) malloc(size);
char *hostname = (char *) malloc(size);
char *cache_directive = "";
int result;
short sport = (short) port;
int size = 200; /* Enough? */
char *sendline = (char *) malloc(size);
char *hostname = (char *) malloc(size);
char *cache_directive = "";
#ifdef HTTP10
if (nocache)
cache_directive = "Pragma: no-cache\r\n"; /* RFC 1945, "Hypertext
* Transfer Protocol * --
* HTTP/1.0" */
result = snprintf(sendline, size,
"GET %s HTTP/1.0\r\nUser-Agent: Echoping/%s\r\n%s\r\n",
url, VERSION, cache_directive);
if (nocache)
cache_directive = "Pragma: no-cache\r\n"; /* RFC 1945,
* "Hypertext
* Transfer Protocol
* -- HTTP/1.0" */
sprintf(sendline,
"GET %s HTTP/1.0\r\nUser-Agent: Echoping/%s\r\n%s\r\n",
url, VERSION, cache_directive);
#else
if (nocache) {
if (nocache == 1)
cache_directive = "Cache-control: max-age=0\r\n"; /* Simply force a
* recheck with
* the server */
else
cache_directive = "Cache-control: no-cache\r\n"; /* RFC 2616
* "Hypertext
* Transfer Protocol
* -- HTTP/1.1" */
}
strncpy(hostname, HTParse(url, "", PARSE_HOST), size); /* See bug #1688940
* to see why we use
* * * strNcpy. */
hostname[size] = '\0'; /* Not added automatically */
if (!strcmp(hostname, ""))
snprintf(hostname, size, "%s:%d", host, sport);
result = snprintf(sendline, size,
"GET %s HTTP/1.1\r\nUser-Agent: Echoping/%s\r\nHost: %s\r\nConnection: close\r\n%s\r\n",
url, VERSION, hostname, cache_directive);
free(hostname);
if (nocache) {
if (nocache == 1)
cache_directive = "Cache-control: max-age=0\r\n"; /* Simply
* force
* a
* recheck
* with
* the
* server
*/
else
cache_directive = "Cache-control: no-cache\r\n"; /* RFC
* 2616
* "Hypertext
* Transfer
* Protocol --
* HTTP/1.1" */
}
strcpy(hostname, HTParse(url, "", PARSE_HOST));
if (!strcmp(hostname, ""))
sprintf(hostname, "%s:%d", host, sport);
sprintf(sendline,
"GET %s HTTP/1.1\r\nUser-Agent: Echoping/%s\r\nHost: %s\r\nConnection: close\r\n%s\r\n",
url, VERSION, hostname, cache_directive);
free(hostname);
#endif
if (result >= size)
err_quit("URL and/or hostname too long(s)");
return sendline;
return sendline;
}
int
read_from_server(CHANNEL fs, short ssl, boolean accept_redirects)
{
int nr = 0;
int total = 0;
int reply_code;
int first_line = TRUE;
short body = FALSE;
int nr = 0;
int total = 0;
char reply_code;
int first_line = TRUE;
short body = FALSE;
#ifdef OPENSSL
int sslcode;
int sslcode;
#endif
while (!body && !timeout_flag) {
if (!ssl)
nr = readline(fs.fs, big_recvline, MAXTOREAD, TRUE);
while (!body && !timeout_flag) {
if (!ssl)
nr = readline(fs.fs, big_recvline, MAXTOREAD, TRUE);
#ifdef OPENSSL
else {
nr = SSL_readline(fs.ssl, big_recvline, MAXTOREAD, TRUE);
if (nr == -1) {
sslcode = ERR_get_error();
err_ret("SSL_readline error: %s", ERR_error_string(sslcode, NULL));
}
}
else {
nr = SSL_readline(fs.ssl, big_recvline, MAXTOREAD, TRUE);
if (nr == -1) {
sslcode = ERR_get_error();
err_ret("SSL_readline error: %s",
ERR_error_string(sslcode, NULL));
}
}
#endif
#ifdef GNUTLS
else
{
nr = TLS_readline(fs.tls, big_recvline, MAXTOREAD, TRUE);
if (nr == -1) {
err_ret("TLS_readline error: %s", gnutls_strerror(nr));
}
}
else
{
nr = TLS_readline(fs.tls, big_recvline, MAXTOREAD, TRUE);
if (nr == -1) {
err_ret("TLS_readline error: %s",
gnutls_strerror(nr));
}
}
#endif
/*
* printf ("DEBUG: reading \"%s\"\n (%d chars)\n",
* big_recvline, nr);
*/
/*
* HTTP replies should be separated by CR-LF. Unfortunately,
* some servers send only CR :-(
*/
body = ((nr == 2) || (nr == 1)); /* Empty line CR-LF seen */
if ((nr < 1) && (timeout_flag)) /* Probably a timeout */
return -1;
if (nr < 1)
/* SourceForge bug #109385 */
/* err_sys ("Error reading HTTP header"); */
return -1;
/*
* if ((int) big_recvline[nr-1] == 10) nr--;
*/
if (first_line) {
/* sscanf parse "HTTP/1.x 200" */
sscanf(big_recvline,"%*s %d", &reply_code);
/* 204 No Content is not an error, message body is empty by definition, see RFC 2616 */
if (reply_code == 204)
return 0; /* zero bytes is correct */
if (! (reply_code >= 200 && reply_code < 300) &&
! ((reply_code >= 300 && reply_code < 400) && accept_redirects))
/*
* Status codes beginning with 3 are not
* errors See bug #850674 and RFC 2616,
* section 10.3
*/
err_quit("HTTP error \"%s\"", big_recvline);
}
total = total + nr;
first_line = FALSE;
}
/* Read the body */
if (!ssl)
nr = readline(fs.fs, big_recvline, MAXTOREAD, FALSE);
/*
* printf ("DEBUG: reading \"%s\"\n (%d chars)\n",
* big_recvline, nr);
*/
/*
* HTTP replies should be separated by CR-LF. Unfortunately,
* some servers send only CR :-(
*/
body = ((nr == 2) || (nr == 1)); /* Empty line CR-LF seen */
if ((nr < 1) && (timeout_flag)) /* Probably a timeout */
return -1;
if (nr < 1)
/* SourceForge bug #109385 */
/* err_sys ("Error reading HTTP header"); */
return -1;
/*
* if ((int) big_recvline[nr-1] == 10) nr--;
*/
if (first_line) {
reply_code = big_recvline[9]; /* 9 because "HTTP/1.x
* 200..." */
if (reply_code != '2'
&& !(reply_code == '3' && accept_redirects))
/*
* Status codes beginning with 3 are not
* errors See bug #850674 and RFC 2616,
* section 10.3
*/
err_quit("HTTP error \"%s\"", big_recvline);
}
total = total + nr;
first_line = FALSE;
}
/* Read the body */
if (!ssl)
nr = readline(fs.fs, big_recvline, MAXTOREAD, FALSE);
#ifdef OPENSSL
else
nr = SSL_readline(fs.ssl, big_recvline, MAXTOREAD, FALSE);
else
nr = SSL_readline(fs.ssl, big_recvline, MAXTOREAD, FALSE);
#endif
#ifdef GNUTLS
else
nr = TLS_readline(fs.tls, big_recvline, MAXTOREAD, FALSE);
else
nr = TLS_readline(fs.tls, big_recvline, MAXTOREAD, FALSE);
#endif
/*
* printf ("DEBUG: reading body \"%s\"\n (%d chars)\n", big_recvline,
* nr);
*/
if ((nr < 2) && (timeout_flag)) /* Probably a timeout */
return -1;
if (nr < 2) /* Hmm, if the body is empty, we'll get a * * * * *
* * * meaningless error message */
err_sys("Error reading HTTP body");
total = total + nr;
return total; /* How to do if we want only the body's size? */
/*
* printf ("DEBUG: reading body \"%s\"\n (%d chars)\n", big_recvline,
* nr);
*/
if ((nr < 2) && (timeout_flag)) /* Probably a timeout */
return -1;
if (nr < 2) /* Hmm, if the body is empty, we'll get a *
* meaningless error message */
err_sys("Error reading HTTP body");
total = total + nr;
return total; /* How to do if we want only the body's size? */
}
#endif /* HTTP */
#endif /* HTTP */

@ -13,94 +13,94 @@
void *
make_icp_sendline(url, shost, opcode, length)
const char *url;
u_num32 *shost;
icp_opcode opcode;
int *length;
const char *url;
u_num32 *shost;
icp_opcode opcode;
int *length;
{
icp_common_t *headerp = NULL;
char *buf = NULL;
char *urloffset = NULL;
u_num32 flags = ICP_FLAG_SRC_RTT;
u_num32 pad = 0;
u_num32 reqnum = 4711;
unsigned short buf_len;
icp_common_t *headerp = NULL;
char *buf = NULL;
char *urloffset = NULL;
u_num32 flags = ICP_FLAG_SRC_RTT;
u_num32 pad = 0;
u_num32 reqnum = 4711;
unsigned short buf_len;
buf_len = sizeof(icp_common_t) + strlen(url) + 1;
if (opcode == ICP_OP_QUERY)
buf_len += sizeof(u_num32);
buf = calloc(buf_len, 1);
headerp = (icp_common_t *) buf;
headerp->opcode = opcode;
headerp->version = ICP_VERSION_CURRENT;
headerp->length = htons(buf_len);
headerp->reqnum = htonl(reqnum);
headerp->flags = htonl(flags);
headerp->pad = pad;
if (shost)
headerp->shostid = htonl(*shost);
/* urloffset = (char *) ((int) buf + sizeof(icp_common_t)); */
urloffset = (char *) (buf + sizeof(icp_common_t));
if (opcode == ICP_OP_QUERY)
urloffset += sizeof(u_num32);
memcpy(urloffset, url, strlen(url));
*length = buf_len;
return buf;
buf_len = sizeof(icp_common_t) + strlen(url) + 1;
if (opcode == ICP_OP_QUERY)
buf_len += sizeof(u_num32);
buf = calloc(buf_len, 1);
headerp = (icp_common_t *) buf;
headerp->opcode = opcode;
headerp->version = ICP_VERSION_CURRENT;
headerp->length = htons(buf_len);
headerp->reqnum = htonl(reqnum);
headerp->flags = htonl(flags);
headerp->pad = pad;
if (shost)
headerp->shostid = htonl(*shost);
/* urloffset = (char *) ((int) buf + sizeof(icp_common_t)); */
urloffset = (char *) (buf + sizeof(icp_common_t));
if (opcode == ICP_OP_QUERY)
urloffset += sizeof(u_num32);
memcpy(urloffset, url, strlen(url));
*length = buf_len;
return buf;
}
int
recv_icp(sockfd, buf, retcode)
int sockfd;
char *buf;
char *retcode;
int sockfd;
char *buf;
char *retcode;
{ /*
* based on draft-wessels-icp-v2-02.txt
*/
icp_common_t *headerp = (icp_common_t *) buf;
int nr, length;
unsigned char opcode;
static char *icp_op_code[] = {
/* 0 */ "ICP_OP_INVALID",
/* 1 */ "ICP_OP_QUERY",
/* 2 */ "ICP_OP_HIT",
/* 3 */ "ICP_OP_MISS",
/* 4 */ "ICP_OP_ERR",
/* 5 */ "",
/* 6 */ "",
/* 7 */ "",
/* 8 */ "",
/* 9 */ "",
/* 10 */ "ICP_OP_SECHO",
/* 11 */ "ICP_OP_DECHO",
/* 12 */ "",
/* 13 */ "",
/* 14 */ "",
/* 15 */ "",
/* 16 */ "",
/* 17 */ "",
/* 18 */ "",
/* 19 */ "",
/* 20 */ "",
/* 21 */ "ICP_OP_MISS_NOFETCH",
/* 22 */ "ICP_OP_DENIED",
/* 23 */ "ICP_OP_HIT_OBJ"
};
{ /*
* based on draft-wessels-icp-v2-02.txt
*/
icp_common_t *headerp = (icp_common_t *) buf;
int nr, length;
unsigned char opcode;
static char *icp_op_code[] = {
/* 0 */ "ICP_OP_INVALID",
/* 1 */ "ICP_OP_QUERY",
/* 2 */ "ICP_OP_HIT",
/* 3 */ "ICP_OP_MISS",
/* 4 */ "ICP_OP_ERR",
/* 5 */ "",
/* 6 */ "",
/* 7 */ "",
/* 8 */ "",
/* 9 */ "",
/* 10 */ "ICP_OP_SECHO",
/* 11 */ "ICP_OP_DECHO",
/* 12 */ "",
/* 13 */ "",
/* 14 */ "",
/* 15 */ "",
/* 16 */ "",
/* 17 */ "",
/* 18 */ "",
/* 19 */ "",
/* 20 */ "",
/* 21 */ "ICP_OP_MISS_NOFETCH",
/* 22 */ "ICP_OP_DENIED",
/* 23 */ "ICP_OP_HIT_OBJ"
};
nr = recvfrom(sockfd, buf, DEFLINE, 0, (struct sockaddr *) 0, (int *) 0);
if (nr < 0) {
if (timeout_flag)
err_quit("Timeout while reading");
else
err_sys("No reply from ICP proxy server");
}
opcode = headerp->opcode;
length = ntohs(headerp->length);
sprintf(retcode, "ICP reply: \42%s\42", icp_op_code[opcode]);
return length;
nr = recvfrom(sockfd, buf, DEFLINE, 0, (struct sockaddr *) 0, (int *) 0);
if (nr < 0) {
if (timeout_flag)
err_quit("Timeout while reading");
else
err_sys("No reply from ICP proxy server");
}
opcode = headerp->opcode;
length = ntohs(headerp->length);
sprintf(retcode, "ICP reply: \42%s\42", icp_op_code[opcode]);
return length;
}
#endif /* ICP */
#endif /* ICP */

@ -11,12 +11,10 @@
#define ICP_FLAG_HIT_OBJ 0x80000000ul
#define ICP_FLAG_SRC_RTT 0x40000000ul
#if SIZEOF_INT == 4
#ifdef __alpha__
typedef unsigned int u_num32;
#elif SIZEOF_LONG == 4
typedef unsigned long u_num32;
#else
#error "No suitable type for representing a 32-bits value"
typedef unsigned long u_num32;
#endif
struct icp_common_s {

@ -1,11 +0,0 @@
#!/bin/sh
# Bug 1688940
# OK
./echoping -v -h "/?query=0123456789656565864854129568977808708770878781672766762766742213542786502345617812784576590234567890123456784455644855856556697867566473432623422345678901234567890123478901234567565719787867155665376556472234516542568425446852434177664277876766" www.james.rcpt.to
echo ""
# Too long
./echoping -v -h "/?query=01234567896565658648541295689778087087708787816727667627667422135427865023456178127845765901234567890123456784455644855856556697867566473432623422345678901234567890123478901234567565719787867155665376556472234516542568425446852434177664277876766" www.james.rcpt.to

@ -5,10 +5,10 @@ AM_INIT_AUTOMAKE(foreign)
dnl TODO: write a XML-RPC plugin for Adamsnames' interface. See a first version in contrib/
AC_ARG_ENABLE(plugin,
[ --enable-plugin=LIST Build only the following plugins],
[if test "$enableval" = "no"; then
[if test "$enableval" == "no"; then
AC_MSG_ERROR([You cannot disable plugin support])
else
if test "$enableval" = "yes"; then
if test "$enableval" == "yes"; then
AC_MSG_ERROR([You must indicate a list of plugins with this option])
else
plugins=$enableval

@ -35,178 +35,180 @@ boolean no_recurse = FALSE;
****************************************************************/
int
nsError(error, domain)
int error;
char *domain;
int error;
char *domain;
{
switch (error) {
case HOST_NOT_FOUND:
err_ret("Unknown domain: %s\n", domain);
return -1;
case NO_DATA:
err_ret("No records of type %s for %s in the Answer section\n",
to_upper(type_name), domain);
return -1;
case TRY_AGAIN:
err_ret("No response for query\n");
return -2;
default:
err_ret("Unexpected error\n");
return -1;
}
switch (error) {
case HOST_NOT_FOUND:
err_ret("Unknown domain: %s\n", domain);
return -1;
case NO_DATA:
err_ret("No records of type %s for %s in the Answer section\n",
to_upper(type_name), domain);
return -1;
case TRY_AGAIN:
err_ret("No response for query\n");
return -2;
default:
err_ret("Unexpected error\n");
return -1;
}
}
void
dns_usage(const char *msg)
{
if (msg) {
fprintf(stderr, "Error: %s\n", msg);
}
poptPrintUsage(dns_poptcon, stderr, 0);
fprintf(stderr, " request\n");
exit(1);
if (msg) {
fprintf(stderr, "Error: %s\n", msg);
}
poptPrintUsage(dns_poptcon, stderr, 0);
fprintf(stderr, " request\n");
exit(1);
}
char *
init(const int argc, const char **argv)
{
int value;
char *hostname;
char *msg = malloc(256);
char *upper_type_name = NULL;
/* popt variables */
struct poptOption options[] = {
{"type", 't', POPT_ARG_STRING, &type_name, 0,
"Type of resources queried (A, MX, SOA, etc)",
"type"},
{"tcp", (char) NULL, POPT_ARG_NONE, &use_tcp, 0,
"Use TCP for the request (virtual circuit)",
"tcp"},
{"no-recurse", (char) NULL, POPT_ARG_NONE, &no_recurse, 0,
"Do not ask recursion",
"no-recurse"},
POPT_AUTOHELP POPT_TABLEEND
};
dns_poptcon = poptGetContext(NULL, argc, argv, options, POPT_CONTEXT_KEEP_FIRST);
while ((value = poptGetNextOpt(dns_poptcon)) > 0) {
}
if (value < -1) {
sprintf(msg, "%s: %s",
poptBadOption(dns_poptcon, POPT_BADOPTION_NOALIAS),
poptStrerror(value));
dns_usage(msg);
}
hostname = (char *) poptGetArg(dns_poptcon); /* Not used */
request = (char *) poptGetArg(dns_poptcon);
if (request == NULL)
dns_usage("Mandatory request missing");
if ((type_name == NULL) || !strcmp(type_name, "")) {
type = T_A;
type_name = "A";
} else {
upper_type_name = (char *) to_upper(type_name);
/*
* TODO: a better algorithm. Use dns_rdatatype_fromtext in
* BIND ?
*/
if (!strcmp(upper_type_name, "A"))
type = T_A;
else if (!strcmp(upper_type_name, "AAAA"))
type = T_AAAA;
else if (!strcmp(upper_type_name, "NS"))
type = T_NS;
else if (!strcmp(upper_type_name, "SOA"))
type = T_SOA;
else if (!strcmp(upper_type_name, "MX"))
type = T_MX;
else if (!strcmp(upper_type_name, "SRV"))
type = T_SRV;
else if (!strcmp(upper_type_name, "CNAME"))
type = T_CNAME;
else if (!strcmp(upper_type_name, "PTR"))
type = T_PTR;
else if (!strcmp(upper_type_name, "TXT"))
type = T_TXT;
else if (!strcmp(upper_type_name, "ANY"))
type = T_ANY;
else
dns_usage("Unknown type");
}
return "domain";
int value;
char *hostname;
char *msg = malloc(256);
char *upper_type_name = NULL;
/* popt variables */
struct poptOption options[] = {
{"type", 't', POPT_ARG_STRING, &type_name, 0,
"Type of resources queried (A, MX, SOA, etc)",
"type"},
{"tcp", (char) NULL, POPT_ARG_NONE, &use_tcp, 0,
"Use TCP for the request (virtual circuit)",
"tcp"},
{"no-recurse", (char) NULL, POPT_ARG_NONE, &no_recurse, 0,
"Do not ask recursion",
"no-recurse"},
POPT_AUTOHELP POPT_TABLEEND
};
dns_poptcon = poptGetContext(NULL, argc,
argv, options, POPT_CONTEXT_KEEP_FIRST);
while ((value = poptGetNextOpt(dns_poptcon)) > 0) {
}
if (value < -1) {
sprintf(msg, "%s: %s",
poptBadOption(dns_poptcon, POPT_BADOPTION_NOALIAS),
poptStrerror(value));
dns_usage(msg);
}
hostname = (char *) poptGetArg(dns_poptcon); /* Not used */
request = (char *) poptGetArg(dns_poptcon);
if (request == NULL)
dns_usage("Mandatory request missing");
if ((type_name == NULL) || !strcmp(type_name, "")) {
type = T_A;
type_name = "A";
} else {
upper_type_name = (char *) to_upper(type_name);
/*
* TODO: a better algorithm. Use dns_rdatatype_fromtext in
* BIND ?
*/
if (!strcmp(upper_type_name, "A"))
type = T_A;
else if (!strcmp(upper_type_name, "AAAA"))
type = T_AAAA;
else if (!strcmp(upper_type_name, "NS"))
type = T_NS;
else if (!strcmp(upper_type_name, "SOA"))
type = T_SOA;
else if (!strcmp(upper_type_name, "MX"))
type = T_MX;
else if (!strcmp(upper_type_name, "SRV"))
type = T_SRV;
else if (!strcmp(upper_type_name, "CNAME"))
type = T_CNAME;
else if (!strcmp(upper_type_name, "PTR"))
type = T_PTR;
else if (!strcmp(upper_type_name, "TXT"))
type = T_TXT;
else if (!strcmp(upper_type_name, "ANY"))
type = T_ANY;
else
dns_usage("Unknown type");
}
return "domain";
}
void
start(struct addrinfo *res)
{
struct sockaddr name_server_sockaddr;
struct sockaddr_in name_server_sockaddr_in;
struct sockaddr_in6 name_server_sockaddr_in6;
name_server = *res;
name_server_sockaddr = *name_server.ai_addr;
if (name_server_sockaddr.sa_family == AF_INET) {
/* Converts a generic sockaddr to an IPv4 sockaddr_in */
(void) memcpy((void *) &name_server_sockaddr_in,
&name_server_sockaddr, sizeof(struct sockaddr));
} else if (name_server_sockaddr.sa_family == AF_INET6) {
struct sockaddr name_server_sockaddr;
struct sockaddr_in name_server_sockaddr_in;
struct sockaddr_in6 name_server_sockaddr_in6;
name_server = *res;
name_server_sockaddr = *name_server.ai_addr;
if (name_server_sockaddr.sa_family == AF_INET) {
/* Converts a generic sockaddr to an IPv4 sockaddr_in */
(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");
/* Converts a generic sockaddr to an IPv6 sockaddr_in6 */
(void) memcpy((void *) &name_server_sockaddr_in6,
&name_server_sockaddr, sizeof(struct sockaddr));
/* 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");
/* Converts a generic sockaddr to an IPv6 sockaddr_in6 */
(void) memcpy((void *) &name_server_sockaddr_in6,
&name_server_sockaddr, sizeof(struct sockaddr));
#else
err_quit
("IPv6 name servers not supported on this platform, may be you should use the -4 option");
err_quit
("IPv6 name servers not supported on this platform, may be you should use the -4 option");
#endif
} else {
err_quit("Unknown family for address of the server");
}
if (res_init() < 0)
err_sys("res_init");
if (name_server_sockaddr.sa_family == AF_INET) {
_res.nsaddr_list[0] = name_server_sockaddr_in;
} else if (name_server_sockaddr.sa_family == AF_INET6) {
} else {
err_quit("Unknown family for address of the server");
}
if (res_init() < 0)
err_sys("res_init");
if (name_server_sockaddr.sa_family == AF_INET) {
_res.nsaddr_list[0] = name_server_sockaddr_in;
} else if (name_server_sockaddr.sa_family == AF_INET6) {
#ifdef HAVE_RES_EXT
/* TODO: completely broken, dioes not work. Check in Stevens */
(void) memcpy(_res_ext.nsaddr_list, &name_server_sockaddr_in6,
sizeof(struct sockaddr_in6));
/* TODO: completely broken, dioes not work. Check in Stevens */
(void) memcpy(_res_ext.nsaddr_list, &name_server_sockaddr_in6,
sizeof(struct sockaddr_in6));
#endif
}
_res.nscount = 1;
_res.options &= ~(RES_DNSRCH | RES_DEFNAMES | RES_NOALIASES);
if (use_tcp) {
_res.options |= RES_USEVC;
}
if (no_recurse) {
_res.options &= ~RES_RECURSE;
}
}
_res.nscount = 1;
_res.options &= ~(RES_DNSRCH | RES_DEFNAMES | RES_NOALIASES);
if (use_tcp) {
_res.options |= RES_USEVC;
}
if (no_recurse) {
_res.options &= ~RES_RECURSE;
}
}
int
execute()
{
union {
HEADER hdr; /* defined in resolv.h */
u_char buf[PACKETSZ]; /* defined in arpa/nameser.h */
} response; /* response buffers */
int response_length; /* buffer length */
if ((response_length = res_query(request, /* the domain we care about */
C_IN, /* Internet class records */
type, (u_char *) & response, /* response
* buffer */
sizeof(response))) /* buffer size */
<0) { /* If negative */
nsError(h_errno, request); /* report the error */
if (h_errno == TRY_AGAIN)
return -1; /* More luck next time? */
else
return -2; /* Give in */
}
/*
* TODO: better analysis of the replies. For instance, replies can be
* in the authority section (delegation info)
*/
return 0;
union {
HEADER hdr; /* defined in resolv.h */
u_char buf[PACKETSZ]; /* defined in arpa/nameser.h */
} response; /* response buffers */
int response_length; /* buffer length */
if ((response_length = res_query(request, /* the domain we care about */
C_IN, /* Internet class records */
type, (u_char *) & response, /* response
* buffer */
sizeof(response))) /* buffer size */
<0) { /* If negative */
nsError(h_errno, request); /* report the error */
if (h_errno == TRY_AGAIN)
return -1; /* More luck next time? */
else
return -2; /* Give in */
}
/*
* TODO: better analysis of the replies. For instance, replies can be
* in the authority section (delegation info)
*/
return 0;
}
void

@ -23,141 +23,137 @@ echoping_options global_options;
void
ldap_usage(const char *msg)
{
if (msg) {
printf("LDAP plugin error: %s\n", msg);
}
poptPrintUsage(ldap_poptcon, stdout, 0);
exit(1);
if (msg) {
printf("LDAP plugin error: %s\n", msg);
}
poptPrintUsage(ldap_poptcon, stdout, 0);
exit(1);
}
char *
init(const int argc, const char **argv,
const echoping_options global_external_options)
{
int value;
char *msg = malloc(MAX_LINE);
char *rest, *port_text;
char *scope_string = NULL;
/* popt variables */
struct poptOption options[] = {
{"request", 'r', POPT_ARG_STRING, &request, 0,
"Request (filter) to send to the LDAP server", "r"},
{"base", 'b', POPT_ARG_STRING, &base, 0,
"Base of the LDAP tree", "b"},
{"scope", 's', POPT_ARG_STRING, &scope_string, 0,
"Scope of the search in the LDAP tree (sub, one or base)", "s"},
{"port", 'p', POPT_ARG_INT, &port, 0,
"TCP port to connect to the LDAP server", "p"},
POPT_AUTOHELP POPT_TABLEEND
};
global_options = global_external_options;
if (global_options.udp)
err_quit("UDP makes no sense for a LDAP connection");
ldap_poptcon = poptGetContext(NULL, argc,
argv, options, POPT_CONTEXT_KEEP_FIRST);
while ((value = poptGetNextOpt(ldap_poptcon)) > 0) {
}
if (value < -1) {
sprintf(msg, "%s: %s",
poptBadOption(ldap_poptcon, POPT_BADOPTION_NOALIAS),
poptStrerror(value));
ldap_usage(msg);
}
if (port == 0)
port = LDAP_PORT;
hostname = poptGetArg(ldap_poptcon);
rest = poptGetArg(ldap_poptcon);
if (rest != NULL) {
fprintf(stderr, "%s: ", rest);
ldap_usage("Additional arguments");
}
if (base == NULL)
base = "";
if (request == NULL || !strcmp(request, ""))
request = "(objectclass=*)"; /* Default mentioned in OpenLDAP
* documentation. Joerg Roth fears that it
* may trigger "Size limit exceeded" if
* there are many objects at this node. RFC
* 4515 seems silent here. */
if (scope_string != NULL) {
scope_string = (char *) to_upper(scope_string);
if (!strcmp(scope_string, "BASE"))
scope = LDAP_SCOPE_BASE;
else if (!strcmp(scope_string, "SUB"))
scope = LDAP_SCOPE_SUBTREE;
else if (!strcmp(scope_string, "ONE"))
scope = LDAP_SCOPE_ONELEVEL;
else
err_quit("Invalid scope \"%s\"", scope_string);
}
if (port == LDAP_PORT) {
return "ldap";
} else {
port_text = malloc(99);
sprintf(port_text, "%d", port);
return port_text;
}
int value;
char *msg = malloc(MAX_LINE);
char *rest, *port_text;
char *scope_string = NULL;
/* popt variables */
struct poptOption options[] = {
{"request", 'r', POPT_ARG_STRING, &request, 0,
"Request (filter) to send to the LDAP server", "r"},
{"base", 'b', POPT_ARG_STRING, &base, 0,
"Base of the LDAP tree", "b"},
{"scope", 's', POPT_ARG_STRING, &scope_string, 0,
"Scope of the search in the LDAP tree (sub, one or base)", "s"},
{"port", 'p', POPT_ARG_INT, &port, 0,
"TCP port to connect to the LDAP server", "p"},
POPT_AUTOHELP POPT_TABLEEND
};
global_options = global_external_options;
if (global_options.udp)
err_quit("UDP makes no sense for a LDAP connection");
ldap_poptcon = poptGetContext(NULL, argc,
argv, options, POPT_CONTEXT_KEEP_FIRST);
while ((value = poptGetNextOpt(ldap_poptcon)) > 0) {
}
if (value < -1) {
sprintf(msg, "%s: %s",
poptBadOption(ldap_poptcon, POPT_BADOPTION_NOALIAS),
poptStrerror(value));
ldap_usage(msg);
}
if (port == 0)
port = LDAP_PORT;
hostname = poptGetArg(ldap_poptcon);
rest = poptGetArg(ldap_poptcon);
if (rest != NULL) {
fprintf(stderr, "%s: ", rest);
ldap_usage("Additional arguments");
}
if (base == NULL)
base = "";
if (request == NULL || !strcmp(request, ""))
request = "(objectclass=*)";
if (scope_string != NULL) {
scope_string = (char *)to_upper(scope_string);
if (!strcmp(scope_string, "BASE"))
scope = LDAP_SCOPE_BASE;
else if (!strcmp(scope_string, "SUB"))
scope = LDAP_SCOPE_SUBTREE;
else if (!strcmp(scope_string, "ONE"))
scope = LDAP_SCOPE_ONELEVEL;
else
err_quit("Invalid scope \"%s\"", scope_string);
}
if (port == LDAP_PORT) {
return "ldap";
} else {
port_text = malloc(99);
sprintf(port_text, "%d", port);
return port_text;
}
}
void
start()
{
int result;
LDAPMessage *response;
int result;
LDAPMessage *response;
session = ldap_init(hostname, port);
if (session == NULL)
err_sys("Cannot initialize LDAP");
/* TODO: allow non-anonymous connections, with ldap_bind_simple_s */
/*
* Unfortunately, ldap_init does not connect to the LDAP server. So
* connection errors (e.g. firewall), will not be detected here and
* loop will go on.
*
* To quote the man page: ldap_init() acts just like ldap_open(), but
* does not open a connection to the LDAP server. The actual
* connection open will occur when the first operation is attempted.
* At this time, ldap_init() is preferred. ldap_open() will be
* depreciated in a later release.
*
* So, we perform a dummy search immediately.
*
* See #1879652 for why we use "dummystuff" and not "*"
*
*/
result = ldap_search_s(session, base, LDAP_SCOPE_ONELEVEL, "(objectClass=dummystuff)", NULL, /* Return
* * all *
* * *
* attributes
*/
1, &response);
if (result != 0) {
err_quit
("Cannot connect to %s (no LDAP server or wrong base, probably): %s",
hostname, ldap_err2string(result));
}
session = ldap_init(hostname, port);
if (session == NULL)
err_sys("Cannot initialize LDAP");
/* TODO: allow non-anonymous connections, with ldap_bind_simple_s */
/*
* Unfortunately, ldap_init does not connect to the LDAP server. So
* connection errors (e.g. firewall), will not be detected here and
* loop will go on.
*
* To quote the man page: ldap_init() acts just like ldap_open(), but
* does not open a connection to the LDAP server. The actual
* connection open will occur when the first operation is attempted.
* At this time, ldap_init() is preferred. ldap_open() will be
* depreciated in a later release.
*
* So, we perform a dummy search immediately.
*/
result = ldap_search_s(session, base, LDAP_SCOPE_ONELEVEL, "(objectclass=*)", NULL, /* Return
* all
* attributes
*/
1, &response);
if (result != 0) {
err_quit
("Cannot connect to %s (no LDAP server or wrong base, probably): %s",
hostname, ldap_err2string(result));
}
}
int
execute()
{
int result;
LDAPMessage *response;
result = ldap_search_s(session, base, scope, request, NULL, /* Return all
* attributes */
0, /* Return attribute types *and* values */
&response);
if (result != 0) {
err_ret("Cannot search \"%s\": %s", request, ldap_err2string(result));
return -1;
}
if (global_options.verbose)
printf("Retrieved: %d entries\n", ldap_count_entries(session, response));
return 0;
int result;
LDAPMessage *response;
result = ldap_search_s(session, base, scope, request, NULL, /* Return
* all
* attributes
*/
0, /* Return attribute types *and* values */
&response);
if (result != 0) {
err_ret("Cannot search \"%s\": %s", request,
ldap_err2string(result));
return -1;
}
if (global_options.verbose)
printf("Retrieved: %d entries\n",
ldap_count_entries(session, response));
return 0;
}
void
terminate()
{
ldap_unbind_s(session);
ldap_unbind_s(session);
}

@ -28,116 +28,120 @@ echoping_options global_options;
void
postgresql_usage(const char *msg)
{
if (msg) {
printf("PostgreSQL plugin error: %s\n", msg);
}
poptPrintUsage(postgresql_poptcon, stdout, 0);
fprintf(stderr, " [SQL-request]\n");
exit(1);
if (msg) {
printf("PostgreSQL plugin error: %s\n", msg);
}
poptPrintUsage(postgresql_poptcon, stdout, 0);
fprintf(stderr, " [SQL-request]\n");
exit(1);
}
char *
init(const int argc, const char **argv,
const echoping_options global_external_options)
{
int value;
char *msg = malloc(256);
char *rest;
/* popt variables */
struct poptOption options[] = {
{"conninfo", 'c', POPT_ARG_STRING, &conninfo, 0,
"Connection information for the Postgresql server. Something like 'host=foo dbname=bar''",
""},
{"readall", 'a', POPT_ARG_NONE, &readall, 0,
"Read all the data sent by the Postgresql server",
""},
{"connect-each-time", 'e', POPT_ARG_NONE, &connect_each_time, 0,
"(Re)Connect to the Postgresql server at each iteration",
""},
POPT_AUTOHELP POPT_TABLEEND
};
global_options = global_external_options;
if (global_options.udp)
err_quit("UDP makes no sense for a PostgreSQL connection");
postgresql_poptcon = poptGetContext(NULL, argc,
argv, options, POPT_CONTEXT_POSIXMEHARDER);
while ((value = poptGetNextOpt(postgresql_poptcon)) > 0) {
}
if (value < -1) {
sprintf(msg, "%s: %s",
poptBadOption(postgresql_poptcon, POPT_BADOPTION_NOALIAS),
poptStrerror(value));
postgresql_usage(msg);
}
request = poptGetArg(postgresql_poptcon);
if (request == NULL)
request = "SELECT now()";
rest = poptGetArg(postgresql_poptcon);
if (rest != NULL)
postgresql_usage("Erroneous additional arguments");
if (conninfo == NULL)
conninfo = "";
return NULL; /* We only use the conninfo, echoping does not see
* our hostname or port */
int value;
char *msg = malloc(256);
char *rest;
/* popt variables */
struct poptOption options[] = {
{"conninfo", 'c', POPT_ARG_STRING, &conninfo, 0,
"Connection information for the Postgresql server. Something like 'host=foo dbname=bar''",
""},
{"readall", 'a', POPT_ARG_NONE, &readall, 0,
"Read all the data sent by the Postgresql server",
""},
{"connect-each-time", 'e', POPT_ARG_NONE, &connect_each_time, 0,
"(Re)Connect to the Postgresql server at each iteration",
""},
POPT_AUTOHELP POPT_TABLEEND
};
global_options = global_external_options;
if (global_options.udp)
err_quit("UDP makes no sense for a PostgreSQL connection");
postgresql_poptcon = poptGetContext(NULL, argc,
argv, options,
POPT_CONTEXT_POSIXMEHARDER);
while ((value = poptGetNextOpt(postgresql_poptcon)) > 0) {
}
if (value < -1) {
sprintf(msg, "%s: %s",
poptBadOption(postgresql_poptcon, POPT_BADOPTION_NOALIAS),
poptStrerror(value));
postgresql_usage(msg);
}
request = poptGetArg(postgresql_poptcon);
if (request == NULL)
request = "SELECT now()";
rest = poptGetArg(postgresql_poptcon);
if (rest != NULL)
postgresql_usage("Erroneous additional arguments");
if (conninfo == NULL)
conninfo = "";
return NULL; /* We only use the conninfo, echoping does not see
* our hostname or port */
}
void
start_raw()
{
if (!connect_each_time) {
conn = PQconnectdb(conninfo);
if (conn == NULL) {
err_quit("Cannot create connection\n");
}
if (PQstatus(conn) == CONNECTION_BAD) {
err_quit("Connection failed: %s\n", PQerrorMessage(conn));
}
}
if (!connect_each_time) {
conn = PQconnectdb(conninfo);
if (conn == NULL) {
err_quit("Cannot create connection\n");
}
if (PQstatus(conn) == CONNECTION_BAD) {
err_quit("Connection failed: %s\n", PQerrorMessage(conn));
}
}
}
int
execute()
{
unsigned int row, column;
char *result;
if (connect_each_time) {
conn = PQconnectdb(conninfo);
if (conn == NULL) {
err_ret("Cannot create connection\n");
return -1;
}
if (PQstatus(conn) == CONNECTION_BAD) {
err_ret("Connection failed: %s\n", PQerrorMessage(conn));
return -1;
}
}
res = PQexec(conn, request);
if (PQresultStatus(res) != PGRES_TUPLES_OK) {
err_ret("Cannot run \"%s\": %s\n", request, PQresultErrorMessage(res));
return -1;
}
if (global_options.verbose)
printf("%d tuples returned\n", PQntuples(res));
if (readall) {
for (row = 0; row < PQntuples(res); row++) {
for (column = 0; column < PQnfields(res); column++) {
result = PQgetvalue(res, row, column);
if (result == NULL) {
err_ret("Cannot retrieve value [%d,%d]\n", row, column);
return -1;
}
/* else { printf ("DEBUG: [%d,%d] %s\n", row, column, result); } */
}
}
}
if (connect_each_time)
PQfinish(conn);
return 0;
unsigned int row, column;
char *result;
if (connect_each_time) {
conn = PQconnectdb(conninfo);
if (conn == NULL) {
err_ret("Cannot create connection\n");
return -1;
}
if (PQstatus(conn) == CONNECTION_BAD) {
err_ret("Connection failed: %s\n", PQerrorMessage(conn));
return -1;
}
}
res = PQexec(conn, request);
if (PQresultStatus(res) != PGRES_TUPLES_OK) {
err_ret("Cannot run \"%s\": %s\n", request,
PQresultErrorMessage(res));
return -1;
}
if (global_options.verbose)
printf("%d tuples returned\n", PQntuples(res));
if (readall) {
for (row = 0; row < PQntuples(res); row++) {
for (column = 0; column < PQnfields(res); column++) {
result = PQgetvalue(res, row, column);
if (result == NULL) {
err_ret("Cannot retrieve value [%d,%d]\n",
row, column);
return -1;
}
/* else { printf ("DEBUG: [%d,%d] %s\n", row,
* column, result); } */
}
}
}
if (connect_each_time)
PQfinish(conn);
return 0;
}
void
terminate()
{
if (!connect_each_time)
PQfinish(conn);
if (!connect_each_time)
PQfinish(conn);
}

@ -12,11 +12,11 @@
char *
init(const int argc, const char *argv[])
{
struct timeval tv;
(void) gettimeofday(&tv, (struct timezone *) NULL);
srand(tv.tv_usec);
return "7"; /* Not used, just to say we use the cooked interface
*/
struct timeval tv;
(void) gettimeofday(&tv, (struct timezone *) NULL);
srand(tv.tv_usec);
return "7"; /* Not used, just to say we use the cooked interface
*/
}
void
@ -27,8 +27,8 @@ start()
int
execute()
{
usleep(rand() % 1000000);
return 1;
usleep(rand() % 1000000);
return 1;
}
void

@ -26,104 +26,105 @@ echoping_options general_options;
void
whois_usage(const char *msg)
{
if (msg) {
printf("Error: %s\n", msg);
}
poptPrintUsage(whois_poptcon, stdout, 0);
fprintf(stderr, " request\n");
exit(1);
if (msg) {
printf("Error: %s\n", msg);
}
poptPrintUsage(whois_poptcon, stdout, 0);
fprintf(stderr, " request\n");
exit(1);
}
char *
init(const int argc, const char **argv, echoping_options global_options)
{
int value;
char *msg = malloc(256);
char *rest;
/* popt variables */
struct poptOption options[] = {
{"dump", 'd', POPT_ARG_NONE, &dump, 'd',
"Dumps the reply from the whois server",
""},
POPT_AUTOHELP POPT_TABLEEND
};
int value;
char *msg = malloc(256);
char *rest;
/* popt variables */
struct poptOption options[] = {
{"dump", 'd', POPT_ARG_NONE, &dump, 'd',
"Dumps the reply from the whois server",
""},
POPT_AUTOHELP POPT_TABLEEND
};
general_options = global_options;
if (global_options.udp)
err_quit("UDP is incompatible with this whois plugin");
/* Will probably be catched before because /etc/services have no entry for UDP
* port 43 */
whois_poptcon = poptGetContext(NULL, argc,
argv, options, POPT_CONTEXT_POSIXMEHARDER);
while ((value = poptGetNextOpt(whois_poptcon)) > 0) {
switch ((char) value) {
case 'd':
break;
default:
sprintf(msg, "Wrong option %d (%c)", value, (char) value);
whois_usage(msg);
}
}
if (value < -1) {
sprintf(msg, "%s: %s",
poptBadOption(whois_poptcon, POPT_BADOPTION_NOALIAS),
poptStrerror(value));
whois_usage(msg);
}
request = (char *) poptGetArg(whois_poptcon);
if (request == NULL)
whois_usage("Mandatory request missing");
rest = (char *) poptGetArg(whois_poptcon);
if (rest != NULL && strcmp(rest, ""))
whois_usage("Extraneous arguments ignored");
return "nicname";
if (global_options.udp)
err_quit("UDP is incompatible with this whois plugin");
/* Will probably be catched before because /etc/services have no entry for
* UDP port 43 */
whois_poptcon = poptGetContext(NULL, argc,
argv, options, POPT_CONTEXT_POSIXMEHARDER);
while ((value = poptGetNextOpt(whois_poptcon)) > 0) {
switch ((char) value) {
case 'd':
break;
default:
sprintf(msg, "Wrong option %d (%c)", value, (char) value);
whois_usage(msg);
}
}
if (value < -1) {
sprintf(msg, "%s: %s",
poptBadOption(whois_poptcon, POPT_BADOPTION_NOALIAS),
poptStrerror(value));
whois_usage(msg);
}
request = (char *) poptGetArg(whois_poptcon);
if (request == NULL)
whois_usage("Mandatory request missing");
rest = (char *) poptGetArg(whois_poptcon);
if (rest != NULL && strcmp(rest, ""))
whois_usage("Extraneous arguments ignored");
return "nicname";
}
void
start(struct addrinfo *res)
{
whois_server = *res;
whois_server = *res;
}
int
execute()
{
int nr = 0;
char recvline[MAX_LINE + 1];
char complete_request[MAX_REQUEST];
int nr = 0;
char recvline[MAX_LINE + 1];
char complete_request[MAX_REQUEST];
#ifdef HAVE_TCP_INFO
struct tcp_info tcpinfo;
socklen_t socket_length = sizeof(tcpinfo);
struct tcp_info tcpinfo;
socklen_t socket_length = sizeof(tcpinfo);
#endif
if ((sockfd =
socket(whois_server.ai_family, whois_server.ai_socktype,
whois_server.ai_protocol)) < 0)
err_sys("Can't open socket");
if (connect(sockfd, whois_server.ai_addr, whois_server.ai_addrlen) < 0)
err_sys("Can't connect to server");
if ((files = fdopen(sockfd, "r")) == NULL)
err_sys("Cannot fdopen");
sprintf(complete_request, "%s\r\n", request);
n = strlen(complete_request);
if (writen(sockfd, complete_request, n) != n)
err_sys("writen error on socket");
/* Read from the server */
while ((nr = readline(files, recvline, MAX_LINE, 0)) > 0)
if (dump)
printf("%s", recvline);
if (dump)
printf("\n");
if ((sockfd =
socket(whois_server.ai_family, whois_server.ai_socktype,
whois_server.ai_protocol)) < 0)
err_sys("Can't open socket");
if (connect(sockfd, whois_server.ai_addr, whois_server.ai_addrlen) < 0)
err_sys("Can't connect to server");
if ((files = fdopen(sockfd, "r")) == NULL)
err_sys("Cannot fdopen");
sprintf(complete_request, "%s\r\n", request);
n = strlen(complete_request);
if (writen(sockfd, complete_request, n) != n)
err_sys("writen error on socket");
/* Read from the server */
while ((nr = readline(files, recvline, MAX_LINE, 0)) > 0)
if (dump)
printf("%s", recvline);
if (dump)
printf("\n");
#ifdef HAVE_TCP_INFO
/* Thanks to Perry Lorier <perry@coders.net> for the tip */
if (general_options.verbose) {
if (getsockopt(sockfd, SOL_TCP, TCP_INFO, &tcpinfo, &socket_length)
!= -1) {
printf("Estimated TCP RTT: %.04f seconds\n",
tcpinfo.tcpi_rtt / 1000000.0);
}
}
/* Thanks to Perry Lorier <perry@coders.net> for the tip */
if (general_options.verbose) {
if (getsockopt
(sockfd, SOL_TCP, TCP_INFO, &tcpinfo, &socket_length)
!= -1) {
printf("Estimated TCP RTT: %.04f seconds\n",
tcpinfo.tcpi_rtt / 1000000.0);
}
}
#endif
close(sockfd);
return 1;
close(sockfd);
return 1;
}
void

@ -9,41 +9,41 @@
int
readline(fs, ptr, maxlen, ln)
FILE *fs;
char *ptr;
int maxlen;
unsigned short ln;
FILE *fs;
char *ptr;
int maxlen;
unsigned short ln;
{
int n = 1;
char *rc;
int r;
int n = 1;
char *rc;
int r;
/* Reading with fgets or fread instead of read one-character-at-a-time is more
* than ten times faster, on a local server. */
if (ln) {
rc = fgets(ptr, maxlen + 1, fs);
if (rc == NULL) {
if (timeout_flag)
return n;
return (-1);
}
n = strlen(rc);
return n;
} else {
while (n < maxlen) {
r = fread(ptr, 1, maxlen, fs);
if (timeout_flag)
return r;
if (r == 0) {
if (n == 1)
return (0); /* EOF, no data read */
else
break; /* EOF, some data was read */
}
n = n + r;
}
}
return (n);
/* Reading with fgets or fread instead of read one-character-at-a-time is
* more than ten times faster, on a local server. */
if (ln) {
rc = fgets(ptr, maxlen + 1, fs);
if (rc == NULL) {
if (timeout_flag)
return n;
return (-1);
}
n = strlen(rc);
return n;
} else {
while (n < maxlen) {
r = fread(ptr, 1, maxlen, fs);
if (timeout_flag)
return r;
if (r == 0) {
if (n == 1)
return (0); /* EOF, no data read */
else
break; /* EOF, some data was read */
}
n = n + r;
}
}
return (n);
}
#ifdef OPENSSL
@ -54,67 +54,69 @@ int buf_end;
int
SSL_readline(sslh, ptr, maxlen, ln)
SSL *sslh;
char *ptr;
int maxlen;
unsigned short ln;
SSL *sslh;
char *ptr;
int maxlen;
unsigned short ln;
{
int rc = 0;
int n = 0;
int i, oi;
if (ln) {
/* Empty buffer */
if (buf_end == 0) {
rc = SSL_read(sslh, SSL_buffer, maxlen);
if (rc == -1)
return rc;
buf_end = rc;
buf_ptr = 0;
}
/* No more data in the buffer */
else if (buf_ptr == buf_end) {
buf_ptr = 0;
rc = SSL_read(sslh, SSL_buffer, maxlen);
if (rc == -1)
return rc;
buf_end = rc;
} else if (SSL_buffer[buf_end] != '\n') {
/* We have a probleme here is the first SSL_read sent back a text not
* finished by a \n. See www.SSL.de for an example. We get more data.
* See bug #230384 */
rc = SSL_read(sslh, SSL_buffer + buf_end, maxlen);
if (rc == -1)
return rc;
buf_end = buf_end + rc;
}
for (oi = buf_ptr, i = buf_ptr; i <= buf_end && SSL_buffer[i] != '\n'; i++) {
*ptr++ = SSL_buffer[i];
buf_ptr++;
}
if (SSL_buffer[i] == '\n')
buf_ptr++;
*ptr = '\0';
/* if (ln) printf ("SSL_readline returns %d (%s)\n", i - oi, SSL_buffer); */
return (i - oi);
} else {
/* OpenSSL reads at most 4096 characters */
rc = 1; /* Just to avoid exiting too soon */
while (n < maxlen && rc != 0) {
if ((buf_end == 0) || (buf_ptr > buf_end)) {
rc = SSL_read(sslh, ptr, maxlen);
buf_end = 0;
buf_ptr = 0;
} else {
for (i = buf_ptr; i < maxlen && i <= buf_end; i++) {
*ptr++ = SSL_buffer[i];
rc++;
}
buf_ptr = i;
}
n = n + rc;
}
return n;
}
int rc = 0;
int n = 0;
int i, oi;
if (ln) {
/* Empty buffer */
if (buf_end == 0) {
rc = SSL_read(sslh, SSL_buffer, maxlen);
if (rc == -1)
return rc;
buf_end = rc;
buf_ptr = 0;
}
/* No more data in the buffer */
else if (buf_ptr == buf_end) {
buf_ptr = 0;
rc = SSL_read(sslh, SSL_buffer, maxlen);
if (rc == -1)
return rc;
buf_end = rc;
} else if (SSL_buffer[buf_end] != '\n') {
/* We have a probleme here is the first SSL_read sent back a
* text not finished by a \n. See www.SSL.de for an example.
* We get more data. See bug #230384 */
rc = SSL_read(sslh, SSL_buffer + buf_end, maxlen);
if (rc == -1)
return rc;
buf_end = buf_end + rc;
}
for (oi = buf_ptr, i = buf_ptr;
i <= buf_end && SSL_buffer[i] != '\n'; i++) {
*ptr++ = SSL_buffer[i];
buf_ptr++;
}
if (SSL_buffer[i] == '\n')
buf_ptr++;
*ptr = '\0';
/* if (ln) printf ("SSL_readline returns %d (%s)\n", i - oi,
* SSL_buffer); */
return (i - oi);
} else {
/* OpenSSL reads at most 4096 characters */
rc = 1; /* Just to avoid exiting too soon */
while (n < maxlen && rc != 0) {
if ((buf_end == 0) || (buf_ptr > buf_end)) {
rc = SSL_read(sslh, ptr, maxlen);
buf_end = 0;
buf_ptr = 0;
} else {
for (i = buf_ptr; i < maxlen && i <= buf_end; i++) {
*ptr++ = SSL_buffer[i];
rc++;
}
buf_ptr = i;
}
n = n + rc;
}
return n;
}
}
#endif
@ -126,65 +128,69 @@ int buf_end;
int
TLS_readline(session, ptr, maxlen, ln)
gnutls_session session;
char *ptr;
int maxlen;
unsigned short ln;
gnutls_session session;
char *ptr;
int maxlen;
unsigned short ln;
{
int rc = 0;
int n = 0;
int i, oi;
if (ln) {
/* Empty buffer */
if (buf_end == 0) {
rc = gnutls_record_recv(session, TLS_buffer, maxlen);
if (rc == -1)
return rc;
buf_end = rc;
buf_ptr = 0;
}
/* No more data in the buffer */
else if (buf_ptr == buf_end) {
buf_ptr = 0;
rc = gnutls_record_recv(session, TLS_buffer, maxlen);
if (rc == -1)
return rc;
buf_end = rc;
} else if (TLS_buffer[buf_end] != '\n') {
rc = gnutls_record_recv(session, TLS_buffer + buf_end, maxlen);
if (rc == -1)
return rc;
buf_end = buf_end + rc;
}
for (oi = buf_ptr, i = buf_ptr; i <= buf_end && TLS_buffer[i] != '\n'; i++) {
*ptr++ = TLS_buffer[i];
buf_ptr++;
}
if (TLS_buffer[i] == '\n')
buf_ptr++;
*ptr = '\0';
/* printf ("DEBUG: TLS_readline returns %d (%s)\n", i - oi, TLS_buffer); */
return (i - oi);
} else {
rc = 1; /* Just to avoid exiting too soon */
while (n < maxlen && rc > 0) {
if ((buf_end == 0) || (buf_ptr > buf_end)) {
rc = gnutls_record_recv(session, ptr, maxlen);
buf_end = 0;
buf_ptr = 0;
} else {
for (i = buf_ptr; i < maxlen && i <= buf_end; i++) {
*ptr++ = TLS_buffer[i];
rc++;
/* printf ("DEBUG: Now %d chars read\n", rc); */
}
buf_ptr = i;
}
if (rc > 0)
n = n + rc;
/* printf ("DEBUG: Now %d chars to send\n", n); */
}
return n;
}
int rc = 0;
int n = 0;
int i, oi;
if (ln) {
/* Empty buffer */
if (buf_end == 0) {
rc = gnutls_record_recv(session, TLS_buffer, maxlen);
if (rc == -1)
return rc;
buf_end = rc;
buf_ptr = 0;
}
/* No more data in the buffer */
else if (buf_ptr == buf_end) {
buf_ptr = 0;
rc = gnutls_record_recv(session, TLS_buffer, maxlen);
if (rc == -1)
return rc;
buf_end = rc;
} else if (TLS_buffer[buf_end] != '\n') {
rc = gnutls_record_recv(session, TLS_buffer + buf_end,
maxlen);
if (rc == -1)
return rc;
buf_end = buf_end + rc;
}
for (oi = buf_ptr, i = buf_ptr;
i <= buf_end && TLS_buffer[i] != '\n'; i++) {
*ptr++ = TLS_buffer[i];
buf_ptr++;
}
if (TLS_buffer[i] == '\n')
buf_ptr++;
*ptr = '\0';
/* printf ("DEBUG: TLS_readline returns %d (%s)\n", i - oi,
* TLS_buffer); */
return (i - oi);
} else {
rc = 1; /* Just to avoid exiting too soon */
while (n < maxlen && rc > 0) {
if ((buf_end == 0) || (buf_ptr > buf_end)) {
rc = gnutls_record_recv(session, ptr, maxlen);
buf_end = 0;
buf_ptr = 0;
} else {
for (i = buf_ptr; i < maxlen && i <= buf_end; i++) {
*ptr++ = TLS_buffer[i];
rc++;
/* printf ("DEBUG: Now %d chars read\n",
* rc); */
}
buf_ptr = i;
}
if (rc > 0)
n = n + rc;
/* printf ("DEBUG: Now %d chars to send\n", n); */
}
return n;
}
}
#endif

@ -10,7 +10,7 @@ autoheader
libtoolize --force
automake --add-missing
autoconf
cd plugins
pushd plugins
aclocal
automake --foreign --add-missing
autoconf
@ -21,5 +21,4 @@ for dir in dns random whois ldap postgresql; do
automake --foreign --add-missing
autoconf
cd ..
done
cd ..
done

@ -13,22 +13,22 @@ char big_recvline[MAXTOREAD];
int
smtp_read_response_from_server(FILE * fs)
{
int nr;
int i;
int nr;
int i;
for (i = 0; i < MAXSMTPLINES; i++) {
nr = readline(fs, big_recvline, MAXTOREAD, TRUE);
if (nr <= 4) {
return -1;
}
if (big_recvline[3] == ' ') {
return nr;
}
if (big_recvline[3] != '-') {
return -1;
}
}
return -1;
for (i = 0; i < MAXSMTPLINES; i++) {
nr = readline(fs, big_recvline, MAXTOREAD, TRUE);
if (nr <= 4) {
return -1;
}
if (big_recvline[3] == ' ') {
return nr;
}
if (big_recvline[3] != '-') {
return -1;
}
}
return -1;
}
#endif /* SMTP */
#endif /* SMTP */

@ -10,7 +10,7 @@ echo " echoping's fault: it may be a network problem."
./echoping -6 -h / -v www.afnic.fr
./echoping -6 -v -R -h / "[2001:4f8:0:2::d]:80" # RFC 3986, section 3.2.2
./echoping -6 -v -R -h / "[2001:4f8:0:2::d]:80" # RFC 2732
# We force the use of IPv6 with -6 because some libc (Solaris) are
# smart enough to send only the IPv4 adresses to the application if

@ -7,7 +7,6 @@ echo "Since this tests tries remote servers, a failure is not always "
echo " echoping's fault: it may be a network problem."
echo "On some systems, you may NEED to be root."
# Raise the precedence to "critic" (RFC 791, section 3.1)
./echoping -P 0xa0 -h / www.gullitv.fr
# IPTOS_THROUGHPUT

@ -13,39 +13,39 @@ char *
random_string(unsigned length)
{
char *state = (char *) malloc(sizeof(char) * STATES);
char *result = (char *) malloc(length + 1);
int i, number;
unsigned seed = (unsigned) time((time_t *) NULL);
char *state = (char *) malloc(sizeof(char) * STATES);
char *result = (char *) malloc(length + 1);
int i, number;
unsigned seed = (unsigned) time((time_t *) NULL);
/* printf ("Seed is %u\n", seed); */
/* printf ("Seed is %u\n", seed); */
/* Initialize random generator */
(void) initstate(seed, state, STATES);
/* Initialize random generator */
(void) initstate(seed, state, STATES);
for (i = 0; i < length; i++) {
number = (random() % 94) + 33;
/* printf ("Number for %d is %d\n", i, number); */
result[i] = (char) number;
}
result[length] = '\0';
for (i = 0; i < length; i++) {
number = (random() % 94) + 33;
/* printf ("Number for %d is %d\n", i, number); */
result[i] = (char) number;
}
result[length] = '\0';
/* printf ("Result is %s\n", result); */
/* printf ("Result is %s\n", result); */
return result;
return result;
}
char *
to_upper(char *input)
{
int c;
char *result;
result = (char *) malloc(strlen(input));
for (c = 0; c < strlen(input); c++)
result[c] = toupper((int) input[c]);
result[strlen(input)] = '\0';
return result;
int c;
char *result;
result = (char *) malloc(strlen(input));
for (c = 0; c < strlen(input); c++)
result[c] = toupper((int)input[c]);
result[strlen(input)] = '\0';
return result;
}
/*
@ -54,91 +54,91 @@ to_upper(char *input)
*/
void
tvsub(out, in)
struct timeval *out, *in;
struct timeval *out, *in;
{
if ((out->tv_usec -= in->tv_usec) < 0) {
--out->tv_sec;
out->tv_usec += 1000000;
}
out->tv_sec -= in->tv_sec;
if ((out->tv_usec -= in->tv_usec) < 0) {
--out->tv_sec;
out->tv_usec += 1000000;
}
out->tv_sec -= in->tv_sec;
}
/* tvadd -- Adds 2 timeval structs: out = out + in. */
void
tvadd(out, in)
struct timeval *out, *in;
struct timeval *out, *in;
{
if ((out->tv_usec += in->tv_usec) >= 1000000) {
++out->tv_sec;
out->tv_usec -= 1000000;
}
out->tv_sec += in->tv_sec;
if ((out->tv_usec += in->tv_usec) >= 1000000) {
++out->tv_sec;
out->tv_usec -= 1000000;
}
out->tv_sec += in->tv_sec;
}
/* tvavg -- Averages a timeval struct */
void
tvavg(out, number)
struct timeval *out;
int number;
struct timeval *out;
int number;
{
double result;
/*
* out->tv_sec = out->tv_sec/number; out->tv_usec =
* out->tv_usec/number;
*/
result = (1000000 * out->tv_sec + out->tv_usec) / number;
/* printf ("Result of average is %f\n", result) */ ;
out->tv_sec = (long) (result / 1000000);
out->tv_usec = (long) (result - (out->tv_sec * 1000000));
double result;
/*
* out->tv_sec = out->tv_sec/number; out->tv_usec =
* out->tv_usec/number;
*/
result = (1000000 * out->tv_sec + out->tv_usec) / number;
/* printf ("Result of average is %f\n", result) */ ;
out->tv_sec = (long) (result / 1000000);
out->tv_usec = (long) (result - (out->tv_sec * 1000000));
}
/* tvstddev -- Computes the standard deviation of a set of results */
void
tvstddev(out, number, average, results)
struct timeval *out;
int number;
struct timeval average;
struct result *results;
struct timeval *out;
int number;
struct timeval average;
struct result *results;
{
int i;
struct timeval result = null_timeval;
struct timeval avg = null_timeval;
int i;
struct timeval result = null_timeval;
struct timeval avg = null_timeval;
#ifdef DEBUG
struct timeval var = null_timeval;
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;
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;
#ifdef DEBUG
printf("DEBUG: Value is %f (average is %f)\n", tv2double
(result), tv2double(average));
printf("DEBUG: Value is %f (average is %f)\n", tv2double
(result), tv2double(average));
#endif
avg = average;
if (tvcmp(&result, &avg) == -1) {
small = result;
large = avg;
} else {
large = result;
small = avg;
}
tvsub(&large, &small);
avg = average;
if (tvcmp(&result, &avg) == -1) {
small = result;
large = avg;
} else {
large = result;
small = avg;
}
tvsub(&large, &small);
#ifdef DEBUG
printf("abs offset is %f\n", tv2double(large));
printf("abs offset is %f\n", tv2double(large));
#endif
d_offset = tv2double(large);
d_square = d_offset * d_offset;
d_variance += d_square;
d_offset = tv2double(large);
d_square = d_offset * d_offset;
d_variance += d_square;
#ifdef DEBUG
printf("variance is now %f\n", tv2double(var));
printf("variance is now %f\n", tv2double(var));
#endif
}
}
result = double2tv(sqrt(d_variance / (double) number));
out->tv_sec = result.tv_sec;
out->tv_usec = result.tv_usec;
}
}
result = double2tv(sqrt(d_variance / (double) number));
out->tv_sec = result.tv_sec;
out->tv_usec = result.tv_usec;
}
@ -147,115 +147,116 @@ tvstddev(out, number, average, results)
/* TODO: IWBN to return the number of excluded outliers */
void
tvstddevavg(out, number, average, results, n_stddev)
struct timeval *out; /* contains std dev on entry */
int number;
struct timeval average;
struct result *results;
double n_stddev;
struct timeval *out; /* contains std dev on entry */
int number;
struct timeval average;
struct result *results;
double n_stddev;
{
int i, valid = 0;
struct timeval result; /* working value */
struct timeval var = null_timeval; /* result accumulator */
double x;
double maxdev = tv2double(*out) * n_stddev;
int i, valid = 0;
struct timeval result; /* working value */
struct timeval var = null_timeval; /* result accumulator */
double x;
double maxdev = tv2double(*out) * n_stddev;
if (tvcmp(out, &null_timeval) == 0) {
/* if the SD is 0 then we just return the average */
*out = average;
return;
}
if (tvcmp(out, &null_timeval) == 0) {
/* if the SD is 0 then we just return the average */
*out = average;
return;
}
for (i = 0; i < number; i++) {
if (results[i].valid == 1) {
result = results[i].timevalue;
tvsub(&result, &average);
/* printf ("value is %f (stddev is %f)\n", tv2double (result), tv2double
* (stddev)); */
/* ensure that result (difference to average) is absolute value */
if (tvcmp(&result, &null_timeval) == -1) {
result = average;
tvsub(&result, &results[i].timevalue);
}
x = tv2double(result);
/* printf("value is %g maxdev %g\n",x,maxdev); */
if (x <= maxdev) {
/* deviation is less than stddev */
tvadd(&var, &results[i].timevalue);
valid++;
} else {
/* printf("dropped\n"); */
}
}
}
/* printf ("total is %f in %d samples\n", tv2double (var), valid); */
if (valid > 0) {
*out = double2tv(tv2double(var) / valid);
} else {
*out = null_timeval;
}
for (i = 0; i < number; i++) {
if (results[i].valid == 1) {
result = results[i].timevalue;
tvsub(&result, &average);
/* printf ("value is %f (stddev is %f)\n", tv2double
* (result), tv2double (stddev)); */
/* ensure that result (difference to average) is absolute
* value */
if (tvcmp(&result, &null_timeval) == -1) {
result = average;
tvsub(&result, &results[i].timevalue);
}
x = tv2double(result);
/* printf("value is %g maxdev %g\n",x,maxdev); */
if (x <= maxdev) {
/* deviation is less than stddev */
tvadd(&var, &results[i].timevalue);
valid++;
} else {
/* printf("dropped\n"); */
}
}
}
/* printf ("total is %f in %d samples\n", tv2double (var), valid); */
if (valid > 0) {
*out = double2tv(tv2double(var) / valid);
} else {
*out = null_timeval;
}
}
/* tvcmp -- Compares two timeval structs */
int
tvcmp(left, right)
struct timeval *left, *right;
struct timeval *left, *right;
{
if (left->tv_sec < right->tv_sec) {
return -1;
}
if (left->tv_sec > right->tv_sec) {
return 1;
}
if (left->tv_usec < right->tv_usec) {
return -1;
}
if (left->tv_usec > right->tv_usec) {
return 1;
}
return 0;
if (left->tv_sec < right->tv_sec) {
return -1;
}
if (left->tv_sec > right->tv_sec) {
return 1;
}
if (left->tv_usec < right->tv_usec) {
return -1;
}
if (left->tv_usec > right->tv_usec) {
return 1;
}
return 0;
}
/* tvmin */
void
tvmin(champion, challenger)
struct timeval *champion, *challenger;
struct timeval *champion, *challenger;
{
if (tvcmp(champion, challenger) == 1) {
champion->tv_sec = challenger->tv_sec;
champion->tv_usec = challenger->tv_usec;
}
if (tvcmp(champion, challenger) == 1) {
champion->tv_sec = challenger->tv_sec;
champion->tv_usec = challenger->tv_usec;
}
}
/* tvmax */
void
tvmax(champion, challenger)
struct timeval *champion, *challenger;
struct timeval *champion, *challenger;
{
if (tvcmp(champion, challenger) == -1) {
champion->tv_sec = challenger->tv_sec;
champion->tv_usec = challenger->tv_usec;
}
if (tvcmp(champion, challenger) == -1) {
champion->tv_sec = challenger->tv_sec;
champion->tv_usec = challenger->tv_usec;
}
}
double
tv2double(tv)
struct timeval tv;
struct timeval tv;
{
double result;
result =
(((((double) tv.tv_sec) * 1000000.0) + (double) tv.tv_usec) / 1000000.0);
/* printf ("Double is %9.3f\n", result); */
return result;
double result;
result =
(((((double) tv.tv_sec) * 1000000.0) + (double) tv.tv_usec) / 1000000.0);
/* printf ("Double is %9.3f\n", result); */
return result;
}
struct timeval
double2tv(x)
double x;
double x;
{
struct timeval result;
result.tv_sec = (int) (x);
result.tv_usec = (int) ((x - result.tv_sec) * 1000000);
return result;
struct timeval result;
result.tv_sec = (int) (x);
result.tv_usec = (int) ((x - result.tv_sec) * 1000000);
return result;
}

@ -9,24 +9,24 @@
int
writen(fd, ptr, nbytes)
register int fd;
register char *ptr;
register int nbytes;
register int fd;
register char *ptr;
register int nbytes;
{
int nleft, nwritten;
int nleft, nwritten;
nleft = nbytes;
while (nleft > 0) {
nwritten = write(fd, ptr, nleft);
if (nwritten <= 0)
return (nwritten); /* error */
/* Some systems, such as Digital's OSF1 (Digital Unix) doesn't set the
* returned value to -1, even when interrupted by an alarm, whatever says
* the documentation. errno is not set. */
if ((nwritten < nleft) && timeout_flag)
return nwritten;
nleft -= nwritten;
ptr += nwritten;
}
return (nbytes - nleft);
nleft = nbytes;
while (nleft > 0) {
nwritten = write(fd, ptr, nleft);
if (nwritten <= 0)
return (nwritten); /* error */
/* Some systems, such as Digital's OSF1 (Digital Unix) doesn't set
* the returned value to -1, even when interrupted by an alarm,
* whatever says the documentation. errno is not set. */
if ((nwritten < nleft) && timeout_flag)
return nwritten;
nleft -= nwritten;
ptr += nwritten;
}
return (nbytes - nleft);
}

@ -1,7 +1,19 @@
#use wml::template Title="echoping donations"
<!-- $Id$ -->
<P>If you want to help and/or motivate echoping and its developer, you <em>can</em>
(but are not forced to do so, echoping is free software):
<P>Give money to a worthy cause :-)
<OL>
<LI>Give money through <A HREF="http://sourceforge.net/project/project_donations.php?group_id=4581">Sourceforge's donation system</A>
<LI>Use my <A HREF="http://www.amazon.com/gp/registry/23ELBV1YZ93SC">Amazon's wish list</A>
<LI>Send me a postcard. I love postcards:<BR>
Stephane Bortzmeyer<BR>
127, rue Brancion<BR>
75015 Paris<BR>
France
</OL>
<P>Or give money to a worthy cause :-)

@ -2,23 +2,27 @@
<!-- $Id$ -->
<P><em>Recent news:</em> a beta version of the future echoping is <A
HREF="ftp://ftp.internatif.org/pub/unix/echoping/">available</A>. This
version, 6.0, will be the first with plugins, so you can extend
echoping with any protocol you like and/or use.
<P>"echoping" is a small program to test (approximatively) performances of a
remote host by sending it requests such as HTTP requests.
<P>To install it, see the INSTALL file. Or type "<code>./configure
--config-cache&& make && sudo make install</code>" if you're in a
hurry :-) Several operating systems have echoping already packaged
(Debian, Gentoo, FreeBSD, NetBSD). <A
HREF="http://sourceforge.net/project/showfiles.php?group_id=4581&package_id=4579">Download</A>, if you
wish. You may be interested also in <A
remote host by sending it TCP "echo" (or other protocol, such as HTTP) packets.
<P>To install it, see the INSTALL file. Or type "<code>./configure &&
make && sudo make install</code>" if you're in a hurry :-) Several
operating systems have echoping already packaged (Debian, FreeBSD,
NetBSD). <A
HREF="ftp://ftp.internatif.org/pub/unix/echoping">Download</A>, if you
wish. (Or you may prefer access the latest developments <A
HREF="http://sourceforge.net/svn/?group_id=4581">via Subversion</A>:
the module is named "SRC"; but be careful, this is not for the faint
of heart and you need to master GNU auto* tools.) You may be
interested in <A
HREF="http://sourceforge.net/project/?group_id=4581">SourceForge's
page about echoping</A>, with the bug reports, etc.
You may prefer access the latest developments <A
HREF="http://sourceforge.net/svn/?group_id=4581">via Subversion</A>:
the module is named "SRC"; but <EM>be careful</EM>, this is not for the faint
of heart and you need to master GNU auto* tools.
<P>To use it, simply:
<PRE>
@ -37,8 +41,6 @@ test hosts which aren't yours.
<P>Current features:
<UL>
<LI>plugins, so you can extend
echoping with any protocol you like and/or use,
<LI>Supports IPv6 as well as IPv4,
<LI>Supports IDN (Unicode domain names like <CODE>café.gennic.net</CODE>),
<LI>uses the protocols echo, discard, chargen or HTTP,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,755 +0,0 @@
{"tickets": [{
"status": "open-fixed",
"reported_by_id": "4f74b61d71b75b397a006f01",
"related_artifacts": [],
"attachments": [],
"reported_by": "zcougar",
"assigned_to": "bortz",
"labels": [],
"discussion_disabled": false,
"assigned_to_id": "4f3540db0594ca2bc0000b32",
"private": false,
"summary": "RPM spec file",
"description": "I made RPM spec file for echoping. It would be nice if\r\nyou can put this file into the package. Then it will be\r\nvery easy to make RPM from source \\(rpm -ta\r\nechoping-x.x.x.tar.gz\\).\r\n\r\nBoth SRPM and RPM built on SuSE 9.0 are available also:\r\n\r\nhttp://www.version6.net/rpm/ecmh-20040110-1.src.rpm\r\nhttp://www.version6.net/rpm/ecmh-20040110-1.i586.rpm\r\n\r\n\\-- \r\nCougar\r\n",
"discussion_thread": {
"_id": "7bc6a80d",
"posts": [
{
"text": "echoping RPM spec file",
"attachments": [
{
"url": "http://sourceforge.net/p/echoping/patches/_discuss/thread/7bc6a80d/fac2/attachment/echoping.spec",
"bytes": 1116
}
],
"author": "zcougar",
"timestamp": "2004-06-30 17:52:52",
"last_edited": null,
"slug": "fac2",
"subject": "#1 RPM spec file"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: NO\n\nOK, downloaded the right :-\\) \".src.rpm\" from rhttp://www.version6.net/rpm, \"rpm2cpio echoping.src.rpm | cpio -idv\"\r\n\r\nBut the echoping.spec is not much better than the one already in echoping distribution. I merged the two files, committed in Subversion \\(r. 358\\) testing on a RPM-enabled machine is now needed.\r\n",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 21:37:47",
"last_edited": null,
"slug": "0956",
"subject": "#1 RPM spec file"
},
{
"text": "- **assigned_to**: nobody --> bortz\n- **status**: open --> open-fixed",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 21:37:47",
"last_edited": null,
"slug": "b62c",
"subject": "#1 RPM spec file"
}
],
"discussion_id": "518aabb45fcbc979b923a2dd",
"subject": ""
},
"mod_date": "2007-03-07 21:37:47",
"votes_down": 0,
"votes_up": 0,
"_id": "518aabb45fcbc979b923a2e8",
"discussion_thread_url": "http://sourceforge.net/rest/p/echoping/patches/_discuss/thread/7bc6a80d/",
"ticket_num": 1,
"custom_fields": {
"_priority": "5"
},
"created_date": "2004-06-30 17:52:51"
},{
"status": "closed-fixed",
"reported_by_id": null,
"related_artifacts": [],
"attachments": [],
"reported_by": "*anonymous",
"assigned_to": "bortz",
"labels": [],
"discussion_disabled": false,
"assigned_to_id": "4f3540db0594ca2bc0000b32",
"private": false,
"summary": "add WHOIS support and fix duplicate write to server",
"description": "This patch adds whois support to echoping. It also\r\nremoves a\r\nproblem that caused the \"sendline\" to be sent to the\r\nserver twice. This problem causes the SMTP-checker to\r\nsend QUIT twice, which is not so important, but it\r\nactually broke the WHOIS check against some servers.\r\n\r\nTo use WHOIS, do this:\r\nechoping -W example.com hostname\r\n\r\nThe reading/writing seems to be a bit shaky, it fails\r\nwith some servers. I'm not sure why, could be something\r\nis not completely correct in the patch.\r\n\r\nKetil Froyn &lt;ketil@froyn.name&gt;",
"discussion_thread": {
"_id": "c0518af1",
"posts": [
{
"text": "Patch to add WHOIS support to echoping and remove duplicate write",
"attachments": [
{
"url": "http://sourceforge.net/p/echoping/patches/_discuss/thread/c0518af1/72e0/attachment/echoping_add_whois.diff",
"bytes": 6038
}
],
"author": "nobody",
"timestamp": "2004-08-12 16:28:03",
"last_edited": null,
"slug": "72e0",
"subject": "#2 add WHOIS support and fix duplicate write to server"
},
{
"text": "Logged In: NO \n\nThis is the kind of error I get:\r\n\r\nreadline error: 1 bytes read, 13 bytes requested \\(Illegal seek\\)\r\n\r\nI haven't debugged the reason for this, it works for me for now.\r\n\r\nKetil Froyn &lt;ketil@froyn.name&gt;",
"attachments": [],
"author": "nobody",
"timestamp": "2004-08-12 16:30:53",
"last_edited": null,
"slug": "fbfb",
"subject": "#2 add WHOIS support and fix duplicate write to server"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: NO\n\nThanks for the patch and report.\r\n\r\nBut, sorry, but the whois patch will not be used. The next version of echoping will use a system of plugins so every new request for a new protocol will be handled by \"Develop a plugin, Luke\" \\(there is already one for whois\\).\r\n\r\nYou can try the next version at ftp://ftp.internatif.org/pub/unix/echoping/echoping-6.0-BETA.tar.gz\r\n",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 15:37:23",
"last_edited": null,
"slug": "890f",
"subject": "#2 add WHOIS support and fix duplicate write to server"
},
{
"text": "- **assigned_to**: nobody --> bortz\n- **status**: open --> open-wont-fix",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 15:37:23",
"last_edited": null,
"slug": "1bcc",
"subject": "#2 add WHOIS support and fix duplicate write to server"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: NO\n\nI cannot reproduce the \"two QUIT\" problem, sorry.\\(Checked with Wireshark.\\)\r\n",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 15:47:19",
"last_edited": null,
"slug": "24be",
"subject": "#2 add WHOIS support and fix duplicate write to server"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: NO\n\nechoping 6 released, with the whois plugin",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-26 20:59:52",
"last_edited": null,
"slug": "77f4",
"subject": "#2 add WHOIS support and fix duplicate write to server"
},
{
"text": "- **status**: open-wont-fix --> closed-fixed",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-26 20:59:52",
"last_edited": null,
"slug": "9214",
"subject": "#2 add WHOIS support and fix duplicate write to server"
}
],
"discussion_id": "518aabb45fcbc979b923a2dd",
"subject": ""
},
"mod_date": "2007-03-26 20:59:52",
"votes_down": 0,
"votes_up": 0,
"_id": "518aabb55fcbc979b923a304",
"discussion_thread_url": "http://sourceforge.net/rest/p/echoping/patches/_discuss/thread/c0518af1/",
"ticket_num": 2,
"custom_fields": {
"_priority": "5"
},
"created_date": "2004-08-12 16:28:03"
},{
"status": "closed-duplicate",
"reported_by_id": null,
"related_artifacts": [],
"attachments": [],
"reported_by": "*anonymous",
"assigned_to": "bortz",
"labels": [],
"discussion_disabled": false,
"assigned_to_id": "4f3540db0594ca2bc0000b32",
"private": false,
"summary": "improved:add WHOIS support and fix duplicate write to server",
"description": "Usage:\r\nechoping -W example.com whois.crsnic.net\r\n\r\nTested like this:\r\npatch -p1 &lt; echoping\\_add\\_whois.diff\r\naclocal && automake --add-missing && autoconf &&\r\n./configure --without-libidn\r\nmake\r\n./echoping -W example.com whois.crsnic.net\r\n\r\nI haven't experienced any more problems after this rewrite.\r\n\r\nKetil Froyn &lt;ketil@froyn.name&gt;\r\n\r\n",
"discussion_thread": {
"_id": "2bdac84c",
"posts": [
{
"text": "WHOIS support for echoping",
"attachments": [
{
"url": "http://sourceforge.net/p/echoping/patches/_discuss/thread/2bdac84c/f246/attachment/echoping_add_whois.diff",
"bytes": 8605
}
],
"author": "nobody",
"timestamp": "2004-08-13 11:44:10",
"last_edited": null,
"slug": "f246",
"subject": "#3 improved:add WHOIS support and fix duplicate write to server"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: NO\n\nSee the discussion in \\#1008066",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 15:40:52",
"last_edited": null,
"slug": "074b",
"subject": "#3 improved:add WHOIS support and fix duplicate write to server"
},
{
"text": "- **assigned_to**: nobody --> bortz\n- **status**: open --> open-duplicate",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 15:40:52",
"last_edited": null,
"slug": "29e7",
"subject": "#3 improved:add WHOIS support and fix duplicate write to server"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: NO\n\nechoping 6 released and should be OK.",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-26 21:01:16",
"last_edited": null,
"slug": "3b87",
"subject": "#3 improved:add WHOIS support and fix duplicate write to server"
},
{
"text": "- **status**: open-duplicate --> closed-duplicate",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-26 21:01:16",
"last_edited": null,
"slug": "5bb8",
"subject": "#3 improved:add WHOIS support and fix duplicate write to server"
}
],
"discussion_id": "518aabb45fcbc979b923a2dd",
"subject": ""
},
"mod_date": "2007-03-26 21:01:16",
"votes_down": 0,
"votes_up": 0,
"_id": "518aabb85fcbc979b923a333",
"discussion_thread_url": "http://sourceforge.net/rest/p/echoping/patches/_discuss/thread/2bdac84c/",
"ticket_num": 3,
"custom_fields": {
"_priority": "5"
},
"created_date": "2004-08-13 11:44:10"
},{
"status": "closed-out-of-date",
"reported_by_id": "51840af32718467ad6898df9",
"related_artifacts": [],
"attachments": [],
"reported_by": "afm",
"assigned_to": "bortz",
"labels": [],
"discussion_disabled": false,
"assigned_to_id": "4f3540db0594ca2bc0000b32",
"private": false,
"summary": "Fix for incorrect Host: header and memory leak",
"description": "The attached patch takes care not to include a port in the Host: \r\nheader of the HTTP request if the port is not set \\(i.e. = 0\\) as \r\nargument to make\\_http\\_sendline.\r\n\r\nFurthermore, it fixes the memory leak caused by the fact that \r\nhostname is not freed when HTTP10 is defined.",
"discussion_thread": {
"_id": "c9820fce",
"posts": [
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: NO\n\nIt seems there is no patch attached \\(same problem for \\#1282749\\)\r\n",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 15:48:52",
"last_edited": null,
"slug": "0000",
"subject": "#4 Fix for incorrect Host: header and memory leak"
},
{
"text": "- **assigned_to**: nobody --> bortz",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 15:48:52",
"last_edited": null,
"slug": "0d1d",
"subject": "#4 Fix for incorrect Host: header and memory leak"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: NO\n\nSeems OK with the release of echoping 6. Feel free to reopen if not OK.\r\n",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-26 21:03:09",
"last_edited": null,
"slug": "e6e3",
"subject": "#4 Fix for incorrect Host: header and memory leak"
},
{
"text": "- **status**: open --> closed-out-of-date",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-26 21:03:09",
"last_edited": null,
"slug": "b2fc",
"subject": "#4 Fix for incorrect Host: header and memory leak"
}
],
"discussion_id": "518aabb45fcbc979b923a2dd",
"subject": ""
},
"mod_date": "2007-03-26 21:03:09",
"votes_down": 0,
"votes_up": 0,
"_id": "518aabba5fcbc979b923a358",
"discussion_thread_url": "http://sourceforge.net/rest/p/echoping/patches/_discuss/thread/c9820fce/",
"ticket_num": 4,
"custom_fields": {
"_priority": "5"
},
"created_date": "2005-09-06 08:46:48"
},{
"status": "closed-duplicate",
"reported_by_id": "51840af32718467ad6898df9",
"related_artifacts": [],
"attachments": [],
"reported_by": "afm",
"assigned_to": "bortz",
"labels": [],
"discussion_disabled": false,
"assigned_to_id": "4f3540db0594ca2bc0000b32",
"private": false,
"summary": "Fix for incorrect Host: header and memory leak",
"description": "The attached patch takes care not to include a port in the Host: \r\nheader of the HTTP request if the port is not set \\(i.e. = 0\\) as \r\nargument to make\\_http\\_sendline.\r\n\r\nFurthermore, it fixes the memory leak caused by the fact that \r\nhostname is not freed when HTTP10 is defined.",
"discussion_thread": {
"_id": "224c2394",
"posts": [
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: NO\n\nSee \\#1282748",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 15:49:22",
"last_edited": null,
"slug": "ab70",
"subject": "#5 Fix for incorrect Host: header and memory leak"
},
{
"text": "- **assigned_to**: nobody --> bortz\n- **status**: open --> open-duplicate",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 15:49:22",
"last_edited": null,
"slug": "6af3",
"subject": "#5 Fix for incorrect Host: header and memory leak"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: NO\n\nShould be obsolete with the release of 6.0.0",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-26 21:04:56",
"last_edited": null,
"slug": "42f8",
"subject": "#5 Fix for incorrect Host: header and memory leak"
},
{
"text": "- **status**: open-duplicate --> closed-duplicate",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-26 21:04:56",
"last_edited": null,
"slug": "f1c6",
"subject": "#5 Fix for incorrect Host: header and memory leak"
}
],
"discussion_id": "518aabb45fcbc979b923a2dd",
"subject": ""
},
"mod_date": "2007-03-26 21:04:56",
"votes_down": 0,
"votes_up": 0,
"_id": "518aabbb5fcbc979b923a373",
"discussion_thread_url": "http://sourceforge.net/rest/p/echoping/patches/_discuss/thread/224c2394/",
"ticket_num": 5,
"custom_fields": {
"_priority": "5"
},
"created_date": "2005-09-06 08:46:49"
},{
"status": "closed-fixed",
"reported_by_id": "4f3540db0594ca2bc0000b32",
"related_artifacts": [],
"attachments": [],
"reported_by": "bortz",
"assigned_to": "bortz",
"labels": [],
"discussion_disabled": false,
"assigned_to_id": "4f3540db0594ca2bc0000b32",
"private": false,
"summary": "Stats enhancement from Andy Juniper",
"description": "\r\nAttached is a patch which addresses the following\r\nissues/enhancements in\r\nechoping-6.0-BETA:\r\n\r\n\\* add a -D command line option to measure latency\r\nover data transfer\r\ntime only, for TCP connections this excludes the\r\nconnection setup \r\nand teardown which can take a long time if DNS and\r\nARP are involved\r\n\\* fix underflow in the standard deviation\r\ncalculation routine, where\r\nif the deviations were small \\(microseconds\\) then\r\nthe standard\r\ndeviation would report as 0 due to performing the\r\nsquare/square\r\nroot operations on integers; the whole of the SD\r\ncalculation is\r\nnow performed using doubles.\r\n\\* add a -N &lt;number&gt; command line option to\r\noptionally additionally\r\nreport a recalculated average which excludes\r\nvalues which are \r\nfurther than +/- N\\*standard deviation from the\r\naverage; this means\r\nthat values which are a long way off the average\r\nget removed from \r\nthe recalculated average. See \r\n\r\n\r\nhttp://www.statsoft.com/textbook/stbasic.html\\#Correlationse\r\nfor\r\ndetails of why I've done this.\r\n\r\nPlease feel free to incorporate these changes into your\r\ncode\\!\r\n\r\nAndy Juniper\r\n",
"discussion_thread": {
"_id": "02ec69da",
"posts": [
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: YES\n\nUnfortunately, there is no patch attached :-\\(\r\n",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 15:51:17",
"last_edited": null,
"slug": "864f",
"subject": "#6 Stats enhancement from Andy Juniper"
},
{
"text": "",
"attachments": [
{
"url": "http://sourceforge.net/p/echoping/patches/_discuss/thread/02ec69da/0f8a/attachment/echoping.patch",
"bytes": 8673
}
],
"author": "bortz",
"timestamp": "2007-03-07 15:53:26",
"last_edited": null,
"slug": "0f8a",
"subject": "#6 Stats enhancement from Andy Juniper"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: YES\n\nPatch attached, this time\nFile Added: echoping.patch",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 15:53:26",
"last_edited": null,
"slug": "a50b",
"subject": "#6 Stats enhancement from Andy Juniper"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: YES\n\nCommitted in Subversion, r356.",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 21:02:43",
"last_edited": null,
"slug": "0e90",
"subject": "#6 Stats enhancement from Andy Juniper"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: YES\n\nAnd documented and credited.\r\n",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 21:21:37",
"last_edited": null,
"slug": "e0e4",
"subject": "#6 Stats enhancement from Andy Juniper"
},
{
"text": "- **status**: open --> open-fixed",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-07 21:21:37",
"last_edited": null,
"slug": "59d9",
"subject": "#6 Stats enhancement from Andy Juniper"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: YES\n\nShipped with echoping 6",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-26 21:07:42",
"last_edited": null,
"slug": "9680",
"subject": "#6 Stats enhancement from Andy Juniper"
},
{
"text": "- **status**: open-fixed --> closed-fixed",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-26 21:07:42",
"last_edited": null,
"slug": "ebb2",
"subject": "#6 Stats enhancement from Andy Juniper"
},
{
"text": "Wonderful blog\\! Do you have any suggestions for aspiring writers? I'm hoping to start my own website soon but I'm a little lost on everything. Would you advise starting with a free platform like Wordpress or go for a paid option? There are so many choices out there that I'm completely overwhelmed .. Any suggestions? Bless you\\!\r\nnorth face jackets on sale http://rmngnwbxvw.wallinside.com/",
"attachments": [],
"author": "nobody",
"timestamp": "2012-11-11 23:53:33",
"last_edited": null,
"slug": "a2a1",
"subject": "#6 Stats enhancement from Andy Juniper"
},
{
"text": "Greetings from Carolina\\! I'm bored to death at work so I decided to check out your blog on my iphone during lunch break. I really like the information you provide here and can't wait to take a look when I get home. I'm amazed at how fast your blog loaded on my phone .. I'm not even using WIFI, just 3G .. Anyways, fantastic site\\!\r\nnorth face jackets for women http://ltfcjmwhsw.blinkweb.com/new-blog.html",
"attachments": [],
"author": "nobody",
"timestamp": "2012-11-16 12:49:26",
"last_edited": null,
"slug": "31d3",
"subject": "#6 Stats enhancement from Andy Juniper"
},
{
"text": "Do you mind if I quote a couple of your articles as long as I provide credit and sources back to your weblog? My blog site is in the exact same area of interest as yours and my visitors would really benefit from a lot of the information you present here. Please let me know if this alright with you. Regards\\!\r\nnorth face jackets on sale http://vzbeclxtke.jimdo.com/2012/11/15/cheap-north-face-jackets-whether-you-are-wearing-a-dress-or-a-pantsuit/",
"attachments": [],
"author": "nobody",
"timestamp": "2012-11-17 13:20:27",
"last_edited": null,
"slug": "1521",
"subject": "#6 Stats enhancement from Andy Juniper"
}
],
"discussion_id": "518aabb45fcbc979b923a2dd",
"subject": ""
},
"mod_date": "2007-03-26 21:07:42",
"votes_down": 0,
"votes_up": 0,
"_id": "518aabbb5fcbc979b923a38e",
"discussion_thread_url": "http://sourceforge.net/rest/p/echoping/patches/_discuss/thread/02ec69da/",
"ticket_num": 6,
"custom_fields": {
"_priority": "5"
},
"created_date": "2006-04-12 07:50:38"
},{
"status": "open-later",
"reported_by_id": "514b78ad34309d5f016e9029",
"related_artifacts": [],
"attachments": [],
"reported_by": "dawn_guy",
"assigned_to": "bortz",
"labels": [],
"discussion_disabled": false,
"assigned_to_id": "4f3540db0594ca2bc0000b32",
"private": false,
"summary": "SMTP enhancement from Dawn Keenan",
"description": "The attached patch makes echoping more friendly towards\r\nSMTP servers as well as more accurate with respect to\r\nreal time response. Wait for the greeting before\r\nsending HELO to the mail server and then provide the\r\nstart of an email conversation in a way that isn't\r\nlikely to generate spurious warnings in the probed\r\nhost's syslog.",
"discussion_thread": {
"_id": "884a274b",
"posts": [
{
"text": "echoping.c context diff",
"attachments": [
{
"url": "http://sourceforge.net/p/echoping/patches/_discuss/thread/884a274b/21ba/attachment/echoping.c.diff",
"bytes": 1259
}
],
"author": "dawn_guy",
"timestamp": "2006-06-26 14:53:45",
"last_edited": null,
"slug": "21ba",
"subject": "#7 SMTP enhancement from Dawn Keenan"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: NO\n\nI don't think that sending \"HELO echoping\" is a good idea.\r\n\r\n1\\) It is not a legal host name and, today, with the spam problem, many sites test that\r\n\r\n2\\) Even if it were \\(HELO echoping.sourceforge.net\\), various anti-spam techniques would do more aggressive testing and probably reject.\r\n\r\nThe issue stays open. I agree with your goals but there is no simple solution.\r\n",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-08 10:28:35",
"last_edited": null,
"slug": "4a6f",
"subject": "#7 SMTP enhancement from Dawn Keenan"
},
{
"text": "- **assigned_to**: nobody --> bortz",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-08 10:28:35",
"last_edited": null,
"slug": "316a",
"subject": "#7 SMTP enhancement from Dawn Keenan"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: NO\n\n&gt; Wait for the greeting before\r\n&gt; sending HELO to the mail server\r\n\r\nThis is a very good idea. Committed in Subversion, r 359.\r\n",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-08 10:34:34",
"last_edited": null,
"slug": "38af",
"subject": "#7 SMTP enhancement from Dawn Keenan"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: NO\n\nThe patch to wait the greeting has been shipped with echoping 6.\r\n\r\nThe idea to add a HELO is good but postponed.\r\n",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-26 21:32:39",
"last_edited": null,
"slug": "7035",
"subject": "#7 SMTP enhancement from Dawn Keenan"
},
{
"text": "- **status**: open --> open-later",
"attachments": [],
"author": "bortz",
"timestamp": "2007-03-26 21:32:39",
"last_edited": null,
"slug": "c711",
"subject": "#7 SMTP enhancement from Dawn Keenan"
},
{
"text": "Logged In: YES \nuser\\_id=25865\nOriginator: NO\n\nSee \\#1692780",
"attachments": [],
"author": "bortz",
"timestamp": "2007-04-02 10:27:50",
"last_edited": null,
"slug": "29c2",
"subject": "#7 SMTP enhancement from Dawn Keenan"
}
],
"discussion_id": "518aabb45fcbc979b923a2dd",
"subject": ""
},
"mod_date": "2007-03-26 21:32:39",
"votes_down": 0,
"votes_up": 0,
"_id": "518aabbf5fcbc979b923a3d1",
"discussion_thread_url": "http://sourceforge.net/rest/p/echoping/patches/_discuss/thread/884a274b/",
"ticket_num": 7,
"custom_fields": {
"_priority": "5"
},
"created_date": "2006-06-26 14:53:45"
},{
"status": "open",
"reported_by_id": "4f3540db0594ca2bc0000b32",
"related_artifacts": [],
"attachments": [],
"reported_by": "bortz",
"assigned_to": "bortz",
"labels": [],
"discussion_disabled": false,
"assigned_to_id": "4f3540db0594ca2bc0000b32",
"private": false,
"summary": "Hanging fgets if the server is down",
"description": "Sent from \"Moelaert, J.P. \\(Johan\\)\" &lt;J.P.Moelaert@utwente.nl&gt;. Not confirmed with echoping 6.\r\n\r\n\r\nI've been using echoping for a month to test if a proxyserver.\r\nSince yesterday I wanted tio use it to test if a webhare server was\r\nrunning.\r\nThe command used was:\r\n\r\nechoping -t1 -h https://webhare.utwente.nl weblx030.civ.utwente.nl:80\r\n\r\nIt seemed to work.\r\nBut when the website was down the command seemed to hang in its fgets\r\ncall.\r\nExport help refered me to\r\n\r\nhttp://groups.google.com/group/comp.os.linux.development.system/browse\\_f\r\nrm/thread/20118509359c9292/19bd5388e468c1fa?lnk=st&q=SIGALRM+fgets&rnum=\r\n12&hl=en\\#19bd5388e468c1fa\r\n&lt;http://groups.google.com/group/comp.os.linux.development.system/browse\\_\r\nfrm/thread/20118509359c9292/19bd5388e468c1fa?lnk=st&q=SIGALRM+fgets&rnum\r\n=12&hl=en\\#19bd5388e468c1fa&gt;\r\n\r\nThis describes a similar problem with fgets.\r\nI added the following to readline.c in the function readline\r\n\r\nfd\\_set rfds;\r\nstruct timeval tv;\r\nint retval, fd= fileno\\(fs\\);\r\n\r\n/\\* watch fildescriptor to see when it has input. \\*/\r\nFD\\_ZERO\\(&rfds\\);\r\nFD\\_SET\\(fd, &rfds\\);\r\n/\\* wait up to number of seconds indicated by timeout \\*/\r\ntv.tv\\_sec = timeout;\r\ntv.tv\\_usec = 0;\r\n/\\* use select to determine readability \\*/\r\nretval = select\\( fd, &rfds, NULL, NULL, &tv \\);\r\n\r\n/\\* let's see what we got \\*/\r\nif \\( retval == -1 \\) \\{\r\nperror\\(\"select\\(\\)\"\\);\r\nreturn \\(-1\\);\r\n\\} else if \\( retval == 0 \\) \\{\r\n/\\* timeout reached \\*/\r\nreturn \\(-1\\); \r\n\\}\r\n/\\* passed the select; start reading from a valid stream \\*/\r\n\r\nI also brought the timeout in main from echoping.c to global level.\r\nThis was then declared as external in readline.c\r\n\r\nThis solved my problem with a hanging fgets.\r\n",
"discussion_thread": {
"_id": "48ab69c7",
"posts": [
{
"text": "k6WEof &lt;a href=\"http://gosjohgbbzhk.com/\"&gt;gosjohgbbzhk&lt;/a&gt;, \\[url=http://ufkdhpznjmpw.com/\\]ufkdhpznjmpw\\[/url\\], \\[link=http://nhafrpxtcgyw.com/\\]nhafrpxtcgyw\\[/link\\], http://tvuxugxrdfgj.com/",
"attachments": [],
"author": "nobody",
"timestamp": "2013-04-15 07:48:11",
"last_edited": null,
"slug": "521f",
"subject": "#8 Hanging fgets if the server is down"
}
],
"discussion_id": "518aabb45fcbc979b923a2dd",
"subject": ""
},
"mod_date": "2007-03-26 21:09:01",
"votes_down": 0,
"votes_up": 0,
"_id": "518aabc05fcbc979b923a402",
"discussion_thread_url": "http://sourceforge.net/rest/p/echoping/patches/_discuss/thread/48ab69c7/",
"ticket_num": 8,
"custom_fields": {
"_priority": "5"
},
"created_date": "2007-03-26 21:09:01"
},{
"status": "open",
"reported_by_id": "518aabc15fcbc979b923a410",
"related_artifacts": [],
"attachments": [],
"reported_by": "zu2",
"assigned_to": null,
"labels": [],
"discussion_disabled": false,
"assigned_to_id": null,
"private": false,
"summary": "'Cannot load \".so\"' patch on CentOS 5.4",
"description": "When running echoping 6.0.2 on the CentOS 5.4 with option \"-m\", it becomes an error. \r\n\r\nThe same variable is used at line 476 in echoping.c , as the destination and the argument of sprintf.\r\n\r\nI think that is reason for 'Cannot load \".so\"'.\r\n\r\nI wrote a patch here. \r\n\r\nthanks.",
"discussion_thread": {
"_id": "feaaf7e8",
"posts": [
{
"text": "",
"attachments": [
{
"url": "http://sourceforge.net/p/echoping/patches/_discuss/thread/feaaf7e8/d995/attachment/echoping.patch.txt",
"bytes": 652
}
],
"author": "zu2",
"timestamp": "2010-01-21 12:19:35",
"last_edited": null,
"slug": "d995",
"subject": "#9 'Cannot load \".so\"' patch on CentOS 5.4"
},
{
"text": "\\# ./echoping -m dns\r\nCannot load \".so\" \\(I tried the short name, then the complete name in \"/usr/lib/echoping\"\\): /usr/lib/echoping/.so: cannot open shared object file: No such file or directory\r\n\\#\r\n",
"attachments": [],
"author": "zu2",
"timestamp": "2010-01-21 12:20:22",
"last_edited": null,
"slug": "b050",
"subject": "#9 'Cannot load \".so\"' patch on CentOS 5.4"
},
{
"text": "g3VkG7 &lt;a href=\"http://owhoajeejjei.com/\"&gt;owhoajeejjei&lt;/a&gt;, \\[url=http://qsyegjeevmkc.com/\\]qsyegjeevmkc\\[/url\\], \\[link=http://rirzyefjjvhb.com/\\]rirzyefjjvhb\\[/link\\], http://rhwqixzbyfza.com/",
"attachments": [],
"author": "nobody",
"timestamp": "2013-04-15 20:16:36",
"last_edited": null,
"slug": "c13b",
"subject": "#9 'Cannot load \".so\"' patch on CentOS 5.4"
}
],
"discussion_id": "518aabb45fcbc979b923a2dd",
"subject": ""
},
"mod_date": "2010-01-21 12:19:35",
"votes_down": 0,
"votes_up": 0,
"_id": "518aabc15fcbc979b923a40f",
"discussion_thread_url": "http://sourceforge.net/rest/p/echoping/patches/_discuss/thread/feaaf7e8/",
"ticket_num": 9,
"custom_fields": {
"_priority": "5"
},
"created_date": "2010-01-21 12:19:35"
}],
"tracker_config":{
"_id": "518aabb45fcbc979b923a2db",
"options": {
"ordinal": 7,
"import_id": "tracker/304581",
"mount_point": "patches",
"TicketMonitoringType": null,
"EnableVoting": false,
"TicketMonitoringEmail": "",
"mount_label": "Patches"
}
},
"milestones":[],
"custom_fields":[
{
"milestones": [],
"type": "milestone",
"name": "_milestone",
"label": "Group"
},
{
"label": "Priority",
"type": "select",
"options": "1 2 3 4 *5 6 7 8 9",
"name": "_priority"
}
],
"open_status_names":"open unread accepted pending open-fixed open-later",
"closed_status_names":"wont-fix closed-fixed closed-duplicate closed-out-of-date",
"saved_bins":[
{
"sort": "mod_date_dt desc",
"_id": "518aabb45fcbc979b923a2e4",
"terms": "!status:closed-duplicate && !status:wont-fix && !status:closed-fixed && !status:closed-out-of-date",
"summary": "Changes"
},
{
"sort": "",
"_id": "518aabb45fcbc979b923a2e3",
"terms": "status:closed-duplicate or status:wont-fix or status:closed-fixed or status:closed-out-of-date",
"summary": "Closed Tickets"
},
{
"sort": "",
"_id": "518aabb45fcbc979b923a2e2",
"terms": "!status:closed-duplicate && !status:wont-fix && !status:closed-fixed && !status:closed-out-of-date",
"summary": "Open Tickets"
}
]}
Loading…
Cancel
Save