mirror of https://framagit.org/bortzmeyer/echoping
Compare commits
227 Commits
RELEASE_5_
...
master
Author | SHA1 | Date |
---|---|---|
Stephane Bortzmeyer | ccf3c95d92 | 4 years ago |
Stephane Bortzmeyer | dfe95b5923 | 9 years ago |
Stephane Bortzmeyer | 845a83c9dc | 9 years ago |
Stéphane Bortzmeyer | c4ee416d0e | 9 years ago |
Stephane Bortzmeyer | 7456da503a | 9 years ago |
Stephane Bortzmeyer | 4bbda2a8b2 | 9 years ago |
Stephane Bortzmeyer | 50639f3829 | 9 years ago |
Dan O'Neill | 2de2c1eea9 | 13 years ago |
Stephane Bortzmeyer | 9574c70b29 | 15 years ago |
Stephane Bortzmeyer | 69dcc40226 | 15 years ago |
Stephane Bortzmeyer | 8039f8cd6e | 15 years ago |
Stephane Bortzmeyer | 808788265e | 15 years ago |
Stephane Bortzmeyer | 0f6aefca60 | 16 years ago |
Stephane Bortzmeyer | 5dc79b9cc8 | 16 years ago |
Stephane Bortzmeyer | f5bbd11505 | 17 years ago |
Stephane Bortzmeyer | 21895a2f96 | 17 years ago |
Stephane Bortzmeyer | 577f0b9f3e | 17 years ago |
Stephane Bortzmeyer | c93c8881a1 | 17 years ago |
Stephane Bortzmeyer | bc5c0b1ad6 | 17 years ago |
Stephane Bortzmeyer | b612eacdbd | 17 years ago |
Stephane Bortzmeyer | 984691b672 | 17 years ago |
Stephane Bortzmeyer | bb93d349d6 | 17 years ago |
Stephane Bortzmeyer | cc1de7b5e3 | 17 years ago |
Stephane Bortzmeyer | d2faba389a | 17 years ago |
Stephane Bortzmeyer | 545a8c3566 | 17 years ago |
Stephane Bortzmeyer | 8a889a4cc7 | 17 years ago |
Stephane Bortzmeyer | 2a6367aa85 | 17 years ago |
Stephane Bortzmeyer | 83e1c21f5a | 17 years ago |
Stephane Bortzmeyer | 6135490262 | 17 years ago |
Stephane Bortzmeyer | d6426b82ed | 17 years ago |
Stephane Bortzmeyer | 06732699ea | 17 years ago |
Stephane Bortzmeyer | 4ba858f7db | 17 years ago |
Stephane Bortzmeyer | a87d7feb18 | 17 years ago |
Stephane Bortzmeyer | 9bf79d32b2 | 17 years ago |
Stephane Bortzmeyer | ffabfba815 | 17 years ago |
Stephane Bortzmeyer | 5209c57539 | 17 years ago |
Stephane Bortzmeyer | b6f1aade2d | 17 years ago |
Stephane Bortzmeyer | edfc042884 | 17 years ago |
Stephane Bortzmeyer | 008dacb414 | 17 years ago |
Stephane Bortzmeyer | 3727151409 | 17 years ago |
Stephane Bortzmeyer | 7275d8b846 | 17 years ago |
Stephane Bortzmeyer | f3d4b40cf9 | 17 years ago |
Stephane Bortzmeyer | 40ca28d608 | 17 years ago |
Stephane Bortzmeyer | b010ab9541 | 17 years ago |
Stephane Bortzmeyer | 8dfa6ed5a2 | 17 years ago |
Stephane Bortzmeyer | 8e83acace2 | 17 years ago |
Stephane Bortzmeyer | 91959176f3 | 17 years ago |
Stephane Bortzmeyer | 4a802c0e84 | 17 years ago |
Stephane Bortzmeyer | 21b4bb3fc3 | 17 years ago |
Stephane Bortzmeyer | 983585e340 | 17 years ago |
Stephane Bortzmeyer | baa60a539c | 17 years ago |
Stephane Bortzmeyer | 4e0eebfeb8 | 17 years ago |
Stephane Bortzmeyer | 8ce9e94775 | 17 years ago |
Stephane Bortzmeyer | 6ee47fd1b2 | 17 years ago |
Stephane Bortzmeyer | 87b652104b | 17 years ago |
Stephane Bortzmeyer | 36210540d0 | 17 years ago |
Stephane Bortzmeyer | 7b1e497d80 | 17 years ago |
Stephane Bortzmeyer | 3b89a4701b | 17 years ago |
Stephane Bortzmeyer | dbf96ba9ad | 17 years ago |
Stephane Bortzmeyer | 2f01006a35 | 17 years ago |
Stephane Bortzmeyer | 9b25a0ad02 | 17 years ago |
Stephane Bortzmeyer | e011b32bcc | 17 years ago |
Stephane Bortzmeyer | dea7e616bf | 17 years ago |
Stephane Bortzmeyer | 19b9484c8a | 17 years ago |
Stephane Bortzmeyer | f5c5e13541 | 17 years ago |
Stephane Bortzmeyer | 470fcc8f5e | 17 years ago |
Stephane Bortzmeyer | 4b555177b4 | 17 years ago |
Stephane Bortzmeyer | 4b210b0f33 | 17 years ago |
Stephane Bortzmeyer | b94e35a7bc | 17 years ago |
Stephane Bortzmeyer | 22dacf69e3 | 17 years ago |
Stephane Bortzmeyer | d6dc37c4f9 | 17 years ago |
Stephane Bortzmeyer | 43876de96e | 17 years ago |
Stephane Bortzmeyer | ddc19c16e7 | 17 years ago |
Stephane Bortzmeyer | 1ee688edbe | 17 years ago |
Stephane Bortzmeyer | 6628af477e | 17 years ago |
Stephane Bortzmeyer | b0e30c76e6 | 17 years ago |
Stephane Bortzmeyer | d1a464d732 | 17 years ago |
Stephane Bortzmeyer | 594797214a | 17 years ago |
Stephane Bortzmeyer | 383efa5cbb | 17 years ago |
Stephane Bortzmeyer | b64fdbd471 | 17 years ago |
Stephane Bortzmeyer | b60d7eb6d2 | 17 years ago |
Stephane Bortzmeyer | 3754822e91 | 18 years ago |
Stephane Bortzmeyer | 89af6a8780 | 18 years ago |
Stephane Bortzmeyer | 46fc19fdd2 | 18 years ago |
Stephane Bortzmeyer | d51c9f04b3 | 18 years ago |
Stephane Bortzmeyer | 5d0bf4cb08 | 18 years ago |
Stephane Bortzmeyer | 4ae4d0bee0 | 18 years ago |
Stephane Bortzmeyer | dd04b58c2f | 18 years ago |
Stephane Bortzmeyer | c6cb11bf9a | 18 years ago |
Stephane Bortzmeyer | a3d4fa83c3 | 19 years ago |
Stephane Bortzmeyer | daa76d65ac | 20 years ago |
Stephane Bortzmeyer | 1f2b14e0b4 | 20 years ago |
Stephane Bortzmeyer | 0774bab6c4 | 20 years ago |
Stephane Bortzmeyer | 75f56f41fb | 20 years ago |
Stephane Bortzmeyer | 73c9332f4d | 20 years ago |
Stephane Bortzmeyer | 7825bf90f5 | 20 years ago |
Stephane Bortzmeyer | ba58394b94 | 20 years ago |
Stephane Bortzmeyer | 8f918af46d | 20 years ago |
Stephane Bortzmeyer | afe8f6c903 | 20 years ago |
Stephane Bortzmeyer | 0a1f940135 | 20 years ago |
Stephane Bortzmeyer | cbd05dbeb3 | 20 years ago |
Stephane Bortzmeyer | 80fadd0066 | 20 years ago |
Stephane Bortzmeyer | 2f9e9c31bf | 20 years ago |
Stephane Bortzmeyer | aea0ea51ac | 20 years ago |
Stephane Bortzmeyer | 90752a3b40 | 20 years ago |
Stephane Bortzmeyer | d88f0a33af | 20 years ago |
Stephane Bortzmeyer | f4b219f33a | 20 years ago |
Stephane Bortzmeyer | 20260fd88f | 20 years ago |
Stephane Bortzmeyer | de253aab54 | 20 years ago |
Stephane Bortzmeyer | 8905307455 | 20 years ago |
Stephane Bortzmeyer | f3c74f8edc | 20 years ago |
Stephane Bortzmeyer | 2e4037abe0 | 20 years ago |
Stephane Bortzmeyer | 8ddc36fade | 20 years ago |
Stephane Bortzmeyer | 4a8f82f621 | 20 years ago |
Stephane Bortzmeyer | aa0d8d6e03 | 20 years ago |
Stephane Bortzmeyer | a5ad100f27 | 20 years ago |
Stephane Bortzmeyer | 1abc617ba3 | 20 years ago |
Stephane Bortzmeyer | ccc43a77fe | 20 years ago |
Stephane Bortzmeyer | ed243e7772 | 20 years ago |
Stephane Bortzmeyer | d6aaf1dc9a | 20 years ago |
Stephane Bortzmeyer | 61fc1a3223 | 20 years ago |
Stephane Bortzmeyer | ccf3ab5b5c | 20 years ago |
Stephane Bortzmeyer | 59fd2fa1ed | 20 years ago |
Stephane Bortzmeyer | 2f6d8d9b17 | 20 years ago |
Stephane Bortzmeyer | 4779000995 | 20 years ago |
Stephane Bortzmeyer | c30ec028f5 | 20 years ago |
Stephane Bortzmeyer | 0add6a1c06 | 20 years ago |
Stephane Bortzmeyer | 717d6422e8 | 20 years ago |
Stephane Bortzmeyer | 316d319e52 | 20 years ago |
Stephane Bortzmeyer | f55f381a26 | 20 years ago |
Stephane Bortzmeyer | a0fc54c78b | 20 years ago |
Stephane Bortzmeyer | efeff930f9 | 20 years ago |
Stephane Bortzmeyer | 5a99238de8 | 20 years ago |
Stephane Bortzmeyer | 98db4f370f | 20 years ago |
Stephane Bortzmeyer | 68efbba978 | 20 years ago |
Stephane Bortzmeyer | 9c90a7191d | 20 years ago |
Stephane Bortzmeyer | 50b7e90667 | 20 years ago |
Stephane Bortzmeyer | ace6dee486 | 20 years ago |
Stephane Bortzmeyer | 85adcec177 | 20 years ago |
Stephane Bortzmeyer | 35d6ba0f39 | 20 years ago |
Stephane Bortzmeyer | e46172d3e7 | 20 years ago |
Stephane Bortzmeyer | 3c9d00e0aa | 20 years ago |
Stephane Bortzmeyer | 17609d6fe5 | 20 years ago |
Stephane Bortzmeyer | 91f44dc0aa | 20 years ago |
Stephane Bortzmeyer | 166520b8ff | 20 years ago |
Stephane Bortzmeyer | 353976ab8a | 20 years ago |
Stephane Bortzmeyer | 3bfc16d42e | 20 years ago |
Stephane Bortzmeyer | db9c2f334b | 20 years ago |
Stephane Bortzmeyer | cbaefa1e17 | 20 years ago |
Stephane Bortzmeyer | 6ed1136ec5 | 20 years ago |
Stephane Bortzmeyer | 28b8096a8b | 20 years ago |
Stephane Bortzmeyer | 46c31fb73a | 20 years ago |
Stephane Bortzmeyer | 008b84e70c | 20 years ago |
Stephane Bortzmeyer | 042832a695 | 20 years ago |
Stephane Bortzmeyer | d0033cad25 | 20 years ago |
Stephane Bortzmeyer | 559a8899cb | 20 years ago |
Stephane Bortzmeyer | b9c3f84c92 | 20 years ago |
Stephane Bortzmeyer | f4c3ceba52 | 20 years ago |
Stephane Bortzmeyer | c6b57a96dc | 20 years ago |
Stephane Bortzmeyer | 446a7f0aaa | 20 years ago |
Stephane Bortzmeyer | 3944b57c90 | 20 years ago |
Stephane Bortzmeyer | 70c4dfb776 | 20 years ago |
Stephane Bortzmeyer | 7671c535bc | 20 years ago |
Stephane Bortzmeyer | dfdf9866c0 | 20 years ago |
Stephane Bortzmeyer | 328fbfb9ea | 20 years ago |
Stephane Bortzmeyer | 6da28180c1 | 20 years ago |
Stephane Bortzmeyer | d3b0ab849a | 20 years ago |
Stephane Bortzmeyer | fa09c1a5ca | 20 years ago |
Stephane Bortzmeyer | 5b3b44da62 | 20 years ago |
Stephane Bortzmeyer | 75818c9b63 | 20 years ago |
Stephane Bortzmeyer | a1d6852155 | 20 years ago |
Stephane Bortzmeyer | a1d91e1af1 | 20 years ago |
Stephane Bortzmeyer | 1b179e9f79 | 20 years ago |
Stephane Bortzmeyer | 245c2f1edb | 20 years ago |
Stephane Bortzmeyer | b46a6cb296 | 20 years ago |
Stephane Bortzmeyer | 225dfc2d82 | 21 years ago |
Stephane Bortzmeyer | 5ee48de072 | 21 years ago |
Stephane Bortzmeyer | ffa5774177 | 21 years ago |
Stephane Bortzmeyer | c63e09123b | 21 years ago |
Stephane Bortzmeyer | 55d42c9707 | 21 years ago |
Stephane Bortzmeyer | c7ffff5ac3 | 21 years ago |
Stephane Bortzmeyer | 5622902b25 | 21 years ago |
Stephane Bortzmeyer | 1558843633 | 21 years ago |
Stephane Bortzmeyer | 0367b93b24 | 21 years ago |
Stephane Bortzmeyer | 40a5afdfa4 | 21 years ago |
Stephane Bortzmeyer | 781afc5c64 | 21 years ago |
Stephane Bortzmeyer | 3ef51cbc24 | 21 years ago |
Stephane Bortzmeyer | a30cec9527 | 21 years ago |
Stephane Bortzmeyer | de376409cb | 21 years ago |
Stephane Bortzmeyer | 9d0fec5e12 | 21 years ago |
Stephane Bortzmeyer | efcfa00812 | 21 years ago |
Stephane Bortzmeyer | 98163911ec | 21 years ago |
Stephane Bortzmeyer | 9bec7086de | 21 years ago |
Stephane Bortzmeyer | aa7d8b33a7 | 21 years ago |
Stephane Bortzmeyer | c71ea15cce | 21 years ago |
Stephane Bortzmeyer | edef4dc5a1 | 21 years ago |
Stephane Bortzmeyer | 8a48d52a02 | 21 years ago |
Stephane Bortzmeyer | 2caeb6ef36 | 21 years ago |
Stephane Bortzmeyer | dea4cf4220 | 21 years ago |
Stephane Bortzmeyer | 76352c4e63 | 21 years ago |
Stephane Bortzmeyer | 40406dadf5 | 21 years ago |
Stephane Bortzmeyer | dd4b1f81ed | 21 years ago |
Stephane Bortzmeyer | c41fed5d81 | 21 years ago |
Stephane Bortzmeyer | 0ffd412d9e | 21 years ago |
Stephane Bortzmeyer | 262a5d1b38 | 21 years ago |
Stephane Bortzmeyer | 9378182596 | 21 years ago |
Stephane Bortzmeyer | 56741f75b6 | 21 years ago |
Stephane Bortzmeyer | 369af6e01c | 21 years ago |
Stephane Bortzmeyer | 2d94cc47a8 | 21 years ago |
Stephane Bortzmeyer | 20eda710c5 | 22 years ago |
Stephane Bortzmeyer | 3afe16a0e5 | 22 years ago |
Stephane Bortzmeyer | 221e1fc158 | 22 years ago |
Stephane Bortzmeyer | c9595aca24 | 22 years ago |
Stephane Bortzmeyer | 654c820200 | 22 years ago |
Stephane Bortzmeyer | 2981be22fb | 22 years ago |
Stephane Bortzmeyer | 3007707ebf | 22 years ago |
Stephane Bortzmeyer | 3cc39e5d62 | 22 years ago |
Stephane Bortzmeyer | 7792309d6d | 22 years ago |
Stephane Bortzmeyer | 18b648465a | 22 years ago |
Stephane Bortzmeyer | e756e98e4a | 22 years ago |
Stephane Bortzmeyer | c20472596e | 22 years ago |
Stephane Bortzmeyer | cfd583491a | 22 years ago |
Stephane Bortzmeyer | d79e1e0969 | 22 years ago |
Stephane Bortzmeyer | c9bde23831 | 22 years ago |
Stephane Bortzmeyer | d753d55343 | 22 years ago |
Stephane Bortzmeyer | d583a4861c | 22 years ago |
Stephane Bortzmeyer | a33249588b | 22 years ago |
@ -0,0 +1,9 @@
|
||||
include ../../../lib/Makefile-tex
|
||||
|
||||
%.epic: %.gp
|
||||
gnuplot $^ > $@
|
||||
|
||||
%.eps: %.gp
|
||||
gnuplot $^ > $@
|
||||
|
||||
|
@ -0,0 +1,270 @@
|
||||
% $Id$
|
||||
|
||||
% Mise au point
|
||||
\documentclass[a4,landscape,article]{seminar}
|
||||
|
||||
% Impression réelle
|
||||
%\documentclass[a4,landscape,slidesonly]{seminar}
|
||||
|
||||
\usepackage[latin1]{inputenc}
|
||||
\usepackage{fancybox}
|
||||
\usepackage{eepic}
|
||||
\usepackage{latexsym}
|
||||
\usepackage{bortzmeyer-utils}
|
||||
\newpagestyle{MH}%
|
||||
{\thepage}
|
||||
{echoping\hfil}
|
||||
\slidepagestyle{MH}
|
||||
|
||||
\pagestyle{empty}
|
||||
|
||||
\title{echoping, mesurer les applications}
|
||||
\author{Stéphane Bortzmeyer\\
|
||||
AFNIC\\
|
||||
\url{<bortz@users.sourceforge.net>}
|
||||
}
|
||||
\date{4 octobre 2004}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{slide}
|
||||
\maketitle
|
||||
\addtocounter{slide}{-1}
|
||||
\slidepagestyle{empty}
|
||||
\end{slide}
|
||||
|
||||
\begin{slide}
|
||||
\heading{Mesurer les applications}
|
||||
\begin{itemize}
|
||||
\item On mesure souvent le temps de réponse du réseau (RTT) avec ping
|
||||
\item Mais celui des applications peut être très différent
|
||||
\begin{enumerate}
|
||||
\item Unix : traitement par le noyau ou par une application qui
|
||||
\foreign{swappe}
|
||||
\item Délais spécifiques à l'application (contacter la base de
|
||||
données\ldots)
|
||||
\item Coupe-feux qui bloquent ICMP
|
||||
\item \foreign{Layer-4 or Layer-7 switches} qui traitent différemment ICMP et TCP
|
||||
\end{enumerate}
|
||||
\end{itemize}
|
||||
\end{slide}
|
||||
|
||||
\begin{slide}
|
||||
\heading{Limite des outils classiques}
|
||||
Certains outils n'ont pas de mesure du RTT : on les emballe avec
|
||||
\computer{time}. Inconvénients :
|
||||
\begin{enumerate}
|
||||
\item On mesure le temps de résolution DNS,
|
||||
\item On mesure le temps de lancement du
|
||||
programme (s'il est en Perl, cela fausse tout)\ldots
|
||||
\end{enumerate}
|
||||
|
||||
Certains outils ont la mesure de RTT (\computer{dig}). Mais pas de
|
||||
possibilité de répéter le test donc, il faut utiliser \computer{awk}
|
||||
si on veut des statistiques.
|
||||
\end{slide}
|
||||
|
||||
Exemple avec dig, le script qtest, qui détermine le serveur le plus
|
||||
rapide (BIND utilise un algorithme analogue pour savoir quel serveur
|
||||
d'un domaine interroger).
|
||||
\begin{info}
|
||||
#!/bin/sh
|
||||
#
|
||||
# From: Joe Abley <jabley@isc.org>
|
||||
|
||||
query=$1; shift
|
||||
#
|
||||
[ -z "$*" ] && echo "Syntax: $0 query server..." && exit 1
|
||||
#
|
||||
for i in 0 1 2; do
|
||||
for server in $*; do
|
||||
dig @${server} ${query};
|
||||
done
|
||||
done | \
|
||||
awk '/^;; Query time:/ { query_time = $4; } \
|
||||
/^;; SERVER: / { sum[$3] += query_time; num[$3]++; } \
|
||||
END { for (server in sum) { print int(sum[server]/num[server]), server; } }' | \
|
||||
sort -n | head -1
|
||||
\end{info}
|
||||
|
||||
\begin{slide}
|
||||
\heading{echoping}
|
||||
\url{http://echoping.sourceforge.net/}
|
||||
|
||||
9 ans d'utilisation aujourd'hui.
|
||||
|
||||
A surtout décollé dans le cadre du projet Renater-Cache (mesurer le
|
||||
temps de réponse du cache national, par exemple avant et après un réglage).
|
||||
|
||||
Mesurer le RTT d'une requête applicative. Le chrono est lancé
|
||||
\emph{après} la résolution DNS.
|
||||
|
||||
Tourne sur tout Unix, en ligne de commandes, pour utilisation par des
|
||||
scripts (mon, Nagios, MRTG, Smokeping).
|
||||
|
||||
Smokeping (\url{http://www.smokeping.org/}) est de loin le plus gros
|
||||
utilisateur d'echoping.
|
||||
\end{slide}
|
||||
|
||||
\begin{slide}
|
||||
\heading{Protocoles utilisés}
|
||||
\begin{enumerate}
|
||||
\item Au début, echo, discard et chargen
|
||||
\item Puis HTTP (Renater-Cache), toujours le plus utilisé
|
||||
\item Demain, DNS, whois, PostgreSQL, LDAP\ldots
|
||||
\end{enumerate}
|
||||
|
||||
\end{slide}
|
||||
|
||||
\begin{slide}
|
||||
\heading{Répétition des tests}
|
||||
|
||||
Comme ping, on peut répéter les tests et avoir des statistiques.
|
||||
\begin{info}
|
||||
% echoping -h 10 -h / webmail.nic.af
|
||||
...
|
||||
Minimum time: 1.799637 seconds (142 bytes per sec.)
|
||||
Maximum time: 16.494219 seconds (16 bytes per sec.)
|
||||
Average time: 3.356738 seconds (76 bytes per sec.)
|
||||
Standard deviation: 3.730219
|
||||
Median time: 2.003397 seconds (128 bytes per sec.)
|
||||
\end{info}
|
||||
\end{slide}
|
||||
|
||||
\begin{slide}
|
||||
\heading{Moyenne et médiane}
|
||||
Sur l'Internet, ou sur un serveur chargé, la moyenne est peu
|
||||
significative : un seul test très lent la change beaucoup.
|
||||
|
||||
La médiane est en général plus informative.
|
||||
|
||||
\begin{info}
|
||||
Elapsed time: 3.030966 seconds
|
||||
Elapsed time: 122.533918 seconds
|
||||
Elapsed time: 2.394198 seconds
|
||||
Elapsed time: 2.012312 seconds
|
||||
Elapsed time: 1.432407 seconds
|
||||
...
|
||||
---
|
||||
Minimum time: 1.432407 seconds (179 bytes per sec.)
|
||||
Maximum time: 122.533918 seconds (2 bytes per sec.)
|
||||
Average time: 11.393709 seconds (22 bytes per sec.)
|
||||
Standard deviation: 26.072556
|
||||
Median time: 2.712582 seconds (94 bytes per sec.)
|
||||
\end{info}
|
||||
\end{slide}
|
||||
|
||||
%\begin{slide}
|
||||
% \heading{Les temps de réponse et leur variation}
|
||||
%\input{whois-ripe.epic}
|
||||
%\end{slide}
|
||||
|
||||
\begin{slide}
|
||||
\heading{Les greffons}
|
||||
Beaucoup d'utilisateurs réclamaient le support de tel ou tel
|
||||
protocole.
|
||||
|
||||
Souvent, ils envoyaient le \foreign{patch}.
|
||||
|
||||
Le code devenait de plus en plus complexe. Et dépendant de
|
||||
bibliothèques extérieures.
|
||||
|
||||
echoping 6 introduira donc les greffons (\foreign{plug-ins}), écrits à
|
||||
part et chargés dynamiquement.
|
||||
|
||||
\end{slide}
|
||||
|
||||
\begin{slide}
|
||||
\heading{Utiliser le greffon DNS}
|
||||
\begin{info}
|
||||
% echoping -v -m dns ns2.nic.fr -t NS nic.fr
|
||||
This is echoping, version 6.0-BETA.
|
||||
|
||||
Running start() for the plugin dns.so...
|
||||
Trying to call plugin dns.so for internet address 192.134.0.4 53...
|
||||
Elapsed time: 0.001717 seconds
|
||||
\end{info}
|
||||
\end{slide}
|
||||
|
||||
\begin{slide}
|
||||
\heading{Utiliser le greffon PostgreSQL}
|
||||
\begin{info}
|
||||
% echoping -v -m postgresql localhost -c 'dbname=essais' \
|
||||
'SELECT * FROM Foobar'
|
||||
|
||||
This is echoping, version 6.0-BETA.
|
||||
|
||||
Running start() for the plugin postgresql.so...
|
||||
Trying to call plugin postgresql.so...
|
||||
3 tuples returned
|
||||
Elapsed time: 0.058392 seconds
|
||||
\end{info}
|
||||
\end{slide}
|
||||
|
||||
\begin{slide}
|
||||
\heading{API des greffons}
|
||||
Les greffons se programment en C
|
||||
\begin{itemize}
|
||||
\item \computer{char * init (const int argc, const char **argv, const echoping\_options options)} Initialise
|
||||
\item \computer{void start (struct addrinfo *res)} Se connecte
|
||||
\item \computer{int execute ()} Le chronomètre est lancé juste avant
|
||||
\item \computer{void terminate ()}
|
||||
\end{itemize}
|
||||
\end{slide}
|
||||
|
||||
Exemple avec le greffon whois, le plus simple vue la simplicité du
|
||||
protocole (\rfc{3912}) :
|
||||
\begin{info}
|
||||
char *
|
||||
init (const int argc, const char **argv, echoping_options global_options)
|
||||
{
|
||||
/* Analyse les arguments */
|
||||
return "nicname";
|
||||
}
|
||||
|
||||
void
|
||||
start (struct addrinfo *res)
|
||||
{
|
||||
whois_server = *res;
|
||||
}
|
||||
|
||||
int
|
||||
execute ()
|
||||
{
|
||||
int nr = 0;
|
||||
char recvline[MAX_LINE + 1];
|
||||
char complete_request[MAX_REQUEST];
|
||||
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");
|
||||
close (sockfd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
terminate ()
|
||||
{
|
||||
}
|
||||
\end{info}
|
||||
|
||||
\end{document}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
3.030966
|
||||
2.394198
|
||||
2.012312
|
||||
1.432407
|
||||
18.939303
|
||||
1.723371
|
||||
122.533918
|
||||
1.889161
|
||||
4.097886
|
||||
15.162768
|
||||
6.279619
|
||||
1.842766
|
||||
5.361982
|
||||
13.420383
|
||||
2.353872
|
||||
1.858294
|
||||
1.944411
|
||||
16.289352
|
||||
3.148175
|
||||
2.159049
|
@ -0,0 +1,12 @@
|
||||
set terminal postscript portrait monochrome
|
||||
#set terminal tpic
|
||||
#set terminal x11
|
||||
set xlabel "Test number"
|
||||
set ylabel "Milli-seconds"
|
||||
set size 0.85,0.75
|
||||
set title "Response time of the RIPE whois server"
|
||||
set logscale y
|
||||
plot "whois-ripe.dat" with points pointsize 3 title "Tests", 2.713 with lines title "Median", 11.394 with lines title "Average"
|
||||
pause -1 "Hit return to continue"
|
||||
|
||||
|
@ -0,0 +1,65 @@
|
||||
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).
|
@ -0,0 +1,20 @@
|
||||
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
@ -1,520 +0,0 @@
|
||||
# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# $Id$
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = .
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
CC = @CC@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
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
|
||||
echoping_LDADD =
|
||||
DOCS = DETAILS
|
||||
|
||||
TESTS = test-echoping-local test-echoping-remote
|
||||
MORE_TESTS = test-echoping-proxy test-echoping-icp test-echoping-crypto test-echoping-tos test-echoping-ipv6
|
||||
|
||||
EXTRA_DIST = $(man_MANS) $(TESTS) $(DOCS) $(MORE_TESTS)
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
|
||||
|
||||
DEFS = @DEFS@ -I. -I$(srcdir) -I.
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
echoping_OBJECTS = echoping.o error.o readline.o writen.o util.o http.o \
|
||||
icp.o HTParse.o smtp.o
|
||||
echoping_DEPENDENCIES =
|
||||
echoping_LDFLAGS =
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
man1dir = $(mandir)/man1
|
||||
MANS = $(man_MANS)
|
||||
|
||||
NROFF = nroff
|
||||
DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
|
||||
Makefile.am Makefile.in NEWS TODO acconfig.h acinclude.m4 aclocal.m4 \
|
||||
config.guess config.h.in config.sub configure configure.in install-sh \
|
||||
missing mkinstalldirs
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
DEP_FILES = .deps/HTParse.P .deps/echoping.P .deps/error.P .deps/http.P \
|
||||
.deps/icp.P .deps/readline.P .deps/smtp.P .deps/util.P .deps/writen.P
|
||||
SOURCES = $(echoping_SOURCES)
|
||||
OBJECTS = $(echoping_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .o .s
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
$(ACLOCAL_M4): configure.in acinclude.m4
|
||||
cd $(srcdir) && $(ACLOCAL)
|
||||
|
||||
config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
config.h: stamp-h
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h; \
|
||||
$(MAKE) stamp-h; \
|
||||
else :; fi
|
||||
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
|
||||
$(SHELL) ./config.status
|
||||
@echo timestamp > stamp-h 2> /dev/null
|
||||
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
|
||||
@if test ! -f $@; then \
|
||||
rm -f $(srcdir)/stamp-h.in; \
|
||||
$(MAKE) $(srcdir)/stamp-h.in; \
|
||||
else :; fi
|
||||
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
|
||||
|
||||
mostlyclean-hdr:
|
||||
|
||||
clean-hdr:
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h
|
||||
|
||||
maintainer-clean-hdr:
|
||||
|
||||
mostlyclean-binPROGRAMS:
|
||||
|
||||
clean-binPROGRAMS:
|
||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||
|
||||
distclean-binPROGRAMS:
|
||||
|
||||
maintainer-clean-binPROGRAMS:
|
||||
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
|
||||
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
done
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core *.core
|
||||
|
||||
clean-compile:
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
|
||||
echoping: $(echoping_OBJECTS) $(echoping_DEPENDENCIES)
|
||||
@rm -f echoping
|
||||
$(LINK) $(echoping_LDFLAGS) $(echoping_OBJECTS) $(echoping_LDADD) $(LIBS)
|
||||
|
||||
install-man1:
|
||||
$(mkinstalldirs) $(DESTDIR)$(man1dir)
|
||||
@list='$(man1_MANS)'; \
|
||||
l2='$(man_MANS)'; for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||
else file=$$i; fi; \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
|
||||
done
|
||||
|
||||
uninstall-man1:
|
||||
@list='$(man1_MANS)'; \
|
||||
l2='$(man_MANS)'; for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
|
||||
rm -f $(DESTDIR)$(man1dir)/$$inst; \
|
||||
done
|
||||
install-man: $(MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-man1
|
||||
uninstall-man:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS) uninstall-man1
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
-rm -rf $(distdir)
|
||||
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
dc_install_base=`cd $(distdir)/=inst && pwd`; \
|
||||
cd $(distdir)/=build \
|
||||
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist
|
||||
-rm -rf $(distdir)
|
||||
@banner="$(distdir).tar.gz is ready for distribution"; \
|
||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
echo "$$dashes"
|
||||
dist: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
-rm -rf $(distdir)
|
||||
dist-all: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
-rm -rf $(distdir)
|
||||
distdir: $(DISTFILES)
|
||||
-rm -rf $(distdir)
|
||||
mkdir $(distdir)
|
||||
-chmod 777 $(distdir)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
|
||||
|
||||
-include $(DEP_FILES)
|
||||
|
||||
mostlyclean-depend:
|
||||
|
||||
clean-depend:
|
||||
|
||||
distclean-depend:
|
||||
-rm -rf .deps
|
||||
|
||||
maintainer-clean-depend:
|
||||
|
||||
%.o: %.c
|
||||
@echo '$(COMPILE) -c $<'; \
|
||||
$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
|
||||
@-cp .deps/$(*F).pp .deps/$(*F).P; \
|
||||
tr ' ' '\012' < .deps/$(*F).pp \
|
||||
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
||||
>> .deps/$(*F).P; \
|
||||
rm .deps/$(*F).pp
|
||||
|
||||
%.lo: %.c
|
||||
@echo '$(LTCOMPILE) -c $<'; \
|
||||
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
|
||||
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
|
||||
< .deps/$(*F).pp > .deps/$(*F).P; \
|
||||
tr ' ' '\012' < .deps/$(*F).pp \
|
||||
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
||||
>> .deps/$(*F).P; \
|
||||
rm -f .deps/$(*F).pp
|
||||
check-TESTS: $(TESTS)
|
||||
@failed=0; all=0; \
|
||||
srcdir=$(srcdir); export srcdir; \
|
||||
for tst in $(TESTS); do \
|
||||
if test -f $$tst; then dir=.; \
|
||||
else dir="$(srcdir)"; fi; \
|
||||
if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \
|
||||
all=`expr $$all + 1`; \
|
||||
echo "PASS: $$tst"; \
|
||||
elif test $$? -ne 77; then \
|
||||
all=`expr $$all + 1`; \
|
||||
failed=`expr $$failed + 1`; \
|
||||
echo "FAIL: $$tst"; \
|
||||
fi; \
|
||||
done; \
|
||||
if test "$$failed" -eq 0; then \
|
||||
banner="All $$all tests passed"; \
|
||||
else \
|
||||
banner="$$failed of $$all tests failed"; \
|
||||
fi; \
|
||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
echo "$$dashes"; \
|
||||
test "$$failed" -eq 0
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
all-recursive-am: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am: install-man
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am: uninstall-binPROGRAMS uninstall-man
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(PROGRAMS) $(MANS) config.h
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \
|
||||
mostlyclean-compile mostlyclean-tags mostlyclean-depend \
|
||||
mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-tags \
|
||||
clean-depend clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \
|
||||
distclean-tags distclean-depend distclean-generic \
|
||||
clean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f config.status
|
||||
|
||||
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \
|
||||
maintainer-clean-compile maintainer-clean-tags \
|
||||
maintainer-clean-depend maintainer-clean-generic \
|
||||
distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f config.status
|
||||
|
||||
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
|
||||
mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
|
||||
maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile install-man1 uninstall-man1 install-man \
|
||||
uninstall-man tags mostlyclean-tags distclean-tags clean-tags \
|
||||
maintainer-clean-tags distdir mostlyclean-depend distclean-depend \
|
||||
clean-depend maintainer-clean-depend check-TESTS info-am info dvi-am \
|
||||
dvi check check-am installcheck-am installcheck all-recursive-am \
|
||||
install-exec-am install-exec install-data-am install-data install-am \
|
||||
install uninstall-am uninstall all-redirect all-am all installdirs \
|
||||
mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
test: check
|
||||
tests: check
|
||||
|
||||
fulltest: test moretest
|
||||
|
||||
moretests: moretest
|
||||
moretest: $(MORE_TESTS)
|
||||
@failed=0; all=0; \
|
||||
srcdir=$(srcdir); export srcdir; \
|
||||
for tst in $(MORE_TESTS); do \
|
||||
if test -f $$tst; then dir=.; \
|
||||
else dir="$(srcdir)"; fi; \
|
||||
if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \
|
||||
all=`expr $$all + 1`; \
|
||||
echo "PASS: $$tst"; \
|
||||
elif test $$? -ne 77; then \
|
||||
all=`expr $$all + 1`; \
|
||||
failed=`expr $$failed + 1`; \
|
||||
echo "FAIL: $$tst"; \
|
||||
fi; \
|
||||
done; \
|
||||
if test "$$failed" -eq 0; then \
|
||||
banner="All $$all tests passed"; \
|
||||
else \
|
||||
banner="$$failed of $$all tests failed"; \
|
||||
fi; \
|
||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
echo "$$dashes"; \
|
||||
test "$$failed" -eq 0
|
||||
|
||||
internal_test: internal_tests
|
||||
internal_tests: internal_tests.o $(echoping_OBJECTS)
|
||||
$(CC) $(LDFLAGS) -o $@ $< util.o
|
||||
./internal_tests
|
||||
|
||||
debug:
|
||||
$(MAKE) DEBUG=1 CFLAGS='-g -O0'
|
||||
|
||||
upload: dist
|
||||
@echo "Have you updated ChangeLog and tagged (cvs tag RELEASE_x_x_x) everything?"
|
||||
@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
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
@ -0,0 +1,63 @@
|
||||
If you want to write your own plugins, you will first have to decide
|
||||
wether your plugin uses a "cooked" hostname or a "raw" one.
|
||||
|
||||
In the first case, the cooked hostname, your plugin will receive from
|
||||
echoping a struct addrinfo. All the DNS stuff, including IDN, is
|
||||
performed by echoping. You can immediately start using the struct
|
||||
addrinfo.
|
||||
|
||||
But some libraries (typically, the one used by the DBMSs) do not work
|
||||
on struct addrinfo but on strings such as "dbname=test
|
||||
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.]
|
||||
|
||||
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.
|
||||
|
||||
You will have to provide three functions:
|
||||
|
||||
char * init (const int argc, const char **argv, const echoping_options options))
|
||||
Accepts remaining arguments (you have to use popt to parse them, or do
|
||||
it by hand, getopt does not allow you to resume the parsing) and
|
||||
returns a string identifying the port name (cooked interface) or NULL
|
||||
(raw interface). The options struct will give you the global options
|
||||
(see echoping.h).
|
||||
|
||||
For the cooked interface:
|
||||
|
||||
void start (struct addrinfo *res)
|
||||
Typically just stores the res structure for later use.
|
||||
|
||||
For the raw interface:
|
||||
|
||||
void start_raw ()
|
||||
Typically connects to the server.
|
||||
|
||||
int execute ()
|
||||
Connects and do whatever the protocol requires. It is called once
|
||||
per iteration. It returns >=0 if it succeeds, -1 if it failed
|
||||
temporarily (so echoping will continue its loop) and -2 if it failed
|
||||
permanently (so echoping will stop the iteration).
|
||||
|
||||
void terminate ()
|
||||
Cleans everything. It is called after all iterations.
|
||||
|
||||
Start your plugin source code with:
|
||||
|
||||
#define IN_PLUGIN
|
||||
#include <echoping/echoping.h>
|
||||
|
||||
You can look at random.c, the simplest plugin, and whois.c, the
|
||||
simplest which still does something useful.
|
||||
|
||||
The documentation of the plugin should be in a manual page named
|
||||
echoping_PLUGINNAME. See the above plugins for examples.
|
||||
|
||||
You can write a shell script named test.sh in the plugin directory to
|
||||
test the plugin. test-echoping-plugins will execute it.
|
||||
|
||||
$Id$
|
@ -1,45 +0,0 @@
|
||||
@BOTTOM@
|
||||
|
||||
/* Do we have getaddrinfo()? */
|
||||
#undef HAVE_GETADDRINFO_PROTO
|
||||
|
||||
/* Do we have POSIX signals? */
|
||||
#undef HAVE_SIGACTION
|
||||
|
||||
/* Do we have T/TCP? */
|
||||
#undef HAVE_TTCP
|
||||
|
||||
/* Do we have TOS? */
|
||||
#undef HAVE_TOS
|
||||
|
||||
/* Do we have socket priority? */
|
||||
#undef HAVE_SOCKET_PRIORITY
|
||||
|
||||
/* Is sys_errlist declared? */
|
||||
#undef DECL_SYS_ERRLIST
|
||||
|
||||
/* Is sys_nerr declared? */
|
||||
#undef DECL_SYS_NERR
|
||||
|
||||
/* HTTP support */
|
||||
#undef HTTP
|
||||
|
||||
/* SMTP support */
|
||||
#undef SMTP
|
||||
|
||||
/* ICP support */
|
||||
#undef ICP
|
||||
|
||||
/* SSL (crypto) */
|
||||
#undef OPENSSL
|
||||
|
||||
/* Port name for HTTP. Unused. */
|
||||
#undef HTTP_TCP_PORT
|
||||
|
||||
/* Port name for ICP */
|
||||
#undef ICP_UDP_PORT
|
||||
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
|
||||
/* $Id$ */
|
@ -1,394 +0,0 @@
|
||||
dnl aclocal.m4 generated automatically by aclocal 1.4-p4
|
||||
|
||||
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
dnl $Id$
|
||||
|
||||
dnl Macros beginning with CF_ stolen from Lynx
|
||||
dnl Thanks to "T.E.Dickey" <dickey@clark.net>
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Make an uppercase version of a variable
|
||||
dnl $1=uppercase($2)
|
||||
AC_DEFUN([CF_UPPER],
|
||||
[
|
||||
changequote(,)dnl
|
||||
$1=`echo $2 | tr '[a-z]' '[A-Z]'`
|
||||
changequote([,])dnl
|
||||
])dnl
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Check for existence of external data in the current set of libraries. If
|
||||
dnl we can modify it, it's real enough.
|
||||
dnl $1 = the name to check
|
||||
dnl $2 = its type
|
||||
AC_DEFUN([CF_CHECK_EXTERN_DATA],
|
||||
[
|
||||
AC_MSG_CHECKING(if external $1 exists)
|
||||
AC_CACHE_VAL(cf_cv_have_$1,[
|
||||
AC_TRY_LINK([
|
||||
#undef $1
|
||||
extern $2 $1;
|
||||
],
|
||||
[$1 = 2],
|
||||
[eval 'cf_cv_have_'$1'=yes'],
|
||||
[eval 'cf_cv_have_'$1'=no'])])
|
||||
|
||||
eval 'cf_result=$cf_cv_have_'$1
|
||||
AC_MSG_RESULT($cf_result)
|
||||
|
||||
if test "$cf_result" = yes ; then
|
||||
eval 'cf_result=HAVE_'$1
|
||||
CF_UPPER(cf_result,$cf_result)
|
||||
AC_DEFINE_UNQUOTED($cf_result)
|
||||
fi
|
||||
|
||||
])dnl
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Check for data that is usually declared in <stdio.h> or <errno.h>, e.g.,
|
||||
dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it
|
||||
dnl ourselves.
|
||||
dnl
|
||||
dnl (I would use AC_CACHE_CHECK here, but it will not work when called in a
|
||||
dnl loop from CF_SYS_ERRLIST).
|
||||
dnl
|
||||
dnl $1 = the name to check
|
||||
AC_DEFUN([CF_CHECK_ERRNO],
|
||||
[
|
||||
AC_MSG_CHECKING(if external $1 is declared)
|
||||
AC_CACHE_VAL(cf_cv_dcl_$1,[
|
||||
AC_TRY_COMPILE([
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <errno.h> ],
|
||||
[long x = (long) $1],
|
||||
[eval 'cf_cv_dcl_'$1'=yes'],
|
||||
[eval 'cf_cv_dcl_'$1'=no]')
|
||||
])
|
||||
eval 'cf_result=$cf_cv_dcl_'$1
|
||||
AC_MSG_RESULT($cf_result)
|
||||
|
||||
if test "$cf_result" = no ; then
|
||||
eval 'cf_result=DECL_'$1
|
||||
CF_UPPER(cf_result,$cf_result)
|
||||
AC_DEFINE_UNQUOTED($cf_result)
|
||||
fi
|
||||
|
||||
# It's possible (for near-UNIX clones) that the data doesn't exist
|
||||
CF_CHECK_EXTERN_DATA($1,int)
|
||||
])dnl
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Check for declaration of sys_nerr and sys_errlist in one of stdio.h and
|
||||
dnl errno.h. Declaration of sys_errlist on BSD4.4 interferes with our
|
||||
dnl declaration. Reported by Keith Bostic.
|
||||
AC_DEFUN([CF_SYS_ERRLIST],
|
||||
[
|
||||
for cf_name in sys_nerr sys_errlist
|
||||
do
|
||||
CF_CHECK_ERRNO($cf_name)
|
||||
done
|
||||
])dnl
|
||||
|
||||
dnl Useful macros to check libraries which are not implicit
|
||||
dnl in Solaris, for instance.
|
||||
AC_DEFUN([CF_LIB_NSL],
|
||||
[
|
||||
AC_CHECK_LIB(nsl,gethostbyname,
|
||||
[
|
||||
AC_MSG_CHECKING(if libnsl is mandatory)
|
||||
AC_TRY_LINK([#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
char *domain; ],
|
||||
[gethostbyname(domain)], dnl
|
||||
[AC_MSG_RESULT(no)], dnl
|
||||
[AC_MSG_RESULT(yes); LIBS="${LIBS} -lnsl"])
|
||||
])
|
||||
])
|
||||
AC_DEFUN([CF_LIB_SOCKET],
|
||||
[
|
||||
AC_CHECK_LIB(socket,socket,
|
||||
[
|
||||
AC_MSG_CHECKING(if libsocket is mandatory)
|
||||
AC_TRY_LINK([#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
union
|
||||
{
|
||||
HEADER hdr;
|
||||
u_char buf[512];
|
||||
}
|
||||
response;
|
||||
char *domain;
|
||||
int requested_type; ],
|
||||
[socket (AF_INET, SOCK_STREAM, 0) ], dnl
|
||||
[AC_MSG_RESULT(no)], dnl
|
||||
[AC_MSG_RESULT(yes); LIBS="${LIBS} -lsocket"])
|
||||
])
|
||||
])
|
||||
AC_DEFUN([CF_LIB_MATH],
|
||||
[
|
||||
AC_CHECK_LIB(m,pow,
|
||||
[
|
||||
AC_MSG_CHECKING(if libmath is mandatory)
|
||||
AC_TRY_LINK([#include <math.h>
|
||||
double a,b; ],
|
||||
[pow(a,b)], dnl
|
||||
[AC_MSG_RESULT(no)], dnl
|
||||
[AC_MSG_RESULT(yes); LIBS="${LIBS} -lm"])
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
dnl Check the port name for HTTP. Everyone should declare "http" but
|
||||
dnl not everyone does. This test is BUGgy, we should use a program
|
||||
dnl which calls getservbyname() otherwise we miss NIS tables, for
|
||||
dnl instance.
|
||||
AC_DEFUN([CF_CHECK_SERVICES],
|
||||
[
|
||||
AC_MSG_CHECKING(what is the name of the HTTP port in your services database)
|
||||
dnl BUG: We should test it is really the good port and not any mention of "http"
|
||||
if grep http /etc/services > /dev/null; then
|
||||
AC_DEFINE(HTTP_TCP_PORT,"http")
|
||||
AC_MSG_RESULT(http)
|
||||
else
|
||||
dnl BUG: Trap on Solaris with a port whose name begins with "www"...
|
||||
if grep www /etc/services > /dev/null; then
|
||||
AC_DEFINE(HTTP_TCP_PORT,"www")
|
||||
AC_MSG_RESULT(www)
|
||||
else
|
||||
AC_DEFINE(HTTP_TCP_PORT,"undefined:use_:80")
|
||||
AC_MSG_RESULT([undefined, you should add it in your database])
|
||||
fi
|
||||
fi
|
||||
AC_MSG_CHECKING(what is the name of the ICP port in your services database)
|
||||
if grep icp /etc/services > /dev/null; then
|
||||
AC_DEFINE(ICP_UDP_PORT,"icp")
|
||||
AC_MSG_RESULT(icp)
|
||||
else
|
||||
AC_DEFINE(ICP_UDP_PORT,"undefined:use_:3130")
|
||||
AC_MSG_RESULT([undefined, you should add it in your database])
|
||||
fi
|
||||
])
|
||||
|
||||
# Check OpenSSL
|
||||
AC_DEFUN([CF_LIB_OPENSSL],
|
||||
[
|
||||
AC_CHECK_LIB(ssl,SSL_CTX_new,
|
||||
[LIBS="${LIBS} -lssl -lcrypto"],
|
||||
[AC_ERROR([Get the OpenSSL library (http://www.openssl.org/)])], dnl
|
||||
-lcrypto
|
||||
)])
|
||||
|
||||
dnl experimental
|
||||
AC_DEFUN([CF_CHECK_TCP_SERVICE],
|
||||
[
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
struct servent *sp;
|
||||
if ((sp = getservbyname ("$1", "tcp")) == 0)
|
||||
exit (1);
|
||||
else
|
||||
exit (0);
|
||||
}
|
||||
],
|
||||
ac_last_port=$1
|
||||
,
|
||||
ac_last_port=
|
||||
)])
|
||||
|
||||
dnl Our (W. Richard Stevens') macro to check for a function prototype in
|
||||
dnl a given header.
|
||||
AC_DEFUN(AC_CHECK_FUNC_PROTO,
|
||||
[AC_CACHE_CHECK(for $1 function prototype in $2, ac_cv_have_$1_proto,
|
||||
AC_EGREP_HEADER($1, $2,
|
||||
ac_cv_have_$1_proto=yes,
|
||||
ac_cv_have_$1_proto=no))
|
||||
if test $ac_cv_have_$1_proto = yes ; then
|
||||
ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_PROTO
|
||||
AC_DEFINE_UNQUOTED($ac_tr_func)
|
||||
fi
|
||||
])
|
||||
|
||||
dnl BROKEN: do not use
|
||||
dnl Copied from autoconf and edited to add an argument: an include file
|
||||
dnl AC_CHECK_FUNC_WITH_HEADER(FUNCTION, HEADER, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
||||
AC_DEFUN(AC_CHECK_FUNC_WITH_HEADER,
|
||||
[AC_MSG_CHECKING([for $1])
|
||||
AC_CACHE_VAL(ac_cv_func_$1,
|
||||
[AC_TRY_LINK(
|
||||
dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
|
||||
dnl which includes <sys/select.h> which contains a prototype for
|
||||
dnl select. Similarly for bzero.
|
||||
[/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $1(); below. */
|
||||
#include <assert.h>
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
])dnl
|
||||
[/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char $1();
|
||||
#include <$2>
|
||||
], [
|
||||
/* The GNU C library defines this for functions which it implements
|
||||
to always fail with ENOSYS. Some functions are actually named
|
||||
something starting with __ and the normal name is an alias. */
|
||||
#if defined (__stub_$1) || defined (__stub___$1)
|
||||
choke me
|
||||
#else
|
||||
$1();
|
||||
#endif
|
||||
], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])
|
||||
if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$3], , :, [$3])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
ifelse([$4], , , [$4
|
||||
])dnl
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
|
||||
# Do all the work for Automake. This macro actually does too much --
|
||||
# some checks are only needed if your package does certain things.
|
||||
# But this isn't really a big deal.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl Usage:
|
||||
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
|
||||
|
||||
AC_DEFUN(AM_INIT_AUTOMAKE,
|
||||
[AC_REQUIRE([AC_PROG_INSTALL])
|
||||
PACKAGE=[$1]
|
||||
AC_SUBST(PACKAGE)
|
||||
VERSION=[$2]
|
||||
AC_SUBST(VERSION)
|
||||
dnl test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
ifelse([$3],,
|
||||
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
|
||||
AC_REQUIRE([AM_SANITY_CHECK])
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])
|
||||
dnl FIXME This is truly gross.
|
||||
missing_dir=`cd $ac_aux_dir && pwd`
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])])
|
||||
|
||||
#
|
||||
# Check to make sure that the build environment is sane.
|
||||
#
|
||||
|
||||
AC_DEFUN(AM_SANITY_CHECK,
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftestfile
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
||||
if test "[$]*" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftestfile`
|
||||
fi
|
||||
if test "[$]*" != "X $srcdir/configure conftestfile" \
|
||||
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "[$]2" = conftestfile
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
rm -f conftest*
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
|
||||
dnl The program must properly implement --version.
|
||||
AC_DEFUN(AM_MISSING_PROG,
|
||||
[AC_MSG_CHECKING(for working $2)
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
||||
if ($2 --version) < /dev/null > /dev/null 2>&1; then
|
||||
$1=$2
|
||||
AC_MSG_RESULT(found)
|
||||
else
|
||||
$1="$3/missing $2"
|
||||
AC_MSG_RESULT(missing)
|
||||
fi
|
||||
AC_SUBST($1)])
|
||||
|
||||
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
||||
|
||||
AC_DEFUN(AM_CONFIG_HEADER,
|
||||
[AC_PREREQ([2.12])
|
||||
AC_CONFIG_HEADER([$1])
|
||||
dnl When config.status generates a header, we must update the stamp-h file.
|
||||
dnl This file resides in the same directory as the config header
|
||||
dnl that is generated. We must strip everything past the first ":",
|
||||
dnl and everything past the last "/".
|
||||
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
|
||||
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
|
||||
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
|
||||
<<am_indx=1
|
||||
for am_file in <<$1>>; do
|
||||
case " <<$>>CONFIG_HEADERS " in
|
||||
*" <<$>>am_file "*<<)>>
|
||||
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
|
||||
;;
|
||||
esac
|
||||
am_indx=`expr "<<$>>am_indx" + 1`
|
||||
done<<>>dnl>>)
|
||||
changequote([,]))])
|
||||
|
@ -0,0 +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@."
|
||||
|
||||
/* $Id$ */
|
File diff suppressed because it is too large
Load Diff
@ -1,97 +0,0 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define if you have the getaddrinfo function. */
|
||||
#undef HAVE_GETADDRINFO
|
||||
|
||||
/* Define if you have the getnameinfo function. */
|
||||
#undef HAVE_GETNAMEINFO
|
||||
|
||||
/* Define if you have the gettimeofday function. */
|
||||
#undef HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define if you have the inet_ntop function. */
|
||||
#undef HAVE_INET_NTOP
|
||||
|
||||
/* Define if you have the sigaction function. */
|
||||
#undef HAVE_SIGACTION
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
#undef HAVE_SOCKET
|
||||
|
||||
/* Define if you have the usleep function. */
|
||||
#undef HAVE_USLEEP
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
|
||||
/* Do we have getaddrinfo()? */
|
||||
#undef HAVE_GETADDRINFO_PROTO
|
||||
|
||||
/* Do we have POSIX signals? */
|
||||
#undef HAVE_SIGACTION
|
||||
|
||||
/* Do we have T/TCP? */
|
||||
#undef HAVE_TTCP
|
||||
|
||||
/* Do we have TOS? */
|
||||
#undef HAVE_TOS
|
||||
|
||||
/* Do we have socket priority? */
|
||||
#undef HAVE_SOCKET_PRIORITY
|
||||
|
||||
/* Is sys_errlist declared? */
|
||||
#undef DECL_SYS_ERRLIST
|
||||
|
||||
/* Is sys_nerr declared? */
|
||||
#undef DECL_SYS_NERR
|
||||
|
||||
/* HTTP support */
|
||||
#undef HTTP
|
||||
|
||||
/* SMTP support */
|
||||
#undef SMTP
|
||||
|
||||
/* ICP support */
|
||||
#undef ICP
|
||||
|
||||
/* SSL (crypto) */
|
||||
#undef OPENSSL
|
||||
|
||||
/* Port name for HTTP. Unused. */
|
||||
#undef HTTP_TCP_PORT
|
||||
|
||||
/* Port name for ICP */
|
||||
#undef ICP_UDP_PORT
|
||||
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
|
||||
/* $Id$ */
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@
|
||||
dnl $Id$
|
||||
AC_INIT(echoping, 6.1-BETA, bortz@users.sourceforge.net)
|
||||
AC_CANONICAL_HOST
|
||||
AC_PROG_CC(cc gcc)
|
||||
AC_LIBTOOL_DLOPEN
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
|
@ -0,0 +1,383 @@
|
||||
dnl $Id$
|
||||
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
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
|
||||
AC_ARG_ENABLE(max-iterations,
|
||||
[ --enable-max-iterations=MAX limit the number of iterations (-n option) to MAX],
|
||||
[if test "$enableval" != "no"; then
|
||||
max_iterations_specified=1
|
||||
fi])
|
||||
if test "$max_iterations_specified" = 0; then
|
||||
AC_DEFINE(MAX_ITERATIONS, 20, Maximum number of iterations)
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(MAX_ITERATIONS, $enableval, Maximum number of iterations)
|
||||
fi
|
||||
max_line_specified=0
|
||||
AC_ARG_ENABLE(max-request-size,
|
||||
[ --enable-max-request-size=MAX limit the size of a request to MAX],
|
||||
[if test "$enableval" != "no"; then
|
||||
max_line_specified=1
|
||||
fi])
|
||||
if test "$max_line_specified" = 0; then
|
||||
AC_DEFINE(MAX_LINE, 65535, Maximum size of a request)
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(MAX_LINE, $enableval, Maximum size of a request)
|
||||
fi
|
||||
AC_ARG_ENABLE(http,
|
||||
[ --enable-http HTTP (Web's main protocol) support],dnl
|
||||
[if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(HTTP,,[HTTP support])
|
||||
HTTP=1
|
||||
fi],
|
||||
dnl Default: enable it
|
||||
[AC_DEFINE(HTTP,,[HTTP support])
|
||||
HTTP=1])
|
||||
AC_ARG_ENABLE(icp,
|
||||
[ --enable-icp ICP (for testing Web proxies/caches) support],dnl
|
||||
[if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(ICP,,[ICP support])
|
||||
ICP=1
|
||||
fi])
|
||||
AC_ARG_ENABLE(smtp,
|
||||
[ --enable-smtp SMTP (Mail's main protocol) support],dnl
|
||||
[if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(SMTP,,[SMTP support])
|
||||
SMTP=1
|
||||
fi],
|
||||
dnl Default: enable it
|
||||
[AC_DEFINE(SMTP,,[SMTP support])
|
||||
SMTP=1])
|
||||
dnl IDN
|
||||
dnl Default: enable it
|
||||
LIBIDN=1
|
||||
AC_ARG_WITH(libidn,
|
||||
[ --with-libidn[=DIR] Internationalized Domain Names support (needs GNU libidn)],dnl
|
||||
[if test "$withval" != "no"; then
|
||||
if test "$withval" != "yes"; then
|
||||
IDNROOT=$withval
|
||||
LDFLAGS="${LDFLAGS} -L$IDNROOT/lib"
|
||||
CPPFLAGS="${CPPFLAGS} -I$IDNROOT/include"
|
||||
fi
|
||||
else
|
||||
LIBIDN=0
|
||||
fi],
|
||||
)
|
||||
if test "$LIBIDN" = "1"; then
|
||||
AC_DEFINE(LIBIDN,,[Internationalized Domain Names support])
|
||||
fi
|
||||
AC_ARG_WITH(ssl,
|
||||
[ --with-ssl[=DIR] SSL crypt support (needs OpenSSL)],dnl
|
||||
[if test "$withval" != "no"; then
|
||||
AC_DEFINE(OPENSSL,,[Crypto (SSL) support])
|
||||
OPENSSL=1
|
||||
if test "$withval" != "yes"; then
|
||||
SSLROOT=$withval
|
||||
LDFLAGS="${LDFLAGS} -L$SSLROOT/lib"
|
||||
CPPFLAGS="${CPPFLAGS} -I$SSLROOT/include"
|
||||
fi
|
||||
fi],
|
||||
dnl Default: disable it
|
||||
)
|
||||
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"
|
||||
fi
|
||||
fi],
|
||||
dnl Default: disable it
|
||||
)
|
||||
dnl TODO: test if the getopt variable optreset exists and, if it
|
||||
dnl does, we can use getopt (Free BSDs and MacOS X). This implies to
|
||||
dnl maintain the two versions, popt and getopt, while echoping has
|
||||
dnl many options. It probably means a high-level language to describe
|
||||
dnl the options and to produce the two versions. gengetopt is an obvious
|
||||
dnl candidate.
|
||||
AC_ARG_WITH(popt,
|
||||
[ --with-popt[=DIR] popt command-line parsing library],dnl
|
||||
[if test "$withval" != "no"; then
|
||||
if test "$withval" != "yes"; then
|
||||
POPTROOT=$withval
|
||||
LDFLAGS="${LDFLAGS} -L$POPTROOT/lib"
|
||||
CPPFLAGS="${CPPFLAGS} -I$POPTROOT/include"
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([The popt command-line parsing library is mandatory for echoping])
|
||||
fi],
|
||||
dnl Default: disable it
|
||||
)
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
|
||||
dnl Checks for libraries.
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(sys/time.h unistd.h)
|
||||
|
||||
case $host_os in
|
||||
osf*)
|
||||
# Stupid bug appeared in Tru64-OSF1 v5. socklen_t is undefined without
|
||||
# the following workaround.
|
||||
CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
|
||||
;;
|
||||
*darwin*)
|
||||
# See bug #748145 and #765777
|
||||
CPPFLAGS="$CPPFLAGS -D_BSD_SOCKLEN_T_=int -no-cpp-precomp"
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_HEADER_TIME
|
||||
|
||||
dnl Checks for library functions.
|
||||
CF_LIB_SOCKET
|
||||
CF_LIB_NSL
|
||||
CF_LIB_MATH
|
||||
AC_TYPE_SIGNAL
|
||||
AC_FUNC_VPRINTF
|
||||
dnl Some Unices like Tru64 or Mac OS X has getaddrinfo() or
|
||||
dnl getnameinfo() but has it renamed in libc as something else so we
|
||||
dnl must include <netdb.h> to get the redefinition. (Stolen from rsync)
|
||||
dnl autoconf AC_CHECK_FUNCS does not allow headers to be easily included :-(
|
||||
AC_CHECK_FUNCS(getaddrinfo getnameinfo inet_ntop, ,
|
||||
[AC_MSG_CHECKING([$ac_func again by including <netdb.h>])
|
||||
AC_TRY_LINK([#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>],[$ac_func(NULL, NULL, NULL, NULL);],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_ERROR([Missing mandatory function - echoping now uses the new network functions (RFC 2133) which are mandatory for IPv6])]
|
||||
)])
|
||||
|
||||
AC_CHECK_FUNCS(gettimeofday socket sigaction strerror, , AC_MSG_ERROR(Missing mandatory function))
|
||||
AC_CHECK_FUNCS(poptGetContext, ,
|
||||
[AC_CHECK_LIB(popt,poptGetContext, ,
|
||||
[AC_MSG_ERROR([Missing popt library, get it from ftp://ftp.rpm.org/pub/rpm/dist/rpm-x.y.z])])])
|
||||
AC_CHECK_FUNCS(usleep) dnl TODO: use the Autoconf macro http://www.gnu.org/software/ac-archive/htmldoc/etr_short_sleep.html
|
||||
AC_CHECK_FUNCS(dlopen, ,
|
||||
[AC_CHECK_LIB(dl,dlopen, ,
|
||||
[AC_MSG_ERROR([echoping requires dlopen (dynamic loading of libraries) for plugins])])])
|
||||
|
||||
if test "$LIBIDN" = "1"; then
|
||||
CF_LIB_LIBIDN
|
||||
fi
|
||||
if test "$OPENSSL" = "1" && test "$GNUTLS" = "1"; then
|
||||
AC_MSG_ERROR([Choose OpenSSL or GNU TLS but not both])
|
||||
fi
|
||||
if test "$OPENSSL" = "1"; then
|
||||
CF_LIB_OPENSSL
|
||||
fi
|
||||
if test "$GNUTLS" = "1"; then
|
||||
CF_LIB_GNUTLS
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([TCP info from socket])
|
||||
AC_TRY_COMPILE(
|
||||
[#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
/* TODO: including tcp.h may not be necessary */
|
||||
#include <netinet/tcp.h>
|
||||
],
|
||||
[int foobar = SOL_TCP;],
|
||||
[AC_DEFINE(HAVE_TCP_INFO,,[TCP info from socket])
|
||||
ac_have_tcp_info="yes"],
|
||||
ac_have_tcp_info=no)
|
||||
AC_MSG_RESULT($ac_have_tcp_info)
|
||||
AC_ARG_ENABLE(tcp_info,
|
||||
[ --enable-tcp-info TCP info from socket],
|
||||
[if test "$enableval" = "yes"; then
|
||||
if test $ac_have_tcp_info = "yes"; then
|
||||
AC_DEFINE(HAVE_TCP_INFO,,[TCP info from socket])
|
||||
TCP_INFO=1
|
||||
else
|
||||
AC_MSG_WARN([No TCP info support on this system, request ignored])
|
||||
fi
|
||||
fi],
|
||||
dnl Default: enable it if supported
|
||||
if test $ac_have_tcp_info = "yes"; then
|
||||
AC_DEFINE(HAVE_TCP_INFO,,[TCP info])
|
||||
TCP_INFO=1
|
||||
fi)
|
||||
|
||||
dnl Type Of Service
|
||||
AC_MSG_CHECKING([Type Of Service])
|
||||
AC_TRY_COMPILE(
|
||||
[#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
],
|
||||
[int foobar = IP_TOS;],
|
||||
[AC_DEFINE(HAVE_TOS,,[Type Of Service support])
|
||||
ac_have_tos="yes"],
|
||||
ac_have_tos="no")
|
||||
AC_MSG_RESULT($ac_have_tos)
|
||||
AC_ARG_ENABLE(tos,
|
||||
[ --enable-tos TOS (Type Of Service) support],
|
||||
[if test "$enableval" = "yes"; then
|
||||
if test $ac_have_tos = "yes"; then
|
||||
AC_DEFINE(HAVE_TOS,,[Type Of Service support])
|
||||
TOS=1
|
||||
else
|
||||
AC_MSG_WARN([No TOS support on this system, request ignored])
|
||||
fi
|
||||
fi],
|
||||
dnl Default: enable it if supported
|
||||
if test $ac_have_tos = "yes"; then
|
||||
AC_DEFINE(HAVE_TOS,,[Type Of Service support])
|
||||
TOS=1
|
||||
fi)
|
||||
|
||||
dnl Socket priority
|
||||
dnl Linux only, it seems. Anyone knows a standard way to do so?
|
||||
AC_MSG_CHECKING([Socket priority])
|
||||
AC_TRY_COMPILE(
|
||||
[#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
],
|
||||
[int foobar = SO_PRIORITY;],
|
||||
[AC_DEFINE(HAVE_SOCKET_PRIORITY)
|
||||
ac_have_priority="yes"],
|
||||
ac_have_priority="no")
|
||||
AC_MSG_RESULT($ac_have_priority)
|
||||
AC_ARG_ENABLE(priority,
|
||||
[ --enable-priority PRIORITY (socket priority) support],
|
||||
[if test "$enableval" = "yes"; then
|
||||
if test $ac_have_priority = "yes"; then
|
||||
AC_DEFINE(HAVE_SOCKET_PRIORITY,,[Socket priority support])
|
||||
PRIORITY=1
|
||||
else
|
||||
AC_MSG_WARN([No socket priority support on this system, request ignored])
|
||||
fi
|
||||
fi],
|
||||
dnl Default: enable it if supported
|
||||
if test $ac_have_priority = "yes"; then
|
||||
AC_DEFINE(HAVE_SOCKET_PRIORITY,,[Socket priority support])
|
||||
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
|
||||
|
||||
interpolate() {
|
||||
old=$1
|
||||
eval new=$old
|
||||
if test "$new" != "$old" ; then
|
||||
interpolate $new
|
||||
else
|
||||
echo $new
|
||||
fi
|
||||
}
|
||||
dnl TODO: the following is broken because installation prefix can be changed at instal-time,
|
||||
dnl not compilation time.
|
||||
if test "x$libdir" = 'x${exec_prefix}/lib' ; then # Default value
|
||||
if test "x$exec_prefix" = "xNONE" ; then # Default value
|
||||
if test "x$prefix" = "xNONE" ; then # Default value
|
||||
plugins_dir=`interpolate '$ac_default_prefix/lib/echoping'`
|
||||
else
|
||||
exec_prefix='${prefix}'
|
||||
plugins_dir=`interpolate '$libdir/echoping'`
|
||||
fi
|
||||
else
|
||||
plugins_dir=`interpolate '$libdir/echoping'`
|
||||
fi
|
||||
else
|
||||
plugins_dir=`interpolate '$libdir/echoping'`
|
||||
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)
|
||||
|
||||
compil_options=""
|
||||
AC_DEFUN([DISPLAY_SETTING],
|
||||
[
|
||||
echo $ECHO_N $1 ": "
|
||||
compil_options="$compil_options\n$1:"
|
||||
if [ eval 'test "$$1" = "1"' > /dev/null]; then
|
||||
AC_MSG_RESULT( enabled)
|
||||
compil_options="$compil_options enabled"
|
||||
else
|
||||
AC_MSG_RESULT( disabled)
|
||||
compil_options="$compil_options disabled "
|
||||
fi
|
||||
])dnl
|
||||
echo ""
|
||||
echo "Configuration of echoping:"
|
||||
|
||||
DISPLAY_SETTING(HTTP)
|
||||
DISPLAY_SETTING(ICP)
|
||||
DISPLAY_SETTING(OPENSSL)
|
||||
DISPLAY_SETTING(GNUTLS)
|
||||
DISPLAY_SETTING(SMTP)
|
||||
DISPLAY_SETTING(LIBIDN)
|
||||
DISPLAY_SETTING(TOS)
|
||||
DISPLAY_SETTING(SCTP)
|
||||
DISPLAY_SETTING(PRIORITY)
|
||||
|
||||
compil_date=`date +%Y-%m-%d`
|
||||
hostname=$ac_hostname
|
||||
AC_SUBST(hostname)
|
||||
AC_SUBST(compil_options)
|
||||
AC_SUBST(compil_date)
|
||||
AC_OUTPUT(Makefile echoping.1 compilation.h)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,210 +0,0 @@
|
||||
dnl $Id$
|
||||
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(echoping.h)
|
||||
AC_CANONICAL_HOST
|
||||
AM_INIT_AUTOMAKE(echoping, 5.0.0)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl User options
|
||||
AC_ARG_ENABLE(http,
|
||||
[--enable-http HTTP (Web's main protocol) support],dnl
|
||||
[if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(HTTP)
|
||||
HTTP=1
|
||||
fi],
|
||||
dnl Default: enable it
|
||||
[AC_DEFINE(HTTP)
|
||||
HTTP=1])
|
||||
AC_ARG_ENABLE(icp,
|
||||
[--enable-icp ICP (for testing Web proxies/caches) support],dnl
|
||||
[if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(ICP)
|
||||
ICP=1
|
||||
fi])
|
||||
AC_ARG_ENABLE(smtp,
|
||||
[--enable-smtp SMTP (Mail's main protocol) support],dnl
|
||||
[if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(SMTP)
|
||||
SMTP=1
|
||||
fi],
|
||||
dnl Default: enable it
|
||||
[AC_DEFINE(SMTP)
|
||||
SMTP=1])
|
||||
AC_ARG_WITH(ssl,
|
||||
[--with-ssl[=DIR] SSL crypt support (needs OpenSSL)],dnl
|
||||
[if test "$withval" != "no"; then
|
||||
AC_DEFINE(OPENSSL)
|
||||
OPENSSL=1
|
||||
if test "$withval" != "yes"; then
|
||||
SSLROOT=$withval
|
||||
LDFLAGS="${LDFLAGS} -L$SSLROOT/lib"
|
||||
CPPFLAGS="${CPPFLAGS} -I$SSLROOT/include"
|
||||
fi
|
||||
fi],
|
||||
dnl Default: disable it
|
||||
)
|
||||
|
||||
dnl See T/TCP later
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
|
||||
dnl Checks for libraries.
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(sys/time.h unistd.h)
|
||||
CF_SYS_ERRLIST
|
||||
|
||||
case $host_os in
|
||||
osf*)
|
||||
# Stupid bug appeared in Tru64-OSF1 v5. socklen_t is undefined without
|
||||
# the following workaround.
|
||||
CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_HEADER_TIME
|
||||
|
||||
dnl Checks for library functions.
|
||||
CF_LIB_SOCKET
|
||||
CF_LIB_NSL
|
||||
CF_LIB_MATH
|
||||
AC_TYPE_SIGNAL
|
||||
AC_FUNC_VPRINTF
|
||||
dnl Some Unices like Tru64 or Mac OS X has getaddrinfo() or
|
||||
dnl getnameinfo() but has it renamed in libc as something else so we
|
||||
dnl must include <netdb.h> to get the redefinition. (Stolen from rsync)
|
||||
dnl autoconf AC_CHECK_FUNCS does not allow headers to be easily included :-(
|
||||
AC_CHECK_FUNCS(getaddrinfo getnameinfo inet_ntop, ,
|
||||
[AC_MSG_CHECKING([$ac_func again by including <netdb.h>])
|
||||
AC_TRY_LINK([#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>],[$ac_func(NULL, NULL, NULL, NULL);],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_ERROR([Missing mandatory function - echoping now uses the new network functions (RFC 2133) which are mandatory for IPv6])]
|
||||
)])
|
||||
|
||||
AC_CHECK_FUNCS(gettimeofday socket sigaction, , AC_MSG_ERROR(Missing mandatory function))
|
||||
AC_CHECK_FUNCS(usleep)
|
||||
|
||||
if test "$OPENSSL" = "1"; then
|
||||
CF_LIB_OPENSSL
|
||||
fi
|
||||
|
||||
dnl T/TCP
|
||||
AC_MSG_CHECKING([T/TCP])
|
||||
AC_TRY_COMPILE(
|
||||
[#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
],
|
||||
[int foobar = MSG_EOF;],
|
||||
[AC_DEFINE(TTCP)
|
||||
ac_have_ttcp="yes"],
|
||||
ac_have_ttcp=no)
|
||||
AC_MSG_RESULT($ac_have_ttcp)
|
||||
AC_ARG_ENABLE(ttcp,
|
||||
[--enable-ttcp T/TCP (Transaction TCP) support],
|
||||
[if test "$enableval" = "yes"; then
|
||||
if test $ac_have_ttcp = "yes"; then
|
||||
AC_DEFINE(HAVE_TTCP)
|
||||
TTCP=1
|
||||
else
|
||||
AC_MSG_WARN([No T/TCP support on this system, request ignored])
|
||||
fi
|
||||
fi],
|
||||
dnl Default: enable it if supported
|
||||
if test $ac_have_ttcp = "yes"; then
|
||||
AC_DEFINE(HAVE_TTCP)
|
||||
TTCP=1
|
||||
fi)
|
||||
|
||||
dnl Type Of Service
|
||||
AC_MSG_CHECKING([Type Of Service])
|
||||
AC_TRY_COMPILE(
|
||||
[#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
],
|
||||
[int foobar = IP_TOS;],
|
||||
[AC_DEFINE(HAVE_TOS)
|
||||
ac_have_tos="yes"],
|
||||
ac_have_tos="no")
|
||||
AC_MSG_RESULT($ac_have_tos)
|
||||
AC_ARG_ENABLE(tos,
|
||||
[--enable-tos TOS (Type Of Service) support],
|
||||
[if test "$enableval" = "yes"; then
|
||||
if test $ac_have_tos = "yes"; then
|
||||
AC_DEFINE(HAVE_TOS)
|
||||
TOS=1
|
||||
else
|
||||
AC_MSG_WARN([No TOS support on this system, request ignored])
|
||||
fi
|
||||
fi],
|
||||
dnl Default: enable it if supported
|
||||
if test $ac_have_tos = "yes"; then
|
||||
AC_DEFINE(HAVE_TOS)
|
||||
TOS=1
|
||||
fi)
|
||||
|
||||
dnl Socket priority
|
||||
dnl Linux only, it seems. Anyone knows a standard way to do so?
|
||||
AC_MSG_CHECKING([Socket priority])
|
||||
AC_TRY_COMPILE(
|
||||
[#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
],
|
||||
[int foobar = SO_PRIORITY;],
|
||||
[AC_DEFINE(HAVE_SOCKET_PRIORITY)
|
||||
ac_have_priority="yes"],
|
||||
ac_have_priority="no")
|
||||
AC_MSG_RESULT($ac_have_priority)
|
||||
AC_ARG_ENABLE(priority,
|
||||
[--enable-priority PRIORITY (socket priority) support],
|
||||
[if test "$enableval" = "yes"; then
|
||||
if test $ac_have_priority = "yes"; then
|
||||
AC_DEFINE(HAVE_SOCKET_PRIORITY)
|
||||
PRIORITY=1
|
||||
else
|
||||
AC_MSG_WARN([No socket priority support on this system, request ignored])
|
||||
fi
|
||||
fi],
|
||||
dnl Default: enable it if supported
|
||||
if test $ac_have_priority = "yes"; then
|
||||
AC_DEFINE(HAVE_SOCKET_PRIORITY)
|
||||
PRIORITY=1
|
||||
fi)
|
||||
|
||||
if test "$GCC" = yes; then
|
||||
CFLAGS="$CFLAGS -Wall"
|
||||
fi
|
||||
|
||||
AC_OUTPUT(Makefile)
|
||||
|
||||
AC_DEFUN([DISPLAY_SETTING],
|
||||
[
|
||||
AC_MSG_CHECKING($1)
|
||||
if [ eval 'test "$$1" = "1"' > /dev/null]; then
|
||||
AC_MSG_RESULT( enabled)
|
||||
else
|
||||
AC_MSG_RESULT( disabled)
|
||||
fi
|
||||
])dnl
|
||||
echo ""
|
||||
echo "Configuration of echoping:"
|
||||
|
||||
DISPLAY_SETTING(HTTP)
|
||||
DISPLAY_SETTING(ICP)
|
||||
DISPLAY_SETTING(OPENSSL)
|
||||
DISPLAY_SETTING(SMTP)
|
||||
DISPLAY_SETTING(TTCP)
|
||||
DISPLAY_SETTING(TOS)
|
||||
DISPLAY_SETTING(PRIORITY)
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,3 @@
|
||||
Various echoping goodies, plugins, etc. No warranty at all, no
|
||||
support.
|
||||
|
@ -0,0 +1,9 @@
|
||||
if ADAMSNAMESBUILD
|
||||
bin_PROGRAMS = test-domquery
|
||||
test_domquery_SOURCES = test-domquery.c
|
||||
pkglib_LTLIBRARIES = domquery.la
|
||||
domquery_la_SOURCES = domquery.c util.c
|
||||
domquery_la_LDFLAGS = -module
|
||||
endif
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
#define CLIENT_NAME "XML-RPC Adams Names plugin for echoping"
|
||||
#define CLIENT_VERSION "0.0"
|
||||
|
||||
#define ENDPOINT "http://www.adamsnames.tc/api/xmlrpc"
|
||||
|
||||
poptContext poptcon;
|
||||
xmlrpc_env env;
|
||||
char *domain;
|
||||
|
||||
/* $Id$ */
|
@ -0,0 +1,17 @@
|
||||
dnl $Id$
|
||||
|
||||
AC_INIT(adamsnames, 0.0-BETA)
|
||||
AC_PROG_CC(cc gcc)
|
||||
AC_PROG_LIBTOOL
|
||||
AM_INIT_AUTOMAKE(foreign)
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
AC_CHECK_PROG(ADAMSNAMES_BUILD, xmlrpc-c-config, 1, 0)
|
||||
if test "$ADAMSNAMES_BUILD" = 1; then
|
||||
LIBS="${LIBS} `xmlrpc-c-config libwww-client --libs`"
|
||||
CCFLAGS="${CCFLAGS} `xmlrpc-c-config libwww-client --cflags`"
|
||||
else
|
||||
AC_ERROR([No XML-RPC C developement environment found, get it from http://xmlrpc-c.sourceforge.net/])
|
||||
fi
|
||||
AM_CONDITIONAL(ADAMSNAMESBUILD, test "$ADAMSNAMES_BUILD" = 1)
|
||||
AC_OUTPUT(Makefile)
|
@ -0,0 +1,111 @@
|
||||
/* echoping plugin to query (with XML-RPC) Adam's Names, the DNS registry.
|
||||
See http://www.adamsnames.tc/api/xmlrpc.html.
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#define IN_PLUGIN
|
||||
#include "../../echoping.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* http://xmlrpc-c.sourceforge.net/ */
|
||||
#include <xmlrpc.h>
|
||||
#include <xmlrpc_client.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "common.h"
|
||||
|
||||
void
|
||||
domquery_usage(char *msg)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
void
|
||||
start_raw()
|
||||
{
|
||||
|
||||
/* 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);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
void
|
||||
terminate()
|
||||
{
|
||||
/* Clean up our error-handling environment. */
|
||||
xmlrpc_env_clean(&env);
|
||||
|
||||
/* Shutdown our XML-RPC client library. */
|
||||
xmlrpc_client_cleanup();
|
||||
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
#include <stdio.h>
|
||||
|
||||
/* http://xmlrpc-c.sourceforge.net/ */
|
||||
#include <xmlrpc.h>
|
||||
#include <xmlrpc_client.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define CLIENT_NAME "XML-RPC Adams Names plugin for echoping"
|
||||
#define CLIENT_VERSION "0.0"
|
||||
|
||||
#define ENDPOINT "http://www.adamsnames.tc/api/xmlrpc"
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: %s domain\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
domain = argv[1];
|
||||
|
||||
/* 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);
|
||||
|
||||
/* 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);
|
||||
|
||||
/* Shutdown our XML-RPC client library. */
|
||||
xmlrpc_client_cleanup();
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include <xmlrpc.h>
|
||||
#include <xmlrpc_client.h>
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
XCFLAGS=-Wall -O0 -g -fPIC ${CFLAGS}
|
||||
LDFLAGS=-shared
|
||||
|
||||
OBJECTS=daytime.o
|
||||
|
||||
all: daytime.so
|
||||
|
||||
%.o: %.c
|
||||
${CC} ${XCFLAGS} -c -o $@ $<
|
||||
|
||||
%.so: %.o
|
||||
${CC} ${LDFLAGS} -o $@ $<
|
||||
|
||||
clean:
|
||||
-rm -f *.o *.so
|
||||
|
||||
.SECONDARY: ${OBJECTS}
|
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Daytime (RFC 867) plugin.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define IN_PLUGIN
|
||||
#include <echoping/echoping.h>
|
||||
|
||||
struct addrinfo daytime_server;
|
||||
int sockfd;
|
||||
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";
|
||||
}
|
||||
|
||||
void
|
||||
start(struct addrinfo *res)
|
||||
{
|
||||
daytime_server = *res;
|
||||
}
|
||||
|
||||
int
|
||||
execute()
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
void
|
||||
terminate()
|
||||
{
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
#!/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
|
@ -0,0 +1,5 @@
|
||||
pkglib_LTLIBRARIES = smallservices.la
|
||||
smallservices_la_SOURCES = small-services.c
|
||||
smallservices_la_LDFLAGS = -module
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
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.
|
@ -0,0 +1,9 @@
|
||||
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)
|
@ -0,0 +1,58 @@
|
||||
/*
|
||||
*
|
||||
* $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()
|
||||
{
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,11 @@
|
||||
#!/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
|
@ -1,190 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing - GNU libit 0.0"
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aclocal)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acinclude.m4' or \`configure.in'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`configure.in'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acconfig.h' or \`configure.in'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
||||
fi
|
||||
touch $file
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
system. You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequirements for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -1,40 +0,0 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain
|
||||
|
||||
# $Id$
|
||||
|
||||
errstatus=0
|
||||
|
||||
for file
|
||||
do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
shift
|
||||
|
||||
pathcomp=
|
||||
for d
|
||||
do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp"
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# mkinstalldirs ends here
|
@ -0,0 +1,12 @@
|
||||
SUBDIRS=@subdirs@
|
||||
CONFIGURE_DEPENDENCIES=list-of-dirs.m4 ../configure-common.ac configure-plugins.ac
|
||||
|
||||
list-of-dirs.m4:
|
||||
@echo "dnl Created automatically on `date`" > $@
|
||||
for file in `ls | grep -v CVS | grep -v autom4te`; do \
|
||||
if test -d $$file; then \
|
||||
echo "if test \"\$$$${file}_BUILD\" = 1; then" >> $@ ; \
|
||||
echo " AC_CONFIG_SUBDIRS($$file)" >> $@ ; \
|
||||
echo "fi" >> $@ ; \
|
||||
fi \
|
||||
done
|
@ -0,0 +1,31 @@
|
||||
LIBIDN=1
|
||||
AC_ARG_WITH(libidn,
|
||||
[ --with-libidn[=DIR] Internationalized Domain Names support (needs GNU libidn)],dnl
|
||||
[if test "$withval" != "no"; then
|
||||
if test "$withval" != "yes"; then
|
||||
IDNROOT=$withval
|
||||
LDFLAGS="${LDFLAGS} -L$IDNROOT/lib"
|
||||
CPPFLAGS="${CPPFLAGS} -I$IDNROOT/include"
|
||||
fi
|
||||
else
|
||||
LIBIDN=0
|
||||
fi],
|
||||
)
|
||||
if test "$LIBIDN" = "1"; then
|
||||
AC_DEFINE(LIBIDN,,[Internationalized Domain Names support])
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(popt,
|
||||
[ --with-popt[=DIR] popt command-line parsing library],dnl
|
||||
[if test "$withval" != "no"; then
|
||||
if test "$withval" != "yes"; then
|
||||
POPTROOT=$withval
|
||||
LDFLAGS="${LDFLAGS} -L$POPTROOT/lib"
|
||||
CPPFLAGS="${CPPFLAGS} -I$POPTROOT/include"
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([The popt command-line parsing library is mandatory for this plugin])
|
||||
fi],
|
||||
)
|
||||
|
||||
dnl $Id$
|
@ -0,0 +1,29 @@
|
||||
dnl $Id$
|
||||
|
||||
m4_include(../configure-common.ac)
|
||||
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
|
||||
AC_MSG_ERROR([You cannot disable plugin support])
|
||||
else
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_MSG_ERROR([You must indicate a list of plugins with this option])
|
||||
else
|
||||
plugins=$enableval
|
||||
fi
|
||||
fi],
|
||||
plugins="random whois dns postgresql ldap")
|
||||
for plugin in $plugins; do
|
||||
if test ! -d $srcdir/$plugin ; then
|
||||
AC_MSG_ERROR([No such plugin $plugin])
|
||||
fi
|
||||
eval ${plugin}_BUILD=1
|
||||
done
|
||||
m4_include(list-of-dirs.m4)
|
||||
plugins_dir=`cat dir`
|
||||
AC_SUBST(plugins_dir)
|
||||
AC_OUTPUT(Makefile)
|
||||
echo ""
|
||||
echo Plugins to build: $plugins
|
@ -0,0 +1,9 @@
|
||||
if DNSBUILD
|
||||
pkglib_LTLIBRARIES = dns.la
|
||||
dns_la_SOURCES = dns.c
|
||||
dns_la_LDFLAGS = -module
|
||||
endif
|
||||
|
||||
man_MANS = echoping_dns.1
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
@ -0,0 +1,56 @@
|
||||
dnl $Id$
|
||||
|
||||
m4_include([../../configure-common.ac])
|
||||
AM_INIT_AUTOMAKE(foreign)
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
m4_include([../configure-plugins.ac])
|
||||
|
||||
DNS_BUILD=1
|
||||
AC_CHECK_FUNCS(poptGetContext,,
|
||||
[AC_CHECK_LIB(popt,poptGetContext,,[AC_MSG_WARN([No popt development environment found, not building this plugin]) && DNS_BUILD=0])])
|
||||
if test "$DNS_BUILD" != "0"; then
|
||||
|
||||
AC_CHECK_FUNC(res_mkquery, ,
|
||||
[AC_CHECK_LIB(bind, res_mkquery, ,
|
||||
[AC_CHECK_LIB(resolv, res_mkquery, ,
|
||||
dnl http://bugs.debian.org/254089
|
||||
[ saved_LIBS="$LIBS"
|
||||
LIBS="$LIBS -lresolv"
|
||||
AC_MSG_CHECKING(for res_mkquery in -lresolv again)
|
||||
AC_LINK_IFELSE([[
|
||||
#include <resolv.h>
|
||||
int main()
|
||||
{
|
||||
res_mkquery (0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
return 0;
|
||||
}]],
|
||||
LIBS="$saved_LIBS -lresolv"; AC_MSG_RESULT(yes),
|
||||
LIBS="$saved_LIBS"; AC_MSG_RESULT(no)
|
||||
[AC_MSG_WARN([No DNS resolver development environment found, not building this plugin]) && DNS_BUILD=0])])])])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([_res ])
|
||||
AC_TRY_LINK([#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#include <resolv.h>],
|
||||
[_res.options = RES_INIT;],
|
||||
AC_DEFINE(HAVE_RES, , [Define if you have the _res variable])
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no));
|
||||
AC_MSG_CHECKING([_res_ext ])
|
||||
AC_TRY_LINK([#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#include <resolv.h>],
|
||||
[_res_ext.nsaddr_list[0].ss_family = AF_INET6;],
|
||||
AC_DEFINE(HAVE_RES_EXT, , [Define if you have the _res_ext variable (for IPv6)])
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no));
|
||||
|
||||
AM_CONDITIONAL(DNSBUILD, test "$DNS_BUILD" = 1)
|
||||
AC_OUTPUT(Makefile)
|
||||
|
@ -0,0 +1,215 @@
|
||||
/*
|
||||
* DNS plugin. $Id$
|
||||
*/
|
||||
|
||||
#define IN_PLUGIN
|
||||
#include "../../echoping.h"
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#include <resolv.h>
|
||||
|
||||
struct addrinfo name_server;
|
||||
poptContext dns_poptcon;
|
||||
char *request;
|
||||
int type;
|
||||
char *type_name = NULL;
|
||||
boolean use_tcp = FALSE;
|
||||
boolean no_recurse = FALSE;
|
||||
|
||||
/* nsError stolen from Liu & Albitz check_soa (in their book "DNS and BIND") */
|
||||
|
||||
/****************************************************************
|
||||
* nsError -- Print an error message from h_errno for a failure *
|
||||
* looking up NS records. res_query() converts the DNS *
|
||||
* packet return code to a smaller list of errors and *
|
||||
* places the error value in h_errno. There is a routine *
|
||||
* called herror() for printing out strings from h_errno *
|
||||
* like perror() does for errno. Unfortunately, the *
|
||||
* herror() messages assume you are looking up address *
|
||||
* records for hosts. In this program, we are looking up *
|
||||
* NS records for domains, so we need our own list of error *
|
||||
* strings. *
|
||||
****************************************************************/
|
||||
int
|
||||
nsError(error, 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;
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
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) {
|
||||
#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));
|
||||
#else
|
||||
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) {
|
||||
#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));
|
||||
#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;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
void
|
||||
terminate()
|
||||
{
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" $Id$
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH ECHOPING_DNS 1 "May 26, 2004"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
.\" .nh disable hyphenation
|
||||
.\" .hy enable hyphenation
|
||||
.\" .ad l left justify
|
||||
.\" .ad b justify to both left and right margins
|
||||
.\" .nf disable filling
|
||||
.\" .fi enable filling
|
||||
.\" .br insert line break
|
||||
.\" .sp <n> insert n+1 empty lines
|
||||
.\" for manpage-specific macros, see man(7)
|
||||
.SH NAME
|
||||
echoping_dns \- echoping plugin which queries a DNS server
|
||||
.SH SYNOPSIS
|
||||
.B echoping
|
||||
.RI [echoping\ options]
|
||||
.RI -m\ dns
|
||||
.B hostname
|
||||
.B request
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
|
||||
.\" respectively.
|
||||
dns is an echoping plugin, fo testing the performances of DNS (RFC
|
||||
1034 and 1035) servers.
|
||||
.SH ARGUMENTS
|
||||
.TP
|
||||
.B request
|
||||
A domain name
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-t, \-\-type
|
||||
The type of data requested (NS, A, SOA, etc)
|
||||
.TP
|
||||
.B \-\-no-recurse
|
||||
Do not request recursive queries
|
||||
.TP
|
||||
.B \-\-tcp
|
||||
Use only TCP ("virtual circuit")
|
||||
.SH SEE ALSO
|
||||
.BR echoping (1),
|
||||
.SH AUTHOR
|
||||
Stephane Bortzmeyer <bortz@users.sourceforge.net>
|
@ -0,0 +1,10 @@
|
||||
if LDAPBUILD
|
||||
pkglib_LTLIBRARIES = ldap.la
|
||||
ldap_la_SOURCES = ldap.c
|
||||
ldap_la_LDFLAGS = -module
|
||||
endif
|
||||
man_MANS = echoping_ldap.1
|
||||
|
||||
EXTRA_DIST = $(man_MANS) test.sh
|
||||
|
||||
# $Id$
|
@ -0,0 +1,19 @@
|
||||
dnl $Id$
|
||||
|
||||
m4_include([../../configure-common.ac])
|
||||
AM_INIT_AUTOMAKE(foreign)
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
m4_include([../configure-plugins.ac])
|
||||
|
||||
LDAP_BUILD=1
|
||||
AC_CHECK_FUNCS(poptGetContext,,
|
||||
[AC_CHECK_LIB(popt,poptGetContext,,[AC_MSG_WARN([No popt development environment found, not building this plugin]) && LDAP_BUILD=0])])
|
||||
if test "$LDAP_BUILD" != "0"; then
|
||||
AC_CHECK_FUNCS(ldap_open, ,
|
||||
[AC_CHECK_LIB(ldap,ldap_open,,
|
||||
[AC_MSG_WARN([No LDAP development environment found, not building this plugin]) && LDAP_BUILD=0])])
|
||||
fi
|
||||
AM_CONDITIONAL(LDAPBUILD, test "$LDAP_BUILD" = 1)
|
||||
AC_OUTPUT(Makefile)
|
||||
|
@ -0,0 +1,52 @@
|
||||
.\" $Id$
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH ECHOPING_LDAP 1 "May 26, 2004"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
.\" .nh disable hyphenation
|
||||
.\" .hy enable hyphenation
|
||||
.\" .ad l left justify
|
||||
.\" .ad b justify to both left and right margins
|
||||
.\" .nf disable filling
|
||||
.\" .fi enable filling
|
||||
.\" .br insert line break
|
||||
.\" .sp <n> insert n+1 empty lines
|
||||
.\" for manpage-specific macros, see man(7)
|
||||
.SH NAME
|
||||
echoping_ldap \- echoping plugin which connects to a LDAP server
|
||||
.SH SYNOPSIS
|
||||
.B echoping
|
||||
.RI [echoping\ options]
|
||||
.RI -m\ ldap
|
||||
.B hostname
|
||||
.RI [-b base]
|
||||
.RI [-r request]
|
||||
.RI [-s scope]
|
||||
.RI [-p port]
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
|
||||
.\" respectively.
|
||||
ldap is an echoping plugin to connect to LDAP servers.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-r request
|
||||
The request to the LDAP server, in LDAP filter language. By default (objectclass=*).
|
||||
.TP
|
||||
.B \-b base
|
||||
Base of the search, for instance "dc=current,dc=bugs,dc=debian,dc=org"
|
||||
.TP
|
||||
.B \-s scope
|
||||
Scope of the search, "sub", "one" or "base"
|
||||
.TP
|
||||
.B \-p port
|
||||
TCP port to use
|
||||
.SH SEE ALSO
|
||||
.BR echoping (1),
|
||||
.SH AUTHOR
|
||||
Stephane Bortzmeyer <bortz@users.sourceforge.net>
|
@ -0,0 +1,163 @@
|
||||
/*
|
||||
* LDAP plugin. TODO: loops with and without opening the connection each
|
||||
* time? $Id$
|
||||
*/
|
||||
|
||||
#define IN_PLUGIN
|
||||
#include "../../echoping.h"
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include <ldap.h>
|
||||
|
||||
const char *request = NULL;
|
||||
const char *base = NULL;
|
||||
int scope = LDAP_SCOPE_BASE;
|
||||
const char *hostname;
|
||||
int port = 0;
|
||||
LDAP *session;
|
||||
poptContext ldap_poptcon;
|
||||
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);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
start()
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
void
|
||||
terminate()
|
||||
{
|
||||
ldap_unbind_s(session);
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $Id$
|
||||
|
||||
../../echoping -m ldap -v db.debian.org --base=dc=debian,dc=org --scope=sub
|
||||
# TODO: ldapsearch works with the bts2ldap gateway but gq and echoping fail
|
||||
#../../echoping -m ldap -v master.debian.org --port=10101 --scope=sub --base='dc=current,dc=bugs,dc=debian,dc=org' '(debbugsPackage=ldap-utils)'
|
@ -0,0 +1,16 @@
|
||||
dnl Created automatically on Tue Jul 27 14:46:36 CEST 2004
|
||||
if test "$dns_BUILD" = 1; then
|
||||
AC_CONFIG_SUBDIRS(dns)
|
||||
fi
|
||||
if test "$ldap_BUILD" = 1; then
|
||||
AC_CONFIG_SUBDIRS(ldap)
|
||||
fi
|
||||
if test "$postgresql_BUILD" = 1; then
|
||||
AC_CONFIG_SUBDIRS(postgresql)
|
||||
fi
|
||||
if test "$random_BUILD" = 1; then
|
||||
AC_CONFIG_SUBDIRS(random)
|
||||
fi
|
||||
if test "$whois_BUILD" = 1; then
|
||||
AC_CONFIG_SUBDIRS(whois)
|
||||
fi
|
@ -0,0 +1,10 @@
|
||||
if PGSQLBUILD
|
||||
pkglib_LTLIBRARIES = postgresql.la
|
||||
postgresql_la_SOURCES = postgresql.c
|
||||
postgresql_la_LDFLAGS = -module
|
||||
endif
|
||||
man_MANS = echoping_postgresql.1
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
||||
# $Id$
|
@ -0,0 +1,34 @@
|
||||
dnl $Id$
|
||||
|
||||
m4_include([../../configure-common.ac])
|
||||
AM_INIT_AUTOMAKE(foreign)
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
m4_include([../configure-plugins.ac])
|
||||
|
||||
PGSQL_BUILD=1
|
||||
AC_ARG_WITH(pgsql,
|
||||
[ --with-pgsql[=DIR] PostgreSQL development library],dnl
|
||||
[if test "$withval" != "no"; then
|
||||
if test "$withval" != "yes"; then
|
||||
PGSQLROOT=$withval
|
||||
LDFLAGS="${LDFLAGS} -L$PGSQLROOT/lib"
|
||||
CPPFLAGS="${CPPFLAGS} -I$PGSQLROOT/include"
|
||||
fi
|
||||
else
|
||||
PGSQL_BUILD=0
|
||||
fi],
|
||||
)
|
||||
AC_CHECK_FUNCS(poptGetContext,,
|
||||
[AC_CHECK_LIB(popt,poptGetContext,,[AC_MSG_WARN([No popt development environment found, not building this plugin]) && PGSQL_BUILD=0])])
|
||||
if test "$PGSQL_BUILD" != "0"; then
|
||||
AC_CHECK_FUNCS(PQconnectdb, ,
|
||||
[AC_CHECK_LIB(pq,PQconnectdb,,
|
||||
[AC_MSG_WARN([No PostgreSQL development environment found, not building this plugin]) && PGSQL_BUILD=0])])
|
||||
fi
|
||||
AC_CHECK_HEADER([libpq-fe.h],,
|
||||
[AC_CHECK_HEADER([postgresql/libpq-fe.h],AC_DEFINE(POSTGRESQL_PREFIX,1,[Define if you need to include postgresql/libpq-fe.h, not just libpq-fe.h]),
|
||||
[AC_MSG_WARN([No PostgreSQL header found, not building this plugin]) && PGSQL_BUILD=0])])
|
||||
AM_CONDITIONAL(PGSQLBUILD, test "$PGSQL_BUILD" = 1)
|
||||
AC_OUTPUT(Makefile)
|
||||
|
@ -0,0 +1,53 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH ECHOPING_POSTGRESQL 1 "May 26, 2004"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
.\" .nh disable hyphenation
|
||||
.\" .hy enable hyphenation
|
||||
.\" .ad l left justify
|
||||
.\" .ad b justify to both left and right margins
|
||||
.\" .nf disable filling
|
||||
.\" .fi enable filling
|
||||
.\" .br insert line break
|
||||
.\" .sp <n> insert n+1 empty lines
|
||||
.\" for manpage-specific macros, see man(7)
|
||||
.SH NAME
|
||||
echoping_postgresql \- echoping plugin which connects to a PostgreSQL RDBMS server
|
||||
.SH SYNOPSIS
|
||||
.B echoping
|
||||
.RI [echoping\ options]
|
||||
.RI -m\ postgresql
|
||||
.B hostname
|
||||
.RI [-c conninfo]
|
||||
.RI [-e]
|
||||
.RI [-r]
|
||||
.RI [SQL-request]
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
|
||||
.\" respectively.
|
||||
postgresql is an echoping plugin to connect to PostgreSQL RDBMS servers.
|
||||
.SH ARGUMENTS
|
||||
.B [SQL-request]
|
||||
The request to the PostgreSQL server (in SQL). Only SELECT are
|
||||
supported. The default is 'SELECT now()'.
|
||||
.TP
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-c, \-\-conninfo
|
||||
Connection information for the Postgresql server. Something like 'dbname=bar'
|
||||
.TP
|
||||
.B \-r, \-\-readall
|
||||
Read all the data sent by the Postgresql server
|
||||
.TP
|
||||
.B \-e, \-\-connect-each-time
|
||||
(Re)connect to the Postgresql server at each iteration
|
||||
.SH SEE ALSO
|
||||
.BR echoping (1),
|
||||
.SH AUTHOR
|
||||
Stephane Bortzmeyer <bortz@users.sourceforge.net>
|
@ -0,0 +1,143 @@
|
||||
/*
|
||||
* PostgreSQL plugin.
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define IN_PLUGIN
|
||||
#include "../../echoping.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef POSTGRESQL_PREFIX
|
||||
#include <postgresql/libpq-fe.h>
|
||||
#else
|
||||
#include <libpq-fe.h>
|
||||
#endif
|
||||
|
||||
const char *request = NULL;
|
||||
int readall = FALSE;
|
||||
int connect_each_time = FALSE;
|
||||
poptContext postgresql_poptcon;
|
||||
PGconn *conn;
|
||||
PGresult *res;
|
||||
char *conninfo;
|
||||
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);
|
||||
}
|
||||
|
||||
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 */
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
void
|
||||
terminate()
|
||||
{
|
||||
if (!connect_each_time)
|
||||
PQfinish(conn);
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
pkglib_LTLIBRARIES = random.la
|
||||
random_la_SOURCES = random.c
|
||||
random_la_LDFLAGS = -module
|
||||
man_MANS = echoping_random.1
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
@ -0,0 +1,12 @@
|
||||
dnl $Id$
|
||||
|
||||
m4_include(../../configure-common.ac)
|
||||
AM_INIT_AUTOMAKE(foreign)
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
RANDOM_BUILD=1
|
||||
|
||||
AC_CHECK_FUNCS(usleep,, [AC_MSG_WARN([No usleep() found, not building this plugin]) && RANDOM_BUILD=0])
|
||||
AC_SUBST(RANDOM_BUILD,$RANDOM_BUILD)
|
||||
AC_OUTPUT(Makefile)
|
||||
|
@ -0,0 +1,36 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH ECHOPING_RANDOM 1 "May 26, 2004"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
.\" .nh disable hyphenation
|
||||
.\" .hy enable hyphenation
|
||||
.\" .ad l left justify
|
||||
.\" .ad b justify to both left and right margins
|
||||
.\" .nf disable filling
|
||||
.\" .fi enable filling
|
||||
.\" .br insert line break
|
||||
.\" .sp <n> insert n+1 empty lines
|
||||
.\" for manpage-specific macros, see man(7)
|
||||
.SH NAME
|
||||
echoping_random \- echoping plugin which just sleeps a random time
|
||||
.SH SYNOPSIS
|
||||
.B echoping
|
||||
.RI [echoping\ options]
|
||||
.RI -m\ random
|
||||
.B hostname
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
|
||||
.\" respectively.
|
||||
random is a dummy echoping plugin, made only for demo purposes.
|
||||
.SH OPTIONS
|
||||
No options
|
||||
.SH SEE ALSO
|
||||
.BR echoping (1),
|
||||
.SH AUTHOR
|
||||
Stephane Bortzmeyer <bortz@users.sourceforge.net>
|
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Pseudo-random plugin. Just an example.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
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
|
||||
*/
|
||||
}
|
||||
|
||||
void
|
||||
start()
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
execute()
|
||||
{
|
||||
usleep(rand() % 1000000);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
terminate()
|
||||
{
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
CONFIGURE_DEPENDENCIES=../../configure-common.ac ../configure-plugins.ac
|
||||
|
||||
pkglib_LTLIBRARIES = whois.la
|
||||
whois_la_SOURCES = whois.c
|
||||
whois_la_LDFLAGS = -module
|
||||
man_MANS = echoping_whois.1
|
||||
|
||||
EXTRA_DIST = $(man_MANS) test.sh
|
@ -0,0 +1,14 @@
|
||||
dnl $Id$
|
||||
|
||||
m4_include([../../configure-common.ac])
|
||||
AM_INIT_AUTOMAKE(foreign)
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
m4_include([../configure-plugins.ac])
|
||||
|
||||
WHOIS_BUILD=1
|
||||
AC_CHECK_FUNCS(poptGetContext,,
|
||||
[AC_CHECK_LIB(popt,poptGetContext,,[AC_MSG_WARN([No popt development environment found, not building this plugin]) && WHOIS_BUILD=0])])
|
||||
AC_SUBST(WHOIS_BUILD,$WHOIS_BUILD)
|
||||
AC_OUTPUT(Makefile)
|
||||
|
@ -0,0 +1,45 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH ECHOPING_WHOIS 1 "May 26, 2004"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
.\" .nh disable hyphenation
|
||||
.\" .hy enable hyphenation
|
||||
.\" .ad l left justify
|
||||
.\" .ad b justify to both left and right margins
|
||||
.\" .nf disable filling
|
||||
.\" .fi enable filling
|
||||
.\" .br insert line break
|
||||
.\" .sp <n> insert n+1 empty lines
|
||||
.\" for manpage-specific macros, see man(7)
|
||||
.SH NAME
|
||||
echoping_whois \- echoping plugin which connects to a whois server
|
||||
.SH SYNOPSIS
|
||||
.B echoping
|
||||
.RI [echoping\ options]
|
||||
.RI -m\ whois
|
||||
.B hostname
|
||||
.RI [-d]
|
||||
.RI request
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
|
||||
.\" respectively.
|
||||
whois is an echoping plugin to connect to whois/nicname servers (see
|
||||
RFC 3912).
|
||||
.SH ARGUMENTS
|
||||
.TP
|
||||
.B request
|
||||
The request to the whois server (typically a domain name)
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-d, \-\-dump
|
||||
Dumps the result of the request
|
||||
.SH SEE ALSO
|
||||
.BR echoping (1),
|
||||
.SH AUTHOR
|
||||
Stephane Bortzmeyer <bortz@users.sourceforge.net>
|
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $Id$
|
||||
|
||||
../../echoping -m whois -v whois.nic.fr --dump echoping.fr # Does not exist
|
||||
../../echoping -m whois -v whois.nic.fr --dump nic.fr # Exists
|
@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Whois (RFC 3912) plugin.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define IN_PLUGIN
|
||||
#include "../../echoping.h"
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define MAX_REQUEST 256
|
||||
|
||||
struct addrinfo whois_server;
|
||||
char *hostname;
|
||||
const char *request = NULL;
|
||||
int dump = FALSE;
|
||||
int n;
|
||||
int sockfd;
|
||||
FILE *files = NULL;
|
||||
poptContext whois_poptcon;
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
};
|
||||
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";
|
||||
}
|
||||
|
||||
void
|
||||
start(struct addrinfo *res)
|
||||
{
|
||||
whois_server = *res;
|
||||
}
|
||||
|
||||
int
|
||||
execute()
|
||||
{
|
||||
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);
|
||||
#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");
|
||||
#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);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
close(sockfd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
terminate()
|
||||
{
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
# For developers only: use it only if you know about autotools.
|
||||
|
||||
set -e
|
||||
|
||||
# Does *not* work with automake 1.4!
|
||||
aclocal
|
||||
autoheader
|
||||
libtoolize --force
|
||||
automake --add-missing
|
||||
autoconf
|
||||
cd plugins
|
||||
aclocal
|
||||
automake --foreign --add-missing
|
||||
autoconf
|
||||
for dir in dns random whois ldap postgresql; do
|
||||
cd $dir
|
||||
aclocal
|
||||
autoheader
|
||||
automake --foreign --add-missing
|
||||
autoconf
|
||||
cd ..
|
||||
done
|
||||
cd ..
|
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $Id$
|
||||
|
||||
echo ""
|
||||
echo "Since this tests tries remote servers, a failure is not always "
|
||||
echo " echoping's fault: it may be a network problem."
|
||||
echo ""
|
||||
echo "For this specific test, you *must* set the locale to UTF-8. It is system-"
|
||||
echo "dependent but you typically 'export LC_CTYPE=xx_XX.utf8' or "
|
||||
echo "'export CHARSET=utf8', depending on your system. 'locale -a' to get"
|
||||
echo "possible values."
|
||||
|
||||
./echoping -h / -v café.gennic.net
|
||||
./echoping -h / -v www.trườngđạihọcbáchkhoahànội.edu.vn
|
||||
./echoping -h / -v www.müller.ch
|
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $Id$
|
||||
|
||||
echo ""
|
||||
echo "Since this tests tries remote servers, a failure is not always "
|
||||
echo " echoping's fault: it may be a network problem."
|
||||
echo ""
|
||||
|
||||
for plugin in `ls plugins`; do
|
||||
if [ -d plugins/$plugin ]; then
|
||||
cd plugins/$plugin
|
||||
if [ -x ./test.sh ]; then
|
||||
echo "Testing $plugin..."
|
||||
sh ./test.sh
|
||||
echo ""
|
||||
fi
|
||||
cd ../..
|
||||
fi
|
||||
done
|
@ -0,0 +1,7 @@
|
||||
#use wml::template Title="echoping donations"
|
||||
|
||||
<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 :-)
|
||||
|
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
PATH=/bin:/usr/bin:/usr/local/bin
|
||||
|
||||
DELAY=`echoping -n 3 -h /tests/bidon www.netaktiv.com | \
|
||||
grep Median | \
|
||||
awk '{print int ($3 * 1000)}' `
|
||||
echo $DELAY
|
||||
echo $DELAY
|
||||
|
||||
UPTIME=`wget -O - -q http://www.netaktiv.com/server-status | \
|
||||
grep uptime | \
|
||||
awk -F: '{print $2}' | sed 's/<br>//' `
|
||||
|
||||
echo $UPTIME
|
||||
echo Web server
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,755 @@
|
||||
{"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 <ketil@froyn.name>",
|
||||
"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 <ketil@froyn.name>",
|
||||
"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 < 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 <ketil@froyn.name>\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 <number> 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> Wait for the greeting before\r\n> 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\\)\" <J.P.Moelaert@utwente.nl>. 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<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>\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 <a href=\"http://gosjohgbbzhk.com/\">gosjohgbbzhk</a>, \\[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 <a href=\"http://owhoajeejjei.com/\">owhoajeejjei</a>, \\[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…
Reference in New Issue