bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-inetutils] Restoration of ping.


From: Mats Erik Andersson
Subject: Re: [bug-inetutils] Restoration of ping.
Date: Wed, 2 May 2012 13:11:28 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

onsdag den  2 maj 2012 klockan 01:58 skrev Alfred M. Szmidt detta:
>       Just tell me why on earth `libicmp/icmp.h' was ever written
>       in the form it exists today. It differs from <netinet/ip_icmp.h>
>       in more than forty macros alone. Backwards is really the nicest
>       thing I can express about that construct. I have just begun
>       the process of adapting our source files to fit the official
>       header file <netinet/ip_icmp.h>, thus abondoning `libicmp/icmp.h'.
> 
>    ip_icmp.h isn't a standardised header though.  I'm not sure about
>    rewriting ping/etc to use this over icmp.h; 
> 
> (which means; lemme think about it for a few days, and feel free to
> add arguments for the change in the mean time)

How can you tell that <netinet/ip.h> be standardised, while
<netinet/ip_icmp.h> no be so? Can you name me a libc implemen-
tation where <netinet/ip_icmp.h> is broken from your viewpoint?

Well, OpenSolaris, NetBSD, OpenBSD, FreeBSD, and DragonFly BSD are
in agreement of using "struct icmp" and all macro names, save that
the BSDs might add a few beyond ICMP_MAXTYPE. Some small disagreement
on n_short/uint16_t and n_time/uint32_t exists, though.

Then comes Glibc along, keeps all of the above, adds a complete and
disjoint set of macros, and duplicates the old structure as
'struct icmphdr'. Chicken race, if I ever saw one!

One major problem is that the help text and info text for "ping"
is naming the ICMP message types according to Glibc, and this is
not what the literature or RFSs consider correct, thus impeding usage.

The changes needed to update macro names alone are as follows:

 doc/inetutils.texi       |   16 ++++++---
 libicmp/icmp.h           |   83 +++++++++++++++++++++++----------------------
 libicmp/icmp_address.c   |    2 +-
 libicmp/icmp_timestamp.c |    2 +-
 ping/libping.c           |   16 ++++----
 ping/ping.c              |    9 +++--
 ping/ping_address.c      |    4 +-
 ping/ping_echo.c         |   65 ++++++++++++++++++------------------
 ping/ping_timestamp.c    |    2 +-
 src/traceroute.c         |   14 ++++----
 10 files changed, 112 insertions(+), 101 deletions(-)

This compiles on OpenSolaris, *BSD, and SysRescueCD.

For reference I append the changes needed for 'libicmp/icmp.h'.


Best regards,
  Mats E A



reply via email to

[Prev in Thread] Current Thread [Next in Thread]