[AGENT++] IPv4 vs IPv6 difference?

Jochen Katz katz at agentpp.com
Fri Nov 11 21:37:26 CET 2005


Hi,

> for them we have to convert everything to support IPv6. Since Agent++
> supports the IPv6, I believe that I would just need to recompile
> everything with the SNMP_PP_IPv6 defined and I will have the support.

this is right in theory, because there aren't many people using snmp++
with IPv6.

If you want to send notifications you have to define
USE_LISTEN_ADDRESS_FOR_SENDING_TRAPS, as otherwise
SnmpRequest::get_new_snmp() will just create a Snmpx object through
Snmpx(status, 0) which defaults to IPv4.

If you're using add_vX_trap_destination(), you have to apply the patch
below.

Regards,
  Jochen


diff -u -r1.9 notification_originator.cpp
--- notification_originator.cpp 20 Mar 2005 19:42:22 -0000      1.9
+++ notification_originator.cpp 11 Nov 2005 20:34:50 -0000
@@ -483,7 +483,7 @@
        OctetStr tag("v1trap");
        OctetStr address;
        IpAddress ip(addr);
-       for (int i=0; i<4; i++) {
+       for (int i=0; i<addr.get_length()-2; i++) {
                address += (unsigned char)ip[i];
        }
        address += (addr.get_port() >> 8);
@@ -519,7 +519,7 @@
        OctetStr tag("v2trap");
        OctetStr address;
        IpAddress ip(addr);
-       for (int i=0; i<4; i++) {
+       for (int i=0; i<addr.get_length()-2; i++) {
                address += (unsigned char)ip[i];
        }
        address += (addr.get_port() >> 8);
@@ -554,7 +554,7 @@
        OctetStr tag("v3trap");
        OctetStr address;
        IpAddress ip(addr);
-       for (int i=0; i<4; i++) {
+       for (int i=0; i<i<addr.get_length()-2; i++) {
                address += (unsigned char)ip[i];
        }
        address += (addr.get_port() >> 8);



More information about the AGENTPP mailing list