IPv6-QUESTION ON SQUID MIB.TXT TABLE

From: Rafael Martinez \(Squid development\) <rmartine@dont-contact.us>
Date: Tue, 09 Oct 2007 13:23:59 +0200

Hi:
Before commit any change, I ask for help.

The file mib.txt under src, describes the MIB tree for Squid.

For incoming IPv6 Squid server, we must import a new MIB definition to
deal with IPv6 addresses.

IMPORTS
        enterprises, Unsigned32, TimeTicks, Gauge32, Counter32,
        MODULE-IDENTITY, OBJECT-TYPE
                FROM SNMPv2-SMI

        DisplayString
                FROM SNMPv2-TC

        Ipv6Address
                FROM IPV6-TC; -- This is already commit.

------------------------------------------------------------------------------

Theses are two IP-related OIDs in actual SQUID MIB.

    cachePeerAddr IpAddress,
    cacheClientAddr IpAddress,

The question:

1) If we get an IPv6 Squid server:
        1a)- should these OIDS be _modified_ to hold IPv6 addreeses ? or
        1b)- should be _added_ new OIDS to hold IPv6 addresses
                (i.e., cachePeerAddr6, cacheClientAddr6)

HINTS:

2) Pre-processor techniques (#ifdef IPv6) are not allowed in the mib.txt
grammar file and IpAddress-Ipv6Address formats are incompatible. So if
we want to keep original squid "--disable-ipv6", 1b) is the choice.

In my opinion, 1b) is the right choice. However, snmp_agent must be
reprogrammed acordingly.

 It should NOT answer when asked either for IpAddress-OID and the IP is
not IPv4 and viceversa: NOT answer when asked for Ipv6Addr when the IP
is IPv4 (though it can be IPv6 mapped!).

Amos ?

   case MESH_PTBL_IP:
        if (laddr.IsIPv4()) {
            struct in_addr iaddr4;
            laddr.GetInAddr(iaddr4);
            Answer = snmp_var_new_integer(Var->name, Var->name_length,
                                          (snint) iaddr4.s_addr,
SMI_IPADDRESS);
        }
        break;
/* Added enumerated type to process cachePeerAddr6 */
   case MESH_PTBL_IPv6:
        if (laddr.IsIPv6()) {{
            Answer = snmp_var_new(Var->name, Var->name_length);
            Answer->type = ASN_OCTET_STR;
            Answer->val_len = sizeof(struct in6_addr);// Use a symbolic
constant.
            struct in6_addr *iaddr6 = (struct in6_addr
*)Answer->val.string;
            laddr.GetInAddr(*iaddr6);
        }
        break;
Received on Tue Oct 09 2007 - 04:23:46 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Oct 30 2007 - 13:00:03 MDT