--------------------- PatchSet 5978 Date: 2007/10/17 11:25:49 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Add some documentation to ICMP methods. Members: src/ICMP.h:1.1.2.7->1.1.2.8 src/tests/testICMP.h:1.1.2.1->1.1.2.2 Index: squid3/src/ICMP.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICMP.h,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -r1.1.2.7 -r1.1.2.8 --- squid3/src/ICMP.h 16 Oct 2007 13:35:08 -0000 1.1.2.7 +++ squid3/src/ICMP.h 17 Oct 2007 11:25:49 -0000 1.1.2.8 @@ -1,5 +1,5 @@ /* - * $Id: ICMP.h,v 1.1.2.7 2007/10/16 13:35:08 amosjeffries Exp $ + * $Id: ICMP.h,v 1.1.2.8 2007/10/17 11:25:49 amosjeffries Exp $ * * DEBUG: section 37 ICMP Routines * AUTHOR: Duane Wessels, Amos Jeffries @@ -112,7 +112,15 @@ #if USE_ICMP - /// Construct ECHO request + /** + * Construct and Send an ECHO request + * + \param to Destination address being 'pinged' + \param opcode Specific code for ECHO request, see RFC ????. + \param payload A payload MAY be sent in the ICMP message. + * Content longer than MAX_PAYLOAD will be truncated. + \param len Length of the payload in bytes if any is to be sent. + */ virtual void SendEcho(IPAddress &to, int opcode, const char *payload, int len) =0; /// Handle ICMP responses. @@ -124,7 +132,19 @@ /// Calculate a packet checksum int CheckSum(unsigned short *ptr, int size); - /// calculate the hop-count from packet TTL + /** + * Translate TTL to a hop distance + * + \param ttl negative : n > 33 + \param ttl n(0...32) : 32 >= n >= 1 + \param ttl n(33...62) : 32 >= n >= 1 + \param ttl n(63...128) : 64 >= n >= 1 + \param ttl n(129...192) : 64 >= n >= 1 + \param ttl n(193...) : n < 255 + * + \bug BUG? ttl<0 can produce high hop values + \bug BUG? ttl>255 can produce zero or negative hop values + */ int ipHops(int ttl); /// Log the packet. Index: squid3/src/tests/testICMP.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/Attic/testICMP.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- squid3/src/tests/testICMP.h 17 Oct 2007 10:24:07 -0000 1.1.2.1 +++ squid3/src/tests/testICMP.h 17 Oct 2007 11:25:49 -0000 1.1.2.2 @@ -1,4 +1,3 @@ - #ifndef SQUID_SRC_TEST_URL_H #define SQUID_SRC_TEST_URL_H