summaryrefslogtreecommitdiff
path: root/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib')
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp.h30
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_common.c142
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_linux.c194
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress.h30
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_common.c430
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c596
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h44
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c338
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.h22
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_common.h29
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_linux.c79
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats.h30
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_common.c389
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_linux.c376
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable.h8
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c1818
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h413
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h161
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c619
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h84
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c1994
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c673
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h316
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h139
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c353
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h76
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c1038
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h98
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c2426
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h457
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h213
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c708
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h79
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c2062
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h100
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable.h8
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c3182
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h1205
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h159
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c446
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h105
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c1363
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h173
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.c153
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.h7
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c956
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h275
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_constants.h81
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c302
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.h71
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c1308
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.h106
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c202
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c1418
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h970
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_constants.h104
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.c390
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.h92
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c1390
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.h178
65 files changed, 31331 insertions, 0 deletions
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp.h
new file mode 100644
index 0000000000..1fcc67f4d9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp.h
@@ -0,0 +1,30 @@
+/*
+ * arp data access header
+ *
+ * $Id: arp.h 13310 2005-10-29 03:31:29Z rstory $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * configure required files
+ *
+ * Notes:
+ *
+ * 1) prefer functionality over platform, where possible. If a method
+ * is available for multiple platforms, test that first. That way
+ * when a new platform is ported, it won't need a new test here.
+ *
+ * 2) don't do detail requirements here. If, for example,
+ * HPUX11 had different reuirements than other HPUX, that should
+ * be handled in the *_hpux.h header file.
+ */
+config_require(ip-mib/data_access/arp_common)
+#if defined( linux )
+config_require(ip-mib/data_access/arp_linux)
+#else
+/*
+ * couldn't determine the correct file!
+ * require a bogus file to generate an error.
+ */
+config_require(ip-mib/data_access/arp-unknown-arch)
+#endif
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_common.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_common.c
new file mode 100644
index 0000000000..e8795f9904
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_common.c
@@ -0,0 +1,142 @@
+/*
+ * Arp MIB architecture support
+ *
+ * $Id: arp_common.c 13920 2005-12-11 17:55:01Z rstory $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/arp.h>
+
+/**---------------------------------------------------------------------*/
+/*
+ * local static prototypes
+ */
+static void _access_arp_entry_release(netsnmp_arp_entry * entry,
+ void *unused);
+
+/**---------------------------------------------------------------------*/
+/*
+ * external per-architecture functions prototypes
+ *
+ * These shouldn't be called by the general public, so they aren't in
+ * the header file.
+ */
+extern int
+netsnmp_access_arp_container_arch_load(netsnmp_container* container,
+ u_int load_flags);
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * container functions
+ */
+/**
+ */
+netsnmp_container *
+netsnmp_access_arp_container_init(u_int flags)
+{
+ netsnmp_container *container1;
+
+ DEBUGMSGTL(("access:arp:container", "init\n"));
+
+ /*
+ * create the containers. one indexed by ifIndex, the other
+ * indexed by ifName.
+ */
+ container1 = netsnmp_container_find("access_arp:table_container");
+ if (NULL == container1)
+ return NULL;
+ return container1;
+}
+
+/**
+ * @retval NULL error
+ * @retval !NULL pointer to container
+ */
+netsnmp_container*
+netsnmp_access_arp_container_load(netsnmp_container* container, u_int load_flags)
+{
+ int rc;
+
+ DEBUGMSGTL(("access:arp:container", "load\n"));
+
+ if (NULL == container)
+ container = netsnmp_container_find("access:arp:table_container");
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_arp\n");
+ return NULL;
+ }
+
+ rc = netsnmp_access_arp_container_arch_load(container, load_flags);
+ if (0 != rc) {
+ netsnmp_access_arp_container_free(container,
+ NETSNMP_ACCESS_ARP_FREE_NOFLAGS);
+ container = NULL;
+ }
+
+ return container;
+}
+
+void
+netsnmp_access_arp_container_free(netsnmp_container *container, u_int free_flags)
+{
+ DEBUGMSGTL(("access:arp:container", "free\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container for netsnmp_access_arp_free\n");
+ return;
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_ARP_FREE_DONT_CLEAR)) {
+ /*
+ * free all items.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)_access_arp_entry_release,
+ NULL);
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_ARP_FREE_KEEP_CONTAINER))
+ CONTAINER_FREE(container);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * arp_entry functions
+ */
+/**
+ */
+netsnmp_arp_entry *
+netsnmp_access_arp_entry_create(void)
+{
+ netsnmp_arp_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_arp_entry);
+
+ entry->oid_index.len = 1;
+ entry->oid_index.oids = &entry->ns_arp_index;
+
+ return entry;
+}
+
+/**
+ */
+void
+netsnmp_access_arp_entry_free(netsnmp_arp_entry * entry)
+{
+ free(entry);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * Utility routines
+ */
+
+/**
+ */
+void
+_access_arp_entry_release(netsnmp_arp_entry * entry, void *context)
+{
+ netsnmp_access_arp_entry_free(entry);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_linux.c
new file mode 100644
index 0000000000..e1d20c1da9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_linux.c
@@ -0,0 +1,194 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id: arp_linux.c 16381 2007-05-17 21:53:28Z hardaker $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/arp.h>
+#include <net-snmp/data_access/interface.h>
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <net/if_arp.h>
+#include <arpa/inet.h>
+
+int _load_v4(netsnmp_container *container, int idx_offset);
+
+/**
+ */
+int
+netsnmp_access_arp_container_arch_load(netsnmp_container *container)
+{
+ int rc = 0, idx_offset = 0;
+
+ rc = _load_v4(container, idx_offset);
+ if(rc < 0) {
+ u_int flags = NETSNMP_ACCESS_ARP_FREE_KEEP_CONTAINER;
+ netsnmp_access_arp_container_free(container, flags);
+ return rc;
+ }
+
+#if defined (NETSNMP_ENABLE_IPV6) && 0 /* xx-rks: arp for v6? */
+ idx_offset = rc;
+
+ rc = _load_v6(container, idx_offset);
+ if(rc < 0) {
+ u_int flags = NETSNMP_ACCESS_ARP_FREE_KEEP_CONTAINER;
+ netsnmp_access_arp_container_free(container, flags);
+ }
+#endif
+
+ /*
+ * return no errors (0) if we found any interfaces
+ */
+ if(rc > 0)
+ rc = 0;
+
+ return rc;
+}
+
+/**
+ */
+int
+_load_v4(netsnmp_container *container, int idx_offset)
+{
+ FILE *in;
+ char line[128];
+ int rc = 0;
+ netsnmp_arp_entry *entry;
+
+ netsnmp_assert(NULL != container);
+
+#define PROCFILE "/proc/net/arp"
+ if (!(in = fopen(PROCFILE, "r"))) {
+ snmp_log(LOG_ERR,"could not open " PROCFILE "\n");
+ return -2;
+ }
+
+ /*
+ * Get rid of the header line
+ */
+ fgets(line, sizeof(line), in);
+
+ /*
+ * IP address | HW | Flag | HW address | Mask | Device
+ * 192.168.1.4 0x1 0x2 00:40:63:CC:1C:8C * eth0
+ */
+ while (fgets(line, sizeof(line), in)) {
+
+ int za, zb, zc, zd, ze, zf, zg, zh, zi, zj;
+ int tmp_flags;
+ char ifname[21];
+
+ rc = sscanf(line,
+ "%d.%d.%d.%d 0x%*x 0x%x %x:%x:%x:%x:%x:%x %*[^ ] %20s\n",
+ &za, &zb, &zc, &zd, &tmp_flags, &ze, &zf, &zg, &zh, &zi,
+ &zj, ifname);
+ if (12 != rc) {
+ snmp_log(LOG_ERR, PROCFILE " data format error (%d!=12)\n", rc);
+ snmp_log(LOG_ERR, " line ==|%s|\n", line);
+ continue;
+ }
+ DEBUGMSGTL(("access:arp:container",
+ "ip addr %d.%d.%d.%d, flags 0x%X, hw addr "
+ "%x:%x:%x:%x:%x:%x, name %s\n",
+ za,zb,zc,zd, tmp_flags, ze,zf,zg,zh,zi,zj, ifname ));
+
+ /*
+ */
+ entry = netsnmp_access_arp_entry_create();
+ if(NULL == entry) {
+ rc = -3;
+ break;
+ }
+
+ /*
+ * look up ifIndex
+ */
+ entry->if_index = netsnmp_access_interface_index_find(ifname);
+ if(0 == entry->if_index) {
+ snmp_log(LOG_ERR,"couldn't find ifIndex for '%s', skipping\n",
+ ifname);
+ netsnmp_access_arp_entry_free(entry);
+ continue;
+ }
+
+ /*
+ * now that we've passed all the possible 'continue', assign
+ * index offset.
+ */
+ entry->ns_arp_index = ++idx_offset;
+
+ /*
+ * parse ip addr
+ */
+ entry->arp_ipaddress[0] = za;
+ entry->arp_ipaddress[1] = zb;
+ entry->arp_ipaddress[2] = zc;
+ entry->arp_ipaddress[3] = zd;
+ entry->arp_ipaddress_len = 4;
+
+ /*
+ * parse hw addr
+ */
+ entry->arp_physaddress[0] = ze;
+ entry->arp_physaddress[1] = zf;
+ entry->arp_physaddress[2] = zg;
+ entry->arp_physaddress[3] = zh;
+ entry->arp_physaddress[4] = zi;
+ entry->arp_physaddress[5] = zj;
+ entry->arp_physaddress_len = 6;
+
+ /*
+ * what can we do with hw? from arp manpage:
+
+ default value of this parameter is ether (i.e. hardware code
+ 0x01 for IEEE 802.3 10Mbps Ethernet). Other values might
+ include network technologies such as ARCnet (arcnet) , PROnet
+ (pronet) , AX.25 (ax25) and NET/ROM (netrom).
+ */
+
+ /*
+ * parse mask
+ */
+ /* xxx-rks: what is mask? how to interpret '*'? */
+
+
+ /*
+ * process type
+ */
+ if(tmp_flags & ATF_PERM)
+ entry->arp_type = INETNETTOMEDIATYPE_STATIC;
+ else
+ entry->arp_type = INETNETTOMEDIATYPE_DYNAMIC;
+
+ /*
+ * process status
+ * if flags are 0, we can't tell the difference between
+ * stale or incomplete.
+ */
+ if(tmp_flags & ATF_COM)
+ entry->arp_state = INETNETTOMEDIASTATE_REACHABLE;
+ else
+ entry->arp_state = INETNETTOMEDIASTATE_UNKNOWN;
+
+ /*
+ * add entry to container
+ */
+ if (CONTAINER_INSERT(container, entry) < 0)
+ {
+ DEBUGMSGTL(("access:arp:container","error with arp_entry: insert into container failed.\n"));
+ netsnmp_access_arp_entry_free(entry);
+ continue;
+ }
+ }
+
+ fclose(in);
+ if( rc < 0 )
+ return rc;
+
+ return idx_offset;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress.h
new file mode 100644
index 0000000000..f1d471abb5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress.h
@@ -0,0 +1,30 @@
+/*
+ * ipaddress data access header
+ *
+ * $Id: ipaddress.h 13271 2005-10-28 15:29:23Z rstory $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * configure required files
+ *
+ * Notes:
+ *
+ * 1) prefer functionality over platform, where possible. If a method
+ * is available for multiple platforms, test that first. That way
+ * when a new platform is ported, it won't need a new test here.
+ *
+ * 2) don't do detail requirements here. If, for example,
+ * HPUX11 had different reuirements than other HPUX, that should
+ * be handled in the *_hpux.h header file.
+ */
+config_require(ip-mib/data_access/ipaddress_common)
+#if defined( linux )
+config_require(ip-mib/data_access/ipaddress_linux)
+#else
+/*
+ * couldn't determine the correct file!
+ * require a bogus file to generate an error.
+ */
+config_require(ip-mib/data_access/ipaddress-unknown-arch)
+#endif
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_common.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_common.c
new file mode 100644
index 0000000000..396fc96454
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_common.c
@@ -0,0 +1,430 @@
+/*
+ * Ipaddress MIB architecture support
+ *
+ * $Id: ipaddress_common.c 16724 2007-10-14 22:10:09Z magfr $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/ipaddress.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "ip-mib/ipAddressTable/ipAddressTable_constants.h"
+
+/**---------------------------------------------------------------------*/
+/*
+ * local static prototypes
+ */
+static int _access_ipaddress_entry_compare_addr(const void *lhs,
+ const void *rhs);
+static void _access_ipaddress_entry_release(netsnmp_ipaddress_entry * entry,
+ void *unused);
+
+/**---------------------------------------------------------------------*/
+/*
+ * external per-architecture functions prototypes
+ *
+ * These shouldn't be called by the general public, so they aren't in
+ * the header file.
+ */
+extern int
+netsnmp_arch_ipaddress_container_load(netsnmp_container* container,
+ u_int load_flags);
+extern int
+netsnmp_arch_ipaddress_entry_init(netsnmp_ipaddress_entry *entry);
+extern int
+netsnmp_arch_ipaddress_entry_copy(netsnmp_ipaddress_entry *lhs,
+ netsnmp_ipaddress_entry *rhs);
+extern void
+netsnmp_arch_ipaddress_entry_cleanup(netsnmp_ipaddress_entry *entry);
+extern int
+netsnmp_arch_ipaddress_create(netsnmp_ipaddress_entry *entry);
+extern int
+netsnmp_arch_ipaddress_delete(netsnmp_ipaddress_entry *entry);
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * container functions
+ */
+/**
+ */
+netsnmp_container *
+netsnmp_access_ipaddress_container_init(u_int flags)
+{
+ netsnmp_container *container1;
+
+ DEBUGMSGTL(("access:ipaddress:container", "init\n"));
+
+ /*
+ * create the containers. one indexed by ifIndex, the other
+ * indexed by ifName.
+ */
+ container1 = netsnmp_container_find("access_ipaddress:table_container");
+ if (NULL == container1) {
+ snmp_log(LOG_ERR, "ipaddress primary container not found\n");
+ return NULL;
+ }
+ container1->container_name = strdup("ia_index");
+
+ if (flags & NETSNMP_ACCESS_IPADDRESS_INIT_ADDL_IDX_BY_ADDR) {
+ netsnmp_container *container2 =
+ netsnmp_container_find("ipaddress_addr:access_ipaddress:table_container");
+ if (NULL == container2) {
+ snmp_log(LOG_ERR, "ipaddress secondary container not found\n");
+ CONTAINER_FREE(container1);
+ return NULL;
+ }
+
+ container2->compare = _access_ipaddress_entry_compare_addr;
+ container2->container_name = strdup("ia_addr");
+
+ netsnmp_container_add_index(container1, container2);
+ }
+
+ return container1;
+}
+
+/**
+ * @retval NULL error
+ * @retval !NULL pointer to container
+ */
+netsnmp_container*
+netsnmp_access_ipaddress_container_load(netsnmp_container* container,
+ u_int load_flags)
+{
+ int rc;
+ u_int container_flags = 0;
+
+ DEBUGMSGTL(("access:ipaddress:container", "load\n"));
+
+ if (NULL == container) {
+ if (load_flags & NETSNMP_ACCESS_IPADDRESS_LOAD_ADDL_IDX_BY_ADDR)
+ container_flags |= NETSNMP_ACCESS_IPADDRESS_INIT_ADDL_IDX_BY_ADDR;
+ container = netsnmp_access_ipaddress_container_init(container_flags);
+ }
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_ipaddress\n");
+ return NULL;
+ }
+
+ rc = netsnmp_arch_ipaddress_container_load(container, load_flags);
+ if (0 != rc) {
+ netsnmp_access_ipaddress_container_free(container,
+ NETSNMP_ACCESS_IPADDRESS_FREE_NOFLAGS);
+ container = NULL;
+ }
+
+ return container;
+}
+
+void
+netsnmp_access_ipaddress_container_free(netsnmp_container *container, u_int free_flags)
+{
+ DEBUGMSGTL(("access:ipaddress:container", "free\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container for netsnmp_access_ipaddress_free\n");
+ return;
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_IPADDRESS_FREE_DONT_CLEAR)) {
+ /*
+ * free all items.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)_access_ipaddress_entry_release,
+ NULL);
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_IPADDRESS_FREE_KEEP_CONTAINER))
+ CONTAINER_FREE(container);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * ipaddress_entry functions
+ */
+/**
+ */
+/**
+ */
+netsnmp_ipaddress_entry *
+netsnmp_access_ipaddress_entry_create(void)
+{
+ netsnmp_ipaddress_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_ipaddress_entry);
+ int rc = 0;
+
+ entry->oid_index.len = 1;
+ entry->oid_index.oids = &entry->ns_ia_index;
+
+ /*
+ * set up defaults
+ */
+ entry->ia_type = IPADDRESSTYPE_UNICAST;
+ entry->ia_status = IPADDRESSSTATUSTC_PREFERRED;
+ entry->ia_storagetype = STORAGETYPE_VOLATILE;
+
+ rc = netsnmp_arch_ipaddress_entry_init(entry);
+ if (SNMP_ERR_NOERROR != rc) {
+ DEBUGMSGT(("access:ipaddress:create","error %d in arch init\n", rc));
+ netsnmp_access_ipaddress_entry_free(entry);
+ entry = NULL;
+ }
+
+ return entry;
+}
+
+/**
+ */
+void
+netsnmp_access_ipaddress_entry_free(netsnmp_ipaddress_entry * entry)
+{
+ if (NULL == entry)
+ return;
+
+ if (NULL != entry->arch_data)
+ netsnmp_arch_ipaddress_entry_cleanup(entry);
+
+ free(entry);
+}
+
+/**
+ * update underlying data store (kernel) for entry
+ *
+ * @retval 0 : success
+ * @retval -1 : error
+ */
+int
+netsnmp_access_ipaddress_entry_set(netsnmp_ipaddress_entry * entry)
+{
+ int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == entry) {
+ netsnmp_assert(NULL != entry);
+ return -1;
+ }
+
+ /*
+ * make sure interface and ifIndex match up
+ */
+ if (NULL == netsnmp_access_interface_name_find(entry->if_index)) {
+ DEBUGMSGT(("access:ipaddress:set", "cant find name for index %d\n",
+ entry->if_index));
+ return -1;
+ }
+
+ /*
+ * don't support non-volatile yet
+ */
+ if (STORAGETYPE_VOLATILE != entry->ia_storagetype) {
+ DEBUGMSGT(("access:ipaddress:set",
+ "non-volatile storagetypes unsupported\n"));
+ return -1;
+ }
+
+ /*
+ *
+ */
+ rc = -1;
+ if (entry->flags & NETSNMP_ACCESS_IPADDRESS_CREATE) {
+ rc = netsnmp_arch_ipaddress_create(entry);
+ }
+ else if (entry->flags & NETSNMP_ACCESS_IPADDRESS_CHANGE) {
+ }
+ else if (entry->flags & NETSNMP_ACCESS_IPADDRESS_DELETE) {
+ rc = netsnmp_arch_ipaddress_delete(entry);
+ }
+ else {
+ snmp_log(LOG_ERR,"netsnmp_access_ipaddress_entry_set with no mode\n");
+ netsnmp_assert(!"ipaddress_entry_set == unknown mode"); /* always false */
+ rc = -1;
+ }
+
+ return rc;
+}
+
+/**
+ * update an old ipaddress_entry from a new one
+ *
+ * @note: only mib related items are compared. Internal objects
+ * such as oid_index, ns_ia_index and flags are not compared.
+ *
+ * @retval -1 : error
+ * @retval >=0 : number of fields updated
+ */
+int
+netsnmp_access_ipaddress_entry_update(netsnmp_ipaddress_entry *lhs,
+ netsnmp_ipaddress_entry *rhs)
+{
+ int rc, changed = 0;
+
+ /*
+ * copy arch stuff. we don't care if it changed
+ */
+ rc = netsnmp_arch_ipaddress_entry_copy(lhs,rhs);
+ if (0 != rc) {
+ snmp_log(LOG_ERR,"arch ipaddress copy failed\n");
+ return -1;
+ }
+
+ if (lhs->if_index != rhs->if_index) {
+ ++changed;
+ lhs->if_index = rhs->if_index;
+ }
+
+ if (lhs->ia_storagetype != rhs->ia_storagetype) {
+ ++changed;
+ lhs->ia_storagetype = rhs->ia_storagetype;
+ }
+
+ if (lhs->ia_address_len != rhs->ia_address_len) {
+ changed += 2;
+ lhs->ia_address_len = rhs->ia_address_len;
+ memcpy(lhs->ia_address, rhs->ia_address, rhs->ia_address_len);
+ }
+ else if (memcmp(lhs->ia_address, rhs->ia_address, rhs->ia_address_len) != 0) {
+ ++changed;
+ memcpy(lhs->ia_address, rhs->ia_address, rhs->ia_address_len);
+ }
+
+ if (lhs->ia_type != rhs->ia_type) {
+ ++changed;
+ lhs->ia_type = rhs->ia_type;
+ }
+
+ if (lhs->ia_status != rhs->ia_status) {
+ ++changed;
+ lhs->ia_status = rhs->ia_status;
+ }
+
+ if (lhs->ia_origin != rhs->ia_origin) {
+ ++changed;
+ lhs->ia_origin = rhs->ia_origin;
+ }
+
+ return changed;
+}
+
+/**
+ * copy an ipaddress_entry
+ *
+ * @retval -1 : error
+ * @retval 0 : no error
+ */
+int
+netsnmp_access_ipaddress_entry_copy(netsnmp_ipaddress_entry *lhs,
+ netsnmp_ipaddress_entry *rhs)
+{
+ int rc;
+
+ /*
+ * copy arch stuff. we don't care if it changed
+ */
+ rc = netsnmp_arch_ipaddress_entry_copy(lhs,rhs);
+ if (0 != rc) {
+ snmp_log(LOG_ERR,"arch ipaddress copy failed\n");
+ return -1;
+ }
+
+ lhs->if_index = rhs->if_index;
+ lhs->ia_storagetype = rhs->ia_storagetype;
+ lhs->ia_address_len = rhs->ia_address_len;
+ memcpy(lhs->ia_address, rhs->ia_address, rhs->ia_address_len);
+ lhs->ia_type = rhs->ia_type;
+ lhs->ia_status = rhs->ia_status;
+ lhs->ia_origin = rhs->ia_origin;
+
+ return 0;
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * Utility routines
+ */
+
+/**
+ * copy the prefix portion of an ip address
+ */
+int
+netsnmp_ipaddress_prefix_copy(u_char *dst, u_char *src, int addr_len, int pfx_len)
+{
+ int bytes = pfx_len / 8;
+ int bits = pfx_len % 8;
+
+ if ((NULL == dst) || (NULL == src) || (0 == pfx_len))
+ return 0;
+
+ memcpy(dst, src, bytes);
+
+ if (bytes < addr_len)
+ memset(&dst[bytes],0x0, addr_len - bytes);
+
+ if (bits) {
+ u_char mask = (0xff << (8-bits));
+
+ dst[bytes] = (src[bytes] & mask);
+ }
+
+ return pfx_len;
+}
+
+
+/**
+ * copy the prefix portion of an ip address
+ *
+ * @param mask network byte order make
+ *
+ * @returns number of prefix bits
+ */
+int
+netsnmp_ipaddress_ipv4_prefix_len(in_addr_t mask)
+{
+ int len = 0;
+
+ while((0xff000000 & mask) == 0xff000000) {
+ len += 8;
+ mask = mask << 8;
+ }
+
+ while(0x80000000 & mask) {
+ ++len;
+ mask = mask << 1;
+ }
+
+ return len;
+}
+
+
+/**
+ */
+void
+_access_ipaddress_entry_release(netsnmp_ipaddress_entry * entry, void *context)
+{
+ netsnmp_access_ipaddress_entry_free(entry);
+}
+
+static int _access_ipaddress_entry_compare_addr(const void *lhs,
+ const void *rhs)
+{
+ const netsnmp_ipaddress_entry *lh = (const netsnmp_ipaddress_entry *)lhs;
+ const netsnmp_ipaddress_entry *rh = (const netsnmp_ipaddress_entry *)rhs;
+
+ netsnmp_assert(NULL != lhs);
+ netsnmp_assert(NULL != rhs);
+
+ /*
+ * compare address length
+ */
+ if (lh->ia_address_len < rh->ia_address_len)
+ return -1;
+ else if (lh->ia_address_len > rh->ia_address_len)
+ return 1;
+
+ /*
+ * length equal, compare address
+ */
+ return memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
new file mode 100644
index 0000000000..d5e78f06e1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
@@ -0,0 +1,596 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id: ipaddress_ioctl.c 16778 2008-01-17 00:09:33Z magfr $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "mibII/mibII_common.h"
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/ipaddress.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "ip-mib/ipAddressTable/ipAddressTable_constants.h"
+#include "if-mib/data_access/interface_ioctl.h"
+
+#include <errno.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
+
+#include "ipaddress_ioctl.h"
+
+static void _print_flags(short flags);
+
+#define LIST_TOKEN "ioctl_extras"
+
+/*
+ * get extra structure
+ *
+ * @returns the extras structure from the entry
+ */
+_ioctl_extras *
+netsnmp_ioctl_ipaddress_extras_get(netsnmp_ipaddress_entry *entry)
+{
+ if ((NULL == entry) || (NULL == entry->arch_data))
+ return NULL;
+
+ return netsnmp_get_list_data(entry->arch_data, LIST_TOKEN);
+}
+
+/**
+ * initialize ioctl extras
+ *
+ * @returns _ioctl_extras pointer, or NULL on error
+ */
+_ioctl_extras *
+netsnmp_ioctl_ipaddress_entry_init(netsnmp_ipaddress_entry *entry)
+{
+ netsnmp_data_list *node;
+ _ioctl_extras *extras;
+
+ if (NULL == entry)
+ return NULL;
+
+ extras = SNMP_MALLOC_TYPEDEF(_ioctl_extras);
+ if (NULL == extras)
+ return NULL;
+
+ node = netsnmp_create_data_list(LIST_TOKEN, extras, free);
+ if (NULL == node) {
+ free(extras);
+ return NULL;
+ }
+
+ netsnmp_data_list_add_node( &entry->arch_data, node );
+
+ return extras;
+}
+
+/**
+ * cleanup ioctl extras
+ */
+void
+netsnmp_ioctl_ipaddress_entry_cleanup(netsnmp_ipaddress_entry *entry)
+{
+ if (NULL == entry) {
+ netsnmp_assert(NULL != entry);
+ return;
+ }
+
+ if (NULL == entry->arch_data) {
+ netsnmp_assert(NULL != entry->arch_data);
+ return;
+ }
+
+ netsnmp_remove_list_node(&entry->arch_data, LIST_TOKEN);
+}
+
+/**
+ * copy ioctl extras
+ *
+ * @retval 0: success
+ * @retval <0: error
+ */
+int
+netsnmp_ioctl_ipaddress_entry_copy(netsnmp_ipaddress_entry *lhs,
+ netsnmp_ipaddress_entry *rhs)
+{
+ _ioctl_extras *lhs_extras, *rhs_extras;
+ int rc = SNMP_ERR_NOERROR;
+
+ if ((NULL == lhs) || (NULL == rhs)) {
+ netsnmp_assert((NULL != lhs) && (NULL != rhs));
+ return -1;
+ }
+
+ rhs_extras = netsnmp_ioctl_ipaddress_extras_get(rhs);
+ lhs_extras = netsnmp_ioctl_ipaddress_extras_get(lhs);
+ if (NULL == rhs_extras) {
+ if (NULL != lhs_extras)
+ netsnmp_ioctl_ipaddress_entry_cleanup(lhs);
+ }
+ else {
+ if (NULL == lhs_extras)
+ lhs_extras = netsnmp_ioctl_ipaddress_entry_init(lhs);
+
+ if (NULL != lhs_extras)
+ memcpy(lhs_extras, rhs_extras, sizeof(_ioctl_extras));
+ else
+ rc = -1;
+ }
+
+ return rc;
+}
+
+/**
+ * load ipv4 address via ioctl
+ */
+int
+_netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container,
+ int idx_offset)
+{
+ int i, sd, rc = 0, interfaces = 0;
+ struct ifconf ifc;
+ struct ifreq *ifrp;
+ struct sockaddr save_addr;
+ struct sockaddr_in * si;
+ netsnmp_ipaddress_entry *entry;
+ _ioctl_extras *extras;
+
+ if ((sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ snmp_log(LOG_ERR, "could not create socket\n");
+ return -1;
+ }
+
+ interfaces =
+ netsnmp_access_ipaddress_ioctl_get_interface_count(sd, &ifc);
+ if(interfaces < 0) {
+ close(sd);
+ return -2;
+ }
+ netsnmp_assert(NULL != ifc.ifc_buf);
+ DEBUGMSGTL(("access:ipaddress:container", "processing %d interfaces\n", interfaces));
+
+ ifrp = ifc.ifc_req;
+ for(i=0; i < interfaces; ++i, ++ifrp) {
+
+ DEBUGMSGTL(("access:ipaddress:container",
+ " interface %d, %s\n", i, ifrp->ifr_name));
+ /*
+ */
+ entry = netsnmp_access_ipaddress_entry_create();
+ if(NULL == entry) {
+ rc = -3;
+ break;
+ }
+ entry->ns_ia_index = ++idx_offset;
+
+ /*
+ * save if name
+ */
+ extras = netsnmp_ioctl_ipaddress_extras_get(entry);
+ memcpy(extras->name, ifrp->ifr_name, sizeof(extras->name));
+
+ /*
+ * each time we make an ioctl, we need to specify the address, but
+ * it will be overwritten in the call. so we save address here.
+ */
+ save_addr = ifrp->ifr_addr;
+
+ /*
+ * set indexes
+ */
+ netsnmp_assert(AF_INET == ifrp->ifr_addr.sa_family);
+ si = (struct sockaddr_in *) &ifrp->ifr_addr;
+ entry->ia_address_len = sizeof(si->sin_addr.s_addr);
+ memcpy(entry->ia_address, &si->sin_addr.s_addr,
+ entry->ia_address_len);
+
+ /*
+ * get ifindex
+ */
+ {
+ /*
+ * I think that Linux and Solaris both use ':' in the
+ * interface name for aliases. When a new arch is added
+ * that uses some other indicator, a new function, maybe
+ * netsnmp_access_ipaddress_entry_name_alias_check(), will
+ * need to be written.
+ */
+ char *ptr = strchr(ifrp->ifr_name, ':');
+ if (NULL != ptr) {
+ entry->flags |= NETSNMP_ACCESS_IPADDRESS_ISALIAS;
+ *ptr = 0;
+ }
+ }
+ entry->if_index =
+ netsnmp_access_interface_ioctl_ifindex_get(sd, ifrp->ifr_name);
+ if (0 == entry->if_index) {
+ snmp_log(LOG_ERR,"no ifindex found for interface\n");
+ netsnmp_access_ipaddress_entry_free(entry);
+ continue;
+ }
+
+ /* restore the interface name if we modifed it due to unaliasing
+ * above
+ */
+ if (entry->flags | NETSNMP_ACCESS_IPADDRESS_ISALIAS) {
+ memcpy(ifrp->ifr_name, extras->name, sizeof(extras->name));
+ }
+
+ /*
+ * get netmask
+ */
+ ifrp->ifr_addr = save_addr;
+ if (ioctl(sd, SIOCGIFNETMASK, ifrp) < 0) {
+ snmp_log(LOG_ERR,
+ "error getting netmask for interface %d\n", i);
+ netsnmp_access_ipaddress_entry_free(entry);
+ continue;
+ }
+ netsnmp_assert(AF_INET == ifrp->ifr_addr.sa_family);
+ si = (struct sockaddr_in *) &ifrp->ifr_addr;
+ entry->ia_prefix_len =
+ netsnmp_ipaddress_ipv4_prefix_len(si->sin_addr.s_addr);
+
+ /*
+ * get flags
+ */
+ ifrp->ifr_addr = save_addr;
+ if (ioctl(sd, SIOCGIFFLAGS, ifrp) < 0) {
+ snmp_log(LOG_ERR,
+ "error getting if_flags for interface %d\n", i);
+ netsnmp_access_ipaddress_entry_free(entry);
+ continue;
+ }
+ extras->flags = ifrp->ifr_flags;
+
+ entry->ia_type = IPADDRESSTYPE_UNICAST; /* assume unicast? */
+
+ /** entry->ia_prefix_oid ? */
+
+ /*
+ * per the MIB:
+ * In the absence of other information, an IPv4 address is
+ * always preferred(1).
+ */
+ entry->ia_status = IPADDRESSSTATUSTC_PREFERRED;
+
+ /*
+ * can we figure out if an address is from DHCP?
+ * use manual until then...
+ */
+ entry->ia_origin = IPADDRESSORIGINTC_MANUAL;
+
+ DEBUGIF("access:ipaddress:container") {
+ DEBUGMSGT_NC(("access:ipaddress:container",
+ " if %d: addr len %d, index 0x%x\n",
+ i, entry->ia_address_len, entry->if_index));
+ if (4 == entry->ia_address_len)
+ DEBUGMSGT_NC(("access:ipaddress:container", " address %p\n",
+ *((void**)entry->ia_address)));
+ DEBUGMSGT_NC(("access:ipaddress:container", "flags 0x%x\n",
+ extras->flags));
+ _print_flags(extras->flags);
+
+ }
+
+ /*
+ * add entry to container
+ */
+ if (CONTAINER_INSERT(container, entry) < 0)
+ {
+ DEBUGMSGTL(("access:ipaddress:container","error with ipaddress_entry: insert into container failed.\n"));
+ netsnmp_access_ipaddress_entry_free(entry);
+ continue;
+ }
+ }
+
+ /*
+ * clean up
+ */
+ free(ifc.ifc_buf);
+ close(sd);
+
+ /*
+ * return number of interfaces seen
+ */
+ if(rc < 0)
+ return rc;
+
+ return idx_offset;
+}
+
+/**
+ * find unused alias number
+ */
+static int
+_next_alias(const char *if_name)
+{
+ int i, j, k, sd, interfaces = 0, len;
+ struct ifconf ifc;
+ struct ifreq *ifrp;
+ char *alias;
+ int *alias_list;
+
+ if (NULL == if_name)
+ return -1;
+ len = strlen(if_name);
+
+ if ((sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ snmp_log(LOG_ERR, "could not create socket\n");
+ return -1;
+ }
+
+ interfaces =
+ netsnmp_access_ipaddress_ioctl_get_interface_count(sd, &ifc);
+ if(interfaces < 0) {
+ close(sd);
+ return -2;
+ }
+ netsnmp_assert(NULL != ifc.ifc_buf);
+ DEBUGMSGTL(("access:ipaddress:container", "processing %d interfaces\n", interfaces));
+
+ alias_list = malloc(interfaces * sizeof(int));
+ if (NULL == alias_list) {
+ close(sd);
+ return -2;
+ }
+
+ ifrp = ifc.ifc_req;
+ for(i=0,j=0; i < interfaces; ++i, ++ifrp) {
+
+ if (strncmp(ifrp->ifr_name, if_name, len) != 0)
+ continue;
+
+ DEBUGMSGTL(("access:ipaddress:container",
+ " interface %d, %s\n", i, ifrp->ifr_name));
+
+ alias = strchr(ifrp->ifr_name, ':');
+ if (NULL == alias)
+ continue;
+
+ ++alias; /* skip ':' */
+ alias_list[j++] = atoi(alias);
+ }
+
+ /*
+ * clean up
+ */
+ free(ifc.ifc_buf);
+ close(sd);
+
+ /*
+ * return first unused alias
+ */
+ for(i=1; i<=interfaces; ++i) {
+ for(k=0;k<j;++k)
+ if (alias_list[k] == i)
+ break;
+ if (k == j)
+ return i;
+ }
+
+ return interfaces + 1;
+}
+
+
+/**
+ *
+ * @retval 0 : no error
+ * @retval -1 : bad parameter
+ * @retval -2 : couldn't create socket
+ * @retval -3 : ioctl failed
+ */
+int
+_netsnmp_ioctl_ipaddress_set_v4(netsnmp_ipaddress_entry * entry)
+{
+ struct ifreq ifrq;
+ struct sockaddr_in *sin;
+ int rc, fd = -1;
+ _ioctl_extras *extras;
+
+ if (NULL == entry)
+ return -1;
+
+ netsnmp_assert(4 == entry->ia_address_len);
+
+ extras = netsnmp_ioctl_ipaddress_extras_get(entry);
+ if (NULL == extras)
+ return -1;
+
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if(fd < 0) {
+ snmp_log(LOG_ERR,"couldn't create socket\n");
+ return -2;
+ }
+ memset(&ifrq, 0, sizeof(ifrq));
+
+ if ('\0' == extras->name[0]) {
+ const char *name = netsnmp_access_interface_name_find(entry->if_index);
+ int alias_idx;
+
+ if (NULL == name) {
+ DEBUGMSGT(("access:ipaddress:set", "cant find name for index %d\n",
+ entry->if_index));
+ close(fd);
+ return -1;
+ }
+
+ /*
+ * search for unused alias
+ */
+ alias_idx = _next_alias(name);
+ snprintf(ifrq.ifr_name,sizeof(ifrq.ifr_name), "%s:%d",
+ name, alias_idx);
+ }
+ else
+ strncpy(ifrq.ifr_name, extras->name, sizeof(ifrq.ifr_name));
+
+ ifrq.ifr_name[ sizeof(ifrq.ifr_name)-1 ] = 0;
+
+ sin = (struct sockaddr_in*)&ifrq.ifr_addr;
+ sin->sin_family = AF_INET;
+ memcpy(&sin->sin_addr.s_addr, entry->ia_address,
+ entry->ia_address_len);
+
+ rc = ioctl(fd, SIOCSIFADDR, &ifrq);
+ close(fd);
+ if(rc < 0) {
+ snmp_log(LOG_ERR,"error setting address\n");
+ return -3;
+ }
+
+ return 0;
+}
+
+/**
+ *
+ * @retval 0 : no error
+ * @retval -1 : bad parameter
+ * @retval -2 : couldn't create socket
+ * @retval -3 : ioctl failed
+ */
+int
+_netsnmp_ioctl_ipaddress_delete_v4(netsnmp_ipaddress_entry * entry)
+{
+ struct ifreq ifrq;
+ int rc, fd = -1;
+ _ioctl_extras *extras;
+
+ if (NULL == entry)
+ return -1;
+
+ netsnmp_assert(4 == entry->ia_address_len);
+
+ extras = netsnmp_ioctl_ipaddress_extras_get(entry);
+ if (NULL == extras)
+ return -1;
+
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if(fd < 0) {
+ snmp_log(LOG_ERR,"couldn't create socket\n");
+ return -2;
+ }
+
+ memset(&ifrq, 0, sizeof(ifrq));
+
+ strncpy(ifrq.ifr_name, extras->name, sizeof(ifrq.ifr_name));
+ ifrq.ifr_name[ sizeof(ifrq.ifr_name)-1 ] = 0;
+
+ ifrq.ifr_flags = 0;
+
+ rc = ioctl(fd, SIOCSIFFLAGS, &ifrq);
+ close(fd);
+ if(rc < 0) {
+ snmp_log(LOG_ERR,"error deleting address\n");
+ return -3;
+ }
+
+ return 0;
+}
+
+/**
+ * get the interface count and populate the ifc_buf
+ *
+ * Note: the caller assumes responsbility for the ifc->ifc_buf
+ * memory, and should free() it when done.
+ *
+ * @retval -1 : malloc error
+ */
+int
+netsnmp_access_ipaddress_ioctl_get_interface_count(int sd, struct ifconf * ifc)
+{
+ int lastlen = 0, i;
+ struct ifconf ifc_tmp;
+
+ if (NULL == ifc) {
+ memset(&ifc_tmp, 0x0, sizeof(ifc_tmp));
+ ifc = &ifc_tmp;
+ }
+
+ /*
+ * Cope with lots of interfaces and brokenness of ioctl SIOCGIFCONF
+ * on some platforms; see W. R. Stevens, ``Unix Network Programming
+ * Volume I'', p.435.
+ */
+
+ for (i = 8;; i *= 2) {
+ ifc->ifc_buf = calloc(i, sizeof(struct ifreq));
+ if (NULL == ifc->ifc_buf) {
+ snmp_log(LOG_ERR, "could not allocate memory for %d interfaces\n",
+ i);
+ return -1;
+ }
+ ifc->ifc_len = i * sizeof(struct ifreq);
+
+ if (ioctl(sd, SIOCGIFCONF, (char *) ifc) < 0) {
+ if (errno != EINVAL || lastlen != 0) {
+ /*
+ * Something has gone genuinely wrong.
+ */
+ snmp_log(LOG_ERR, "bad rc from ioctl, errno %d", errno);
+ SNMP_FREE(ifc->ifc_buf);
+ break;
+ }
+ /*
+ * Otherwise, it could just be that the buffer is too small.
+ */
+ } else {
+ if (ifc->ifc_len == lastlen) {
+ /*
+ * The length is the same as the last time; we're done.
+ */
+ break;
+ }
+ lastlen = ifc->ifc_len;
+ }
+ free(ifc->ifc_buf); /* no SNMP_FREE, getting ready to reassign */
+ }
+
+ if (ifc == &ifc_tmp)
+ free(ifc_tmp.ifc_buf);
+
+ return ifc->ifc_len / sizeof(struct ifreq);
+}
+
+/**
+ */
+static void
+_print_flags(short flags)
+{
+/** Standard interface flags. */
+ struct {
+ short flag;
+ const char *name;
+ } map[] = {
+ { IFF_UP, "interface is up"},
+ { IFF_BROADCAST, "broadcast address valid"},
+ { IFF_DEBUG, "turn on debugging"},
+ { IFF_LOOPBACK, "is a loopback net"},
+ { IFF_POINTOPOINT, "interface is has p-p link"},
+ { IFF_NOTRAILERS, "avoid use of trailers"},
+ { IFF_RUNNING, "resources allocated"},
+ { IFF_NOARP, "no ARP protocol"},
+ { IFF_PROMISC, "receive all packets"},
+ { IFF_ALLMULTI, "receive all multicast packets"},
+ { IFF_MASTER, "master of a load balancer"},
+ { IFF_SLAVE, "slave of a load balancer"},
+ { IFF_MULTICAST, "Supports multicast"},
+ { IFF_PORTSEL, "can set media type"},
+ { IFF_AUTOMEDIA, "auto media select active"},
+ };
+ short unknown = flags;
+ int i;
+
+ for(i = 0; i < sizeof(map)/sizeof(map[0]); ++i)
+ if(flags & map[i].flag) {
+ DEBUGMSGT_NC(("access:ipaddress:container"," %s\n", map[i].name));
+ unknown &= ~map[i].flag;
+ }
+
+ if(unknown)
+ DEBUGMSGT_NC(("access:ipaddress:container"," unknown 0x%x\n", unknown));
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h
new file mode 100644
index 0000000000..a7a0ea2a39
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h
@@ -0,0 +1,44 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int
+_netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container,
+ int idx_offset);
+int
+_netsnmp_ioctl_ipaddress_set_v4(netsnmp_ipaddress_entry * entry);
+int
+_netsnmp_ioctl_ipaddress_remove_v4(netsnmp_ipaddress_entry * entry);
+
+int
+netsnmp_access_ipaddress_ioctl_get_interface_count(int sd, struct ifconf * ifc);
+
+
+/*
+ * struct ioctl for arch_data
+ */
+typedef struct _ioctl_extras {
+ u_int flags;
+ u_char name[IFNAMSIZ];
+} _ioctl_extras;
+
+
+
+_ioctl_extras *
+netsnmp_ioctl_ipaddress_entry_init(netsnmp_ipaddress_entry *entry);
+void
+netsnmp_ioctl_ipaddress_entry_cleanup(netsnmp_ipaddress_entry *entry);
+int
+netsnmp_ioctl_ipaddress_entry_copy(netsnmp_ipaddress_entry *lhs,
+ netsnmp_ipaddress_entry *rhs);
+
+_ioctl_extras *
+netsnmp_ioctl_ipaddress_extras_get(netsnmp_ipaddress_entry *entry);
+
+int
+_netsnmp_ioctl_ipaddress_delete_v4(netsnmp_ipaddress_entry * entry);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
new file mode 100644
index 0000000000..8cb06a250f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
@@ -0,0 +1,338 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id: ipaddress_linux.c 17155 2008-08-13 13:02:12Z jsafranek $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "mibII/mibII_common.h"
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/ipaddress.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "ip-mib/ipAddressTable/ipAddressTable_constants.h"
+
+#include <errno.h>
+#include <sys/ioctl.h>
+
+#if defined (NETSNMP_ENABLE_IPV6)
+#include <linux/types.h>
+#include <asm/types.h>
+#include <linux/rtnetlink.h>
+#endif
+
+#include "ipaddress_ioctl.h"
+
+int _load_v6(netsnmp_container *container, int idx_offset);
+
+/*
+ * initialize arch specific storage
+ *
+ * @retval 0: success
+ * @retval <0: error
+ */
+int
+netsnmp_arch_ipaddress_entry_init(netsnmp_ipaddress_entry *entry)
+{
+ /*
+ * init ipv4 stuff
+ */
+ if (NULL == netsnmp_ioctl_ipaddress_entry_init(entry))
+ return -1;
+
+ /*
+ * init ipv6 stuff
+ * so far, we can just share the ipv4 stuff, so nothing to do
+ */
+
+ return 0;
+}
+
+/*
+ * cleanup arch specific storage
+ */
+void
+netsnmp_arch_ipaddress_entry_cleanup(netsnmp_ipaddress_entry *entry)
+{
+ /*
+ * cleanup ipv4 stuff
+ */
+ netsnmp_ioctl_ipaddress_entry_cleanup(entry);
+
+ /*
+ * cleanup ipv6 stuff
+ * so far, we can just share the ipv4 stuff, so nothing to do
+ */
+}
+
+/*
+ * copy arch specific storage
+ */
+int
+netsnmp_arch_ipaddress_entry_copy(netsnmp_ipaddress_entry *lhs,
+ netsnmp_ipaddress_entry *rhs)
+{
+ int rc;
+
+ /*
+ * copy ipv4 stuff
+ */
+ rc = netsnmp_ioctl_ipaddress_entry_copy(lhs, rhs);
+ if (rc)
+ return rc;
+
+ /*
+ * copy ipv6 stuff
+ * so far, we can just share the ipv4 stuff, so nothing to do
+ */
+
+ return rc;
+}
+
+/*
+ * create a new entry
+ */
+int
+netsnmp_arch_ipaddress_create(netsnmp_ipaddress_entry *entry)
+{
+ if (NULL == entry)
+ return -1;
+
+ if (4 != entry->ia_address_len) {
+ DEBUGMSGT(("access:ipaddress:create", "only ipv4 supported\n"));
+ return -2;
+ }
+
+ return _netsnmp_ioctl_ipaddress_set_v4(entry);
+}
+
+/*
+ * create a new entry
+ */
+int
+netsnmp_arch_ipaddress_delete(netsnmp_ipaddress_entry *entry)
+{
+ if (NULL == entry)
+ return -1;
+
+ if (4 != entry->ia_address_len) {
+ DEBUGMSGT(("access:ipaddress:create", "only ipv4 supported\n"));
+ return -2;
+ }
+
+ return _netsnmp_ioctl_ipaddress_delete_v4(entry);
+}
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+int
+netsnmp_arch_ipaddress_container_load(netsnmp_container *container,
+ u_int load_flags)
+{
+ int rc = 0, idx_offset = 0;
+
+ if (0 == (load_flags & NETSNMP_ACCESS_IPADDRESS_LOAD_IPV6_ONLY)) {
+ rc = _netsnmp_ioctl_ipaddress_container_load_v4(container, idx_offset);
+ if(rc < 0) {
+ u_int flags = NETSNMP_ACCESS_IPADDRESS_FREE_KEEP_CONTAINER;
+ netsnmp_access_ipaddress_container_free(container, flags);
+ }
+ }
+
+#if defined (NETSNMP_ENABLE_IPV6)
+
+ if (0 == (load_flags & NETSNMP_ACCESS_IPADDRESS_LOAD_IPV4_ONLY)) {
+ if (rc < 0)
+ rc = 0;
+
+ idx_offset = rc;
+
+ /*
+ * load ipv6, ignoring errors if file not found
+ */
+ rc = _load_v6(container, idx_offset);
+ if (-2 == rc)
+ rc = 0;
+ else if(rc < 0) {
+ u_int flags = NETSNMP_ACCESS_IPADDRESS_FREE_KEEP_CONTAINER;
+ netsnmp_access_ipaddress_container_free(container, flags);
+ }
+ }
+#endif
+
+ /*
+ * return no errors (0) if we found any interfaces
+ */
+ if(rc > 0)
+ rc = 0;
+
+ return rc;
+}
+
+#if defined (NETSNMP_ENABLE_IPV6)
+/**
+ */
+int
+_load_v6(netsnmp_container *container, int idx_offset)
+{
+ FILE *in;
+ char line[80], addr[40];
+ char if_name[IFNAMSIZ+1];/* +1 for '\0' because of the ugly sscanf below */
+ u_char *buf;
+ int if_index, pfx_len, scope, flags, rc = 0;
+ size_t in_len, out_len;
+ netsnmp_ipaddress_entry *entry;
+ _ioctl_extras *extras;
+ static int log_open_err = 1;
+
+ netsnmp_assert(NULL != container);
+
+#define PROCFILE "/proc/net/if_inet6"
+ if (!(in = fopen(PROCFILE, "r"))) {
+ if (1 == log_open_err) {
+ snmp_log(LOG_ERR,"could not open " PROCFILE "\n");
+ log_open_err = 0;
+ }
+ return -2;
+ }
+ /*
+ * if we hadn't been able to open file and turned of err logging,
+ * turn it back on now that we opened the file.
+ */
+ if (0 == log_open_err)
+ log_open_err = 1;
+
+ /*
+ * address index prefix_len scope status if_name
+ */
+ while (fgets(line, sizeof(line), in)) {
+ /*
+ * fe800000000000000200e8fffe5b5c93 05 40 20 80 eth0
+ * A D P S F I
+ * A: address
+ * D: device number
+ * P: prefix len
+ * S: scope (see include/net/ipv6.h, net/ipv6/addrconf.c)
+ * F: flags (see include/linux/rtnetlink.h, net/ipv6/addrconf.c)
+ * I: interface
+ */
+ rc = sscanf(line, "%39s %04x %02x %02x %02x %" SNMP_MACRO_VAL_TO_STR(IFNAMSIZ) "s\n",
+ addr, &if_index, &pfx_len, &scope, &flags, if_name);
+ if( 6 != rc ) {
+ snmp_log(LOG_ERR, PROCFILE " data format error (%d!=6), line ==|%s|\n",
+ rc, line);
+ continue;
+ }
+ DEBUGMSGTL(("access:ipaddress:container",
+ "addr %s, index %d, pfx %d, scope %d, flags 0x%X, name %s\n",
+ addr, if_index, pfx_len, scope, flags, if_name));
+ /*
+ */
+ entry = netsnmp_access_ipaddress_entry_create();
+ if(NULL == entry) {
+ rc = -3;
+ break;
+ }
+
+ in_len = entry->ia_address_len = sizeof(entry->ia_address);
+ netsnmp_assert(16 == in_len);
+ out_len = 0;
+ buf = entry->ia_address;
+ if(1 != netsnmp_hex_to_binary(&buf, &in_len,
+ &out_len, 0, addr, ":")) {
+ snmp_log(LOG_ERR,"error parsing '%s', skipping\n",
+ entry->ia_address);
+ netsnmp_access_ipaddress_entry_free(entry);
+ continue;
+ }
+ netsnmp_assert(16 == out_len);
+ entry->ia_address_len = out_len;
+
+ entry->ns_ia_index = ++idx_offset;
+
+ /*
+ * save if name
+ */
+ extras = netsnmp_ioctl_ipaddress_extras_get(entry);
+ memcpy(extras->name, if_name, sizeof(extras->name));
+ extras->flags = flags;
+
+ /*
+ * yyy-rks: optimization: create a socket outside the loop and use
+ * netsnmp_access_interface_ioctl_ifindex_get() here, since
+ * netsnmp_access_interface_index_find will open/close a socket
+ * every time it is called.
+ */
+ entry->if_index = netsnmp_access_interface_index_find(if_name);
+
+ /*
+ #define IPADDRESSSTATUSTC_PREFERRED 1
+ #define IPADDRESSSTATUSTC_DEPRECATED 2
+ #define IPADDRESSSTATUSTC_INVALID 3
+ #define IPADDRESSSTATUSTC_INACCESSIBLE 4
+ #define IPADDRESSSTATUSTC_UNKNOWN 5
+ #define IPADDRESSSTATUSTC_TENTATIVE 6
+ #define IPADDRESSSTATUSTC_DUPLICATE 7
+ */
+ if(flags & IFA_F_PERMANENT)
+ entry->ia_status = IPADDRESSSTATUSTC_PREFERRED; /* ?? */
+ else if(flags & IFA_F_DEPRECATED)
+ entry->ia_status = IPADDRESSSTATUSTC_DEPRECATED;
+ else if(flags & IFA_F_TENTATIVE)
+ entry->ia_status = IPADDRESSSTATUSTC_TENTATIVE;
+ else {
+ entry->ia_status = IPADDRESSSTATUSTC_UNKNOWN;
+ DEBUGMSGTL(("access:ipaddress:ipv6",
+ "unknown flags 0x%x\n", flags));
+ }
+
+ /*
+ * if it's not multi, it must be uni.
+ * (an ipv6 address is never broadcast)
+ */
+ if (IN6_IS_ADDR_MULTICAST(entry->ia_address))
+ entry->ia_type = IPADDRESSTYPE_ANYCAST;
+ else
+ entry->ia_type = IPADDRESSTYPE_UNICAST;
+
+
+ entry->ia_prefix_len = pfx_len;
+
+ /*
+ * can we figure out if an address is from DHCP?
+ * use manual until then...
+ *
+ *#define IPADDRESSORIGINTC_OTHER 1
+ *#define IPADDRESSORIGINTC_MANUAL 2
+ *#define IPADDRESSORIGINTC_DHCP 4
+ *#define IPADDRESSORIGINTC_LINKLAYER 5
+ *#define IPADDRESSORIGINTC_RANDOM 6
+ *
+ * are 'local' address assigned by link layer??
+ */
+ if (IN6_IS_ADDR_LINKLOCAL(entry->ia_address) ||
+ IN6_IS_ADDR_SITELOCAL(entry->ia_address))
+ entry->ia_origin = IPADDRESSORIGINTC_LINKLAYER;
+ else
+ entry->ia_origin = IPADDRESSORIGINTC_MANUAL;
+
+ /* xxx-rks: what can we do with scope? */
+
+ /*
+ * add entry to container
+ */
+ CONTAINER_INSERT(container, entry);
+ }
+
+ fclose(in);
+
+ if(rc<0)
+ return rc;
+
+ return idx_offset;
+}
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.h
new file mode 100644
index 0000000000..ab46955cbf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.h
@@ -0,0 +1,22 @@
+/*
+ * ipaddress data access header
+ *
+ * $Id: ipaddress_linux.h 13371 2005-11-02 17:07:28Z rstory $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * configure required files
+ *
+ * Notes:
+ *
+ * 1) prefer functionality over platform, where possible. If a method
+ * is available for multiple platforms, test that first. That way
+ * when a new platform is ported, it won't need a new test here.
+ *
+ * 2) don't do detail requirements here. If, for example,
+ * HPUX11 had different reuirements than other HPUX, that should
+ * be handled in the *_hpux.h header file.
+ */
+config_require(ip-mib/data_access/ipaddress_linux)
+config_require(ip-mib/data_access/ipaddress_ioctl)
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_common.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_common.h
new file mode 100644
index 0000000000..0404bd5f3c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_common.h
@@ -0,0 +1,29 @@
+/*
+ * ip scalar data access header
+ *
+ * $Id: scalars_common.h 13271 2005-10-28 15:29:23Z rstory $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * configure required files
+ *
+ * Notes:
+ *
+ * 1) prefer functionality over platform, where possible. If a method
+ * is available for multiple platforms, test that first. That way
+ * when a new platform is ported, it won't need a new test here.
+ *
+ * 2) don't do detail requirements here. If, for example,
+ * HPUX11 had different reuirements than other HPUX, that should
+ * be handled in the *_hpux.h header file.
+ */
+#if defined( linux )
+config_require(ip-mib/data_access/scalars_linux)
+#else
+/*
+ * couldn't determine the correct file!
+ * require a bogus file to generate an error.
+ */
+config_require(ip-mib/data_access/scalars-unknown-arch)
+#endif
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_linux.c
new file mode 100644
index 0000000000..aedcd8b1f1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_linux.c
@@ -0,0 +1,79 @@
+/*
+ * Arp MIB architecture support
+ *
+ * $Id: scalars_linux.c 16965 2008-05-25 07:14:16Z magfr $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/data_access/ip_scalars.h>
+
+static const char ipfw_name[] = "/proc/sys/net/ipv6/conf/all/forwarding";
+
+int
+netsnmp_arch_ip_scalars_ipv6IpForwarding_get(u_long *value)
+{
+ FILE *filep;
+ int rc;
+
+ if (NULL == value)
+ return -1;
+
+
+ filep = fopen(ipfw_name, "r");
+ if (NULL == filep) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "could not open %s\n",
+ ipfw_name));
+ return -2;
+ }
+
+ rc = fscanf(filep, "%ld", value);
+ fclose(filep);
+ if (1 != rc) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "could not read %s\n",
+ ipfw_name));
+ return -3;
+ }
+
+ if ((0 != *value) && (1 != *value)) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "unexpected value %ld in %s\n",
+ *value, ipfw_name));
+ return -4;
+ }
+
+ return 0;
+}
+
+int
+netsnmp_arch_ip_scalars_ipv6IpForwarding_set(u_long value)
+{
+ FILE *filep;
+ int rc;
+
+ if (1 == value)
+ ;
+ else if (2 == value)
+ value = 0;
+ else {
+ DEBUGMSGTL(("access:ipv6IpForwarding",
+ "bad value %ld for ipv6IpForwarding\n", value));
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ filep = fopen(ipfw_name, "w");
+ if (NULL == filep) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "could not open %s\n",
+ ipfw_name));
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+
+ rc = fprintf(filep, "%ld", value);
+ fclose(filep);
+ if (1 != rc) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "could not write %s\n",
+ ipfw_name));
+ return SNMP_ERR_GENERR;
+ }
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats.h
new file mode 100644
index 0000000000..84ca0c89f8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats.h
@@ -0,0 +1,30 @@
+/*
+ * systemstats data access header
+ *
+ * $Id: systemstats.h 13271 2005-10-28 15:29:23Z rstory $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * configure required files
+ *
+ * Notes:
+ *
+ * 1) prefer functionality over platform, where possible. If a method
+ * is available for multiple platforms, test that first. That way
+ * when a new platform is ported, it won't need a new test here.
+ *
+ * 2) don't do detail requirements here. If, for example,
+ * HPUX11 had different reuirements than other HPUX, that should
+ * be handled in the *_hpux.h header file.
+ */
+config_require(ip-mib/data_access/systemstats_common)
+#if defined( linux )
+config_require(ip-mib/data_access/systemstats_linux)
+#else
+/*
+ * couldn't determine the correct file!
+ * require a bogus file to generate an error.
+ */
+config_require(ip-mib/data_access/systemstats-unknown-arch);
+#endif
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_common.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_common.c
new file mode 100644
index 0000000000..83e1867442
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_common.c
@@ -0,0 +1,389 @@
+/*
+ * Systemstats MIB architecture support
+ *
+ * $Id: systemstats_common.c 11913 2005-02-08 21:58:36Z nba $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h"
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/ipstats.h>
+#include <net-snmp/data_access/systemstats.h>
+
+/**---------------------------------------------------------------------*/
+/*
+ * local static vars
+ */
+static int need_wrap_check = -1;
+
+/*
+ * local static prototypes
+ */
+static void _entry_release(netsnmp_systemstats_entry * entry, void *unused);
+
+/**---------------------------------------------------------------------*/
+/*
+ * external per-architecture functions prototypes
+ *
+ * These shouldn't be called by the general public, so they aren't in
+ * the header file.
+ */
+extern int
+netsnmp_access_systemstats_container_arch_load(netsnmp_container* container,
+ u_int load_flags);
+extern void
+netsnmp_access_systemstats_arch_init(void);
+
+/**---------------------------------------------------------------------*/
+/*
+ * initialization
+ */
+void
+netsnmp_access_systemstats_init(void)
+{
+ netsnmp_container * ifcontainer;
+
+ netsnmp_access_systemstats_arch_init();
+
+ /*
+ * load once to set up ifIndexes
+ */
+ ifcontainer = netsnmp_access_systemstats_container_load(NULL, 0);
+ if(NULL != ifcontainer)
+ netsnmp_access_systemstats_container_free(ifcontainer, 0);
+
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * container functions
+ */
+/**
+ * initialize systemstats container
+ */
+netsnmp_container *
+netsnmp_access_systemstats_container_init(u_int flags)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("access:systemstats:container", "init\n"));
+
+ /*
+ * create the containers. one indexed by ifIndex, the other
+ * indexed by ifName.
+ */
+ container = netsnmp_container_find("access_systemstats:table_container");
+ if (NULL == container)
+ return NULL;
+
+ return container;
+}
+
+/**
+ * load systemstats information in specified container
+ *
+ * @param container empty container, or NULL to have one created for you
+ * @param load_flags flags to modify behaviour.
+ *
+ * @retval NULL error
+ * @retval !NULL pointer to container
+ */
+netsnmp_container*
+netsnmp_access_systemstats_container_load(netsnmp_container* container, u_int load_flags)
+{
+ int rc;
+
+ DEBUGMSGTL(("access:systemstats:container", "load\n"));
+
+ if (NULL == container)
+ container = netsnmp_access_systemstats_container_init(load_flags);
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_systemstats\n");
+ return NULL;
+ }
+
+ rc = netsnmp_access_systemstats_container_arch_load(container, load_flags);
+ if (0 != rc) {
+ netsnmp_access_systemstats_container_free(container,
+ NETSNMP_ACCESS_SYSTEMSTATS_FREE_NOFLAGS);
+ container = NULL;
+ }
+
+ return container;
+}
+
+void
+netsnmp_access_systemstats_container_free(netsnmp_container *container, u_int free_flags)
+{
+ DEBUGMSGTL(("access:systemstats:container", "free\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container for netsnmp_access_systemstats_free\n");
+ return;
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_SYSTEMSTATS_FREE_DONT_CLEAR)) {
+ /*
+ * free all items.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)_entry_release,
+ NULL);
+ }
+
+ CONTAINER_FREE(container);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * entry functions
+ */
+/**
+ */
+netsnmp_systemstats_entry *
+netsnmp_access_systemstats_entry_get_by_index(netsnmp_container *container, oid index)
+{
+ netsnmp_index tmp;
+
+ DEBUGMSGTL(("access:systemstats:entry", "by_index\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container for netsnmp_access_systemstats_entry_get_by_index\n");
+ return NULL;
+ }
+
+ tmp.len = 1;
+ tmp.oids = &index;
+
+ return (netsnmp_systemstats_entry *) CONTAINER_FIND(container, &tmp);
+}
+
+/**
+ */
+netsnmp_systemstats_entry *
+netsnmp_access_systemstats_entry_create(int version)
+{
+ netsnmp_systemstats_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_systemstats_entry);
+
+ DEBUGMSGTL(("access:systemstats:entry", "create\n"));
+
+ if(NULL == entry)
+ return NULL;
+
+ entry->ns_ip_version = version;
+
+ entry->oid_index.len = 1;
+ entry->oid_index.oids = (oid *) & entry->ns_ip_version;
+
+ return entry;
+}
+
+/**
+ */
+void
+netsnmp_access_systemstats_entry_free(netsnmp_systemstats_entry * entry)
+{
+ DEBUGMSGTL(("access:systemstats:entry", "free\n"));
+
+ if (NULL == entry)
+ return;
+
+ /*
+ * SNMP_FREE not needed, for any of these,
+ * since the whole entry is about to be freed
+ */
+
+ if (NULL != entry->old_stats)
+ free(entry->old_stats);
+
+ free(entry);
+}
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * Utility routines
+ */
+
+/**
+ * \internal
+ */
+static void
+_entry_release(netsnmp_systemstats_entry * entry, void *context)
+{
+ netsnmp_access_systemstats_entry_free(entry);
+}
+
+/**
+ * update entry stats (checking for counter wrap)
+ *
+ * @retval 0 : success
+ * @retval <0 : error
+ */
+int
+netsnmp_access_systemstats_entry_update_stats(netsnmp_systemstats_entry * prev_vals,
+ netsnmp_systemstats_entry * new_vals)
+{
+ DEBUGMSGTL(("access:systemstats", "check_wrap\n"));
+
+ /*
+ * sanity checks
+ */
+ if ((NULL == prev_vals) || (NULL == new_vals) ||
+ (prev_vals->ns_ip_version != new_vals->ns_ip_version))
+ return -1;
+
+ /*
+ * if we've determined that we have 64 bit counters, just copy them.
+ */
+ if (0 == need_wrap_check) {
+ memcpy(&prev_vals->stats, &new_vals->stats, sizeof(new_vals->stats));
+ return 0;
+ }
+
+ if (NULL == prev_vals->old_stats) {
+ /*
+ * if we don't have old stats, they can't have wrapped, so just copy
+ */
+ prev_vals->old_stats = SNMP_MALLOC_TYPEDEF(netsnmp_ipstats);
+ if (NULL == prev_vals->old_stats) {
+ return -2;
+ }
+ }
+ else {
+ /*
+ * update straight 32 bit counters
+ */
+ prev_vals->stats.InHdrErrors = new_vals->stats.InHdrErrors;
+ prev_vals->stats.InNoRoutes = new_vals->stats.InNoRoutes;
+ prev_vals->stats.InAddrErrors = new_vals->stats.InAddrErrors;
+ prev_vals->stats.InUnknownProtos = new_vals->stats.InUnknownProtos;
+ prev_vals->stats.InTruncatedPkts = new_vals->stats.InTruncatedPkts;
+ prev_vals->stats.ReasmReqds = new_vals->stats.InTruncatedPkts;
+ prev_vals->stats.ReasmOKs = new_vals->stats.ReasmOKs;
+ prev_vals->stats.ReasmFails = new_vals->stats.ReasmFails;
+ prev_vals->stats.InDiscards = new_vals->stats.InDiscards;
+ prev_vals->stats.OutNoRoutes = new_vals->stats.OutNoRoutes;
+ prev_vals->stats.OutDiscards = new_vals->stats.OutDiscards;
+ prev_vals->stats.OutFragReqds = new_vals->stats.OutFragReqds;
+ prev_vals->stats.OutFragOKs = new_vals->stats.OutFragOKs;
+ prev_vals->stats.OutFragFails = new_vals->stats.OutFragFails;
+ prev_vals->stats.OutFragCreates = new_vals->stats.OutFragCreates;
+
+ /*
+ * update 64bit counters
+ */
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCInReceives,
+ &new_vals->stats.HCInReceives,
+ &prev_vals->old_stats->HCInReceives,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCInOctets,
+ &new_vals->stats.HCInOctets,
+ &prev_vals->old_stats->HCInOctets,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCInForwDatagrams,
+ &new_vals->stats.HCInForwDatagrams,
+ &prev_vals->old_stats->HCInForwDatagrams,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCInDelivers,
+ &new_vals->stats.HCInDelivers,
+ &prev_vals->old_stats->HCInDelivers,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutRequests,
+ &new_vals->stats.HCOutRequests,
+ &prev_vals->old_stats->HCOutRequests,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutForwDatagrams,
+ &new_vals->stats.HCOutForwDatagrams,
+ &prev_vals->old_stats->HCOutForwDatagrams,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutTransmits,
+ &new_vals->stats.HCOutTransmits,
+ &prev_vals->old_stats->HCOutTransmits,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutOctets,
+ &new_vals->stats.HCOutOctets,
+ &prev_vals->old_stats->HCOutOctets,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCInMcastPkts,
+ &new_vals->stats.HCInMcastPkts,
+ &prev_vals->old_stats->HCInMcastPkts,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCInMcastOctets,
+ &new_vals->stats.HCInMcastOctets,
+ &prev_vals->old_stats->HCInMcastOctets,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutMcastPkts,
+ &new_vals->stats.HCOutMcastPkts,
+ &prev_vals->old_stats->HCOutMcastPkts,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutMcastOctets,
+ &new_vals->stats.HCOutMcastOctets,
+ &prev_vals->old_stats->HCOutMcastOctets,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCInBcastPkts,
+ &new_vals->stats.HCInBcastPkts,
+ &prev_vals->old_stats->HCInBcastPkts,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutBcastPkts,
+ &new_vals->stats.HCOutBcastPkts,
+ &prev_vals->old_stats->HCOutBcastPkts,
+ &need_wrap_check);
+ }
+
+ /*
+ * if we've decided we no longer need to check wraps, free old stats
+ */
+ if (0 == need_wrap_check) {
+ SNMP_FREE(prev_vals->old_stats);
+ }
+
+ /*
+ * update old stats from new stats.
+ * careful - old_stats is a pointer to stats...
+ */
+ memcpy(prev_vals->old_stats, &new_vals->stats, sizeof(new_vals->stats));
+
+ return 0;
+}
+
+/**
+ * update systemstats entry data (checking for counter wraps)
+ *
+ * Given an existing entry, update it with the new values from another
+ * entry.
+ *
+ * @retval -2 : malloc failed
+ * @retval -1 : systemstatss not the same
+ * @retval 0 : no error
+ */
+int
+netsnmp_access_systemstats_entry_update(netsnmp_systemstats_entry * lhs,
+ netsnmp_systemstats_entry * rhs)
+{
+ DEBUGMSGTL(("access:systemstats", "copy\n"));
+
+ if ((NULL == lhs) || (NULL == rhs) ||
+ (lhs->ns_ip_version != rhs->ns_ip_version))
+ return -1;
+
+ /*
+ * update stats
+ */
+ netsnmp_access_systemstats_entry_update_stats(lhs, rhs);
+
+ /*
+ * update other data
+ */
+ lhs->flags = rhs->flags;
+
+ return 0;
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ *
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_linux.c
new file mode 100644
index 0000000000..947afe805f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_linux.c
@@ -0,0 +1,376 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id: systemstats_linux.c 15220 2006-09-15 00:48:50Z tanders $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/ipstats.h>
+#include <net-snmp/data_access/systemstats.h>
+
+static int _systemstats_v4(netsnmp_container* container, u_int load_flags);
+#if defined (NETSNMP_ENABLE_IPV6)
+static int _systemstats_v6(netsnmp_container* container, u_int load_flags);
+#endif
+
+
+void
+netsnmp_access_systemstats_arch_init(void)
+{
+ /*
+ * nothing to do
+ */
+}
+
+/*
+ /proc/net/snmp
+
+ Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates
+ Ip: 2 64 7083534 0 0 0 0 0 6860233 6548963 0 0 1 286623 63322 1 259920 0 0
+
+ Icmp: InMsgs InErrors InDestUnreachs InTimeExcds InParmProbs InSrcQuenchs InRedirects InEchos InEchoReps InTimestamps InTimestampReps InAddrMasks InAddrMaskReps OutMsgs OutErrors OutDestUnreachs OutTimeExcds OutParmProbs OutSrcQuenchs OutRedirects OutEchos OutEchoReps OutTimestamps OutTimestampReps OutAddrMasks OutAddrMaskReps
+ Icmp: 335 36 254 72 0 0 0 0 9 0 0 0 0 257 0 257 0 0 0 0 0 0 0 0 0 0
+
+ Tcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens PassiveOpens AttemptFails EstabResets CurrEstab InSegs OutSegs RetransSegs InErrs OutRsts
+ Tcp: 1 200 120000 -1 5985 55 27 434 10 5365077 5098096 10902 2 4413
+
+ Udp: InDatagrams NoPorts InErrors OutDatagrams
+ Udp: 1491094 122 0 1466178
+*/
+
+
+/*
+ *
+ * @retval 0 success
+ * @retval -1 no container specified
+ * @retval -2 could not open file
+ * @retval -3 could not create entry (probably malloc)
+ * @retval -4 file format error
+ */
+int
+netsnmp_access_systemstats_container_arch_load(netsnmp_container* container,
+ u_int load_flags)
+{
+ int rc1;
+#if defined (NETSNMP_ENABLE_IPV6)
+ int rc2;
+#endif
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_systemstats_\n");
+ return -1;
+ }
+
+ /*
+ * load v4 and v6 stats. Even if one fails, try the other.
+ * If they have the same rc, return it. if the differ, return
+ * the smaller one. No log messages, since each individual function
+ * would have logged its own message.
+ */
+ rc1 = _systemstats_v4(container, load_flags);
+#if defined (NETSNMP_ENABLE_IPV6)
+ rc2 = _systemstats_v6(container, load_flags);
+ if ((rc1 == rc2) || (rc1 < rc2))
+ return rc1;
+
+ return rc2;
+#else
+ return rc1;
+#endif
+}
+
+static int
+_systemstats_v4(netsnmp_container* container, u_int load_flags)
+{
+ FILE *devin;
+ char line[1024];
+ netsnmp_systemstats_entry *entry = NULL;
+ int scan_count;
+ char *stats, *start = line;
+ int len;
+ uintmax_t scan_vals[19];
+
+ DEBUGMSGTL(("access:systemstats:container:arch", "load v4 (flags %p)\n",
+ load_flags));
+
+ netsnmp_assert(container != NULL); /* load function shoulda checked this */
+
+ if (!(devin = fopen("/proc/net/snmp", "r"))) {
+ DEBUGMSGTL(("access:systemstats",
+ "Failed to load Systemstats Table (linux1)\n"));
+ snmp_log(LOG_ERR, "cannot open /proc/net/snmp ...\n");
+ return -2;
+ }
+
+ /*
+ * skip header, but make sure it's the length we expect...
+ */
+ fgets(line, sizeof(line), devin);
+ len = strlen(line);
+ if (224 != len) {
+ fclose(devin);
+ snmp_log(LOG_ERR, "unexpected header length in /proc/net/snmp."
+ " %d != 224\n", len);
+ return -4;
+ }
+
+ /*
+ * This file provides the statistics for each systemstats.
+ * Read in each line in turn, isolate the systemstats name
+ * and retrieve (or create) the corresponding data structure.
+ */
+ start = fgets(line, sizeof(line), devin);
+ fclose(devin);
+ if (start) {
+
+ len = strlen(line);
+ if (line[len - 1] == '\n')
+ line[len - 1] = '\0';
+
+ while (*start && *start == ' ')
+ start++;
+
+ if ((!*start) || ((stats = strrchr(start, ':')) == NULL)) {
+ snmp_log(LOG_ERR,
+ "systemstats data format error 1, line ==|%s|\n", line);
+ return -4;
+ }
+
+ DEBUGMSGTL(("access:systemstats", "processing '%s'\n", start));
+
+ *stats++ = 0; /* null terminate name */
+ while (*stats == ' ') /* skip spaces before stats */
+ stats++;
+
+ entry = netsnmp_access_systemstats_entry_create(1);
+ if(NULL == entry) {
+ netsnmp_access_systemstats_container_free(container,
+ NETSNMP_ACCESS_SYSTEMSTATS_FREE_NOFLAGS);
+ return -3;
+ }
+
+ /*
+ * OK - we've now got (or created) the data structure for
+ * this systemstats, including any "static" information.
+ * Now parse the rest of the line (i.e. starting from 'stats')
+ * to extract the relevant statistics, and populate
+ * data structure accordingly.
+ */
+
+ memset(scan_vals, 0x0, sizeof(scan_vals));
+ scan_count = sscanf(stats,
+ "%llu %llu %llu %llu %llu %llu %llu %llu %llu %llu"
+ "%llu %llu %llu %llu %llu %llu %llu %llu %llu",
+ &scan_vals[0],&scan_vals[1],&scan_vals[2],
+ &scan_vals[3],&scan_vals[4],&scan_vals[5],
+ &scan_vals[6],&scan_vals[7],&scan_vals[8],
+ &scan_vals[9],&scan_vals[10],&scan_vals[11],
+ &scan_vals[12],&scan_vals[13],&scan_vals[14],
+ &scan_vals[15],&scan_vals[16],&scan_vals[17],
+ &scan_vals[18]);
+ DEBUGMSGTL(("access:systemstats", " read %d values\n", scan_count));
+
+ if(scan_count != 19) {
+ snmp_log(LOG_ERR,
+ "error scanning systemstats data (expected %d, got %d)\n",
+ 19, scan_count);
+ netsnmp_access_systemstats_entry_free(entry);
+ return -4;
+ }
+ /* entry->stats. = scan_vals[0]; / * Forwarding */
+ /* entry->stats. = scan_vals[1]; / * DefaultTTL */
+ entry->stats.HCInReceives.low = scan_vals[2] & 0xffffffff;
+ entry->stats.HCInReceives.high = scan_vals[2] >> 32;
+ entry->stats.InHdrErrors = scan_vals[3];
+ entry->stats.InAddrErrors = scan_vals[4];
+ entry->stats.HCInForwDatagrams.low = scan_vals[5] & 0xffffffff;
+ entry->stats.HCInForwDatagrams.high = scan_vals[5] >> 32;
+ entry->stats.InUnknownProtos = scan_vals[6];
+ entry->stats.InDiscards = scan_vals[7];
+ entry->stats.HCInDelivers.low = scan_vals[8] & 0xffffffff;
+ entry->stats.HCInDelivers.high = scan_vals[8] >> 32;
+ entry->stats.HCOutRequests.low = scan_vals[9] & 0xffffffff;
+ entry->stats.HCOutRequests.high = scan_vals[9] >> 32;
+ entry->stats.OutDiscards = scan_vals[10];
+ entry->stats.OutNoRoutes = scan_vals[11];
+ /* entry->stats. = scan_vals[12]; / * ReasmTimeout */
+ entry->stats.ReasmReqds = scan_vals[13];
+ entry->stats.ReasmOKs = scan_vals[14];
+ entry->stats.ReasmFails = scan_vals[15];
+ entry->stats.OutFragOKs = scan_vals[16];
+ entry->stats.OutFragFails = scan_vals[17];
+ entry->stats.OutFragCreates = scan_vals[18];
+
+ /*
+ * add to container
+ */
+ CONTAINER_INSERT(container, entry);
+ }
+ return 0;
+}
+
+#if defined (NETSNMP_ENABLE_IPV6)
+static int
+_systemstats_v6(netsnmp_container* container, u_int load_flags)
+{
+ FILE *devin;
+ char line[1024];
+ netsnmp_systemstats_entry *entry = NULL;
+ int scan_count = 0;
+ char *stats, *start = line;
+ int len, rc;
+ uintmax_t scan_val;
+ const char *filename = "/proc/net/snmp6";
+ static int warned_open = 0;
+
+ DEBUGMSGTL(("access:systemstats:container:arch", "load v6 (flags %p)\n",
+ load_flags));
+
+ netsnmp_assert(container != NULL); /* load function shoulda checked this */
+
+ entry = netsnmp_access_systemstats_entry_create(2);
+ if(NULL == entry)
+ return -3;
+
+ /*
+ * try to open file. If we can't, that's ok - maybe the module hasn't
+ * been loaded yet.
+ */
+ if (!(devin = fopen(filename, "r"))) {
+ DEBUGMSGTL(("access:systemstats",
+ "Failed to load Systemstats Table (linux1)\n"));
+ if(!warned_open) {
+ ++warned_open;
+ snmp_log(LOG_ERR, "cannot open %s ...\n", filename);
+ }
+ free(entry);
+ return 0;
+ }
+
+ /*
+ * This file provides the statistics for each systemstats.
+ * Read in each line in turn, isolate the systemstats name
+ * and retrieve (or create) the corresponding data structure.
+ */
+ while (1) {
+ start = fgets(line, sizeof(line), devin);
+ if (NULL == start)
+ break;
+
+ len = strlen(line);
+ if (line[len - 1] == '\n')
+ line[len - 1] = '\0';
+
+ if (('I' != line[0]) || ('6' != line[2]))
+ continue;
+
+ stats = strrchr(line, ' ');
+ if (NULL == stats) {
+ snmp_log(LOG_ERR,
+ "systemstats data format error 1, line ==|%s|\n", line);
+ continue;
+ }
+
+ DEBUGMSGTL(("access:systemstats", "processing '%s'\n", line));
+
+ /*
+ * OK - we've now got (or created) the data structure for
+ * this systemstats, including any "static" information.
+ * Now parse the rest of the line (i.e. starting from 'stats')
+ * to extract the relevant statistics, and populate
+ * data structure accordingly.
+ */
+ scan_val = atoll(stats);
+ if (0 == scan_val)
+ continue;
+
+ rc = 0;
+ if ('I' == line[3]) { /* In */
+ if ('A' == line[5]) {
+ entry->stats.InAddrErrors = scan_val;
+ } else if ('D' == line[5]) {
+ if ('e' == line[6]) {
+ entry->stats.HCInDelivers.low = scan_val & 0xffffffff;
+ entry->stats.HCInDelivers.high = scan_val >> 32;
+ } else if ('i' == line[6])
+ entry->stats.InDiscards = scan_val;
+ else
+ rc = 1;
+ } else if ('H' == line[5]) {
+ entry->stats.InHdrErrors = scan_val;
+ } else if ('M' == line[5]) {
+ entry->stats.HCInMcastPkts.low = scan_val & 0xffffffff;
+ entry->stats.HCInMcastPkts.high = scan_val >> 32;
+ } else if ('N' == line[5]) {
+ entry->stats.InNoRoutes = scan_val;
+ } else if ('R' == line[5]) {
+ entry->stats.HCInReceives.low = scan_val & 0xffffffff;
+ entry->stats.HCInReceives.high = scan_val >> 32;
+ } else if ('T' == line[5]) {
+ if ('r' == line[6]) {
+ entry->stats.InTruncatedPkts = scan_val & 0xffffffff;
+ } else if ('o' == line[6])
+ ; /* TooBig isn't in the MIB, so ignore it */
+ else
+ rc = 1;
+ } else if ('U' == line[5]) {
+ entry->stats.InUnknownProtos = scan_val;
+ } else
+ rc = 1;
+ } else if ('O' == line[3]) { /* Out */
+ if ('D' == line[6]) {
+ entry->stats.OutDiscards = scan_val;
+ } else if ('F' == line[6]) {
+ entry->stats.HCOutForwDatagrams.low = scan_val & 0xffffffff;
+ entry->stats.HCOutForwDatagrams.high = scan_val >> 32;
+ } else if ('M' == line[6]) {
+ entry->stats.HCOutMcastPkts.low = scan_val & 0xffffffff;
+ entry->stats.HCOutMcastPkts.high = scan_val >> 32;
+ } else if ('N' == line[6]) {
+ entry->stats.OutNoRoutes = scan_val;
+ } else if ('R' == line[6]) {
+ entry->stats.HCOutRequests.low = scan_val & 0xffffffff;
+ entry->stats.HCOutRequests.high = scan_val >> 32;
+ } else
+ rc = 1;
+ } else if ('R' == line[3]) { /* Reasm */
+ if ('F' == line[8]) {
+ entry->stats.ReasmFails = scan_val;
+ } else if ('O' == line[8]) {
+ entry->stats.ReasmOKs = scan_val;
+ } else if ('R' == line[8]) {
+ entry->stats.ReasmReqds = scan_val;
+ } else if ('T' == line[8]) {
+ ; /* no mib entry for reasm timeout */
+ } else
+ rc = 1;
+ } else if ('F' == line[3]) { /* Frag */
+ if ('C' == line[7])
+ entry->stats.OutFragCreates = scan_val;
+ else if ('O' == line[7])
+ entry->stats.OutFragOKs = scan_val;
+ else if ('F' == line[7])
+ entry->stats.OutFragFails = scan_val;
+ else
+ rc = 1;
+ } else
+ rc = 1;
+
+ if (rc)
+ DEBUGMSGTL(("access:systemstats", "unknown stat %s\n", line));
+ else
+ ++scan_count;
+ }
+
+ fclose(devin);
+
+ /*
+ * add to container
+ */
+ CONTAINER_INSERT(container, entry);
+
+ return rc;
+}
+#endif /* NETSNMP_ENABLE_IPV6 */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable.h
new file mode 100644
index 0000000000..c2faab8468
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable.h
@@ -0,0 +1,8 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/data_access/arp)
+config_require(ip-mib/inetNetToMediaTable/inetNetToMediaTable)
+config_require(ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface)
+config_require(ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c
new file mode 100644
index 0000000000..640c2e219a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c
@@ -0,0 +1,1818 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: inetNetToMediaTable.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** \page MFD helper for inetNetToMediaTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "inetNetToMediaTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "inetNetToMediaTable_interface.h"
+
+oid inetNetToMediaTable_oid[] = { INETNETTOMEDIATABLE_OID };
+int inetNetToMediaTable_oid_size =
+OID_LENGTH(inetNetToMediaTable_oid);
+
+inetNetToMediaTable_registration inetNetToMediaTable_user_context;
+
+void initialize_table_inetNetToMediaTable(void);
+void shutdown_table_inetNetToMediaTable(void);
+
+
+/**
+ * Initializes the inetNetToMediaTable module
+ */
+void
+init_inetNetToMediaTable(void)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:init_inetNetToMediaTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform inetNetToMediaTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("inetNetToMediaTable"))
+ initialize_table_inetNetToMediaTable();
+
+} /* init_inetNetToMediaTable */
+
+/**
+ * Shut-down the inetNetToMediaTable module (agent is exiting)
+ */
+void
+shutdown_inetNetToMediaTable(void)
+{
+ if (should_init("inetNetToMediaTable"))
+ shutdown_table_inetNetToMediaTable();
+
+}
+
+/**
+ * Initialize the table inetNetToMediaTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_inetNetToMediaTable(void)
+{
+ inetNetToMediaTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:initialize_table_inetNetToMediaTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform inetNetToMediaTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize inetNetToMediaTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("inetNetToMediaTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _inetNetToMediaTable_initialize_interface(user_context, flags);
+} /* initialize_table_inetNetToMediaTable */
+
+/**
+ * Shutdown the table inetNetToMediaTable
+ */
+void
+shutdown_table_inetNetToMediaTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _inetNetToMediaTable_shutdown_interface
+ (&inetNetToMediaTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+inetNetToMediaTable_rowreq_ctx_init(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra inetNetToMediaTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+inetNetToMediaTable_rowreq_ctx_cleanup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra inetNetToMediaTable rowreq cleanup.
+ */
+} /* inetNetToMediaTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+inetNetToMediaTable_pre_request(inetNetToMediaTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform inetNetToMediaTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+inetNetToMediaTable_post_request(inetNetToMediaTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform inetNetToMediaTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (inetNetToMediaTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ inetNetToMediaTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement inetNetToMediaTable data context functions.
+ */
+/*
+ * inetNetToMediaTable_allocate_data
+ *
+ * Purpose: create new inetNetToMediaTable_data.
+ */
+inetNetToMediaTable_data *
+inetNetToMediaTable_allocate_data(void)
+{
+ /*
+ * TODO:201:r: |-> allocate memory for the inetNetToMediaTable data context.
+ */
+ /** this might not be right for netsnmp_inetmedia_entry */
+ inetNetToMediaTable_data *rtn = netsnmp_access_arp_entry_create();
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "inetNetToMediaTable_data.\n");
+ }
+
+ return rtn;
+} /* inetNetToMediaTable_allocate_data */
+
+/*
+ * inetNetToMediaTable_release_data
+ *
+ * Purpose: release inetNetToMediaTable data.
+ */
+void
+inetNetToMediaTable_release_data(inetNetToMediaTable_data * data)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_release_data", "called\n"));
+
+ /*
+ * TODO:202:r: |-> release memory for the inetNetToMediaTable data context.
+ */
+ netsnmp_access_arp_entry_free(data);
+} /* inetNetToMediaTable_release_data */
+
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param inetNetToMediaIfIndex_val
+ * @param inetNetToMediaNetAddressType_val
+ * @param inetNetToMediaNetAddress_val_ptr
+ * @param inetNetToMediaNetAddress_val_ptr_len
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+inetNetToMediaTable_indexes_set_tbl_idx(inetNetToMediaTable_mib_index *
+ tbl_idx,
+ long inetNetToMediaIfIndex_val,
+ u_long
+ inetNetToMediaNetAddressType_val,
+ char
+ *inetNetToMediaNetAddress_val_ptr,
+ size_t
+ inetNetToMediaNetAddress_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * inetNetToMediaIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ /** WARNING: this code might not work for netsnmp_arp_entry */
+ tbl_idx->inetNetToMediaIfIndex = inetNetToMediaIfIndex_val;
+
+ /*
+ * inetNetToMediaNetAddressType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /** WARNING: this code might not work for netsnmp_arp_entry */
+ tbl_idx->inetNetToMediaNetAddressType =
+ inetNetToMediaNetAddressType_val;
+
+ /*
+ * inetNetToMediaNetAddress(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->inetNetToMediaNetAddress_len = sizeof(tbl_idx->inetNetToMediaNetAddress) / sizeof(tbl_idx->inetNetToMediaNetAddress[0]); /* max length */
+ /** WARNING: this code might not work for netsnmp_arp_entry */
+ /*
+ * make sure there is enough space for inetNetToMediaNetAddress data
+ */
+ if (tbl_idx->inetNetToMediaNetAddress_len <
+ inetNetToMediaNetAddress_val_ptr_len) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->inetNetToMediaNetAddress_len =
+ inetNetToMediaNetAddress_val_ptr_len;
+ memcpy(tbl_idx->inetNetToMediaNetAddress,
+ inetNetToMediaNetAddress_val_ptr,
+ inetNetToMediaNetAddress_val_ptr_len *
+ sizeof(inetNetToMediaNetAddress_val_ptr[0]));
+
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+inetNetToMediaTable_indexes_set(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, long inetNetToMediaIfIndex_val,
+ u_long inetNetToMediaNetAddressType_val,
+ char *inetNetToMediaNetAddress_val_ptr,
+ size_t
+ inetNetToMediaNetAddress_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ inetNetToMediaTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ inetNetToMediaIfIndex_val,
+ inetNetToMediaNetAddressType_val,
+ inetNetToMediaNetAddress_val_ptr,
+ inetNetToMediaNetAddress_val_ptr_len))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != inetNetToMediaTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaPhysAddress
+ * inetNetToMediaPhysAddress is subid 4 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.35.1.4
+ * Description:
+The media-dependent `physical' address.
+
+
+ As the entries in this table are typically not persistent
+ when this object is written the entity SHOULD NOT save the
+ change to non-volatile storage.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 0 - 65535;
+ *
+ * Its syntax is PhysAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 65535)
+ */
+/**
+ * Extract the current value of the inetNetToMediaPhysAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaPhysAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param inetNetToMediaPhysAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by inetNetToMediaPhysAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*inetNetToMediaPhysAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update inetNetToMediaPhysAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+inetNetToMediaPhysAddress_get(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ char **inetNetToMediaPhysAddress_val_ptr_ptr,
+ size_t
+ * inetNetToMediaPhysAddress_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != inetNetToMediaPhysAddress_val_ptr_ptr)
+ && (NULL != *inetNetToMediaPhysAddress_val_ptr_ptr));
+ netsnmp_assert(NULL != inetNetToMediaPhysAddress_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaPhysAddress_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetNetToMediaPhysAddress data.
+ * copy (* inetNetToMediaPhysAddress_val_ptr_ptr ) data and (* inetNetToMediaPhysAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ if ((*inetNetToMediaPhysAddress_val_ptr_len_ptr) <
+ rowreq_ctx->data->arp_physaddress_len)
+ return MFD_SKIP;
+
+ memcpy((*inetNetToMediaPhysAddress_val_ptr_ptr),
+ rowreq_ctx->data->arp_physaddress,
+ rowreq_ctx->data->arp_physaddress_len);
+ (*inetNetToMediaPhysAddress_val_ptr_len_ptr) =
+ rowreq_ctx->data->arp_physaddress_len;
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaPhysAddress_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaLastUpdated
+ * inetNetToMediaLastUpdated is subid 5 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.35.1.5
+ * Description:
+The value of sysUpTime at the time this entry was last
+ updated. If this entry was updated prior to the last re-
+ initialization of the local network management subsystem,
+ then this object contains a zero value.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is TimeStamp (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the inetNetToMediaLastUpdated data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaLastUpdated_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetNetToMediaLastUpdated_get(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long * inetNetToMediaLastUpdated_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetNetToMediaLastUpdated_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaLastUpdated_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetNetToMediaLastUpdated data.
+ * copy (* inetNetToMediaLastUpdated_val_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * xxx-rks: get this value?
+ */
+ return MFD_SKIP;
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaLastUpdated_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaType
+ * inetNetToMediaType is subid 6 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.35.1.6
+ * Description:
+The type of mapping.
+
+
+ Setting this object to the value invalid(2) has the effect
+ of invalidating the corresponding entry in the
+ inetNetToMediaTable. That is, it effectively dis-
+ associates the interface identified with said entry from the
+ mapping identified with said entry. It is an
+ implementation- specific matter as to whether the agent
+ removes an invalidated entry from the table. Accordingly,
+ management stations must be prepared to receive tabular
+ information from agents that corresponds to entries not
+ currently in use. Proper interpretation of such entries
+ requires examination of the relevant inetNetToMediaType
+ object.
+
+
+ The 'dynamic(3)' type indicates that the IP address to
+ physical addresses mapping has been dynamically resolved
+ using e.g. IPv4 ARP or the IPv6 Neighbor Discovery protocol.
+
+
+ The 'static(4)' type indicates that the mapping has been
+ statically configured. Both of these refer to entries that
+ provide mappings for other entities addresses.
+
+
+ The 'local(5)' type indicates that the mapping is provided
+ for an entity's own interface address.
+
+
+ As the entries in this table are typically not persistent
+ when this object is written the entity SHOULD NOT save the
+
+
+
+
+ change to non-volatile storage.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: static
+ *
+ * Enum range: 5/8. Values: other(1), invalid(2), dynamic(3), static(4), local(5)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the inetNetToMediaType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetNetToMediaType_get(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long * inetNetToMediaType_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetNetToMediaType_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaType_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetNetToMediaType data.
+ * copy (* inetNetToMediaType_val_ptr ) from rowreq_ctx->data
+ */
+ (*inetNetToMediaType_val_ptr) = rowreq_ctx->data->arp_type;
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaType_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaState
+ * inetNetToMediaState is subid 7 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.35.1.7
+ * Description:
+The Neighbor Unreachability Detection [4] state for the
+ interface when the address mapping in this entry is used.
+ If Neighbor Unreachability Detection is not in use (e.g. for
+ IPv4), this object is always unknown(6).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 6/8. Values: reachable(1), stale(2), delay(3), probe(4), invalid(5), unknown(6), incomplete(7)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the inetNetToMediaState data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaState_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetNetToMediaState_get(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long * inetNetToMediaState_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetNetToMediaState_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaState_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetNetToMediaState data.
+ * copy (* inetNetToMediaState_val_ptr ) from rowreq_ctx->data
+ */
+ (*inetNetToMediaState_val_ptr) = rowreq_ctx->data->arp_state;
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaState_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaRowStatus
+ * inetNetToMediaRowStatus is subid 8 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.35.1.8
+ * Description:
+The status of this conceptual row.
+
+
+ The RowStatus TC requires that this DESCRIPTION clause
+ states under which circumstances other objects in this row
+ can be modified. The value of this object has no effect on
+ whether other objects in this conceptual row can be
+ modified.
+
+
+ A conceptual row can not be made active until the
+ inetNetToMediaPhysAddress object has been set.
+
+
+
+
+ Note that if the inetNetToMediaType is set to 'invalid' the
+ managed node may delete the entry independent of the state
+ of this object.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the inetNetToMediaRowStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaRowStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetNetToMediaRowStatus_get(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long * inetNetToMediaRowStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetNetToMediaRowStatus_val_ptr);
+
+ (*inetNetToMediaRowStatus_val_ptr) =
+ rowreq_ctx->inetNetToMediaRowStatus;
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaRowStatus_get */
+
+
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * inetNetToMediaTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * inetNetToMediaTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetNetToMediaTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+inetNetToMediaTable_undo_setup(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup inetNetToMediaTable undo.
+ * set up inetNetToMediaTable undo information, in preparation for a set.
+ * Undo storage is in (* inetNetToMediaRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* inetNetToMediaTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetNetToMediaTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+inetNetToMediaTable_undo(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> inetNetToMediaTable undo.
+ * inetNetToMediaTable undo information, in response to a failed set.
+ * Undo storage is in (* inetNetToMediaRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* inetNetToMediaTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetNetToMediaTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+inetNetToMediaTable_undo_cleanup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup inetNetToMediaTable undo.
+ * Undo storage is in (* inetNetToMediaRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* inetNetToMediaTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * inetNetToMediaTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+inetNetToMediaTable_commit(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit inetNetToMediaTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+#if 1
+ /** xxx-rks:9 nettomedia commit */
+#else
+ if (save_flags & COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG) {
+ save_flags &= ~COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG; /* clear inetNetToMediaPhysAddress */
+ /*
+ * TODO:482:o: |-> commit column inetNetToMediaPhysAddress.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "inetNetToMediaTable column inetNetToMediaPhysAddress commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo inetNetToMediaPhysAddress
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_INETNETTOMEDIATYPE_FLAG) {
+ save_flags &= ~COLUMN_INETNETTOMEDIATYPE_FLAG; /* clear inetNetToMediaType */
+ /*
+ * TODO:482:o: |-> commit column inetNetToMediaType.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "inetNetToMediaTable column inetNetToMediaType commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo inetNetToMediaType
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_INETNETTOMEDIATYPE_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_INETNETTOMEDIAROWSTATUS_FLAG) {
+ save_flags &= ~COLUMN_INETNETTOMEDIAROWSTATUS_FLAG; /* clear inetNetToMediaRowStatus */
+ /*
+ * TODO:482:o: |-> commit column inetNetToMediaRowStatus.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "inetNetToMediaTable column inetNetToMediaRowStatus commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo inetNetToMediaRowStatus
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_INETNETTOMEDIAROWSTATUS_FLAG;
+ }
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+#endif
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* inetNetToMediaTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * inetNetToMediaTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+inetNetToMediaTable_undo_commit(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo inetNetToMediaTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* inetNetToMediaTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement inetNetToMediaTable node value checks.
+ * TODO:450:M: Implement inetNetToMediaTable undo functions.
+ * TODO:460:M: Implement inetNetToMediaTable set functions.
+ * TODO:480:M: Implement inetNetToMediaTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaPhysAddress
+ * inetNetToMediaPhysAddress is subid 4 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.35.1.4
+ * Description:
+The media-dependent `physical' address.
+
+
+ As the entries in this table are typically not persistent
+ when this object is written the entity SHOULD NOT save the
+ change to non-volatile storage.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 0 - 65535;
+ *
+ * Its syntax is PhysAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 65535)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaPhysAddress_val_ptr
+ * A char containing the new value.
+ * @param inetNetToMediaPhysAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by inetNetToMediaPhysAddress_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * Since you aren't using a generated data context, you also need to
+ * check the length, to make sure you don't overflow your storage space.
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetNetToMediaTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is in (one of) the range set(s): 0 - 65535
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetNetToMediaPhysAddress_check_value(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, char
+ *inetNetToMediaPhysAddress_val_ptr,
+ size_t
+ inetNetToMediaPhysAddress_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaPhysAddress_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != inetNetToMediaPhysAddress_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetNetToMediaPhysAddress value.
+ */
+
+ return MFD_SUCCESS; /* inetNetToMediaPhysAddress value not illegal */
+} /* inetNetToMediaPhysAddress_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetNetToMediaTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * inetNetToMediaTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+inetNetToMediaPhysAddress_undo_setup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaPhysAddress_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup inetNetToMediaPhysAddress undo.
+ */
+ /*
+ * copy inetNetToMediaPhysAddress and inetNetToMediaPhysAddress_len data
+ * set rowreq_ctx->undo->inetNetToMediaPhysAddress from rowreq_ctx->data->inetNetToMediaPhysAddress
+ */
+
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaPhysAddress_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetNetToMediaPhysAddress_val_ptr
+ * A char containing the new value.
+ * @param inetNetToMediaPhysAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by inetNetToMediaPhysAddress_val_ptr
+ */
+int
+inetNetToMediaPhysAddress_set(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ char *inetNetToMediaPhysAddress_val_ptr,
+ size_t inetNetToMediaPhysAddress_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaPhysAddress_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != inetNetToMediaPhysAddress_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set inetNetToMediaPhysAddress value.
+ * set inetNetToMediaPhysAddress value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaPhysAddress_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+inetNetToMediaPhysAddress_undo(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaPhysAddress_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up inetNetToMediaPhysAddress undo.
+ */
+ /*
+ * copy inetNetToMediaPhysAddress and inetNetToMediaPhysAddress_len data
+ * set rowreq_ctx->data->inetNetToMediaPhysAddress from rowreq_ctx->undo->inetNetToMediaPhysAddress
+ */
+
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaPhysAddress_undo */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaType
+ * inetNetToMediaType is subid 6 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.35.1.6
+ * Description:
+The type of mapping.
+
+
+ Setting this object to the value invalid(2) has the effect
+ of invalidating the corresponding entry in the
+ inetNetToMediaTable. That is, it effectively dis-
+ associates the interface identified with said entry from the
+ mapping identified with said entry. It is an
+ implementation- specific matter as to whether the agent
+ removes an invalidated entry from the table. Accordingly,
+ management stations must be prepared to receive tabular
+ information from agents that corresponds to entries not
+ currently in use. Proper interpretation of such entries
+ requires examination of the relevant inetNetToMediaType
+ object.
+
+
+ The 'dynamic(3)' type indicates that the IP address to
+ physical addresses mapping has been dynamically resolved
+ using e.g. IPv4 ARP or the IPv6 Neighbor Discovery protocol.
+
+
+ The 'static(4)' type indicates that the mapping has been
+ statically configured. Both of these refer to entries that
+ provide mappings for other entities addresses.
+
+
+ The 'local(5)' type indicates that the mapping is provided
+ for an entity's own interface address.
+
+
+ As the entries in this table are typically not persistent
+ when this object is written the entity SHOULD NOT save the
+
+
+
+
+ change to non-volatile storage.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: static
+ *
+ * Enum range: 5/8. Values: other(1), invalid(2), dynamic(3), static(4), local(5)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetNetToMediaTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of other(1), invalid(2), dynamic(3), static(4), local(5)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetNetToMediaType_check_value(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long inetNetToMediaType_val)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaType_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetNetToMediaType value.
+ */
+
+ return MFD_SUCCESS; /* inetNetToMediaType value not illegal */
+} /* inetNetToMediaType_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetNetToMediaTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * inetNetToMediaTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+inetNetToMediaType_undo_setup(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaType_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup inetNetToMediaType undo.
+ */
+ /*
+ * copy inetNetToMediaType data
+ * set rowreq_ctx->undo->inetNetToMediaType from rowreq_ctx->data->inetNetToMediaType
+ */
+
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaType_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetNetToMediaType_val
+ * A long containing the new value.
+ */
+int
+inetNetToMediaType_set(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long inetNetToMediaType_val)
+{
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaType_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set inetNetToMediaType value.
+ * set inetNetToMediaType value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaType_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+inetNetToMediaType_undo(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaType_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up inetNetToMediaType undo.
+ */
+ /*
+ * copy inetNetToMediaType data
+ * set rowreq_ctx->data->inetNetToMediaType from rowreq_ctx->undo->inetNetToMediaType
+ */
+
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaType_undo */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaRowStatus
+ * inetNetToMediaRowStatus is subid 8 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.35.1.8
+ * Description:
+The status of this conceptual row.
+
+
+ The RowStatus TC requires that this DESCRIPTION clause
+ states under which circumstances other objects in this row
+ can be modified. The value of this object has no effect on
+ whether other objects in this conceptual row can be
+ modified.
+
+
+ A conceptual row can not be made active until the
+ inetNetToMediaPhysAddress object has been set.
+
+
+
+
+ Note that if the inetNetToMediaType is set to 'invalid' the
+ managed node may delete the entry independent of the state
+ of this object.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaRowStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetNetToMediaTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetNetToMediaRowStatus_check_value(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetNetToMediaRowStatus_val)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaRowStatus_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetNetToMediaRowStatus value.
+ */
+
+ return MFD_SUCCESS; /* inetNetToMediaRowStatus value not illegal */
+} /* inetNetToMediaRowStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetNetToMediaTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * inetNetToMediaTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+inetNetToMediaRowStatus_undo_setup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaRowStatus_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup inetNetToMediaRowStatus undo.
+ */
+ /*
+ * copy inetNetToMediaRowStatus data
+ * set rowreq_ctx->undo->inetNetToMediaRowStatus from rowreq_ctx->data->inetNetToMediaRowStatus
+ */
+ rowreq_ctx->inetNetToMediaRowStatus_undo =
+ rowreq_ctx->inetNetToMediaRowStatus;
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaRowStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetNetToMediaRowStatus_val
+ * A long containing the new value.
+ */
+int
+inetNetToMediaRowStatus_set(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long inetNetToMediaRowStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaRowStatus_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set inetNetToMediaRowStatus value.
+ * set inetNetToMediaRowStatus value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaRowStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+inetNetToMediaRowStatus_undo(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaRowStatus_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up inetNetToMediaRowStatus undo.
+ */
+ /*
+ * copy inetNetToMediaRowStatus data
+ * set rowreq_ctx->data->inetNetToMediaRowStatus from rowreq_ctx->undo->inetNetToMediaRowStatus
+ */
+ rowreq_ctx->inetNetToMediaRowStatus =
+ rowreq_ctx->inetNetToMediaRowStatus_undo;
+
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaRowStatus_undo */
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * inetNetToMediaTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-inetNetToMediaTable if you don't have dependencies)
+ */
+int
+inetNetToMediaTable_check_dependencies(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:inetNetToMediaTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check inetNetToMediaTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_INETNETTOMEDIAROWSTATUS_FLAG) {
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition(rowreq_ctx->
+ inetNetToMediaRowStatus_undo,
+ rowreq_ctx->
+ inetNetToMediaRowStatus);
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ if (ROWSTATUS_DESTROY == rowreq_ctx->inetNetToMediaRowStatus) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ } else if (ROWSTATUS_CREATEANDGO ==
+ rowreq_ctx->inetNetToMediaRowStatus) {
+ if ((rowreq_ctx->
+ column_set_flags & INETNETTOMEDIATABLE_REQUIRED_COLS)
+ != INETNETTOMEDIATABLE_REQUIRED_COLS) {
+ DEBUGMSGTL(("inetNetToMediaTable",
+ "required columns missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_set_flags,
+ INETNETTOMEDIATABLE_REQUIRED_COLS));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ rowreq_ctx->inetNetToMediaRowStatus = ROWSTATUS_ACTIVE;
+ }
+ } /* row creation */
+ else {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY == rowreq_ctx->inetNetToMediaRowStatus) {
+ if (rowreq_ctx->
+ column_set_flags &
+ ~COLUMN_INETNETTOMEDIAROWSTATUS_FLAG) {
+ DEBUGMSGTL(("inetNetToMediaTable",
+ "destroy must be only varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+ } /* row change */
+ } else {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ DEBUGMSGTL(("inetNetToMediaTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ } /* row status not set */
+
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return rc;
+} /* inetNetToMediaTable_check_dependencies */
+
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
new file mode 100644
index 0000000000..aad8ad9a83
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
@@ -0,0 +1,413 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: inetNetToMediaTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef INETNETTOMEDIATABLE_H
+#define INETNETTOMEDIATABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/arp.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(ip-mib/data_access/arp)
+config_require(ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface)
+config_require(ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for inetNetToMediaTable
+ */
+#include "inetNetToMediaTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_inetNetToMediaTable(void);
+ void shutdown_inetNetToMediaTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review inetNetToMediaTable registration context.
+ */
+ typedef netsnmp_data_list inetNetToMediaTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review inetNetToMediaTable data context structure.
+ * This structure is used to represent the data for inetNetToMediaTable.
+ */
+ typedef netsnmp_arp_entry inetNetToMediaTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review inetNetToMediaTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef inetNetToMediaTable_data inetNetToMediaTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review inetNetToMediaTable mib index.
+ * This structure is used to represent the index for inetNetToMediaTable.
+ */
+ typedef struct inetNetToMediaTable_mib_index_s {
+
+ /*
+ * inetNetToMediaIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ long inetNetToMediaIfIndex;
+
+ /*
+ * inetNetToMediaNetAddressType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long inetNetToMediaNetAddressType;
+
+ /*
+ * inetNetToMediaNetAddress(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /** 128 - 2(other indexes) - oid length(10) = 115 */
+ char inetNetToMediaNetAddress[115];
+ size_t inetNetToMediaNetAddress_len;
+
+
+ } inetNetToMediaTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review inetNetToMediaTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(8)
+ */
+#define MAX_inetNetToMediaTable_IDX_LEN 118
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review inetNetToMediaTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * inetNetToMediaTable_rowreq_ctx pointer.
+ */
+ typedef struct inetNetToMediaTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_inetNetToMediaTable_IDX_LEN];
+
+ inetNetToMediaTable_mib_index tbl_idx;
+
+ inetNetToMediaTable_data *data;
+ inetNetToMediaTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to inetNetToMediaTable rowreq context.
+ */
+ int inetNetToMediaRowStatus,
+ inetNetToMediaRowStatus_undo;
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *inetNetToMediaTable_data_list;
+
+ } inetNetToMediaTable_rowreq_ctx;
+
+ typedef struct inetNetToMediaTable_ref_rowreq_ctx_s {
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx;
+ } inetNetToMediaTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ inetNetToMediaTable_pre_request(inetNetToMediaTable_registration *
+ user_context);
+ int
+ inetNetToMediaTable_post_request(inetNetToMediaTable_registration *
+ user_context, int rc);
+
+ int
+ inetNetToMediaTable_rowreq_ctx_init(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ inetNetToMediaTable_rowreq_ctx_cleanup
+ (inetNetToMediaTable_rowreq_ctx * rowreq_ctx);
+
+ inetNetToMediaTable_data *inetNetToMediaTable_allocate_data(void);
+ void
+ inetNetToMediaTable_release_data(inetNetToMediaTable_data * data);
+
+ int
+ inetNetToMediaTable_check_dependencies
+ (inetNetToMediaTable_rowreq_ctx * rowreq_ctx);
+ int
+ inetNetToMediaTable_commit(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+
+ inetNetToMediaTable_rowreq_ctx
+ * inetNetToMediaTable_row_find_by_mib_index
+ (inetNetToMediaTable_mib_index * mib_idx);
+
+ extern oid inetNetToMediaTable_oid[];
+ extern int inetNetToMediaTable_oid_size;
+
+
+#include "inetNetToMediaTable_interface.h"
+#include "inetNetToMediaTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+ /*
+ * indexes
+ */
+
+ int
+ inetNetToMediaPhysAddress_get(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, char
+ **inetNetToMediaPhysAddress_val_ptr_ptr,
+ size_t *
+ inetNetToMediaPhysAddress_val_ptr_len_ptr);
+ int
+ inetNetToMediaLastUpdated_get(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ inetNetToMediaLastUpdated_val_ptr);
+ int inetNetToMediaType_get(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ inetNetToMediaType_val_ptr);
+ int inetNetToMediaState_get(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ inetNetToMediaState_val_ptr);
+ int
+ inetNetToMediaRowStatus_get(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ inetNetToMediaRowStatus_val_ptr);
+
+
+ int
+ inetNetToMediaTable_indexes_set_tbl_idx
+ (inetNetToMediaTable_mib_index * tbl_idx,
+ long inetNetToMediaIfIndex_val,
+ u_long inetNetToMediaNetAddressType_val,
+ char *inetNetToMediaNetAddress_val_ptr,
+ size_t inetNetToMediaNetAddress_val_ptr_len);
+ int
+ inetNetToMediaTable_indexes_set(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ long inetNetToMediaIfIndex_val,
+ u_long
+ inetNetToMediaNetAddressType_val,
+ char
+ *inetNetToMediaNetAddress_val_ptr,
+ size_t
+ inetNetToMediaNetAddress_val_ptr_len);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+
+
+ int
+ inetNetToMediaTable_undo_setup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ inetNetToMediaTable_undo_cleanup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetNetToMediaTable_undo(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ inetNetToMediaTable_commit(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ inetNetToMediaTable_undo_commit(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ inetNetToMediaPhysAddress_check_value
+ (inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ char *inetNetToMediaPhysAddress_val_ptr,
+ size_t inetNetToMediaPhysAddress_val_ptr_len);
+ int
+ inetNetToMediaPhysAddress_undo_setup(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ inetNetToMediaPhysAddress_set(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, char
+ *inetNetToMediaPhysAddress_val_ptr,
+ size_t
+ inetNetToMediaPhysAddress_val_ptr_len);
+ int
+ inetNetToMediaPhysAddress_undo(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ inetNetToMediaLastUpdated_check_value
+ (inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long inetNetToMediaLastUpdated_val);
+ int
+ inetNetToMediaLastUpdated_undo_setup(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ inetNetToMediaLastUpdated_set(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ inetNetToMediaLastUpdated_val);
+ int
+ inetNetToMediaLastUpdated_undo(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ inetNetToMediaType_check_value(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetNetToMediaType_val);
+ int
+ inetNetToMediaType_undo_setup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetNetToMediaType_set(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetNetToMediaType_val);
+ int inetNetToMediaType_undo(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ inetNetToMediaState_check_value(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetNetToMediaState_val);
+ int
+ inetNetToMediaState_undo_setup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetNetToMediaState_set(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ inetNetToMediaState_val);
+ int inetNetToMediaState_undo(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ inetNetToMediaRowStatus_check_value(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ inetNetToMediaRowStatus_val);
+ int
+ inetNetToMediaRowStatus_undo_setup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ inetNetToMediaRowStatus_undo(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ inetNetToMediaTable_check_dependencies
+ (inetNetToMediaTable_rowreq_ctx * ctx);
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* INETNETTOMEDIATABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h
new file mode 100644
index 0000000000..819739581e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h
@@ -0,0 +1,161 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: inetNetToMediaTable_constants.h 13759 2005-12-01 00:45:50Z rstory $
+ */
+#ifndef INETNETTOMEDIATABLE_CONSTANTS_H
+#define INETNETTOMEDIATABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table inetNetToMediaTable
+ */
+#define INETNETTOMEDIATABLE_OID 1,3,6,1,2,1,4,35
+
+#define COLUMN_INETNETTOMEDIAIFINDEX 1
+
+#define COLUMN_INETNETTOMEDIANETADDRESSTYPE 2
+
+#define COLUMN_INETNETTOMEDIANETADDRESS 3
+
+#define COLUMN_INETNETTOMEDIAPHYSADDRESS 4
+#define COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG (0x1 << 3)
+
+#define COLUMN_INETNETTOMEDIALASTUPDATED 5
+
+#define COLUMN_INETNETTOMEDIATYPE 6
+#define COLUMN_INETNETTOMEDIATYPE_FLAG (0x1 << 5)
+
+#define COLUMN_INETNETTOMEDIASTATE 7
+
+#define COLUMN_INETNETTOMEDIAROWSTATUS 8
+#define COLUMN_INETNETTOMEDIAROWSTATUS_FLAG (0x1 << 7)
+
+
+#define INETNETTOMEDIATABLE_MIN_COL COLUMN_INETNETTOMEDIAPHYSADDRESS
+#define INETNETTOMEDIATABLE_MAX_COL COLUMN_INETNETTOMEDIAROWSTATUS
+
+
+ /*
+ * TODO:405:r: Review INETNETTOMEDIATABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define INETNETTOMEDIATABLE_SETTABLE_COLS (COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG | COLUMN_INETNETTOMEDIATYPE_FLAG | COLUMN_INETNETTOMEDIAROWSTATUS_FLAG)
+ /*
+ * TODO:405:r: Review INETNETTOMEDIATABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define INETNETTOMEDIATABLE_REQUIRED_COLS (COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG | COLUMN_INETNETTOMEDIAROWSTATUS_FLAG)
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table inetNetToMediaTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * inetNetToMediaNetAddressType (InetAddressType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETADDRESSTYPE_ENUMS
+#define INETADDRESSTYPE_ENUMS
+
+#define INETADDRESSTYPE_UNKNOWN 0
+#define INETADDRESSTYPE_IPV4 1
+#define INETADDRESSTYPE_IPV6 2
+#define INETADDRESSTYPE_IPV4Z 3
+#define INETADDRESSTYPE_IPV6Z 4
+#define INETADDRESSTYPE_DNS 16
+
+#endif /* INETADDRESSTYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * inetNetToMediaType (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETNETTOMEDIATYPE_ENUMS
+#define INETNETTOMEDIATYPE_ENUMS
+
+#define INETNETTOMEDIATYPE_OTHER 1
+#define INETNETTOMEDIATYPE_INVALID 2
+#define INETNETTOMEDIATYPE_DYNAMIC 3
+#define INETNETTOMEDIATYPE_STATIC 4
+#define INETNETTOMEDIATYPE_LOCAL 5
+
+#endif /* INETNETTOMEDIATYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * inetNetToMediaState (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETNETTOMEDIASTATE_ENUMS
+#define INETNETTOMEDIASTATE_ENUMS
+
+#define INETNETTOMEDIASTATE_REACHABLE 1
+#define INETNETTOMEDIASTATE_STALE 2
+#define INETNETTOMEDIASTATE_DELAY 3
+#define INETNETTOMEDIASTATE_PROBE 4
+#define INETNETTOMEDIASTATE_INVALID 5
+#define INETNETTOMEDIASTATE_UNKNOWN 6
+#define INETNETTOMEDIASTATE_INCOMPLETE 7
+
+#endif /* INETNETTOMEDIASTATE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * inetNetToMediaRowStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* INETNETTOMEDIATABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
new file mode 100644
index 0000000000..cad942c621
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
@@ -0,0 +1,619 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: inetNetToMediaTable_data_access.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "inetNetToMediaTable.h"
+
+
+#include "inetNetToMediaTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+
+/**
+ * initialization for inetNetToMediaTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param inetNetToMediaTable_reg
+ * Pointer to inetNetToMediaTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+inetNetToMediaTable_init_data(inetNetToMediaTable_registration *
+ inetNetToMediaTable_reg)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize inetNetToMediaTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+inetNetToMediaTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to inetNetToMediaTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to inetNetToMediaTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up inetNetToMediaTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = INETNETTOMEDIATABLE_CACHE_TIMEOUT; /* seconds */
+} /* inetNetToMediaTable_container_init */
+
+/**
+ * check entry for update
+ *
+ */
+static void
+_snarf_arp_entry(netsnmp_arp_entry *arp_entry,
+ netsnmp_container *container)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx;
+ int inetAddressType;
+
+ DEBUGTRACE;
+
+ netsnmp_assert(NULL != arp_entry);
+ netsnmp_assert(NULL != container);
+
+ /*
+ * convert the addr len to an inetAddressType
+ */
+ switch (arp_entry->arp_ipaddress_len) {
+ case 4:
+ inetAddressType = INETADDRESSTYPE_IPV4;
+ break;
+
+ case 6:
+ inetAddressType = INETADDRESSTYPE_IPV6;
+ break;
+
+ default:
+ netsnmp_access_arp_entry_free(arp_entry);
+ snmp_log(LOG_ERR, "unsupported address type\n");
+ return;
+ }
+
+ /*
+ * allocate an row context and set the index(es), then add it to
+ * the container
+ */
+ rowreq_ctx = inetNetToMediaTable_allocate_rowreq_ctx(arp_entry, NULL);
+ if ((NULL != rowreq_ctx) &&
+ (MFD_SUCCESS == inetNetToMediaTable_indexes_set
+ (rowreq_ctx, rowreq_ctx->data->if_index, inetAddressType,
+ rowreq_ctx->data->arp_ipaddress,
+ rowreq_ctx->data->arp_ipaddress_len))) {
+ rowreq_ctx->inetNetToMediaRowStatus = ROWSTATUS_ACTIVE;
+ CONTAINER_INSERT(container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "inetNetToMediaTable cache.\n");
+ inetNetToMediaTable_release_rowreq_ctx(rowreq_ctx);
+ } else
+ netsnmp_access_arp_entry_free(arp_entry);
+ }
+}
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before inetNetToMediaTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+inetNetToMediaTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to inetNetToMediaTable_container_shutdown\n");
+ return;
+ }
+
+} /* inetNetToMediaTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement inetNetToMediaTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * inetNetToMediaTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+inetNetToMediaTable_container_load(netsnmp_container *container)
+{
+ netsnmp_container *arp_container;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_cache_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the inetNetToMediaTable container.
+ * loop over your inetNetToMediaTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ arp_container =
+ netsnmp_access_arp_container_load(NULL,
+ NETSNMP_ACCESS_ARP_LOAD_NOFLAGS);
+ if (NULL == arp_container)
+ return MFD_RESOURCE_UNAVAILABLE; /* msg already logged */
+
+ /*
+ * we just got a fresh copy of data. snarf data
+ */
+ CONTAINER_FOR_EACH(arp_container,
+ (netsnmp_container_obj_func *) _snarf_arp_entry,
+ container);
+
+ /*
+ * free the container. we've either claimed each entry, or released it,
+ * so the access function doesn't need to clear the container.
+ */
+ netsnmp_access_arp_container_free(arp_container,
+ NETSNMP_ACCESS_ARP_FREE_DONT_CLEAR);
+
+ DEBUGMSGT(("verbose:inetNetToMediaTable:inetNetToMediaTable_cache_load", "%d records\n", CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+inetNetToMediaTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free inetNetToMediaTable container data.
+ */
+} /* inetNetToMediaTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+inetNetToMediaTable_row_prep(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_row_prep */
+
+/*
+ * TODO:420:r: Implement inetNetToMediaTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaIfIndex
+ * inetNetToMediaIfIndex is subid 1 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.35.1.1
+ * Description:
+The index value which uniquely identifies the interface to
+ which this entry is applicable. The interface identified by
+ a particular value of this index is the same interface as
+ identified by the same value of the IF-MIB's ifIndex.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: d
+ *
+ * Ranges: 1 - 2147483647;
+ *
+ * Its syntax is InterfaceIndex (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE inetNetToMediaIfIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of inetNetToMediaIfIndex index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * inetNetToMediaTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The value is in (one of) the range set(s): 1 - 2147483647
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+inetNetToMediaIfIndex_check_index(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaIfIndex_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check inetNetToMediaTable index inetNetToMediaIfIndex.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.inetNetToMediaIfIndex)
+ */
+
+ return MFD_SUCCESS; /* inetNetToMediaIfIndex index ok */
+} /* inetNetToMediaIfIndex_check_index */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaNetAddressType
+ * inetNetToMediaNetAddressType is subid 2 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.35.1.2
+ * Description:
+The type of inetNetToMediaNetAddress.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 1 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 5/8. Values: unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16)
+ *
+ * Its syntax is InetAddressType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ *
+ *
+ *
+ * NOTE: NODE inetNetToMediaNetAddressType IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of inetNetToMediaNetAddressType index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * inetNetToMediaTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The value is one of unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+inetNetToMediaNetAddressType_check_index(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaNetAddressType_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check inetNetToMediaTable index inetNetToMediaNetAddressType.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.inetNetToMediaNetAddressType)
+ */
+
+ return MFD_SUCCESS; /* inetNetToMediaNetAddressType index ok */
+} /* inetNetToMediaNetAddressType_check_index */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaNetAddress
+ * inetNetToMediaNetAddress is subid 3 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.35.1.3
+ * Description:
+The IP Address corresponding to the media-dependent
+ `physical' address. The address type of this object is
+ specified in inetNetToMediaAddressType.
+
+
+ Implementors need to be aware that if the size of
+ inetNetToMediaNetAddress exceeds 115 octets then OIDS of
+ instances of columns in this row will have more than 128
+ sub-identifiers and cannot be accessed using SNMPv1, SNMPv2c
+ or SNMPv3.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is InetAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ *
+ *
+ *
+ * NOTE: NODE inetNetToMediaNetAddress IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of inetNetToMediaNetAddress index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * inetNetToMediaTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The length is in (one of) the range set(s): 0 - 255
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+inetNetToMediaNetAddress_check_index(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaNetAddress_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check inetNetToMediaTable index inetNetToMediaNetAddress.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.inetNetToMediaNetAddress)
+ */
+
+ return MFD_SUCCESS; /* inetNetToMediaNetAddress index ok */
+} /* inetNetToMediaNetAddress_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param inetNetToMediaTable_reg
+ * Pointer to the user registration data
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+inetNetToMediaTable_validate_index(inetNetToMediaTable_registration *
+ inetNetToMediaTable_reg,
+ inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_validate_index", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:430:M: |-> Validate potential inetNetToMediaTable index.
+ */
+ if (1) {
+ snmp_log(LOG_WARNING, "invalid index for a new row in the "
+ "inetNetToMediaTable table.\n");
+ /*
+ * determine failure type.
+ *
+ * If the index could not ever be created, return MFD_NOT_EVER
+ * If the index can not be created under the present circumstances
+ * (even though it could be created under other circumstances),
+ * return MFD_NOT_NOW.
+ */
+ if (0) {
+ return MFD_CANNOT_CREATE_EVER;
+ } else {
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ }
+
+ return rc;
+} /* inetNetToMediaTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
new file mode 100644
index 0000000000..d1638cf51f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
@@ -0,0 +1,84 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: inetNetToMediaTable_data_access.h 13759 2005-12-01 00:45:50Z rstory $
+ */
+#ifndef INETNETTOMEDIATABLE_DATA_ACCESS_H
+#define INETNETTOMEDIATABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+
+
+ int
+ inetNetToMediaTable_init_data(inetNetToMediaTable_registration *
+ inetNetToMediaTable_reg);
+
+
+ /*
+ * TODO:180:o: Review inetNetToMediaTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define INETNETTOMEDIATABLE_CACHE_TIMEOUT 60
+
+ void inetNetToMediaTable_container_init(netsnmp_container
+ **container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ inetNetToMediaTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int inetNetToMediaTable_container_load(netsnmp_container
+ *container);
+ void inetNetToMediaTable_container_free(netsnmp_container
+ *container);
+
+ int inetNetToMediaTable_cache_load(netsnmp_container
+ *container);
+ void inetNetToMediaTable_cache_free(netsnmp_container
+ *container);
+
+ int
+ inetNetToMediaTable_row_prep(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ inetNetToMediaTable_validate_index(inetNetToMediaTable_registration
+ * inetNetToMediaTable_reg,
+ inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetNetToMediaIfIndex_check_index(inetNetToMediaTable_rowreq_ctx * rowreq_ctx); /* internal */
+ int inetNetToMediaNetAddressType_check_index(inetNetToMediaTable_rowreq_ctx * rowreq_ctx); /* internal */
+ int inetNetToMediaNetAddress_check_index(inetNetToMediaTable_rowreq_ctx * rowreq_ctx); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* INETNETTOMEDIATABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c
new file mode 100644
index 0000000000..33393090b7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c
@@ -0,0 +1,1994 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: inetNetToMediaTable_interface.c 15781 2007-01-23 22:55:06Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "inetNetToMediaTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "inetNetToMediaTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+typedef struct inetNetToMediaTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ inetNetToMediaTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} inetNetToMediaTable_interface_ctx;
+
+static inetNetToMediaTable_interface_ctx inetNetToMediaTable_if_ctx;
+
+static void
+ _inetNetToMediaTable_container_init(inetNetToMediaTable_interface_ctx *
+ if_ctx);
+static void
+ _inetNetToMediaTable_container_shutdown(inetNetToMediaTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+inetNetToMediaTable_container_get(void)
+{
+ return inetNetToMediaTable_if_ctx.container;
+}
+
+inetNetToMediaTable_registration *
+inetNetToMediaTable_registration_get(void)
+{
+ return inetNetToMediaTable_if_ctx.user_ctx;
+}
+
+inetNetToMediaTable_registration *
+inetNetToMediaTable_registration_set(inetNetToMediaTable_registration *
+ newreg)
+{
+ inetNetToMediaTable_registration *old =
+ inetNetToMediaTable_if_ctx.user_ctx;
+ inetNetToMediaTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+inetNetToMediaTable_container_size(void)
+{
+ return CONTAINER_SIZE(inetNetToMediaTable_if_ctx.container);
+}
+
+u_int
+inetNetToMediaTable_dirty_get(void)
+{
+ return inetNetToMediaTable_if_ctx.table_dirty;
+}
+
+void
+inetNetToMediaTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("inetNetToMediaTable:inetNetToMediaTable_dirty_set",
+ "called. was %d, now %d\n",
+ inetNetToMediaTable_if_ctx.table_dirty, status));
+ inetNetToMediaTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_pre_request;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_post_request;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_get_values;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_check_objects;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_set_values;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_undo_values;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_commit;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_irreversible_commit;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int
+ _inetNetToMediaTable_undo_column(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list *
+ var, int column);
+
+NETSNMP_STATIC_INLINE int
+ _inetNetToMediaTable_check_indexes(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+
+/**
+ * @internal
+ * Initialize the table inetNetToMediaTable
+ * (Define its contents and how it's structured)
+ */
+void
+_inetNetToMediaTable_initialize_interface(inetNetToMediaTable_registration
+ * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &inetNetToMediaTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &inetNetToMediaTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for inetNetToMediaTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: inetNetToMediaIfIndex */
+ ASN_INTEGER,
+ /** index: inetNetToMediaNetAddressType */
+ ASN_OCTET_STR,
+ /** index: inetNetToMediaNetAddress */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = INETNETTOMEDIATABLE_MIN_COL;
+ tbl_info->max_column = INETNETTOMEDIATABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ inetNetToMediaTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ inetNetToMediaTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _inetNetToMediaTable_container_init(&inetNetToMediaTable_if_ctx);
+ if (NULL == inetNetToMediaTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for inetNetToMediaTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_inetNetToMediaTable_object_lookup;
+ access_multiplexer->get_values = _mfd_inetNetToMediaTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_inetNetToMediaTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_inetNetToMediaTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_inetNetToMediaTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_inetNetToMediaTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_inetNetToMediaTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_inetNetToMediaTable_set_values;
+ access_multiplexer->undo_sets = _mfd_inetNetToMediaTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_inetNetToMediaTable_commit;
+ access_multiplexer->undo_commit = _mfd_inetNetToMediaTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_inetNetToMediaTable_irreversible_commit;
+
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_inetNetToMediaTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("inetNetToMediaTable:init_inetNetToMediaTable",
+ "Registering inetNetToMediaTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("inetNetToMediaTable", handler,
+ inetNetToMediaTable_oid,
+ inetNetToMediaTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table inetNetToMediaTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &inetNetToMediaTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ inetNetToMediaTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != inetNetToMediaTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(inetNetToMediaTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _inetNetToMediaTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table inetNetToMediaTable
+ */
+void
+_inetNetToMediaTable_shutdown_interface(inetNetToMediaTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _inetNetToMediaTable_container_shutdown(&inetNetToMediaTable_if_ctx);
+}
+
+void
+inetNetToMediaTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ inetNetToMediaTable_if_ctx.tbl_info.valid_columns = vc;
+} /* inetNetToMediaTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+inetNetToMediaTable_index_to_oid(netsnmp_index * oid_idx,
+ inetNetToMediaTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * inetNetToMediaIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_inetNetToMediaIfIndex;
+ /*
+ * inetNetToMediaNetAddressType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_inetNetToMediaNetAddressType;
+ /*
+ * inetNetToMediaNetAddress(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_inetNetToMediaNetAddress;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_inetNetToMediaIfIndex, 0x00,
+ sizeof(var_inetNetToMediaIfIndex));
+ var_inetNetToMediaIfIndex.type = ASN_INTEGER;
+ memset(&var_inetNetToMediaNetAddressType, 0x00,
+ sizeof(var_inetNetToMediaNetAddressType));
+ var_inetNetToMediaNetAddressType.type = ASN_INTEGER;
+ memset(&var_inetNetToMediaNetAddress, 0x00,
+ sizeof(var_inetNetToMediaNetAddress));
+ var_inetNetToMediaNetAddress.type = ASN_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_inetNetToMediaIfIndex.next_variable =
+ &var_inetNetToMediaNetAddressType;
+ var_inetNetToMediaNetAddressType.next_variable =
+ &var_inetNetToMediaNetAddress;
+ var_inetNetToMediaNetAddress.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_index_to_oid", "called\n"));
+
+ /*
+ * inetNetToMediaIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_inetNetToMediaIfIndex,
+ (u_char *) & mib_idx->inetNetToMediaIfIndex,
+ sizeof(mib_idx->inetNetToMediaIfIndex));
+
+ /*
+ * inetNetToMediaNetAddressType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_inetNetToMediaNetAddressType,
+ (u_char *) & mib_idx->inetNetToMediaNetAddressType,
+ sizeof(mib_idx->inetNetToMediaNetAddressType));
+
+ /*
+ * inetNetToMediaNetAddress(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_inetNetToMediaNetAddress,
+ (u_char *) & mib_idx->inetNetToMediaNetAddress,
+ mib_idx->inetNetToMediaNetAddress_len *
+ sizeof(mib_idx->inetNetToMediaNetAddress[0]));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_inetNetToMediaIfIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_inetNetToMediaIfIndex);
+
+ return err;
+} /* inetNetToMediaTable_index_to_oid */
+
+/**
+ * extract inetNetToMediaTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+inetNetToMediaTable_index_from_oid(netsnmp_index * oid_idx,
+ inetNetToMediaTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * inetNetToMediaIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_inetNetToMediaIfIndex;
+ /*
+ * inetNetToMediaNetAddressType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_inetNetToMediaNetAddressType;
+ /*
+ * inetNetToMediaNetAddress(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_inetNetToMediaNetAddress;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_inetNetToMediaIfIndex, 0x00,
+ sizeof(var_inetNetToMediaIfIndex));
+ var_inetNetToMediaIfIndex.type = ASN_INTEGER;
+ memset(&var_inetNetToMediaNetAddressType, 0x00,
+ sizeof(var_inetNetToMediaNetAddressType));
+ var_inetNetToMediaNetAddressType.type = ASN_INTEGER;
+ memset(&var_inetNetToMediaNetAddress, 0x00,
+ sizeof(var_inetNetToMediaNetAddress));
+ var_inetNetToMediaNetAddress.type = ASN_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_inetNetToMediaIfIndex.next_variable =
+ &var_inetNetToMediaNetAddressType;
+ var_inetNetToMediaNetAddressType.next_variable =
+ &var_inetNetToMediaNetAddress;
+ var_inetNetToMediaNetAddress.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_inetNetToMediaIfIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->inetNetToMediaIfIndex =
+ *((long *) var_inetNetToMediaIfIndex.val.string);
+ mib_idx->inetNetToMediaNetAddressType =
+ *((u_long *) var_inetNetToMediaNetAddressType.val.string);
+ /*
+ * NOTE: val_len is in bytes, inetNetToMediaNetAddress_len might not be
+ */
+ if (var_inetNetToMediaNetAddress.val_len >
+ sizeof(mib_idx->inetNetToMediaNetAddress))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->inetNetToMediaNetAddress,
+ var_inetNetToMediaNetAddress.val.string,
+ var_inetNetToMediaNetAddress.val_len);
+ mib_idx->inetNetToMediaNetAddress_len =
+ var_inetNetToMediaNetAddress.val_len /
+ sizeof(mib_idx->inetNetToMediaNetAddress[0]);
+ }
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_inetNetToMediaIfIndex);
+
+ return err;
+} /* inetNetToMediaTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a inetNetToMediaTable_rowreq_ctx
+ */
+inetNetToMediaTable_rowreq_ctx *
+inetNetToMediaTable_allocate_rowreq_ctx(inetNetToMediaTable_data * data,
+ void *user_init_ctx)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(inetNetToMediaTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:inetNetToMediaTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "inetNetToMediaTable_rowreq_ctx.\n");
+ return NULL;
+ } else {
+ if (NULL != data) {
+ /*
+ * track if we got data from user
+ */
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+ } else if (NULL ==
+ (rowreq_ctx->data =
+ inetNetToMediaTable_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->inetNetToMediaTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ inetNetToMediaTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ inetNetToMediaTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* inetNetToMediaTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a inetNetToMediaTable_rowreq_ctx
+ */
+void
+inetNetToMediaTable_release_rowreq_ctx(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:inetNetToMediaTable:inetNetToMediaTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ inetNetToMediaTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ inetNetToMediaTable_release_data(rowreq_ctx->data);
+
+ if (rowreq_ctx->undo)
+ inetNetToMediaTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* inetNetToMediaTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_inetNetToMediaTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:inetNetToMediaTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = inetNetToMediaTable_pre_request(inetNetToMediaTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetNetToMediaTable", "error %d from "
+ "inetNetToMediaTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_inetNetToMediaTable_post_request(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ inetNetToMediaTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:inetNetToMediaTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && inetNetToMediaTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "inetNetToMediaTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = inetNetToMediaTable_post_request(inetNetToMediaTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetNetToMediaTable", "error %d from "
+ "inetNetToMediaTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static inetNetToMediaTable_rowreq_ctx *
+_mfd_inetNetToMediaTable_rowreq_from_index(netsnmp_index * oid_idx,
+ int *rc_ptr)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx;
+ inetNetToMediaTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_rowreq_from_index", "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = inetNetToMediaTable_index_from_oid(oid_idx, &mib_idx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("inetNetToMediaTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = inetNetToMediaTable_allocate_rowreq_ctx(NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _inetNetToMediaTable_check_indexes(rowreq_ctx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ inetNetToMediaTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids,
+ oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_inetNetToMediaTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_inetNetToMediaTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * inetNetToMediaTable_interface_ctx *if_ctx =
+ * (inetNetToMediaTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if (NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx =
+ _mfd_inetNetToMediaTable_rowreq_from_index(&oid_idx, &rc);
+ if (MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests, (netsnmp_index *)
+ rowreq_ctx);
+ }
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ inetNetToMediaTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_inetNetToMediaTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_inetNetToMediaTable_get_column(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * inetNetToMediaPhysAddress(4)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_INETNETTOMEDIAPHYSADDRESS:
+ var->type = ASN_OCTET_STR;
+ rc = inetNetToMediaPhysAddress_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * inetNetToMediaLastUpdated(5)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIALASTUPDATED:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_TIMETICKS;
+ rc = inetNetToMediaLastUpdated_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * inetNetToMediaType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_INETNETTOMEDIATYPE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = inetNetToMediaType_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * inetNetToMediaState(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIASTATE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = inetNetToMediaState_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * inetNetToMediaRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIAROWSTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = inetNetToMediaRowStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _inetNetToMediaTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _inetNetToMediaTable_get_column */
+
+int
+_mfd_inetNetToMediaTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _inetNetToMediaTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_inetNetToMediaTable_check_indexes(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_check_indexes", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /*
+ * (INDEX) inetNetToMediaIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((rowreq_ctx->tbl_idx.inetNetToMediaIfIndex < 1)
+ || (rowreq_ctx->tbl_idx.inetNetToMediaIfIndex > 2147483647))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = inetNetToMediaIfIndex_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * (INDEX) inetNetToMediaNetAddressType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (rowreq_ctx->tbl_idx.inetNetToMediaNetAddressType !=
+ INETADDRESSTYPE_UNKNOWN)
+ && (rowreq_ctx->tbl_idx.inetNetToMediaNetAddressType !=
+ INETADDRESSTYPE_IPV4)
+ && (rowreq_ctx->tbl_idx.inetNetToMediaNetAddressType !=
+ INETADDRESSTYPE_IPV6)
+ && (rowreq_ctx->tbl_idx.inetNetToMediaNetAddressType !=
+ INETADDRESSTYPE_IPV4Z)
+ && (rowreq_ctx->tbl_idx.inetNetToMediaNetAddressType !=
+ INETADDRESSTYPE_IPV6Z)
+ && (rowreq_ctx->tbl_idx.inetNetToMediaNetAddressType !=
+ INETADDRESSTYPE_DNS)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = inetNetToMediaNetAddressType_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * (INDEX) inetNetToMediaNetAddress(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((rowreq_ctx->tbl_idx.inetNetToMediaNetAddress_len < 0)
+ || (rowreq_ctx->tbl_idx.inetNetToMediaNetAddress_len > 255))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = inetNetToMediaNetAddress_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return inetNetToMediaTable_validate_index(inetNetToMediaTable_if_ctx.
+ user_ctx, rowreq_ctx);
+} /* _inetNetToMediaTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_inetNetToMediaTable_check_column(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) inetNetToMediaIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ case COLUMN_INETNETTOMEDIAIFINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) inetNetToMediaNetAddressType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIANETADDRESSTYPE:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) inetNetToMediaNetAddress(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ case COLUMN_INETNETTOMEDIANETADDRESS:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * inetNetToMediaPhysAddress(4)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_INETNETTOMEDIAPHYSADDRESS:
+ rc = netsnmp_check_vb_type(var, ASN_OCTET_STR);
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 0) || (var->val_len > 65535))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:_inetNetToMediaTable_check_column:inetNetToMediaPhysAddress", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetNetToMediaPhysAddress_check_value(rowreq_ctx,
+ (char *) var->val.
+ string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetNetToMediaPhysAddress_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * inetNetToMediaLastUpdated(5)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIALASTUPDATED:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * inetNetToMediaType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_INETNETTOMEDIATYPE:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != INETNETTOMEDIATYPE_OTHER)
+ && (*var->val.integer != INETNETTOMEDIATYPE_INVALID)
+ && (*var->val.integer != INETNETTOMEDIATYPE_DYNAMIC)
+ && (*var->val.integer != INETNETTOMEDIATYPE_STATIC)
+ && (*var->val.integer != INETNETTOMEDIATYPE_LOCAL)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:_inetNetToMediaTable_check_column:inetNetToMediaType", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetNetToMediaType_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetNetToMediaType_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * inetNetToMediaState(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIASTATE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * inetNetToMediaRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIAROWSTATUS:
+ rc = netsnmp_check_vb_rowstatus_value(var);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:_inetNetToMediaTable_check_column:inetNetToMediaRowStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetNetToMediaRowStatus_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetNetToMediaRowStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _inetNetToMediaTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _inetNetToMediaTable_check_column */
+
+int
+_mfd_inetNetToMediaTable_check_objects(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _inetNetToMediaTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_inetNetToMediaTable_check_dependencies(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = inetNetToMediaTable_check_dependencies(rowreq_ctx);
+ if (rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_inetNetToMediaTable_undo_setup_column(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * inetNetToMediaPhysAddress(4)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_INETNETTOMEDIAPHYSADDRESS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG;
+ rc = inetNetToMediaPhysAddress_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * inetNetToMediaType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_INETNETTOMEDIATYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_INETNETTOMEDIATYPE_FLAG;
+ rc = inetNetToMediaType_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * inetNetToMediaRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIAROWSTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_INETNETTOMEDIAROWSTATUS_FLAG;
+ rc = inetNetToMediaRowStatus_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _inetNetToMediaTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _inetNetToMediaTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_inetNetToMediaTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = inetNetToMediaTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = inetNetToMediaTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _inetNetToMediaTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_inetNetToMediaTable_undo_cleanup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = inetNetToMediaTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ inetNetToMediaTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_inetNetToMediaTable_set_column(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * inetNetToMediaPhysAddress(4)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_INETNETTOMEDIAPHYSADDRESS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG;
+ rc = inetNetToMediaPhysAddress_set(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * inetNetToMediaType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_INETNETTOMEDIATYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_INETNETTOMEDIATYPE_FLAG;
+ rc = inetNetToMediaType_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * inetNetToMediaRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIAROWSTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_INETNETTOMEDIAROWSTATUS_FLAG;
+ rc = inetNetToMediaRowStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _inetNetToMediaTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _inetNetToMediaTable_set_column */
+
+int
+_mfd_inetNetToMediaTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _inetNetToMediaTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_inetNetToMediaTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = inetNetToMediaTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ inetNetToMediaTable_dirty_set(inetNetToMediaTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_inetNetToMediaTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = inetNetToMediaTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ inetNetToMediaTable_dirty_set(d - 1);
+ }
+
+ rc = inetNetToMediaTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "inetNetToMediaTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_inetNetToMediaTable_undo_column(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * inetNetToMediaPhysAddress(4)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_INETNETTOMEDIAPHYSADDRESS:
+ rc = inetNetToMediaPhysAddress_undo(rowreq_ctx);
+ break;
+
+ /*
+ * inetNetToMediaType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_INETNETTOMEDIATYPE:
+ rc = inetNetToMediaType_undo(rowreq_ctx);
+ break;
+
+ /*
+ * inetNetToMediaRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIAROWSTATUS:
+ rc = inetNetToMediaRowStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _inetNetToMediaTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _inetNetToMediaTable_undo_column */
+
+int
+_mfd_inetNetToMediaTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = inetNetToMediaTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _inetNetToMediaTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_inetNetToMediaTable_irreversible_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info, netsnmp_request_info
+ *requests)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(inetNetToMediaTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(inetNetToMediaTable_if_ctx.container,
+ rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGTRACE;
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for inetNetToMediaTable_cache_load\n");
+ return -1;
+ }
+ DEBUGMSGTL(("inetNetToMediaTable/cache", "inetNetToMedia_load %p/%p\n",
+ cache, cache->magic));
+
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return inetNetToMediaTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in inetNetToMediaTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ inetNetToMediaTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in inetNetToMediaTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ inetNetToMediaTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_inetNetToMediaTable_container_init(inetNetToMediaTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ inetNetToMediaTable_oid,
+ inetNetToMediaTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for inetNetToMediaTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ inetNetToMediaTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("inetNetToMediaTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "inetNetToMediaTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _inetNetToMediaTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_inetNetToMediaTable_container_shutdown(inetNetToMediaTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_container_shutdown", "called\n"));
+
+ inetNetToMediaTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _inetNetToMediaTable_container_shutdown */
+
+
+inetNetToMediaTable_rowreq_ctx *
+inetNetToMediaTable_row_find_by_mib_index(inetNetToMediaTable_mib_index *
+ mib_idx)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = inetNetToMediaTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(inetNetToMediaTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
new file mode 100644
index 0000000000..a111a23abe
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
@@ -0,0 +1,103 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: inetNetToMediaTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef INETNETTOMEDIATABLE_INTERFACE_H
+#define INETNETTOMEDIATABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "inetNetToMediaTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _inetNetToMediaTable_initialize_interface
+ (inetNetToMediaTable_registration * user_ctx, u_long flags);
+ void
+ _inetNetToMediaTable_shutdown_interface
+ (inetNetToMediaTable_registration * user_ctx);
+
+ inetNetToMediaTable_registration
+ * inetNetToMediaTable_registration_get(void);
+
+ inetNetToMediaTable_registration
+ * inetNetToMediaTable_registration_set
+ (inetNetToMediaTable_registration * newreg);
+
+ netsnmp_container *inetNetToMediaTable_container_get(void);
+ int inetNetToMediaTable_container_size(void);
+
+ u_int inetNetToMediaTable_dirty_get(void);
+ void inetNetToMediaTable_dirty_set(u_int status);
+
+ inetNetToMediaTable_rowreq_ctx
+ * inetNetToMediaTable_allocate_rowreq_ctx(inetNetToMediaTable_data
+ *, void *);
+ void
+ inetNetToMediaTable_release_rowreq_ctx
+ (inetNetToMediaTable_rowreq_ctx * rowreq_ctx);
+
+ int inetNetToMediaTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ inetNetToMediaTable_mib_index
+ * mib_idx);
+ int inetNetToMediaTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ inetNetToMediaTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ inetNetToMediaTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* INETNETTOMEDIATABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable.h
new file mode 100644
index 0000000000..abfa1000c1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipAddressPrefixTable/ipAddressPrefixTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c
new file mode 100644
index 0000000000..ecd26a050e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c
@@ -0,0 +1,673 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipAddressPrefixTable.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** \page MFD helper for ipAddressPrefixTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipAddressPrefixTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ipAddressPrefixTable_interface.h"
+
+oid ipAddressPrefixTable_oid[] = { IPADDRESSPREFIXTABLE_OID };
+int ipAddressPrefixTable_oid_size =
+OID_LENGTH(ipAddressPrefixTable_oid);
+
+ipAddressPrefixTable_registration ipAddressPrefixTable_user_context;
+
+void initialize_table_ipAddressPrefixTable(void);
+void shutdown_table_ipAddressPrefixTable(void);
+
+
+/**
+ * Initializes the ipAddressPrefixTable module
+ */
+void
+init_ipAddressPrefixTable(void)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:init_ipAddressPrefixTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform ipAddressPrefixTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("ipAddressPrefixTable"))
+ initialize_table_ipAddressPrefixTable();
+
+} /* init_ipAddressPrefixTable */
+
+/**
+ * Shut-down the ipAddressPrefixTable module (agent is exiting)
+ */
+void
+shutdown_ipAddressPrefixTable(void)
+{
+ if (should_init("ipAddressPrefixTable"))
+ shutdown_table_ipAddressPrefixTable();
+
+}
+
+/**
+ * Initialize the table ipAddressPrefixTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ipAddressPrefixTable(void)
+{
+ ipAddressPrefixTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:initialize_table_ipAddressPrefixTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform ipAddressPrefixTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ipAddressPrefixTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("ipAddressPrefixTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ipAddressPrefixTable_initialize_interface(user_context, flags);
+} /* initialize_table_ipAddressPrefixTable */
+
+/**
+ * Shutdown the table ipAddressPrefixTable
+ */
+void
+shutdown_table_ipAddressPrefixTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipAddressPrefixTable_shutdown_interface
+ (&ipAddressPrefixTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+ipAddressPrefixTable_rowreq_ctx_init(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ipAddressPrefixTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+ipAddressPrefixTable_rowreq_ctx_cleanup(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ipAddressPrefixTable rowreq cleanup.
+ */
+} /* ipAddressPrefixTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ipAddressPrefixTable_pre_request(ipAddressPrefixTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform ipAddressPrefixTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+ipAddressPrefixTable_post_request(ipAddressPrefixTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform ipAddressPrefixTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressPrefixTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipAddressPrefixTable is subid 32 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.32, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ipAddressPrefixTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param ipAddressPrefixIfIndex_val
+ * @param ipAddressPrefixType_val
+ * @param ipAddressPrefixPrefix_val_ptr
+ * @param ipAddressPrefixPrefix_val_ptr_len
+ * @param ipAddressPrefixLength_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+ipAddressPrefixTable_indexes_set_tbl_idx(ipAddressPrefixTable_mib_index *
+ tbl_idx,
+ long ipAddressPrefixIfIndex_val,
+ u_long ipAddressPrefixType_val,
+ char
+ *ipAddressPrefixPrefix_val_ptr,
+ size_t
+ ipAddressPrefixPrefix_val_ptr_len,
+ u_long ipAddressPrefixLength_val)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * ipAddressPrefixIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ tbl_idx->ipAddressPrefixIfIndex = ipAddressPrefixIfIndex_val;
+
+ /*
+ * ipAddressPrefixType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ tbl_idx->ipAddressPrefixType = ipAddressPrefixType_val;
+
+ /*
+ * ipAddressPrefixPrefix(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->ipAddressPrefixPrefix_len = sizeof(tbl_idx->ipAddressPrefixPrefix) / sizeof(tbl_idx->ipAddressPrefixPrefix[0]); /* max length */
+ /*
+ * make sure there is enough space for ipAddressPrefixPrefix data
+ */
+ if ((NULL == tbl_idx->ipAddressPrefixPrefix) ||
+ (tbl_idx->ipAddressPrefixPrefix_len <
+ (ipAddressPrefixPrefix_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->ipAddressPrefixPrefix_len = ipAddressPrefixPrefix_val_ptr_len;
+ memcpy(tbl_idx->ipAddressPrefixPrefix, ipAddressPrefixPrefix_val_ptr,
+ ipAddressPrefixPrefix_val_ptr_len *
+ sizeof(ipAddressPrefixPrefix_val_ptr[0]));
+
+ /*
+ * ipAddressPrefixLength(4)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ tbl_idx->ipAddressPrefixLength = ipAddressPrefixLength_val;
+
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+ipAddressPrefixTable_indexes_set(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipAddressPrefixIfIndex_val,
+ u_long ipAddressPrefixType_val,
+ char *ipAddressPrefixPrefix_val_ptr,
+ size_t ipAddressPrefixPrefix_val_ptr_len,
+ u_long ipAddressPrefixLength_val)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ ipAddressPrefixTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ ipAddressPrefixIfIndex_val,
+ ipAddressPrefixType_val,
+ ipAddressPrefixPrefix_val_ptr,
+ ipAddressPrefixPrefix_val_ptr_len,
+ ipAddressPrefixLength_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != ipAddressPrefixTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressPrefixEntry.ipAddressPrefixOrigin
+ * ipAddressPrefixOrigin is subid 5 of ipAddressPrefixEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.32.1.5
+ * Description:
+The origin of this prefix.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 4/8. Values: other(1), manual(2), wellknown(3), dhcp(4), routeradv(5)
+ *
+ * Its syntax is IpAddressPrefixOriginTC (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressPrefixOrigin data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressPrefixOrigin_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressPrefixOrigin_get(ipAddressPrefixTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressPrefixOrigin_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressPrefixOrigin_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixOrigin_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressPrefixOrigin data.
+ * copy (* ipAddressPrefixOrigin_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressPrefixOrigin_val_ptr) =
+ rowreq_ctx->data.ipAddressPrefixOrigin;
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixOrigin_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressPrefixEntry.ipAddressPrefixOnLinkFlag
+ * ipAddressPrefixOnLinkFlag is subid 6 of ipAddressPrefixEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.32.1.6
+ * Description:
+This object has the value 'true(1)', if this prefix can be
+ used for on-link determination and the value 'false(2)'
+ otherwise.
+
+
+ The default for IPv4 prefixes is 'true(1)'.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressPrefixOnLinkFlag data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressPrefixOnLinkFlag_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressPrefixOnLinkFlag_get(ipAddressPrefixTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressPrefixOnLinkFlag_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressPrefixOnLinkFlag_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixOnLinkFlag_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressPrefixOnLinkFlag data.
+ * copy (* ipAddressPrefixOnLinkFlag_val_ptr ) from rowreq_ctx->data
+ */
+ if (INETADDRESSTYPE_IPV4 == rowreq_ctx->tbl_idx.ipAddressPrefixType) {
+ (*ipAddressPrefixOnLinkFlag_val_ptr) = 1; /* per MIB */
+ } else
+ (*ipAddressPrefixOnLinkFlag_val_ptr) =
+ rowreq_ctx->data.ipAddressPrefixOnLinkFlag;
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixOnLinkFlag_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressPrefixEntry.ipAddressPrefixAutonomousFlag
+ * ipAddressPrefixAutonomousFlag is subid 7 of ipAddressPrefixEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.32.1.7
+ * Description:
+Autonomous address configuration flag. When true(1),
+ indicates that this prefix can be used for autonomous
+ address configuration (i.e. can be used to form a local
+ interface address). If false(2), it is not used to auto-
+ configure a local interface address.
+
+
+ The default for IPv4 prefixes is 'false(2)'.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressPrefixAutonomousFlag data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressPrefixAutonomousFlag_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressPrefixAutonomousFlag_get(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressPrefixAutonomousFlag_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressPrefixAutonomousFlag_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixAutonomousFlag_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressPrefixAutonomousFlag data.
+ * copy (* ipAddressPrefixAutonomousFlag_val_ptr ) from rowreq_ctx->data
+ */
+ if (INETADDRESSTYPE_IPV4 == rowreq_ctx->tbl_idx.ipAddressPrefixType)
+ (*ipAddressPrefixAutonomousFlag_val_ptr) = 2; /* per MIB */
+ else
+ (*ipAddressPrefixAutonomousFlag_val_ptr) =
+ rowreq_ctx->data.ipAddressPrefixAutonomousFlag;
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixAutonomousFlag_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressPrefixEntry.ipAddressPrefixAdvPreferredLifetime
+ * ipAddressPrefixAdvPreferredLifetime is subid 8 of ipAddressPrefixEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.32.1.8
+ * Description:
+The remaining length of time in seconds that this prefix
+ will continue to be preferred, i.e. time until deprecation.
+
+
+
+
+ A value of 4,294,967,295 represents infinity.
+
+
+ The address generated from a deprecated prefix should no
+ longer be used as a source address in new communications,
+ but packets received on such an interface are processed as
+ expected.
+
+
+ The default for IPv4 prefixes is 4,294,967,295 (infinity).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressPrefixAdvPreferredLifetime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressPrefixAdvPreferredLifetime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressPrefixAdvPreferredLifetime_get(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressPrefixAdvPreferredLifetime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressPrefixAdvPreferredLifetime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixAdvPreferredLifetime_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressPrefixAdvPreferredLifetime data.
+ * copy (* ipAddressPrefixAdvPreferredLifetime_val_ptr ) from rowreq_ctx->data
+ */
+ if (INETADDRESSTYPE_IPV4 == rowreq_ctx->tbl_idx.ipAddressPrefixType)
+ (*ipAddressPrefixAdvPreferredLifetime_val_ptr) = 4294967295; /* per MIB */
+ else
+ (*ipAddressPrefixAdvPreferredLifetime_val_ptr) =
+ rowreq_ctx->data.ipAddressPrefixAdvPreferredLifetime;
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixAdvPreferredLifetime_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressPrefixEntry.ipAddressPrefixAdvValidLifetime
+ * ipAddressPrefixAdvValidLifetime is subid 9 of ipAddressPrefixEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.32.1.9
+ * Description:
+The remaining length of time, in seconds, that this prefix
+ will continue to be valid, i.e. time until invalidation. A
+ value of 4,294,967,295 represents infinity.
+
+
+ The address generated from an invalidated prefix should not
+ appear as the destination or source address of a packet.
+
+
+ The default for IPv4 prefixes is 4,294,967,295 (infinity).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressPrefixAdvValidLifetime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressPrefixAdvValidLifetime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressPrefixAdvValidLifetime_get(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressPrefixAdvValidLifetime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressPrefixAdvValidLifetime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixAdvValidLifetime_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressPrefixAdvValidLifetime data.
+ * copy (* ipAddressPrefixAdvValidLifetime_val_ptr ) from rowreq_ctx->data
+ */
+ if (INETADDRESSTYPE_IPV4 == rowreq_ctx->tbl_idx.ipAddressPrefixType)
+ (*ipAddressPrefixAdvValidLifetime_val_ptr) = 4294967295; /* per MIB */
+ else
+ (*ipAddressPrefixAdvValidLifetime_val_ptr) =
+ rowreq_ctx->data.ipAddressPrefixAdvValidLifetime;
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixAdvValidLifetime_get */
+
+
+
+/** @} */
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h
new file mode 100644
index 0000000000..5030f98fa2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h
@@ -0,0 +1,316 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipAddressPrefixTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef IPADDRESSPREFIXTABLE_H
+#define IPADDRESSPREFIXTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(ip-mib/ipAddressTable/ipAddressTable)
+config_require(ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface)
+config_require(ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for ipAddressPrefixTable
+ */
+#include "ipAddressPrefixTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ipAddressPrefixTable(void);
+ void shutdown_ipAddressPrefixTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressPrefixTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipAddressPrefixTable is subid 32 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.32, length: 8
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review ipAddressPrefixTable registration context.
+ */
+ typedef netsnmp_data_list ipAddressPrefixTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review ipAddressPrefixTable data context structure.
+ * This structure is used to represent the data for ipAddressPrefixTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * ipAddressPrefixTable.
+ */
+ typedef struct ipAddressPrefixTable_data_s {
+
+ /*
+ * ipAddressPrefixOrigin(5)/IpAddressPrefixOriginTC/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long ipAddressPrefixOrigin;
+
+ /*
+ * ipAddressPrefixOnLinkFlag(6)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long ipAddressPrefixOnLinkFlag;
+
+ /*
+ * ipAddressPrefixAutonomousFlag(7)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long ipAddressPrefixAutonomousFlag;
+
+ /*
+ * ipAddressPrefixAdvPreferredLifetime(8)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long ipAddressPrefixAdvPreferredLifetime;
+
+ /*
+ * ipAddressPrefixAdvValidLifetime(9)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long ipAddressPrefixAdvValidLifetime;
+
+ } ipAddressPrefixTable_data;
+
+
+ /*
+ * TODO:120:r: |-> Review ipAddressPrefixTable mib index.
+ * This structure is used to represent the index for ipAddressPrefixTable.
+ */
+ typedef struct ipAddressPrefixTable_mib_index_s {
+
+ /*
+ * ipAddressPrefixIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ long ipAddressPrefixIfIndex;
+
+ /*
+ * ipAddressPrefixType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long ipAddressPrefixType;
+
+ /*
+ * ipAddressPrefixPrefix(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /** 128 - 3(other indexes) - oid length(10) = 114 */
+ char ipAddressPrefixPrefix[114];
+ size_t ipAddressPrefixPrefix_len;
+
+ /*
+ * ipAddressPrefixLength(4)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ u_long ipAddressPrefixLength;
+
+
+ } ipAddressPrefixTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review ipAddressPrefixTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(8)
+ */
+#define MAX_ipAddressPrefixTable_IDX_LEN 118
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review ipAddressPrefixTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * ipAddressPrefixTable_rowreq_ctx pointer.
+ */
+ typedef struct ipAddressPrefixTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_ipAddressPrefixTable_IDX_LEN];
+
+ ipAddressPrefixTable_mib_index tbl_idx;
+
+ ipAddressPrefixTable_data data;
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to ipAddressPrefixTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *ipAddressPrefixTable_data_list;
+
+ } ipAddressPrefixTable_rowreq_ctx;
+
+ typedef struct ipAddressPrefixTable_ref_rowreq_ctx_s {
+ ipAddressPrefixTable_rowreq_ctx *rowreq_ctx;
+ } ipAddressPrefixTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ ipAddressPrefixTable_pre_request(ipAddressPrefixTable_registration
+ * user_context);
+ int
+ ipAddressPrefixTable_post_request(ipAddressPrefixTable_registration
+ * user_context, int rc);
+
+ int
+ ipAddressPrefixTable_rowreq_ctx_init
+ (ipAddressPrefixTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ ipAddressPrefixTable_rowreq_ctx_cleanup
+ (ipAddressPrefixTable_rowreq_ctx * rowreq_ctx);
+
+
+ ipAddressPrefixTable_rowreq_ctx
+ * ipAddressPrefixTable_row_find_by_mib_index
+ (ipAddressPrefixTable_mib_index * mib_idx);
+
+ extern oid ipAddressPrefixTable_oid[];
+ extern int ipAddressPrefixTable_oid_size;
+
+
+#include "ipAddressPrefixTable_interface.h"
+#include "ipAddressPrefixTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressPrefixTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipAddressPrefixTable is subid 32 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.32, length: 8
+ */
+ /*
+ * indexes
+ */
+
+ int
+ ipAddressPrefixOrigin_get(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipAddressPrefixOrigin_val_ptr);
+ int
+ ipAddressPrefixOnLinkFlag_get(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressPrefixOnLinkFlag_val_ptr);
+ int
+ ipAddressPrefixAutonomousFlag_get(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressPrefixAutonomousFlag_val_ptr);
+ int
+ ipAddressPrefixAdvPreferredLifetime_get
+ (ipAddressPrefixTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressPrefixAdvPreferredLifetime_val_ptr);
+ int
+ ipAddressPrefixAdvValidLifetime_get(ipAddressPrefixTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipAddressPrefixAdvValidLifetime_val_ptr);
+
+
+ int
+ ipAddressPrefixTable_indexes_set_tbl_idx
+ (ipAddressPrefixTable_mib_index * tbl_idx,
+ long ipAddressPrefixIfIndex_val, u_long ipAddressPrefixType_val,
+ char *ipAddressPrefixPrefix_val_ptr,
+ size_t ipAddressPrefixPrefix_val_ptr_len,
+ u_long ipAddressPrefixLength_val);
+ int
+ ipAddressPrefixTable_indexes_set(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipAddressPrefixIfIndex_val,
+ u_long ipAddressPrefixType_val,
+ char
+ *ipAddressPrefixPrefix_val_ptr,
+ size_t
+ ipAddressPrefixPrefix_val_ptr_len,
+ u_long ipAddressPrefixLength_val);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSPREFIXTABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h
new file mode 100644
index 0000000000..d9c0cb0e61
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h
@@ -0,0 +1,139 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: ipAddressPrefixTable_constants.h 13763 2005-12-01 15:49:39Z rstory $
+ */
+#ifndef IPADDRESSPREFIXTABLE_CONSTANTS_H
+#define IPADDRESSPREFIXTABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ipAddressPrefixTable
+ */
+#define IPADDRESSPREFIXTABLE_OID 1,3,6,1,2,1,4,32
+
+#define COLUMN_IPADDRESSPREFIXIFINDEX 1
+
+#define COLUMN_IPADDRESSPREFIXTYPE 2
+
+#define COLUMN_IPADDRESSPREFIXPREFIX 3
+
+#define COLUMN_IPADDRESSPREFIXLENGTH 4
+
+#define COLUMN_IPADDRESSPREFIXORIGIN 5
+
+#define COLUMN_IPADDRESSPREFIXONLINKFLAG 6
+
+#define COLUMN_IPADDRESSPREFIXAUTONOMOUSFLAG 7
+
+#define COLUMN_IPADDRESSPREFIXADVPREFERREDLIFETIME 8
+
+#define COLUMN_IPADDRESSPREFIXADVVALIDLIFETIME 9
+
+
+#define IPADDRESSPREFIXTABLE_MIN_COL COLUMN_IPADDRESSPREFIXORIGIN
+#define IPADDRESSPREFIXTABLE_MAX_COL COLUMN_IPADDRESSPREFIXADVVALIDLIFETIME
+
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table ipAddressPrefixTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressPrefixType (InetAddressType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETADDRESSTYPE_ENUMS
+#define INETADDRESSTYPE_ENUMS
+
+#define INETADDRESSTYPE_UNKNOWN 0
+#define INETADDRESSTYPE_IPV4 1
+#define INETADDRESSTYPE_IPV6 2
+#define INETADDRESSTYPE_IPV4Z 3
+#define INETADDRESSTYPE_IPV6Z 4
+#define INETADDRESSTYPE_DNS 16
+
+#endif /* INETADDRESSTYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressPrefixOrigin (IpAddressPrefixOriginTC / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPADDRESSPREFIXORIGINTC_ENUMS
+#define IPADDRESSPREFIXORIGINTC_ENUMS
+
+#define IPADDRESSPREFIXORIGINTC_OTHER 1
+#define IPADDRESSPREFIXORIGINTC_MANUAL 2
+#define IPADDRESSPREFIXORIGINTC_WELLKNOWN 3
+#define IPADDRESSPREFIXORIGINTC_DHCP 4
+#define IPADDRESSPREFIXORIGINTC_ROUTERADV 5
+
+#endif /* IPADDRESSPREFIXORIGINTC_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressPrefixOnLinkFlag (TruthValue / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TRUTHVALUE_ENUMS
+#define TRUTHVALUE_ENUMS
+
+#define TRUTHVALUE_TRUE 1
+#define TRUTHVALUE_FALSE 2
+
+#endif /* TRUTHVALUE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressPrefixAutonomousFlag (TruthValue / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TRUTHVALUE_ENUMS
+#define TRUTHVALUE_ENUMS
+
+#define TRUTHVALUE_TRUE 1
+#define TRUTHVALUE_FALSE 2
+
+#endif /* TRUTHVALUE_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSPREFIXTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c
new file mode 100644
index 0000000000..4cda4de3cd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c
@@ -0,0 +1,353 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipAddressPrefixTable_data_access.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipAddressPrefixTable.h"
+
+
+#include "ipAddressPrefixTable_data_access.h"
+
+#include "ip-mib/ipAddressTable/ipAddressTable.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressPrefixTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipAddressPrefixTable is subid 32 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.32, length: 8
+ */
+
+/**
+ * initialization for ipAddressPrefixTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ipAddressPrefixTable_reg
+ * Pointer to ipAddressPrefixTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ipAddressPrefixTable_init_data(ipAddressPrefixTable_registration *
+ ipAddressPrefixTable_reg)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize ipAddressPrefixTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+ipAddressPrefixTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ipAddressPrefixTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to ipAddressPrefixTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up ipAddressPrefixTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = IPADDRESSPREFIXTABLE_CACHE_TIMEOUT; /* seconds */
+} /* ipAddressPrefixTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before ipAddressPrefixTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+ipAddressPrefixTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to ipAddressPrefixTable_container_shutdown\n");
+ return;
+ }
+
+} /* ipAddressPrefixTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ipAddressPrefixTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * ipAddressPrefixTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+ipAddressPrefixTable_container_load(netsnmp_container *container)
+{
+ ipAddressPrefixTable_rowreq_ctx *rowreq_ctx = NULL, *tmp_rowreq_ctx;
+ ipAddressTable_rowreq_ctx *addr_rowreq_ctx;
+ netsnmp_container *addr_container;
+ netsnmp_iterator *addr_it;
+ size_t count = 0;
+ u_char tmp_pfx[NETSNMP_ACCESS_IPADDRESS_BUF_SIZE];
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_container_load", "called\n"));
+
+ addr_container = ipAddressTable_container_get();
+ if (NULL == addr_container) {
+ DEBUGMSGTL(("ipAddressPrefixTable:container_load",
+ "couldn't get ipAddress container\n"));
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ addr_it = CONTAINER_ITERATOR(addr_container);
+ if (NULL == addr_container) {
+ DEBUGMSGTL(("ipAddressPrefixTable:container_load",
+ "couldn't get ipAddress iterator\n"));
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ * TODO:351:M: |-> Load/update data in the ipAddressPrefixTable container.
+ * loop over your ipAddressPrefixTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ for (addr_rowreq_ctx = ITERATOR_FIRST(addr_it);
+ addr_rowreq_ctx; addr_rowreq_ctx = ITERATOR_NEXT(addr_it)) {
+
+
+
+ /*
+ * TODO:352:M: | |-> set indexes in new ipAddressPrefixTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ if (NULL == rowreq_ctx) {
+ rowreq_ctx = ipAddressPrefixTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ }
+ netsnmp_ipaddress_prefix_copy(tmp_pfx,
+ addr_rowreq_ctx->tbl_idx.
+ ipAddressAddr,
+ addr_rowreq_ctx->data->
+ ia_address_len,
+ addr_rowreq_ctx->data->
+ ia_prefix_len);
+ if (MFD_SUCCESS !=
+ ipAddressPrefixTable_indexes_set(rowreq_ctx,
+ addr_rowreq_ctx->data->
+ if_index,
+ addr_rowreq_ctx->tbl_idx.
+ ipAddressAddrType, tmp_pfx,
+ addr_rowreq_ctx->data->
+ ia_address_len,
+ addr_rowreq_ctx->data->
+ ia_prefix_len)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "ipAddressPrefixTable data.\n");
+ ipAddressPrefixTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /** do we already have this prefix? */
+ tmp_rowreq_ctx = CONTAINER_FIND(container, rowreq_ctx);
+ if (NULL != tmp_rowreq_ctx)
+ continue;
+
+ /*
+ * TODO:352:r: | |-> populate ipAddressPrefixTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ rowreq_ctx->data.ipAddressPrefixOrigin =
+ addr_rowreq_ctx->data->ia_origin;
+
+ /** defer the rest til row prep */
+
+ /*
+ * insert into table container, clear ptr so we reallocate
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ rowreq_ctx = NULL;
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+ipAddressPrefixTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free ipAddressPrefixTable container data.
+ */
+} /* ipAddressPrefixTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+ipAddressPrefixTable_row_prep(ipAddressPrefixTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+ if (INETADDRESSTYPE_IPV6 == rowreq_ctx->tbl_idx.ipAddressPrefixType) {
+
+ }
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h
new file mode 100644
index 0000000000..4f20577320
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h
@@ -0,0 +1,76 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipAddressPrefixTable_data_access.h 13763 2005-12-01 15:49:39Z rstory $
+ */
+#ifndef IPADDRESSPREFIXTABLE_DATA_ACCESS_H
+#define IPADDRESSPREFIXTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressPrefixTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipAddressPrefixTable is subid 32 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.32, length: 8
+ */
+
+
+ int
+ ipAddressPrefixTable_init_data(ipAddressPrefixTable_registration *
+ ipAddressPrefixTable_reg);
+
+
+ /*
+ * TODO:180:o: Review ipAddressPrefixTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define IPADDRESSPREFIXTABLE_CACHE_TIMEOUT 60
+
+ void ipAddressPrefixTable_container_init(netsnmp_container
+ **container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ ipAddressPrefixTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int ipAddressPrefixTable_container_load(netsnmp_container
+ *container);
+ void ipAddressPrefixTable_container_free(netsnmp_container
+ *container);
+
+ int ipAddressPrefixTable_cache_load(netsnmp_container
+ *container);
+ void ipAddressPrefixTable_cache_free(netsnmp_container
+ *container);
+
+ int
+ ipAddressPrefixTable_row_prep(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSPREFIXTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c
new file mode 100644
index 0000000000..7159836ba4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c
@@ -0,0 +1,1038 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipAddressPrefixTable_interface.c 15015 2006-08-17 15:06:43Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipAddressPrefixTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ipAddressPrefixTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressPrefixTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipAddressPrefixTable is subid 32 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.32, length: 8
+ */
+typedef struct ipAddressPrefixTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ ipAddressPrefixTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} ipAddressPrefixTable_interface_ctx;
+
+static ipAddressPrefixTable_interface_ctx ipAddressPrefixTable_if_ctx;
+
+static void
+ _ipAddressPrefixTable_container_init(ipAddressPrefixTable_interface_ctx *
+ if_ctx);
+static void
+ _ipAddressPrefixTable_container_shutdown(ipAddressPrefixTable_interface_ctx
+ * if_ctx);
+
+
+netsnmp_container *
+ipAddressPrefixTable_container_get(void)
+{
+ return ipAddressPrefixTable_if_ctx.container;
+}
+
+ipAddressPrefixTable_registration *
+ipAddressPrefixTable_registration_get(void)
+{
+ return ipAddressPrefixTable_if_ctx.user_ctx;
+}
+
+ipAddressPrefixTable_registration *
+ipAddressPrefixTable_registration_set(ipAddressPrefixTable_registration *
+ newreg)
+{
+ ipAddressPrefixTable_registration *old =
+ ipAddressPrefixTable_if_ctx.user_ctx;
+ ipAddressPrefixTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+ipAddressPrefixTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipAddressPrefixTable_if_ctx.container);
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ipAddressPrefixTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ipAddressPrefixTable_post_request;
+static Netsnmp_Node_Handler _mfd_ipAddressPrefixTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ipAddressPrefixTable_get_values;
+/**
+ * @internal
+ * Initialize the table ipAddressPrefixTable
+ * (Define its contents and how it's structured)
+ */
+void
+ _ipAddressPrefixTable_initialize_interface
+ (ipAddressPrefixTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ipAddressPrefixTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &ipAddressPrefixTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_ipAddressPrefixTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ipAddressPrefixTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ipAddressPrefixIfIndex */
+ ASN_INTEGER,
+ /** index: ipAddressPrefixType */
+ ASN_OCTET_STR,
+ /** index: ipAddressPrefixPrefix */
+ ASN_UNSIGNED,
+ /** index: ipAddressPrefixLength */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = IPADDRESSPREFIXTABLE_MIN_COL;
+ tbl_info->max_column = IPADDRESSPREFIXTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ipAddressPrefixTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ipAddressPrefixTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ipAddressPrefixTable_container_init(&ipAddressPrefixTable_if_ctx);
+ if (NULL == ipAddressPrefixTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for ipAddressPrefixTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_ipAddressPrefixTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ipAddressPrefixTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_ipAddressPrefixTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_ipAddressPrefixTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ipAddressPrefixTable:init_ipAddressPrefixTable",
+ "Registering ipAddressPrefixTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ipAddressPrefixTable",
+ handler,
+ ipAddressPrefixTable_oid,
+ ipAddressPrefixTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table ipAddressPrefixTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ipAddressPrefixTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ ipAddressPrefixTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != ipAddressPrefixTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(ipAddressPrefixTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _ipAddressPrefixTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ipAddressPrefixTable
+ */
+void
+_ipAddressPrefixTable_shutdown_interface(ipAddressPrefixTable_registration
+ * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ipAddressPrefixTable_container_shutdown(&ipAddressPrefixTable_if_ctx);
+}
+
+void
+ipAddressPrefixTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ipAddressPrefixTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ipAddressPrefixTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+ipAddressPrefixTable_index_to_oid(netsnmp_index * oid_idx,
+ ipAddressPrefixTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipAddressPrefixIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ipAddressPrefixIfIndex;
+ /*
+ * ipAddressPrefixType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipAddressPrefixType;
+ /*
+ * ipAddressPrefixPrefix(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_ipAddressPrefixPrefix;
+ /*
+ * ipAddressPrefixLength(4)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ipAddressPrefixLength;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipAddressPrefixIfIndex, 0x00,
+ sizeof(var_ipAddressPrefixIfIndex));
+ var_ipAddressPrefixIfIndex.type = ASN_INTEGER;
+ memset(&var_ipAddressPrefixType, 0x00,
+ sizeof(var_ipAddressPrefixType));
+ var_ipAddressPrefixType.type = ASN_INTEGER;
+ memset(&var_ipAddressPrefixPrefix, 0x00,
+ sizeof(var_ipAddressPrefixPrefix));
+ var_ipAddressPrefixPrefix.type = ASN_OCTET_STR;
+ memset(&var_ipAddressPrefixLength, 0x00,
+ sizeof(var_ipAddressPrefixLength));
+ var_ipAddressPrefixLength.type = ASN_UNSIGNED;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipAddressPrefixIfIndex.next_variable = &var_ipAddressPrefixType;
+ var_ipAddressPrefixType.next_variable = &var_ipAddressPrefixPrefix;
+ var_ipAddressPrefixPrefix.next_variable = &var_ipAddressPrefixLength;
+ var_ipAddressPrefixLength.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_index_to_oid", "called\n"));
+
+ /*
+ * ipAddressPrefixIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_ipAddressPrefixIfIndex,
+ (u_char *) & mib_idx->ipAddressPrefixIfIndex,
+ sizeof(mib_idx->ipAddressPrefixIfIndex));
+
+ /*
+ * ipAddressPrefixType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_ipAddressPrefixType,
+ (u_char *) & mib_idx->ipAddressPrefixType,
+ sizeof(mib_idx->ipAddressPrefixType));
+
+ /*
+ * ipAddressPrefixPrefix(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_ipAddressPrefixPrefix,
+ (u_char *) & mib_idx->ipAddressPrefixPrefix,
+ mib_idx->ipAddressPrefixPrefix_len *
+ sizeof(mib_idx->ipAddressPrefixPrefix[0]));
+
+ /*
+ * ipAddressPrefixLength(4)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_ipAddressPrefixLength,
+ (u_char *) & mib_idx->ipAddressPrefixLength,
+ sizeof(mib_idx->ipAddressPrefixLength));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_ipAddressPrefixIfIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipAddressPrefixIfIndex);
+
+ return err;
+} /* ipAddressPrefixTable_index_to_oid */
+
+/**
+ * extract ipAddressPrefixTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+ipAddressPrefixTable_index_from_oid(netsnmp_index * oid_idx,
+ ipAddressPrefixTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipAddressPrefixIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ipAddressPrefixIfIndex;
+ /*
+ * ipAddressPrefixType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipAddressPrefixType;
+ /*
+ * ipAddressPrefixPrefix(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_ipAddressPrefixPrefix;
+ /*
+ * ipAddressPrefixLength(4)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ipAddressPrefixLength;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipAddressPrefixIfIndex, 0x00,
+ sizeof(var_ipAddressPrefixIfIndex));
+ var_ipAddressPrefixIfIndex.type = ASN_INTEGER;
+ memset(&var_ipAddressPrefixType, 0x00,
+ sizeof(var_ipAddressPrefixType));
+ var_ipAddressPrefixType.type = ASN_INTEGER;
+ memset(&var_ipAddressPrefixPrefix, 0x00,
+ sizeof(var_ipAddressPrefixPrefix));
+ var_ipAddressPrefixPrefix.type = ASN_OCTET_STR;
+ memset(&var_ipAddressPrefixLength, 0x00,
+ sizeof(var_ipAddressPrefixLength));
+ var_ipAddressPrefixLength.type = ASN_UNSIGNED;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipAddressPrefixIfIndex.next_variable = &var_ipAddressPrefixType;
+ var_ipAddressPrefixType.next_variable = &var_ipAddressPrefixPrefix;
+ var_ipAddressPrefixPrefix.next_variable = &var_ipAddressPrefixLength;
+ var_ipAddressPrefixLength.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_ipAddressPrefixIfIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->ipAddressPrefixIfIndex =
+ *((long *) var_ipAddressPrefixIfIndex.val.string);
+ mib_idx->ipAddressPrefixType =
+ *((u_long *) var_ipAddressPrefixType.val.string);
+ /*
+ * NOTE: val_len is in bytes, ipAddressPrefixPrefix_len might not be
+ */
+ if (var_ipAddressPrefixPrefix.val_len >
+ sizeof(mib_idx->ipAddressPrefixPrefix))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->ipAddressPrefixPrefix,
+ var_ipAddressPrefixPrefix.val.string,
+ var_ipAddressPrefixPrefix.val_len);
+ mib_idx->ipAddressPrefixPrefix_len =
+ var_ipAddressPrefixPrefix.val_len /
+ sizeof(mib_idx->ipAddressPrefixPrefix[0]);
+ }
+ mib_idx->ipAddressPrefixLength =
+ *((u_long *) var_ipAddressPrefixLength.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipAddressPrefixIfIndex);
+
+ return err;
+} /* ipAddressPrefixTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a ipAddressPrefixTable_rowreq_ctx
+ */
+ipAddressPrefixTable_rowreq_ctx *
+ipAddressPrefixTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ ipAddressPrefixTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(ipAddressPrefixTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:ipAddressPrefixTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "ipAddressPrefixTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->ipAddressPrefixTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ ipAddressPrefixTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ ipAddressPrefixTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* ipAddressPrefixTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a ipAddressPrefixTable_rowreq_ctx
+ */
+void
+ipAddressPrefixTable_release_rowreq_ctx(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:ipAddressPrefixTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ ipAddressPrefixTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* ipAddressPrefixTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipAddressPrefixTable_pre_request(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_mfd_ipAddressPrefixTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipAddressPrefixTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ipAddressPrefixTable_pre_request(ipAddressPrefixTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressPrefixTable", "error %d from "
+ "ipAddressPrefixTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressPrefixTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipAddressPrefixTable_post_request(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressPrefixTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_mfd_ipAddressPrefixTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ ipAddressPrefixTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipAddressPrefixTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = ipAddressPrefixTable_post_request(ipAddressPrefixTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressPrefixTable", "error %d from "
+ "ipAddressPrefixTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressPrefixTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipAddressPrefixTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ ipAddressPrefixTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_mfd_ipAddressPrefixTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * ipAddressPrefixTable_interface_ctx *if_ctx =
+ * (ipAddressPrefixTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ ipAddressPrefixTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ipAddressPrefixTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipAddressPrefixTable_get_column(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_mfd_ipAddressPrefixTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipAddressPrefixOrigin(5)/IpAddressPrefixOriginTC/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IPADDRESSPREFIXORIGIN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressPrefixOrigin_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressPrefixOnLinkFlag(6)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IPADDRESSPREFIXONLINKFLAG:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressPrefixOnLinkFlag_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressPrefixAutonomousFlag(7)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IPADDRESSPREFIXAUTONOMOUSFLAG:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressPrefixAutonomousFlag_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressPrefixAdvPreferredLifetime(8)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPADDRESSPREFIXADVPREFERREDLIFETIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipAddressPrefixAdvPreferredLifetime_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * ipAddressPrefixAdvValidLifetime(9)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPADDRESSPREFIXADVVALIDLIFETIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipAddressPrefixAdvValidLifetime_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipAddressPrefixTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipAddressPrefixTable_get_column */
+
+int
+_mfd_ipAddressPrefixTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressPrefixTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_mfd_ipAddressPrefixTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipAddressPrefixTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressPrefixTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for ipAddressPrefixTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return ipAddressPrefixTable_container_load((netsnmp_container *)
+ cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in ipAddressPrefixTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(ipAddressPrefixTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ ipAddressPrefixTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in ipAddressPrefixTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ipAddressPrefixTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_ipAddressPrefixTable_container_init(ipAddressPrefixTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_ipAddressPrefixTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ ipAddressPrefixTable_oid,
+ ipAddressPrefixTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for ipAddressPrefixTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ ipAddressPrefixTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("ipAddressPrefixTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ipAddressPrefixTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _ipAddressPrefixTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ipAddressPrefixTable_container_shutdown(ipAddressPrefixTable_interface_ctx
+ * if_ctx)
+{
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_ipAddressPrefixTable_container_shutdown", "called\n"));
+
+ ipAddressPrefixTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ipAddressPrefixTable_container_shutdown */
+
+
+ipAddressPrefixTable_rowreq_ctx *
+ipAddressPrefixTable_row_find_by_mib_index(ipAddressPrefixTable_mib_index *
+ mib_idx)
+{
+ ipAddressPrefixTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = ipAddressPrefixTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(ipAddressPrefixTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h
new file mode 100644
index 0000000000..ca829ac597
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h
@@ -0,0 +1,98 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipAddressPrefixTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef IPADDRESSPREFIXTABLE_INTERFACE_H
+#define IPADDRESSPREFIXTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ipAddressPrefixTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _ipAddressPrefixTable_initialize_interface
+ (ipAddressPrefixTable_registration * user_ctx, u_long flags);
+ void
+ _ipAddressPrefixTable_shutdown_interface
+ (ipAddressPrefixTable_registration * user_ctx);
+
+ ipAddressPrefixTable_registration
+ * ipAddressPrefixTable_registration_get(void);
+
+ ipAddressPrefixTable_registration
+ * ipAddressPrefixTable_registration_set
+ (ipAddressPrefixTable_registration * newreg);
+
+ netsnmp_container *ipAddressPrefixTable_container_get(void);
+ int ipAddressPrefixTable_container_size(void);
+ ipAddressPrefixTable_rowreq_ctx
+ * ipAddressPrefixTable_allocate_rowreq_ctx(void *);
+ void
+ ipAddressPrefixTable_release_rowreq_ctx
+ (ipAddressPrefixTable_rowreq_ctx * rowreq_ctx);
+
+ int ipAddressPrefixTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ ipAddressPrefixTable_mib_index
+ * mib_idx);
+ int ipAddressPrefixTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ ipAddressPrefixTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ ipAddressPrefixTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSPREFIXTABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable.h
new file mode 100644
index 0000000000..8d4d27443e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipAddressTable/ipAddressTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
new file mode 100644
index 0000000000..e9a957e896
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
@@ -0,0 +1,2426 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipAddressTable.c 15640 2006-12-06 15:10:40Z rstory $
+ */
+/** \page MFD helper for ipAddressTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/data_access/interface.h>
+
+/*
+ * include our parent header
+ */
+#include "ipAddressTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ipAddressTable_interface.h"
+
+oid ipAddressTable_oid[] = { IPADDRESSTABLE_OID };
+int ipAddressTable_oid_size = OID_LENGTH(ipAddressTable_oid);
+
+ipAddressTable_registration ipAddressTable_user_context;
+
+void initialize_table_ipAddressTable(void);
+void shutdown_table_ipAddressTable(void);
+
+
+/**
+ * Initializes the ipAddressTable module
+ */
+void
+init_ipAddressTable(void)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:init_ipAddressTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform ipAddressTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("ipAddressTable"))
+ initialize_table_ipAddressTable();
+
+} /* init_ipAddressTable */
+
+/**
+ * Shut-down the ipAddressTable module (agent is exiting)
+ */
+void
+shutdown_ipAddressTable(void)
+{
+ if (should_init("ipAddressTable"))
+ shutdown_table_ipAddressTable();
+
+}
+
+/**
+ * Initialize the table ipAddressTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ipAddressTable(void)
+{
+ ipAddressTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:initialize_table_ipAddressTable",
+ "called\n"));
+
+ /*
+ * TODO:301:o: Perform ipAddressTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ipAddressTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ user_context = NULL;
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ipAddressTable_initialize_interface(user_context, flags);
+} /* initialize_table_ipAddressTable */
+
+/**
+ * Shutdown the table ipAddressTable
+ */
+void
+shutdown_table_ipAddressTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipAddressTable_shutdown_interface(&ipAddressTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+ipAddressTable_rowreq_ctx_init(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_rowreq_ctx_init",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ipAddressTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+ipAddressTable_rowreq_ctx_cleanup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_rowreq_ctx_cleanup",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ipAddressTable rowreq cleanup.
+ */
+ if (NULL != rowreq_ctx->data) {
+ ipAddressTable_release_data(rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+ }
+} /* ipAddressTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ * @param user_context
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ipAddressTable_pre_request(ipAddressTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_pre_request",
+ "called\n"));
+
+ /*
+ * TODO:510:o: Perform ipAddressTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+ipAddressTable_post_request(ipAddressTable_registration * user_context,
+ int rc)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_post_request",
+ "called\n"));
+
+ /*
+ * TODO:511:o: Perform ipAddressTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (ipAddressTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ ipAddressTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* ipAddressTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ipAddressTable data context functions.
+ */
+/*
+ * ipAddressTable_allocate_data
+ *
+ * Purpose: create new ipAddressTable_data.
+ */
+ipAddressTable_data *
+ipAddressTable_allocate_data(void)
+{
+ /*
+ * TODO:201:r: |-> allocate memory for the ipAddressTable data context.
+ */
+ ipAddressTable_data *rtn = netsnmp_access_ipaddress_entry_create();
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_allocate_data",
+ "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "ipAddressTable_data.\n");
+ }
+
+ return rtn;
+} /* ipAddressTable_allocate_data */
+
+/*
+ * ipAddressTable_release_data
+ *
+ * Purpose: release ipAddressTable data.
+ */
+void
+ipAddressTable_release_data(ipAddressTable_data * data)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_release_data",
+ "called\n"));
+
+ /*
+ * TODO:202:r: |-> release memory for the ipAddressTable data context.
+ */
+ netsnmp_access_ipaddress_entry_free(data);
+} /* ipAddressTable_release_data */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressAddrType
+ * ipAddressAddrType is subid 1 of ipAddressEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.34.1.1
+ * Description:
+The address type of ipAddressAddr.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 1 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 5/8. Values: unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16)
+ *
+ * Its syntax is InetAddressType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ *
+ *
+ *
+ * NOTE: NODE ipAddressAddrType IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-ipAddressAddrType.m2d :
+ * @verbatim $m2c_node_skip_mapping = 1@endverbatim
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+ipAddressAddrType_map(u_long * mib_ipAddressAddrType_val_ptr,
+ u_long raw_ipAddressAddrType_val)
+{
+ netsnmp_assert(NULL != mib_ipAddressAddrType_val_ptr);
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressAddrType_map",
+ "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement ipAddressAddrType enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_ipAddressAddrType_val) {
+ case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4:
+ *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4;
+ break;
+
+ case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6:
+ *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV6;
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "couldn't map value %ld for ipAddressAddrType\n",
+ raw_ipAddressAddrType_val);
+ *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_UNKNOWN;
+ }
+
+ return MFD_SUCCESS;
+} /* ipAddressAddrType_map */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param ipAddressAddrType_val
+ * @param ipAddressAddr_val_ptr
+ * @param ipAddressAddr_val_ptr_len
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+ipAddressTable_indexes_set_tbl_idx(ipAddressTable_mib_index * tbl_idx,
+ u_long ipAddressAddrType_val,
+ char *ipAddressAddr_val_ptr,
+ size_t ipAddressAddr_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /** WARNING: this code might not work for netsnmp_ipaddress_entry */
+ ipAddressAddrType_map(&tbl_idx->ipAddressAddrType,
+ ipAddressAddrType_val);
+
+ /*
+ * ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->ipAddressAddr_len = sizeof(tbl_idx->ipAddressAddr) / sizeof(tbl_idx->ipAddressAddr[0]); /* max length */
+ /** WARNING: this code might not work for netsnmp_ipaddress_entry */
+ /*
+ * make sure there is enough space for ipAddressAddr data
+ */
+ if (tbl_idx->ipAddressAddr_len < ipAddressAddr_val_ptr_len) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->ipAddressAddr_len = ipAddressAddr_val_ptr_len;
+ memcpy(tbl_idx->ipAddressAddr, ipAddressAddr_val_ptr,
+ ipAddressAddr_val_ptr_len * sizeof(ipAddressAddr_val_ptr[0]));
+
+
+ return MFD_SUCCESS;
+} /* ipAddressTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressAddrType_val,
+ char *ipAddressAddr_val_ptr,
+ size_t ipAddressAddr_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set",
+ "called\n"));
+
+ if (MFD_SUCCESS !=
+ ipAddressTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ ipAddressAddrType_val,
+ ipAddressAddr_val_ptr,
+ ipAddressAddr_val_ptr_len))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != ipAddressTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* ipAddressTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressIfIndex
+ * ipAddressIfIndex is subid 3 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.3
+ * Description:
+The index value which uniquely identifies the interface to
+ which this entry is applicable. The interface identified by
+ a particular value of this index is the same interface as
+ identified by the same value of the IF-MIB's ifIndex.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: d
+ *
+ * Ranges: 1 - 2147483647;
+ *
+ * Its syntax is InterfaceIndex (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the ipAddressIfIndex data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressIfIndex_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressIfIndex_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ long *ipAddressIfIndex_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressIfIndex_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressIfIndex_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressIfIndex data.
+ * copy (* ipAddressIfIndex_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressIfIndex_val_ptr) = rowreq_ctx->data->if_index;
+
+ return MFD_SUCCESS;
+} /* ipAddressIfIndex_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressType
+ * ipAddressType is subid 4 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.4
+ * Description:
+The type of address. broadcast(3) is not a valid value for
+ IPv6 addresses (RFC3513).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: unicast
+ *
+ * Enum range: 2/8. Values: unicast(1), anycast(2), broadcast(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressType_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressType_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressType_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressType_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressType data.
+ * copy (* ipAddressType_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressType_val_ptr) = rowreq_ctx->data->ia_type;
+
+ return MFD_SUCCESS;
+} /* ipAddressType_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressPrefix
+ * ipAddressPrefix is subid 5 of ipAddressEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.34.1.5
+ * Description:
+A pointer to the row in the prefix table to which this
+ address belongs. May be { 0 0 } if there is no such row.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ * defval: zeroDotZero
+ *
+ *
+ * Its syntax is RowPointer (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the ipAddressPrefix data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressPrefix_val_ptr_ptr
+ * Pointer to storage for a oid variable
+ * @param ipAddressPrefix_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by ipAddressPrefix.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*ipAddressPrefix_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update ipAddressPrefix_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+ipAddressPrefix_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ oid ** ipAddressPrefix_val_ptr_ptr,
+ size_t * ipAddressPrefix_val_ptr_len_ptr)
+{
+ oid *dst, tmp_oid[MAX_OID_LEN] =
+ { 1, 3, 6, 1, 2, 1, 4, 32, 1, 5 };
+ u_char tmp_buf[NETSNMP_ACCESS_IPADDRESS_BUF_SIZE];
+ int len;
+
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != ipAddressPrefix_val_ptr_ptr)
+ && (NULL != *ipAddressPrefix_val_ptr_ptr));
+ netsnmp_assert(NULL != ipAddressPrefix_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressPrefix_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressPrefix data.
+ * copy (* ipAddressPrefix_val_ptr_ptr ) data and (* ipAddressPrefix_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ dst = &tmp_oid[10];
+ *(dst++) = rowreq_ctx->data->if_index;
+ *(dst++) = rowreq_ctx->tbl_idx.ipAddressAddrType;
+ *(dst++) = rowreq_ctx->data->ia_address_len;
+ netsnmp_ipaddress_prefix_copy(tmp_buf,
+ rowreq_ctx->tbl_idx.ipAddressAddr,
+ rowreq_ctx->data->ia_address_len,
+ rowreq_ctx->data->ia_prefix_len);
+ for (len = 0; len < rowreq_ctx->data->ia_address_len; ++len)
+ *(dst++) = tmp_buf[len];
+ *(dst++) = rowreq_ctx->data->ia_prefix_len;
+ len = dst - tmp_oid;
+
+ len *= sizeof((*ipAddressPrefix_val_ptr_ptr)[0]);
+ if ((*ipAddressPrefix_val_ptr_len_ptr) < len) {
+ (*ipAddressPrefix_val_ptr_ptr) = malloc(len);
+ if (NULL == (*ipAddressPrefix_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*ipAddressPrefix_val_ptr_len_ptr) = len;
+ memcpy((*ipAddressPrefix_val_ptr_ptr), tmp_oid, len);
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefix_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressOrigin
+ * ipAddressOrigin is subid 6 of ipAddressEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.34.1.6
+ * Description:
+The origin of the address.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 4/8. Values: other(1), manual(2), dhcp(4), linklayer(5), random(6)
+ *
+ * Its syntax is IpAddressOriginTC (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressOrigin data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressOrigin_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressOrigin_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressOrigin_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressOrigin_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressOrigin_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressOrigin data.
+ * copy (* ipAddressOrigin_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressOrigin_val_ptr) = rowreq_ctx->data->ia_origin;
+
+ return MFD_SUCCESS;
+} /* ipAddressOrigin_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressStatus
+ * ipAddressStatus is subid 7 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.7
+ * Description:
+The status of the address, describing if the address can be
+ used for communication.
+
+
+ In the absence of other information, an IPv4 address is
+ always preferred(1).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: preferred
+ *
+ * Enum range: 5/8. Values: preferred(1), invalid(3), inaccessible(4), unknown(5), tentative(6), duplicate(7)
+ *
+ * Its syntax is IpAddressStatusTC (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressStatus_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressStatus_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStatus_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressStatus data.
+ * copy (* ipAddressStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressStatus_val_ptr) = rowreq_ctx->data->ia_status;
+
+ return MFD_SUCCESS;
+} /* ipAddressStatus_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressCreated
+ * ipAddressCreated is subid 8 of ipAddressEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.34.1.8
+ * Description:
+The value of sysUpTime at the time this entry was created.
+ If this entry was created prior to the last re-
+ initialization of the local network management subsystem,
+ then this object contains a zero value.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is TimeStamp (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressCreated data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressCreated_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressCreated_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressCreated_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressCreated_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressCreated_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressCreated data.
+ * copy (* ipAddressCreated_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressCreated_val_ptr) = rowreq_ctx->ipAddressCreated;
+
+ return MFD_SUCCESS;
+} /* ipAddressCreated_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressLastChanged
+ * ipAddressLastChanged is subid 9 of ipAddressEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.34.1.9
+ * Description:
+The value of sysUpTime at the time this entry was last
+ updated. If this entry was updated prior to the last re-
+ initialization of the local network management subsystem,
+ then this object contains a zero value.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is TimeStamp (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressLastChanged data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressLastChanged_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressLastChanged_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressLastChanged_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressLastChanged_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressLastChanged_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressLastChanged data.
+ * copy (* ipAddressLastChanged_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressLastChanged_val_ptr) = rowreq_ctx->ipAddressLastChanged;
+
+ return MFD_SUCCESS;
+} /* ipAddressLastChanged_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressRowStatus
+ * ipAddressRowStatus is subid 10 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.10
+ * Description:
+The status of this conceptual row.
+
+
+ The RowStatus TC requires that this DESCRIPTION clause
+ states under which circumstances other objects in this row
+ can be modified. The value of this object has no effect on
+ whether other objects in this conceptual row can be
+ modified.
+
+
+ A conceptual row can not be made active until the
+ ipAddressIfIndex has been set to a valid index.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressRowStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressRowStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressRowStatus_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressRowStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressRowStatus_val_ptr);
+
+ /** WARNING: this code might not work for netsnmp_ipaddress_entry */
+ (*ipAddressRowStatus_val_ptr) = rowreq_ctx->ipAddressRowStatus;
+
+ return MFD_SUCCESS;
+} /* ipAddressRowStatus_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressStorageType
+ * ipAddressStorageType is subid 11 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.11
+ * Description:
+The storage type for this conceptual row. If this object
+ has a value of 'permanent' then no other objects are
+ required to be able to be modified.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: volatile
+ *
+ * Enum range: 4/8. Values: other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5)
+ *
+ * Its syntax is StorageType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressStorageType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressStorageType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressStorageType_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressStorageType_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressStorageType_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStorageType_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressStorageType data.
+ * copy (* ipAddressStorageType_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressStorageType_val_ptr) = rowreq_ctx->data->ia_storagetype;
+
+ return MFD_SUCCESS;
+} /* ipAddressStorageType_get */
+
+
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * ipAddressTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * ipAddressTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ipAddressTable_undo_setup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_undo_setup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup ipAddressTable undo.
+ * set up ipAddressTable undo information, in preparation for a set.
+ * Undo storage is in (* ipAddressStorageType_val_ptr )*
+ */
+ /*
+ * check for storage types that don't allow modification.
+ * probably should try and do this earlier (and we could, by
+ * adding code to the interface file), but this ought to suffice.
+ */
+ if (STORAGETYPE_READONLY == rowreq_ctx->data->ia_storagetype) {
+ DEBUGMSGTL(("ipAddressTable", "can't change readonly row\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ /*
+ * save last changed
+ */
+ rowreq_ctx->ipAddressLastChanged_undo =
+ rowreq_ctx->ipAddressLastChanged;
+
+
+ /*
+ * just copy everything
+ */
+ rc = netsnmp_access_ipaddress_entry_copy(rowreq_ctx->undo,
+ rowreq_ctx->data);
+
+ return rc;
+} /* ipAddressTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ipAddressTable_undo(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_undo", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> ipAddressTable undo.
+ * ipAddressTable undo information, in response to a failed set.
+ * Undo storage is in (* ipAddressStorageType_val_ptr )*
+ */
+
+ return rc;
+} /* ipAddressTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipAddressTable_undo_cleanup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_undo_cleanup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup ipAddressTable undo.
+ * Undo storage is in (* ipAddressStorageType_val_ptr )*
+ */
+ rowreq_ctx->ipAddressLastChanged =
+ rowreq_ctx->ipAddressLastChanged_undo;
+
+ return rc;
+} /* ipAddressTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipAddressTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipAddressTable_commit(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * commit ipAddressTable data
+ * 1) check the column's flag to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ /*
+ * did anything change?
+ */
+ if (0 == rowreq_ctx->column_set_flags) {
+ DEBUGMSGTL(("ipAddressTable:ipAddressTable_commit",
+ "no change\n"));
+ return MFD_SUCCESS;
+ }
+
+
+ /*
+ * pass everything to data access
+ * let data access know what columns are set
+ */
+ rowreq_ctx->data->flags = rowreq_ctx->column_set_flags;
+
+ if (rowreq_ctx->column_set_flags & COLUMN_IPADDRESSROWSTATUS_FLAG) {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->data->flags |= NETSNMP_ACCESS_IPADDRESS_CREATE;
+ rowreq_ctx->ipAddressCreated = netsnmp_get_agent_uptime();
+ } else if (ROWSTATUS_DESTROY == rowreq_ctx->ipAddressRowStatus) {
+ rowreq_ctx->data->flags |= NETSNMP_ACCESS_IPADDRESS_DELETE;
+ } else
+ rowreq_ctx->data->flags |= NETSNMP_ACCESS_IPADDRESS_CHANGE;
+ } else
+ rowreq_ctx->data->flags |= NETSNMP_ACCESS_IPADDRESS_CHANGE;
+
+ /*
+ * do it
+ */
+ rc = netsnmp_access_ipaddress_entry_set(rowreq_ctx->data);
+ if (rc) {
+ DEBUGMSGTL(("ipAddressTable",
+ "bad rc %d from IP address data access\n", rc));
+ rc = MFD_ERROR;
+ } else {
+ rowreq_ctx->ipAddressLastChanged = netsnmp_get_agent_uptime();
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+ return rc;
+} /* ipAddressTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipAddressTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipAddressTable_undo_commit(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_undo_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo ipAddressTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_IPADDRESSROWSTATUS_FLAG) {
+ /*
+ * if we created an addr, delete it. if we deleted it,
+ * re-create it. If we changed it, change it back.
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->undo->flags |= NETSNMP_ACCESS_IPADDRESS_DELETE;
+ } else if (ROWSTATUS_DESTROY == rowreq_ctx->ipAddressRowStatus) {
+ rowreq_ctx->undo->flags |= NETSNMP_ACCESS_IPADDRESS_CREATE;
+ } else
+ rowreq_ctx->undo->flags |= NETSNMP_ACCESS_IPADDRESS_CHANGE;
+ } else
+ rowreq_ctx->undo->flags |= NETSNMP_ACCESS_IPADDRESS_CHANGE;
+
+ /*
+ * do it
+ */
+ rc = netsnmp_access_ipaddress_entry_set(rowreq_ctx->undo);
+ if (rc) {
+ DEBUGMSGTL(("ipAddressTable",
+ "bad rc %d from IP address data access\n", rc));
+ rc = MFD_ERROR;
+ }
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* ipAddressTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement ipAddressTable node value checks.
+ * TODO:450:M: Implement ipAddressTable undo functions.
+ * TODO:460:M: Implement ipAddressTable set functions.
+ * TODO:480:M: Implement ipAddressTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressIfIndex
+ * ipAddressIfIndex is subid 3 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.3
+ * Description:
+The index value which uniquely identifies the interface to
+ which this entry is applicable. The interface identified by
+ a particular value of this index is the same interface as
+ identified by the same value of the IF-MIB's ifIndex.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: d
+ *
+ * Ranges: 1 - 2147483647;
+ *
+ * Its syntax is InterfaceIndex (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressIfIndex_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipAddressTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 1 - 2147483647
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipAddressIfIndex_check_value(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ long ipAddressIfIndex_val)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressIfIndex_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipAddressIfIndex value.
+ */
+ /*
+ * if the new value is the same as the old, accept it.
+ */
+ if (ipAddressIfIndex_val == rowreq_ctx->data->if_index)
+ return MFD_SUCCESS;
+
+ /*
+ * currently don't support moving addresses between interfaces, so
+ * if this isn't a new row, return error.
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)) {
+ DEBUGMSGT(("ipAddressTable",
+ "changing ifIndex value not supported\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ /*
+ * find name for ifIndex
+ */
+ if (NULL == netsnmp_access_interface_name_find(ipAddressIfIndex_val)) {
+ DEBUGMSGT(("ipAddressTable", "cant find name for index %d\n",
+ ipAddressIfIndex_val));
+ return MFD_NOT_VALID_NOW;
+ }
+
+ return MFD_SUCCESS; /* ipAddressIfIndex value not illegal */
+} /* ipAddressIfIndex_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipAddressTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipAddressIfIndex_undo_setup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressIfIndex_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipAddressIfIndex undo.
+ */
+ /*
+ * handled in ipAddressTable_undo_setup
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressIfIndex_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipAddressIfIndex_val
+ * A long containing the new value.
+ */
+int
+ipAddressIfIndex_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ long ipAddressIfIndex_val)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressIfIndex_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipAddressIfIndex value.
+ * set ipAddressIfIndex value in rowreq_ctx->data
+ */
+ if (rowreq_ctx->data->if_index != ipAddressIfIndex_val)
+ rowreq_ctx->data->if_index = ipAddressIfIndex_val;
+ else
+ rowreq_ctx->column_set_flags &= ~COLUMN_IPADDRESSIFINDEX_FLAG;
+
+ return MFD_SUCCESS;
+} /* ipAddressIfIndex_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipAddressIfIndex_undo(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressIfIndex_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipAddressIfIndex undo.
+ */
+ /*
+ * copy ipAddressIfIndex data
+ * set rowreq_ctx->data->ipAddressIfIndex from rowreq_ctx->undo->ipAddressIfIndex
+ */
+ rowreq_ctx->data->if_index = rowreq_ctx->undo->if_index;
+
+ return MFD_SUCCESS;
+} /* ipAddressIfIndex_undo */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressType
+ * ipAddressType is subid 4 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.4
+ * Description:
+The type of address. broadcast(3) is not a valid value for
+ IPv6 addresses (RFC3513).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: unicast
+ *
+ * Enum range: 2/8. Values: unicast(1), anycast(2), broadcast(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipAddressTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of unicast(1), anycast(2), broadcast(3)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipAddressType_check_value(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressType_val)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressType_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipAddressType value.
+ *
+ * no support for anything but unicast yet
+ */
+ if (ipAddressType_val != IPADDRESSTYPE_UNICAST)
+ return MFD_NOT_VALID_EVER;
+
+ return MFD_SUCCESS; /* ipAddressType value not illegal */
+} /* ipAddressType_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipAddressTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipAddressType_undo_setup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressType_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipAddressType undo.
+ */
+ /*
+ * handled in ipAddressTable_undo_setup
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressType_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipAddressType_val
+ * A long containing the new value.
+ */
+int
+ipAddressType_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressType_val)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressType_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipAddressType value.
+ * set ipAddressType value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->ia_type = ipAddressType_val;
+
+ return MFD_SUCCESS;
+} /* ipAddressType_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipAddressType_undo(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressType_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipAddressType undo.
+ */
+ /*
+ * copy ipAddressType data
+ * set rowreq_ctx->data->ipAddressType from rowreq_ctx->undo->ipAddressType
+ */
+ rowreq_ctx->data->ia_type = rowreq_ctx->undo->ia_type;
+
+ return MFD_SUCCESS;
+} /* ipAddressType_undo */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressStatus
+ * ipAddressStatus is subid 7 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.7
+ * Description:
+The status of the address, describing if the address can be
+ used for communication.
+
+
+ In the absence of other information, an IPv4 address is
+ always preferred(1).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: preferred
+ *
+ * Enum range: 5/8. Values: preferred(1), invalid(3), inaccessible(4), unknown(5), tentative(6), duplicate(7)
+ *
+ * Its syntax is IpAddressStatusTC (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipAddressTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of preferred(1), invalid(3), inaccessible(4), unknown(5), tentative(6), duplicate(7)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipAddressStatus_check_value(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressStatus_val)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStatus_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipAddressStatus value.
+ *
+ * nothing but preferred supported yet
+ */
+ if (IPADDRESSSTATUSTC_PREFERRED != ipAddressStatus_val)
+ return MFD_NOT_VALID_EVER;
+
+ return MFD_SUCCESS; /* ipAddressStatus value not illegal */
+} /* ipAddressStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipAddressTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipAddressStatus_undo_setup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStatus_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipAddressStatus undo.
+ */
+ /*
+ * handled in ipAddressTable_undo_setup
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipAddressStatus_val
+ * A long containing the new value.
+ */
+int
+ipAddressStatus_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStatus_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipAddressStatus value.
+ * set ipAddressStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->ia_status = ipAddressStatus_val;
+
+ return MFD_SUCCESS;
+} /* ipAddressStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipAddressStatus_undo(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStatus_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipAddressStatus undo.
+ */
+ /*
+ * copy ipAddressStatus data
+ * set rowreq_ctx->data->ipAddressStatus from rowreq_ctx->undo->ipAddressStatus
+ */
+ rowreq_ctx->data->ia_status = rowreq_ctx->undo->ia_status;
+
+ return MFD_SUCCESS;
+} /* ipAddressStatus_undo */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressRowStatus
+ * ipAddressRowStatus is subid 10 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.10
+ * Description:
+The status of this conceptual row.
+
+
+ The RowStatus TC requires that this DESCRIPTION clause
+ states under which circumstances other objects in this row
+ can be modified. The value of this object has no effect on
+ whether other objects in this conceptual row can be
+ modified.
+
+
+ A conceptual row can not be made active until the
+ ipAddressIfIndex has been set to a valid index.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressRowStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipAddressTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipAddressRowStatus_check_value(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressRowStatus_val)
+{
+ int rc;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressRowStatus_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipAddressRowStatus value.
+ *
+ * don't support createAndWait
+ * check for valid RowStatus transition (old, new)
+ */
+ if (ROWSTATUS_CREATEANDWAIT == ipAddressRowStatus_val) {
+ DEBUGMSGTL(("ipAddressTable", "createAndWait not supported\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ rc = check_rowstatus_transition(rowreq_ctx->ipAddressRowStatus,
+ ipAddressRowStatus_val);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable",
+ "row status transition from %d to %d\n",
+ rowreq_ctx->ipAddressRowStatus,
+ ipAddressRowStatus_val));
+ return rc;
+ }
+
+ return MFD_SUCCESS; /* ipAddressRowStatus value not illegal */
+} /* ipAddressRowStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipAddressTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipAddressRowStatus_undo_setup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressRowStatus_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipAddressRowStatus undo.
+ */
+ /*
+ * handled in ipAddressTable_undo_setup
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressRowStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipAddressRowStatus_val
+ * A long containing the new value.
+ */
+int
+ipAddressRowStatus_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressRowStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressRowStatus_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipAddressRowStatus value.
+ * set ipAddressRowStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->ipAddressRowStatus = ipAddressRowStatus_val;
+
+ return MFD_SUCCESS;
+} /* ipAddressRowStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipAddressRowStatus_undo(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressRowStatus_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipAddressRowStatus undo.
+ */
+ /*
+ * copy ipAddressRowStatus data
+ * set rowreq_ctx->data->ipAddressRowStatus from rowreq_ctx->undo->ipAddressRowStatus
+ */
+ rowreq_ctx->ipAddressRowStatus = rowreq_ctx->ipAddressRowStatus_undo;
+
+ return MFD_SUCCESS;
+} /* ipAddressRowStatus_undo */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressStorageType
+ * ipAddressStorageType is subid 11 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.11
+ * Description:
+The storage type for this conceptual row. If this object
+ has a value of 'permanent' then no other objects are
+ required to be able to be modified.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: volatile
+ *
+ * Enum range: 4/8. Values: other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5)
+ *
+ * Its syntax is StorageType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressStorageType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipAddressTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipAddressStorageType_check_value(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressStorageType_val)
+{
+ int rc;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStorageType_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipAddressStorageType value.
+ */
+ /*
+ * since I don't know how the various operating systems
+ * deal with ip addresses, and whether or not changes will
+ * be saved on reboot, so don't allow rows to be set to anything
+ * but volatile. I'd prefer other, but since the default for
+ * new rows, per the mib, is volatile...
+ *
+ * If some industrious soul would like
+ * non-volaltile support, the first would need to
+ * add it in the data access code for their os
+ * define a flag bit for volatile/permanent/readonly
+ * set the bit in data access
+ * copy the bit to a new var in the rowreq_ctx (see _add_new_entry)
+ * with a default of volatile (for os' w/out nonvolatile support)
+ * update this code to use new flag
+ */
+ if (STORAGETYPE_VOLATILE != ipAddressStorageType_val)
+ return MFD_NOT_VALID_EVER;
+
+ /*
+ * check for valid StorageType transition (old, new)
+ */
+ rc = check_storage_transition(rowreq_ctx->data->ia_storagetype,
+ ipAddressStorageType_val);
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return MFD_SUCCESS; /* ipAddressStorageType value not illegal */
+} /* ipAddressStorageType_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipAddressTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipAddressStorageType_undo_setup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStorageType_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipAddressStorageType undo.
+ */
+ /*
+ * handled in ipAddressTable_undo_setup
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressStorageType_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipAddressStorageType_val
+ * A long containing the new value.
+ */
+int
+ipAddressStorageType_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressStorageType_val)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStorageType_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipAddressStorageType value.
+ * set ipAddressStorageType value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->ia_storagetype = ipAddressStorageType_val;
+
+ return MFD_SUCCESS;
+} /* ipAddressStorageType_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipAddressStorageType_undo(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStorageType_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipAddressStorageType undo.
+ */
+ /*
+ * copy ipAddressStorageType data
+ * set rowreq_ctx->data->ipAddressStorageType from rowreq_ctx->undo->ipAddressStorageType
+ */
+ rowreq_ctx->data->ia_storagetype = rowreq_ctx->undo->ia_storagetype;
+
+ return MFD_SUCCESS;
+} /* ipAddressStorageType_undo */
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipAddressTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-ipAddressTable if you don't have dependencies)
+ */
+int
+ipAddressTable_check_dependencies(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressTable:ipAddressTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check ipAddressTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_IPADDRESSROWSTATUS_FLAG) {
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ if (ROWSTATUS_DESTROY == rowreq_ctx->ipAddressRowStatus) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ } else if (ROWSTATUS_CREATEANDGO ==
+ rowreq_ctx->ipAddressRowStatus) {
+ if ((rowreq_ctx->
+ column_set_flags & IPADDRESSTABLE_REQUIRED_COLS)
+ != IPADDRESSTABLE_REQUIRED_COLS) {
+ DEBUGMSGTL(("ipAddressTable",
+ "required columns missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_set_flags,
+ IPADDRESSTABLE_REQUIRED_COLS));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ rowreq_ctx->ipAddressRowStatus = ROWSTATUS_ACTIVE;
+ }
+ } /* row creation */
+ else {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY == rowreq_ctx->ipAddressRowStatus) {
+ if (rowreq_ctx->
+ column_set_flags & ~COLUMN_IPADDRESSROWSTATUS_FLAG) {
+ DEBUGMSGTL(("ipAddressTable",
+ "destroy must be only varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+ } /* row change */
+ } else {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ DEBUGMSGTL(("ipAddressTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ } /* row status not set */
+
+ return rc;
+} /* ipAddressTable_check_dependencies */
+
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
new file mode 100644
index 0000000000..6f4cafe042
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
@@ -0,0 +1,457 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipAddressTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef IPADDRESSTABLE_H
+#define IPADDRESSTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/ipaddress.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(if-mib/data_access/interface)
+config_require(ip-mib/data_access/ipaddress)
+config_require(ip-mib/ipAddressTable/ipAddressTable_interface)
+config_require(ip-mib/ipAddressTable/ipAddressTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for ipAddressTable
+ */
+#include "ipAddressTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ipAddressTable(void);
+ void shutdown_ipAddressTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review ipAddressTable registration context.
+ */
+ typedef netsnmp_data_list ipAddressTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review ipAddressTable data context structure.
+ * This structure is used to represent the data for ipAddressTable.
+ */
+ typedef netsnmp_ipaddress_entry ipAddressTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review ipAddressTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef ipAddressTable_data ipAddressTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review ipAddressTable mib index.
+ * This structure is used to represent the index for ipAddressTable.
+ */
+ typedef struct ipAddressTable_mib_index_s {
+
+ /*
+ * ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long ipAddressAddrType;
+
+ /*
+ * ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /** 128 - 1(other indexes) - oid length(10) = 116 */
+ char ipAddressAddr[116];
+ size_t ipAddressAddr_len;
+
+
+ } ipAddressTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review ipAddressTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(8)
+ */
+#define MAX_ipAddressTable_IDX_LEN 118
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review ipAddressTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * ipAddressTable_rowreq_ctx pointer.
+ */
+ typedef struct ipAddressTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_ipAddressTable_IDX_LEN];
+
+ ipAddressTable_mib_index tbl_idx;
+
+ ipAddressTable_data *data;
+ ipAddressTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to ipAddressTable rowreq context.
+ */
+
+ /*
+ * not available from net-snmp ipaddress data_access
+ */
+ uint32_t ipAddressCreated; /* sysUpTime */
+ uint32_t ipAddressLastChanged, ipAddressLastChanged_undo; /* sysUpTime */
+ int ipAddressRowStatus, ipAddressRowStatus_undo;
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *ipAddressTable_data_list;
+
+ } ipAddressTable_rowreq_ctx;
+
+ typedef struct ipAddressTable_ref_rowreq_ctx_s {
+ ipAddressTable_rowreq_ctx *rowreq_ctx;
+ } ipAddressTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int ipAddressTable_pre_request(ipAddressTable_registration
+ * user_context);
+ int ipAddressTable_post_request(ipAddressTable_registration
+ * user_context, int rc);
+
+ int
+ ipAddressTable_rowreq_ctx_init(ipAddressTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx);
+ void
+ ipAddressTable_rowreq_ctx_cleanup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ ipAddressTable_data *ipAddressTable_allocate_data(void);
+ void ipAddressTable_release_data(ipAddressTable_data *
+ data);
+
+ int
+ ipAddressTable_check_dependencies(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressTable_commit(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ ipAddressTable_rowreq_ctx
+ * ipAddressTable_row_find_by_mib_index(ipAddressTable_mib_index *
+ mib_idx);
+
+ extern oid ipAddressTable_oid[];
+ extern int ipAddressTable_oid_size;
+
+
+#include "ipAddressTable_interface.h"
+#include "ipAddressTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+ /*
+ * indexes
+ */
+ int ipAddressAddrType_map(u_long *
+ mib_ipAddressAddrType_val_ptr,
+ u_long
+ raw_ipAddressAddrType_val);
+
+ int ipAddressIfIndex_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ long *ipAddressIfIndex_val_ptr);
+ int ipAddressType_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipAddressType_val_ptr);
+ int ipAddressPrefix_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ oid ** ipAddressPrefix_val_ptr_ptr,
+ size_t
+ * ipAddressPrefix_val_ptr_len_ptr);
+ int ipAddressOrigin_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipAddressOrigin_val_ptr);
+ int ipAddressStatus_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipAddressStatus_val_ptr);
+ int ipAddressCreated_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressCreated_val_ptr);
+ int ipAddressLastChanged_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressLastChanged_val_ptr);
+ int ipAddressRowStatus_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressRowStatus_val_ptr);
+ int ipAddressStorageType_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressStorageType_val_ptr);
+
+
+ int
+ ipAddressTable_indexes_set_tbl_idx(ipAddressTable_mib_index *
+ tbl_idx,
+ u_long ipAddressAddrType_val,
+ char *ipAddressAddr_val_ptr,
+ size_t
+ ipAddressAddr_val_ptr_len);
+ int ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipAddressAddrType_val,
+ char *ipAddressAddr_val_ptr,
+ size_t
+ ipAddressAddr_val_ptr_len);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+
+
+ int ipAddressTable_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressTable_undo_cleanup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressTable_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressTable_commit(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressTable_undo_commit(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int ipAddressIfIndex_check_value(ipAddressTable_rowreq_ctx
+ * rowreq_ctx, long
+ ipAddressIfIndex_val);
+
+ int ipAddressIfIndex_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressIfIndex_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipAddressIfIndex_val);
+ int ipAddressIfIndex_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipAddressType_check_value(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressType_val);
+ int ipAddressType_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressType_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressType_val);
+ int ipAddressType_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipAddressPrefix_check_value(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ oid *
+ ipAddressPrefix_val_ptr,
+ size_t
+ ipAddressPrefix_val_ptr_len);
+ int ipAddressPrefix_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressPrefix_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ oid * ipAddressPrefix_val_ptr,
+ size_t
+ ipAddressPrefix_val_ptr_len);
+ int ipAddressPrefix_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipAddressOrigin_check_value(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipAddressOrigin_val);
+ int ipAddressOrigin_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressOrigin_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressOrigin_val);
+ int ipAddressOrigin_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipAddressStatus_check_value(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipAddressStatus_val);
+ int ipAddressStatus_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressStatus_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressStatus_val);
+ int ipAddressStatus_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipAddressCreated_check_value(ipAddressTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ ipAddressCreated_val);
+ int ipAddressCreated_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressCreated_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressCreated_val);
+ int ipAddressCreated_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipAddressLastChanged_check_value(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressLastChanged_val);
+ int
+ ipAddressLastChanged_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressLastChanged_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipAddressLastChanged_val);
+ int ipAddressLastChanged_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipAddressRowStatus_check_value(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressRowStatus_val);
+ int ipAddressRowStatus_undo_setup(ipAddressTable_rowreq_ctx
+ * rowreq_ctx);
+ int ipAddressRowStatus_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressRowStatus_val);
+ int ipAddressRowStatus_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipAddressStorageType_check_value(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressStorageType_val);
+ int
+ ipAddressStorageType_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressStorageType_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipAddressStorageType_val);
+ int ipAddressStorageType_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ ipAddressTable_check_dependencies(ipAddressTable_rowreq_ctx * ctx);
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSTABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
new file mode 100644
index 0000000000..e7a7ae50a6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
@@ -0,0 +1,213 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: ipAddressTable_constants.h 13767 2005-12-01 17:00:57Z rstory $
+ */
+#ifndef IPADDRESSTABLE_CONSTANTS_H
+#define IPADDRESSTABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ipAddressTable
+ */
+#define IPADDRESSTABLE_OID 1,3,6,1,2,1,4,34
+
+#define COLUMN_IPADDRESSADDRTYPE 1
+
+#define COLUMN_IPADDRESSADDR 2
+
+#define COLUMN_IPADDRESSIFINDEX 3
+#define COLUMN_IPADDRESSIFINDEX_FLAG (0x1 << 2)
+
+#define COLUMN_IPADDRESSTYPE 4
+#define COLUMN_IPADDRESSTYPE_FLAG (0x1 << 3)
+
+#define COLUMN_IPADDRESSPREFIX 5
+
+#define COLUMN_IPADDRESSORIGIN 6
+
+#define COLUMN_IPADDRESSSTATUS 7
+#define COLUMN_IPADDRESSSTATUS_FLAG (0x1 << 6)
+
+#define COLUMN_IPADDRESSCREATED 8
+
+#define COLUMN_IPADDRESSLASTCHANGED 9
+
+#define COLUMN_IPADDRESSROWSTATUS 10
+#define COLUMN_IPADDRESSROWSTATUS_FLAG (0x1 << 9)
+
+#define COLUMN_IPADDRESSSTORAGETYPE 11
+#define COLUMN_IPADDRESSSTORAGETYPE_FLAG (0x1 << 10)
+
+
+#define IPADDRESSTABLE_MIN_COL COLUMN_IPADDRESSIFINDEX
+#define IPADDRESSTABLE_MAX_COL COLUMN_IPADDRESSSTORAGETYPE
+
+ /*
+ * TODO:405:r: Review IPADDRESSTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define IPADDRESSTABLE_SETTABLE_COLS (COLUMN_IPADDRESSIFINDEX_FLAG | COLUMN_IPADDRESSTYPE_FLAG | COLUMN_IPADDRESSSTATUS_FLAG | COLUMN_IPADDRESSROWSTATUS_FLAG | COLUMN_IPADDRESSSTORAGETYPE_FLAG)
+ /*
+ * TODO:405:r: Review IPADDRESSTABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define IPADDRESSTABLE_REQUIRED_COLS (COLUMN_IPADDRESSIFINDEX_FLAG | COLUMN_IPADDRESSROWSTATUS_FLAG)
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table ipAddressTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressAddrType (InetAddressType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETADDRESSTYPE_ENUMS
+#define INETADDRESSTYPE_ENUMS
+
+#define INETADDRESSTYPE_UNKNOWN 0
+#define INETADDRESSTYPE_IPV4 1
+#define INETADDRESSTYPE_IPV6 2
+#define INETADDRESSTYPE_IPV4Z 3
+#define INETADDRESSTYPE_IPV6Z 4
+#define INETADDRESSTYPE_DNS 16
+
+#endif /* INETADDRESSTYPE_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of ipAddressAddrType enums.
+ * (used for value mapping; see notes at top of file)
+ *
+ * simplistic map of address length to type
+ */
+#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4 4
+#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6 16
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressType (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPADDRESSTYPE_ENUMS
+#define IPADDRESSTYPE_ENUMS
+
+#define IPADDRESSTYPE_UNICAST 1
+#define IPADDRESSTYPE_ANYCAST 2
+#define IPADDRESSTYPE_BROADCAST 3
+
+#endif /* IPADDRESSTYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressOrigin (IpAddressOriginTC / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPADDRESSORIGINTC_ENUMS
+#define IPADDRESSORIGINTC_ENUMS
+
+#define IPADDRESSORIGINTC_OTHER 1
+#define IPADDRESSORIGINTC_MANUAL 2
+#define IPADDRESSORIGINTC_DHCP 4
+#define IPADDRESSORIGINTC_LINKLAYER 5
+#define IPADDRESSORIGINTC_RANDOM 6
+
+#endif /* IPADDRESSORIGINTC_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressStatus (IpAddressStatusTC / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPADDRESSSTATUSTC_ENUMS
+#define IPADDRESSSTATUSTC_ENUMS
+
+#define IPADDRESSSTATUSTC_PREFERRED 1
+#define IPADDRESSSTATUSTC_DEPRECATED 2
+#define IPADDRESSSTATUSTC_INVALID 3
+#define IPADDRESSSTATUSTC_INACCESSIBLE 4
+#define IPADDRESSSTATUSTC_UNKNOWN 5
+#define IPADDRESSSTATUSTC_TENTATIVE 6
+#define IPADDRESSSTATUSTC_DUPLICATE 7
+
+#endif /* IPADDRESSSTATUSTC_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressRowStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressStorageType (StorageType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef STORAGETYPE_ENUMS
+#define STORAGETYPE_ENUMS
+
+#define STORAGETYPE_OTHER 1
+#define STORAGETYPE_VOLATILE 2
+#define STORAGETYPE_NONVOLATILE 3
+#define STORAGETYPE_PERMANENT 4
+#define STORAGETYPE_READONLY 5
+
+#endif /* STORAGETYPE_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
new file mode 100644
index 0000000000..035ee51055
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
@@ -0,0 +1,708 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipAddressTable_data_access.c 16381 2007-05-17 21:53:28Z hardaker $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipAddressTable.h"
+
+
+#include "ipAddressTable_data_access.h"
+
+#include <sys/ioctl.h>
+#include <errno.h>
+
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+
+/**
+ * initialization for ipAddressTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ipAddressTable_reg
+ * Pointer to ipAddressTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ipAddressTable_init_data(ipAddressTable_registration * ipAddressTable_reg)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize ipAddressTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+/**
+ * check entry for update
+ */
+static void
+_clear_times(ipAddressTable_rowreq_ctx * rowreq_ctx, void *magic)
+{
+ rowreq_ctx->ipAddressLastChanged = rowreq_ctx->ipAddressCreated = 0;
+}
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+ipAddressTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_container_init",
+ "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ipAddressTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ /*
+ * We create a custom container here so we can pre-load it, which
+ * will result in all new entries with last changed values. we need
+ * to clear those... We also need to make sure ifIndexes have been
+ * assigned...
+ */
+ *container_ptr_ptr =
+ netsnmp_container_find("ipAddressTable:table_container");
+ if (NULL != *container_ptr_ptr) {
+ ipAddressTable_container_load(*container_ptr_ptr);
+ CONTAINER_FOR_EACH(*container_ptr_ptr,
+ (netsnmp_container_obj_func *) _clear_times,
+ NULL);
+ }
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to ipAddressTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up ipAddressTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+
+ /*
+ * basically, turn off all automatic cache handling except autoload.
+ */
+ cache->flags |=
+ (NETSNMP_CACHE_DONT_AUTO_RELEASE | NETSNMP_CACHE_DONT_FREE_EXPIRED
+ | NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD | NETSNMP_CACHE_AUTO_RELOAD
+ | NETSNMP_CACHE_DONT_INVALIDATE_ON_SET);
+} /* ipAddressTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before ipAddressTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+ipAddressTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_container_shutdown",
+ "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to ipAddressTable_container_shutdown\n");
+ return;
+ }
+
+} /* ipAddressTable_container_shutdown */
+
+/**
+ * check entry for update
+ */
+static void
+_check_entry_for_updates(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ void **magic)
+{
+ netsnmp_container *ipaddress_container = magic[0];
+ netsnmp_container *to_delete = (netsnmp_container *) magic[1];
+
+ /*
+ * check for matching entry using secondary index.
+ */
+ netsnmp_ipaddress_entry *ipaddress_entry =
+ CONTAINER_FIND(ipaddress_container, rowreq_ctx->data);
+ if (NULL == ipaddress_entry) {
+ DEBUGMSGTL(("ipAddressTable:access", "removing missing entry\n"));
+
+ if (NULL == to_delete) {
+ magic[1] = to_delete = netsnmp_container_find("lifo");
+ if (NULL == to_delete)
+ snmp_log(LOG_ERR, "couldn't create delete container\n");
+ }
+ if (NULL != to_delete)
+ CONTAINER_INSERT(to_delete, rowreq_ctx);
+ } else {
+ DEBUGMSGTL(("ipAddressTable:access", "updating existing entry\n"));
+
+ /*
+ * Check for changes & update
+ */
+ if (netsnmp_access_ipaddress_entry_update(rowreq_ctx->data,
+ ipaddress_entry) > 0)
+ rowreq_ctx->ipAddressLastChanged = netsnmp_get_agent_uptime();
+
+ /*
+ * remove entry from ifcontainer
+ */
+ CONTAINER_REMOVE(ipaddress_container, ipaddress_entry);
+ netsnmp_access_ipaddress_entry_free(ipaddress_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_add_new_entry(netsnmp_ipaddress_entry *ipaddress_entry,
+ netsnmp_container *container)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx;
+
+ DEBUGMSGTL(("ipAddressTable:access", "creating new entry\n"));
+
+ netsnmp_assert(NULL != ipaddress_entry);
+ netsnmp_assert(NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx = ipAddressTable_allocate_rowreq_ctx(ipaddress_entry, NULL);
+ if ((NULL != rowreq_ctx) &&
+ (MFD_SUCCESS ==
+ ipAddressTable_indexes_set(rowreq_ctx,
+ ipaddress_entry->ia_address_len,
+ ipaddress_entry->ia_address,
+ ipaddress_entry->ia_address_len))) {
+ if (CONTAINER_INSERT(container, rowreq_ctx) < 0) {
+ DEBUGMSGTL (("ipAddressTable:access","container insert failed for new entry\n"));
+ ipAddressTable_release_rowreq_ctx(rowreq_ctx);
+ return;
+ }
+ rowreq_ctx->ipAddressLastChanged =
+ rowreq_ctx->ipAddressCreated = netsnmp_get_agent_uptime();
+ } else {
+ if (NULL != rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "ipAddressTable cache.\n");
+ ipAddressTable_release_rowreq_ctx(rowreq_ctx);
+ } else {
+ snmp_log(LOG_ERR, "memory allocation failed while loading "
+ "ipAddressTable cache.\n");
+ netsnmp_access_ipaddress_entry_free(ipaddress_entry);
+ }
+
+ return;
+ }
+
+ /*-------------------------------------------------------------------
+ * handle data that isn't part of the data_access ipaddress structure
+ */
+ rowreq_ctx->ipAddressRowStatus = ROWSTATUS_ACTIVE;
+}
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ipAddressTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * ipAddressTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+ipAddressTable_container_load(netsnmp_container *container)
+{
+ netsnmp_container *ipaddress_container;
+ void *tmp_ptr[2];
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_cache_load",
+ "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the ipAddressTable container.
+ * loop over your ipAddressTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ ipaddress_container =
+ netsnmp_access_ipaddress_container_load(NULL,
+ NETSNMP_ACCESS_IPADDRESS_LOAD_ADDL_IDX_BY_ADDR);
+ /*
+ * we just got a fresh copy of interface data. compare it to
+ * what we've already got, and make any adjustments, saving
+ * missing addresses to be deleted.
+ */
+ tmp_ptr[0] = ipaddress_container->next;
+ tmp_ptr[1] = NULL;
+ CONTAINER_FOR_EACH(container, (netsnmp_container_obj_func *)
+ _check_entry_for_updates, tmp_ptr);
+
+ /*
+ * now add any new interfaces
+ */
+ CONTAINER_FOR_EACH(ipaddress_container,
+ (netsnmp_container_obj_func *) _add_new_entry,
+ container);
+
+ /*
+ * free the container. we've either claimed each entry, or released it,
+ * so the access function doesn't need to clear the container.
+ */
+ netsnmp_access_ipaddress_container_free(ipaddress_container,
+ NETSNMP_ACCESS_IPADDRESS_FREE_DONT_CLEAR);
+
+ /*
+ * remove deleted addresses from table container
+ */
+ if (NULL != tmp_ptr[1]) {
+ netsnmp_container *tmp_container =
+ (netsnmp_container *) tmp_ptr[1];
+ ipAddressTable_rowreq_ctx *tmp_ctx;
+
+ /*
+ * this works because the tmp_container is a linked list,
+ * which can be used like a stack...
+ */
+ while (CONTAINER_SIZE(tmp_container)) {
+ /*
+ * get from delete list
+ */
+ tmp_ctx = CONTAINER_FIRST(tmp_container);
+
+ /*
+ * release context, delete from table container
+ */
+ CONTAINER_REMOVE(container, tmp_ctx);
+ ipAddressTable_release_rowreq_ctx(tmp_ctx);
+
+ /*
+ * pop off delete list
+ */
+ CONTAINER_REMOVE(tmp_container, NULL);
+ }
+ }
+
+ DEBUGMSGT(("verbose:ipAddressTable:ipAddressTable_cache_load",
+ "%d records\n", CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+}
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+ipAddressTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_container_free",
+ "called\n"));
+
+ /*
+ * TODO:380:M: Free ipAddressTable container data.
+ */
+} /* ipAddressTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+ipAddressTable_row_prep(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressTable_row_prep */
+
+/*
+ * TODO:420:r: Implement ipAddressTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressAddrType
+ * ipAddressAddrType is subid 1 of ipAddressEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.34.1.1
+ * Description:
+The address type of ipAddressAddr.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 1 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 5/8. Values: unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16)
+ *
+ * Its syntax is InetAddressType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ *
+ *
+ *
+ * NOTE: NODE ipAddressAddrType IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of ipAddressAddrType index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * ipAddressTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The value is one of unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+ipAddressAddrType_check_index(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressAddrType_check_index",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check ipAddressTable index ipAddressAddrType.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.ipAddressAddrType)
+ */
+ switch (rowreq_ctx->tbl_idx.ipAddressAddrType) {
+
+ case INETADDRESSTYPE_IPV4:
+ case INETADDRESSTYPE_IPV6:
+ break;
+
+ default:
+ DEBUGMSGT(("ipAddressTable", "illegal addr type\n"));
+ return MFD_ERROR;
+ }
+
+
+ return MFD_SUCCESS; /* ipAddressAddrType index ok */
+} /* ipAddressAddrType_check_index */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressAddr
+ * ipAddressAddr is subid 2 of ipAddressEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.34.1.2
+ * Description:
+The IP address to which this entry's addressing information
+ pertains. The address type of this object is specified in
+ ipAddressAddrType.
+
+
+ Implementors need to be aware that if the size of
+ ipAddressAddr exceeds 116 octets then OIDS of instances of
+ columns in this row will have more than 128 sub-identifiers
+ and cannot be accessed using SNMPv1, SNMPv2c or SNMPv3.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is InetAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ *
+ *
+ *
+ * NOTE: NODE ipAddressAddr IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of ipAddressAddr index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * ipAddressTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The length is in (one of) the range set(s): 0 - 255
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+ipAddressAddr_check_index(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressAddr_check_index",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check ipAddressTable index ipAddressAddr.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.ipAddressAddr)
+ */
+ switch (rowreq_ctx->tbl_idx.ipAddressAddrType) {
+
+ case INETADDRESSTYPE_IPV4:
+ if (4 != rowreq_ctx->tbl_idx.ipAddressAddr_len) {
+ DEBUGMSGT(("ipAddressTable", "bad addr len: %d\n",rowreq_ctx->tbl_idx.ipAddressAddr_len));
+ return MFD_ERROR;
+ }
+ break;
+
+ case INETADDRESSTYPE_IPV6:
+ /** xxx-rks: allow 20? */
+ if (16 != rowreq_ctx->tbl_idx.ipAddressAddr_len) {
+ DEBUGMSGT(("ipAddressTable", "bad addr len: %d\n",rowreq_ctx->tbl_idx.ipAddressAddr_len));
+ return MFD_ERROR;
+ }
+ break;
+
+ default:
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS; /* ipAddressAddr index ok */
+} /* ipAddressAddr_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param ipAddressTable_reg
+ * Pointer to the user registration data
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+ipAddressTable_validate_index(ipAddressTable_registration *
+ ipAddressTable_reg,
+ ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_validate_index",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:430:M: |-> Validate potential ipAddressTable index.
+ *
+ *
+ * xxx-rks: we only plan ipv4 support initially
+ */
+ if ((4 != rowreq_ctx->tbl_idx.ipAddressAddr_len)) {
+ snmp_log(LOG_WARNING, "invalid index for a new row in the "
+ "ipAddressTable table.\n");
+ /*
+ * determine failure type.
+ *
+ * If the index could not ever be created, return MFD_NOT_EVER
+ * If the index can not be created under the present circumstances
+ * (even though it could be created under other circumstances),
+ * return MFD_NOT_NOW.
+ */
+ if (0) {
+ return MFD_CANNOT_CREATE_EVER;
+ } else {
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ } else {
+ rowreq_ctx->data->ia_address[0] =
+ rowreq_ctx->tbl_idx.ipAddressAddr[0];
+ rowreq_ctx->data->ia_address[1] =
+ rowreq_ctx->tbl_idx.ipAddressAddr[1];
+ rowreq_ctx->data->ia_address[2] =
+ rowreq_ctx->tbl_idx.ipAddressAddr[2];
+ rowreq_ctx->data->ia_address[3] =
+ rowreq_ctx->tbl_idx.ipAddressAddr[3];
+ rowreq_ctx->data->ia_address_len = 4;
+ }
+
+ return rc;
+} /* ipAddressTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h
new file mode 100644
index 0000000000..8e8a985501
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h
@@ -0,0 +1,79 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipAddressTable_data_access.h 13767 2005-12-01 17:00:57Z rstory $
+ */
+#ifndef IPADDRESSTABLE_DATA_ACCESS_H
+#define IPADDRESSTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+
+
+ int ipAddressTable_init_data(ipAddressTable_registration *
+ ipAddressTable_reg);
+
+
+ /*
+ * TODO:180:o: Review ipAddressTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define IPADDRESSTABLE_CACHE_TIMEOUT 60
+
+ void ipAddressTable_container_init(netsnmp_container
+ **container_ptr_ptr,
+ netsnmp_cache * cache);
+ void ipAddressTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int ipAddressTable_container_load(netsnmp_container
+ *container);
+ void ipAddressTable_container_free(netsnmp_container
+ *container);
+
+ int ipAddressTable_cache_load(netsnmp_container
+ *container);
+ void ipAddressTable_cache_free(netsnmp_container
+ *container);
+
+ int ipAddressTable_row_prep(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipAddressTable_validate_index(ipAddressTable_registration *
+ ipAddressTable_reg,
+ ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressAddrType_check_index(ipAddressTable_rowreq_ctx * rowreq_ctx); /* internal */
+ int ipAddressAddr_check_index(ipAddressTable_rowreq_ctx * rowreq_ctx); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c
new file mode 100644
index 0000000000..c2f13f3f79
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c
@@ -0,0 +1,2062 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipAddressTable_interface.c 15781 2007-01-23 22:55:06Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipAddressTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ipAddressTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+typedef struct ipAddressTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ ipAddressTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} ipAddressTable_interface_ctx;
+
+static ipAddressTable_interface_ctx ipAddressTable_if_ctx;
+
+static void _ipAddressTable_container_init(ipAddressTable_interface_ctx
+ * if_ctx);
+static void
+ _ipAddressTable_container_shutdown(ipAddressTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+ipAddressTable_container_get(void)
+{
+ return ipAddressTable_if_ctx.container;
+}
+
+ipAddressTable_registration *
+ipAddressTable_registration_get(void)
+{
+ return ipAddressTable_if_ctx.user_ctx;
+}
+
+ipAddressTable_registration *
+ipAddressTable_registration_set(ipAddressTable_registration * newreg)
+{
+ ipAddressTable_registration *old = ipAddressTable_if_ctx.user_ctx;
+ ipAddressTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+ipAddressTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipAddressTable_if_ctx.container);
+}
+
+u_int
+ipAddressTable_dirty_get(void)
+{
+ return ipAddressTable_if_ctx.table_dirty;
+}
+
+void
+ipAddressTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("ipAddressTable:ipAddressTable_dirty_set",
+ "called. was %d, now %d\n",
+ ipAddressTable_if_ctx.table_dirty, status));
+ ipAddressTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ipAddressTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_post_request;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_get_values;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_check_objects;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_set_values;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_undo_values;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_commit;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_irreversible_commit;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int
+ _ipAddressTable_undo_column(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column);
+
+NETSNMP_STATIC_INLINE int
+ _ipAddressTable_check_indexes(ipAddressTable_rowreq_ctx * rowreq_ctx);
+
+/**
+ * @internal
+ * Initialize the table ipAddressTable
+ * (Define its contents and how it's structured)
+ */
+void
+_ipAddressTable_initialize_interface(ipAddressTable_registration * reg_ptr,
+ u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ipAddressTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &ipAddressTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ipAddressTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ipAddressAddrType */
+ ASN_OCTET_STR,
+ /** index: ipAddressAddr */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = IPADDRESSTABLE_MIN_COL;
+ tbl_info->max_column = IPADDRESSTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ipAddressTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ipAddressTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ipAddressTable_container_init(&ipAddressTable_if_ctx);
+ if (NULL == ipAddressTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for ipAddressTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_ipAddressTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ipAddressTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_ipAddressTable_pre_request;
+ access_multiplexer->post_request = _mfd_ipAddressTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_ipAddressTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_ipAddressTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_ipAddressTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_ipAddressTable_set_values;
+ access_multiplexer->undo_sets = _mfd_ipAddressTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_ipAddressTable_commit;
+ access_multiplexer->undo_commit = _mfd_ipAddressTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_ipAddressTable_irreversible_commit;
+
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_ipAddressTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ipAddressTable:init_ipAddressTable",
+ "Registering ipAddressTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ipAddressTable", handler,
+ ipAddressTable_oid,
+ ipAddressTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table ipAddressTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ipAddressTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ ipAddressTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != ipAddressTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(ipAddressTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _ipAddressTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ipAddressTable
+ */
+void
+_ipAddressTable_shutdown_interface(ipAddressTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ipAddressTable_container_shutdown(&ipAddressTable_if_ctx);
+}
+
+void
+ipAddressTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ipAddressTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ipAddressTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+ipAddressTable_index_to_oid(netsnmp_index * oid_idx,
+ ipAddressTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipAddressAddrType;
+ /*
+ * ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_ipAddressAddr;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipAddressAddrType, 0x00, sizeof(var_ipAddressAddrType));
+ var_ipAddressAddrType.type = ASN_INTEGER;
+ memset(&var_ipAddressAddr, 0x00, sizeof(var_ipAddressAddr));
+ var_ipAddressAddr.type = ASN_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipAddressAddrType.next_variable = &var_ipAddressAddr;
+ var_ipAddressAddr.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_index_to_oid",
+ "called\n"));
+
+ /*
+ * ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_ipAddressAddrType,
+ (u_char *) & mib_idx->ipAddressAddrType,
+ sizeof(mib_idx->ipAddressAddrType));
+
+ /*
+ * ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_ipAddressAddr,
+ (u_char *) & mib_idx->ipAddressAddr,
+ mib_idx->ipAddressAddr_len *
+ sizeof(mib_idx->ipAddressAddr[0]));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_ipAddressAddrType);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipAddressAddrType);
+
+ return err;
+} /* ipAddressTable_index_to_oid */
+
+/**
+ * extract ipAddressTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+ipAddressTable_index_from_oid(netsnmp_index * oid_idx,
+ ipAddressTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipAddressAddrType;
+ /*
+ * ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_ipAddressAddr;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipAddressAddrType, 0x00, sizeof(var_ipAddressAddrType));
+ var_ipAddressAddrType.type = ASN_INTEGER;
+ memset(&var_ipAddressAddr, 0x00, sizeof(var_ipAddressAddr));
+ var_ipAddressAddr.type = ASN_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipAddressAddrType.next_variable = &var_ipAddressAddr;
+ var_ipAddressAddr.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_index_from_oid",
+ "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_ipAddressAddrType);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->ipAddressAddrType =
+ *((u_long *) var_ipAddressAddrType.val.string);
+ /*
+ * NOTE: val_len is in bytes, ipAddressAddr_len might not be
+ */
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_index_from_oid",
+ "var_ipAddressAddr.val_len = %d\n", var_ipAddressAddr.val_len));
+ if (var_ipAddressAddr.val_len > sizeof(mib_idx->ipAddressAddr))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->ipAddressAddr, var_ipAddressAddr.val.string,
+ var_ipAddressAddr.val_len);
+ mib_idx->ipAddressAddr_len =
+ var_ipAddressAddr.val_len /
+ sizeof(mib_idx->ipAddressAddr[0]);
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_index_from_oid",
+ "mib_idx->ipAddressAddr_len = %d\n", mib_idx->ipAddressAddr_len));
+
+ }
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipAddressAddrType);
+
+ return err;
+} /* ipAddressTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a ipAddressTable_rowreq_ctx
+ */
+ipAddressTable_rowreq_ctx *
+ipAddressTable_allocate_rowreq_ctx(ipAddressTable_data * data,
+ void *user_init_ctx)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(ipAddressTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:ipAddressTable:ipAddressTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "ipAddressTable_rowreq_ctx.\n");
+ return NULL;
+ } else {
+ if (NULL != data) {
+ /*
+ * track if we got data from user
+ */
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+ } else if (NULL ==
+ (rowreq_ctx->data = ipAddressTable_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->ipAddressTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ ipAddressTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ ipAddressTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* ipAddressTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a ipAddressTable_rowreq_ctx
+ */
+void
+ipAddressTable_release_rowreq_ctx(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:ipAddressTable:ipAddressTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ ipAddressTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ ipAddressTable_release_data(rowreq_ctx->data);
+
+ if (rowreq_ctx->undo)
+ ipAddressTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* ipAddressTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipAddressTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipAddressTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ipAddressTable_pre_request(ipAddressTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressTable", "error %d from "
+ "ipAddressTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipAddressTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ ipAddressTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipAddressTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && ipAddressTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "ipAddressTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = ipAddressTable_post_request(ipAddressTable_if_ctx.user_ctx,
+ packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressTable", "error %d from "
+ "ipAddressTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static ipAddressTable_rowreq_ctx *
+_mfd_ipAddressTable_rowreq_from_index(netsnmp_index * oid_idx, int *rc_ptr)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx;
+ ipAddressTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_rowreq_from_index", "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = ipAddressTable_index_from_oid(oid_idx, &mib_idx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("ipAddressTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = ipAddressTable_allocate_rowreq_ctx(NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _ipAddressTable_check_indexes(rowreq_ctx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ ipAddressTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids,
+ oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_ipAddressTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipAddressTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * ipAddressTable_interface_ctx *if_ctx =
+ * (ipAddressTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+#define NETSNMP_IPADDRESSTABLE_CREATE_SUPPORT 1
+#ifndef NETSNMP_IPADDRESSTABLE_CREATE_SUPPORT
+ rc = SNMP_ERR_NOCREATION;
+#else
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if (NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx = _mfd_ipAddressTable_rowreq_from_index(&oid_idx, &rc);
+ if (MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests, (netsnmp_index *)
+ rowreq_ctx);
+ }
+#endif
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ ipAddressTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ipAddressTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipAddressTable_get_column(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipAddressIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/W/e/R/d/H
+ */
+ case COLUMN_IPADDRESSIFINDEX:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressIfIndex_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSTYPE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressType_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressPrefix(5)/RowPointer/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/D/h
+ */
+ case COLUMN_IPADDRESSPREFIX:
+ var->type = ASN_OBJECT_ID;
+ rc = ipAddressPrefix_get(rowreq_ctx, (oid **) & var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * ipAddressOrigin(6)/IpAddressOriginTC/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IPADDRESSORIGIN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressOrigin_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressStatus(7)/IpAddressStatusTC/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressStatus_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressCreated(8)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPADDRESSCREATED:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_TIMETICKS;
+ rc = ipAddressCreated_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressLastChanged(9)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPADDRESSLASTCHANGED:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_TIMETICKS;
+ rc = ipAddressLastChanged_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPADDRESSROWSTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressRowStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressStorageType(11)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTORAGETYPE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressStorageType_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipAddressTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipAddressTable_get_column */
+
+int
+_mfd_ipAddressTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_get_values",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipAddressTable_get_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_ipAddressTable_check_indexes(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_check_indexes",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /*
+ * (INDEX) ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (rowreq_ctx->tbl_idx.ipAddressAddrType !=
+ INETADDRESSTYPE_UNKNOWN)
+ && (rowreq_ctx->tbl_idx.ipAddressAddrType != INETADDRESSTYPE_IPV4)
+ && (rowreq_ctx->tbl_idx.ipAddressAddrType != INETADDRESSTYPE_IPV6)
+ && (rowreq_ctx->tbl_idx.ipAddressAddrType != INETADDRESSTYPE_IPV4Z)
+ && (rowreq_ctx->tbl_idx.ipAddressAddrType != INETADDRESSTYPE_IPV6Z)
+ && (rowreq_ctx->tbl_idx.ipAddressAddrType != INETADDRESSTYPE_DNS)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = ipAddressAddrType_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * (INDEX) ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((rowreq_ctx->tbl_idx.ipAddressAddr_len < 0)
+ || (rowreq_ctx->tbl_idx.ipAddressAddr_len > 255))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = ipAddressAddr_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return ipAddressTable_validate_index(ipAddressTable_if_ctx.user_ctx,
+ rowreq_ctx);
+} /* _ipAddressTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipAddressTable_check_column(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ case COLUMN_IPADDRESSADDRTYPE:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ case COLUMN_IPADDRESSADDR:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * ipAddressIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/W/e/R/d/H
+ */
+ case COLUMN_IPADDRESSIFINDEX:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 1)
+ || (*var->val.integer > 2147483647))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:_ipAddressTable_check_column:ipAddressIfIndex", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipAddressIfIndex_check_value(rowreq_ctx,
+ *((long *) var->val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipAddressIfIndex_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipAddressType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSTYPE:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != IPADDRESSTYPE_UNICAST)
+ && (*var->val.integer != IPADDRESSTYPE_ANYCAST)
+ && (*var->val.integer != IPADDRESSTYPE_BROADCAST)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:_ipAddressTable_check_column:ipAddressType", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipAddressType_check_value(rowreq_ctx,
+ *((u_long *) var->val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipAddressType_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipAddressPrefix(5)/RowPointer/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/D/h
+ */
+ case COLUMN_IPADDRESSPREFIX:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipAddressOrigin(6)/IpAddressOriginTC/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IPADDRESSORIGIN:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipAddressStatus(7)/IpAddressStatusTC/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTATUS:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != IPADDRESSSTATUSTC_PREFERRED)
+ && (*var->val.integer != IPADDRESSSTATUSTC_INVALID)
+ && (*var->val.integer != IPADDRESSSTATUSTC_INACCESSIBLE)
+ && (*var->val.integer != IPADDRESSSTATUSTC_UNKNOWN)
+ && (*var->val.integer != IPADDRESSSTATUSTC_TENTATIVE)
+ && (*var->val.integer != IPADDRESSSTATUSTC_DUPLICATE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:_ipAddressTable_check_column:ipAddressStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipAddressStatus_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipAddressStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipAddressCreated(8)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPADDRESSCREATED:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipAddressLastChanged(9)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPADDRESSLASTCHANGED:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipAddressRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPADDRESSROWSTATUS:
+ rc = netsnmp_check_vb_rowstatus_value(var);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:_ipAddressTable_check_column:ipAddressRowStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipAddressRowStatus_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipAddressRowStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipAddressStorageType(11)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTORAGETYPE:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != STORAGETYPE_OTHER)
+ && (*var->val.integer != STORAGETYPE_VOLATILE)
+ && (*var->val.integer != STORAGETYPE_NONVOLATILE)
+ && (*var->val.integer != STORAGETYPE_PERMANENT)
+ && (*var->val.integer != STORAGETYPE_READONLY)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:_ipAddressTable_check_column:ipAddressStorageType", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipAddressStorageType_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipAddressStorageType_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipAddressTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _ipAddressTable_check_column */
+
+int
+_mfd_ipAddressTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipAddressTable_check_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_ipAddressTable_check_dependencies(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipAddressTable_check_dependencies(rowreq_ctx);
+ if (rc) {
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipAddressTable_undo_setup_column(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipAddressIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/W/e/R/d/H
+ */
+ case COLUMN_IPADDRESSIFINDEX:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSIFINDEX_FLAG;
+ rc = ipAddressIfIndex_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSTYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSTYPE_FLAG;
+ rc = ipAddressType_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressStatus(7)/IpAddressStatusTC/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSSTATUS_FLAG;
+ rc = ipAddressStatus_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPADDRESSROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSROWSTATUS_FLAG;
+ rc = ipAddressRowStatus_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressStorageType(11)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTORAGETYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSSTORAGETYPE_FLAG;
+ rc = ipAddressStorageType_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipAddressTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipAddressTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ipAddressTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_undo_setup",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = ipAddressTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = ipAddressTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipAddressTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ipAddressTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_undo_cleanup",
+ "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = ipAddressTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ ipAddressTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipAddressTable_set_column(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipAddressIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/W/e/R/d/H
+ */
+ case COLUMN_IPADDRESSIFINDEX:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSIFINDEX_FLAG;
+ rc = ipAddressIfIndex_set(rowreq_ctx, *((long *) var->val.string));
+ break;
+
+ /*
+ * ipAddressType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSTYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSTYPE_FLAG;
+ rc = ipAddressType_set(rowreq_ctx, *((u_long *) var->val.string));
+ break;
+
+ /*
+ * ipAddressStatus(7)/IpAddressStatusTC/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSSTATUS_FLAG;
+ rc = ipAddressStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * ipAddressRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPADDRESSROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSROWSTATUS_FLAG;
+ rc = ipAddressRowStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * ipAddressStorageType(11)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTORAGETYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSSTORAGETYPE_FLAG;
+ rc = ipAddressStorageType_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipAddressTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _ipAddressTable_set_column */
+
+int
+_mfd_ipAddressTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_set_values",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipAddressTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_ipAddressTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_commit",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipAddressTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ ipAddressTable_dirty_set(ipAddressTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_ipAddressTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_undo_commit",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = ipAddressTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ ipAddressTable_dirty_set(d - 1);
+ }
+
+ rc = ipAddressTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "ipAddressTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipAddressTable_undo_column(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipAddressIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/W/e/R/d/H
+ */
+ case COLUMN_IPADDRESSIFINDEX:
+ rc = ipAddressIfIndex_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSTYPE:
+ rc = ipAddressType_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressStatus(7)/IpAddressStatusTC/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTATUS:
+ rc = ipAddressStatus_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPADDRESSROWSTATUS:
+ rc = ipAddressRowStatus_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressStorageType(11)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTORAGETYPE:
+ rc = ipAddressStorageType_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipAddressTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipAddressTable_undo_column */
+
+int
+_mfd_ipAddressTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_undo_values",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipAddressTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipAddressTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_ipAddressTable_irreversible_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(ipAddressTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(ipAddressTable_if_ctx.container, rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:ipAddressTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for ipAddressTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return ipAddressTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in ipAddressTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(ipAddressTable_rowreq_ctx * rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:ipAddressTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ ipAddressTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:ipAddressTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in ipAddressTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ipAddressTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_ipAddressTable_container_init(ipAddressTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_container_init",
+ "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ ipAddressTable_oid,
+ ipAddressTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for ipAddressTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ ipAddressTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("ipAddressTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ipAddressTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _ipAddressTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ipAddressTable_container_shutdown(ipAddressTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_container_shutdown", "called\n"));
+
+ ipAddressTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ipAddressTable_container_shutdown */
+
+
+ipAddressTable_rowreq_ctx *
+ipAddressTable_row_find_by_mib_index(ipAddressTable_mib_index * mib_idx)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = ipAddressTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(ipAddressTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h
new file mode 100644
index 0000000000..74adfe0256
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h
@@ -0,0 +1,100 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipAddressTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef IPADDRESSTABLE_INTERFACE_H
+#define IPADDRESSTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ipAddressTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _ipAddressTable_initialize_interface(ipAddressTable_registration *
+ user_ctx, u_long flags);
+ void
+ _ipAddressTable_shutdown_interface(ipAddressTable_registration *
+ user_ctx);
+
+ ipAddressTable_registration *ipAddressTable_registration_get(void);
+
+ ipAddressTable_registration
+ * ipAddressTable_registration_set(ipAddressTable_registration *
+ newreg);
+
+ netsnmp_container *ipAddressTable_container_get(void);
+ int ipAddressTable_container_size(void);
+
+ u_int ipAddressTable_dirty_get(void);
+ void ipAddressTable_dirty_set(u_int status);
+
+ ipAddressTable_rowreq_ctx
+ * ipAddressTable_allocate_rowreq_ctx(ipAddressTable_data *,
+ void *);
+ void
+ ipAddressTable_release_rowreq_ctx(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipAddressTable_index_to_oid(netsnmp_index * oid_idx,
+ ipAddressTable_mib_index *
+ mib_idx);
+ int ipAddressTable_index_from_oid(netsnmp_index * oid_idx,
+ ipAddressTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void ipAddressTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSTABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable.h
new file mode 100644
index 0000000000..047db745e4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable.h
@@ -0,0 +1,8 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/data_access/systemstats)
+config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable)
+config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface)
+config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c
new file mode 100644
index 0000000000..4b1acb1f6f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c
@@ -0,0 +1,3182 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipSystemStatsTable.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** \page MFD helper for ipSystemStatsTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipSystemStatsTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ipSystemStatsTable_interface.h"
+
+oid ipSystemStatsTable_oid[] = { IPSYSTEMSTATSTABLE_OID };
+int ipSystemStatsTable_oid_size =
+OID_LENGTH(ipSystemStatsTable_oid);
+
+ipSystemStatsTable_registration ipSystemStatsTable_user_context;
+
+void initialize_table_ipSystemStatsTable(void);
+void shutdown_table_ipSystemStatsTable(void);
+
+
+/**
+ * Initializes the ipSystemStatsTable module
+ */
+void
+init_ipSystemStatsTable(void)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:init_ipSystemStatsTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform ipSystemStatsTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("ipSystemStatsTable"))
+ initialize_table_ipSystemStatsTable();
+
+} /* init_ipSystemStatsTable */
+
+/**
+ * Shut-down the ipSystemStatsTable module (agent is exiting)
+ */
+void
+shutdown_ipSystemStatsTable(void)
+{
+ if (should_init("ipSystemStatsTable"))
+ shutdown_table_ipSystemStatsTable();
+
+}
+
+/**
+ * Initialize the table ipSystemStatsTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ipSystemStatsTable(void)
+{
+ ipSystemStatsTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:initialize_table_ipSystemStatsTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform ipSystemStatsTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ipSystemStatsTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("ipSystemStatsTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ipSystemStatsTable_initialize_interface(user_context, flags);
+} /* initialize_table_ipSystemStatsTable */
+
+/**
+ * Shutdown the table ipSystemStatsTable
+ */
+void
+shutdown_table_ipSystemStatsTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipSystemStatsTable_shutdown_interface
+ (&ipSystemStatsTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+ipSystemStatsTable_rowreq_ctx_init(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ipSystemStatsTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+ipSystemStatsTable_rowreq_ctx_cleanup(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ipSystemStatsTable rowreq cleanup.
+ */
+} /* ipSystemStatsTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ * @param user_context
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ipSystemStatsTable_pre_request(ipSystemStatsTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform ipSystemStatsTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+ipSystemStatsTable_post_request(ipSystemStatsTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform ipSystemStatsTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipSystemStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipSystemStatsTable is subid 1 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.1, length: 9
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ipSystemStatsTable data context functions.
+ */
+/*
+ * ipSystemStatsTable_allocate_data
+ *
+ * Purpose: create new ipSystemStatsTable_data.
+ */
+ipSystemStatsTable_data *
+ipSystemStatsTable_allocate_data(void)
+{
+ /*
+ * TODO:201:r: |-> allocate memory for the ipSystemStatsTable data context.
+ */
+ ipSystemStatsTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(ipSystemStatsTable_data);
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "ipSystemStatsTable_data.\n");
+ }
+
+ return rtn;
+} /* ipSystemStatsTable_allocate_data */
+
+/*
+ * ipSystemStatsTable_release_data
+ *
+ * Purpose: release ipSystemStatsTable data.
+ */
+void
+ipSystemStatsTable_release_data(ipSystemStatsTable_data * data)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_release_data", "called\n"));
+
+ /*
+ * TODO:202:r: |-> release memory for the ipSystemStatsTable data context.
+ */
+ free(data);
+} /* ipSystemStatsTable_release_data */
+
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param ipSystemStatsIPVersion_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+ipSystemStatsTable_indexes_set_tbl_idx(ipSystemStatsTable_mib_index *
+ tbl_idx,
+ u_long ipSystemStatsIPVersion_val)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * ipSystemStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /** WARNING: this code might not work for netsnmp_systemstats_entry */
+ tbl_idx->ipSystemStatsIPVersion = ipSystemStatsIPVersion_val;
+
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+ipSystemStatsTable_indexes_set(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long ipSystemStatsIPVersion_val)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ ipSystemStatsTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ ipSystemStatsIPVersion_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != ipSystemStatsTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInReceives
+ * ipSystemStatsInReceives is subid 3 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.3
+ * Description:
+The total number of input IP datagrams received, including
+ those received in error.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInReceives data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInReceives_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInReceives_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInReceives_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInReceives_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInReceives_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInReceives data.
+ * copy (* ipSystemStatsInReceives_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInReceives_val_ptr) =
+ rowreq_ctx->data->stats.HCInReceives.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInReceives_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCInReceives
+ * ipSystemStatsHCInReceives is subid 4 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.4
+ * Description:
+The total number of input IP datagrams received, including
+ those received in error. This object counts the same
+ datagrams as ipSystemStatsInReceives but allows for larger
+
+
+
+
+ values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCInReceives data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCInReceives_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCInReceives_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInReceives_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCInReceives data.
+ * get (* ipSystemStatsHCInReceives_val_ptr ).low and (* ipSystemStatsHCInReceives_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCInReceives_val_ptr).low =
+ rowreq_ctx->data->stats.HCInReceives.low;
+ (*ipSystemStatsHCInReceives_val_ptr).high =
+ rowreq_ctx->data->stats.HCInReceives.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCInReceives_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInOctets
+ * ipSystemStatsInOctets is subid 5 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.5
+ * Description:
+The total number of octets received in input IP datagrams,
+ including those received in error. Octets from datagrams
+ counted in ipSystemStatsInReceives MUST be counted here.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInOctets_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInOctets_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInOctets data.
+ * copy (* ipSystemStatsInOctets_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInOctets_val_ptr) =
+ rowreq_ctx->data->stats.HCInOctets.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCInOctets
+ * ipSystemStatsHCInOctets is subid 6 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.6
+ * Description:
+The total number of octets received in input IP datagrams,
+ including those received in error. This object counts the
+ same octets as ipSystemStatsInOctets but allows for larger
+ values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCInOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCInOctets_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCInOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInOctets_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCInOctets data.
+ * get (* ipSystemStatsHCInOctets_val_ptr ).low and (* ipSystemStatsHCInOctets_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCInOctets_val_ptr).low =
+ rowreq_ctx->data->stats.HCInOctets.low;
+ (*ipSystemStatsHCInOctets_val_ptr).high =
+ rowreq_ctx->data->stats.HCInOctets.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCInOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInHdrErrors
+ * ipSystemStatsInHdrErrors is subid 7 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.7
+ * Description:
+The number of input IP datagrams discarded due to errors in
+ their IP headers, including version number mismatch, other
+ format errors, hop count exceeded, errors discovered in
+ processing their IP options, etc.
+
+
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInHdrErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInHdrErrors_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInHdrErrors_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInHdrErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInHdrErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInHdrErrors_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInHdrErrors data.
+ * copy (* ipSystemStatsInHdrErrors_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInHdrErrors_val_ptr) =
+ rowreq_ctx->data->stats.InHdrErrors;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInHdrErrors_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInNoRoutes
+ * ipSystemStatsInNoRoutes is subid 8 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.8
+ * Description:
+The number of input IP datagrams discarded because no route
+ could be found to transmit them to their destination.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInNoRoutes data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInNoRoutes_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInNoRoutes_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInNoRoutes_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInNoRoutes_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInNoRoutes_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInNoRoutes data.
+ * copy (* ipSystemStatsInNoRoutes_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInNoRoutes_val_ptr) =
+ rowreq_ctx->data->stats.InNoRoutes;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInNoRoutes_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInAddrErrors
+ * ipSystemStatsInAddrErrors is subid 9 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.9
+ * Description:
+The number of input IP datagrams discarded because the IP
+ address in their IP header's destination field was not a
+ valid address to be received at this entity. This count
+ includes invalid addresses (e.g., ::0) and unsupported
+ addresses (e.g., addresses with unallocated prefixes). For
+ entities which are not IP routers and therefore do not
+ forward datagrams, this counter includes datagrams discarded
+ because the destination address was not a local address.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInAddrErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInAddrErrors_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInAddrErrors_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInAddrErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInAddrErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInAddrErrors_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInAddrErrors data.
+ * copy (* ipSystemStatsInAddrErrors_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInAddrErrors_val_ptr) =
+ rowreq_ctx->data->stats.InAddrErrors;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInAddrErrors_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInUnknownProtos
+ * ipSystemStatsInUnknownProtos is subid 10 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.10
+ * Description:
+The number of locally-addressed IP datagrams received
+ successfully but discarded because of an unknown or
+ unsupported protocol.
+
+
+
+
+ When tracking interface statistics the counter of the
+ interface to which these datagrams were addressed is
+ incremented. This interface might not be the same as the
+ input interface for some of the datagrams.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInUnknownProtos data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInUnknownProtos_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInUnknownProtos_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInUnknownProtos_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInUnknownProtos_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInUnknownProtos_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInUnknownProtos data.
+ * copy (* ipSystemStatsInUnknownProtos_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInUnknownProtos_val_ptr) =
+ rowreq_ctx->data->stats.InUnknownProtos;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInUnknownProtos_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInTruncatedPkts
+ * ipSystemStatsInTruncatedPkts is subid 11 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.11
+ * Description:
+The number of input IP datagrams discarded because the
+ datagram frame didn't carry enough data.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInTruncatedPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInTruncatedPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInTruncatedPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInTruncatedPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInTruncatedPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInTruncatedPkts_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInTruncatedPkts data.
+ * copy (* ipSystemStatsInTruncatedPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInTruncatedPkts_val_ptr) =
+ rowreq_ctx->data->stats.InTruncatedPkts;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInTruncatedPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInForwDatagrams
+ * ipSystemStatsInForwDatagrams is subid 12 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.12
+ * Description:
+The number of input datagrams for which this entity was not
+ their final IP destination and for which this entity
+ attempted to find a route to forward them to that final
+ destination. In entities which do not act as IP routers,
+ this counter will include only those datagrams which were
+ Source-Routed via this entity, and the Source-Route
+ processing was successful.
+
+
+ When tracking interface statistics the counter of the
+ incoming interface is incremented for each datagram.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInForwDatagrams data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInForwDatagrams_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInForwDatagrams_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInForwDatagrams_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInForwDatagrams_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInForwDatagrams data.
+ * copy (* ipSystemStatsInForwDatagrams_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInForwDatagrams_val_ptr) =
+ rowreq_ctx->data->stats.HCInForwDatagrams.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInForwDatagrams_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCInForwDatagrams
+ * ipSystemStatsHCInForwDatagrams is subid 13 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.13
+ * Description:
+The number of input datagrams for which this entity was not
+ their final IP destination and for which this entity
+ attempted to find a route to forward them to that final
+ destination. This object counts the same packets as
+ ipSystemStatsInForwDatagrams but allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCInForwDatagrams data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCInForwDatagrams_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInForwDatagrams_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInForwDatagrams_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCInForwDatagrams data.
+ * get (* ipSystemStatsHCInForwDatagrams_val_ptr ).low and (* ipSystemStatsHCInForwDatagrams_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCInForwDatagrams_val_ptr).low =
+ rowreq_ctx->data->stats.HCInForwDatagrams.low;
+ (*ipSystemStatsHCInForwDatagrams_val_ptr).high =
+ rowreq_ctx->data->stats.HCInForwDatagrams.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCInForwDatagrams_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsReasmReqds
+ * ipSystemStatsReasmReqds is subid 14 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.14
+ * Description:
+The number of IP fragments received which needed to be
+ reassembled at this interface.
+
+
+ When tracking interface statistics the counter of the
+ interface to which these fragments were addressed is
+ incremented. This interface might not be the same as the
+ input interface for some of the fragments.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsReasmReqds data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsReasmReqds_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsReasmReqds_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsReasmReqds_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsReasmReqds_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsReasmReqds_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsReasmReqds data.
+ * copy (* ipSystemStatsReasmReqds_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsReasmReqds_val_ptr) =
+ rowreq_ctx->data->stats.ReasmReqds;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsReasmReqds_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsReasmOKs
+ * ipSystemStatsReasmOKs is subid 15 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.15
+ * Description:
+The number of IP datagrams successfully reassembled.
+
+
+ When tracking interface statistics the counter of the
+ interface to which these datagrams were addressed is
+ incremented. This interface might not be the same as the
+ input interface for some of the datagrams.
+
+
+ Discontinuities in the value of this counter can occur at
+
+
+
+
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsReasmOKs data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsReasmOKs_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsReasmOKs_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsReasmOKs_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsReasmOKs_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsReasmOKs_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsReasmOKs data.
+ * copy (* ipSystemStatsReasmOKs_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsReasmOKs_val_ptr) = rowreq_ctx->data->stats.ReasmOKs;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsReasmOKs_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsReasmFails
+ * ipSystemStatsReasmFails is subid 16 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.16
+ * Description:
+The number of failures detected by the IP re-assembly
+ algorithm (for whatever reason: timed out, errors, etc.).
+ Note that this is not necessarily a count of discarded IP
+ fragments since some algorithms (notably the algorithm in
+ RFC 815) can lose track of the number of fragments by
+ combining them as they are received.
+
+
+ When tracking interface statistics the counter of the
+ interface to which these fragments were addressed is
+ incremented. This interface might not be the same as the
+ input interface for some of the fragments.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsReasmFails data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsReasmFails_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsReasmFails_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsReasmFails_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsReasmFails_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsReasmFails_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsReasmFails data.
+ * copy (* ipSystemStatsReasmFails_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsReasmFails_val_ptr) =
+ rowreq_ctx->data->stats.ReasmFails;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsReasmFails_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInDiscards
+ * ipSystemStatsInDiscards is subid 17 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.17
+ * Description:
+The number of input IP datagrams for which no problems were
+ encountered to prevent their continued processing, but which
+ were discarded (e.g., for lack of buffer space). Note that
+ this counter does not include any datagrams discarded while
+ awaiting re-assembly.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInDiscards data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInDiscards_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInDiscards_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInDiscards_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInDiscards_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInDiscards_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInDiscards data.
+ * copy (* ipSystemStatsInDiscards_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInDiscards_val_ptr) =
+ rowreq_ctx->data->stats.InDiscards;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInDiscards_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInDelivers
+ * ipSystemStatsInDelivers is subid 18 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.18
+ * Description:
+The total number of datagrams successfully delivered to IP
+ user-protocols (including ICMP).
+
+
+ When tracking interface statistics the counter of the
+ interface to which these datagrams were addressed is
+ incremented. This interface might not be the same as the
+ input interface for some of the datagrams.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInDelivers data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInDelivers_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInDelivers_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInDelivers_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInDelivers_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInDelivers_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInDelivers data.
+ * copy (* ipSystemStatsInDelivers_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInDelivers_val_ptr) =
+ rowreq_ctx->data->stats.HCInDelivers.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInDelivers_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCInDelivers
+ * ipSystemStatsHCInDelivers is subid 19 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.19
+ * Description:
+The total number of datagrams successfully delivered to IP
+ user-protocols (including ICMP). This object counts the
+ same packets as ipSystemStatsInDelivers but allows for
+ larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCInDelivers data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCInDelivers_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCInDelivers_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInDelivers_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCInDelivers data.
+ * get (* ipSystemStatsHCInDelivers_val_ptr ).low and (* ipSystemStatsHCInDelivers_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCInDelivers_val_ptr).low =
+ rowreq_ctx->data->stats.HCInDelivers.low;
+ (*ipSystemStatsHCInDelivers_val_ptr).high =
+ rowreq_ctx->data->stats.HCInDelivers.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCInDelivers_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutRequests
+ * ipSystemStatsOutRequests is subid 20 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.20
+ * Description:
+The total number of IP datagrams which local IP user-
+ protocols (including ICMP) supplied to IP in requests for
+ transmission. Note that this counter does not include any
+ datagrams counted in ipSystemStatsOutForwDatagrams.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutRequests data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutRequests_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutRequests_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutRequests_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutRequests_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutRequests_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutRequests data.
+ * copy (* ipSystemStatsOutRequests_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutRequests_val_ptr) =
+ rowreq_ctx->data->stats.HCOutRequests.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutRequests_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCOutRequests
+ * ipSystemStatsHCOutRequests is subid 21 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.21
+ * Description:
+The total number of IP datagrams which local IP user-
+ protocols (including ICMP) supplied to IP in requests for
+ transmission. This object counts the same packets as
+ ipSystemStatsHCOutRequests but allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCOutRequests data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCOutRequests_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCOutRequests_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutRequests_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCOutRequests data.
+ * get (* ipSystemStatsHCOutRequests_val_ptr ).low and (* ipSystemStatsHCOutRequests_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCOutRequests_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutRequests.low;
+ (*ipSystemStatsHCOutRequests_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutRequests.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCOutRequests_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutNoRoutes
+ * ipSystemStatsOutNoRoutes is subid 22 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.22
+ * Description:
+The number of locally generated IP datagrams discarded
+ because no route could be found to transmit them to their
+ destination.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutNoRoutes data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutNoRoutes_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutNoRoutes_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutNoRoutes_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutNoRoutes_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutNoRoutes_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutNoRoutes data.
+ * copy (* ipSystemStatsOutNoRoutes_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutNoRoutes_val_ptr) =
+ rowreq_ctx->data->stats.OutNoRoutes;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutNoRoutes_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutForwDatagrams
+ * ipSystemStatsOutForwDatagrams is subid 23 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.23
+ * Description:
+The number of datagrams for which this entity was not their
+ final IP destination and for which it was successful in
+ finding a path to their final destination. In entities
+ which do not act as IP routers, this counter will include
+ only those datagrams which were Source-Routed via this
+ entity, and the Source-Route processing was successful.
+
+
+ When tracking interface statistics the counter of the
+ outgoing interface is incremented for a successfully
+ forwarded datagram.
+
+
+ Discontinuities in the value of this counter can occur at
+
+
+
+
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutForwDatagrams data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutForwDatagrams_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutForwDatagrams_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutForwDatagrams_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutForwDatagrams_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutForwDatagrams data.
+ * copy (* ipSystemStatsOutForwDatagrams_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutForwDatagrams_val_ptr) =
+ rowreq_ctx->data->stats.HCOutForwDatagrams.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutForwDatagrams_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCOutForwDatagrams
+ * ipSystemStatsHCOutForwDatagrams is subid 24 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.24
+ * Description:
+The number of datagrams for which this entity was not their
+ final IP destination and for which it was successful in
+ finding a path to their final destination. This object
+ counts the same packets as ipSystemStatsOutForwDatagrams but
+ allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCOutForwDatagrams data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCOutForwDatagrams_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutForwDatagrams_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutForwDatagrams_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCOutForwDatagrams data.
+ * get (* ipSystemStatsHCOutForwDatagrams_val_ptr ).low and (* ipSystemStatsHCOutForwDatagrams_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCOutForwDatagrams_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutForwDatagrams.low;
+ (*ipSystemStatsHCOutForwDatagrams_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutForwDatagrams.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCOutForwDatagrams_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutDiscards
+ * ipSystemStatsOutDiscards is subid 25 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.25
+ * Description:
+The number of output IP datagrams for which no problem was
+ encountered to prevent their transmission to their
+ destination, but which were discarded (e.g., for lack of
+ buffer space). Note that this counter would include
+ datagrams counted in ipSystemStatsOutForwDatagrams if any
+ such datagrams met this (discretionary) discard criterion.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutDiscards data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutDiscards_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutDiscards_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutDiscards_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutDiscards_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutDiscards_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutDiscards data.
+ * copy (* ipSystemStatsOutDiscards_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutDiscards_val_ptr) =
+ rowreq_ctx->data->stats.OutDiscards;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutDiscards_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutFragReqds
+ * ipSystemStatsOutFragReqds is subid 26 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.26
+ * Description:
+The number of IP datagrams that would require fragmentation
+ in order to be transmitted.
+
+
+
+
+
+ When tracking interface statistics the counter of the
+ outgoing interface is incremented for a successfully
+ fragmented datagram.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutFragReqds data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutFragReqds_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutFragReqds_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutFragReqds_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutFragReqds_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutFragReqds_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutFragReqds data.
+ * copy (* ipSystemStatsOutFragReqds_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutFragReqds_val_ptr) =
+ rowreq_ctx->data->stats.OutFragReqds;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutFragReqds_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutFragOKs
+ * ipSystemStatsOutFragOKs is subid 27 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.27
+ * Description:
+The number of IP datagrams that have been successfully
+ fragmented.
+
+
+ When tracking interface statistics the counter of the
+ outgoing interface is incremented for a successfully
+ fragmented datagram.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutFragOKs data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutFragOKs_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutFragOKs_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutFragOKs_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutFragOKs_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutFragOKs_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutFragOKs data.
+ * copy (* ipSystemStatsOutFragOKs_val_ptr ) from rowreq_ctx->data
+ */
+ snmp_log(LOG_ERR,
+ "ipSystemStatsTable node ipSystemStatsOutFragOKs not implemented: skipping\n");
+ return MFD_SKIP;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutFragOKs_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutFragFails
+ * ipSystemStatsOutFragFails is subid 28 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.28
+ * Description:
+The number of IP datagrams that have been discarded because
+ they needed to be fragmented but could not be. This
+ includes IPv4 packets that have the DF bit set and IPv6
+ packets that are being forwarded and exceed the outgoing
+ link MTU.
+
+
+ When tracking interface statistics the counter of the
+ outgoing interface is incremented for an unsuccessfully
+ fragmented datagram.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutFragFails data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutFragFails_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutFragFails_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutFragFails_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutFragFails_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutFragFails_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutFragFails data.
+ * copy (* ipSystemStatsOutFragFails_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutFragFails_val_ptr) =
+ rowreq_ctx->data->stats.OutFragFails;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutFragFails_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutFragCreates
+ * ipSystemStatsOutFragCreates is subid 29 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.29
+ * Description:
+The number of output datagram fragments that have been
+ generated as a result of IP fragmentation.
+
+
+ When tracking interface statistics the counter of the
+ outgoing interface is incremented for a successfully
+ fragmented datagram.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutFragCreates data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutFragCreates_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutFragCreates_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ ipSystemStatsOutFragCreates_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutFragCreates_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutFragCreates_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutFragCreates data.
+ * copy (* ipSystemStatsOutFragCreates_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutFragCreates_val_ptr) =
+ rowreq_ctx->data->stats.OutFragCreates;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutFragCreates_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutTransmits
+ * ipSystemStatsOutTransmits is subid 30 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.30
+ * Description:
+The total number of IP datagrams that this entity supplied
+ to the lower layers for transmission. This includes
+ datagrams generated local and those forwarded by this
+ entity.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutTransmits data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutTransmits_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutTransmits_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutTransmits_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutTransmits_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutTransmits_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutTransmits data.
+ * copy (* ipSystemStatsOutTransmits_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutTransmits_val_ptr) =
+ rowreq_ctx->data->stats.HCOutTransmits.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutTransmits_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCOutTransmits
+ * ipSystemStatsHCOutTransmits is subid 31 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.31
+ * Description:
+The total number of IP datagrams that this entity supplied
+ to the lower layers for transmission. This object counts
+ the same datagrams as ipSystemStatsOutTransmits but allows
+ for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCOutTransmits data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCOutTransmits_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCOutTransmits_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutTransmits_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCOutTransmits data.
+ * get (* ipSystemStatsHCOutTransmits_val_ptr ).low and (* ipSystemStatsHCOutTransmits_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCOutTransmits_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutTransmits.low;
+ (*ipSystemStatsHCOutTransmits_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutTransmits.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCOutTransmits_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutOctets
+ * ipSystemStatsOutOctets is subid 32 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.32
+ * Description:
+The total number of octets in IP datagrams delivered to the
+ lower layers for transmission. Octets from datagrams
+ counted in ipSystemStatsOutTransmits MUST be counted here.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutOctets_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutOctets_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutOctets data.
+ * copy (* ipSystemStatsOutOctets_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutOctets_val_ptr) =
+ rowreq_ctx->data->stats.HCOutOctets.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCOutOctets
+ * ipSystemStatsHCOutOctets is subid 33 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.33
+ * Description:
+The total number of octets in IP datagrams delivered to the
+ lower layers for transmission. This objects counts the same
+ octets as ipSystemStatsOutOctets but allows for larger
+ values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCOutOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCOutOctets_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCOutOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutOctets_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCOutOctets data.
+ * get (* ipSystemStatsHCOutOctets_val_ptr ).low and (* ipSystemStatsHCOutOctets_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCOutOctets_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutOctets.low;
+ (*ipSystemStatsHCOutOctets_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutOctets.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCOutOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInMcastPkts
+ * ipSystemStatsInMcastPkts is subid 34 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.34
+ * Description:
+The number of IP multicast datagrams received.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInMcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInMcastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInMcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInMcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInMcastPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInMcastPkts data.
+ * copy (* ipSystemStatsInMcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInMcastPkts_val_ptr) =
+ rowreq_ctx->data->stats.HCInMcastPkts.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInMcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCInMcastPkts
+ * ipSystemStatsHCInMcastPkts is subid 35 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.35
+ * Description:
+The number of IP multicast datagrams received. This object
+ counts the same datagrams as ipSystemStatsInMcastPkts but
+ allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCInMcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCInMcastPkts_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCInMcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInMcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCInMcastPkts data.
+ * get (* ipSystemStatsHCInMcastPkts_val_ptr ).low and (* ipSystemStatsHCInMcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCInMcastPkts_val_ptr).low =
+ rowreq_ctx->data->stats.HCInMcastPkts.low;
+ (*ipSystemStatsHCInMcastPkts_val_ptr).high =
+ rowreq_ctx->data->stats.HCInMcastPkts.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCInMcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInMcastOctets
+ * ipSystemStatsInMcastOctets is subid 36 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.36
+ * Description:
+The total number of octets received in IP multicast
+ datagrams. Octets from datagrams counted in
+ ipSystemStatsOutMcastPkts MUST be counted here.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInMcastOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInMcastOctets_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInMcastOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInMcastOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInMcastOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInMcastOctets_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInMcastOctets data.
+ * copy (* ipSystemStatsInMcastOctets_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInMcastOctets_val_ptr) =
+ rowreq_ctx->data->stats.HCInMcastOctets.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInMcastOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCInMcastOctets
+ * ipSystemStatsHCInMcastOctets is subid 37 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.37
+ * Description:
+The total number of octets received in IP multicast
+ datagrams. This object counts the same octets as
+ ipSystemStatsInMcastOctets but allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCInMcastOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCInMcastOctets_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInMcastOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInMcastOctets_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCInMcastOctets data.
+ * get (* ipSystemStatsHCInMcastOctets_val_ptr ).low and (* ipSystemStatsHCInMcastOctets_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCInMcastOctets_val_ptr).low =
+ rowreq_ctx->data->stats.HCInMcastOctets.low;
+ (*ipSystemStatsHCInMcastOctets_val_ptr).high =
+ rowreq_ctx->data->stats.HCInMcastOctets.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCInMcastOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutMcastPkts
+ * ipSystemStatsOutMcastPkts is subid 38 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.38
+ * Description:
+The number of IP multicast datagrams transmitted.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutMcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutMcastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutMcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutMcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutMcastPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutMcastPkts data.
+ * copy (* ipSystemStatsOutMcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutMcastPkts_val_ptr) =
+ rowreq_ctx->data->stats.HCOutMcastPkts.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutMcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCOutMcastPkts
+ * ipSystemStatsHCOutMcastPkts is subid 39 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.39
+ * Description:
+The number of IP multicast datagrams transmitted. This
+ object counts the same datagrams as
+ ipSystemStatsOutMcastPkts but allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCOutMcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCOutMcastPkts_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCOutMcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutMcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCOutMcastPkts data.
+ * get (* ipSystemStatsHCOutMcastPkts_val_ptr ).low and (* ipSystemStatsHCOutMcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCOutMcastPkts_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutMcastPkts.low;
+ (*ipSystemStatsHCOutMcastPkts_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutMcastPkts.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCOutMcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutMcastOctets
+ * ipSystemStatsOutMcastOctets is subid 40 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.40
+ * Description:
+The total number of octets transmitted in IP multicast
+ datagrams. Octets from datagrams counted in
+ ipSystemStatsInMcastPkts MUST be counted here.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutMcastOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutMcastOctets_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ ipSystemStatsOutMcastOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutMcastOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutMcastOctets_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutMcastOctets data.
+ * copy (* ipSystemStatsOutMcastOctets_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutMcastOctets_val_ptr) =
+ rowreq_ctx->data->stats.HCOutMcastOctets.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutMcastOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCOutMcastOctets
+ * ipSystemStatsHCOutMcastOctets is subid 41 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.41
+ * Description:
+The total number of octets transmitted in IP multicast
+ datagrams. This object counts the same octets as
+ ipSystemStatsOutMcastOctets but allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+
+
+
+
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCOutMcastOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCOutMcastOctets_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutMcastOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutMcastOctets_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCOutMcastOctets data.
+ * get (* ipSystemStatsHCOutMcastOctets_val_ptr ).low and (* ipSystemStatsHCOutMcastOctets_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCOutMcastOctets_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutMcastOctets.low;
+ (*ipSystemStatsHCOutMcastOctets_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutMcastOctets.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCOutMcastOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInBcastPkts
+ * ipSystemStatsInBcastPkts is subid 42 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.42
+ * Description:
+The number of IP broadcast datagrams received.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInBcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInBcastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInBcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInBcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInBcastPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInBcastPkts data.
+ * copy (* ipSystemStatsInBcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInBcastPkts_val_ptr) =
+ rowreq_ctx->data->stats.HCInBcastPkts.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInBcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCInBcastPkts
+ * ipSystemStatsHCInBcastPkts is subid 43 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.43
+ * Description:
+The number of IP broadcast datagrams received. This object
+ counts the same datagrams as ipSystemStatsInBcastPkts but
+ allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCInBcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCInBcastPkts_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCInBcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInBcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCInBcastPkts data.
+ * get (* ipSystemStatsHCInBcastPkts_val_ptr ).low and (* ipSystemStatsHCInBcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCInBcastPkts_val_ptr).low =
+ rowreq_ctx->data->stats.HCInBcastPkts.low;
+ (*ipSystemStatsHCInBcastPkts_val_ptr).high =
+ rowreq_ctx->data->stats.HCInBcastPkts.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCInBcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutBcastPkts
+ * ipSystemStatsOutBcastPkts is subid 44 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.44
+ * Description:
+The number of IP broadcast datagrams transmitted.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutBcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutBcastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutBcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutBcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutBcastPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutBcastPkts data.
+ * copy (* ipSystemStatsOutBcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutBcastPkts_val_ptr) =
+ rowreq_ctx->data->stats.HCOutBcastPkts.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutBcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCOutBcastPkts
+ * ipSystemStatsHCOutBcastPkts is subid 45 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.45
+ * Description:
+The number of IP broadcast datagrams transmitted. This
+ object counts the same datagrams as
+ ipSystemStatsOutBcastPkts but allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCOutBcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCOutBcastPkts_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCOutBcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutBcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCOutBcastPkts data.
+ * get (* ipSystemStatsHCOutBcastPkts_val_ptr ).low and (* ipSystemStatsHCOutBcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCOutBcastPkts_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutBcastPkts.low;
+ (*ipSystemStatsHCOutBcastPkts_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutBcastPkts.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCOutBcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsDiscontinuityTime
+ * ipSystemStatsDiscontinuityTime is subid 46 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.46
+ * Description:
+The value of sysUpTime on the most recent occasion at which
+ any one or more of this entry's counters suffered a
+ discontinuity.
+
+
+ If no such discontinuities have occurred since the last re-
+ initialization of the local management subsystem, then this
+ object contains a zero value.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is TimeStamp (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsDiscontinuityTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsDiscontinuityTime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsDiscontinuityTime_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsDiscontinuityTime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsDiscontinuityTime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsDiscontinuityTime_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsDiscontinuityTime data.
+ * copy (* ipSystemStatsDiscontinuityTime_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsDiscontinuityTime_val_ptr) =
+ rowreq_ctx->ipSystemStatsDiscontinuityTime;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsDiscontinuityTime_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsRefreshRate
+ * ipSystemStatsRefreshRate is subid 47 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.47
+ * Description:
+The minimum reasonable polling interval for this entry.
+ This object provides an indication of the minimum amount of
+ time required to update the counters in this entry.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsRefreshRate data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsRefreshRate_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsRefreshRate_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsRefreshRate_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsRefreshRate_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsRefreshRate_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsRefreshRate data.
+ * copy (* ipSystemStatsRefreshRate_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsRefreshRate_val_ptr) =
+ rowreq_ctx->ipSystemStatsRefreshRate;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsRefreshRate_get */
+
+
+
+/** @} */
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
new file mode 100644
index 0000000000..51590d293f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
@@ -0,0 +1,1205 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipSystemStatsTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef IPSYSTEMSTATSTABLE_H
+#define IPSYSTEMSTATSTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/ipstats.h>
+#include <net-snmp/data_access/systemstats.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(ip-mib/data_access/systemstats)
+config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface)
+config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for ipSystemStatsTable
+ */
+#include "ipSystemStatsTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ipSystemStatsTable(void);
+ void shutdown_ipSystemStatsTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipSystemStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipSystemStatsTable is subid 1 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.1, length: 9
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review ipSystemStatsTable registration context.
+ */
+ typedef netsnmp_data_list ipSystemStatsTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review ipSystemStatsTable data context structure.
+ * This structure is used to represent the data for ipSystemStatsTable.
+ */
+ typedef netsnmp_systemstats_entry ipSystemStatsTable_data;
+
+
+ /*
+ * TODO:120:r: |-> Review ipSystemStatsTable mib index.
+ * This structure is used to represent the index for ipSystemStatsTable.
+ */
+ typedef struct ipSystemStatsTable_mib_index_s {
+
+ /*
+ * ipSystemStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long ipSystemStatsIPVersion;
+
+
+ } ipSystemStatsTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review ipSystemStatsTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_ipSystemStatsTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review ipSystemStatsTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * ipSystemStatsTable_rowreq_ctx pointer.
+ */
+ typedef struct ipSystemStatsTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_ipSystemStatsTable_IDX_LEN];
+
+ ipSystemStatsTable_mib_index tbl_idx;
+
+ ipSystemStatsTable_data *data;
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to ipSystemStatsTable rowreq context.
+ */
+ char known_missing;
+ uint32_t ipSystemStatsDiscontinuityTime;
+ uint32_t ipSystemStatsRefreshRate;
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *ipSystemStatsTable_data_list;
+
+ } ipSystemStatsTable_rowreq_ctx;
+
+ typedef struct ipSystemStatsTable_ref_rowreq_ctx_s {
+ ipSystemStatsTable_rowreq_ctx *rowreq_ctx;
+ } ipSystemStatsTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_pre_request(ipSystemStatsTable_registration *
+ user_context);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_post_request(ipSystemStatsTable_registration *
+ user_context, int rc);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_rowreq_ctx_init(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ void *user_init_ctx);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_rowreq_ctx_cleanup(ipSystemStatsTable_rowreq_ctx
+ * rowreq_ctx);
+
+ ipSystemStatsTable_data *ipSystemStatsTable_allocate_data(void);
+ void ipSystemStatsTable_release_data(ipSystemStatsTable_data
+ * data);
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_rowreq_ctx
+ * ipSystemStatsTable_row_find_by_mib_index
+ (ipSystemStatsTable_mib_index * mib_idx);
+
+ extern oid ipSystemStatsTable_oid[];
+ extern int ipSystemStatsTable_oid_size;
+
+
+#include "ipSystemStatsTable_interface.h"
+#include "ipSystemStatsTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipSystemStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipSystemStatsTable is subid 1 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.1, length: 9
+ */
+ /*
+ * indexes
+ */
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInReceives_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInReceives_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInReceives_val_ptr);
+ int ipSystemStatsInOctets_get(ipSystemStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipSystemStatsInOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 * ipSystemStatsHCInOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInHdrErrors_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInHdrErrors_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInNoRoutes_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInNoRoutes_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInAddrErrors_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInAddrErrors_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInUnknownProtos_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInUnknownProtos_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInTruncatedPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInTruncatedPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInForwDatagrams_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInForwDatagrams_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsReasmReqds_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsReasmReqds_val_ptr);
+ int ipSystemStatsReasmOKs_get(ipSystemStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipSystemStatsReasmOKs_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsReasmFails_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsReasmFails_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInDiscards_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInDiscards_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInDelivers_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInDelivers_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInDelivers_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutRequests_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutRequests_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutRequests_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutNoRoutes_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutNoRoutes_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutForwDatagrams_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutForwDatagrams_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutDiscards_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutDiscards_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutFragReqds_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutFragReqds_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutFragOKs_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutFragOKs_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutFragFails_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutFragFails_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutFragCreates_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutFragCreates_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutTransmits_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutTransmits_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutTransmits_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInMcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInMcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInMcastOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInMcastOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutMcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutMcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutMcastOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutMcastOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInBcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInBcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutBcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutBcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsDiscontinuityTime_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsDiscontinuityTime_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsRefreshRate_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsRefreshRate_val_ptr);
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_indexes_set_tbl_idx(ipSystemStatsTable_mib_index
+ * tbl_idx,
+ u_long
+ ipSystemStatsIPVersion_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_indexes_set(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipSystemStatsIPVersion_val);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPSYSTEMSTATSTABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h
new file mode 100644
index 0000000000..0fa6104c7a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h
@@ -0,0 +1,159 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: ipSystemStatsTable_constants.h 13768 2005-12-01 20:12:20Z rstory $
+ */
+#ifndef IPSYSTEMSTATSTABLE_CONSTANTS_H
+#define IPSYSTEMSTATSTABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ipSystemStatsTable
+ */
+#define IPSYSTEMSTATSTABLE_OID 1,3,6,1,2,1,4,31,1
+
+#define COLUMN_IPSYSTEMSTATSIPVERSION 1
+
+#define COLUMN_IPSYSTEMSTATSINRECEIVES 3
+
+#define COLUMN_IPSYSTEMSTATSHCINRECEIVES 4
+
+#define COLUMN_IPSYSTEMSTATSINOCTETS 5
+
+#define COLUMN_IPSYSTEMSTATSHCINOCTETS 6
+
+#define COLUMN_IPSYSTEMSTATSINHDRERRORS 7
+
+#define COLUMN_IPSYSTEMSTATSINNOROUTES 8
+
+#define COLUMN_IPSYSTEMSTATSINADDRERRORS 9
+
+#define COLUMN_IPSYSTEMSTATSINUNKNOWNPROTOS 10
+
+#define COLUMN_IPSYSTEMSTATSINTRUNCATEDPKTS 11
+
+#define COLUMN_IPSYSTEMSTATSINFORWDATAGRAMS 12
+
+#define COLUMN_IPSYSTEMSTATSHCINFORWDATAGRAMS 13
+
+#define COLUMN_IPSYSTEMSTATSREASMREQDS 14
+
+#define COLUMN_IPSYSTEMSTATSREASMOKS 15
+
+#define COLUMN_IPSYSTEMSTATSREASMFAILS 16
+
+#define COLUMN_IPSYSTEMSTATSINDISCARDS 17
+
+#define COLUMN_IPSYSTEMSTATSINDELIVERS 18
+
+#define COLUMN_IPSYSTEMSTATSHCINDELIVERS 19
+
+#define COLUMN_IPSYSTEMSTATSOUTREQUESTS 20
+
+#define COLUMN_IPSYSTEMSTATSHCOUTREQUESTS 21
+
+#define COLUMN_IPSYSTEMSTATSOUTNOROUTES 22
+
+#define COLUMN_IPSYSTEMSTATSOUTFORWDATAGRAMS 23
+
+#define COLUMN_IPSYSTEMSTATSHCOUTFORWDATAGRAMS 24
+
+#define COLUMN_IPSYSTEMSTATSOUTDISCARDS 25
+
+#define COLUMN_IPSYSTEMSTATSOUTFRAGREQDS 26
+
+#define COLUMN_IPSYSTEMSTATSOUTFRAGOKS 27
+
+#define COLUMN_IPSYSTEMSTATSOUTFRAGFAILS 28
+
+#define COLUMN_IPSYSTEMSTATSOUTFRAGCREATES 29
+
+#define COLUMN_IPSYSTEMSTATSOUTTRANSMITS 30
+
+#define COLUMN_IPSYSTEMSTATSHCOUTTRANSMITS 31
+
+#define COLUMN_IPSYSTEMSTATSOUTOCTETS 32
+
+#define COLUMN_IPSYSTEMSTATSHCOUTOCTETS 33
+
+#define COLUMN_IPSYSTEMSTATSINMCASTPKTS 34
+
+#define COLUMN_IPSYSTEMSTATSHCINMCASTPKTS 35
+
+#define COLUMN_IPSYSTEMSTATSINMCASTOCTETS 36
+
+#define COLUMN_IPSYSTEMSTATSHCINMCASTOCTETS 37
+
+#define COLUMN_IPSYSTEMSTATSOUTMCASTPKTS 38
+
+#define COLUMN_IPSYSTEMSTATSHCOUTMCASTPKTS 39
+
+#define COLUMN_IPSYSTEMSTATSOUTMCASTOCTETS 40
+
+#define COLUMN_IPSYSTEMSTATSHCOUTMCASTOCTETS 41
+
+#define COLUMN_IPSYSTEMSTATSINBCASTPKTS 42
+
+#define COLUMN_IPSYSTEMSTATSHCINBCASTPKTS 43
+
+#define COLUMN_IPSYSTEMSTATSOUTBCASTPKTS 44
+
+#define COLUMN_IPSYSTEMSTATSHCOUTBCASTPKTS 45
+
+#define COLUMN_IPSYSTEMSTATSDISCONTINUITYTIME 46
+
+#define COLUMN_IPSYSTEMSTATSREFRESHRATE 47
+
+
+#define IPSYSTEMSTATSTABLE_MIN_COL COLUMN_IPSYSTEMSTATSINRECEIVES
+#define IPSYSTEMSTATSTABLE_MAX_COL COLUMN_IPSYSTEMSTATSREFRESHRATE
+
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table ipSystemStatsTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipSystemStatsIPVersion (InetVersion / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETVERSION_ENUMS
+#define INETVERSION_ENUMS
+
+#define INETVERSION_UNKNOWN 0
+#define INETVERSION_IPV4 1
+#define INETVERSION_IPV6 2
+
+#endif /* INETVERSION_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPSYSTEMSTATSTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c
new file mode 100644
index 0000000000..c1d257d6e0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c
@@ -0,0 +1,446 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipSystemStatsTable_data_access.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipSystemStatsTable.h"
+
+
+#include "ipSystemStatsTable_data_access.h"
+
+static int ipss_cache_refresh = 30;
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipSystemStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipSystemStatsTable is subid 1 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.1, length: 9
+ */
+
+/**
+ * initialization for ipSystemStatsTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ipSystemStatsTable_reg
+ * Pointer to ipSystemStatsTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ipSystemStatsTable_init_data(ipSystemStatsTable_registration *
+ ipSystemStatsTable_reg)
+{
+ static unsigned int my_columns[] = {
+ COLUMN_IPSYSTEMSTATSINRECEIVES, COLUMN_IPSYSTEMSTATSHCINRECEIVES,
+ /** COLUMN_IPSYSTEMSTATSINOCTETS, */
+ COLUMN_IPSYSTEMSTATSHCINOCTETS,
+ COLUMN_IPSYSTEMSTATSINHDRERRORS,
+ /** COLUMN_IPSYSTEMSTATSINNOROUTES, */
+ COLUMN_IPSYSTEMSTATSINADDRERRORS,
+ COLUMN_IPSYSTEMSTATSINUNKNOWNPROTOS,
+ /** COLUMN_IPSYSTEMSTATSINTRUNCATEDPKTS, */
+ COLUMN_IPSYSTEMSTATSINFORWDATAGRAMS,
+ COLUMN_IPSYSTEMSTATSHCINFORWDATAGRAMS,
+ COLUMN_IPSYSTEMSTATSREASMREQDS,
+ COLUMN_IPSYSTEMSTATSREASMOKS, COLUMN_IPSYSTEMSTATSREASMFAILS,
+ COLUMN_IPSYSTEMSTATSINDISCARDS, COLUMN_IPSYSTEMSTATSINDELIVERS,
+ COLUMN_IPSYSTEMSTATSHCINDELIVERS, COLUMN_IPSYSTEMSTATSOUTREQUESTS,
+ COLUMN_IPSYSTEMSTATSHCOUTREQUESTS, COLUMN_IPSYSTEMSTATSOUTNOROUTES,
+ /** COLUMN_IPSYSTEMSTATSOUTFORWDATAGRAMS, */
+ COLUMN_IPSYSTEMSTATSHCOUTFORWDATAGRAMS,
+ COLUMN_IPSYSTEMSTATSOUTDISCARDS,
+ /** COLUMN_IPSYSTEMSTATSOUTFRAGREQDS, */
+ COLUMN_IPSYSTEMSTATSOUTFRAGOKS, COLUMN_IPSYSTEMSTATSOUTFRAGFAILS,
+ COLUMN_IPSYSTEMSTATSOUTFRAGCREATES,
+ /** COLUMN_IPSYSTEMSTATSOUTTRANSMITS, */
+ /** COLUMN_IPSYSTEMSTATSHCOUTTRANSMITS, */
+ /** COLUMN_IPSYSTEMSTATSOUTOCTETS, */
+ /** COLUMN_IPSYSTEMSTATSHCOUTOCTETS, */
+ /** COLUMN_IPSYSTEMSTATSINMCASTPKTS, */
+ /** COLUMN_IPSYSTEMSTATSHCINMCASTPKTS, */
+ /** COLUMN_IPSYSTEMSTATSINMCASTOCTETS, */
+ /** COLUMN_IPSYSTEMSTATSHCINMCASTOCTETS, */
+ /** COLUMN_IPSYSTEMSTATSOUTMCASTPKTS, */
+ /** COLUMN_IPSYSTEMSTATSHCOUTMCASTPKTS, */
+ /** COLUMN_IPSYSTEMSTATSOUTMCASTOCTETS, */
+ /** COLUMN_IPSYSTEMSTATSHCOUTMCASTOCTETS, */
+ /** COLUMN_IPSYSTEMSTATSINBCASTPKTS, */
+ /** COLUMN_IPSYSTEMSTATSHCINBCASTPKTS, */
+ /** COLUMN_IPSYSTEMSTATSOUTBCASTPKTS, */
+ /** COLUMN_IPSYSTEMSTATSHCOUTBCASTPKTS, */
+ COLUMN_IPSYSTEMSTATSDISCONTINUITYTIME,
+ COLUMN_IPSYSTEMSTATSREFRESHRATE
+ };
+ static netsnmp_column_info valid_columns;
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_init_data",
+ "called\n"));
+
+ /*
+ * we only want to process certain columns, and ignore
+ * anything else.
+ */
+ valid_columns.isRange = 0;
+ valid_columns.details.list = my_columns;
+ valid_columns.list_count = sizeof(my_columns) / sizeof(unsigned int);
+ ipSystemStatsTable_valid_columns_set(&valid_columns);
+ /*
+ * TODO:303:o: Initialize ipSystemStatsTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+ipSystemStatsTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ipSystemStatsTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to ipSystemStatsTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up ipSystemStatsTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = IPSYSTEMSTATSTABLE_CACHE_TIMEOUT; /* seconds */
+
+ /*
+ * don't release resources
+ */
+ cache->flags |=
+ (NETSNMP_CACHE_DONT_AUTO_RELEASE | NETSNMP_CACHE_DONT_FREE_EXPIRED
+ | NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD |
+ NETSNMP_CACHE_AUTO_RELOAD);
+} /* ipSystemStatsTable_container_init */
+
+/**
+ * check entry for update
+ */
+static void
+_check_for_updates(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_container *stats)
+{
+ /*
+ * check for matching entry. works because indexes are the same.
+ */
+ netsnmp_systemstats_entry *systemstats_entry =
+ CONTAINER_FIND(stats, rowreq_ctx->data);
+ if (NULL == systemstats_entry) {
+ DEBUGMSGTL(("ipSystemStatsTable:access",
+ "updating missing entry\n"));
+
+ /*
+ * mark row as missing, so we can set discontinuity
+ * when it comes back.
+ *
+ * what else should we do? set refresh to 0? that's not quite right...
+ */
+ rowreq_ctx->known_missing = 1;
+ } else {
+ DEBUGMSGTL(("ipSystemStatsTable:access",
+ "updating existing entry\n"));
+
+ /*
+ * Check for changes & update
+ */
+ netsnmp_access_systemstats_entry_update(rowreq_ctx->data,
+ systemstats_entry);
+
+ /*
+ * set discontinuity if previously missing.
+ */
+ if (1 == rowreq_ctx->known_missing) {
+ rowreq_ctx->known_missing = 0;
+ rowreq_ctx->ipSystemStatsDiscontinuityTime =
+ netsnmp_get_agent_uptime();
+ }
+
+ /*
+ * remove entry from container
+ */
+ CONTAINER_REMOVE(stats, systemstats_entry);
+ netsnmp_access_systemstats_entry_free(systemstats_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_add_new(netsnmp_systemstats_entry *systemstats_entry,
+ netsnmp_container *container)
+{
+ ipSystemStatsTable_rowreq_ctx *rowreq_ctx;
+
+ DEBUGMSGTL(("ipSystemStatsTable:access", "creating new entry\n"));
+
+ netsnmp_assert(NULL != systemstats_entry);
+ netsnmp_assert(NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx =
+ ipSystemStatsTable_allocate_rowreq_ctx(systemstats_entry, NULL);
+ if ((NULL != rowreq_ctx)
+ && (MFD_SUCCESS ==
+ ipSystemStatsTable_indexes_set(rowreq_ctx,
+ systemstats_entry->
+ ns_ip_version))) {
+ rowreq_ctx->ipSystemStatsRefreshRate = ipss_cache_refresh * 1000; /* milli-seconds */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ } else {
+ if (NULL != rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "ipSystemStatsTable cache.\n");
+ ipSystemStatsTable_release_rowreq_ctx(rowreq_ctx);
+ } else {
+ snmp_log(LOG_ERR, "memory allocation failed while loading "
+ "ipSystemStatsTable cache.\n");
+ netsnmp_access_systemstats_entry_free(systemstats_entry);
+ }
+ }
+}
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before ipSystemStatsTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+ipSystemStatsTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to ipSystemStatsTable_container_shutdown\n");
+ return;
+ }
+
+} /* ipSystemStatsTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ipSystemStatsTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * ipSystemStatsTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+ipSystemStatsTable_container_load(netsnmp_container *container)
+{
+ netsnmp_container *stats =
+ netsnmp_access_systemstats_container_load(NULL, 0);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_cache_load",
+ "called\n"));
+
+ netsnmp_assert(NULL != container);
+
+ if (NULL == stats)
+ return MFD_RESOURCE_UNAVAILABLE; /* msg already logged */
+ /*
+ * TODO:351:M: |-> Load/update data in the ipSystemStatsTable container.
+ * loop over your ipSystemStatsTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /*
+ * we just got a fresh copy of data. compare it to
+ * what we've already got, and make any adjustements...
+ */
+ CONTAINER_FOR_EACH(container, (netsnmp_container_obj_func *)
+ _check_for_updates, stats);
+
+ /*
+ * now add any new entries
+ */
+ CONTAINER_FOR_EACH(stats, (netsnmp_container_obj_func *)
+ _add_new, container);
+
+ /*
+ * free the container. we've either claimed each ifentry, or released it,
+ * so the dal function doesn't need to clear the container.
+ */
+ netsnmp_access_systemstats_container_free(stats,
+ NETSNMP_ACCESS_SYSTEMSTATS_FREE_DONT_CLEAR);
+
+ DEBUGMSGT(("verbose:ipSystemStatsTable:ipSystemStatsTable_cache_load",
+ "%d records\n", CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+ipSystemStatsTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free ipSystemStatsTable container data.
+ */
+} /* ipSystemStatsTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+ipSystemStatsTable_row_prep(ipSystemStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h
new file mode 100644
index 0000000000..fadd3bcb96
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h
@@ -0,0 +1,105 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipSystemStatsTable_data_access.h 13768 2005-12-01 20:12:20Z rstory $
+ */
+#ifndef IPSYSTEMSTATSTABLE_DATA_ACCESS_H
+#define IPSYSTEMSTATSTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipSystemStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipSystemStatsTable is subid 1 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.1, length: 9
+ */
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_init_data(ipSystemStatsTable_registration *
+ ipSystemStatsTable_reg);
+
+
+ /*
+ * TODO:180:o: Review ipSystemStatsTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define IPSYSTEMSTATSTABLE_CACHE_TIMEOUT 60
+
+ void ipSystemStatsTable_container_init(netsnmp_container
+ **container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void ipSystemStatsTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int ipSystemStatsTable_container_load(netsnmp_container
+ *container);
+ void ipSystemStatsTable_container_free(netsnmp_container
+ *container);
+
+ int ipSystemStatsTable_cache_load(netsnmp_container
+ *container);
+ void ipSystemStatsTable_cache_free(netsnmp_container
+ *container);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_row_prep(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPSYSTEMSTATSTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c
new file mode 100644
index 0000000000..614afa0a99
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c
@@ -0,0 +1,1363 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipSystemStatsTable_interface.c 15015 2006-08-17 15:06:43Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipSystemStatsTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ipSystemStatsTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipSystemStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipSystemStatsTable is subid 1 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.1, length: 9
+ */
+typedef struct ipSystemStatsTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ ipSystemStatsTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} ipSystemStatsTable_interface_ctx;
+
+static ipSystemStatsTable_interface_ctx ipSystemStatsTable_if_ctx;
+
+static void
+ _ipSystemStatsTable_container_init(ipSystemStatsTable_interface_ctx *
+ if_ctx);
+static void
+ _ipSystemStatsTable_container_shutdown(ipSystemStatsTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+ipSystemStatsTable_container_get(void)
+{
+ return ipSystemStatsTable_if_ctx.container;
+}
+
+ipSystemStatsTable_registration *
+ipSystemStatsTable_registration_get(void)
+{
+ return ipSystemStatsTable_if_ctx.user_ctx;
+}
+
+ipSystemStatsTable_registration *
+ipSystemStatsTable_registration_set(ipSystemStatsTable_registration *
+ newreg)
+{
+ ipSystemStatsTable_registration *old =
+ ipSystemStatsTable_if_ctx.user_ctx;
+ ipSystemStatsTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+ipSystemStatsTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipSystemStatsTable_if_ctx.container);
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ipSystemStatsTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ipSystemStatsTable_post_request;
+static Netsnmp_Node_Handler _mfd_ipSystemStatsTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ipSystemStatsTable_get_values;
+/**
+ * @internal
+ * Initialize the table ipSystemStatsTable
+ * (Define its contents and how it's structured)
+ */
+void
+_ipSystemStatsTable_initialize_interface(ipSystemStatsTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ipSystemStatsTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &ipSystemStatsTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_ipSystemStatsTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ipSystemStatsTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ipSystemStatsIPVersion */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = IPSYSTEMSTATSTABLE_MIN_COL;
+ tbl_info->max_column = IPSYSTEMSTATSTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ipSystemStatsTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ipSystemStatsTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ipSystemStatsTable_container_init(&ipSystemStatsTable_if_ctx);
+ if (NULL == ipSystemStatsTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for ipSystemStatsTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_ipSystemStatsTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ipSystemStatsTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_ipSystemStatsTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_ipSystemStatsTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ipSystemStatsTable:init_ipSystemStatsTable",
+ "Registering ipSystemStatsTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ipSystemStatsTable", handler,
+ ipSystemStatsTable_oid,
+ ipSystemStatsTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table ipSystemStatsTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ipSystemStatsTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ ipSystemStatsTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != ipSystemStatsTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(ipSystemStatsTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _ipSystemStatsTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ipSystemStatsTable
+ */
+void
+_ipSystemStatsTable_shutdown_interface(ipSystemStatsTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ipSystemStatsTable_container_shutdown(&ipSystemStatsTable_if_ctx);
+}
+
+void
+ipSystemStatsTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ipSystemStatsTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ipSystemStatsTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+ipSystemStatsTable_index_to_oid(netsnmp_index * oid_idx,
+ ipSystemStatsTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipSystemStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipSystemStatsIPVersion;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipSystemStatsIPVersion, 0x00,
+ sizeof(var_ipSystemStatsIPVersion));
+ var_ipSystemStatsIPVersion.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipSystemStatsIPVersion.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_index_to_oid", "called\n"));
+
+ /*
+ * ipSystemStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_ipSystemStatsIPVersion,
+ (u_char *) & mib_idx->ipSystemStatsIPVersion,
+ sizeof(mib_idx->ipSystemStatsIPVersion));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_ipSystemStatsIPVersion);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipSystemStatsIPVersion);
+
+ return err;
+} /* ipSystemStatsTable_index_to_oid */
+
+/**
+ * extract ipSystemStatsTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+ipSystemStatsTable_index_from_oid(netsnmp_index * oid_idx,
+ ipSystemStatsTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipSystemStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipSystemStatsIPVersion;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipSystemStatsIPVersion, 0x00,
+ sizeof(var_ipSystemStatsIPVersion));
+ var_ipSystemStatsIPVersion.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipSystemStatsIPVersion.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_ipSystemStatsIPVersion);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->ipSystemStatsIPVersion =
+ *((u_long *) var_ipSystemStatsIPVersion.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipSystemStatsIPVersion);
+
+ return err;
+} /* ipSystemStatsTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a ipSystemStatsTable_rowreq_ctx
+ */
+ipSystemStatsTable_rowreq_ctx *
+ipSystemStatsTable_allocate_rowreq_ctx(ipSystemStatsTable_data * data,
+ void *user_init_ctx)
+{
+ ipSystemStatsTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(ipSystemStatsTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:ipSystemStatsTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "ipSystemStatsTable_rowreq_ctx.\n");
+ return NULL;
+ } else {
+ if (NULL != data) {
+ /*
+ * track if we got data from user
+ */
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+ } else if (NULL ==
+ (rowreq_ctx->data =
+ ipSystemStatsTable_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->ipSystemStatsTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ ipSystemStatsTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ ipSystemStatsTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* ipSystemStatsTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a ipSystemStatsTable_rowreq_ctx
+ */
+void
+ipSystemStatsTable_release_rowreq_ctx(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:ipSystemStatsTable:ipSystemStatsTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ ipSystemStatsTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ ipSystemStatsTable_release_data(rowreq_ctx->data);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* ipSystemStatsTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipSystemStatsTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_mfd_ipSystemStatsTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipSystemStatsTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ipSystemStatsTable_pre_request(ipSystemStatsTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipSystemStatsTable", "error %d from "
+ "ipSystemStatsTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipSystemStatsTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipSystemStatsTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipSystemStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_mfd_ipSystemStatsTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ ipSystemStatsTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipSystemStatsTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = ipSystemStatsTable_post_request(ipSystemStatsTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipSystemStatsTable", "error %d from "
+ "ipSystemStatsTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipSystemStatsTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipSystemStatsTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ ipSystemStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_mfd_ipSystemStatsTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * ipSystemStatsTable_interface_ctx *if_ctx =
+ * (ipSystemStatsTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ ipSystemStatsTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ipSystemStatsTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_mfd_ipSystemStatsTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipSystemStatsInReceives(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINRECEIVES:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInReceives_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCInReceives(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINRECEIVES:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInReceives_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInOctets(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINOCTETS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInOctets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINOCTETS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInOctets_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInHdrErrors(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINHDRERRORS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInHdrErrors_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInNoRoutes(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINNOROUTES:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInNoRoutes_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInAddrErrors(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINADDRERRORS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInAddrErrors_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInUnknownProtos(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINUNKNOWNPROTOS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInUnknownProtos_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInTruncatedPkts(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINTRUNCATEDPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInTruncatedPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInForwDatagrams(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINFORWDATAGRAMS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInForwDatagrams_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCInForwDatagrams(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINFORWDATAGRAMS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInForwDatagrams_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsReasmReqds(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSREASMREQDS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsReasmReqds_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsReasmOKs(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSREASMOKS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsReasmOKs_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsReasmFails(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSREASMFAILS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsReasmFails_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInDiscards(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINDISCARDS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInDiscards_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInDelivers(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINDELIVERS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInDelivers_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCInDelivers(19)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINDELIVERS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInDelivers_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutRequests(20)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTREQUESTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutRequests_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCOutRequests(21)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTREQUESTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutRequests_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutNoRoutes(22)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTNOROUTES:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutNoRoutes_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutForwDatagrams(23)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTFORWDATAGRAMS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutForwDatagrams_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCOutForwDatagrams(24)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTFORWDATAGRAMS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutForwDatagrams_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutDiscards(25)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTDISCARDS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutDiscards_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutFragReqds(26)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTFRAGREQDS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutFragReqds_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutFragOKs(27)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTFRAGOKS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutFragOKs_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutFragFails(28)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTFRAGFAILS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutFragFails_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutFragCreates(29)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTFRAGCREATES:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutFragCreates_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutTransmits(30)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTTRANSMITS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutTransmits_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCOutTransmits(31)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTTRANSMITS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutTransmits_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutOctets(32)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTOCTETS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutOctets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCOutOctets(33)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTOCTETS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutOctets_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInMcastPkts(34)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINMCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInMcastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCInMcastPkts(35)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINMCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInMcastPkts_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInMcastOctets(36)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINMCASTOCTETS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInMcastOctets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCInMcastOctets(37)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINMCASTOCTETS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInMcastOctets_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutMcastPkts(38)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTMCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutMcastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCOutMcastPkts(39)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTMCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutMcastPkts_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutMcastOctets(40)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTMCASTOCTETS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutMcastOctets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCOutMcastOctets(41)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTMCASTOCTETS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutMcastOctets_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInBcastPkts(42)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINBCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInBcastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCInBcastPkts(43)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINBCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInBcastPkts_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutBcastPkts(44)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTBCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutBcastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCOutBcastPkts(45)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTBCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutBcastPkts_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsDiscontinuityTime(46)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSDISCONTINUITYTIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_TIMETICKS;
+ rc = ipSystemStatsDiscontinuityTime_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * ipSystemStatsRefreshRate(47)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSREFRESHRATE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipSystemStatsRefreshRate_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipSystemStatsTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipSystemStatsTable_get_column */
+
+int
+_mfd_ipSystemStatsTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipSystemStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_mfd_ipSystemStatsTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipSystemStatsTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipSystemStatsTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for ipSystemStatsTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return ipSystemStatsTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in ipSystemStatsTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ ipSystemStatsTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in ipSystemStatsTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ipSystemStatsTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_ipSystemStatsTable_container_init(ipSystemStatsTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_ipSystemStatsTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ ipSystemStatsTable_oid,
+ ipSystemStatsTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for ipSystemStatsTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ ipSystemStatsTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("ipSystemStatsTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ipSystemStatsTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _ipSystemStatsTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ipSystemStatsTable_container_shutdown(ipSystemStatsTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_ipSystemStatsTable_container_shutdown", "called\n"));
+
+ ipSystemStatsTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ipSystemStatsTable_container_shutdown */
+
+
+ipSystemStatsTable_rowreq_ctx *
+ipSystemStatsTable_row_find_by_mib_index(ipSystemStatsTable_mib_index *
+ mib_idx)
+{
+ ipSystemStatsTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = ipSystemStatsTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(ipSystemStatsTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h
new file mode 100644
index 0000000000..37cf765c35
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h
@@ -0,0 +1,173 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipSystemStatsTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef IPSYSTEMSTATSTABLE_INTERFACE_H
+#define IPSYSTEMSTATSTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ipSystemStatsTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _ipSystemStatsTable_initialize_interface
+ (ipSystemStatsTable_registration * user_ctx, u_long flags);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _ipSystemStatsTable_shutdown_interface
+ (ipSystemStatsTable_registration * user_ctx);
+
+
+
+
+
+
+
+ ipSystemStatsTable_registration
+ * ipSystemStatsTable_registration_get(void);
+
+
+
+
+
+
+
+ ipSystemStatsTable_registration
+ * ipSystemStatsTable_registration_set
+ (ipSystemStatsTable_registration * newreg);
+
+ netsnmp_container *ipSystemStatsTable_container_get(void);
+ int ipSystemStatsTable_container_size(void);
+
+
+
+
+
+
+
+ ipSystemStatsTable_rowreq_ctx
+ * ipSystemStatsTable_allocate_rowreq_ctx(ipSystemStatsTable_data *,
+ void *);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_release_rowreq_ctx(ipSystemStatsTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int ipSystemStatsTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ ipSystemStatsTable_mib_index
+ * mib_idx);
+ int ipSystemStatsTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ ipSystemStatsTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPSYSTEMSTATSTABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.c
new file mode 100644
index 0000000000..2543491afd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.c
@@ -0,0 +1,153 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf,v 1.8 2004/10/14 12:57:34 dts12 Exp $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/data_access/ip_scalars.h>
+
+#include "ip_scalars.h"
+
+int
+handle_ipv6IpForwarding(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+/** Initializes the ip module */
+void
+init_ip_scalars(void)
+{
+ static oid ipReasmTimeout_oid[] = { 1, 3, 6, 1, 2, 1, 4, 13, 0 };
+ static oid ipv6IpForwarding_oid[] = { 1, 3, 6, 1, 2, 1, 4, 25 };
+ static oid ipv6IpDefaultHopLimit_oid[] =
+ { 1, 3, 6, 1, 2, 1, 4, 26, 0 };
+
+ DEBUGMSGTL(("ip_scalar", "Initializing\n"));
+
+ netsnmp_register_num_file_instance
+ ("ipReasmTimeout",
+ ipReasmTimeout_oid, OID_LENGTH(ipReasmTimeout_oid),
+ "/proc/sys/net/ipv4/ipfrag_time", ASN_INTEGER,
+ HANDLER_CAN_RONLY, NULL, NULL);
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("ipv6IpForwarding", handle_ipv6IpForwarding,
+ ipv6IpForwarding_oid,
+ OID_LENGTH(ipv6IpForwarding_oid),
+ HANDLER_CAN_RWRITE));
+
+ netsnmp_register_num_file_instance
+ ("ipv6IpDefaultHopLimit",
+ ipv6IpDefaultHopLimit_oid, OID_LENGTH(ipv6IpDefaultHopLimit_oid),
+ "/proc/sys/net/ipv6/conf/default/hop_limit", ASN_INTEGER,
+ HANDLER_CAN_RWRITE, NULL, NULL);
+
+}
+
+int
+handle_ipv6IpForwarding(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ u_long value;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ rc = netsnmp_arch_ip_scalars_ipv6IpForwarding_get(&value);
+ if (rc != 0) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_NOSUCHINSTANCE);
+ }
+ else {
+ value = value ? 1 : 2;
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *)&value, sizeof(value));
+ }
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * store old info for undo later
+ */
+ rc = netsnmp_arch_ip_scalars_ipv6IpForwarding_get(&value);
+ if (rc < 0) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_NOCREATION);
+ }
+ else {
+ u_long *value_save;
+ memdup((u_char **) & value_save, (u_char *) &value,
+ sizeof(value));
+ if ( NULL == value_save ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("ipfw", value_save,
+ free));
+ }
+ }
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ value = *(requests->requestvb->val.integer);
+ rc = netsnmp_arch_ip_scalars_ipv6IpForwarding_set(value);
+ if ( 0 != rc ) {
+ netsnmp_set_request_error(reqinfo, requests, rc );
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "ipfw"));
+ rc = netsnmp_arch_ip_scalars_ipv6IpForwarding_set(value);
+ if ( 0 != rc ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR, "unknown mode (%d) in handle_ipv6IpForwarding\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.h
new file mode 100644
index 0000000000..7670a49803
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.h
@@ -0,0 +1,7 @@
+/*
+ * module to include the modules
+ */
+
+void init_ip_scalars(void);
+
+config_require(ip-mib/data_access/scalars_common)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable.h
new file mode 100644
index 0000000000..2ebd7680f0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipv4InterfaceTable/ipv4InterfaceTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c
new file mode 100644
index 0000000000..b79811c88c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c
@@ -0,0 +1,956 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipv4InterfaceTable.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** \page MFD helper for ipv4InterfaceTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv4InterfaceTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ipv4InterfaceTable_interface.h"
+
+oid ipv4InterfaceTable_oid[] = { IPV4INTERFACETABLE_OID };
+int ipv4InterfaceTable_oid_size =
+OID_LENGTH(ipv4InterfaceTable_oid);
+
+ipv4InterfaceTable_registration ipv4InterfaceTable_user_context;
+
+void initialize_table_ipv4InterfaceTable(void);
+void shutdown_table_ipv4InterfaceTable(void);
+
+
+/**
+ * Initializes the ipv4InterfaceTable module
+ */
+void
+init_ipv4InterfaceTable(void)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:init_ipv4InterfaceTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform ipv4InterfaceTable one-time module initialization.
+ */
+
+ /*
+ * we depend on the ifTable, so we put our init in with it
+ * to guarantee order of execution.
+ */
+ init_ifTable();
+
+ /*
+ * last changed should be 0 at startup
+ */
+ ipv4InterfaceTable_lastChange_set(0);
+
+} /* init_ipv4InterfaceTable */
+
+/**
+ * Shut-down the ipv4InterfaceTable module (agent is exiting)
+ */
+void
+shutdown_ipv4InterfaceTable(void)
+{
+ if (should_init("ipv4InterfaceTable"))
+ shutdown_table_ipv4InterfaceTable();
+
+}
+
+/**
+ * Initialize the table ipv4InterfaceTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ipv4InterfaceTable(void)
+{
+ ipv4InterfaceTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:initialize_table_ipv4InterfaceTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform ipv4InterfaceTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ipv4InterfaceTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("ipv4InterfaceTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ipv4InterfaceTable_initialize_interface(user_context, flags);
+} /* initialize_table_ipv4InterfaceTable */
+
+/**
+ * Shutdown the table ipv4InterfaceTable
+ */
+void
+shutdown_table_ipv4InterfaceTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipv4InterfaceTable_shutdown_interface
+ (&ipv4InterfaceTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+ipv4InterfaceTable_rowreq_ctx_init(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ipv4InterfaceTable rowreq initialization. (eg DEFVALS)
+ */
+ rowreq_ctx->data.ipv4InterfaceRetransmitTime = 1000;
+
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ * @param rowreq_ctx
+ *
+ */
+void
+ipv4InterfaceTable_rowreq_ctx_cleanup(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ipv4InterfaceTable rowreq cleanup.
+ */
+} /* ipv4InterfaceTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ * @param user_context
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ipv4InterfaceTable_pre_request(ipv4InterfaceTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform ipv4InterfaceTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+ipv4InterfaceTable_post_request(ipv4InterfaceTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform ipv4InterfaceTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (ipv4InterfaceTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ ipv4InterfaceTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ipv4InterfaceTable data context functions.
+ */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv4InterfaceEntry.ipv4InterfaceReasmMaxSize
+ * ipv4InterfaceReasmMaxSize is subid 2 of ipv4InterfaceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.28.1.2
+ * Description:
+The size of the largest IPv4 datagram which this entity can
+ re-assemble from incoming IPv4 fragmented datagrams received
+ on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 65535;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the ipv4InterfaceReasmMaxSize data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv4InterfaceReasmMaxSize_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv4InterfaceReasmMaxSize_get(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ long *ipv4InterfaceReasmMaxSize_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv4InterfaceReasmMaxSize_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceReasmMaxSize_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (!
+ (rowreq_ctx->data.ifentry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V4_REASMMAX))
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv4InterfaceReasmMaxSize data.
+ * copy (* ipv4InterfaceReasmMaxSize_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv4InterfaceReasmMaxSize_val_ptr) =
+ rowreq_ctx->data.ipv4InterfaceReasmMaxSize;
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceReasmMaxSize_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv4InterfaceEntry.ipv4InterfaceEnableStatus
+ * ipv4InterfaceEnableStatus is subid 3 of ipv4InterfaceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.4.28.1.3
+ * Description:
+The indication of whether IPv4 is enabled (up) or disabled
+ (down) on this interface. This object does not affect the
+ state of the interface itself, only its connection to an
+ IPv4 stack. The IF-MIB should be used to control the state
+ of the interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: up(1), down(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipv4InterfaceEnableStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv4InterfaceEnableStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv4InterfaceEnableStatus_get(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv4InterfaceEnableStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv4InterfaceEnableStatus_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceEnableStatus_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv4InterfaceEnableStatus data.
+ * copy (* ipv4InterfaceEnableStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv4InterfaceEnableStatus_val_ptr) =
+ rowreq_ctx->data.ipv4InterfaceEnableStatus;
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceEnableStatus_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv4InterfaceEntry.ipv4InterfaceRetransmitTime
+ * ipv4InterfaceRetransmitTime is subid 4 of ipv4InterfaceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.28.1.4
+ * Description:
+The time between retransmissions of ARP requests to a
+ neighbor when resolving the address or when probing the
+ reachability of a neighbor.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ * defval: 1000
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipv4InterfaceRetransmitTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv4InterfaceRetransmitTime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv4InterfaceRetransmitTime_get(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ ipv4InterfaceRetransmitTime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv4InterfaceRetransmitTime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceRetransmitTime_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (!
+ (rowreq_ctx->data.ifentry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V4_RETRANSMIT))
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv4InterfaceRetransmitTime data.
+ * copy (* ipv4InterfaceRetransmitTime_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv4InterfaceRetransmitTime_val_ptr) =
+ rowreq_ctx->data.ipv4InterfaceRetransmitTime;
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceRetransmitTime_get */
+
+
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * ipv4InterfaceTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * ipv4InterfaceTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv4InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ipv4InterfaceTable_undo_setup(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_undo_setup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup ipv4InterfaceTable undo.
+ * set up ipv4InterfaceTable undo information, in preparation for a set.
+ * Undo storage is in (* ipv4InterfaceRetransmitTime_val_ptr )*
+ */
+
+ return rc;
+} /* ipv4InterfaceTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv4InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ipv4InterfaceTable_undo(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> ipv4InterfaceTable undo.
+ * ipv4InterfaceTable undo information, in response to a failed set.
+ * Undo storage is in (* ipv4InterfaceRetransmitTime_val_ptr )*
+ */
+
+ return rc;
+} /* ipv4InterfaceTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv4InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipv4InterfaceTable_undo_cleanup(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup ipv4InterfaceTable undo.
+ * Undo storage is in (* ipv4InterfaceRetransmitTime_val_ptr )*
+ */
+
+ return rc;
+} /* ipv4InterfaceTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipv4InterfaceTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipv4InterfaceTable_commit(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit ipv4InterfaceTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_IPV4INTERFACEENABLESTATUS_FLAG) {
+ save_flags &= ~COLUMN_IPV4INTERFACEENABLESTATUS_FLAG; /* clear ipv4InterfaceEnableStatus */
+ /*
+ * TODO:482:o: |-> commit column ipv4InterfaceEnableStatus.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipv4InterfaceTable column ipv4InterfaceEnableStatus commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipv4InterfaceEnableStatus
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV4INTERFACEENABLESTATUS_FLAG;
+ }
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* ipv4InterfaceTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipv4InterfaceTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipv4InterfaceTable_undo_commit(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo ipv4InterfaceTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* ipv4InterfaceTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement ipv4InterfaceTable node value checks.
+ * TODO:450:M: Implement ipv4InterfaceTable undo functions.
+ * TODO:460:M: Implement ipv4InterfaceTable set functions.
+ * TODO:480:M: Implement ipv4InterfaceTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv4InterfaceEntry.ipv4InterfaceEnableStatus
+ * ipv4InterfaceEnableStatus is subid 3 of ipv4InterfaceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.4.28.1.3
+ * Description:
+The indication of whether IPv4 is enabled (up) or disabled
+ (down) on this interface. This object does not affect the
+ state of the interface itself, only its connection to an
+ IPv4 stack. The IF-MIB should be used to control the state
+ of the interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: up(1), down(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv4InterfaceEnableStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipv4InterfaceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of up(1), down(2)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipv4InterfaceEnableStatus_check_value(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipv4InterfaceEnableStatus_val)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceEnableStatus_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipv4InterfaceEnableStatus value.
+ */
+ /*
+ * did the access code set the flag indicating that we can control
+ * individual protocols on this interface?
+ */
+ if (rowreq_ctx->data.ifentry->ns_flags &
+ NETSNMP_INTERFACE_FLAGS_CAN_DOWN_PROTOCOL);
+ else
+ return MFD_NOT_VALID_EVER;
+
+ return MFD_SUCCESS; /* ipv4InterfaceEnableStatus value not illegal */
+} /* ipv4InterfaceEnableStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv4InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipv4InterfaceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipv4InterfaceEnableStatus_undo_setup(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceEnableStatus_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipv4InterfaceEnableStatus undo.
+ */
+ /*
+ * copy ipv4InterfaceEnableStatus data
+ * set rowreq_ctx->undo->ipv4InterfaceEnableStatus from rowreq_ctx->data.ipv4InterfaceEnableStatus
+ */
+ rowreq_ctx->undo->ipv4InterfaceEnableStatus =
+ rowreq_ctx->data.ipv4InterfaceEnableStatus;
+
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceEnableStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipv4InterfaceEnableStatus_val
+ * A long containing the new value.
+ */
+int
+ipv4InterfaceEnableStatus_set(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long ipv4InterfaceEnableStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceEnableStatus_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipv4InterfaceEnableStatus value.
+ * set ipv4InterfaceEnableStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.ipv4InterfaceEnableStatus =
+ ipv4InterfaceEnableStatus_val;
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceEnableStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipv4InterfaceEnableStatus_undo(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceEnableStatus_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipv4InterfaceEnableStatus undo.
+ */
+ /*
+ * copy ipv4InterfaceEnableStatus data
+ * set rowreq_ctx->data.ipv4InterfaceEnableStatus from rowreq_ctx->undo->ipv4InterfaceEnableStatus
+ */
+ rowreq_ctx->data.ipv4InterfaceEnableStatus =
+ rowreq_ctx->undo->ipv4InterfaceEnableStatus;
+
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceEnableStatus_undo */
+
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h
new file mode 100644
index 0000000000..84dfcedeae
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h
@@ -0,0 +1,275 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipv4InterfaceTable.h 15205 2006-09-14 17:15:32Z rstory $
+ */
+#ifndef IPV4INTERFACETABLE_H
+#define IPV4INTERFACETABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "if-mib/ifTable/ifTable.h"
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(if-mib/ifTable/ifTable)
+config_require(ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface)
+config_require(ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for ipv4InterfaceTable
+ */
+#include "ipv4InterfaceTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ipv4InterfaceTable(void);
+ void shutdown_ipv4InterfaceTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ *
+ * we share data structures (data too, in fact) with ifTable
+ */
+ typedef ifTable_registration ipv4InterfaceTable_registration;
+ typedef ifTable_data ipv4InterfaceTable_data;
+ typedef ifTable_undo_data ipv4InterfaceTable_undo_data;
+ typedef ifTable_mib_index ipv4InterfaceTable_mib_index;
+ typedef ifTable_rowreq_ctx ipv4InterfaceTable_rowreq_ctx;
+
+ /*
+ * ipv4InterfaceReasmMaxSize(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+#define ipv4InterfaceReasmMaxSize ifentry->reasm_max_v4
+
+ /*
+ * ipv4InterfaceEnableStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+#define ipv4InterfaceEnableStatus ifentry->admin_status
+
+ /*
+ * ipv4InterfaceRetransmitTime(4)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/D/h
+ */
+#define ipv4InterfaceRetransmitTime ifentry->retransmit_v4
+
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ ipv4InterfaceTable_pre_request(ipv4InterfaceTable_registration *
+ user_context);
+ int
+ ipv4InterfaceTable_post_request(ipv4InterfaceTable_registration *
+ user_context, int rc);
+
+ int
+ ipv4InterfaceTable_rowreq_ctx_init(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ void *user_init_ctx);
+ void
+ ipv4InterfaceTable_rowreq_ctx_cleanup(ipv4InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int ipv4InterfaceTable_commit(ipv4InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ ipv4InterfaceTable_rowreq_ctx
+ * ipv4InterfaceTable_row_find_by_mib_index
+ (ipv4InterfaceTable_mib_index * mib_idx);
+
+ extern oid ipv4InterfaceTable_oid[];
+ extern int ipv4InterfaceTable_oid_size;
+
+
+#include "ipv4InterfaceTable_interface.h"
+#include "ipv4InterfaceTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ */
+ /*
+ * indexes
+ */
+
+ int
+ ipv4InterfaceReasmMaxSize_get(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx, long
+ *ipv4InterfaceReasmMaxSize_val_ptr);
+ int
+ ipv4InterfaceEnableStatus_get(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv4InterfaceEnableStatus_val_ptr);
+ int
+ ipv4InterfaceRetransmitTime_get(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv4InterfaceRetransmitTime_val_ptr);
+
+
+ int
+ ipv4InterfaceTable_indexes_set_tbl_idx(ipv4InterfaceTable_mib_index
+ * tbl_idx, long
+ ipv4InterfaceIfIndex_val);
+ int
+ ipv4InterfaceTable_indexes_set(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipv4InterfaceIfIndex_val);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ */
+
+
+ int
+ ipv4InterfaceTable_undo_setup(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ ipv4InterfaceTable_undo_cleanup(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipv4InterfaceTable_undo(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipv4InterfaceTable_commit(ipv4InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ ipv4InterfaceTable_undo_commit(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ ipv4InterfaceReasmMaxSize_check_value(ipv4InterfaceTable_rowreq_ctx
+ * rowreq_ctx, long
+ ipv4InterfaceReasmMaxSize_val);
+ int
+ ipv4InterfaceReasmMaxSize_undo_setup(ipv4InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ ipv4InterfaceReasmMaxSize_set(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipv4InterfaceReasmMaxSize_val);
+ int
+ ipv4InterfaceReasmMaxSize_undo(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipv4InterfaceEnableStatus_check_value(ipv4InterfaceTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ ipv4InterfaceEnableStatus_val);
+ int
+ ipv4InterfaceEnableStatus_undo_setup(ipv4InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ ipv4InterfaceEnableStatus_set(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipv4InterfaceEnableStatus_val);
+ int
+ ipv4InterfaceEnableStatus_undo(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipv4InterfaceRetransmitTime_check_value
+ (ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long ipv4InterfaceRetransmitTime_val);
+ int
+ ipv4InterfaceRetransmitTime_undo_setup
+ (ipv4InterfaceTable_rowreq_ctx * rowreq_ctx);
+ int
+ ipv4InterfaceRetransmitTime_set(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipv4InterfaceRetransmitTime_val);
+ int
+ ipv4InterfaceRetransmitTime_undo(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ ipv4InterfaceTable_check_dependencies(ipv4InterfaceTable_rowreq_ctx
+ * ctx);
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV4INTERFACETABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_constants.h
new file mode 100644
index 0000000000..29095cd6ee
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_constants.h
@@ -0,0 +1,81 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: ipv4InterfaceTable_constants.h 13897 2005-12-10 01:56:01Z rstory $
+ */
+#ifndef IPV4INTERFACETABLE_CONSTANTS_H
+#define IPV4INTERFACETABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ipv4InterfaceTable
+ */
+#define IPV4INTERFACETABLE_OID 1,3,6,1,2,1,4,28
+#define IPV4INTERFACETABLELASTCHANGE_OID 1,3,6,1,2,1,4,27
+
+#define COLUMN_IPV4INTERFACEIFINDEX 1
+
+#define COLUMN_IPV4INTERFACEREASMMAXSIZE 2
+
+#define COLUMN_IPV4INTERFACEENABLESTATUS 3
+#define COLUMN_IPV4INTERFACEENABLESTATUS_FLAG (0x1 << 2)
+
+#define COLUMN_IPV4INTERFACERETRANSMITTIME 4
+
+
+#define IPV4INTERFACETABLE_MIN_COL COLUMN_IPV4INTERFACEREASMMAXSIZE
+#define IPV4INTERFACETABLE_MAX_COL COLUMN_IPV4INTERFACERETRANSMITTIME
+
+
+ /*
+ * TODO:405:r: Review IPV4INTERFACETABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define IPV4INTERFACETABLE_SETTABLE_COLS (COLUMN_IPV4INTERFACEENABLESTATUS_FLAG)
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table ipv4InterfaceTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipv4InterfaceEnableStatus (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPV4INTERFACEENABLESTATUS_ENUMS
+#define IPV4INTERFACEENABLESTATUS_ENUMS
+
+#define IPV4INTERFACEENABLESTATUS_UP 1
+#define IPV4INTERFACEENABLESTATUS_DOWN 2
+
+#endif /* IPV4INTERFACEENABLESTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV4INTERFACETABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c
new file mode 100644
index 0000000000..72bb5ba463
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c
@@ -0,0 +1,302 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipv4InterfaceTable_data_access.c 15205 2006-09-14 17:15:32Z rstory $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv4InterfaceTable.h"
+
+
+#include "ipv4InterfaceTable_data_access.h"
+
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ */
+
+/**
+ * initialization for ipv4InterfaceTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ipv4InterfaceTable_reg
+ * Pointer to ipv4InterfaceTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ipv4InterfaceTable_init_data(ipv4InterfaceTable_registration *
+ ipv4InterfaceTable_reg)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize ipv4InterfaceTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+ipv4InterfaceTable_container_init(netsnmp_container **container_ptr_ptr)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ipv4InterfaceTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+} /* ipv4InterfaceTable_container_init */
+
+
+/**
+ * @internal
+ * determine if we want a ifTable row in our container
+ */
+void
+ipv4InterfaceTable_check_entry_for_updates(const ifTable_rowreq_ctx *
+ ift_rrc,
+ netsnmp_interface_entry *entry)
+{
+ netsnmp_container *c = ipv4InterfaceTable_container_get();
+ ifTable_rowreq_ctx *ip4if_rrc;
+ int changed = 0;
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:check_entry_for_updates",
+ "called\n"));
+
+ /*
+ * do we have a corresponding row?
+ */
+ ip4if_rrc = CONTAINER_FIND(c, ift_rrc);
+ if (NULL == ip4if_rrc) {
+ /*
+ * no corresponding row. should we have one?
+ */
+ if ((NULL != entry) &&
+ (entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV4)) {
+ /*
+ * yes.
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable:check_entry_for_updates",
+ "inserted row for %d\n", entry->index));
+ CONTAINER_INSERT(c, ift_rrc);
+ changed = 1;
+ }
+ } else {
+ /*
+ * found corresponding row. is it still applicable?
+ */
+ if ((NULL == entry) ||
+ (0 == (entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV4))) {
+ /*
+ * no
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable:check_entry_for_updates",
+ "removed row for %d\n",
+ ift_rrc->data.ifentry->index));
+ CONTAINER_REMOVE(c, ift_rrc);
+ changed = 1;
+ } else {
+ /*
+ * still applicable. anything changed?
+ */
+ if ((entry->retransmit_v4 !=
+ ift_rrc->data.ifentry->retransmit_v4) ||
+ (entry->reasm_max_v4 != ift_rrc->data.ifentry->reasm_max_v4)) {
+ DEBUGMSGTL(("ipv4InterfaceTable:check_entry_for_updates",
+ "row changed for %d\n",
+ ift_rrc->data.ifentry->index));
+ changed = 1;
+ }
+ }
+ }
+
+ /*
+ * if something changed, update table last changed
+ */
+ if (changed)
+ ipv4InterfaceTable_lastChange_set(netsnmp_get_agent_uptime());
+}
+
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before ipv4InterfaceTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+ipv4InterfaceTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to ipv4InterfaceTable_container_shutdown\n");
+ return;
+ }
+
+} /* ipv4InterfaceTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ipv4InterfaceTable data load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * ipv4InterfaceTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+ipv4InterfaceTable_container_load(netsnmp_container *container)
+{
+ DEBUGMSGT(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_container_load", "illegal call!\n"));
+
+ return MFD_ERROR;
+} /* ipv4InterfaceTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+ipv4InterfaceTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free ipv4InterfaceTable container data.
+ */
+} /* ipv4InterfaceTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+ipv4InterfaceTable_row_prep(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.h
new file mode 100644
index 0000000000..821e37e392
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.h
@@ -0,0 +1,71 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipv4InterfaceTable_data_access.h 13899 2005-12-10 01:58:09Z rstory $
+ */
+#ifndef IPV4INTERFACETABLE_DATA_ACCESS_H
+#define IPV4INTERFACETABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ */
+
+
+ int
+ ipv4InterfaceTable_init_data(ipv4InterfaceTable_registration *
+ ipv4InterfaceTable_reg);
+
+
+ void
+ ipv4InterfaceTable_container_init(netsnmp_container
+ **container_ptr_ptr);
+ void ipv4InterfaceTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int
+ ipv4InterfaceTable_container_load(netsnmp_container
+ *container);
+ void
+ ipv4InterfaceTable_container_free(netsnmp_container
+ *container);
+
+ int
+ ipv4InterfaceTable_row_prep(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ void
+ ipv4InterfaceTable_check_entry_for_updates(const
+ ifTable_rowreq_ctx
+ * ift_rrc,
+ netsnmp_interface_entry
+ *entry);
+
+
+#ifdef __cplusplus
+ }
+#endif
+#endif /* IPV4INTERFACETABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c
new file mode 100644
index 0000000000..d8b8dc4d0d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c
@@ -0,0 +1,1308 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipv4InterfaceTable_interface.c 14142 2006-01-15 19:55:17Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv4InterfaceTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ipv4InterfaceTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ */
+typedef struct ipv4InterfaceTable_interface_ctx_s {
+
+ netsnmp_container *container;
+
+ ipv4InterfaceTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_long last_changed;
+
+} ipv4InterfaceTable_interface_ctx;
+
+static ipv4InterfaceTable_interface_ctx ipv4InterfaceTable_if_ctx;
+
+static void
+ _ipv4InterfaceTable_container_init(ipv4InterfaceTable_interface_ctx *
+ if_ctx);
+static void
+ _ipv4InterfaceTable_container_shutdown(ipv4InterfaceTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+ipv4InterfaceTable_container_get(void)
+{
+ return ipv4InterfaceTable_if_ctx.container;
+}
+
+ipv4InterfaceTable_registration *
+ipv4InterfaceTable_registration_get(void)
+{
+ return ipv4InterfaceTable_if_ctx.user_ctx;
+}
+
+ipv4InterfaceTable_registration *
+ipv4InterfaceTable_registration_set(ipv4InterfaceTable_registration *
+ newreg)
+{
+ ipv4InterfaceTable_registration *old =
+ ipv4InterfaceTable_if_ctx.user_ctx;
+ ipv4InterfaceTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+ipv4InterfaceTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipv4InterfaceTable_if_ctx.container);
+}
+
+u_int
+ipv4InterfaceTable_dirty_get(void)
+{
+ return ifTable_dirty_get();
+}
+
+void
+ipv4InterfaceTable_dirty_set(u_int status)
+{
+ ifTable_dirty_set(status);
+}
+
+/*
+ * ipv4InterfaceTableLastChanged, which is the last time that a row in
+ * the table was changed or the last time a row was added/deleted from the
+ * table.
+ */
+void
+ipv4InterfaceTable_lastChange_set(u_long table_changed)
+{
+ DEBUGMSGTL(("ipv4InterfaceTable:lastChanged_set",
+ "called. was %ld, now %ld\n",
+ ipv4InterfaceTable_if_ctx.last_changed, table_changed));
+ ipv4InterfaceTable_if_ctx.last_changed = table_changed;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_post_request;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_get_values;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_check_objects;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_set_values;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_undo_values;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_commit;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+ _ipv4InterfaceTable_undo_column(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list *
+ var, int column);
+
+ipv4InterfaceTable_data *ipv4InterfaceTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table ipv4InterfaceTable
+ * (Define its contents and how it's structured)
+ */
+void
+_ipv4InterfaceTable_initialize_interface(ipv4InterfaceTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ipv4InterfaceTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &ipv4InterfaceTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_ipv4InterfaceTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ipv4InterfaceTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ipv4InterfaceIfIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = IPV4INTERFACETABLE_MIN_COL;
+ tbl_info->max_column = IPV4INTERFACETABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ipv4InterfaceTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ipv4InterfaceTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ipv4InterfaceTable_container_init(&ipv4InterfaceTable_if_ctx);
+ if (NULL == ipv4InterfaceTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for ipv4InterfaceTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_ipv4InterfaceTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ipv4InterfaceTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_ipv4InterfaceTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_ipv4InterfaceTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_ipv4InterfaceTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_ipv4InterfaceTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_ipv4InterfaceTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_ipv4InterfaceTable_set_values;
+ access_multiplexer->undo_sets = _mfd_ipv4InterfaceTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_ipv4InterfaceTable_commit;
+ access_multiplexer->undo_commit = _mfd_ipv4InterfaceTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_ipv4InterfaceTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable:init_ipv4InterfaceTable",
+ "Registering ipv4InterfaceTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ipv4InterfaceTable", handler,
+ ipv4InterfaceTable_oid,
+ ipv4InterfaceTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table ipv4InterfaceTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ipv4InterfaceTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ ipv4InterfaceTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+ /*
+ * register LastChanged
+ */
+ {
+ oid lc_oid[] = { IPV4INTERFACETABLELASTCHANGE_OID };
+ netsnmp_register_watched_scalar(netsnmp_create_handler_registration
+ ("ipv4TableLastChanged", NULL,
+ lc_oid, OID_LENGTH(lc_oid),
+ HANDLER_CAN_RONLY),
+ netsnmp_create_watcher_info((void
+ *)
+ &ipv4InterfaceTable_if_ctx.
+ last_changed,
+ sizeof
+ (u_long),
+ ASN_TIMETICKS,
+ WATCHER_FIXED_SIZE));
+ }
+} /* _ipv4InterfaceTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ipv4InterfaceTable
+ */
+void
+_ipv4InterfaceTable_shutdown_interface(ipv4InterfaceTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ipv4InterfaceTable_container_shutdown(&ipv4InterfaceTable_if_ctx);
+}
+
+void
+ipv4InterfaceTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ipv4InterfaceTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ipv4InterfaceTable_valid_columns_set */
+
+/*
+ * ipv4InterfaceTable_allocate_data
+ *
+ * Purpose: create new ipv4InterfaceTable_data.
+ */
+ipv4InterfaceTable_data *
+ipv4InterfaceTable_allocate_data(void)
+{
+ ipv4InterfaceTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(ipv4InterfaceTable_data);
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "ipv4InterfaceTable_data.\n");
+ }
+
+ return rtn;
+} /* ipv4InterfaceTable_allocate_data */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv4InterfaceTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipv4InterfaceTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ipv4InterfaceTable_pre_request(ipv4InterfaceTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable", "error %d from "
+ "ipv4InterfaceTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv4InterfaceTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_post_request", "called\n"));
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipv4InterfaceTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && ipv4InterfaceTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "ipv4InterfaceTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = ipv4InterfaceTable_post_request(ipv4InterfaceTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable", "error %d from "
+ "ipv4InterfaceTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv4InterfaceTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * ipv4InterfaceTable_interface_ctx *if_ctx =
+ * (ipv4InterfaceTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ ipv4InterfaceTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ipv4InterfaceTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv4InterfaceTable_get_column(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv4InterfaceReasmMaxSize(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_IPV4INTERFACEREASMMAXSIZE:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = ipv4InterfaceReasmMaxSize_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * ipv4InterfaceEnableStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV4INTERFACEENABLESTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipv4InterfaceEnableStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv4InterfaceRetransmitTime(4)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/D/h
+ */
+ case COLUMN_IPV4INTERFACERETRANSMITTIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv4InterfaceRetransmitTime_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv4InterfaceTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipv4InterfaceTable_get_column */
+
+int
+_mfd_ipv4InterfaceTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv4InterfaceTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv4InterfaceTable_check_column(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_ipv4InterfaceTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) ipv4InterfaceIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ case COLUMN_IPV4INTERFACEIFINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * ipv4InterfaceReasmMaxSize(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_IPV4INTERFACEREASMMAXSIZE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipv4InterfaceEnableStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV4INTERFACEENABLESTATUS:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ ipv4InterfaceEnableStatus));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != IPV4INTERFACEENABLESTATUS_UP)
+ && (*var->val.integer != IPV4INTERFACEENABLESTATUS_DOWN)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv4InterfaceTable:_ipv4InterfaceTable_check_column:ipv4InterfaceEnableStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipv4InterfaceEnableStatus_check_value(rowreq_ctx,
+ *((u_long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipv4InterfaceEnableStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipv4InterfaceRetransmitTime(4)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/D/h
+ */
+ case COLUMN_IPV4INTERFACERETRANSMITTIME:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv4InterfaceTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _ipv4InterfaceTable_check_column */
+
+int
+_mfd_ipv4InterfaceTable_check_objects(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv4InterfaceTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv4InterfaceTable_undo_setup_column(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_ipv4InterfaceTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv4InterfaceEnableStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV4INTERFACEENABLESTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV4INTERFACEENABLESTATUS_FLAG;
+ rc = ipv4InterfaceEnableStatus_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv4InterfaceTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipv4InterfaceTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ipv4InterfaceTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rc = _mfd_ifTable_undo_setup_allocate(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ netsnmp_request_set_error_all(requests, rc);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rc = ipv4InterfaceTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv4InterfaceTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ipv4InterfaceTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = ipv4InterfaceTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ _mfd_ifTable_undo_setup_release(rowreq_ctx);
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv4InterfaceTable_set_column(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_ipv4InterfaceTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv4InterfaceEnableStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV4INTERFACEENABLESTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV4INTERFACEENABLESTATUS_FLAG;
+ rc = ipv4InterfaceEnableStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv4InterfaceTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _ipv4InterfaceTable_set_column */
+
+int
+_mfd_ipv4InterfaceTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv4InterfaceTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_ipv4InterfaceTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipv4InterfaceTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ ipv4InterfaceTable_dirty_set(ipv4InterfaceTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_ipv4InterfaceTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = ipv4InterfaceTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ ipv4InterfaceTable_dirty_set(d - 1);
+ }
+
+ rc = ipv4InterfaceTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "ipv4InterfaceTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv4InterfaceTable_undo_column(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_ipv4InterfaceTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv4InterfaceEnableStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV4INTERFACEENABLESTATUS:
+ rc = ipv4InterfaceEnableStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv4InterfaceTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipv4InterfaceTable_undo_column */
+
+int
+_mfd_ipv4InterfaceTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipv4InterfaceTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv4InterfaceTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_ipv4InterfaceTable_irreversible_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ CONTAINER_REMOVE(ipv4InterfaceTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in ipv4InterfaceTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ipv4InterfaceTable_container_free(container);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_ipv4InterfaceTable_container_init(ipv4InterfaceTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_ipv4InterfaceTable_container_init", "called\n"));
+
+ /*
+ * container init
+ */
+ ipv4InterfaceTable_container_init(&if_ctx->container);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("ipv4InterfaceTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ipv4InterfaceTable_container_init\n");
+ return;
+ }
+
+} /* _ipv4InterfaceTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ipv4InterfaceTable_container_shutdown(ipv4InterfaceTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_ipv4InterfaceTable_container_shutdown", "called\n"));
+
+ ipv4InterfaceTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ipv4InterfaceTable_container_shutdown */
+
+
+ipv4InterfaceTable_rowreq_ctx *
+ipv4InterfaceTable_row_find_by_mib_index(ipv4InterfaceTable_mib_index *
+ mib_idx)
+{
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = ifTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(ipv4InterfaceTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.h
new file mode 100644
index 0000000000..cdded1a4d4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.h
@@ -0,0 +1,106 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipv4InterfaceTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef IPV4INTERFACETABLE_INTERFACE_H
+#define IPV4INTERFACETABLE_INTERFACE_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
+#include "ipv4InterfaceTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _ipv4InterfaceTable_initialize_interface
+ (ipv4InterfaceTable_registration * user_ctx, u_long flags);
+ void
+ _ipv4InterfaceTable_shutdown_interface
+ (ipv4InterfaceTable_registration * user_ctx);
+
+ ipv4InterfaceTable_registration
+ * ipv4InterfaceTable_registration_get(void);
+
+ ipv4InterfaceTable_registration
+ * ipv4InterfaceTable_registration_set
+ (ipv4InterfaceTable_registration * newreg);
+
+ netsnmp_container *ipv4InterfaceTable_container_get(void);
+ int ipv4InterfaceTable_container_size(void);
+
+ u_int ipv4InterfaceTable_dirty_get(void);
+ void ipv4InterfaceTable_dirty_set(u_int status);
+
+ ipv4InterfaceTable_rowreq_ctx
+ * ipv4InterfaceTable_allocate_rowreq_ctx(void *);
+ void
+ ipv4InterfaceTable_release_rowreq_ctx
+ (ipv4InterfaceTable_rowreq_ctx * rowreq_ctx);
+
+ int ipv4InterfaceTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ ipv4InterfaceTable_mib_index
+ * mib_idx);
+ int ipv4InterfaceTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ ipv4InterfaceTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ ipv4InterfaceTable_valid_columns_set(netsnmp_column_info *vc);
+
+ /*
+ */
+ void ipv4InterfaceTable_lastChange_set(u_long uptime);
+
+
+#ifdef __cplusplus
+ }
+#endif
+#endif /* IPV4INTERFACETABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c
new file mode 100644
index 0000000000..3c85a548a8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c
@@ -0,0 +1,202 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.7 $ of : subagent.m2c,v $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv4InterfaceTable.h"
+
+#include <signal.h>
+
+static int keep_running;
+
+static RETSIGTYPE
+stop_server(int a)
+{
+ keep_running = 0;
+}
+
+static void
+usage(void)
+{
+ printf
+ ("usage: ipv4InterfaceTable [-D<tokens>] [-f] [-L] [-M] [-H] [LISTENING ADDRESSES]\n"
+ "\t-f Do not fork() from the calling shell.\n"
+ "\t-DTOKEN[,TOKEN,...]\n"
+ "\t\tTurn on debugging output for the given TOKEN(s).\n"
+ "\t\tWithout any tokens specified, it defaults to printing\n"
+ "\t\tall the tokens (which is equivalent to the keyword 'ALL').\n"
+ "\t\tYou might want to try ALL for extremely verbose output.\n"
+ "\t\tNote: You can't put a space between the -D and the TOKENs.\n"
+ "\t-H\tDisplay a list of configuration file directives\n"
+ "\t\tunderstood by the agent and then exit.\n"
+ "\t-M\tRun as a normal SNMP Agent instead of an AgentX sub-agent.\n"
+ "\t-x ADDRESS\tconnect to master agent at ADDRESS (default NETSNMP_AGENTX_SOCKET).\n"
+ "\t-L\tDo not open a log file; print all messages to stderr.\n");
+ exit(0);
+}
+
+int
+main(int argc, char **argv)
+{
+ int agentx_subagent = 1; /* change this if you want to be a SNMP master agent */
+ /*
+ * Defs for arg-handling code: handles setting of policy-related variables
+ */
+ int ch;
+ extern char *optarg;
+ int dont_fork = 0, use_syslog = 0;
+ char *agentx_socket = NULL;
+
+ while ((ch = getopt(argc, argv, "D:fHLMx:")) != EOF)
+ switch (ch) {
+ case 'D':
+ debug_register_tokens(optarg);
+ snmp_set_do_debugging(1);
+ break;
+ case 'f':
+ dont_fork = 1;
+ break;
+ case 'H':
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS, 1);
+ init_agent("ipv4InterfaceTable"); /* register our .conf handlers */
+ init_ipv4InterfaceTable();
+ init_snmp("ipv4InterfaceTable");
+ fprintf(stderr, "Configuration directives understood:\n");
+ read_config_print_usage(" ");
+ exit(0);
+ case 'M':
+ agentx_subagent = 0;
+ break;
+ case 'L':
+ use_syslog = 0; /* use stderr */
+ break;
+ case 'x':
+ agentx_socket = optarg;
+ break;
+ default:
+ fprintf(stderr, "unknown option %c\n", ch);
+ usage();
+ }
+
+ if (optind < argc) {
+ int i;
+ /*
+ * There are optional transport addresses on the command line.
+ */
+ DEBUGMSGTL(("snmpd/main", "optind %d, argc %d\n", optind, argc));
+ for (i = optind; i < argc; i++) {
+ char *c, *astring;
+ if ((c = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS))) {
+ astring = malloc(strlen(c) + 2 + strlen(argv[i]));
+ if (astring == NULL) {
+ fprintf(stderr, "malloc failure processing argv[%d]\n",
+ i);
+ exit(1);
+ }
+ sprintf(astring, "%s,%s", c, argv[i]);
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS, astring);
+ SNMP_FREE(astring);
+ } else {
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS, argv[i]);
+ }
+ }
+ DEBUGMSGTL(("snmpd/main", "port spec: %s\n",
+ netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS)));
+ }
+
+ /*
+ * we're an agentx subagent?
+ */
+ if (agentx_subagent) {
+ /*
+ * make us a agentx client.
+ */
+ netsnmp_enable_subagent();
+ if (NULL != agentx_socket)
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET,
+ agentx_socket);
+ }
+
+ snmp_disable_log();
+ if (use_syslog)
+ snmp_enable_calllog();
+ else
+ snmp_enable_stderrlog();
+
+ /*
+ * daemonize
+ */
+ if (!dont_fork) {
+ int rc = netsnmp_daemonize(1, !use_syslog);
+ if (rc)
+ exit(-1);
+ }
+
+ /*
+ * initialize tcp/ip if necessary
+ */
+ SOCK_STARTUP;
+
+ /*
+ * initialize the agent library
+ */
+ init_agent("ipv4InterfaceTable");
+
+ /*
+ * init ipv4InterfaceTable mib code
+ */
+ init_ipv4InterfaceTable();
+
+ /*
+ * read ipv4InterfaceTable.conf files.
+ */
+ init_snmp("ipv4InterfaceTable");
+
+ /*
+ * If we're going to be a snmp master agent, initial the ports
+ */
+ if (!agentx_subagent)
+ init_master_agent(); /* open the port to listen on (defaults to udp:161) */
+
+ /*
+ * In case we recevie a request to stop (kill -TERM or kill -INT)
+ */
+ keep_running = 1;
+ signal(SIGTERM, stop_server);
+ signal(SIGINT, stop_server);
+
+ /*
+ * you're main loop here...
+ */
+ while (keep_running) {
+ /*
+ * if you use select(), see snmp_select_info() in snmp_api(3)
+ */
+ /*
+ * --- OR ---
+ */
+ agent_check_and_process(1); /* 0 == don't block */
+ }
+
+ /*
+ * at shutdown time
+ */
+ snmp_shutdown("ipv4InterfaceTable");
+ SOCK_CLEANUP;
+ exit(0);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable.h
new file mode 100644
index 0000000000..471eaa0f40
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipv6InterfaceTable/ipv6InterfaceTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c
new file mode 100644
index 0000000000..abc08ada37
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c
@@ -0,0 +1,1418 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipv6InterfaceTable.c 15946 2007-03-12 21:28:23Z dts12 $
+ */
+/** \page MFD helper for ipv6InterfaceTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv6InterfaceTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ipv6InterfaceTable_interface.h"
+
+oid ipv6InterfaceTable_oid[] = { IPV6INTERFACETABLE_OID };
+int ipv6InterfaceTable_oid_size =
+OID_LENGTH(ipv6InterfaceTable_oid);
+
+ipv6InterfaceTable_registration ipv6InterfaceTable_user_context;
+
+void initialize_table_ipv6InterfaceTable(void);
+void shutdown_table_ipv6InterfaceTable(void);
+
+
+/**
+ * Initializes the ipv6InterfaceTable module
+ */
+void
+init_ipv6InterfaceTable(void)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:init_ipv6InterfaceTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform ipv6InterfaceTable one-time module initialization.
+ */
+
+ /*
+ * we depend on the ifTable, so we put our init in with it
+ * to guarantee order of execution.
+ */
+ init_ifTable();
+
+ /*
+ * last changed should be 0 at startup
+ */
+ ipv6InterfaceTable_lastChange_set(0);
+
+} /* init_ipv6InterfaceTable */
+
+/**
+ * Shut-down the ipv6InterfaceTable module (agent is exiting)
+ */
+void
+shutdown_ipv6InterfaceTable(void)
+{
+ if (should_init("ipv6InterfaceTable"))
+ shutdown_table_ipv6InterfaceTable();
+
+}
+
+/**
+ * Initialize the table ipv6InterfaceTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ipv6InterfaceTable(void)
+{
+ ipv6InterfaceTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:initialize_table_ipv6InterfaceTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform ipv6InterfaceTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ipv6InterfaceTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("ipv6InterfaceTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ipv6InterfaceTable_initialize_interface(user_context, flags);
+} /* initialize_table_ipv6InterfaceTable */
+
+/**
+ * Shutdown the table ipv6InterfaceTable
+ */
+void
+shutdown_table_ipv6InterfaceTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipv6InterfaceTable_shutdown_interface
+ (&ipv6InterfaceTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+ipv6InterfaceTable_rowreq_ctx_init(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ipv6InterfaceTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ * @param rowreq_ctx
+ */
+void
+ipv6InterfaceTable_rowreq_ctx_cleanup(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ipv6InterfaceTable rowreq cleanup.
+ */
+} /* ipv6InterfaceTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ * @param user_context
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ipv6InterfaceTable_pre_request(ipv6InterfaceTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform ipv6InterfaceTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+ipv6InterfaceTable_post_request(ipv6InterfaceTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform ipv6InterfaceTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (ipv6InterfaceTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ ipv6InterfaceTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ipv6InterfaceTable data context functions.
+ */
+
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceReasmMaxSize
+ * ipv6InterfaceReasmMaxSize is subid 2 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.30.1.2
+ * Description:
+The size of the largest IPv6 datagram which this entity can
+ re-assemble from incoming IPv6 fragmented datagrams received
+ on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 1500 - 65535;
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipv6InterfaceReasmMaxSize data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceReasmMaxSize_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv6InterfaceReasmMaxSize_get(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6InterfaceReasmMaxSize_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6InterfaceReasmMaxSize_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceReasmMaxSize_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (!
+ (rowreq_ctx->data.ifentry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX))
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6InterfaceReasmMaxSize data.
+ * copy (* ipv6InterfaceReasmMaxSize_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6InterfaceReasmMaxSize_val_ptr) =
+ rowreq_ctx->data.ipv6InterfaceReasmMaxSize;
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceReasmMaxSize_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceIdentifier
+ * ipv6InterfaceIdentifier is subid 3 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.30.1.3
+ * Description:
+The Interface Identifier for this interface. The Interface
+ Identifier is combined with an address prefix to form an
+ interface address.
+
+
+ By default, the Interface Identifier is auto-configured
+ according to the rules of the link type this interface is
+ attached to.
+
+
+ A zero length identifier may be used where appropriate. One
+ possible example is a loopback interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 2x:
+ *
+ * Ranges: 0 - 8;
+ *
+ * Its syntax is Ipv6AddressIfIdentifierTC (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 8)
+ */
+/**
+ * Extract the current value of the ipv6InterfaceIdentifier data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceIdentifier_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param ipv6InterfaceIdentifier_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by ipv6InterfaceIdentifier.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*ipv6InterfaceIdentifier_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update ipv6InterfaceIdentifier_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+ipv6InterfaceIdentifier_get(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ char **ipv6InterfaceIdentifier_val_ptr_ptr,
+ size_t
+ * ipv6InterfaceIdentifier_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != ipv6InterfaceIdentifier_val_ptr_ptr)
+ && (NULL != *ipv6InterfaceIdentifier_val_ptr_ptr));
+ netsnmp_assert(NULL != ipv6InterfaceIdentifier_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceIdentifier_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (!
+ (rowreq_ctx->data.ifentry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_IFID))
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6InterfaceIdentifier data.
+ * copy (* ipv6InterfaceIdentifier_val_ptr_ptr ) data and (* ipv6InterfaceIdentifier_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for ipv6InterfaceIdentifier data
+ */
+ if ((NULL == (*ipv6InterfaceIdentifier_val_ptr_ptr)) ||
+ ((*ipv6InterfaceIdentifier_val_ptr_len_ptr) <
+ (rowreq_ctx->data.ipv6InterfaceIdentifier_len *
+ sizeof(rowreq_ctx->data.ipv6InterfaceIdentifier[0])))) {
+ /*
+ * allocate space for ipv6InterfaceIdentifier data
+ */
+ (*ipv6InterfaceIdentifier_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.ipv6InterfaceIdentifier_len *
+ sizeof(rowreq_ctx->data.ipv6InterfaceIdentifier[0]));
+ if (NULL == (*ipv6InterfaceIdentifier_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*ipv6InterfaceIdentifier_val_ptr_len_ptr) =
+ rowreq_ctx->data.ipv6InterfaceIdentifier_len *
+ sizeof(rowreq_ctx->data.ipv6InterfaceIdentifier[0]);
+ memcpy((*ipv6InterfaceIdentifier_val_ptr_ptr),
+ rowreq_ctx->data.ipv6InterfaceIdentifier,
+ rowreq_ctx->data.ipv6InterfaceIdentifier_len *
+ sizeof(rowreq_ctx->data.ipv6InterfaceIdentifier[0]));
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceIdentifier_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceEnableStatus
+ * ipv6InterfaceEnableStatus is subid 5 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.4.30.1.5
+ * Description:
+The indication of whether IPv6 is enabled (up) or disabled
+ (down) on this interface. This object does not affect the
+ state of the interface itself, only its connection to an
+ IPv6 stack. The IF-MIB should be used to control the state
+ of the interface.
+
+
+ When this object is written the entity SHOULD save the
+ change to non-volatile storage and restore the object from
+ non-volatile storage upon re-initialization of the system.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: up(1), down(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipv6InterfaceEnableStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceEnableStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv6InterfaceEnableStatus_get(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6InterfaceEnableStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6InterfaceEnableStatus_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceEnableStatus_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6InterfaceEnableStatus data.
+ * copy (* ipv6InterfaceEnableStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6InterfaceEnableStatus_val_ptr) =
+ rowreq_ctx->data.ipv6InterfaceEnableStatus;
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceEnableStatus_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceReachableTime
+ * ipv6InterfaceReachableTime is subid 6 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.30.1.6
+ * Description:
+The time a neighbor is considered reachable after receiving
+ a reachability confirmation.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipv6InterfaceReachableTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceReachableTime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv6InterfaceReachableTime_get(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6InterfaceReachableTime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6InterfaceReachableTime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceReachableTime_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (!
+ (rowreq_ctx->data.ifentry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_REACHABLE))
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6InterfaceReachableTime data.
+ * copy (* ipv6InterfaceReachableTime_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6InterfaceReachableTime_val_ptr) =
+ rowreq_ctx->data.ipv6InterfaceReachableTime;
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceReachableTime_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceRetransmitTime
+ * ipv6InterfaceRetransmitTime is subid 7 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.30.1.7
+ * Description:
+The time between retransmissions of Neighbor Solicitation
+ messages to a neighbor when resolving the address or when
+ probing the reachability of a neighbor.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipv6InterfaceRetransmitTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceRetransmitTime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv6InterfaceRetransmitTime_get(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ ipv6InterfaceRetransmitTime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6InterfaceRetransmitTime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceRetransmitTime_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (!
+ (rowreq_ctx->data.ifentry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_RETRANSMIT))
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6InterfaceRetransmitTime data.
+ * copy (* ipv6InterfaceRetransmitTime_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6InterfaceRetransmitTime_val_ptr) =
+ rowreq_ctx->data.ipv6InterfaceRetransmitTime;
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceRetransmitTime_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceForwarding
+ * ipv6InterfaceForwarding is subid 8 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.4.30.1.8
+ * Description:
+The indication of whether this entity is acting as an IPv6
+ router on this interface with respect to the forwarding of
+ datagrams received by, but not addressed to, this entity.
+ IPv6 routers forward datagrams. IPv6 hosts do not (except
+ those source-routed via the host).
+
+
+
+
+
+ This object is constrained by ipv6IpForwarding and is
+ ignored if ipv6IpForwarding is set to notForwarding. Those
+ systems that do not provide per-interface control of the
+ forwarding function should set this object to forwarding for
+ all interfaces and allow the ipv6IpForwarding object to
+ control the forwarding capability.
+
+
+ When this object is written the entity SHOULD save the
+ change to non-volatile storage and restore the object from
+ non-volatile storage upon re-initialization of the system.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: forwarding(1), notForwarding(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipv6InterfaceForwarding data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceForwarding_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv6InterfaceForwarding_get(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6InterfaceForwarding_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6InterfaceForwarding_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceForwarding_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (!
+ (rowreq_ctx->data.ifentry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_FORWARDING))
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6InterfaceForwarding data.
+ * copy (* ipv6InterfaceForwarding_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6InterfaceForwarding_val_ptr) =
+ rowreq_ctx->data.ipv6InterfaceForwarding;
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceForwarding_get */
+
+
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * ipv6InterfaceTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * ipv6InterfaceTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv6InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ipv6InterfaceTable_undo_setup(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_undo_setup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup ipv6InterfaceTable undo.
+ * set up ipv6InterfaceTable undo information, in preparation for a set.
+ * Undo storage is in (* ipv6InterfaceForwarding_val_ptr )*
+ */
+
+ return rc;
+} /* ipv6InterfaceTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv6InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ipv6InterfaceTable_undo(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> ipv6InterfaceTable undo.
+ * ipv6InterfaceTable undo information, in response to a failed set.
+ * Undo storage is in (* ipv6InterfaceForwarding_val_ptr )*
+ */
+
+ return rc;
+} /* ipv6InterfaceTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv6InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipv6InterfaceTable_undo_cleanup(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup ipv6InterfaceTable undo.
+ * Undo storage is in (* ipv6InterfaceForwarding_val_ptr )*
+ */
+
+ return rc;
+} /* ipv6InterfaceTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipv6InterfaceTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipv6InterfaceTable_commit(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit ipv6InterfaceTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_IPV6INTERFACEENABLESTATUS_FLAG) {
+ save_flags &= ~COLUMN_IPV6INTERFACEENABLESTATUS_FLAG; /* clear ipv6InterfaceEnableStatus */
+ /*
+ * TODO:482:o: |-> commit column ipv6InterfaceEnableStatus.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipv6InterfaceTable column ipv6InterfaceEnableStatus commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipv6InterfaceEnableStatus
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV6INTERFACEENABLESTATUS_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_IPV6INTERFACEFORWARDING_FLAG) {
+ save_flags &= ~COLUMN_IPV6INTERFACEFORWARDING_FLAG; /* clear ipv6InterfaceForwarding */
+ /*
+ * TODO:482:o: |-> commit column ipv6InterfaceForwarding.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipv6InterfaceTable column ipv6InterfaceForwarding commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipv6InterfaceForwarding
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV6INTERFACEFORWARDING_FLAG;
+ }
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* ipv6InterfaceTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipv6InterfaceTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipv6InterfaceTable_undo_commit(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo ipv6InterfaceTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* ipv6InterfaceTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement ipv6InterfaceTable node value checks.
+ * TODO:450:M: Implement ipv6InterfaceTable undo functions.
+ * TODO:460:M: Implement ipv6InterfaceTable set functions.
+ * TODO:480:M: Implement ipv6InterfaceTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceEnableStatus
+ * ipv6InterfaceEnableStatus is subid 5 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.4.30.1.5
+ * Description:
+The indication of whether IPv6 is enabled (up) or disabled
+ (down) on this interface. This object does not affect the
+ state of the interface itself, only its connection to an
+ IPv6 stack. The IF-MIB should be used to control the state
+ of the interface.
+
+
+ When this object is written the entity SHOULD save the
+ change to non-volatile storage and restore the object from
+ non-volatile storage upon re-initialization of the system.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: up(1), down(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceEnableStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipv6InterfaceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of up(1), down(2)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipv6InterfaceEnableStatus_check_value(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipv6InterfaceEnableStatus_val)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceEnableStatus_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipv6InterfaceEnableStatus value.
+ */
+
+ return MFD_SUCCESS; /* ipv6InterfaceEnableStatus value not illegal */
+} /* ipv6InterfaceEnableStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv6InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipv6InterfaceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipv6InterfaceEnableStatus_undo_setup(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceEnableStatus_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipv6InterfaceEnableStatus undo.
+ */
+ /*
+ * copy ipv6InterfaceEnableStatus data
+ * set rowreq_ctx->undo->ipv6InterfaceEnableStatus from rowreq_ctx->data.ipv6InterfaceEnableStatus
+ */
+ rowreq_ctx->undo->ipv6InterfaceEnableStatus =
+ rowreq_ctx->data.ipv6InterfaceEnableStatus;
+
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceEnableStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipv6InterfaceEnableStatus_val
+ * A long containing the new value.
+ */
+int
+ipv6InterfaceEnableStatus_set(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long ipv6InterfaceEnableStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceEnableStatus_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipv6InterfaceEnableStatus value.
+ * set ipv6InterfaceEnableStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.ipv6InterfaceEnableStatus =
+ ipv6InterfaceEnableStatus_val;
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceEnableStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipv6InterfaceEnableStatus_undo(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceEnableStatus_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipv6InterfaceEnableStatus undo.
+ */
+ /*
+ * copy ipv6InterfaceEnableStatus data
+ * set rowreq_ctx->data.ipv6InterfaceEnableStatus from rowreq_ctx->undo->ipv6InterfaceEnableStatus
+ */
+ rowreq_ctx->data.ipv6InterfaceEnableStatus =
+ rowreq_ctx->undo->ipv6InterfaceEnableStatus;
+
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceEnableStatus_undo */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceForwarding
+ * ipv6InterfaceForwarding is subid 8 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.4.30.1.8
+ * Description:
+The indication of whether this entity is acting as an IPv6
+ router on this interface with respect to the forwarding of
+ datagrams received by, but not addressed to, this entity.
+ IPv6 routers forward datagrams. IPv6 hosts do not (except
+ those source-routed via the host).
+
+
+
+
+
+ This object is constrained by ipv6IpForwarding and is
+ ignored if ipv6IpForwarding is set to notForwarding. Those
+ systems that do not provide per-interface control of the
+ forwarding function should set this object to forwarding for
+ all interfaces and allow the ipv6IpForwarding object to
+ control the forwarding capability.
+
+
+ When this object is written the entity SHOULD save the
+ change to non-volatile storage and restore the object from
+ non-volatile storage upon re-initialization of the system.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: forwarding(1), notForwarding(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceForwarding_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipv6InterfaceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of forwarding(1), notForwarding(2)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipv6InterfaceForwarding_check_value(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipv6InterfaceForwarding_val)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceForwarding_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipv6InterfaceForwarding value.
+ */
+
+ return MFD_SUCCESS; /* ipv6InterfaceForwarding value not illegal */
+} /* ipv6InterfaceForwarding_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv6InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipv6InterfaceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipv6InterfaceForwarding_undo_setup(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceForwarding_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipv6InterfaceForwarding undo.
+ */
+ /*
+ * copy ipv6InterfaceForwarding data
+ * set rowreq_ctx->undo->ipv6InterfaceForwarding from rowreq_ctx->data.ipv6InterfaceForwarding
+ */
+ rowreq_ctx->undo->ipv6InterfaceForwarding =
+ rowreq_ctx->data.ipv6InterfaceForwarding;
+
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceForwarding_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipv6InterfaceForwarding_val
+ * A long containing the new value.
+ */
+int
+ipv6InterfaceForwarding_set(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long ipv6InterfaceForwarding_val)
+{
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceForwarding_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipv6InterfaceForwarding value.
+ * set ipv6InterfaceForwarding value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.ipv6InterfaceForwarding = ipv6InterfaceForwarding_val;
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceForwarding_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipv6InterfaceForwarding_undo(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceForwarding_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipv6InterfaceForwarding undo.
+ */
+ /*
+ * copy ipv6InterfaceForwarding data
+ * set rowreq_ctx->data.ipv6InterfaceForwarding from rowreq_ctx->undo->ipv6InterfaceForwarding
+ */
+ rowreq_ctx->data.ipv6InterfaceForwarding =
+ rowreq_ctx->undo->ipv6InterfaceForwarding;
+
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceForwarding_undo */
+
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h
new file mode 100644
index 0000000000..3b2ef5cc17
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h
@@ -0,0 +1,970 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipv6InterfaceTable.h 15205 2006-09-14 17:15:32Z rstory $
+ */
+#ifndef IPV6INTERFACETABLE_H
+#define IPV6INTERFACETABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "if-mib/ifTable/ifTable.h"
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(if-mib/ifTable/ifTable)
+config_require(ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface)
+config_require(ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for ipv6InterfaceTable
+ */
+#include "ipv6InterfaceTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ipv6InterfaceTable(void);
+ void shutdown_ipv6InterfaceTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ *
+ * we share data structures (data too, in fact) with ifTable
+ */
+ typedef ifTable_registration ipv6InterfaceTable_registration;
+ typedef ifTable_data ipv6InterfaceTable_data;
+ typedef ifTable_undo_data ipv6InterfaceTable_undo_data;
+ typedef ifTable_mib_index ipv6InterfaceTable_mib_index;
+ typedef ifTable_rowreq_ctx ipv6InterfaceTable_rowreq_ctx;
+
+ /*
+ * ipv6InterfaceReasmMaxSize(2)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/R/d/h
+ */
+#define ipv6InterfaceReasmMaxSize ifentry->reasm_max_v6
+
+ /*
+ * ipv6InterfaceIdentifier(3)/Ipv6AddressIfIdentifierTC/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+
+#define ipv6InterfaceIdentifier ifentry->v6_if_id
+#define ipv6InterfaceIdentifier_len ifentry->v6_if_id_len
+
+ /*
+ * ipv6InterfaceEnableStatus(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+#define ipv6InterfaceEnableStatus ifentry->admin_status
+
+ /*
+ * ipv6InterfaceReachableTime(6)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+#define ipv6InterfaceReachableTime ifentry->reachable_time
+
+ /*
+ * ipv6InterfaceRetransmitTime(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+#define ipv6InterfaceRetransmitTime ifentry->retransmit_v6
+
+ /*
+ * ipv6InterfaceForwarding(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+#define ipv6InterfaceForwarding ifentry->forwarding_v6
+
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_pre_request(ipv6InterfaceTable_registration *
+ user_context);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_post_request(ipv6InterfaceTable_registration *
+ user_context, int rc);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_rowreq_ctx_init(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ void *user_init_ctx);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_rowreq_ctx_cleanup(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int ipv6InterfaceTable_commit(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+
+
+
+
+
+ ipv6InterfaceTable_rowreq_ctx
+ * ipv6InterfaceTable_row_find_by_mib_index
+ (ipv6InterfaceTable_mib_index * mib_idx);
+
+ extern oid ipv6InterfaceTable_oid[];
+ extern int ipv6InterfaceTable_oid_size;
+
+
+#include "ipv6InterfaceTable_interface.h"
+#include "ipv6InterfaceTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ */
+ /*
+ * indexes
+ */
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReasmMaxSize_get(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv6InterfaceReasmMaxSize_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceIdentifier_get(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx, char
+ **ipv6InterfaceIdentifier_val_ptr_ptr,
+ size_t
+ *
+ ipv6InterfaceIdentifier_val_ptr_len_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceEnableStatus_get(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv6InterfaceEnableStatus_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReachableTime_get(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv6InterfaceReachableTime_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceRetransmitTime_get(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv6InterfaceRetransmitTime_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceForwarding_get(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv6InterfaceForwarding_val_ptr);
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_indexes_set_tbl_idx(ipv6InterfaceTable_mib_index
+ * tbl_idx, long
+ ipv6InterfaceIfIndex_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_indexes_set(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipv6InterfaceIfIndex_val);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ */
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_undo_setup(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_undo_cleanup(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipv6InterfaceTable_undo(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipv6InterfaceTable_commit(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_undo_commit(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReasmMaxSize_check_value(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ ipv6InterfaceReasmMaxSize_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReasmMaxSize_undo_setup(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReasmMaxSize_set(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipv6InterfaceReasmMaxSize_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReasmMaxSize_undo(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceIdentifier_check_value(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx, char
+ *ipv6InterfaceIdentifier_val_ptr,
+ size_t
+ ipv6InterfaceIdentifier_val_ptr_len);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceIdentifier_undo_setup(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceIdentifier_set(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ char *ipv6InterfaceIdentifier_val_ptr,
+ size_t
+ ipv6InterfaceIdentifier_val_ptr_len);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceIdentifier_undo(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceEnableStatus_check_value(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ ipv6InterfaceEnableStatus_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceEnableStatus_undo_setup(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceEnableStatus_set(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipv6InterfaceEnableStatus_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceEnableStatus_undo(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReachableTime_check_value
+ (ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long ipv6InterfaceReachableTime_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReachableTime_undo_setup(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReachableTime_set(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipv6InterfaceReachableTime_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReachableTime_undo(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceRetransmitTime_check_value
+ (ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long ipv6InterfaceRetransmitTime_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceRetransmitTime_undo_setup
+ (ipv6InterfaceTable_rowreq_ctx * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceRetransmitTime_set(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipv6InterfaceRetransmitTime_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceRetransmitTime_undo(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceForwarding_check_value(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipv6InterfaceForwarding_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceForwarding_undo_setup(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceForwarding_set(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipv6InterfaceForwarding_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceForwarding_undo(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_check_dependencies(ipv6InterfaceTable_rowreq_ctx
+ * ctx);
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV6INTERFACETABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_constants.h
new file mode 100644
index 0000000000..bee70bdbad
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_constants.h
@@ -0,0 +1,104 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: ipv6InterfaceTable_constants.h 13897 2005-12-10 01:56:01Z rstory $
+ */
+#ifndef IPV6INTERFACETABLE_CONSTANTS_H
+#define IPV6INTERFACETABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ipv6InterfaceTable
+ */
+#define IPV6INTERFACETABLELASTCHANGE_OID 1,3,6,1,2,1,4,29
+#define IPV6INTERFACETABLE_OID 1,3,6,1,2,1,4,30
+
+#define COLUMN_IPV6INTERFACEIFINDEX 1
+
+#define COLUMN_IPV6INTERFACEREASMMAXSIZE 2
+
+#define COLUMN_IPV6INTERFACEIDENTIFIER 3
+
+#define COLUMN_IPV6INTERFACEENABLESTATUS 5
+#define COLUMN_IPV6INTERFACEENABLESTATUS_FLAG (0x1 << 4)
+
+#define COLUMN_IPV6INTERFACEREACHABLETIME 6
+
+#define COLUMN_IPV6INTERFACERETRANSMITTIME 7
+
+#define COLUMN_IPV6INTERFACEFORWARDING 8
+#define COLUMN_IPV6INTERFACEFORWARDING_FLAG (0x1 << 7)
+
+
+#define IPV6INTERFACETABLE_MIN_COL COLUMN_IPV6INTERFACEREASMMAXSIZE
+#define IPV6INTERFACETABLE_MAX_COL COLUMN_IPV6INTERFACEFORWARDING
+
+
+ /*
+ * TODO:405:r: Review IPV6INTERFACETABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define IPV6INTERFACETABLE_SETTABLE_COLS (COLUMN_IPV6INTERFACEENABLESTATUS_FLAG | COLUMN_IPV6INTERFACEFORWARDING_FLAG)
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table ipv6InterfaceTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipv6InterfaceEnableStatus (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPV6INTERFACEENABLESTATUS_ENUMS
+#define IPV6INTERFACEENABLESTATUS_ENUMS
+
+#define IPV6INTERFACEENABLESTATUS_UP 1
+#define IPV6INTERFACEENABLESTATUS_DOWN 2
+
+#endif /* IPV6INTERFACEENABLESTATUS_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipv6InterfaceForwarding (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPV6INTERFACEFORWARDING_ENUMS
+#define IPV6INTERFACEFORWARDING_ENUMS
+
+#define IPV6INTERFACEFORWARDING_FORWARDING 1
+#define IPV6INTERFACEFORWARDING_NOTFORWARDING 2
+
+#endif /* IPV6INTERFACEFORWARDING_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV6INTERFACETABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.c
new file mode 100644
index 0000000000..cf4568e94d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.c
@@ -0,0 +1,390 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipv6InterfaceTable_data_access.c 15205 2006-09-14 17:15:32Z rstory $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv6InterfaceTable.h"
+
+
+#include "ipv6InterfaceTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ */
+
+/**
+ * initialization for ipv6InterfaceTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ipv6InterfaceTable_reg
+ * Pointer to ipv6InterfaceTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ipv6InterfaceTable_init_data(ipv6InterfaceTable_registration *
+ ipv6InterfaceTable_reg)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize ipv6InterfaceTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+ipv6InterfaceTable_container_init(netsnmp_container **container_ptr_ptr)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ipv6InterfaceTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+} /* ipv6InterfaceTable_container_init */
+
+/**
+ * @internal
+ * determine if we want a ifTable row in our container
+ */
+void
+ipv6InterfaceTable_check_entry_for_updates(const ifTable_rowreq_ctx *
+ ift_rrc,
+ netsnmp_interface_entry *entry)
+{
+ netsnmp_container *c = ipv6InterfaceTable_container_get();
+ ifTable_rowreq_ctx *ip6if_rrc;
+ int changed = 0;
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:check_entry_for_updates",
+ "called\n"));
+
+ /*
+ * do we have a corresponding row?
+ */
+ ip6if_rrc = CONTAINER_FIND(c, ift_rrc);
+ if (NULL == ip6if_rrc) {
+ /*
+ * no corresponding row. should we have one?
+ */
+ if ((NULL != entry) &&
+ (entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV6)) {
+ /*
+ * yes.
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable:check_entry_for_updates",
+ "inserted row for index %d\n", entry->index));
+ CONTAINER_INSERT(c, ift_rrc);
+ changed = 1;
+ }
+ } else {
+ /*
+ * found corresponding row. is it still applicable?
+ */
+ if ((NULL == entry) ||
+ (0 == (entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV6))) {
+ /*
+ * no
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable:check_entry_for_updates",
+ "removed row for index %d\n",
+ ift_rrc->data.ifentry->index));
+ CONTAINER_REMOVE(c, ift_rrc);
+ changed = 1;
+ } else {
+ /*
+ * still applicable. anything changed?
+ */
+ if (/** retransmit */
+ ((entry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_RETRANSMIT)
+ && (entry->retransmit_v6 !=
+ ift_rrc->data.ifentry->retransmit_v6)) ||
+ /** reasm */
+ ((entry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX)
+ && (entry->reasm_max_v6 !=
+ ift_rrc->data.ifentry->reasm_max_v6)) ||
+ /** reachable time */
+ ((entry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_REACHABLE)
+ && (entry->reachable_time !=
+ ift_rrc->data.ifentry->reachable_time)) ||
+ /** if id */
+ ((entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_IFID)
+ &&
+ ((entry->v6_if_id_len !=
+ ift_rrc->data.ifentry->v6_if_id_len)
+ || (0 !=
+ memcmp(entry->v6_if_id,
+ ift_rrc->data.ifentry->v6_if_id,
+ entry->v6_if_id_len)))) ||
+ /** forwarding */
+ ((entry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_FORWARDING)
+ && (entry->forwarding_v6 !=
+ ift_rrc->data.ifentry->forwarding_v6))) {
+ DEBUGMSGTL(("ipv6InterfaceTable:check_entry_for_updates",
+ "row changed for index %d\n",
+ ift_rrc->data.ifentry->index));
+ changed = 1;
+ }
+ }
+ }
+
+ /*
+ * if something changed, update table last changed
+ */
+ if (changed)
+ ipv6InterfaceTable_lastChange_set(netsnmp_get_agent_uptime());
+}
+
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before ipv6InterfaceTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+ipv6InterfaceTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to ipv6InterfaceTable_container_shutdown\n");
+ return;
+ }
+
+} /* ipv6InterfaceTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ipv6InterfaceTable data load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * ipv6InterfaceTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+ipv6InterfaceTable_container_load(netsnmp_container *container)
+{
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * ipv6InterfaceIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ long ipv6InterfaceIfIndex;
+
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the ipv6InterfaceTable container.
+ * loop over your ipv6InterfaceTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ while (1) {
+ /*
+ * check for end of data; bail out if there is no more data
+ */
+ if (1)
+ break;
+
+ /*
+ * TODO:352:M: | |-> set indexes in new ipv6InterfaceTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = ipv6InterfaceTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ ipv6InterfaceTable_indexes_set(rowreq_ctx,
+ ipv6InterfaceIfIndex)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "ipv6InterfaceTable data.\n");
+ ipv6InterfaceTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate ipv6InterfaceTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * non-TRANSIENT data: no need to copy. set pointer to data
+ */
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+ipv6InterfaceTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free ipv6InterfaceTable container data.
+ */
+} /* ipv6InterfaceTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+ipv6InterfaceTable_row_prep(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.h
new file mode 100644
index 0000000000..4ff94dc18b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.h
@@ -0,0 +1,92 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipv6InterfaceTable_data_access.h 13770 2005-12-01 20:54:19Z rstory $
+ */
+#ifndef IPV6INTERFACETABLE_DATA_ACCESS_H
+#define IPV6INTERFACETABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ */
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_init_data(ipv6InterfaceTable_registration *
+ ipv6InterfaceTable_reg);
+
+
+ void ipv6InterfaceTable_container_init(netsnmp_container
+ **container_ptr_ptr);
+ void ipv6InterfaceTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int ipv6InterfaceTable_container_load(netsnmp_container
+ *container);
+ void ipv6InterfaceTable_container_free(netsnmp_container
+ *container);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_row_prep(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV6INTERFACETABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c
new file mode 100644
index 0000000000..41a95f80df
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c
@@ -0,0 +1,1390 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipv6InterfaceTable_interface.c 15902 2007-02-27 13:36:15Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv6InterfaceTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ipv6InterfaceTable_interface.h"
+
+#include "if-mib/ifTable/ifTable.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ */
+typedef struct ipv6InterfaceTable_interface_ctx_s {
+
+ netsnmp_container *container;
+
+ ipv6InterfaceTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_long last_changed;
+
+} ipv6InterfaceTable_interface_ctx;
+
+static ipv6InterfaceTable_interface_ctx ipv6InterfaceTable_if_ctx;
+
+static void
+ _ipv6InterfaceTable_container_init(ipv6InterfaceTable_interface_ctx *
+ if_ctx);
+static void
+ _ipv6InterfaceTable_container_shutdown(ipv6InterfaceTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+ipv6InterfaceTable_container_get(void)
+{
+ return ipv6InterfaceTable_if_ctx.container;
+}
+
+ipv6InterfaceTable_registration *
+ipv6InterfaceTable_registration_get(void)
+{
+ return ipv6InterfaceTable_if_ctx.user_ctx;
+}
+
+ipv6InterfaceTable_registration *
+ipv6InterfaceTable_registration_set(ipv6InterfaceTable_registration *
+ newreg)
+{
+ ipv6InterfaceTable_registration *old =
+ ipv6InterfaceTable_if_ctx.user_ctx;
+ ipv6InterfaceTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+ipv6InterfaceTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipv6InterfaceTable_if_ctx.container);
+}
+
+u_int
+ipv6InterfaceTable_dirty_get(void)
+{
+ return ifTable_dirty_get();
+}
+
+void
+ipv6InterfaceTable_dirty_set(u_int status)
+{
+ ifTable_dirty_set(status);
+}
+
+/*
+ * ipv6InterfaceTableLastChanged, which is the last time that a row in
+ * the table was changed or the last time a row was added/deleted from the
+ * table.
+ */
+void
+ipv6InterfaceTable_lastChange_set(u_long table_changed)
+{
+ DEBUGMSGTL(("ipv6InterfaceTable:lastChanged_set",
+ "called. was %ld, now %ld\n",
+ ipv6InterfaceTable_if_ctx.last_changed, table_changed));
+ ipv6InterfaceTable_if_ctx.last_changed = table_changed;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_post_request;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_get_values;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_check_objects;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_set_values;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_undo_values;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_commit;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+ _ipv6InterfaceTable_undo_column(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list *
+ var, int column);
+
+/**
+ * @internal
+ * Initialize the table ipv6InterfaceTable
+ * (Define its contents and how it's structured)
+ */
+void
+_ipv6InterfaceTable_initialize_interface(ipv6InterfaceTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ipv6InterfaceTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &ipv6InterfaceTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_ipv6InterfaceTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ipv6InterfaceTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ipv6InterfaceIfIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = IPV6INTERFACETABLE_MIN_COL;
+ tbl_info->max_column = IPV6INTERFACETABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ipv6InterfaceTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ipv6InterfaceTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ipv6InterfaceTable_container_init(&ipv6InterfaceTable_if_ctx);
+ if (NULL == ipv6InterfaceTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for ipv6InterfaceTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_ipv6InterfaceTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ipv6InterfaceTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_ipv6InterfaceTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_ipv6InterfaceTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_ipv6InterfaceTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_ipv6InterfaceTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_ipv6InterfaceTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_ipv6InterfaceTable_set_values;
+ access_multiplexer->undo_sets = _mfd_ipv6InterfaceTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_ipv6InterfaceTable_commit;
+ access_multiplexer->undo_commit = _mfd_ipv6InterfaceTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_ipv6InterfaceTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable:init_ipv6InterfaceTable",
+ "Registering ipv6InterfaceTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ipv6InterfaceTable", handler,
+ ipv6InterfaceTable_oid,
+ ipv6InterfaceTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table ipv6InterfaceTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ipv6InterfaceTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ ipv6InterfaceTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+ /*
+ * register LastChanged
+ */
+ {
+ oid lc_oid[] = { IPV6INTERFACETABLELASTCHANGE_OID };
+ netsnmp_register_watched_scalar(netsnmp_create_handler_registration
+ ("ipv6TableLastChanged", NULL,
+ lc_oid, OID_LENGTH(lc_oid),
+ HANDLER_CAN_RONLY),
+ netsnmp_create_watcher_info((void
+ *)
+ &ipv6InterfaceTable_if_ctx.
+ last_changed,
+ sizeof
+ (u_long),
+ ASN_TIMETICKS,
+ WATCHER_FIXED_SIZE));
+ }
+} /* _ipv6InterfaceTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ipv6InterfaceTable
+ */
+void
+_ipv6InterfaceTable_shutdown_interface(ipv6InterfaceTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ipv6InterfaceTable_container_shutdown(&ipv6InterfaceTable_if_ctx);
+}
+
+void
+ipv6InterfaceTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ipv6InterfaceTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ipv6InterfaceTable_valid_columns_set */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv6InterfaceTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipv6InterfaceTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ipv6InterfaceTable_pre_request(ipv6InterfaceTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable", "error %d from "
+ "ipv6InterfaceTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv6InterfaceTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_post_request", "called\n"));
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipv6InterfaceTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && ipv6InterfaceTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "ipv6InterfaceTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = ipv6InterfaceTable_post_request(ipv6InterfaceTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable", "error %d from "
+ "ipv6InterfaceTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv6InterfaceTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * ipv6InterfaceTable_interface_ctx *if_ctx =
+ * (ipv6InterfaceTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ ipv6InterfaceTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ipv6InterfaceTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv6InterfaceTable_get_column(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv6InterfaceReasmMaxSize(2)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_IPV6INTERFACEREASMMAXSIZE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6InterfaceReasmMaxSize_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6InterfaceIdentifier(3)/Ipv6AddressIfIdentifierTC/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ case COLUMN_IPV6INTERFACEIDENTIFIER:
+ var->type = ASN_OCTET_STR;
+ rc = ipv6InterfaceIdentifier_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * ipv6InterfaceEnableStatus(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEENABLESTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipv6InterfaceEnableStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6InterfaceReachableTime(6)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEREACHABLETIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6InterfaceReachableTime_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6InterfaceRetransmitTime(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPV6INTERFACERETRANSMITTIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6InterfaceRetransmitTime_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6InterfaceForwarding(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEFORWARDING:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipv6InterfaceForwarding_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ if (COLUMN_IPV6INTERFACEREASMMAXSIZE <= column && column <= COLUMN_IPV6INTERFACEFORWARDING) {
+ DEBUGMSGTL(("internal:${context}:_ipv6InterfaceTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv6InterfaceTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _ipv6InterfaceTable_get_column */
+
+int
+_mfd_ipv6InterfaceTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv6InterfaceTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv6InterfaceTable_check_column(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_ipv6InterfaceTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) ipv6InterfaceIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ case COLUMN_IPV6INTERFACEIFINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * ipv6InterfaceReasmMaxSize(2)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_IPV6INTERFACEREASMMAXSIZE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipv6InterfaceIdentifier(3)/Ipv6AddressIfIdentifierTC/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ case COLUMN_IPV6INTERFACEIDENTIFIER:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipv6InterfaceEnableStatus(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEENABLESTATUS:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ ipv6InterfaceEnableStatus));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != IPV6INTERFACEENABLESTATUS_UP)
+ && (*var->val.integer != IPV6INTERFACEENABLESTATUS_DOWN)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv6InterfaceTable:_ipv6InterfaceTable_check_column:ipv6InterfaceEnableStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipv6InterfaceEnableStatus_check_value(rowreq_ctx,
+ *((u_long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipv6InterfaceEnableStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipv6InterfaceReachableTime(6)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEREACHABLETIME:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipv6InterfaceRetransmitTime(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPV6INTERFACERETRANSMITTIME:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipv6InterfaceForwarding(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEFORWARDING:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ ipv6InterfaceForwarding));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != IPV6INTERFACEFORWARDING_FORWARDING)
+ && (*var->val.integer != IPV6INTERFACEFORWARDING_NOTFORWARDING)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv6InterfaceTable:_ipv6InterfaceTable_check_column:ipv6InterfaceForwarding", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipv6InterfaceForwarding_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipv6InterfaceForwarding_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv6InterfaceTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _ipv6InterfaceTable_check_column */
+
+int
+_mfd_ipv6InterfaceTable_check_objects(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv6InterfaceTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv6InterfaceTable_undo_setup_column(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_ipv6InterfaceTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv6InterfaceEnableStatus(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEENABLESTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV6INTERFACEENABLESTATUS_FLAG;
+ rc = ipv6InterfaceEnableStatus_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipv6InterfaceForwarding(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEFORWARDING:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV6INTERFACEFORWARDING_FLAG;
+ rc = ipv6InterfaceForwarding_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv6InterfaceTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipv6InterfaceTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ipv6InterfaceTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rc = _mfd_ifTable_undo_setup_allocate(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ netsnmp_request_set_error_all(requests,rc);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rc = ipv6InterfaceTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv6InterfaceTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ipv6InterfaceTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = ipv6InterfaceTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ _mfd_ifTable_undo_setup_release(rowreq_ctx);
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv6InterfaceTable_set_column(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_ipv6InterfaceTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv6InterfaceEnableStatus(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEENABLESTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV6INTERFACEENABLESTATUS_FLAG;
+ rc = ipv6InterfaceEnableStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * ipv6InterfaceForwarding(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEFORWARDING:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV6INTERFACEFORWARDING_FLAG;
+ rc = ipv6InterfaceForwarding_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv6InterfaceTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _ipv6InterfaceTable_set_column */
+
+int
+_mfd_ipv6InterfaceTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv6InterfaceTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_ipv6InterfaceTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipv6InterfaceTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ ipv6InterfaceTable_dirty_set(ipv6InterfaceTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_ipv6InterfaceTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = ipv6InterfaceTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ ipv6InterfaceTable_dirty_set(d - 1);
+ }
+
+ rc = ipv6InterfaceTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "ipv6InterfaceTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv6InterfaceTable_undo_column(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_ipv6InterfaceTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv6InterfaceEnableStatus(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEENABLESTATUS:
+ rc = ipv6InterfaceEnableStatus_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipv6InterfaceForwarding(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEFORWARDING:
+ rc = ipv6InterfaceForwarding_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv6InterfaceTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipv6InterfaceTable_undo_column */
+
+int
+_mfd_ipv6InterfaceTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipv6InterfaceTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv6InterfaceTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_ipv6InterfaceTable_irreversible_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ CONTAINER_REMOVE(ipv6InterfaceTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in ipv6InterfaceTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ipv6InterfaceTable_container_free(container);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_ipv6InterfaceTable_container_init(ipv6InterfaceTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_ipv6InterfaceTable_container_init", "called\n"));
+
+ /*
+ * container init
+ */
+ ipv6InterfaceTable_container_init(&if_ctx->container);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("ipv6InterfaceTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ipv6InterfaceTable_container_init\n");
+ return;
+ }
+
+} /* _ipv6InterfaceTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ipv6InterfaceTable_container_shutdown(ipv6InterfaceTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_ipv6InterfaceTable_container_shutdown", "called\n"));
+
+ ipv6InterfaceTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ipv6InterfaceTable_container_shutdown */
+
+
+ipv6InterfaceTable_rowreq_ctx *
+ipv6InterfaceTable_row_find_by_mib_index(ipv6InterfaceTable_mib_index *
+ mib_idx)
+{
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = ifTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(ipv6InterfaceTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.h
new file mode 100644
index 0000000000..1e91466363
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.h
@@ -0,0 +1,178 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipv6InterfaceTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef IPV6INTERFACETABLE_INTERFACE_H
+#define IPV6INTERFACETABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ipv6InterfaceTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _ipv6InterfaceTable_initialize_interface
+ (ipv6InterfaceTable_registration * user_ctx, u_long flags);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _ipv6InterfaceTable_shutdown_interface
+ (ipv6InterfaceTable_registration * user_ctx);
+
+
+
+
+
+
+
+ ipv6InterfaceTable_registration
+ * ipv6InterfaceTable_registration_get(void);
+
+
+
+
+
+
+
+ ipv6InterfaceTable_registration
+ * ipv6InterfaceTable_registration_set
+ (ipv6InterfaceTable_registration * newreg);
+
+ netsnmp_container *ipv6InterfaceTable_container_get(void);
+ int ipv6InterfaceTable_container_size(void);
+
+ u_int ipv6InterfaceTable_dirty_get(void);
+ void ipv6InterfaceTable_dirty_set(u_int status);
+
+
+
+
+
+
+
+ ipv6InterfaceTable_rowreq_ctx
+ * ipv6InterfaceTable_allocate_rowreq_ctx(void *);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_release_rowreq_ctx(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int ipv6InterfaceTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ ipv6InterfaceTable_mib_index
+ * mib_idx);
+ int ipv6InterfaceTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ ipv6InterfaceTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_valid_columns_set(netsnmp_column_info *vc);
+
+ /*
+ */
+ void ipv6InterfaceTable_lastChange_set(u_long uptime);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV6INTERFACETABLE_INTERFACE_H */
+/** @} */
+