[AGENT++] IPv4/IPv6 support for Agent++
Neil Gendzwill
gendzwil at sedsystems.ca
Fri Aug 8 00:58:47 CEST 2014
We would like to support requests from both IPv4 and IPv6 clients in a
dual-stack Linux environment (SL 6, if it matters).
Our current code uses the Agent++ class Snmpx, which inherits from the
Snmp++ class Snmp.
The Snmp class allows support for IPv6 by either setting a flag in one
of the constructors or using a constructor with two UDP addresses. From
uxsnmp.h:
Snmp(int &status, const unsigned short port = 0, const bool bind_ipv6 =
false); // Source code shows this support is either/or depending on
bind_ipv6
Snmp(int &status, const UdpAddress&
addr); // Again,
either/or depending on contents of addr
Snmp(int &status, const UdpAddress& addr_v4, const UdpAddress&
addr_v6); // This constructor supports both
However, Snmpx only supports the first two constructors and does not
support the dual address constructor. It also defaults bind_ipv6 in the
first constructor to false. On the surface of it, seems like it
supports only one protocol or the other. From snmp_pp_ext.h:
Snmpx(int &status, u_short port): Snmp(status, port) {}
Snmpx(int &status, const NS_SNMP UdpAddress& addr): Snmp( status, addr) {}
// 3rd Snmp constructor unsupported
How do I set up an agent that listens to requests in either protocol?
Or do I need two agents?
Regards,
Neil Gendzwill
SED Systems
Saskatoon, Canada
More information about the AGENTPP
mailing list