diff --git a/Add-Default-Router-Table-support.patch b/Add-Default-Router-Table-support.patch deleted file mode 100644 index 0fc58f9..0000000 --- a/Add-Default-Router-Table-support.patch +++ /dev/null @@ -1,3568 +0,0 @@ -From c1b7328c39698ce792f7b5082de9dc079da8b848 Mon Sep 17 00:00:00 2001 -From: Mitsuru Chinen -Date: Mon, 20 Oct 2008 17:22:10 +0900 -Subject: [PATCH] Add Default Router Table support - -From net-snmp patch tracker: -[ 1708243 ] add linux support for ipDefaultRouterTable OID to net-snmp -http://sourceforge.net/tracker/index.php?func=detail&aid=1708243&group_id=12694&atid=312694 - -[ 1724602 ] [Linux] ipDefaultRouterTable improvement -http://sourceforge.net/tracker/index.php?func=detail&aid=1724602&group_id=12694&atid=312694 - -[ 1728223 ] [Linux] add configure check for netlink socket -http://sourceforge.net/tracker/index.php?func=detail&aid=1728223&group_id=12694&atid=312694 - -Signed-off-by: Mitsuru Chinen ---- - agent/mibgroup/ip-mib/data_access/defaultrouter.h | 29 + - .../ip-mib/data_access/defaultrouter_common.c | 291 ++++++ - .../ip-mib/data_access/defaultrouter_linux.c | 322 ++++++ - .../mibgroup/ip-mib/data_access/ipaddress_linux.c | 10 +- - agent/mibgroup/ip-mib/ipDefaultRouterTable.h | 5 + - .../ipDefaultRouterTable/ipDefaultRouterTable.c | 213 ++++ - .../ipDefaultRouterTable/ipDefaultRouterTable.h | 212 ++++ - .../ipDefaultRouterTable_data_access.c | 420 ++++++++ - .../ipDefaultRouterTable_data_access.h | 76 ++ - .../ipDefaultRouterTable_data_get.c | 325 +++++++ - .../ipDefaultRouterTable_data_get.h | 84 ++ - .../ipDefaultRouterTable_enums.h | 93 ++ - .../ipDefaultRouterTable_interface.c | 1018 ++++++++++++++++++++ - .../ipDefaultRouterTable_interface.h | 99 ++ - .../ipDefaultRouterTable_oids.h | 39 + - agent/mibgroup/mibII/var_route.c | 1 + - configure.in | 23 + - include/net-snmp/data_access/defaultrouter.h | 114 +++ - 18 files changed, 3373 insertions(+), 1 deletions(-) - create mode 100644 agent/mibgroup/ip-mib/data_access/defaultrouter.h - create mode 100644 agent/mibgroup/ip-mib/data_access/defaultrouter_common.c - create mode 100644 agent/mibgroup/ip-mib/data_access/defaultrouter_linux.c - create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable.h - create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c - create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h - create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.c - create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h - create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.c - create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.h - create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h - create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c - create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.h - create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oids.h - create mode 100644 include/net-snmp/data_access/defaultrouter.h - -diff --git a/agent/mibgroup/ip-mib/data_access/defaultrouter.h b/agent/mibgroup/ip-mib/data_access/defaultrouter.h -new file mode 100644 -index 0000000..9e7b1ef ---- /dev/null -+++ b/agent/mibgroup/ip-mib/data_access/defaultrouter.h -@@ -0,0 +1,29 @@ -+/* -+ * defaultrouter data access header -+ * -+ * $Id: $ -+ */ -+/**---------------------------------------------------------------------*/ -+/* -+ * 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/defaultrouter_common) -+#if defined( linux ) -+config_require(ip-mib/data_access/defaultrouter_linux) -+#else -+/* -+ * couldn't determine the correct file! -+ * require a bogus file to generate an error. -+ */ -+config_require(ip-mib/data_access/defaultrouter-unknown-arch); -+#endif -diff --git a/agent/mibgroup/ip-mib/data_access/defaultrouter_common.c b/agent/mibgroup/ip-mib/data_access/defaultrouter_common.c -new file mode 100644 -index 0000000..64ca425 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/data_access/defaultrouter_common.c -@@ -0,0 +1,291 @@ -+/* -+ * defaultrouter MIB architecture support -+ * -+ * $Id:$ -+ */ -+#include -+#include -+ -+#include -+#include -+ -+#include "ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h" -+ -+/**---------------------------------------------------------------------*/ -+/* -+ * local static prototypes -+ */ -+static int _access_defaultrouter_entry_compare_addr(const void *lhs, -+ const void *rhs); -+static void _access_defaultrouter_entry_release(netsnmp_defaultrouter_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_defaultrouter_entry_init(netsnmp_defaultrouter_entry *entry); -+ -+extern int -+netsnmp_arch_defaultrouter_container_load(netsnmp_container* container, -+ u_int load_flags); -+ -+/**---------------------------------------------------------------------*/ -+/* -+ * container functions -+ */ -+/** -+ */ -+netsnmp_container * -+netsnmp_access_defaultrouter_container_init(u_int flags) -+{ -+ netsnmp_container *container1; -+ -+ DEBUGMSGTL(("access:defaultrouter:container", "init\n")); -+ -+ /* -+ * create the containers. one indexed by ifIndex, the other -+ * indexed by ifName. -+ */ -+ container1 = netsnmp_container_find("access_defaultrouter:table_container"); -+ if (NULL == container1) { -+ snmp_log(LOG_ERR, "defaultrouter primary container is not found\n"); -+ return NULL; -+ } -+ container1->container_name = strdup("dr_index"); -+ -+ if (flags & NETSNMP_ACCESS_DEFAULTROUTER_INIT_ADDL_IDX_BY_ADDR) { -+ netsnmp_container *container2 = -+ netsnmp_container_find("defaultrouter_addr:access_defaultrouter:table_container"); -+ if (NULL == container2) { -+ snmp_log(LOG_ERR, "defaultrouter secondary container not found\n"); -+ CONTAINER_FREE(container1); -+ return NULL; -+ } -+ -+ container2->compare = _access_defaultrouter_entry_compare_addr; -+ container2->container_name = strdup("dr_addr"); -+ -+ netsnmp_container_add_index(container1, container2); -+ } -+ -+ return container1; -+} -+ -+/** -+ * @retval NULL error -+ * @retval !NULL pointer to container -+ */ -+netsnmp_container* -+netsnmp_access_defaultrouter_container_load(netsnmp_container* container, -+ u_int load_flags) -+{ -+ int rc; -+ u_int container_flags = 0; -+ -+ DEBUGMSGTL(("access:defaultrouter:container", "load\n")); -+ -+ if (NULL == container) { -+ if (load_flags & NETSNMP_ACCESS_DEFAULTROUTER_LOAD_ADDL_IDX_BY_ADDR) { -+ container_flags |= -+ NETSNMP_ACCESS_DEFAULTROUTER_INIT_ADDL_IDX_BY_ADDR; -+ } -+ container = -+ netsnmp_access_defaultrouter_container_init(container_flags); -+ } -+ -+ if (NULL == container) { -+ snmp_log(LOG_ERR, "no container specified/found for access_defaultrouter\n"); -+ return NULL; -+ } -+ -+ rc = netsnmp_arch_defaultrouter_container_load(container, load_flags); -+ if (0 != rc) { -+ netsnmp_access_defaultrouter_container_free(container, -+ NETSNMP_ACCESS_DEFAULTROUTER_FREE_NOFLAGS); -+ container = NULL; -+ } -+ -+ return container; -+} -+ -+void -+netsnmp_access_defaultrouter_container_free(netsnmp_container *container, -+ u_int free_flags) -+{ -+ DEBUGMSGTL(("access:defaultrouter:container", "free\n")); -+ -+ if (NULL == container) { -+ snmp_log(LOG_ERR, -+ "invalid container for netsnmp_access_defaultrouter_free\n"); -+ return; -+ } -+ -+ if(! (free_flags & NETSNMP_ACCESS_DEFAULTROUTER_FREE_DONT_CLEAR)) { -+ /* -+ * free all items. -+ */ -+ CONTAINER_CLEAR(container, -+ (netsnmp_container_obj_func*)_access_defaultrouter_entry_release, -+ NULL); -+ } -+ -+ if(! (free_flags & NETSNMP_ACCESS_DEFAULTROUTER_FREE_KEEP_CONTAINER)) -+ CONTAINER_FREE(container); -+} -+ -+/**---------------------------------------------------------------------*/ -+/* -+ * defaultrouter_entry functions -+ */ -+/** -+ */ -+/** -+ */ -+netsnmp_defaultrouter_entry * -+netsnmp_access_defaultrouter_entry_create(void) -+{ -+ int rc = 0; -+ netsnmp_defaultrouter_entry *entry = -+ SNMP_MALLOC_TYPEDEF(netsnmp_defaultrouter_entry); -+ -+ DEBUGMSGTL(("access:defaultrouter:entry", "create\n")); -+ -+ if(NULL == entry) -+ return NULL; -+ -+ entry->oid_index.len = 1; -+ entry->oid_index.oids = &entry->ns_dr_index; -+ -+ /* -+ * set up defaults -+ */ -+ entry->dr_lifetime = IPDEFAULTROUTERLIFETIME_MAX; -+ entry->dr_preference = IPDEFAULTROUTERPREFERENCE_MEDIUM; -+ -+ rc = netsnmp_arch_defaultrouter_entry_init(entry); -+ if (SNMP_ERR_NOERROR != rc) { -+ DEBUGMSGT(("access:defaultrouter:create","error %d in arch init\n")); -+ netsnmp_access_defaultrouter_entry_free(entry); -+ entry = NULL; -+ } -+ -+ return entry; -+} -+ -+void -+netsnmp_access_defaultrouter_entry_free(netsnmp_defaultrouter_entry * entry) -+{ -+ if (NULL == entry) -+ return; -+ -+ free(entry); -+} -+ -+/** -+ * update an old defaultrouter_entry from a new one -+ * -+ * @note: only mib related items are compared. Internal objects -+ * such as oid_index, ns_dr_index and flags are not compared. -+ * -+ * @retval -1 : error -+ * @retval >=0 : number of fields updated -+ */ -+int -+netsnmp_access_defaultrouter_entry_update(netsnmp_defaultrouter_entry *lhs, -+ netsnmp_defaultrouter_entry *rhs) -+{ -+ int changed = 0; -+ -+ if (lhs->dr_addresstype != rhs->dr_addresstype) { -+ ++changed; -+ lhs->dr_addresstype = rhs->dr_addresstype; -+ } -+ -+ if (lhs->dr_address_len != rhs->dr_address_len) { -+ changed += 2; -+ lhs->dr_address_len = rhs->dr_address_len; -+ memcpy(lhs->dr_address, rhs->dr_address, rhs->dr_address_len); -+ } -+ else if (memcmp(lhs->dr_address, rhs->dr_address, rhs->dr_address_len) != 0) { -+ ++changed; -+ memcpy(lhs->dr_address, rhs->dr_address, rhs->dr_address_len); -+ } -+ -+ if (lhs->dr_if_index != rhs->dr_if_index) { -+ ++changed; -+ lhs->dr_if_index = rhs->dr_if_index; -+ } -+ -+ if (lhs->dr_lifetime != rhs->dr_lifetime) { -+ ++changed; -+ lhs->dr_lifetime = rhs->dr_lifetime; -+ } -+ -+ if (lhs->dr_preference != rhs->dr_preference) { -+ ++changed; -+ lhs->dr_preference = rhs->dr_preference; -+ } -+ -+ return changed; -+} -+ -+/** -+ * copy an defaultrouter_entry -+ * -+ * @retval -1 : error -+ * @retval 0 : no error -+ */ -+int -+netsnmp_access_defaultrouter_entry_copy(netsnmp_defaultrouter_entry *lhs, -+ netsnmp_defaultrouter_entry *rhs) -+{ -+ lhs->dr_addresstype = rhs->dr_addresstype; -+ lhs->dr_address_len = rhs->dr_address_len; -+ memcpy(lhs->dr_address, rhs->dr_address, rhs->dr_address_len); -+ lhs->dr_if_index = rhs->dr_if_index; -+ lhs->dr_lifetime = rhs->dr_lifetime; -+ lhs->dr_preference = rhs->dr_preference; -+ -+ return 0; -+} -+ -+/**---------------------------------------------------------------------*/ -+/* -+ * Utility routines -+ */ -+ -+/** -+ */ -+void -+_access_defaultrouter_entry_release(netsnmp_defaultrouter_entry * entry, void *context) -+{ -+ netsnmp_access_defaultrouter_entry_free(entry); -+} -+ -+static int _access_defaultrouter_entry_compare_addr(const void *lhs, -+ const void *rhs) -+{ -+ const netsnmp_defaultrouter_entry *lh = (const netsnmp_defaultrouter_entry *)lhs; -+ const netsnmp_defaultrouter_entry *rh = (const netsnmp_defaultrouter_entry *)rhs; -+ -+ netsnmp_assert(NULL != lhs); -+ netsnmp_assert(NULL != rhs); -+ -+ /* -+ * compare address length -+ */ -+ if (lh->dr_address_len < rh->dr_address_len) -+ return -1; -+ else if (lh->dr_address_len > rh->dr_address_len) -+ return 1; -+ -+ /* -+ * length equal, compare address -+ */ -+ return memcmp(lh->dr_address, rh->dr_address, lh->dr_address_len); -+} -diff --git a/agent/mibgroup/ip-mib/data_access/defaultrouter_linux.c b/agent/mibgroup/ip-mib/data_access/defaultrouter_linux.c -new file mode 100644 -index 0000000..156e137 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/data_access/defaultrouter_linux.c -@@ -0,0 +1,322 @@ -+/* -+ * Interface MIB architecture support -+ * -+ * $Id:$ -+ */ -+#include -+#include -+ -+#include -+#include -+ -+#include "ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h" -+ -+#include -+#ifdef HAVE_LINUX_RTNETLINK_H -+#include -+#include -+#endif -+#include -+#include -+#include -+#include -+ -+#define RCVBUF_SIZE 32768 -+#define SNDBUF_SIZE 512 -+ -+#ifdef NETSNMP_ENABLE_IPV6 -+#define DR_ADDRSTRLEN INET6_ADDRSTRLEN -+#else -+#define DR_ADDRSTRLEN INET_ADDRSTRLEN -+#endif -+ -+/**---------------------------------------------------------------------*/ -+/* -+ * local static prototypes -+ */ -+static int _load(netsnmp_container *container); -+ -+ -+/* -+ * initialize arch specific storage -+ * -+ * @retval 0: success -+ * @retval <0: error -+ */ -+int -+netsnmp_arch_defaultrouter_entry_init(netsnmp_defaultrouter_entry *entry) -+{ -+ /* -+ * init -+ */ -+ return 0; -+} -+ -+/** -+ * -+ * @retval 0 no errors -+ * @retval !0 errors -+ */ -+int -+netsnmp_arch_defaultrouter_container_load(netsnmp_container *container, -+ u_int load_flags) -+{ -+ int rc = 0; -+ -+ DEBUGMSGTL(("access:defaultrouter:entry:arch", "load (linux)\n")); -+ -+ rc = _load(container); -+ if (rc < 0) { -+ u_int flags = NETSNMP_ACCESS_DEFAULTROUTER_FREE_KEEP_CONTAINER; -+ netsnmp_access_defaultrouter_container_free(container, flags); -+ } -+ -+ return rc; -+} -+ -+/** -+ * -+ * @retval 0 no errors -+ * @retval !0 errors -+ */ -+static int -+_load(netsnmp_container *container) -+{ -+#ifndef HAVE_LINUX_RTNETLINK_H -+ DEBUGMSGTL(("access:defaultrouter", -+ "cannot get default router information" -+ "as netlink socket is not available\n")); -+ return -1; -+#else -+ int rc = 0; -+ int idx_offset = 0; -+ netsnmp_defaultrouter_entry *entry; -+ int nlsk; -+ struct sockaddr_nl addr; -+ unsigned char rcvbuf[RCVBUF_SIZE]; -+ int rcvbuf_size = RCVBUF_SIZE; -+ unsigned char sndbuf[SNDBUF_SIZE]; -+ struct nlmsghdr *hdr; -+ struct rtmsg *rthdr; -+ int count; -+ int end_of_message = 0; -+ long hz = sysconf(_SC_CLK_TCK); -+ -+ netsnmp_assert(NULL != container); -+ -+ /* -+ * Open a netlink socket -+ */ -+ nlsk = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); -+ if (nlsk < 0) { -+ snmp_log(LOG_ERR, "Could not open netlink socket : %s\n", -+ strerror(errno)); -+ return -1; -+ } -+ -+ if (setsockopt(nlsk, SOL_SOCKET, SO_RCVBUF, -+ &rcvbuf_size, sizeof(rcvbuf_size)) < 0) { -+ snmp_log(LOG_ERR, "Could not open netlink socket : %s\n", -+ strerror(errno)); -+ close(nlsk); -+ return -1; -+ } -+ -+ memset(&addr, '\0', sizeof(struct sockaddr_nl)); -+ addr.nl_family = AF_NETLINK; -+ -+ memset(sndbuf, '\0', SNDBUF_SIZE); -+ hdr = (struct nlmsghdr *)sndbuf; -+ hdr->nlmsg_type = RTM_GETROUTE; -+ hdr->nlmsg_pid = getpid(); -+ hdr->nlmsg_seq = 0; -+ hdr->nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST; -+ hdr->nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); -+ rthdr = (struct rtmsg *)NLMSG_DATA(hdr); -+ rthdr->rtm_table = RT_TABLE_MAIN; -+ -+ /* -+ * Send a request to the kernel to dump the routing table to us -+ */ -+ count = sendto(nlsk, sndbuf, hdr->nlmsg_len, 0, -+ (struct sockaddr *)&addr, sizeof(struct sockaddr_nl)); -+ if (count < 0) { -+ snmp_log(LOG_ERR, "unable to send netlink message to kernel : %s\n", -+ strerror(errno)); -+ close(nlsk); -+ return -2; -+ } -+ -+ /* -+ * Now listen for response -+ */ -+ do { -+ struct nlmsghdr *nlmhp; -+ struct rtmsg *rtmp; -+ struct rtattr *rtap; -+ struct rta_cacheinfo *rtci; -+ socklen_t sock_len; -+ int rtcount; -+ -+ memset(rcvbuf, '\0', RCVBUF_SIZE); -+ sock_len = sizeof(struct sockaddr_nl); -+ -+ /* -+ * Get the message -+ */ -+ count = recvfrom(nlsk, rcvbuf, RCVBUF_SIZE, 0, -+ (struct sockaddr *)&addr, &sock_len); -+ if (count < 0) { -+ snmp_log(LOG_ERR, "unable to receive netlink messages: %s\n", -+ strerror(errno)); -+ rc = -1; -+ break; -+ } -+ -+ /* -+ * Walk all of the returned messages -+ */ -+ nlmhp = (struct nlmsghdr *)rcvbuf; -+ while (NLMSG_OK(nlmhp, count)) { -+ u_char addresstype; -+ char address[NETSNMP_ACCESS_DEFAULTROUTER_BUF_SIZE + 1]; -+ size_t address_len = 0; -+ int if_index = -1; -+ u_long lifetime = 0; -+ int preference = -3; -+ -+ /* -+ * Make sure the message is ok -+ */ -+ if (nlmhp->nlmsg_type == NLMSG_ERROR) { -+ snmp_log(LOG_ERR, "kernel produced nlmsg err\n"); -+ rc = -1; -+ break; -+ } -+ -+ /* -+ * End of message, we're done -+ */ -+ if (nlmhp->nlmsg_type & NLMSG_DONE) { -+ end_of_message = 1; -+ break; -+ } -+ -+ /* -+ * Get the pointer to the rtmsg struct -+ */ -+ rtmp = NLMSG_DATA(nlmhp); -+ -+ /* -+ * zero length destination is a default route -+ */ -+ if (rtmp->rtm_dst_len != 0) -+ goto next_nlmsghdr; -+ -+ /* -+ * Start scanning the attributes for needed info -+ */ -+ if (rtmp->rtm_family == AF_INET) { -+ addresstype = INETADDRESSTYPE_IPV4; -+ lifetime = IPDEFAULTROUTERLIFETIME_MAX; /* infinity */ -+ } -+#ifdef NETSNMP_ENABLE_IPV6 -+ else if (rtmp->rtm_family == AF_INET6) { -+ addresstype = INETADDRESSTYPE_IPV6; -+ /* router lifetime for IPv6 is retrieved by RTA_CACHEINFO */ -+ lifetime = 0; -+ } -+#endif -+ else -+ goto next_nlmsghdr; /* skip, we don't care about this route */ -+ -+ preference = 0; /* preference is medium(0) for now */ -+ -+ rtap = RTM_RTA(rtmp); -+ rtcount = RTM_PAYLOAD(nlmhp); -+ while (RTA_OK(rtap, rtcount)) { -+ switch (rtap->rta_type) { -+ case RTA_OIF: -+ if_index = *(int *)(RTA_DATA(rtap)); -+ break; -+ -+ case RTA_GATEWAY: -+ address_len = RTA_PAYLOAD(rtap); -+ memset(address, '\0', sizeof(address)); -+ memcpy(address, RTA_DATA(rtap), address_len); -+ break; -+ -+#ifdef NETSNMP_ENABLE_IPV6 -+ case RTA_CACHEINFO: -+ rtci = RTA_DATA(rtap); -+ if ((rtmp->rtm_flags & RTM_F_CLONED) || -+ (rtci && rtci->rta_expires)) { -+ lifetime = rtci->rta_expires / hz; -+ } -+ break; -+#endif -+ -+ default: -+ break; -+ } /* switch */ -+ -+ rtap = RTA_NEXT(rtap, rtcount); -+ } /* while RTA_OK(rtap) */ -+ -+ -+ if (address_len != 0 && if_index != -1 && -+ lifetime != 0 && preference != -3 ) { -+ DEBUGIF("access:defaultrouter") { -+ char addr_str[DR_ADDRSTRLEN]; -+ memset(addr_str, '\0', DR_ADDRSTRLEN); -+ -+ if (rtmp->rtm_family == AF_INET) -+ inet_ntop(AF_INET, address, addr_str, DR_ADDRSTRLEN); -+#ifdef NETSNMP_ENABLE_IPV6 -+ else -+ inet_ntop(AF_INET6, address, addr_str, DR_ADDRSTRLEN); -+#endif -+ DEBUGMSGTL(("access:defaultrouter", -+ "found default route: %s if_index %d " -+ "lifetime %lu preference %d\n", -+ addr_str, if_index, lifetime, preference)); -+ } -+ -+ entry = netsnmp_access_defaultrouter_entry_create(); -+ if (NULL == entry) { -+ rc = -3; -+ break; -+ } -+ -+ entry->ns_dr_index = ++idx_offset; -+ entry->dr_addresstype = addresstype; -+ entry->dr_address_len = address_len; -+ memcpy(entry->dr_address, address, -+ NETSNMP_ACCESS_DEFAULTROUTER_BUF_SIZE); -+ entry->dr_if_index = if_index; -+ entry->dr_lifetime = lifetime; -+ entry->dr_preference = preference; -+ -+ if (CONTAINER_INSERT(container, entry) < 0) -+ { -+ DEBUGMSGTL(("access:arp:container", -+ "error with defaultrouter_entry: " -+ "insert into container failed.\n")); -+ netsnmp_access_defaultrouter_entry_free(entry); -+ continue; -+ } -+ } -+ -+next_nlmsghdr: -+ nlmhp = NLMSG_NEXT(nlmhp, count); -+ } /* while NLMSG_OK(nlmhp) */ -+ -+ if (rc < 0) -+ break; -+ -+ } while (!end_of_message); -+ -+ close(nlsk); -+ return rc; -+#endif /* HAVE_LINUX_RTNETLINK_H */ -+} -diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c -index ac37578..4616649 100644 ---- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c -+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c -@@ -19,9 +19,11 @@ - #if defined (NETSNMP_ENABLE_IPV6) - #include - #include -+#ifdef HAVE_LINUX_RTNETLINK_H - #include - #include - #endif -+#endif - - #include "ipaddress_ioctl.h" - -@@ -180,6 +182,12 @@ netsnmp_arch_ipaddress_container_load(netsnmp_container *container, - int - _load_v6(netsnmp_container *container, int idx_offset) - { -+#ifndef HAVE_LINUX_RTNETLINK_H -+ DEBUGMSGTL(("access:ipaddress:container", -+ "cannot get ip address information" -+ "as netlink socket is not available\n")); -+ return -1; -+#else - FILE *in; - char line[80], addr[40]; - char if_name[IFNAMSIZ+1];/* +1 for '\0' because of the ugly sscanf below */ -@@ -438,6 +446,6 @@ netsnmp_access_other_info_get(int index, int family) - } - close(sd); - return addr; -+#endif - } - #endif -- -diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable.h b/agent/mibgroup/ip-mib/ipDefaultRouterTable.h -new file mode 100644 -index 0000000..28ed84b ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable.h -@@ -0,0 +1,5 @@ -+/* -+ * module to include the modules -+ */ -+ -+config_require(ip-mib/ipDefaultRouterTable/ipDefaultRouterTable) -diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c -new file mode 100644 -index 0000000..8ce841d ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c -@@ -0,0 +1,213 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+/** \page MFD helper for ipDefaultRouterTable -+ * -+ * \section intro Introduction -+ * Introductory text. -+ * -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "ipDefaultRouterTable.h" -+ -+#include -+ -+#include "ipDefaultRouterTable_interface.h" -+ -+oid ipDefaultRouterTable_oid[] = { IPDEFAULTROUTERTABLE_OID }; -+int ipDefaultRouterTable_oid_size = -+OID_LENGTH(ipDefaultRouterTable_oid); -+ -+ipDefaultRouterTable_registration ipDefaultRouterTable_user_context; -+ -+void initialize_table_ipDefaultRouterTable(void); -+void shutdown_table_ipDefaultRouterTable(void); -+ -+ -+/** -+ * Initializes the ipDefaultRouterTable module -+ */ -+void -+init_ipDefaultRouterTable(void) -+{ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:init_ipDefaultRouterTable", -+ "called\n")); -+ -+ /* -+ * TODO:300:o: Perform ipDefaultRouterTable one-time module initialization. -+ */ -+ -+ /* -+ * here we initialize all the tables we're planning on supporting -+ */ -+ if (should_init("ipDefaultRouterTable")) -+ initialize_table_ipDefaultRouterTable(); -+ -+} /* init_ipDefaultRouterTable */ -+ -+/** -+ * Shut-down the ipDefaultRouterTable module (agent is exiting) -+ */ -+void -+shutdown_ipDefaultRouterTable(void) -+{ -+ if (should_init("ipDefaultRouterTable")) -+ shutdown_table_ipDefaultRouterTable(); -+ -+} -+ -+/** -+ * Initialize the table ipDefaultRouterTable -+ * (Define its contents and how it's structured) -+ */ -+void -+initialize_table_ipDefaultRouterTable(void) -+{ -+ ipDefaultRouterTable_registration *user_context; -+ u_long flags; -+ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:initialize_table_ipDefaultRouterTable", "called\n")); -+ -+ /* -+ * TODO:301:o: Perform ipDefaultRouterTable one-time table initialization. -+ */ -+ -+ /* -+ * TODO:302:o: |->Initialize ipDefaultRouterTable 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("ipDefaultRouterTable", NULL, NULL); -+ -+ /* -+ * No support for any flags yet, but in the future you would -+ * set any flags here. -+ */ -+ flags = 0; -+ -+ /* -+ * call interface initialization code -+ */ -+ _ipDefaultRouterTable_initialize_interface(user_context, flags); -+} /* initialize_table_ipDefaultRouterTable */ -+ -+/** -+ * Shutdown the table ipDefaultRouterTable -+ */ -+void -+shutdown_table_ipDefaultRouterTable(void) -+{ -+ /* -+ * call interface shutdown code -+ */ -+ _ipDefaultRouterTable_shutdown_interface -+ (&ipDefaultRouterTable_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 -+ipDefaultRouterTable_rowreq_ctx_init(ipDefaultRouterTable_rowreq_ctx * -+ rowreq_ctx, void *user_init_ctx) -+{ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_rowreq_ctx_init", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:210:o: |-> Perform extra ipDefaultRouterTable rowreq initialization. (eg DEFVALS) -+ */ -+ -+ return MFD_SUCCESS; -+} /* ipDefaultRouterTable_rowreq_ctx_init */ -+ -+/** -+ * extra context cleanup -+ * -+ */ -+void -+ipDefaultRouterTable_rowreq_ctx_cleanup(ipDefaultRouterTable_rowreq_ctx * -+ rowreq_ctx) -+{ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_rowreq_ctx_cleanup", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:211:o: |-> Perform extra ipDefaultRouterTable rowreq cleanup. -+ */ -+} /* ipDefaultRouterTable_rowreq_ctx_cleanup */ -+ -+/** -+ * pre-request callback -+ * -+ * -+ * @retval MFD_SUCCESS : success. -+ * @retval MFD_ERROR : other error -+ */ -+int -+ipDefaultRouterTable_pre_request(ipDefaultRouterTable_registration * -+ user_context) -+{ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_pre_request", "called\n")); -+ -+ /* -+ * TODO:510:o: Perform ipDefaultRouterTable pre-request actions. -+ */ -+ -+ return MFD_SUCCESS; -+} /* ipDefaultRouterTable_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 -+ipDefaultRouterTable_post_request(ipDefaultRouterTable_registration * -+ user_context, int rc) -+{ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_post_request", "called\n")); -+ -+ /* -+ * TODO:511:o: Perform ipDefaultRouterTable post-request actions. -+ */ -+ -+ return MFD_SUCCESS; -+} /* ipDefaultRouterTable_post_request */ -+ -+ -+/** @{ */ -diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h -new file mode 100644 -index 0000000..1bca12e ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h -@@ -0,0 +1,212 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+#ifndef IPDEFAULTROUTERTABLE_H -+#define IPDEFAULTROUTERTABLE_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+/** @addtogroup misc misc: Miscellaneous routines -+ * -+ * @{ -+ */ -+#include -+#include -+ -+ /* -+ * other required module components -+ */ -+ /* *INDENT-OFF* */ -+config_require(ip-mib/data_access/defaultrouter) -+config_require(ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface) -+config_require(ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access) -+config_require(ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get) -+ /* *INDENT-ON* */ -+ -+ /* -+ * OID and column number definitions for ipDefaultRouterTable -+ */ -+#include "ipDefaultRouterTable_oids.h" -+ -+ /* -+ * enum definions -+ */ -+#include "ipDefaultRouterTable_enums.h" -+ -+ /* -+ ********************************************************************* -+ * function declarations -+ */ -+ void init_ipDefaultRouterTable(void); -+ void shutdown_ipDefaultRouterTable(void); -+ -+ /* -+ ********************************************************************* -+ * Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipDefaultRouterTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * IP-MIB::ipDefaultRouterTable is subid 37 of ip. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.37, 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 ipDefaultRouterTable registration context. -+ */ -+ typedef netsnmp_data_list ipDefaultRouterTable_registration; -+ -+/**********************************************************************/ -+ /* -+ * TODO:110:r: |-> Review ipDefaultRouterTable data context structure. -+ * This structure is used to represent the data for ipDefaultRouterTable. -+ */ -+ typedef netsnmp_defaultrouter_entry ipDefaultRouterTable_data; -+ -+ -+ /* -+ * TODO:120:r: |-> Review ipDefaultRouterTable mib index. -+ * This structure is used to represent the index for ipDefaultRouterTable. -+ */ -+ typedef struct ipDefaultRouterTable_mib_index_s { -+ -+ /* -+ * ipDefaultRouterAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h -+ */ -+ u_long ipDefaultRouterAddressType; -+ -+ /* -+ * ipDefaultRouterAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h -+ */ -+ /** 128 - 2(other indexes) - oid length(10) = 115 */ -+ char ipDefaultRouterAddress[115]; -+ size_t ipDefaultRouterAddress_len; -+ -+ /* -+ * ipDefaultRouterIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ long ipDefaultRouterIfIndex; -+ -+ -+ } ipDefaultRouterTable_mib_index; -+ -+ /* -+ * TODO:121:r: | |-> Review ipDefaultRouterTable 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_ipDefaultRouterTable_IDX_LEN 118 -+ -+ -+ /* -+ ********************************************************************* -+ * TODO:130:o: |-> Review ipDefaultRouterTable Row request (rowreq) context. -+ * When your functions are called, you will be passed a -+ * ipDefaultRouterTable_rowreq_ctx pointer. -+ */ -+ typedef struct ipDefaultRouterTable_rowreq_ctx_s { -+ -+ /** this must be first for container compare to work */ -+ netsnmp_index oid_idx; -+ oid oid_tmp[MAX_ipDefaultRouterTable_IDX_LEN]; -+ -+ ipDefaultRouterTable_mib_index tbl_idx; -+ -+ ipDefaultRouterTable_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 ipDefaultRouterTable rowreq context. -+ */ -+ -+ /* -+ * storage for future expansion -+ */ -+ netsnmp_data_list *ipDefaultRouterTable_data_list; -+ -+ } ipDefaultRouterTable_rowreq_ctx; -+ -+ typedef struct ipDefaultRouterTable_ref_rowreq_ctx_s { -+ ipDefaultRouterTable_rowreq_ctx *rowreq_ctx; -+ } ipDefaultRouterTable_ref_rowreq_ctx; -+ -+ /* -+ ********************************************************************* -+ * function prototypes -+ */ -+ int -+ ipDefaultRouterTable_pre_request(ipDefaultRouterTable_registration -+ * user_context); -+ int -+ ipDefaultRouterTable_post_request(ipDefaultRouterTable_registration -+ * user_context, int rc); -+ -+ int -+ ipDefaultRouterTable_rowreq_ctx_init -+ (ipDefaultRouterTable_rowreq_ctx * rowreq_ctx, -+ void *user_init_ctx); -+ void -+ ipDefaultRouterTable_rowreq_ctx_cleanup -+ (ipDefaultRouterTable_rowreq_ctx * rowreq_ctx); -+ -+ ipDefaultRouterTable_data *ipDefaultRouterTable_allocate_data(void); -+ void -+ ipDefaultRouterTable_release_data(ipDefaultRouterTable_data * -+ data); -+ -+ -+ ipDefaultRouterTable_rowreq_ctx -+ *ipDefaultRouterTable_row_find_by_mib_index -+ (ipDefaultRouterTable_mib_index * mib_idx); -+ -+ extern oid ipDefaultRouterTable_oid[]; -+ extern int ipDefaultRouterTable_oid_size; -+ -+ -+#include "ipDefaultRouterTable_interface.h" -+#include "ipDefaultRouterTable_data_access.h" -+#include "ipDefaultRouterTable_data_get.h" -+ -+ /* -+ * DUMMY markers, ignore -+ * -+ * TODO:099:x: ************************************************************* -+ * TODO:199:x: ************************************************************* -+ * TODO:299:x: ************************************************************* -+ * TODO:399:x: ************************************************************* -+ * TODO:499:x: ************************************************************* -+ */ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPDEFAULTROUTERTABLE_H */ -+/** @} */ -diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.c b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.c -new file mode 100644 -index 0000000..70e1b23 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.c -@@ -0,0 +1,420 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "ipDefaultRouterTable.h" -+ -+ -+#include "ipDefaultRouterTable_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 ipDefaultRouterTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * IP-MIB::ipDefaultRouterTable is subid 37 of ip. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.37, length: 8 -+ */ -+ -+/** -+ * initialization for ipDefaultRouterTable data access -+ * -+ * This function is called during startup to allow you to -+ * allocate any resources you need for the data table. -+ * -+ * @param ipDefaultRouterTable_reg -+ * Pointer to ipDefaultRouterTable_registration -+ * -+ * @retval MFD_SUCCESS : success. -+ * @retval MFD_ERROR : unrecoverable error. -+ */ -+int -+ipDefaultRouterTable_init_data(ipDefaultRouterTable_registration * -+ ipDefaultRouterTable_reg) -+{ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_init_data", "called\n")); -+ -+ /* -+ * TODO:303:o: Initialize ipDefaultRouterTable data. -+ */ -+ -+ return MFD_SUCCESS; -+} /* ipDefaultRouterTable_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 -+ipDefaultRouterTable_container_init(netsnmp_container ** container_ptr_ptr, -+ netsnmp_cache * cache) -+{ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_container_init", "called\n")); -+ -+ if (NULL == container_ptr_ptr) { -+ snmp_log(LOG_ERR, -+ "bad container param to ipDefaultRouterTable_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 ipDefaultRouterTable_container_init\n"); -+ return; -+ } -+ -+ /* -+ * TODO:345:A: Set up ipDefaultRouterTable 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 = IPDEFAULTROUTERTABLE_CACHE_TIMEOUT; /* seconds */ -+} /* ipDefaultRouterTable_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 ipDefaultRouterTable_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 -+ipDefaultRouterTable_container_shutdown(netsnmp_container * container_ptr) -+{ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_container_shutdown", "called\n")); -+ -+ if (NULL == container_ptr) { -+ snmp_log(LOG_ERR, -+ "bad params to ipDefaultRouterTable_container_shutdown\n"); -+ return; -+ } -+ -+} /* ipDefaultRouterTable_container_shutdown */ -+ -+/** -+ * check entry for update -+ */ -+static void -+_check_entry_for_updates(ipDefaultRouterTable_rowreq_ctx * rowreq_ctx, -+ void **magic) -+{ -+ netsnmp_container *defaultrouter_container = magic[0]; -+ netsnmp_container *to_delete = (netsnmp_container *) magic[1]; -+ -+ /* -+ * check for matching entry using secondary index. -+ */ -+ netsnmp_defaultrouter_entry *defaultrouter_entry = -+ CONTAINER_FIND(defaultrouter_container, rowreq_ctx->data); -+ if (NULL == defaultrouter_entry) { -+ DEBUGMSGTL(("ipDefaultRouterTable: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(("ipDefaultRouterTable:access", "updating existing entry\n")); -+ -+ /* -+ * Check for changes & update -+ */ -+ netsnmp_access_defaultrouter_entry_update(rowreq_ctx->data, -+ defaultrouter_entry); -+ -+ /* -+ * remove entry from ifcontainer -+ */ -+ CONTAINER_REMOVE(defaultrouter_container, defaultrouter_entry); -+ netsnmp_access_defaultrouter_entry_free(defaultrouter_entry); -+ } -+} -+ -+/** -+ * add new entry -+ */ -+static void -+_add_new_entry(netsnmp_defaultrouter_entry *defaultrouter_entry, -+ netsnmp_container *container) -+{ -+ ipDefaultRouterTable_rowreq_ctx *rowreq_ctx; -+ -+ DEBUGMSGTL(("ipDefaultRouterTable:access", "creating new entry\n")); -+ -+ netsnmp_assert(NULL != defaultrouter_entry); -+ netsnmp_assert(NULL != container); -+ -+ /* -+ * allocate an row context and set the index(es) -+ */ -+ rowreq_ctx = ipDefaultRouterTable_allocate_rowreq_ctx(defaultrouter_entry, -+ NULL); -+ if ((NULL != rowreq_ctx) && -+ (MFD_SUCCESS == -+ ipDefaultRouterTable_indexes_set(rowreq_ctx, -+ defaultrouter_entry->dr_addresstype, -+ defaultrouter_entry->dr_address, -+ defaultrouter_entry->dr_address_len, -+ defaultrouter_entry->dr_if_index))) { -+ if (CONTAINER_INSERT(container, rowreq_ctx) < 0) { -+ DEBUGMSGTL(("ipAddressTable:access", -+ "container insert failed for new entry\n")); -+ ipDefaultRouterTable_release_rowreq_ctx(rowreq_ctx); -+ return; -+ } -+ } else { -+ if (NULL != rowreq_ctx) { -+ snmp_log(LOG_ERR, "error setting index while loading " -+ "ipDefaultRouterTable cache.\n"); -+ ipDefaultRouterTable_release_rowreq_ctx(rowreq_ctx); -+ } else { -+ snmp_log(LOG_ERR, "memory allocation failed while loading " -+ "ipDefaultRouterTable cache.\n"); -+ netsnmp_access_defaultrouter_entry_free(defaultrouter_entry); -+ } -+ -+ return; -+ } -+} -+ -+/** -+ * load initial data -+ * -+ * TODO:350:M: Implement ipDefaultRouterTable 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 -+ * ipDefaultRouterTable_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 -+ipDefaultRouterTable_container_load(netsnmp_container * container) -+{ -+ netsnmp_container *defaultrouter_container; -+ void *tmp_ptr[2]; -+ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_container_load", "called\n")); -+ -+ /* -+ * TODO:351:M: |-> Load/update data in the ipDefaultRouterTable container. -+ * loop over your ipDefaultRouterTable data, allocate a rowreq context, -+ * set the index(es) [and data, optionally] and insert into -+ * the container. -+ */ -+ defaultrouter_container = -+ netsnmp_access_defaultrouter_container_load(NULL, -+ NETSNMP_ACCESS_DEFAULTROUTER_LOAD_ADDL_IDX_BY_ADDR); -+ -+ if (NULL == defaultrouter_container) -+ return MFD_RESOURCE_UNAVAILABLE; /* msg already logged */ -+ -+ /* -+ * 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] = defaultrouter_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(defaultrouter_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_defaultrouter_container_free(defaultrouter_container, -+ NETSNMP_ACCESS_DEFAULTROUTER_FREE_DONT_CLEAR); -+ -+ /* -+ * remove deleted addresses from table container -+ */ -+ if (NULL != tmp_ptr[1]) { -+ netsnmp_container *tmp_container = -+ (netsnmp_container *) tmp_ptr[1]; -+ ipDefaultRouterTable_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); -+ ipDefaultRouterTable_release_rowreq_ctx(tmp_ctx); -+ -+ /* -+ * pop off delete list -+ */ -+ CONTAINER_REMOVE(tmp_container, NULL); -+ } -+ } -+ -+ DEBUGMSGT(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_container_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 -+ipDefaultRouterTable_container_free(netsnmp_container * container) -+{ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_container_free", "called\n")); -+ -+ /* -+ * TODO:380:M: Free ipDefaultRouterTable container data. -+ */ -+} /* ipDefaultRouterTable_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 -+ipDefaultRouterTable_row_prep(ipDefaultRouterTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_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; -+} /* ipDefaultRouterTable_row_prep */ -+ -+/** @} */ -diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h -new file mode 100644 -index 0000000..ed033f0 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h -@@ -0,0 +1,76 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+#ifndef IPDEFAULTROUTERTABLE_DATA_ACCESS_H -+#define IPDEFAULTROUTERTABLE_DATA_ACCESS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+ /* -+ ********************************************************************* -+ * function declarations -+ */ -+ -+ /* -+ ********************************************************************* -+ * Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipDefaultRouterTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * IP-MIB::ipDefaultRouterTable is subid 37 of ip. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.37, length: 8 -+ */ -+ -+ -+ int -+ ipDefaultRouterTable_init_data(ipDefaultRouterTable_registration * -+ ipDefaultRouterTable_reg); -+ -+ -+ /* -+ * TODO:180:o: Review ipDefaultRouterTable cache timeout. -+ * The number of seconds before the cache times out -+ */ -+#define IPDEFAULTROUTERTABLE_CACHE_TIMEOUT 60 -+ -+ void ipDefaultRouterTable_container_init(netsnmp_container -+ ** -+ container_ptr_ptr, -+ netsnmp_cache * -+ cache); -+ void -+ ipDefaultRouterTable_container_shutdown(netsnmp_container * -+ container_ptr); -+ -+ int ipDefaultRouterTable_container_load(netsnmp_container * -+ container); -+ void ipDefaultRouterTable_container_free(netsnmp_container * -+ container); -+ -+ int ipDefaultRouterTable_cache_load(netsnmp_container * -+ container); -+ void ipDefaultRouterTable_cache_free(netsnmp_container * -+ container); -+ int -+ ipDefaultRouterTable_row_prep(ipDefaultRouterTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPDEFAULTROUTERTABLE_DATA_ACCESS_H */ -diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.c b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.c -new file mode 100644 -index 0000000..1177897 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.c -@@ -0,0 +1,325 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 12088 $ of $ -+ * -+ * $Id:$ -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "ipDefaultRouterTable.h" -+ -+ -+/** @defgroup data_get data_get: Routines to get data -+ * -+ * TODO:230:M: Implement ipDefaultRouterTable get routines. -+ * TODO:240:M: Implement ipDefaultRouterTable mapping routines (if any). -+ * -+ * These routine are used to get the value for individual objects. The -+ * row context is passed, along with a pointer to the memory where the -+ * value should be copied. -+ * -+ * @{ -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipDefaultRouterTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * IP-MIB::ipDefaultRouterTable is subid 37 of ip. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.37, length: 8 -+ */ -+ -+/* -+ * --------------------------------------------------------------------- -+ * * TODO:200:r: Implement ipDefaultRouterTable data context functions. -+ */ -+/* -+ * ipDefaultRouterTable_allocate_data -+ * -+ * Purpose: create new ipDefaultRouterTable_data. -+ */ -+ipDefaultRouterTable_data * -+ipDefaultRouterTable_allocate_data(void) -+{ -+ /* -+ * TODO:201:r: |-> allocate memory for the ipDefaultRouterTable data context. -+ */ -+ ipDefaultRouterTable_data *rtn = -+ netsnmp_access_defaultrouter_entry_create(); -+ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_allocate_data", "called\n")); -+ -+ if (NULL == rtn) { -+ snmp_log(LOG_ERR, "unable to malloc memory for new " -+ "ipDefaultRouterTable_data.\n"); -+ } -+ -+ return rtn; -+} /* ipDefaultRouterTable_allocate_data */ -+ -+/* -+ * ipDefaultRouterTable_release_data -+ * -+ * Purpose: release ipDefaultRouterTable data. -+ */ -+void -+ipDefaultRouterTable_release_data(ipDefaultRouterTable_data * data) -+{ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_release_data", "called\n")); -+ -+ /* -+ * TODO:202:r: |-> release memory for the ipDefaultRouterTable data context. -+ */ -+ netsnmp_access_defaultrouter_entry_free(data); -+} /* ipDefaultRouterTable_release_data */ -+ -+ -+ -+/** -+ * set mib index(es) -+ * -+ * @param tbl_idx mib index structure -+ * @param ipDefaultRouterAddressType_val -+ * @param ipDefaultRouterAddress_ptr -+ * @param ipDefaultRouterAddress_ptr_len -+ * @param ipDefaultRouterIfIndex_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 -+ipDefaultRouterTable_indexes_set_tbl_idx(ipDefaultRouterTable_mib_index * -+ tbl_idx, -+ u_long -+ ipDefaultRouterAddressType_val, -+ char -+ *ipDefaultRouterAddress_val_ptr, -+ size_t -+ ipDefaultRouterAddress_val_ptr_len, -+ long ipDefaultRouterIfIndex_val) -+{ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_indexes_set_tbl_idx", "called\n")); -+ -+ /* -+ * ipDefaultRouterAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h -+ */ -+ /** WARNING: this code might not work for netsnmp_defaultrouter_entry */ -+ tbl_idx->ipDefaultRouterAddressType = ipDefaultRouterAddressType_val; -+ -+ /* -+ * ipDefaultRouterAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h -+ */ -+ tbl_idx->ipDefaultRouterAddress_len = sizeof(tbl_idx->ipDefaultRouterAddress) / sizeof(tbl_idx->ipDefaultRouterAddress[0]); /* max length */ -+ /** WARNING: this code might not work for netsnmp_defaultrouter_entry */ -+ /* -+ * make sure there is enough space for ipDefaultRouterAddress data -+ */ -+ if ((NULL == tbl_idx->ipDefaultRouterAddress) || -+ (tbl_idx->ipDefaultRouterAddress_len < -+ (ipDefaultRouterAddress_val_ptr_len))) { -+ snmp_log(LOG_ERR, "not enough space for value\n"); -+ return MFD_ERROR; -+ } -+ tbl_idx->ipDefaultRouterAddress_len = -+ ipDefaultRouterAddress_val_ptr_len; -+ memcpy(tbl_idx->ipDefaultRouterAddress, ipDefaultRouterAddress_val_ptr, -+ ipDefaultRouterAddress_val_ptr_len * -+ sizeof(ipDefaultRouterAddress_val_ptr[0])); -+ -+ /* -+ * ipDefaultRouterIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ /** WARNING: this code might not work for netsnmp_defaultrouter_entry */ -+ tbl_idx->ipDefaultRouterIfIndex = ipDefaultRouterIfIndex_val; -+ -+ -+ return MFD_SUCCESS; -+} /* ipDefaultRouterTable_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 -+ipDefaultRouterTable_indexes_set(ipDefaultRouterTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long ipDefaultRouterAddressType_val, -+ char *ipDefaultRouterAddress_val_ptr, -+ size_t ipDefaultRouterAddress_val_ptr_len, -+ long ipDefaultRouterIfIndex_val) -+{ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_indexes_set", "called\n")); -+ -+ if (MFD_SUCCESS != -+ ipDefaultRouterTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx, -+ ipDefaultRouterAddressType_val, -+ ipDefaultRouterAddress_val_ptr, -+ ipDefaultRouterAddress_val_ptr_len, -+ ipDefaultRouterIfIndex_val)) -+ return MFD_ERROR; -+ -+ /* -+ * convert mib index to oid index -+ */ -+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid); -+ if (0 != ipDefaultRouterTable_index_to_oid(&rowreq_ctx->oid_idx, -+ &rowreq_ctx->tbl_idx)) { -+ return MFD_ERROR; -+ } -+ -+ return MFD_SUCCESS; -+} /* ipDefaultRouterTable_indexes_set */ -+ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipDefaultRouterEntry.ipDefaultRouterLifetime -+ * ipDefaultRouterLifetime is subid 4 of ipDefaultRouterEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.37.1.4 -+ * Description: -+The remaining length of time, in seconds, that this router -+ will continue to be useful as a default router. A value of -+ zero indicates that it is no longer useful as a default -+ router. It is left to the implementer of the MIB as to -+ whether a router with a lifetime of zero is removed from the -+ list. -+ -+ For IPv6, this value should be extracted from the router -+ advertisement messages. -+ * -+ * 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 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 ipDefaultRouterLifetime data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipDefaultRouterLifetime_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 -+ipDefaultRouterLifetime_get(ipDefaultRouterTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipDefaultRouterLifetime_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipDefaultRouterLifetime_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterLifetime_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipDefaultRouterLifetime data. -+ * copy (* ipDefaultRouterLifetime_val_ptr ) from rowreq_ctx->data -+ */ -+ (*ipDefaultRouterLifetime_val_ptr) = rowreq_ctx->data->dr_lifetime; -+ -+ return MFD_SUCCESS; -+} /* ipDefaultRouterLifetime_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipDefaultRouterEntry.ipDefaultRouterPreference -+ * ipDefaultRouterPreference is subid 5 of ipDefaultRouterEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.37.1.5 -+ * Description: -+An indication of preference given to this router as a -+ default router as described in he Default Router -+ Preferences document. Treating the value as a -+ 2 bit signed integer allows for simple arithmetic -+ comparisons. -+ -+ For IPv4 routers or IPv6 routers that are not using the -+ updated router advertisement format, this object is set to -+ medium (0). -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 1 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 0 -+ * settable 0 -+ * -+ * Enum range: 3/8. Values: reserved(-2), low(-1), medium(0), high(1) -+ * -+ * 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 ipDefaultRouterPreference data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipDefaultRouterPreference_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 -+ipDefaultRouterPreference_get(ipDefaultRouterTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipDefaultRouterPreference_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipDefaultRouterPreference_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterPreference_get", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipDefaultRouterPreference data. -+ * copy (* ipDefaultRouterPreference_val_ptr ) from rowreq_ctx->data -+ */ -+ (*ipDefaultRouterPreference_val_ptr) = rowreq_ctx->data->dr_preference; -+ -+ return MFD_SUCCESS; -+} /* ipDefaultRouterPreference_get */ -+ -+ -+ -+/** @} */ -diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.h b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.h -new file mode 100644 -index 0000000..8698675 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.h -@@ -0,0 +1,84 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 12088 $ of $ -+ * -+ * $Id:$ -+ * -+ * @file ipDefaultRouterTable_data_get.h -+ * -+ * @addtogroup get -+ * -+ * Prototypes for get functions -+ * -+ * @{ -+ */ -+#ifndef IPDEFAULTROUTERTABLE_DATA_GET_H -+#define IPDEFAULTROUTERTABLE_DATA_GET_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ /* -+ ********************************************************************* -+ * GET function declarations -+ */ -+ -+ /* -+ ********************************************************************* -+ * GET Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipDefaultRouterTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * IP-MIB::ipDefaultRouterTable is subid 37 of ip. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.37, length: 8 -+ */ -+ /* -+ * indexes -+ */ -+ -+ int -+ ipDefaultRouterLifetime_get(ipDefaultRouterTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipDefaultRouterLifetime_val_ptr); -+ int -+ ipDefaultRouterPreference_get(ipDefaultRouterTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipDefaultRouterPreference_val_ptr); -+ -+ -+ int -+ ipDefaultRouterTable_indexes_set_tbl_idx -+ (ipDefaultRouterTable_mib_index * tbl_idx, -+ u_long ipDefaultRouterAddressType_val, -+ char *ipDefaultRouterAddress_val_ptr, -+ size_t ipDefaultRouterAddress_val_ptr_len, -+ long ipDefaultRouterIfIndex_val); -+ int -+ ipDefaultRouterTable_indexes_set(ipDefaultRouterTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ ipDefaultRouterAddressType_val, -+ char -+ *ipDefaultRouterAddress_val_ptr, -+ size_t -+ ipDefaultRouterAddress_val_ptr_len, -+ long ipDefaultRouterIfIndex_val); -+ -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPDEFAULTROUTERTABLE_DATA_GET_H */ -+/** @} */ -diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h -new file mode 100644 -index 0000000..bb46d10 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h -@@ -0,0 +1,93 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $ -+ * -+ * $Id:$ -+ */ -+#ifndef IPDEFAULTROUTERTABLE_ENUMS_H -+#define IPDEFAULTROUTERTABLE_ENUMS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ /* -+ * 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 ipDefaultRouterTable -+ * -+ ************************************************************************* -+ *************************************************************************/ -+ -+/************************************************************* -+ * constants for enums for the MIB node -+ * ipDefaultRouterLifetime (UNSIGNED32 / ASN_UNSIGNED) -+ * -+ * since a Textual Convention may be referenced more than once in a -+ * MIB, protect againt redefinitions of the enum values. -+ */ -+#ifndef IPDEFAULTROUTERLIFETIME_ENUMS -+#define IPDEFAULTROUTERLIFETIME_ENUMS -+ -+#define IPDEFAULTROUTERLIFETIME_MIN 0 -+#define IPDEFAULTROUTERLIFETIME_MAX 0xFFFFFFFFUL -+ -+#endif /* IPDEFAULTROUTERLIFETIME_ENUMS */ -+ -+ -+/************************************************************* -+ * constants for enums for the MIB node -+ * ipDefaultRouterAddressType (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 -+ * ipDefaultRouterPreference (INTEGER / ASN_INTEGER) -+ * -+ * since a Textual Convention may be referenced more than once in a -+ * MIB, protect againt redefinitions of the enum values. -+ */ -+#ifndef IPDEFAULTROUTERPREFERENCE_ENUMS -+#define IPDEFAULTROUTERPREFERENCE_ENUMS -+ -+#define IPDEFAULTROUTERPREFERENCE_RESERVED -2 -+#define IPDEFAULTROUTERPREFERENCE_LOW -1 -+#define IPDEFAULTROUTERPREFERENCE_MEDIUM 0 -+#define IPDEFAULTROUTERPREFERENCE_HIGH 1 -+ -+#endif /* IPDEFAULTROUTERPREFERENCE_ENUMS */ -+ -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPDEFAULTROUTERTABLE_ENUMS_H */ -diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c -new file mode 100644 -index 0000000..afe7e57 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c -@@ -0,0 +1,1018 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 15899 $ of $ -+ * -+ * $Id:$ -+ */ -+/* -+ * ********************************************************************* -+ * ********************************************************************* -+ * ********************************************************************* -+ * *** *** -+ * *** 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 -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "ipDefaultRouterTable.h" -+ -+ -+#include -+#include -+ -+#include "ipDefaultRouterTable_interface.h" -+ -+#include -+ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipDefaultRouterTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * IP-MIB::ipDefaultRouterTable is subid 37 of ip. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.37, length: 8 -+ */ -+typedef struct ipDefaultRouterTable_interface_ctx_s { -+ -+ netsnmp_container *container; -+ netsnmp_cache *cache; -+ -+ ipDefaultRouterTable_registration *user_ctx; -+ -+ netsnmp_table_registration_info tbl_info; -+ -+ netsnmp_baby_steps_access_methods access_multiplexer; -+ -+} ipDefaultRouterTable_interface_ctx; -+ -+static ipDefaultRouterTable_interface_ctx ipDefaultRouterTable_if_ctx; -+ -+static void -+_ipDefaultRouterTable_container_init(ipDefaultRouterTable_interface_ctx * -+ if_ctx); -+static void -+_ipDefaultRouterTable_container_shutdown(ipDefaultRouterTable_interface_ctx -+ * if_ctx); -+ -+ -+netsnmp_container * -+ipDefaultRouterTable_container_get(void) -+{ -+ return ipDefaultRouterTable_if_ctx.container; -+} -+ -+ipDefaultRouterTable_registration * -+ipDefaultRouterTable_registration_get(void) -+{ -+ return ipDefaultRouterTable_if_ctx.user_ctx; -+} -+ -+ipDefaultRouterTable_registration * -+ipDefaultRouterTable_registration_set(ipDefaultRouterTable_registration * -+ newreg) -+{ -+ ipDefaultRouterTable_registration *old = -+ ipDefaultRouterTable_if_ctx.user_ctx; -+ ipDefaultRouterTable_if_ctx.user_ctx = newreg; -+ return old; -+} -+ -+int -+ipDefaultRouterTable_container_size(void) -+{ -+ return CONTAINER_SIZE(ipDefaultRouterTable_if_ctx.container); -+} -+ -+/* -+ * mfd multiplexer modes -+ */ -+static Netsnmp_Node_Handler _mfd_ipDefaultRouterTable_pre_request; -+static Netsnmp_Node_Handler _mfd_ipDefaultRouterTable_post_request; -+static Netsnmp_Node_Handler _mfd_ipDefaultRouterTable_object_lookup; -+static Netsnmp_Node_Handler _mfd_ipDefaultRouterTable_get_values; -+/** -+ * @internal -+ * Initialize the table ipDefaultRouterTable -+ * (Define its contents and how it's structured) -+ */ -+void -+_ipDefaultRouterTable_initialize_interface -+ (ipDefaultRouterTable_registration * reg_ptr, u_long flags) -+{ -+ netsnmp_baby_steps_access_methods *access_multiplexer = -+ &ipDefaultRouterTable_if_ctx.access_multiplexer; -+ netsnmp_table_registration_info *tbl_info = -+ &ipDefaultRouterTable_if_ctx.tbl_info; -+ netsnmp_handler_registration *reginfo; -+ netsnmp_mib_handler *handler; -+ int mfd_modes = 0; -+ -+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_ipDefaultRouterTable_initialize_interface", "called\n")); -+ -+ -+ /************************************************* -+ * -+ * save interface context for ipDefaultRouterTable -+ */ -+ /* -+ * Setting up the table's definition -+ */ -+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER, -+ /** index: ipDefaultRouterAddressType */ -+ ASN_OCTET_STR, -+ /** index: ipDefaultRouterAddress */ -+ ASN_INTEGER, -+ /** index: ipDefaultRouterIfIndex */ -+ 0); -+ -+ /* -+ * Define the minimum and maximum accessible columns. This -+ * optimizes retrival. -+ */ -+ tbl_info->min_column = IPDEFAULTROUTERTABLE_MIN_COL; -+ tbl_info->max_column = IPDEFAULTROUTERTABLE_MAX_COL; -+ -+ /* -+ * save users context -+ */ -+ ipDefaultRouterTable_if_ctx.user_ctx = reg_ptr; -+ -+ /* -+ * call data access initialization code -+ */ -+ ipDefaultRouterTable_init_data(reg_ptr); -+ -+ /* -+ * set up the container -+ */ -+ _ipDefaultRouterTable_container_init(&ipDefaultRouterTable_if_ctx); -+ if (NULL == ipDefaultRouterTable_if_ctx.container) { -+ snmp_log(LOG_ERR, -+ "could not initialize container for ipDefaultRouterTable\n"); -+ return; -+ } -+ -+ /* -+ * access_multiplexer: REQUIRED wrapper for get request handling -+ */ -+ access_multiplexer->object_lookup = -+ _mfd_ipDefaultRouterTable_object_lookup; -+ access_multiplexer->get_values = _mfd_ipDefaultRouterTable_get_values; -+ -+ /* -+ * no wrappers yet -+ */ -+ access_multiplexer->pre_request = -+ _mfd_ipDefaultRouterTable_pre_request; -+ access_multiplexer->post_request = -+ _mfd_ipDefaultRouterTable_post_request; -+ -+ -+ /************************************************* -+ * -+ * Create a registration, save our reg data, register table. -+ */ -+ DEBUGMSGTL(("ipDefaultRouterTable:init_ipDefaultRouterTable", -+ "Registering ipDefaultRouterTable as a mibs-for-dummies table.\n")); -+ handler = -+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer); -+ reginfo = -+ netsnmp_handler_registration_create("ipDefaultRouterTable", -+ handler, -+ ipDefaultRouterTable_oid, -+ ipDefaultRouterTable_oid_size, -+ HANDLER_CAN_BABY_STEP | -+ HANDLER_CAN_RONLY); -+ if (NULL == reginfo) { -+ snmp_log(LOG_ERR, -+ "error registering table ipDefaultRouterTable\n"); -+ return; -+ } -+ reginfo->my_reg_void = &ipDefaultRouterTable_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, -+ ipDefaultRouterTable_if_ctx. -+ container, -+ TABLE_CONTAINER_KEY_NETSNMP_INDEX); -+ netsnmp_inject_handler(reginfo, handler); -+ -+ /************************************************* -+ * -+ * inject cache helper -+ */ -+ if (NULL != ipDefaultRouterTable_if_ctx.cache) { -+ handler = -+ netsnmp_cache_handler_get(ipDefaultRouterTable_if_ctx.cache); -+ netsnmp_inject_handler(reginfo, handler); -+ } -+ -+ /* -+ * register table -+ */ -+ netsnmp_register_table(reginfo, tbl_info); -+ -+} /* _ipDefaultRouterTable_initialize_interface */ -+ -+/** -+ * @internal -+ * Shutdown the table ipDefaultRouterTable -+ */ -+void -+_ipDefaultRouterTable_shutdown_interface(ipDefaultRouterTable_registration -+ * reg_ptr) -+{ -+ /* -+ * shutdown the container -+ */ -+ _ipDefaultRouterTable_container_shutdown(&ipDefaultRouterTable_if_ctx); -+} -+ -+void -+ipDefaultRouterTable_valid_columns_set(netsnmp_column_info *vc) -+{ -+ ipDefaultRouterTable_if_ctx.tbl_info.valid_columns = vc; -+} /* ipDefaultRouterTable_valid_columns_set */ -+ -+/** -+ * @internal -+ * convert the index component stored in the context to an oid -+ */ -+int -+ipDefaultRouterTable_index_to_oid(netsnmp_index * oid_idx, -+ ipDefaultRouterTable_mib_index * mib_idx) -+{ -+ int err = SNMP_ERR_NOERROR; -+ -+ /* -+ * temp storage for parsing indexes -+ */ -+ /* -+ * ipDefaultRouterAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h -+ */ -+ netsnmp_variable_list var_ipDefaultRouterAddressType; -+ /* -+ * ipDefaultRouterAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h -+ */ -+ netsnmp_variable_list var_ipDefaultRouterAddress; -+ /* -+ * ipDefaultRouterIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ netsnmp_variable_list var_ipDefaultRouterIfIndex; -+ -+ /* -+ * set up varbinds -+ */ -+ memset(&var_ipDefaultRouterAddressType, 0x00, -+ sizeof(var_ipDefaultRouterAddressType)); -+ var_ipDefaultRouterAddressType.type = ASN_INTEGER; -+ memset(&var_ipDefaultRouterAddress, 0x00, -+ sizeof(var_ipDefaultRouterAddress)); -+ var_ipDefaultRouterAddress.type = ASN_OCTET_STR; -+ memset(&var_ipDefaultRouterIfIndex, 0x00, -+ sizeof(var_ipDefaultRouterIfIndex)); -+ var_ipDefaultRouterIfIndex.type = ASN_INTEGER; -+ -+ /* -+ * chain temp index varbinds together -+ */ -+ var_ipDefaultRouterAddressType.next_variable = -+ &var_ipDefaultRouterAddress; -+ var_ipDefaultRouterAddress.next_variable = &var_ipDefaultRouterIfIndex; -+ var_ipDefaultRouterIfIndex.next_variable = NULL; -+ -+ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_index_to_oid", "called\n")); -+ -+ /* -+ * ipDefaultRouterAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h -+ */ -+ snmp_set_var_value(&var_ipDefaultRouterAddressType, -+ (u_char *) & mib_idx->ipDefaultRouterAddressType, -+ sizeof(mib_idx->ipDefaultRouterAddressType)); -+ -+ /* -+ * ipDefaultRouterAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h -+ */ -+ snmp_set_var_value(&var_ipDefaultRouterAddress, -+ (u_char *) & mib_idx->ipDefaultRouterAddress, -+ mib_idx->ipDefaultRouterAddress_len * -+ sizeof(mib_idx->ipDefaultRouterAddress[0])); -+ -+ /* -+ * ipDefaultRouterIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ snmp_set_var_value(&var_ipDefaultRouterIfIndex, -+ (u_char *) & mib_idx->ipDefaultRouterIfIndex, -+ sizeof(mib_idx->ipDefaultRouterIfIndex)); -+ -+ -+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len, -+ NULL, 0, &var_ipDefaultRouterAddressType); -+ 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_ipDefaultRouterAddressType); -+ -+ return err; -+} /* ipDefaultRouterTable_index_to_oid */ -+ -+/** -+ * extract ipDefaultRouterTable indexes from a netsnmp_index -+ * -+ * @retval SNMP_ERR_NOERROR : no error -+ * @retval SNMP_ERR_GENERR : error -+ */ -+int -+ipDefaultRouterTable_index_from_oid(netsnmp_index * oid_idx, -+ ipDefaultRouterTable_mib_index * -+ mib_idx) -+{ -+ int err = SNMP_ERR_NOERROR; -+ -+ /* -+ * temp storage for parsing indexes -+ */ -+ /* -+ * ipDefaultRouterAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h -+ */ -+ netsnmp_variable_list var_ipDefaultRouterAddressType; -+ /* -+ * ipDefaultRouterAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h -+ */ -+ netsnmp_variable_list var_ipDefaultRouterAddress; -+ /* -+ * ipDefaultRouterIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ netsnmp_variable_list var_ipDefaultRouterIfIndex; -+ -+ /* -+ * set up varbinds -+ */ -+ memset(&var_ipDefaultRouterAddressType, 0x00, -+ sizeof(var_ipDefaultRouterAddressType)); -+ var_ipDefaultRouterAddressType.type = ASN_INTEGER; -+ memset(&var_ipDefaultRouterAddress, 0x00, -+ sizeof(var_ipDefaultRouterAddress)); -+ var_ipDefaultRouterAddress.type = ASN_OCTET_STR; -+ memset(&var_ipDefaultRouterIfIndex, 0x00, -+ sizeof(var_ipDefaultRouterIfIndex)); -+ var_ipDefaultRouterIfIndex.type = ASN_INTEGER; -+ -+ /* -+ * chain temp index varbinds together -+ */ -+ var_ipDefaultRouterAddressType.next_variable = -+ &var_ipDefaultRouterAddress; -+ var_ipDefaultRouterAddress.next_variable = &var_ipDefaultRouterIfIndex; -+ var_ipDefaultRouterIfIndex.next_variable = NULL; -+ -+ -+ DEBUGMSGTL(("verbose:ipDefaultRouterTable:ipDefaultRouterTable_index_from_oid", "called\n")); -+ -+ /* -+ * parse the oid into the individual index components -+ */ -+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len, -+ &var_ipDefaultRouterAddressType); -+ if (err == SNMP_ERR_NOERROR) { -+ /* -+ * copy out values -+ */ -+ mib_idx->ipDefaultRouterAddressType = -+ *((u_long *) var_ipDefaultRouterAddressType.val.string); -+ /* -+ * NOTE: val_len is in bytes, ipDefaultRouterAddress_len might not be -+ */ -+ if (var_ipDefaultRouterAddress.val_len > -+ sizeof(mib_idx->ipDefaultRouterAddress)) -+ err = SNMP_ERR_GENERR; -+ else { -+ memcpy(mib_idx->ipDefaultRouterAddress, -+ var_ipDefaultRouterAddress.val.string, -+ var_ipDefaultRouterAddress.val_len); -+ mib_idx->ipDefaultRouterAddress_len = -+ var_ipDefaultRouterAddress.val_len / -+ sizeof(mib_idx->ipDefaultRouterAddress[0]); -+ } -+ mib_idx->ipDefaultRouterIfIndex = -+ *((long *) var_ipDefaultRouterIfIndex.val.string); -+ -+ -+ } -+ -+ /* -+ * parsing may have allocated memory. free it. -+ */ -+ snmp_reset_var_buffers(&var_ipDefaultRouterAddressType); -+ -+ return err; -+} /* ipDefaultRouterTable_index_from_oid */ -+ -+ -+/* -+ ********************************************************************* -+ * @internal -+ * allocate resources for a ipDefaultRouterTable_rowreq_ctx -+ */ -+ipDefaultRouterTable_rowreq_ctx * -+ipDefaultRouterTable_allocate_rowreq_ctx(ipDefaultRouterTable_data * data, -+ void *user_init_ctx) -+{ -+ ipDefaultRouterTable_rowreq_ctx *rowreq_ctx = -+ SNMP_MALLOC_TYPEDEF(ipDefaultRouterTable_rowreq_ctx); -+ -+ DEBUGMSGTL(("internal:ipDefaultRouterTable:ipDefaultRouterTable_allocate_rowreq_ctx", "called\n")); -+ -+ if (NULL == rowreq_ctx) { -+ snmp_log(LOG_ERR, "Couldn't allocate memory for a " -+ "ipDefaultRouterTable_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 = -+ ipDefaultRouterTable_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->ipDefaultRouterTable_data_list = NULL; -+ -+ /* -+ * if we allocated data, call init routine -+ */ -+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) { -+ if (SNMPERR_SUCCESS != -+ ipDefaultRouterTable_rowreq_ctx_init(rowreq_ctx, -+ user_init_ctx)) { -+ ipDefaultRouterTable_release_rowreq_ctx(rowreq_ctx); -+ rowreq_ctx = NULL; -+ } -+ } -+ -+ return rowreq_ctx; -+} /* ipDefaultRouterTable_allocate_rowreq_ctx */ -+ -+/* -+ * @internal -+ * release resources for a ipDefaultRouterTable_rowreq_ctx -+ */ -+void -+ipDefaultRouterTable_release_rowreq_ctx(ipDefaultRouterTable_rowreq_ctx * -+ rowreq_ctx) -+{ -+ DEBUGMSGTL(("internal:ipDefaultRouterTable:ipDefaultRouterTable_release_rowreq_ctx", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ ipDefaultRouterTable_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)) -+ ipDefaultRouterTable_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); -+} /* ipDefaultRouterTable_release_rowreq_ctx */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_ipDefaultRouterTable_pre_request(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration -+ *reginfo, -+ netsnmp_agent_request_info -+ *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ int rc; -+ -+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_mfd_ipDefaultRouterTable_pre_request", "called\n")); -+ -+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) { -+ DEBUGMSGTL(("internal:ipDefaultRouterTable", -+ "skipping additional pre_request\n")); -+ return SNMP_ERR_NOERROR; -+ } -+ -+ rc = ipDefaultRouterTable_pre_request(ipDefaultRouterTable_if_ctx. -+ user_ctx); -+ if (MFD_SUCCESS != rc) { -+ /* -+ * nothing we can do about it but log it -+ */ -+ DEBUGMSGTL(("ipDefaultRouterTable", "error %d from " -+ "ipDefaultRouterTable_pre_request\n", rc)); -+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc)); -+ } -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_ipDefaultRouterTable_pre_request */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_ipDefaultRouterTable_post_request(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration -+ *reginfo, -+ netsnmp_agent_request_info -+ *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ ipDefaultRouterTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ int rc, packet_rc; -+ -+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_mfd_ipDefaultRouterTable_post_request", "called\n")); -+ -+ /* -+ * release row context, if deleted -+ */ -+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED)) -+ ipDefaultRouterTable_release_rowreq_ctx(rowreq_ctx); -+ -+ /* -+ * wait for last call before calling user -+ */ -+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) { -+ DEBUGMSGTL(("internal:ipDefaultRouterTable", -+ "waiting for last post_request\n")); -+ return SNMP_ERR_NOERROR; -+ } -+ -+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0); -+ rc = ipDefaultRouterTable_post_request(ipDefaultRouterTable_if_ctx. -+ user_ctx, packet_rc); -+ if (MFD_SUCCESS != rc) { -+ /* -+ * nothing we can do about it but log it -+ */ -+ DEBUGMSGTL(("ipDefaultRouterTable", "error %d from " -+ "ipDefaultRouterTable_post_request\n", rc)); -+ } -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_ipDefaultRouterTable_post_request */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_ipDefaultRouterTable_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; -+ ipDefaultRouterTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ -+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_mfd_ipDefaultRouterTable_object_lookup", "called\n")); -+ -+ /* -+ * get our context from mfd -+ * ipDefaultRouterTable_interface_ctx *if_ctx = -+ * (ipDefaultRouterTable_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 -+ ipDefaultRouterTable_row_prep(rowreq_ctx); -+ -+ return SNMP_VALIDATE_ERR(rc); -+} /* _mfd_ipDefaultRouterTable_object_lookup */ -+ -+/*********************************************************************** -+ * -+ * GET processing -+ * -+ ***********************************************************************/ -+/* -+ * @internal -+ * Retrieve the value for a particular column -+ */ -+NETSNMP_STATIC_INLINE int -+_ipDefaultRouterTable_get_column(ipDefaultRouterTable_rowreq_ctx * -+ rowreq_ctx, netsnmp_variable_list * var, -+ int column) -+{ -+ int rc = SNMPERR_SUCCESS; -+ -+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_mfd_ipDefaultRouterTable_get_column", "called for %d\n", column)); -+ -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ switch (column) { -+ -+ /* -+ * ipDefaultRouterLifetime(4)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/R/d/h -+ */ -+ case COLUMN_IPDEFAULTROUTERLIFETIME: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_UNSIGNED; -+ rc = ipDefaultRouterLifetime_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipDefaultRouterPreference(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h -+ */ -+ case COLUMN_IPDEFAULTROUTERPREFERENCE: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_INTEGER; -+ rc = ipDefaultRouterPreference_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ default: -+ if (IPDEFAULTROUTERTABLE_MIN_COL <= column -+ && column <= IPDEFAULTROUTERTABLE_MAX_COL) { -+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_mfd_ipDefaultRouterTable_get_column", "assume column %d is reserved\n", column)); -+ rc = MFD_SKIP; -+ } else { -+ snmp_log(LOG_ERR, -+ "unknown column %d in _ipDefaultRouterTable_get_column\n", -+ column); -+ } -+ break; -+ } -+ -+ return rc; -+} /* _ipDefaultRouterTable_get_column */ -+ -+int -+_mfd_ipDefaultRouterTable_get_values(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info -+ *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ ipDefaultRouterTable_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:ipDefaultRouterTable:_mfd_ipDefaultRouterTable_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 = _ipDefaultRouterTable_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_ipDefaultRouterTable_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:ipDefaultRouterTable:_cache_load", "called\n")); -+ -+ if ((NULL == cache) || (NULL == cache->magic)) { -+ snmp_log(LOG_ERR, -+ "invalid cache for ipDefaultRouterTable_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 ipDefaultRouterTable_container_load((netsnmp_container *) -+ cache->magic); -+} /* _cache_load */ -+ -+/** -+ * @internal -+ */ -+static void -+_cache_free(netsnmp_cache * cache, void *magic) -+{ -+ netsnmp_container *container; -+ -+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_cache_free", "called\n")); -+ -+ if ((NULL == cache) || (NULL == cache->magic)) { -+ snmp_log(LOG_ERR, -+ "invalid cache in ipDefaultRouterTable_cache_free\n"); -+ return; -+ } -+ -+ container = (netsnmp_container *) cache->magic; -+ -+ _container_free(container); -+} /* _cache_free */ -+ -+/** -+ * @internal -+ */ -+static void -+_container_item_free(ipDefaultRouterTable_rowreq_ctx * rowreq_ctx, -+ void *context) -+{ -+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_container_item_free", -+ "called\n")); -+ -+ if (NULL == rowreq_ctx) -+ return; -+ -+ ipDefaultRouterTable_release_rowreq_ctx(rowreq_ctx); -+} /* _container_item_free */ -+ -+/** -+ * @internal -+ */ -+static void -+_container_free(netsnmp_container * container) -+{ -+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_container_free", -+ "called\n")); -+ -+ if (NULL == container) { -+ snmp_log(LOG_ERR, -+ "invalid container in ipDefaultRouterTable_container_free\n"); -+ return; -+ } -+ -+ /* -+ * call user code -+ */ -+ ipDefaultRouterTable_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 -+_ipDefaultRouterTable_container_init(ipDefaultRouterTable_interface_ctx * -+ if_ctx) -+{ -+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_ipDefaultRouterTable_container_init", "called\n")); -+ -+ /* -+ * cache init -+ */ -+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */ -+ _cache_load, _cache_free, -+ ipDefaultRouterTable_oid, -+ ipDefaultRouterTable_oid_size); -+ -+ if (NULL == if_ctx->cache) { -+ snmp_log(LOG_ERR, -+ "error creating cache for ipDefaultRouterTable\n"); -+ return; -+ } -+ -+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET; -+ -+ ipDefaultRouterTable_container_init(&if_ctx->container, if_ctx->cache); -+ if (NULL == if_ctx->container) -+ if_ctx->container = -+ netsnmp_container_find("ipDefaultRouterTable:table_container"); -+ if (NULL == if_ctx->container) { -+ snmp_log(LOG_ERR, "error creating container in " -+ "ipDefaultRouterTable_container_init\n"); -+ return; -+ } -+ -+ if (NULL != if_ctx->cache) -+ if_ctx->cache->magic = (void *) if_ctx->container; -+} /* _ipDefaultRouterTable_container_init */ -+ -+/** -+ * @internal -+ * shutdown the container with functions or wrappers -+ */ -+void -+_ipDefaultRouterTable_container_shutdown(ipDefaultRouterTable_interface_ctx -+ * if_ctx) -+{ -+ DEBUGMSGTL(("internal:ipDefaultRouterTable:_ipDefaultRouterTable_container_shutdown", "called\n")); -+ -+ ipDefaultRouterTable_container_shutdown(if_ctx->container); -+ -+ _container_free(if_ctx->container); -+ -+} /* _ipDefaultRouterTable_container_shutdown */ -+ -+ -+ipDefaultRouterTable_rowreq_ctx * -+ipDefaultRouterTable_row_find_by_mib_index(ipDefaultRouterTable_mib_index * -+ mib_idx) -+{ -+ ipDefaultRouterTable_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 = ipDefaultRouterTable_index_to_oid(&oid_idx, mib_idx); -+ if (MFD_SUCCESS != rc) -+ return NULL; -+ -+ rowreq_ctx = -+ CONTAINER_FIND(ipDefaultRouterTable_if_ctx.container, &oid_idx); -+ -+ return rowreq_ctx; -+} -diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.h b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.h -new file mode 100644 -index 0000000..a780491 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.h -@@ -0,0 +1,99 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 15899 $ of $ -+ * -+ * $Id:$ -+ */ -+/** @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 IPDEFAULTROUTERTABLE_INTERFACE_H -+#define IPDEFAULTROUTERTABLE_INTERFACE_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+#include "ipDefaultRouterTable.h" -+ -+ -+ /* -+ ******************************************************************** -+ * Table declarations -+ */ -+ -+ /* -+ * PUBLIC interface initialization routine -+ */ -+ void -+ _ipDefaultRouterTable_initialize_interface -+ (ipDefaultRouterTable_registration * user_ctx, u_long flags); -+ void -+ _ipDefaultRouterTable_shutdown_interface -+ (ipDefaultRouterTable_registration * user_ctx); -+ -+ ipDefaultRouterTable_registration -+ *ipDefaultRouterTable_registration_get(void); -+ -+ ipDefaultRouterTable_registration -+ *ipDefaultRouterTable_registration_set -+ (ipDefaultRouterTable_registration * newreg); -+ -+ netsnmp_container *ipDefaultRouterTable_container_get(void); -+ int ipDefaultRouterTable_container_size(void); -+ -+ ipDefaultRouterTable_rowreq_ctx -+ *ipDefaultRouterTable_allocate_rowreq_ctx(ipDefaultRouterTable_data -+ *, void *); -+ void -+ ipDefaultRouterTable_release_rowreq_ctx -+ (ipDefaultRouterTable_rowreq_ctx * rowreq_ctx); -+ -+ int ipDefaultRouterTable_index_to_oid(netsnmp_index * -+ oid_idx, -+ ipDefaultRouterTable_mib_index -+ * mib_idx); -+ int ipDefaultRouterTable_index_from_oid(netsnmp_index * -+ oid_idx, -+ ipDefaultRouterTable_mib_index -+ * mib_idx); -+ -+ /* -+ * access to certain internals. use with caution! -+ */ -+ void -+ ipDefaultRouterTable_valid_columns_set(netsnmp_column_info *vc); -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPDEFAULTROUTERTABLE_INTERFACE_H */ -+/** @} */ -diff --git a/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oids.h b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oids.h -new file mode 100644 -index 0000000..6914e71 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oids.h -@@ -0,0 +1,39 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $ -+ * -+ * $Id:$ -+ */ -+#ifndef IPDEFAULTROUTERTABLE_OIDS_H -+#define IPDEFAULTROUTERTABLE_OIDS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+ /* -+ * column number definitions for table ipDefaultRouterTable -+ */ -+#define IPDEFAULTROUTERTABLE_OID 1,3,6,1,2,1,4,37 -+ -+#define COLUMN_IPDEFAULTROUTERADDRESSTYPE 1 -+ -+#define COLUMN_IPDEFAULTROUTERADDRESS 2 -+ -+#define COLUMN_IPDEFAULTROUTERIFINDEX 3 -+ -+#define COLUMN_IPDEFAULTROUTERLIFETIME 4 -+ -+#define COLUMN_IPDEFAULTROUTERPREFERENCE 5 -+ -+ -+#define IPDEFAULTROUTERTABLE_MIN_COL COLUMN_IPDEFAULTROUTERLIFETIME -+#define IPDEFAULTROUTERTABLE_MAX_COL COLUMN_IPDEFAULTROUTERPREFERENCE -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPDEFAULTROUTERTABLE_OIDS_H */ -diff --git a/agent/mibgroup/mibII/var_route.c b/agent/mibgroup/mibII/var_route.c -index 0a811f3..3fa02ba 100644 ---- a/agent/mibgroup/mibII/var_route.c -+++ b/agent/mibgroup/mibII/var_route.c -@@ -87,6 +87,7 @@ static size_t all_routes_size; - extern const struct sockaddr *get_address(const void *, int, int); - extern const struct in_addr *get_in_address(const void *, int, int); - -+ - /* - * var_ipRouteEntry(... - * Arguments: -diff --git a/configure.in b/configure.in -index 3ad7955..c5e05ba 100644 ---- a/configure.in -+++ b/configure.in -@@ -3342,6 +3342,29 @@ typedef __u32 u32; /* ditto */ - typedef __u16 u16; /* ditto */ - typedef __u8 u8; /* ditto */ - ]]) -+# linux netlink -+AC_CHECK_HEADERS(linux/netlink.h,,, -+[[ -+#if HAVE_ASM_TYPES_H -+#include -+#endif -+#if HAVE_SYS_SOCKET_H -+#include -+#endif -+]]) -+# linux rtnetlink -+AC_CHECK_HEADERS(linux/rtnetlink.h,,, -+[[ -+#if HAVE_ASM_TYPES_H -+#include -+#endif -+#if HAVE_SYS_SOCKET_H -+#include -+#endif -+#if HAVE_LINUX_NETLINK_H -+#include -+#endif -+]]) - # BSDi3 headers - AC_CHECK_HEADERS(sys/stat.h) - # BSDi3/IRIX headers -diff --git a/include/net-snmp/data_access/defaultrouter.h b/include/net-snmp/data_access/defaultrouter.h -new file mode 100644 -index 0000000..93ac18f ---- /dev/null -+++ b/include/net-snmp/data_access/defaultrouter.h -@@ -0,0 +1,114 @@ -+/* -+ * defaultrouter data access header -+ * -+ * $Id:$ -+ */ -+#ifndef NETSNMP_ACCESS_DEFAULTROUTER_H -+#define NETSNMP_ACCESS_DEFAULTROUTER_H -+ -+# ifdef __cplusplus -+extern "C" { -+#endif -+ -+/**---------------------------------------------------------------------*/ -+/* -+ * structure definitions -+ */ -+#if defined( NETSNMP_ENABLE_IPV6 ) -+# define NETSNMP_ACCESS_DEFAULTROUTER_BUF_SIZE 16 /* XXX: 20, for ip6z? */ -+#else -+# define NETSNMP_ACCESS_DEFAULTROUTER_BUF_SIZE 4 -+#endif -+ -+ -+/* -+ * netsnmp_default_route_entry -+ */ -+typedef struct netsnmp_defaultrouter_s { -+ -+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */ -+ oid ns_dr_index; /* arbitrary index */ -+ -+ int flags; /* for net-snmp use */ -+ -+ /* -+ * mib related data -+ */ -+ u_char dr_addresstype; /* ipDefaultRouterAddressType */ -+ char dr_address[NETSNMP_ACCESS_DEFAULTROUTER_BUF_SIZE]; /* ipDefaultRouterAddress */ -+ size_t dr_address_len; /* length of ipDefaultRouterAddress */ -+ oid dr_if_index; /* ipDefaultRouterIfIndex */ -+ uint32_t dr_lifetime; /* ipDefaultRouterLifetime (0-65535) */ -+ char dr_preference; /* ipDefaultRouterPreference (-2,-1,0,1) */ -+ -+} netsnmp_defaultrouter_entry; -+ -+ -+/**---------------------------------------------------------------------*/ -+/* -+ * ACCESS function prototypes -+ */ -+/* -+ * container init -+ */ -+netsnmp_container * -+netsnmp_access_defaultrouter_container_init(u_int flags); -+#define NETSNMP_ACCESS_DEFAULTROUTER_INIT_NOFLAGS 0x0000 -+#define NETSNMP_ACCESS_DEFAULTROUTER_INIT_ADDL_IDX_BY_ADDR 0x0001 -+ -+/* -+ * container load -+ */ -+netsnmp_container* -+netsnmp_access_defaultrouter_container_load(netsnmp_container* container, -+ u_int load_flags); -+#define NETSNMP_ACCESS_DEFAULTROUTER_LOAD_NOFLAGS 0x0000 -+#define NETSNMP_ACCESS_DEFAULTROUTER_LOAD_IPV4_ONLY 0x0001 -+#define NETSNMP_ACCESS_DEFAULTROUTER_LOAD_IPV6_ONLY 0x0002 -+#define NETSNMP_ACCESS_DEFAULTROUTER_LOAD_ADDL_IDX_BY_ADDR 0x0004 -+ -+/* -+ * container free -+ */ -+void -+netsnmp_access_defaultrouter_container_free(netsnmp_container *container, -+ u_int free_flags); -+#define NETSNMP_ACCESS_DEFAULTROUTER_FREE_NOFLAGS 0x0000 -+#define NETSNMP_ACCESS_DEFAULTROUTER_FREE_DONT_CLEAR 0x0001 -+#define NETSNMP_ACCESS_DEFAULTROUTER_FREE_KEEP_CONTAINER 0x0002 -+ -+/* -+ * entry create -+ */ -+netsnmp_defaultrouter_entry * -+netsnmp_access_defaultrouter_entry_create(void); -+ -+/* -+ * entry load -+ */ -+int -+netsnmp_access_defaultrouter_entry_load(size_t *num_entries, -+ netsnmp_defaultrouter_entry **entries); -+ -+/* -+ * entry update -+ */ -+int -+netsnmp_access_defaultrouter_entry_update(netsnmp_defaultrouter_entry *lhs, -+ netsnmp_defaultrouter_entry *rhs); -+ -+/* -+ * entry free -+ */ -+void -+netsnmp_access_defaultrouter_entry_free(netsnmp_defaultrouter_entry *entry); -+ -+ -+ -+/**---------------------------------------------------------------------*/ -+ -+# ifdef __cplusplus -+} -+#endif -+ -+#endif /* NETSNMP_ACCESS_DEFAULTROUTER_H */ --- -1.6.0.2 - diff --git a/Add-ICMP-Statistics-Tables-support.patch b/Add-ICMP-Statistics-Tables-support.patch deleted file mode 100644 index 5921473..0000000 --- a/Add-ICMP-Statistics-Tables-support.patch +++ /dev/null @@ -1,1477 +0,0 @@ -From f691d90915f55027107270245494e1d25e340e20 Mon Sep 17 00:00:00 2001 -From: Mitsuru Chinen -Date: Mon, 20 Oct 2008 16:43:13 +0900 -Subject: [PATCH] Add ICMP Statistics Tables support - -From net-snmp patch tracker: -[ 1702361 ] Add ability to retrieve /proc/net/snmp6 under linux -http://sourceforge.net/tracker/index.php?func=detail&aid=1702361&group_id=12694&atid=312694 - -[ 1702366 ] add support for icmpStatsTable oid under linux -http://sourceforge.net/tracker/index.php?func=detail&aid=1702366&group_id=12694&atid=312694 - -[ 1703004 ] consolidate snmp6 caching in mibII read for linux -http://sourceforge.net/tracker/index.php?func=detail&aid=1703004&group_id=12694&atid=312694 - -[ 1715395 ] Fix the output form of icmpStatsTable on Linux -http://sourceforge.net/tracker/index.php?func=detail&aid=1715395&group_id=12694&atid=312694 - -[ 1721096 ] [Linux] Reply icmpStatsTable with old kernel -http://sourceforge.net/tracker/index.php?func=detail&aid=1721096&group_id=12694&atid=312694 - -[ 1823465 ] fix icmp registration and caches -http://sourceforge.net/tracker/index.php?func=detail&aid=1823465&group_id=12694&atid=312694 - -[ 1927751 ] Update icmpMsgStatsTable, Take IV -http://sourceforge.net/tracker/index.php?func=detail&aid=1927751&group_id=12694&atid=312694 - -Signed-off-by: Mitsuru Chinen ---- - agent/mibgroup/mibII/icmp.c | 578 +++++++++++++++++++++++++++++++++ - agent/mibgroup/mibII/icmp.h | 15 + - agent/mibgroup/mibII/ipv6.c | 2 +- - agent/mibgroup/mibII/kernel_linux.c | 483 +++++++++++++++++++++++++--- - agent/mibgroup/mibII/kernel_linux.h | 86 +++++ - configure | 5 +- - configure.in | 5 +- - include/net-snmp/net-snmp-config.h.in | 3 + - win32/net-snmp/net-snmp-config.h.in | 3 + - 9 files changed, 1138 insertions(+), 42 deletions(-) - -diff --git a/agent/mibgroup/mibII/icmp.c b/agent/mibgroup/mibII/icmp.c -index f3fbb82..50daac1 100644 ---- a/agent/mibgroup/mibII/icmp.c -+++ b/agent/mibgroup/mibII/icmp.c -@@ -9,6 +9,13 @@ - #if HAVE_NETINET_IP_ICMP_H - #include - #endif -+ -+#ifdef NETSNMP_ENABLE_IPV6 -+#if HAVE_NETINET_ICMP6_H -+#include -+#endif -+#endif /* NETSNMP_ENABLE_IPV6 */ -+ - #if HAVE_NETINET_ICMP_VAR_H - #include - #endif -@@ -60,16 +67,388 @@ perfstat_id_t ps_name; - * registering underneath - */ - oid icmp_oid[] = { SNMP_OID_MIB2, 5 }; -+oid icmp_stats_tbl_oid[] = { SNMP_OID_MIB2, 5, 29 }; -+oid icmp_msg_stats_tbl_oid[] = { SNMP_OID_MIB2, 5, 30 }; - #ifdef USING_MIBII_IP_MODULE - extern oid ip_module_oid[]; - extern int ip_module_oid_len; - extern int ip_module_count; - #endif - -+#ifdef linux -+struct icmp_stats_table_entry { -+ __uint32_t ipVer; -+ __uint32_t icmpStatsInMsgs; -+ __uint32_t icmpStatsInErrors; -+ __uint32_t icmpStatsOutMsgs; -+ __uint32_t icmpStatsOutErrors; -+}; -+ -+struct icmp_stats_table_entry icmp_stats_table[2]; -+ -+#define ICMP_MSG_STATS_HAS_IN 1 -+#define ICMP_MSG_STATS_HAS_OUT 2 -+ -+struct icmp_msg_stats_table_entry { -+ uint32_t ipVer; -+ uint32_t icmpMsgStatsType; -+ uint32_t icmpMsgStatsInPkts; -+ uint32_t icmpMsgStatsOutPkts; -+ int flags; -+}; -+ -+#define ICMP_MSG_STATS_IPV4_COUNT 11 -+ -+#ifdef NETSNMP_ENABLE_IPV6 -+#define ICMP_MSG_STATS_IPV6_COUNT 14 -+#else -+#define ICMP_MSG_STATS_IPV6_COUNT 0 -+#endif /* NETSNMP_ENABLE_IPV6 */ -+ -+struct icmp_msg_stats_table_entry icmp_msg_stats_table[ICMP_MSG_STATS_IPV4_COUNT + ICMP_MSG_STATS_IPV6_COUNT]; -+ -+int -+icmp_stats_load(netsnmp_cache *cache, void *vmagic) -+{ -+ -+ /* -+ * note don't bother using the passed in cache -+ * and vmagic pointers. They are useless as they -+ * currently point to the icmp system stats cache -+ * since I see little point in registering another -+ * cache for this table. Its not really needed -+ */ -+ -+ int i; -+ struct icmp_mib v4icmp; -+ struct icmp6_mib v6icmp; -+ for(i=0;i<2;i++) { -+ switch(i) { -+ case 0: -+ linux_read_icmp_stat(&v4icmp); -+ icmp_stats_table[i].icmpStatsInMsgs = v4icmp.icmpInMsgs; -+ icmp_stats_table[i].icmpStatsInErrors = v4icmp.icmpInErrors; -+ icmp_stats_table[i].icmpStatsOutMsgs = v4icmp.icmpOutMsgs; -+ icmp_stats_table[i].icmpStatsOutErrors = v4icmp.icmpOutErrors; -+ break; -+ default: -+ memset(&icmp_stats_table[i],0, -+ sizeof(struct icmp_stats_table_entry)); -+ linux_read_icmp6_stat(&v6icmp); -+ icmp_stats_table[i].icmpStatsInMsgs = v6icmp.icmp6InMsgs; -+ icmp_stats_table[i].icmpStatsInErrors = v6icmp.icmp6InErrors; -+ icmp_stats_table[i].icmpStatsOutMsgs = v6icmp.icmp6OutMsgs; -+ icmp_stats_table[i].icmpStatsOutErrors = v6icmp.icmp6OutDestUnreachs + -+ v6icmp.icmp6OutPktTooBigs + v6icmp.icmp6OutTimeExcds + -+ v6icmp.icmp6OutParmProblems; -+ break; -+ } -+ icmp_stats_table[i].ipVer=i+1; -+ } -+ -+ return 0; -+} -+ -+int -+icmp_msg_stats_load(netsnmp_cache *cache, void *vmagic) -+{ -+ struct icmp_mib v4icmp; -+ struct icmp4_msg_mib v4icmpmsg; -+ struct icmp6_mib v6icmp; -+ struct icmp6_msg_mib v6icmpmsg; -+ int i, j, k, flag, inc; -+ -+ memset(&icmp_msg_stats_table, 0, sizeof(icmp_msg_stats_table)); -+ -+ i = 0; -+ flag = 0; -+ k = 0; -+ inc = 0; -+ linux_read_icmp_msg_stat(&v4icmp, &v4icmpmsg, &flag); -+ if (flag) { -+ while (254 != k) { -+ if (v4icmpmsg.vals[k].InType) { -+ icmp_msg_stats_table[i].ipVer = 1; -+ icmp_msg_stats_table[i].icmpMsgStatsType = k; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmpmsg.vals[k].InType; -+ icmp_msg_stats_table[i].flags = icmp_msg_stats_table[i].flags | ICMP_MSG_STATS_HAS_IN; -+ inc = 1; /* Set this if we found a valid entry */ -+ } -+ if (v4icmpmsg.vals[k].OutType) { -+ icmp_msg_stats_table[i].ipVer = 1; -+ icmp_msg_stats_table[i].icmpMsgStatsType = k; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmpmsg.vals[k].OutType; -+ icmp_msg_stats_table[i].flags = icmp_msg_stats_table[i].flags | ICMP_MSG_STATS_HAS_OUT; -+ inc = 1; /* Set this if we found a valid entry */ -+ } -+ if (inc) { -+ i++; -+ inc = 0; -+ } -+ k++; -+ } -+ } else { -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_ECHOREPLY; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInEchoReps; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutEchoReps; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_DEST_UNREACH; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInDestUnreachs; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutDestUnreachs; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_SOURCE_QUENCH; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInSrcQuenchs; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutSrcQuenchs; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_REDIRECT; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInRedirects; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutRedirects; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_ECHO; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInEchos; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutEchos; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_TIME_EXCEEDED; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInTimeExcds; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutTimeExcds; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_PARAMETERPROB; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInParmProbs; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutParmProbs; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_TIMESTAMP; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInTimestamps; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutTimestamps; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_TIMESTAMPREPLY; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInTimestampReps; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutTimestampReps; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_ADDRESS; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInAddrMasks; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutAddrMasks; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_ADDRESSREPLY; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInAddrMaskReps; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutAddrMaskReps; -+ i++; -+ -+ /* set the IP version and default flags */ -+ for (j = 0; j < ICMP_MSG_STATS_IPV4_COUNT; j++) { -+ icmp_msg_stats_table[j].ipVer = 1; -+ icmp_msg_stats_table[j].flags = ICMP_MSG_STATS_HAS_IN | ICMP_MSG_STATS_HAS_OUT; -+ } -+ } -+ -+#ifdef NETSNMP_ENABLE_IPV6 -+ flag = 0; -+ k = 0; -+ inc = 0; -+ linux_read_icmp6_msg_stat(&v6icmp, &v6icmpmsg, &flag); -+ if (flag) { -+ while (254 != k) { -+ if (v6icmpmsg.vals[k].InType) { -+ icmp_msg_stats_table[i].ipVer = 2; -+ icmp_msg_stats_table[i].icmpMsgStatsType = k; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmpmsg.vals[k].InType; -+ icmp_msg_stats_table[i].flags = icmp_msg_stats_table[i].flags | ICMP_MSG_STATS_HAS_IN; -+ inc = 1; /* Set this if we found a valid entry */ -+ } -+ if (v6icmpmsg.vals[k].OutType) { -+ icmp_msg_stats_table[i].ipVer = 2; -+ icmp_msg_stats_table[i].icmpMsgStatsType = k; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmpmsg.vals[k].OutType; -+ icmp_msg_stats_table[i].flags = icmp_msg_stats_table[i].flags | ICMP_MSG_STATS_HAS_OUT; -+ inc = 1; /* Set this if we found a valid entry */ -+ } -+ if (inc) { -+ i++; -+ inc = 0; -+ } -+ k++; -+ } -+ } else { -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP6_DST_UNREACH; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InDestUnreachs; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutDestUnreachs; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP6_PACKET_TOO_BIG; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InPktTooBigs; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutPktTooBigs; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP6_TIME_EXCEEDED; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InTimeExcds; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutTimeExcds; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP6_PARAM_PROB; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InParmProblems; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutParmProblems; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP6_ECHO_REQUEST; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InEchos; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = 0; -+ icmp_msg_stats_table[i].flags = ICMP_MSG_STATS_HAS_IN; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP6_ECHO_REPLY; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InEchoReplies; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutEchoReplies; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = MLD_LISTENER_QUERY; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InGroupMembQueries; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = 0; -+ icmp_msg_stats_table[i].flags = ICMP_MSG_STATS_HAS_IN; -+ i++; -+ icmp_msg_stats_table[i].icmpMsgStatsType = MLD_LISTENER_REPORT; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InGroupMembResponses; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutGroupMembResponses; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = MLD_LISTENER_REDUCTION; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InGroupMembReductions; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutGroupMembReductions; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ND_ROUTER_SOLICIT; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InRouterSolicits; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutRouterSolicits; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ND_ROUTER_ADVERT; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InRouterAdvertisements; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = 0; -+ icmp_msg_stats_table[i].flags = ICMP_MSG_STATS_HAS_IN; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ND_NEIGHBOR_SOLICIT; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InNeighborSolicits; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutNeighborSolicits; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ND_NEIGHBOR_ADVERT; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InNeighborAdvertisements; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutNeighborAdvertisements; -+ i++; -+ -+ icmp_msg_stats_table[i].icmpMsgStatsType = ND_REDIRECT; -+ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v6icmp.icmp6InRedirects; -+ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v6icmp.icmp6OutRedirects; -+ -+ for (j = 0; j < ICMP_MSG_STATS_IPV6_COUNT; j++) { -+ icmp_msg_stats_table[ICMP_MSG_STATS_IPV4_COUNT + j].ipVer = 2; -+ icmp_msg_stats_table[ICMP_MSG_STATS_IPV4_COUNT + j].flags = ICMP_MSG_STATS_HAS_IN | ICMP_MSG_STATS_HAS_OUT; -+ } -+#endif /* NETSNMP_ENABLE_IPV6 */ -+ } -+ return 0; -+} -+ -+netsnmp_variable_list * -+icmp_stats_next_entry( void **loop_context, -+ void **data_context, -+ netsnmp_variable_list *index, -+ netsnmp_iterator_info *data) -+{ -+ int i = (int)(*loop_context); -+ netsnmp_variable_list *idx = index; -+ -+ if(i > 1) -+ return NULL; -+ -+ -+ /* -+ *set IP version -+ */ -+ snmp_set_var_typed_value(idx, ASN_INTEGER, (u_char *)&icmp_stats_table[i].ipVer, -+ sizeof(__uint32_t)); -+ idx = idx->next_variable; -+ -+ *data_context = &icmp_stats_table[i]; -+ -+ *loop_context = (void *)(++i); -+ -+ return index; -+} -+ -+ -+netsnmp_variable_list * -+icmp_stats_first_entry( void **loop_context, -+ void **data_context, -+ netsnmp_variable_list *index, -+ netsnmp_iterator_info *data) -+{ -+ -+ *loop_context = 0; -+ *data_context = NULL; -+ return icmp_stats_next_entry(loop_context, data_context, index, data); -+} -+ -+netsnmp_variable_list * -+icmp_msg_stats_next_entry(void **loop_context, -+ void **data_context, -+ netsnmp_variable_list *index, -+ netsnmp_iterator_info *data) -+{ -+ int i = (int)(*loop_context); -+ netsnmp_variable_list *idx = index; -+ -+ if(i >= ICMP_MSG_STATS_IPV4_COUNT + ICMP_MSG_STATS_IPV6_COUNT) -+ return NULL; -+ -+ /* set IP version */ -+ snmp_set_var_typed_value(idx, ASN_INTEGER, -+ (u_char *)&icmp_msg_stats_table[i].ipVer, -+ sizeof(uint32_t)); -+ -+ /* set packet type */ -+ idx = idx->next_variable; -+ snmp_set_var_typed_value(idx, ASN_INTEGER, -+ (u_char *)&icmp_msg_stats_table[i].icmpMsgStatsType, -+ sizeof(uint32_t)); -+ -+ *data_context = &icmp_msg_stats_table[i]; -+ *loop_context = (void *)(++i); -+ -+ return index; -+} -+ -+ -+netsnmp_variable_list * -+icmp_msg_stats_first_entry(void **loop_context, -+ void **data_context, -+ netsnmp_variable_list *index, -+ netsnmp_iterator_info *data) -+{ -+ *loop_context = 0; -+ *data_context = NULL; -+ return icmp_msg_stats_next_entry(loop_context, data_context, index, data); -+} -+#endif -+ - void - init_icmp(void) - { - netsnmp_handler_registration *reginfo; -+ netsnmp_handler_registration *msg_stats_reginfo; -+ netsnmp_iterator_info *iinfo; -+ netsnmp_iterator_info *msg_stats_iinfo; -+ netsnmp_table_registration_info *table_info; -+ netsnmp_table_registration_info *msg_stats_table_info; - - /* - * register ourselves with the agent as a group of scalars... -@@ -89,6 +468,68 @@ init_icmp(void) - icmp_oid, OID_LENGTH(icmp_oid))); - #endif - -+#ifdef linux -+ -+ /* register icmpStatsTable */ -+ reginfo = netsnmp_create_handler_registration("icmpStatsTable", -+ icmp_stats_table_handler, icmp_stats_tbl_oid, -+ OID_LENGTH(icmp_stats_tbl_oid), HANDLER_CAN_RONLY); -+ -+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); -+ if (!table_info) { -+ return; -+ } -+ -+ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, 0); -+ table_info->min_column = ICMP_STAT_INMSG; -+ table_info->max_column = ICMP_STAT_OUTERR; -+ -+ -+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info); -+ if (!iinfo) { -+ return; -+ } -+ iinfo->get_first_data_point = icmp_stats_first_entry; -+ iinfo->get_next_data_point = icmp_stats_next_entry; -+ iinfo->table_reginfo = table_info; -+ -+ netsnmp_register_table_iterator(reginfo, iinfo); -+ -+ /* register icmpMsgStatsTable */ -+ msg_stats_reginfo = netsnmp_create_handler_registration("icmpMsgStatsTable", -+ icmp_msg_stats_table_handler, icmp_msg_stats_tbl_oid, -+ OID_LENGTH(icmp_msg_stats_tbl_oid), HANDLER_CAN_RONLY); -+ -+ msg_stats_table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); -+ if (!msg_stats_table_info) { -+ return; -+ } -+ -+ netsnmp_table_helper_add_indexes(msg_stats_table_info, ASN_INTEGER, ASN_INTEGER, 0); -+ msg_stats_table_info->min_column = ICMP_MSG_STAT_IN_PKTS; -+ msg_stats_table_info->max_column = ICMP_MSG_STAT_OUT_PKTS; -+ -+ msg_stats_iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info); -+ if (!msg_stats_iinfo) { -+ return; -+ } -+ msg_stats_iinfo->get_first_data_point = icmp_msg_stats_first_entry; -+ msg_stats_iinfo->get_next_data_point = icmp_msg_stats_next_entry; -+ msg_stats_iinfo->table_reginfo = msg_stats_table_info; -+ -+ netsnmp_register_table_iterator(msg_stats_reginfo, msg_stats_iinfo); -+ netsnmp_inject_handler( msg_stats_reginfo, -+ netsnmp_get_cache_handler(ICMP_STATS_CACHE_TIMEOUT, -+ icmp_load, icmp_free, -+ icmp_msg_stats_tbl_oid, OID_LENGTH(icmp_msg_stats_tbl_oid))); -+#ifndef hpux11 -+ netsnmp_inject_handler( reginfo, -+ netsnmp_get_cache_handler(ICMP_STATS_CACHE_TIMEOUT, -+ icmp_load, icmp_free, -+ icmp_stats_tbl_oid, OID_LENGTH(icmp_stats_tbl_oid))); -+#endif /* ! hpux11 */ -+#endif /* linux */ -+ - #ifdef USING_MIBII_IP_MODULE - if (++ip_module_count == 2) - REGISTER_SYSOR_TABLE(ip_module_oid, ip_module_oid_len, -@@ -550,6 +991,141 @@ icmp_handler(netsnmp_mib_handler *handler, - return SNMP_ERR_NOERROR; - } - -+int -+icmp_msg_stats_table_handler(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *reqinfo, -+ netsnmp_request_info *requests) -+{ -+ netsnmp_request_info *request; -+ netsnmp_variable_list *requestvb; -+ netsnmp_table_request_info *table_info; -+ struct icmp_msg_stats_table_entry *entry; -+ oid subid; -+ -+ switch (reqinfo->mode) { -+ case MODE_GET: -+ for (request = requests; request; request = request->next) { -+ requestvb = request->requestvb; -+ entry = (struct icmp_msg_stats_table_entry *)netsnmp_extract_iterator_context(request); -+ if (!entry) -+ continue; -+ table_info = netsnmp_extract_table_info(request); -+ subid = table_info->colnum; -+ -+ switch (subid) { -+ case ICMP_MSG_STAT_IN_PKTS: -+ if (entry->flags & ICMP_MSG_STATS_HAS_IN) { -+ snmp_set_var_typed_value(requestvb, ASN_COUNTER, -+ (u_char *)&entry->icmpMsgStatsInPkts, sizeof(uint32_t)); -+ } else { -+ requestvb->type = SNMP_NOSUCHINSTANCE; -+ } -+ break; -+ case ICMP_MSG_STAT_OUT_PKTS: -+ if (entry->flags & ICMP_MSG_STATS_HAS_OUT) { -+ snmp_set_var_typed_value(requestvb, ASN_COUNTER, -+ (u_char *)&entry->icmpMsgStatsOutPkts, sizeof(uint32_t)); -+ } else { -+ requestvb->type = SNMP_NOSUCHINSTANCE; -+ } -+ break; -+ default: -+ snmp_log(LOG_WARNING, "mibII/icmpMsgStatsTable: Unrecognised column (%d)\n",(int)subid); -+ } -+ } -+ break; -+ case MODE_GETNEXT: -+ case MODE_GETBULK: -+ case MODE_SET_RESERVE1: -+ case MODE_SET_RESERVE2: -+ case MODE_SET_ACTION: -+ case MODE_SET_COMMIT: -+ case MODE_SET_FREE: -+ case MODE_SET_UNDO: -+ snmp_log(LOG_WARNING, "mibII/icmpStatsTable: Unsupported mode (%d)\n", -+ reqinfo->mode); -+ break; -+ default: -+ snmp_log(LOG_WARNING, "mibII/icmpStatsTable: Unrecognised mode (%d)\n", -+ reqinfo->mode); -+ break; -+ -+ } -+ -+ return SNMP_ERR_NOERROR; -+} -+ -+int -+icmp_stats_table_handler(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *reqinfo, -+ netsnmp_request_info *requests) -+{ -+ netsnmp_request_info *request; -+ netsnmp_variable_list *requestvb; -+ netsnmp_table_request_info *table_info; -+ struct icmp_stats_table_entry *entry; -+ oid subid; -+#ifndef hpux11 -+ if (!netsnmp_cache_is_valid(reqinfo, reginfo->handlerName)) { -+ netsnmp_assert(!"cache == valid"); /* always false */ -+ icmp_load( NULL, NULL ); /* XXX - check for failure */ -+ } -+#endif -+ -+ switch (reqinfo->mode) { -+ case MODE_GET: -+ for (request=requests; request; request=request->next) { -+ requestvb = request->requestvb; -+ entry = (struct icmp_stats_table_entry *)netsnmp_extract_iterator_context(request); -+ if (!entry) -+ continue; -+ table_info = netsnmp_extract_table_info(request); -+ subid = table_info->colnum; -+ -+ switch (subid) { -+ case ICMP_STAT_INMSG: -+ snmp_set_var_typed_value(requestvb, ASN_COUNTER, -+ (u_char *)&entry->icmpStatsInMsgs, sizeof(__uint32_t)); -+ break; -+ case ICMP_STAT_INERR: -+ snmp_set_var_typed_value(requestvb, ASN_COUNTER, -+ (u_char *)&entry->icmpStatsInErrors, sizeof(__uint32_t)); -+ break; -+ case ICMP_STAT_OUTMSG: -+ snmp_set_var_typed_value(requestvb, ASN_COUNTER, -+ (u_char *)&entry->icmpStatsOutMsgs, sizeof(__uint32_t)); -+ break; -+ case ICMP_STAT_OUTERR: -+ snmp_set_var_typed_value(requestvb, ASN_COUNTER, -+ (u_char *)&entry->icmpStatsOutErrors, sizeof(__uint32_t)); -+ break; -+ default: -+ snmp_log(LOG_WARNING, "mibII/icmpStatsTable: Unrecognised column (%d)\n",(int)subid); -+ } -+ } -+ break; -+ case MODE_GETNEXT: -+ case MODE_GETBULK: -+ case MODE_SET_RESERVE1: -+ case MODE_SET_RESERVE2: -+ case MODE_SET_ACTION: -+ case MODE_SET_COMMIT: -+ case MODE_SET_FREE: -+ case MODE_SET_UNDO: -+ snmp_log(LOG_WARNING, "mibII/icmpStatsTable: Unsupported mode (%d)\n", -+ reqinfo->mode); -+ break; -+ default: -+ snmp_log(LOG_WARNING, "mibII/icmpStatsTable: Unrecognised mode (%d)\n", -+ reqinfo->mode); -+ break; -+ -+ } -+ -+ return SNMP_ERR_NOERROR; -+} - - /********************* - * -@@ -680,6 +1256,8 @@ icmp_load(netsnmp_cache *cache, void *vmagic) - } else { - DEBUGMSGTL(("mibII/icmp", "Loaded ICMP Group (linux)\n")); - } -+ icmp_stats_load(cache, vmagic); -+ icmp_msg_stats_load(cache, vmagic); - return ret_value; - } - #elif defined(solaris2) -diff --git a/agent/mibgroup/mibII/icmp.h b/agent/mibgroup/mibII/icmp.h -index 7417639..4a780ac 100644 ---- a/agent/mibgroup/mibII/icmp.h -+++ b/agent/mibgroup/mibII/icmp.h -@@ -12,6 +12,8 @@ config_arch_require(linux, mibII/kernel_linux) - - extern void init_icmp(void); - extern Netsnmp_Node_Handler icmp_handler; -+extern Netsnmp_Node_Handler icmp_stats_table_handler; -+extern Netsnmp_Node_Handler icmp_msg_stats_table_handler; - extern NetsnmpCacheLoad icmp_load; - extern NetsnmpCacheFree icmp_free; - -@@ -42,4 +44,17 @@ extern NetsnmpCacheFree icmp_free; - #define ICMPOUTADDRMASKS 25 - #define ICMPOUTADDRMASKREPS 26 - -+#define ICMPSTATSTABLE 29 -+#define ICMP_STAT_IPVER 1 -+#define ICMP_STAT_INMSG 2 -+#define ICMP_STAT_INERR 3 -+#define ICMP_STAT_OUTMSG 4 -+#define ICMP_STAT_OUTERR 5 -+ -+#define ICMPMSGSTATSTABLE 30 -+#define ICMP_MSG_STAT_IPVER 1 -+#define ICMP_MSG_STAT_TYPE 2 -+#define ICMP_MSG_STAT_IN_PKTS 3 -+#define ICMP_MSG_STAT_OUT_PKTS 4 -+ - #endif /* _MIBGROUP_ICMP_H */ -diff --git a/agent/mibgroup/mibII/ipv6.c b/agent/mibgroup/mibII/ipv6.c -index 1e24989..ac64ad5 100644 ---- a/agent/mibgroup/mibII/ipv6.c -+++ b/agent/mibgroup/mibII/ipv6.c -@@ -1851,7 +1851,7 @@ linux_read_ip6_stat_ulong(const char *file) - return value; - } - --void -+static void - linux_read_ip6_stat(struct ip6_mib *ip6stat) - { - if (!ip6stat) -diff --git a/agent/mibgroup/mibII/kernel_linux.c b/agent/mibgroup/mibII/kernel_linux.c -index bb6f867..7b47d9c 100644 ---- a/agent/mibgroup/mibII/kernel_linux.c -+++ b/agent/mibgroup/mibII/kernel_linux.c -@@ -16,43 +16,109 @@ - #if HAVE_SYS_PARAM_H - #include - #endif -+#include - - #include "kernel_linux.h" - - struct ip_mib cached_ip_mib; -+struct ip6_mib cached_ip6_mib; - struct icmp_mib cached_icmp_mib; -+struct icmp6_mib cached_icmp6_mib; -+struct icmp4_msg_mib cached_icmp4_msg_mib; -+struct tcp_mib cached_tcp_mib; - struct tcp_mib cached_tcp_mib; - struct udp_mib cached_udp_mib; -+struct udp6_mib cached_udp6_mib; - - #define IP_STATS_LINE "Ip: %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu" - #define ICMP_STATS_LINE "Icmp: %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu" -+#define ICMP_MSG_STATS_LINE "IcmpMsg: " - #define TCP_STATS_LINE "Tcp: %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu" - #define UDP_STATS_LINE "Udp: %lu %lu %lu %lu" -+#define IP6_STATS_LINE "Ip6" -+#define ICMP6_STATS_LINE "Icmp6" - #define UDP6_STATS_LINE "Udp6" - - #define IP_STATS_PREFIX_LEN 4 - #define ICMP_STATS_PREFIX_LEN 6 -+#define ICMP_MSG_STATS_PREFIX_LEN 9 - #define TCP_STATS_PREFIX_LEN 5 - #define UDP_STATS_PREFIX_LEN 5 -+#define IP6_STATS_PREFIX_LEN 3 -+#define ICMP6_STATS_PREFIX_LEN 5 - #define UDP6_STATS_PREFIX_LEN 4 - -+int -+decode_icmp_msg(char *line, char *data, struct icmp4_msg_mib *msg) -+{ -+ char *token, *saveptr, *lineptr, *saveptr1, *dataptr, *delim = NULL; -+ char line_cpy[1024]; -+ char data_cpy[1024]; -+ long index; -+ -+ if(data == NULL) -+ return -1; -+ -+ /* -+ * Since we are using strtok, there is a possiblity of the orginal data -+ * getting modified. So we take a local copy for this purpose even though -+ * its expensive. -+ */ -+ strncpy(line_cpy, line, sizeof(line_cpy)); -+ strncpy(data_cpy, data, sizeof(data_cpy)); -+ -+ lineptr = line_cpy; -+ dataptr = data_cpy; -+ saveptr1 = NULL; -+ while (1) { -+ if(NULL == (token = strtok_r(lineptr, " ", &saveptr))) -+ break; -+ lineptr = NULL; -+ errno = 0; -+ if (0 == strncmp(strsep(&token, "e"), "OutTyp", 6)) { -+ index = strtol(token, &delim, 0); -+ if (ERANGE == errno) { -+ continue; -+ } else if (index > LONG_MAX) { -+ continue; -+ } else if (index < LONG_MIN) { -+ continue; -+ } -+ if (NULL == (token = strtok_r(dataptr, " ", &saveptr1))) -+ break; -+ dataptr = NULL; -+ msg->vals[index].OutType = atoi(token); -+ } else { -+ index = strtol(token, &delim, 0); -+ if (ERANGE == errno) { -+ continue; -+ } else if (index > LONG_MAX) { -+ continue; -+ } else if (index < LONG_MIN) { -+ continue; -+ } -+ if(NULL == (token = strtok_r(dataptr, " ", &saveptr1))) -+ break; -+ dataptr = NULL; -+ msg->vals[index].InType = atoi(token); -+ } -+ } -+ return 0; -+} - - int - linux_read_mibII_stats(void) - { - FILE *in = fopen("/proc/net/snmp", "r"); --#ifdef NETSNMP_ENABLE_IPV6 -- FILE *in6; -- unsigned long value; --#endif -- char line[1024]; -- -+ char line[1024], data[1024]; -+ int ret = 0; - if (!in) { - DEBUGMSGTL(("mibII/kernel_linux","Unable to open /proc/net/snmp")); - return -1; - } - -- -+ memset(line, '\0', sizeof(line)); -+ memset(data, '\0', sizeof(data)); - while (line == fgets(line, sizeof(line), in)) { - if (!strncmp(line, IP_STATS_LINE, IP_STATS_PREFIX_LEN)) { - sscanf(line, IP_STATS_LINE, -@@ -104,6 +170,19 @@ linux_read_mibII_stats(void) - &cached_icmp_mib.icmpOutTimestampReps, - &cached_icmp_mib.icmpOutAddrMasks, - &cached_icmp_mib.icmpOutAddrMaskReps); -+ } else if (!strncmp(line, ICMP_MSG_STATS_LINE, ICMP_MSG_STATS_PREFIX_LEN)) { -+ /* -+ * Note: We have to do this differently from other stats as the -+ * counters to this stats are dynamic. So we will not know the -+ * number of counters at a given time. -+ */ -+ fgets(data, sizeof(data), in); -+ if(decode_icmp_msg(line + ICMP_MSG_STATS_PREFIX_LEN, -+ data + ICMP_MSG_STATS_PREFIX_LEN, -+ &cached_icmp4_msg_mib) < 0) { -+ continue; -+ } -+ ret = 1; - } else if (!strncmp(line, TCP_STATS_LINE, TCP_STATS_PREFIX_LEN)) { - int ret = sscanf(line, TCP_STATS_LINE, - &cached_tcp_mib.tcpRtoAlgorithm, -@@ -132,35 +211,6 @@ linux_read_mibII_stats(void) - } - fclose(in); - --#ifdef NETSNMP_ENABLE_IPV6 -- in6 = fopen("/proc/net/snmp6", "r"); -- if (in6) { -- -- while (line == fgets(line, sizeof(line), in6)) { -- -- if (('U' != line[0]) || -- (0 != strncmp(line, UDP6_STATS_LINE, UDP6_STATS_PREFIX_LEN))) -- continue; -- -- sscanf(line, "%*s %lu" , &value); -- -- if ('O' == line[4]) /* Udp6OutDatagrams */ -- cached_udp_mib.udpOutDatagrams += value; -- else if ('N' == line[4]) /* Udp6NoPorts */ -- cached_udp_mib.udpNoPorts += value; -- else if ('D' == line[6]) /* Udp6InDatagrams */ -- cached_udp_mib.udpInDatagrams += value; -- else if ('E' == line[6]) /* Udp6InErrors */ -- cached_udp_mib.udpInErrors += value; -- -- } -- fclose(in6); -- } else { -- DEBUGMSGTL(("mibII/kernel_linux","Unable to open /proc/net/snmp6")); -- } -- --#endif -- - /* - * Tweak illegal values: - * -@@ -176,7 +226,8 @@ linux_read_mibII_stats(void) - */ - if (!cached_tcp_mib.tcpRtoAlgorithm) - cached_tcp_mib.tcpRtoAlgorithm = 1; -- return 0; -+ -+ return ret; - } - - int -@@ -189,18 +240,305 @@ linux_read_ip_stat(struct ip_mib *ipstat) - return 0; - } - -+int linux_read_ip6_stat( struct ip6_mib *ip6stat) -+{ -+#ifdef NETSNMP_ENABLE_IPV6 -+ FILE *in; -+ char line[1024]; -+ unsigned long stats; -+ char *endp; -+ int match; -+#endif -+ -+ memset((char *) ip6stat, (0), sizeof(*ip6stat)); -+ -+#ifdef NETSNMP_ENABLE_IPV6 -+ DEBUGMSGTL(("mibII/kernel_linux/ip6stats", -+ "Reading /proc/net/snmp6 stats\n")); -+ if (NULL == (in = fopen("/proc/net/snmp6", "r"))) { -+ DEBUGMSGTL(("mibII/kernel_linux/ip6stats", -+ "Failed to open /proc/net/snmp6\n")); -+ return -1; -+ } -+ -+ while (NULL != fgets(line, sizeof(line), in)) { -+ if (0 != strncmp(line, IP6_STATS_LINE, IP6_STATS_PREFIX_LEN)) -+ continue; -+ -+ if (1 != sscanf(line, "%*s %lu", &stats)) -+ continue; -+ -+ endp = strchr(line, ' '); -+ *endp = '\0'; -+ DEBUGMSGTL(("mibII/kernel_linux/ip6stats", "Find tag: %s\n", line)); -+ -+ match = 1; -+ if (0 == strncmp(line + 3, "In", 2)) { /* In */ -+ if (0 == strcmp(line + 5, "AddrErrors")) { -+ cached_ip6_mib.ip6InAddrErrors = stats; -+ } else if (0 == strcmp(line + 5, "Delivers")) { -+ cached_ip6_mib.ip6InDelivers = stats; -+ } else if (0 == strcmp(line + 5, "Discards")) { -+ cached_ip6_mib.ip6InDiscards = stats; -+ } else if (0 == strcmp(line + 5, "HdrErrors")) { -+ cached_ip6_mib.ip6InHdrErrors = stats; -+ } else if (0 == strcmp(line + 5, "McastPkts")) { -+ cached_ip6_mib.ip6InMcastPkts = stats; -+ } else if (0 == strcmp(line + 5, "NoRoutes")) { -+ cached_ip6_mib.ip6InNoRoutes = stats; -+ } else if (0 == strcmp(line + 5, "Receives")) { -+ cached_ip6_mib.ip6InReceives = stats; -+ } else if (0 == strcmp(line + 5, "TruncatedPkts")) { -+ cached_ip6_mib.ip6InTruncatedPkts = stats; -+ } else if (0 == strcmp(line + 5, "TooBigErrors")) { -+ cached_ip6_mib.ip6InTooBigErrors = stats; -+ } else if (0 == strcmp(line + 5, "UnknownProtos")) { -+ cached_ip6_mib.ip6InUnknownProtos = stats; -+ } else { -+ match = 0; -+ } -+ } else if (0 == strncmp(line + 3, "Out", 3)) { /* Out */ -+ if (0 == strcmp(line + 6, "Discards")) { -+ cached_ip6_mib.ip6OutDiscards = stats; -+ } else if (0 == strcmp(line + 6, "ForwDatagrams")) { -+ cached_ip6_mib.ip6OutForwDatagrams = stats; -+ } else if (0 == strcmp(line + 6, "McastPkts")) { -+ cached_ip6_mib.ip6OutMcastPkts = stats; -+ } else if (0 == strcmp(line + 6, "NoRoutes")) { -+ cached_ip6_mib.ip6OutNoRoutes = stats; -+ } else if (0 == strcmp(line + 6, "Requests")) { -+ cached_ip6_mib.ip6OutRequests = stats; -+ } else { -+ match = 0; -+ } -+ } else if (0 == strncmp(line + 3, "Reasm", 5)) { /* Reasm */ -+ if (0 == strcmp(line + 8, "Fails")) { -+ cached_ip6_mib.ip6ReasmFails = stats; -+ } else if (0 == strcmp(line + 8, "OKs")) { -+ cached_ip6_mib.ip6ReasmOKs = stats; -+ } else if (0 == strcmp(line + 8, "Reqds")) { -+ cached_ip6_mib.ip6ReasmReqds = stats; -+ } else if (0 == strcmp(line + 8, "Timeout")) { -+ cached_ip6_mib.ip6ReasmTimeout = stats; -+ } else { -+ match = 0; -+ } -+ } else if (0 == strncmp(line + 3, "Frag", 4)) { /* Frag */ -+ if (0 == strcmp(line + 7, "Creates")) { -+ cached_ip6_mib.ip6FragCreates = stats; -+ } else if (0 == strcmp(line + 7, "Fails")) { -+ cached_ip6_mib.ip6FragFails = stats; -+ } else if (0 == strcmp(line + 7, "OKs")) { -+ cached_ip6_mib.ip6FragOKs = stats; -+ } else { -+ match = 0; -+ } -+ } else { -+ match = 0; -+ } -+ -+ if(!match) -+ DEBUGMSGTL(("mibII/kernel_linux/ip6stats", -+ "%s is an unknown tag\n", line)); -+ } -+ -+ fclose(in); -+#endif -+ -+ memcpy((char *) ip6stat, (char *) &cached_ip6_mib, sizeof(*ip6stat)); -+ return 0; -+} -+ -+int -+linux_read_icmp_msg_stat(struct icmp_mib *icmpstat, -+ struct icmp4_msg_mib *icmpmsgstat, -+ int *flag) -+{ -+ int ret; -+ -+ memset(icmpstat, 0, sizeof(*icmpstat)); -+ memset(icmpmsgstat, 0, sizeof(*icmpmsgstat)); -+ -+ if ((ret = linux_read_mibII_stats()) == -1) { -+ return -1; -+ } else if (ret) { -+ memcpy(icmpmsgstat, &cached_icmp4_msg_mib, sizeof(*icmpmsgstat)); -+ *flag = 1; /* We have a valid icmpmsg */ -+ } -+ -+ memcpy(icmpstat, &cached_icmp_mib, sizeof(*icmpstat)); -+ return 0; -+} -+ -+ -+ -+int -+linux_read_icmp6_parse(struct icmp6_mib *icmp6stat, -+ struct icmp6_msg_mib *icmp6msgstat, -+ int *support) -+{ -+#ifdef NETSNMP_ENABLE_IPV6 -+ FILE *in; -+ char line[1024]; -+ char name[255]; -+ unsigned long stats; -+ char *endp ,*token, *vals; -+ int match; -+#endif -+ -+ memset(icmp6stat, 0, sizeof(*icmp6stat)); -+ if (NULL != icmp6msgstat) -+ memset(icmp6msgstat, 0, sizeof(*icmp6msgstat)); -+ -+#ifdef NETSNMP_ENABLE_IPV6 -+ DEBUGMSGTL(("mibII/kernel_linux/icmp6stats", -+ "Reading /proc/net/snmp6 stats\n")); -+ if (NULL == (in = fopen("/proc/net/snmp6", "r"))) { -+ DEBUGMSGTL(("mibII/kernel_linux/icmp6stats", -+ "Failed to open /proc/net/snmp6\n")); -+ return -1; -+ } -+ -+ while (NULL != fgets(line, sizeof(line), in)) { -+ if (0 != strncmp(line, ICMP6_STATS_LINE, ICMP6_STATS_PREFIX_LEN)) -+ continue; -+ -+ if (2 != sscanf(line, "%s %lu", name, &stats)) -+ continue; -+ -+ endp = strchr(line, ' '); -+ *endp = '\0'; -+ DEBUGMSGTL(("mibII/kernel_linux/icmp6stats", "Find tag: %s\n", line)); -+ -+ vals = name; -+ if (NULL != icmp6msgstat) { -+ if (0 == strncmp(name, "Icmp6OutType", 12)) { -+ token = strsep(&vals, "e"); -+ icmp6msgstat->vals[atoi(vals)].OutType = stats; -+ *support = 1; -+ continue; -+ } else if (0 == strncmp(name, "Icmp6InType", 11)) { -+ token = strsep(&vals, "e"); -+ icmp6msgstat->vals[atoi(vals)].InType = stats; -+ *support = 1; -+ continue; -+ } -+ } -+ -+ match = 1; -+ if (0 == strncmp(line + 5, "In", 2)) { /* In */ -+ if (0 == strcmp(line + 7, "DestUnreachs")) { -+ cached_icmp6_mib.icmp6InDestUnreachs = stats; -+ } else if (0 == strcmp(line + 7, "Echos")) { -+ cached_icmp6_mib.icmp6InEchos = stats; -+ } else if (0 == strcmp(line + 7, "EchoReplies")) { -+ cached_icmp6_mib.icmp6InEchoReplies = stats; -+ } else if (0 == strcmp(line + 7, "Errors")) { -+ cached_icmp6_mib.icmp6InErrors = stats; -+ } else if (0 == strcmp(line + 7, "GroupMembQueries")) { -+ cached_icmp6_mib.icmp6InGroupMembQueries = stats; -+ } else if (0 == strcmp(line + 7, "GroupMembReductions")) { -+ cached_icmp6_mib.icmp6InGroupMembReductions = stats; -+ } else if (0 == strcmp(line + 7, "GroupMembResponses")) { -+ cached_icmp6_mib.icmp6InGroupMembResponses = stats; -+ } else if (0 == strcmp(line + 7, "Msgs")) { -+ cached_icmp6_mib.icmp6InMsgs = stats; -+ } else if (0 == strcmp(line + 7, "NeighborAdvertisements")) { -+ cached_icmp6_mib.icmp6InNeighborAdvertisements = stats; -+ } else if (0 == strcmp(line + 7, "NeighborSolicits")) { -+ cached_icmp6_mib.icmp6InNeighborSolicits = stats; -+ } else if (0 == strcmp(line + 7, "PktTooBigs")) { -+ cached_icmp6_mib.icmp6InPktTooBigs = stats; -+ } else if (0 == strcmp(line + 7, "ParmProblems")) { -+ cached_icmp6_mib.icmp6InParmProblems = stats; -+ } else if (0 == strcmp(line + 7, "Redirects")) { -+ cached_icmp6_mib.icmp6InRedirects = stats; -+ } else if (0 == strcmp(line + 7, "RouterAdvertisements")) { -+ cached_icmp6_mib.icmp6InRouterAdvertisements = stats; -+ } else if (0 == strcmp(line + 7, "RouterSolicits")) { -+ cached_icmp6_mib.icmp6InRouterSolicits = stats; -+ } else if (0 == strcmp(line + 7, "TimeExcds")) { -+ cached_icmp6_mib.icmp6InTimeExcds = stats; -+ } else { -+ match = 0; -+ } -+ } else if (0 == strncmp(line + 5, "Out", 3)) { /* Out */ -+ if (0 == strcmp(line + 8, "DestUnreachs")) { -+ cached_icmp6_mib.icmp6OutDestUnreachs = stats; -+ } else if (0 == strcmp(line + 8, "EchoReplies")) { -+ cached_icmp6_mib.icmp6OutEchoReplies = stats; -+ } else if (0 == strcmp(line + 8, "GroupMembReductions")) { -+ cached_icmp6_mib.icmp6OutGroupMembReductions = stats; -+ } else if (0 == strcmp(line + 8, "GroupMembResponses")) { -+ cached_icmp6_mib.icmp6OutGroupMembResponses = stats; -+ } else if (0 == strcmp(line + 8, "Msgs")) { -+ cached_icmp6_mib.icmp6OutMsgs = stats; -+ } else if (0 == strcmp(line + 8, "NeighborAdvertisements")) { -+ cached_icmp6_mib.icmp6OutNeighborAdvertisements = stats; -+ } else if (0 == strcmp(line + 8, "NeighborSolicits")) { -+ cached_icmp6_mib.icmp6OutNeighborSolicits = stats; -+ } else if (0 == strcmp(line + 8, "PktTooBigs")) { -+ cached_icmp6_mib.icmp6OutPktTooBigs = stats; -+ } else if (0 == strcmp(line + 8, "ParmProblems")) { -+ cached_icmp6_mib.icmp6OutParmProblems = stats; -+ } else if (0 == strcmp(line + 8, "Redirects")) { -+ cached_icmp6_mib.icmp6OutRedirects = stats; -+ } else if (0 == strcmp(line + 8, "RouterSolicits")) { -+ cached_icmp6_mib.icmp6OutRouterSolicits = stats; -+ } else if (0 == strcmp(line + 8, "TimeExcds")) { -+ cached_icmp6_mib.icmp6OutTimeExcds = stats; -+ } else { -+ match = 0; -+ } -+ } else { -+ match = 0; -+ } -+ if(!match) -+ DEBUGMSGTL(("mibII/kernel_linux/icmp6stats", -+ "%s is an unknown tag\n", line)); -+ } -+ -+ fclose(in); -+#endif -+ -+ memcpy((char *) icmp6stat, (char *) &cached_icmp6_mib, -+ sizeof(*icmp6stat)); -+ return 0; -+} -+ -+int -+linux_read_icmp6_msg_stat(struct icmp6_mib *icmp6stat, -+ struct icmp6_msg_mib *icmp6msgstat, -+ int *support) -+{ -+ if (linux_read_icmp6_parse(icmp6stat, icmp6msgstat, support) < 0) -+ return -1; -+ else -+ return 0; -+} -+ - int - linux_read_icmp_stat(struct icmp_mib *icmpstat) - { - memset((char *) icmpstat, (0), sizeof(*icmpstat)); - if (linux_read_mibII_stats() == -1) -- return -1; -+ return -1; -+ - memcpy((char *) icmpstat, (char *) &cached_icmp_mib, -- sizeof(*icmpstat)); -+ sizeof(*icmpstat)); - return 0; - } - - int -+linux_read_icmp6_stat(struct icmp6_mib *icmp6stat) -+{ -+ if (linux_read_icmp6_parse(icmp6stat, NULL, NULL) < 0) -+ return -1; -+ else -+ return 0; -+} -+ -+int - linux_read_tcp_stat(struct tcp_mib *tcpstat) - { - memset((char *) tcpstat, (0), sizeof(*tcpstat)); -@@ -216,6 +554,73 @@ linux_read_udp_stat(struct udp_mib *udpstat) - memset((char *) udpstat, (0), sizeof(*udpstat)); - if (linux_read_mibII_stats() == -1) - return -1; -+ -+#ifdef NETSNMP_ENABLE_IPV6 -+ { -+ struct udp6_mib udp6stat; -+ memset(&udp6stat, 0, sizeof(udp6stat)); -+ -+ if (linux_read_udp6_stat(&udp6stat) == 0) { -+ cached_udp_mib.udpOutDatagrams += udp6stat.udp6OutDatagrams; -+ cached_udp_mib.udpNoPorts += udp6stat.udp6NoPorts; -+ cached_udp_mib.udpInDatagrams += udp6stat.udp6InDatagrams; -+ cached_udp_mib.udpInErrors += udp6stat.udp6InErrors; -+ } -+ } -+#endif - memcpy((char *) udpstat, (char *) &cached_udp_mib, sizeof(*udpstat)); - return 0; - } -+ -+int -+linux_read_udp6_stat(struct udp6_mib *udp6stat) -+{ -+#ifdef NETSNMP_ENABLE_IPV6 -+ FILE *in; -+ char line[1024]; -+ unsigned long stats; -+ char *endp; -+#endif -+ -+ memset(udp6stat, 0, sizeof(*udp6stat)); -+ -+#ifdef NETSNMP_ENABLE_IPV6 -+ DEBUGMSGTL(("mibII/kernel_linux/udp6stats", -+ "Reading /proc/net/snmp6 stats\n")); -+ if (NULL == (in = fopen("/proc/net/snmp6", "r"))) { -+ DEBUGMSGTL(("mibII/kernel_linux/udp6stats", -+ "Failed to open /proc/net/snmp6\n")); -+ return -1; -+ } -+ -+ while (NULL != fgets(line, sizeof(line), in)) { -+ if (0 != strncmp(line, UDP6_STATS_LINE, UDP6_STATS_PREFIX_LEN)) -+ continue; -+ -+ if (1 != sscanf(line, "%*s %lu", &stats)) -+ continue; -+ -+ endp = strchr(line, ' '); -+ *endp = '\0'; -+ DEBUGMSGTL(("mibII/kernel_linux/udp6stats", "Find tag: %s\n", line)); -+ -+ if (0 == strcmp(line + 4, "OutDatagrams")) { -+ cached_udp6_mib.udp6OutDatagrams = stats; -+ } else if (0 == strcmp(line + 4, "NoPorts")) { -+ cached_udp6_mib.udp6NoPorts = stats; -+ } else if (0 == strcmp(line + 4, "InDatagrams")) { -+ cached_udp6_mib.udp6InDatagrams = stats; -+ } else if (0 == strcmp(line + 4, "InErrors")) { -+ cached_udp6_mib.udp6InErrors = stats; -+ } else { -+ DEBUGMSGTL(("mibII/kernel_linux/udp6stats", -+ "%s is an unknown tag\n", line)); -+ } -+ } -+ -+ fclose(in); -+#endif -+ -+ memcpy((char *) udp6stat, (char *) &cached_udp6_mib, sizeof(*udp6stat)); -+ return 0; -+} -diff --git a/agent/mibgroup/mibII/kernel_linux.h b/agent/mibgroup/mibII/kernel_linux.h -index fb7db96..6bf5d47 100644 ---- a/agent/mibgroup/mibII/kernel_linux.h -+++ b/agent/mibgroup/mibII/kernel_linux.h -@@ -29,6 +29,31 @@ struct ip_mib { - unsigned long ipRoutingDiscards; - }; - -+struct ip6_mib { -+ unsigned long ip6InReceives; -+ unsigned long ip6InHdrErrors; -+ unsigned long ip6InTooBigErrors; -+ unsigned long ip6InNoRoutes; -+ unsigned long ip6InAddrErrors; -+ unsigned long ip6InUnknownProtos; -+ unsigned long ip6InTruncatedPkts; -+ unsigned long ip6InDiscards; -+ unsigned long ip6InDelivers; -+ unsigned long ip6OutForwDatagrams; -+ unsigned long ip6OutRequests; -+ unsigned long ip6OutDiscards; -+ unsigned long ip6OutNoRoutes; -+ unsigned long ip6ReasmTimeout; -+ unsigned long ip6ReasmReqds; -+ unsigned long ip6ReasmOKs; -+ unsigned long ip6ReasmFails; -+ unsigned long ip6FragOKs; -+ unsigned long ip6FragFails; -+ unsigned long ip6FragCreates; -+ unsigned long ip6InMcastPkts; -+ unsigned long ip6OutMcastPkts; -+}; -+ - struct icmp_mib { - unsigned long icmpInMsgs; - unsigned long icmpInErrors; -@@ -58,6 +83,51 @@ struct icmp_mib { - unsigned long icmpOutAddrMaskReps; - }; - -+struct icmp6_mib { -+ unsigned long icmp6InMsgs; -+ unsigned long icmp6InErrors; -+ unsigned long icmp6InDestUnreachs; -+ unsigned long icmp6InPktTooBigs; -+ unsigned long icmp6InTimeExcds; -+ unsigned long icmp6InParmProblems; -+ unsigned long icmp6InEchos; -+ unsigned long icmp6InEchoReplies; -+ unsigned long icmp6InGroupMembQueries; -+ unsigned long icmp6InGroupMembResponses; -+ unsigned long icmp6InGroupMembReductions; -+ unsigned long icmp6InRouterSolicits; -+ unsigned long icmp6InRouterAdvertisements; -+ unsigned long icmp6InNeighborSolicits; -+ unsigned long icmp6InNeighborAdvertisements; -+ unsigned long icmp6InRedirects; -+ unsigned long icmp6OutMsgs; -+ unsigned long icmp6OutDestUnreachs; -+ unsigned long icmp6OutPktTooBigs; -+ unsigned long icmp6OutTimeExcds; -+ unsigned long icmp6OutParmProblems; -+ unsigned long icmp6OutEchoReplies; -+ unsigned long icmp6OutRouterSolicits; -+ unsigned long icmp6OutNeighborSolicits; -+ unsigned long icmp6OutNeighborAdvertisements; -+ unsigned long icmp6OutRedirects; -+ unsigned long icmp6OutGroupMembResponses; -+ unsigned long icmp6OutGroupMembReductions; -+}; -+ -+struct icmp_msg_mib { -+ unsigned long InType; -+ unsigned long OutType; -+}; -+ -+/* Lets use wrapper structures for future expansion */ -+struct icmp4_msg_mib { -+ struct icmp_msg_mib vals[255]; -+}; -+ -+struct icmp6_msg_mib { -+ struct icmp_msg_mib vals[255]; -+}; -+ - struct udp_mib { - unsigned long udpInDatagrams; - unsigned long udpNoPorts; -@@ -65,6 +135,13 @@ struct udp_mib { - unsigned long udpOutDatagrams; - }; - -+struct udp6_mib { -+ unsigned long udp6InDatagrams; -+ unsigned long udp6NoPorts; -+ unsigned long udp6InErrors; -+ unsigned long udp6OutDatagrams; -+}; -+ - struct tcp_mib { - unsigned long tcpRtoAlgorithm; - unsigned long tcpRtoMin; -@@ -86,8 +163,17 @@ struct tcp_mib { - - - int linux_read_ip_stat(struct ip_mib *); -+int linux_read_ip6_stat(struct ip6_mib *); - int linux_read_icmp_stat(struct icmp_mib *); -+int linux_read_icmp6_stat(struct icmp6_mib *); - int linux_read_udp_stat(struct udp_mib *); -+int linux_read_udp6_stat(struct udp6_mib *); - int linux_read_tcp_stat(struct tcp_mib *); -+int linux_read_icmp_msg_stat(struct icmp_mib *, -+ struct icmp4_msg_mib *, -+ int *flag); -+int linux_read_icmp6_msg_stat(struct icmp6_mib *, -+ struct icmp6_msg_mib *, -+ int *support); - - #endif /* _MIBGROUP_KERNEL_LINUX_H */ -diff --git a/configure b/configure -index 322d5ac..1b062bf 100755 ---- a/configure -+++ b/configure -@@ -33746,7 +33746,7 @@ done - - - --for ac_header in arpa/inet.h netinet/in_systm.h netinet/in.h netinet/ip_var.h netinet/tcp.h netinet/tcpip.h netinet/udp.h net/if.h netinet/in_var.h netinet/ip.h netinet/ip_icmp.h net/if_arp.h net/if_mib.h net/if_var.h netinet/if_ether.h netinet/tcp_timer.h netinet/tcp_var.h netinet/udp_var.h netinet/icmp_var.h netdb.h net/route.h -+for ac_header in arpa/inet.h netinet/in_systm.h netinet/in.h netinet/ip_var.h netinet/tcp.h netinet/tcpip.h netinet/udp.h net/if.h netinet/in_var.h netinet/ip.h netinet/ip_icmp.h netinet/icmp6.h net/if_arp.h net/if_mib.h net/if_var.h netinet/if_ether.h netinet/tcp_timer.h netinet/tcp_var.h netinet/udp_var.h netinet/icmp_var.h netdb.h net/route.h - do - as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` - echo "$as_me:$LINENO: checking for $ac_header" >&5 -@@ -33794,6 +33794,9 @@ cat >>conftest.$ac_ext <<_ACEOF - #if HAVE_NETINET_IP_ICMP_H - #include - #endif -+#if HAVE_NETINET_ICMP6_H -+#include -+#endif - #if HAVE_NETINET_TCP_H - #include - #endif -diff --git a/configure.in b/configure.in -index 82c22b8..3ad7955 100644 ---- a/configure.in -+++ b/configure.in -@@ -3247,7 +3247,7 @@ AC_INCLUDES_DEFAULT([]) - ]) - AC_CHECK_HEADERS(sys/timeout.h sys/un.h fstab.h sys/fs.h mtab.h ufs/fs.h sys/fixpoint.h machine/param.h sys/vm.h vm/vm.h sys/vmmeter.h sys/vmparam.h sys/vmmac.h sys/vmsystm.h sys/time.h sys/times.h sys/statvfs.h sys/vfs.h sys/mnttab.h sys/select.h mntent.h sys/mntent.h kstat.h utsname.h sys/utsname.h sys/cdefs.h getopt.h locale.h pthread.h sys/loadavg.h regex.h linux/tasks.h pwd.h grp.h utmpx.h) - # Network headers --AC_CHECK_HEADERS(arpa/inet.h netinet/in_systm.h netinet/in.h netinet/ip_var.h netinet/tcp.h netinet/tcpip.h netinet/udp.h net/if.h netinet/in_var.h netinet/ip.h netinet/ip_icmp.h net/if_arp.h net/if_mib.h net/if_var.h netinet/if_ether.h netinet/tcp_timer.h netinet/tcp_var.h netinet/udp_var.h netinet/icmp_var.h netdb.h net/route.h,,, -+AC_CHECK_HEADERS(arpa/inet.h netinet/in_systm.h netinet/in.h netinet/ip_var.h netinet/tcp.h netinet/tcpip.h netinet/udp.h net/if.h netinet/in_var.h netinet/ip.h netinet/ip_icmp.h netinet/icmp6.h net/if_arp.h net/if_mib.h net/if_var.h netinet/if_ether.h netinet/tcp_timer.h netinet/tcp_var.h netinet/udp_var.h netinet/icmp_var.h netdb.h net/route.h,,, - [[ - #if HAVE_SYS_TYPES_H - #include -@@ -3282,6 +3282,9 @@ AC_CHECK_HEADERS(arpa/inet.h netinet/in_systm.h netinet/in.h netinet/ip_var.h ne - #if HAVE_NETINET_IP_ICMP_H - #include - #endif -+#if HAVE_NETINET_ICMP6_H -+#include -+#endif - #if HAVE_NETINET_TCP_H - #include - #endif -diff --git a/include/net-snmp/net-snmp-config.h.in b/include/net-snmp/net-snmp-config.h.in -index 1be4ca4..2c93d11 100644 ---- a/include/net-snmp/net-snmp-config.h.in -+++ b/include/net-snmp/net-snmp-config.h.in -@@ -588,6 +588,9 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_NETINET_IP_ICMP_H - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_NETINET_ICMP6_H -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_NETINET_IP_VAR_H - -diff --git a/win32/net-snmp/net-snmp-config.h.in b/win32/net-snmp/net-snmp-config.h.in -index bf2d2dc..1654562 100644 ---- a/win32/net-snmp/net-snmp-config.h.in -+++ b/win32/net-snmp/net-snmp-config.h.in -@@ -486,6 +486,9 @@ - /* Define to 1 if you have the header file. */ - /* #undef HAVE_NETINET_IP_ICMP_H */ - -+/* Define to 1 if you have the header file. */ -+/* #undef HAVE_NETINET_ICMP6_H */ -+ - /* Define to 1 if you have the header file. */ - /* #undef HAVE_NETINET_IP_VAR_H */ - --- -1.6.0.2 - diff --git a/Add-IPv6-Scope-Zone-Index.patch b/Add-IPv6-Scope-Zone-Index.patch deleted file mode 100644 index cc166f5..0000000 --- a/Add-IPv6-Scope-Zone-Index.patch +++ /dev/null @@ -1,3481 +0,0 @@ -From 4d63cceb36d6a178aecd4a8e134b6eae795dfdab Mon Sep 17 00:00:00 2001 -From: Mitsuru Chinen -Date: Mon, 20 Oct 2008 17:51:43 +0900 -Subject: [PATCH] Add IPv6 Scope Zone Index - -[ 1715405 ] Adding ipv6ScopeZoneIndexTable -http://sourceforge.net/tracker/index.php?func=detail&aid=1715405&group_id=12694&atid=312694 - -[ 1897883 ] Fix ipv6ScopeZoneIndexTable on Linux -http://sourceforge.net/tracker/index.php?func=detail&aid=1897883&group_id=12694&atid=312694 - -Signed-off-by: Mitsuru Chinen ---- - agent/mibgroup/ip-mib/data_access/ipv6scopezone.h | 30 + - .../ip-mib/data_access/ipv6scopezone_common.c | 152 +++ - .../ip-mib/data_access/ipv6scopezone_linux.c | 141 +++ - agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable.h | 5 + - .../ipv6ScopeZoneIndexTable.c | 1004 +++++++++++++++++ - .../ipv6ScopeZoneIndexTable.h | 269 +++++ - .../ipv6ScopeZoneIndexTable_data_access.c | 304 ++++++ - .../ipv6ScopeZoneIndexTable_data_access.h | 70 ++ - .../ipv6ScopeZoneIndexTable_enums.h | 39 + - .../ipv6ScopeZoneIndexTable_interface.c | 1124 ++++++++++++++++++++ - .../ipv6ScopeZoneIndexTable_interface.h | 98 ++ - .../ipv6ScopeZoneIndexTable_oids.h | 55 + - include/net-snmp/data_access/scopezone.h | 68 ++ - 13 files changed, 3359 insertions(+), 0 deletions(-) - create mode 100644 agent/mibgroup/ip-mib/data_access/ipv6scopezone.h - create mode 100644 agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c - create mode 100644 agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c - create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable.h - create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.c - create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h - create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.c - create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h - create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_enums.h - create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c - create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h - create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h - create mode 100644 include/net-snmp/data_access/scopezone.h - -diff --git a/agent/mibgroup/ip-mib/data_access/ipv6scopezone.h b/agent/mibgroup/ip-mib/data_access/ipv6scopezone.h -new file mode 100644 -index 0000000..8d81b3f ---- /dev/null -+++ b/agent/mibgroup/ip-mib/data_access/ipv6scopezone.h -@@ -0,0 +1,30 @@ -+/* -+ * scopezone data access header -+ * -+ * $Id: ipv6scopezone.h 14170 2007-04-29 02:22:12Z varun_c $ -+ */ -+/**---------------------------------------------------------------------*/ -+/* -+ * 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/ipv6scopezone_common) -+#if defined( linux ) -+config_require(ip-mib/data_access/ipv6scopezone_linux) -+#else -+/* -+ * couldn't determine the correct file! -+ * require a bogus file to generate an error. -+ */ -+config_require(ip-mib/data_access/ipv6scopezone-unknown-arch); -+#endif -+ -diff --git a/agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c b/agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c -new file mode 100644 -index 0000000..fdf712b ---- /dev/null -+++ b/agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c -@@ -0,0 +1,152 @@ -+/* -+ * ipv6ScopeIndexTable MIB architecture support -+ * -+ * $Id: ipv6scopezone_common.c 14170 2007-04-29 02:22:12Z varun_c $ -+ */ -+#include -+#include -+ -+#include -+#include -+/* -+ * local static prototypes -+ */ -+static void _entry_release(netsnmp_v6scopezone_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_scopezone_container_arch_load(netsnmp_container* container, -+ u_int load_flags); -+extern void -+netsnmp_access_scopezone_arch_init(void); -+ -+/** -+ * initialize systemstats container -+ */ -+netsnmp_container * -+netsnmp_access_scopezone_container_init(u_int flags) -+{ -+ netsnmp_container *container; -+ -+ DEBUGMSGTL(("access:scopezone:container", "init\n")); -+ /* -+ * create the containers. one indexed by ifIndex, the other -+ * indexed by ifName. -+ */ -+ container = netsnmp_container_find("access_scopezone:table_container"); -+ if (NULL == container) -+ return NULL; -+ -+ return container; -+} -+ -+/** -+ * load scopezone 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_scopezone_container_load(netsnmp_container* container, u_int load_flags) -+{ -+ int rc; -+ -+ DEBUGMSGTL(("access:scopezone:container", "load\n")); -+ -+ if (NULL == container) -+ container = netsnmp_access_scopezone_container_init(load_flags); -+ if (NULL == container) { -+ snmp_log(LOG_ERR, "no container specified/found for access_scopezone\n"); -+ return NULL; -+ } -+ -+ rc = netsnmp_access_scopezone_container_arch_load(container, load_flags); -+ if (0 != rc) { -+ netsnmp_access_scopezone_container_free(container, -+ NETSNMP_ACCESS_SCOPEZONE_FREE_NOFLAGS); -+ container = NULL; -+ } -+ -+ return container; -+} -+ -+void -+netsnmp_access_scopezone_container_free(netsnmp_container *container, u_int free_flags) -+{ -+ DEBUGMSGTL(("access:scopezone:container", "free\n")); -+ -+ if (NULL == container) { -+ snmp_log(LOG_ERR, "invalid container for netsnmp_access_scopezone_free\n"); -+ return; -+ } -+ -+ if(! (free_flags & NETSNMP_ACCESS_SCOPEZONE_FREE_DONT_CLEAR)) { -+ /* -+ * free all items. -+ */ -+ CONTAINER_CLEAR(container, -+ (netsnmp_container_obj_func*)_entry_release, -+ NULL); -+ } -+ -+ CONTAINER_FREE(container); -+} -+ -+/** -+ */ -+netsnmp_v6scopezone_entry * -+netsnmp_access_scopezone_entry_create(void) -+{ -+ netsnmp_v6scopezone_entry *entry = -+ SNMP_MALLOC_TYPEDEF(netsnmp_v6scopezone_entry); -+ -+ DEBUGMSGTL(("access:scopezone:entry", "create\n")); -+ -+ if(NULL == entry) -+ return NULL; -+ -+ -+ entry->oid_index.len = 1; -+ entry->oid_index.oids = &entry->ns_scopezone_index; -+ -+ return entry; -+} -+ -+/** -+ */ -+void -+netsnmp_access_scopezone_entry_free(netsnmp_v6scopezone_entry * entry) -+{ -+ DEBUGMSGTL(("access:scopezone:entry", "free\n")); -+ -+ if (NULL == entry) -+ return; -+ -+ -+ free(entry); -+} -+ -+/**---------------------------------------------------------------------*/ -+/* -+ * Utility routines -+ */ -+ -+/** -+ * \internal -+ */ -+static void -+_entry_release(netsnmp_v6scopezone_entry * entry, void *context) -+{ -+ netsnmp_access_scopezone_entry_free(entry); -+} -+ -diff --git a/agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c b/agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c -new file mode 100644 -index 0000000..d89f53c ---- /dev/null -+++ b/agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c -@@ -0,0 +1,141 @@ -+/* -+ * Interface MIB architecture support -+ * -+ * $Id: ipv6scopezone_linux.c 14170 2007-04-29 02:22:12Z varun_c $ -+ */ -+#include -+#include -+ -+#include -+#include -+ -+#if defined (NETSNMP_ENABLE_IPV6) -+static int _scopezone_v6(netsnmp_container* container, int idx_offset); -+#endif -+ -+/* -+ * -+ * @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_scopezone_container_arch_load(netsnmp_container* container, -+ u_int load_flags) -+{ -+ int rc1 = 0, idx_offset = 0; -+#if defined (NETSNMP_ENABLE_IPV6) -+ -+ if (NULL == container) { -+ snmp_log(LOG_ERR, "no container specified/found for access_scopezone_\n"); -+ return -1; -+ } -+ -+ rc1 = _scopezone_v6(container, idx_offset); -+#endif -+ if(rc1 > 0) -+ rc1 = 0; -+ return rc1; -+} -+ -+#if defined (NETSNMP_ENABLE_IPV6) -+ -+/* scope identifiers, from kernel - include/net/ipv6.h */ -+#define IPV6_ADDR_LOOPBACK 0x0010U -+#define IPV6_ADDR_LINKLOCAL 0x0020U -+#define IPV6_ADDR_SITELOCAL 0x0040U -+ -+static int -+_scopezone_v6(netsnmp_container* container, int idx_offset) -+{ -+ -+ /* -+ * On Linux, we support only link-local scope zones. -+ * Each interface, which has link-local address, gets unique scope -+ * zone index. -+ */ -+ FILE *in; -+ char line[80], addr[40]; -+ int if_index, pfx_len, scope, flags, rc = 0; -+ int last_if_index = -1; -+ netsnmp_v6scopezone_entry *entry; -+ 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 %02x %02x %02x %02x\n", -+ addr, &if_index, &pfx_len, &scope, &flags); -+ if( 5 != rc ) { -+ snmp_log(LOG_ERR, PROCFILE " data format error (%d!=5), line ==|%s|\n", -+ rc, line); -+ continue; -+ } -+ DEBUGMSGTL(("access:scopezone:container", -+ "addr %s, index %d, pfx %d, scope %d, flags 0x%X\n", -+ addr, if_index, pfx_len, scope, flags)); -+ -+ if (! (scope & IPV6_ADDR_LINKLOCAL)) { -+ DEBUGMSGTL(("access:scopezone:container", -+ "The address is not link-local, skipping\n")); -+ continue; -+ } -+ /* -+ * Check that the interface was not inserted before, just in case -+ * one interface has two or more link-local addresses. -+ */ -+ if (last_if_index == if_index) { -+ DEBUGMSGTL(("access:scopezone:container", -+ "The interface was already inserted, skipping\n")); -+ continue; -+ } -+ -+ last_if_index = if_index; -+ entry = netsnmp_access_scopezone_entry_create(); -+ if(NULL == entry) { -+ rc = -3; -+ break; -+ } -+ entry->ns_scopezone_index = ++idx_offset; -+ entry->index = if_index; -+ entry->scopezone_linklocal = if_index; -+ -+ CONTAINER_INSERT(container, entry); -+ } -+ fclose(in); -+ if(rc<0) -+ return rc; -+ -+ return idx_offset; -+} -+#endif -diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable.h b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable.h -new file mode 100644 -index 0000000..779bd75 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable.h -@@ -0,0 +1,5 @@ -+/* -+ * module to include the modules -+ */ -+ -+config_require(ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable) -diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.c b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.c -new file mode 100644 -index 0000000..edd6586 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.c -@@ -0,0 +1,1004 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:ipv6ScopeZoneIndexTable.c 14170 2007-04-29 00:12:32Z varun_c$ -+ */ -+/** \page MFD helper for ipv6ScopeZoneIndexTable -+ * -+ * \section intro Introduction -+ * Introductory text. -+ * -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "ipv6ScopeZoneIndexTable.h" -+ -+#include -+ -+#include "ipv6ScopeZoneIndexTable_interface.h" -+ -+oid ipv6ScopeZoneIndexTable_oid[] = -+ { IPV6SCOPEZONEINDEXTABLE_OID }; -+int ipv6ScopeZoneIndexTable_oid_size = -+OID_LENGTH(ipv6ScopeZoneIndexTable_oid); -+ -+ipv6ScopeZoneIndexTable_registration ipv6ScopeZoneIndexTable_user_context; -+ -+void initialize_table_ipv6ScopeZoneIndexTable(void); -+void shutdown_table_ipv6ScopeZoneIndexTable(void); -+ -+ -+/** -+ * Initializes the ipv6ScopeZoneIndexTable module -+ */ -+void -+init_ipv6ScopeZoneIndexTable(void) -+{ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:init_ipv6ScopeZoneIndexTable", "called\n")); -+ -+ /* -+ * TODO:300:o: Perform ipv6ScopeZoneIndexTable one-time module initialization. -+ */ -+ -+ /* -+ * here we initialize all the tables we're planning on supporting -+ */ -+ if (should_init("ipv6ScopeZoneIndexTable")) -+ initialize_table_ipv6ScopeZoneIndexTable(); -+ -+} /* init_ipv6ScopeZoneIndexTable */ -+ -+/** -+ * Shut-down the ipv6ScopeZoneIndexTable module (agent is exiting) -+ */ -+void -+shutdown_ipv6ScopeZoneIndexTable(void) -+{ -+ if (should_init("ipv6ScopeZoneIndexTable")) -+ shutdown_table_ipv6ScopeZoneIndexTable(); -+ -+} -+ -+/** -+ * Initialize the table ipv6ScopeZoneIndexTable -+ * (Define its contents and how it's structured) -+ */ -+void -+initialize_table_ipv6ScopeZoneIndexTable(void) -+{ -+ ipv6ScopeZoneIndexTable_registration *user_context; -+ u_long flags; -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:initialize_table_ipv6ScopeZoneIndexTable", "called\n")); -+ -+ /* -+ * TODO:301:o: Perform ipv6ScopeZoneIndexTable one-time table initialization. -+ */ -+ -+ /* -+ * TODO:302:o: |->Initialize ipv6ScopeZoneIndexTable 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("ipv6ScopeZoneIndexTable", NULL, NULL); -+ -+ /* -+ * No support for any flags yet, but in the future you would -+ * set any flags here. -+ */ -+ flags = 0; -+ -+ /* -+ * call interface initialization code -+ */ -+ _ipv6ScopeZoneIndexTable_initialize_interface(user_context, flags); -+} /* initialize_table_ipv6ScopeZoneIndexTable */ -+ -+/** -+ * Shutdown the table ipv6ScopeZoneIndexTable -+ */ -+void -+shutdown_table_ipv6ScopeZoneIndexTable(void) -+{ -+ /* -+ * call interface shutdown code -+ */ -+ _ipv6ScopeZoneIndexTable_shutdown_interface -+ (&ipv6ScopeZoneIndexTable_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 -+ipv6ScopeZoneIndexTable_rowreq_ctx_init(ipv6ScopeZoneIndexTable_rowreq_ctx -+ * rowreq_ctx, void *user_init_ctx) -+{ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_rowreq_ctx_init", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:210:o: |-> Perform extra ipv6ScopeZoneIndexTable rowreq initialization. (eg DEFVALS) -+ */ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexTable_rowreq_ctx_init */ -+ -+/** -+ * extra context cleanup -+ * -+ */ -+void -+ipv6ScopeZoneIndexTable_rowreq_ctx_cleanup -+ (ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_rowreq_ctx_cleanup", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:211:o: |-> Perform extra ipv6ScopeZoneIndexTable rowreq cleanup. -+ */ -+} /* ipv6ScopeZoneIndexTable_rowreq_ctx_cleanup */ -+ -+/** -+ * pre-request callback -+ * -+ * -+ * @retval MFD_SUCCESS : success. -+ * @retval MFD_ERROR : other error -+ */ -+int -+ipv6ScopeZoneIndexTable_pre_request(ipv6ScopeZoneIndexTable_registration * -+ user_context) -+{ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_pre_request", "called\n")); -+ -+ /* -+ * TODO:510:o: Perform ipv6ScopeZoneIndexTable pre-request actions. -+ */ -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexTable_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 -+ipv6ScopeZoneIndexTable_post_request(ipv6ScopeZoneIndexTable_registration * -+ user_context, int rc) -+{ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_post_request", "called\n")); -+ -+ /* -+ * TODO:511:o: Perform ipv6ScopeZoneIndexTable post-request actions. -+ */ -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexTable_post_request */ -+ -+/* -+ * ipv6ScopeZoneIndexTable_allocate_data -+ * -+ * Purpose: create new ipv6ScopeZoneIndexTable_data. -+ */ -+ipv6ScopeZoneIndexTable_data * -+ipv6ScopeZoneIndexTable_allocate_data(void) -+{ -+ /* -+ * TODO:201:r: |-> allocate memory for the ipv6ScopeZoneIndexTable data context. -+ */ -+ ipv6ScopeZoneIndexTable_data *rtn = netsnmp_access_scopezone_entry_create(); -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_allocate_data", "called\n")); -+ -+ if (NULL == rtn) { -+ snmp_log(LOG_ERR, "unable to malloc memory for new " -+ "ipv6ScopeZoneIndexTable_data.\n"); -+ } -+ -+ return rtn; -+} /* ipv6ScopeZoneIndexTable_allocate_data */ -+ -+/* -+ * ipv6ScopeZoneIndexTable_release_data -+ * -+ * Purpose: release ipv6ScopeZoneIndexTable data. -+ */ -+void -+ipv6ScopeZoneIndexTable_release_data(ipv6ScopeZoneIndexTable_data * data) -+{ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_release_data", "called\n")); -+ -+ /* -+ * TODO:202:r: |-> release memory for the ipv6ScopeZoneIndexTable data context. -+ */ -+ netsnmp_access_scopezone_entry_free(data); -+} /* ipv6ScopeZoneIndexTable_release_data */ -+ -+/** @defgroup data_get data_get: Routines to get data -+ * -+ * TODO:230:M: Implement ipv6ScopeZoneIndexTable get routines. -+ * TODO:240:M: Implement ipv6ScopeZoneIndexTable mapping routines (if any). -+ * -+ * These routine are used to get the value for individual objects. The -+ * row context is passed, along with a pointer to the memory where the -+ * value should be copied. -+ * -+ * @{ -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipv6ScopeZoneIndexTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * IP-MIB::ipv6ScopeZoneIndexTable is subid 36 of ip. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.36, length: 8 -+ */ -+ -+/* -+ * --------------------------------------------------------------------- -+ * * TODO:200:r: Implement ipv6ScopeZoneIndexTable data context functions. -+ */ -+ -+ -+/** -+ * set mib index(es) -+ * -+ * @param tbl_idx mib index structure -+ * @param ipv6ScopeZoneIndexIfIndex_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 -+ipv6ScopeZoneIndexTable_indexes_set_tbl_idx -+ (ipv6ScopeZoneIndexTable_mib_index * tbl_idx, -+ long ipv6ScopeZoneIndexIfIndex_val) -+{ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_indexes_set_tbl_idx", "called\n")); -+ -+ /* -+ * ipv6ScopeZoneIndexIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ tbl_idx->ipv6ScopeZoneIndexIfIndex = ipv6ScopeZoneIndexIfIndex_val; -+ -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexTable_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 -+ipv6ScopeZoneIndexTable_indexes_set(ipv6ScopeZoneIndexTable_rowreq_ctx * -+ rowreq_ctx, -+ long ipv6ScopeZoneIndexIfIndex_val) -+{ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_indexes_set", "called\n")); -+ -+ if (MFD_SUCCESS != -+ ipv6ScopeZoneIndexTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx, -+ ipv6ScopeZoneIndexIfIndex_val)) -+ return MFD_ERROR; -+ -+ /* -+ * convert mib index to oid index -+ */ -+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid); -+ if (0 != ipv6ScopeZoneIndexTable_index_to_oid(&rowreq_ctx->oid_idx, -+ &rowreq_ctx->tbl_idx)) { -+ return MFD_ERROR; -+ } -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexTable_indexes_set */ -+ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexLinkLocal -+ * ipv6ScopeZoneIndexLinkLocal is subid 2 of ipv6ScopeZoneIndexEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.36.1.2 -+ * Description: -+The zone index for the link-local scope on this interface. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 1 -+ * settable 0 -+ * hint: d -+ * -+ * -+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexLinkLocal data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipv6ScopeZoneIndexLinkLocal_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 -+ipv6ScopeZoneIndexLinkLocal_get(ipv6ScopeZoneIndexTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipv6ScopeZoneIndexLinkLocal_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipv6ScopeZoneIndexLinkLocal_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexLinkLocal_get", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexLinkLocal data. -+ * copy (* ipv6ScopeZoneIndexLinkLocal_val_ptr ) from rowreq_ctx->data -+ */ -+ (*ipv6ScopeZoneIndexLinkLocal_val_ptr) = -+ rowreq_ctx->data->scopezone_linklocal; -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexLinkLocal_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndex3 -+ * ipv6ScopeZoneIndex3 is subid 3 of ipv6ScopeZoneIndexEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.36.1.3 -+ * Description: -+The zone index for scope 3 on this interface. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 1 -+ * settable 0 -+ * hint: d -+ * -+ * -+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndex3 data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipv6ScopeZoneIndex3_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 -+ipv6ScopeZoneIndex3_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipv6ScopeZoneIndex3_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipv6ScopeZoneIndex3_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndex3_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndex3 data. -+ * copy (* ipv6ScopeZoneIndex3_val_ptr ) from rowreq_ctx->data -+ */ -+ (*ipv6ScopeZoneIndex3_val_ptr) = 0; -+ -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndex3_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexAdminLocal -+ * ipv6ScopeZoneIndexAdminLocal is subid 4 of ipv6ScopeZoneIndexEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.36.1.4 -+ * Description: -+The zone index for the admin-local scope on this interface. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 1 -+ * settable 0 -+ * hint: d -+ * -+ * -+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexAdminLocal data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipv6ScopeZoneIndexAdminLocal_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 -+ipv6ScopeZoneIndexAdminLocal_get(ipv6ScopeZoneIndexTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipv6ScopeZoneIndexAdminLocal_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipv6ScopeZoneIndexAdminLocal_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexAdminLocal_get", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexAdminLocal data. -+ * copy (* ipv6ScopeZoneIndexAdminLocal_val_ptr ) from rowreq_ctx->data -+ */ -+ (*ipv6ScopeZoneIndexAdminLocal_val_ptr) = 0; -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexAdminLocal_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexSiteLocal -+ * ipv6ScopeZoneIndexSiteLocal is subid 5 of ipv6ScopeZoneIndexEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.36.1.5 -+ * Description: -+The zone index for the site-local scope on this interface. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 1 -+ * settable 0 -+ * hint: d -+ * -+ * -+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexSiteLocal data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipv6ScopeZoneIndexSiteLocal_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 -+ipv6ScopeZoneIndexSiteLocal_get(ipv6ScopeZoneIndexTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipv6ScopeZoneIndexSiteLocal_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipv6ScopeZoneIndexSiteLocal_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexSiteLocal_get", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexSiteLocal data. -+ * copy (* ipv6ScopeZoneIndexSiteLocal_val_ptr ) from rowreq_ctx->data -+ */ -+ (*ipv6ScopeZoneIndexSiteLocal_val_ptr) = 0; -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexSiteLocal_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndex6 -+ * ipv6ScopeZoneIndex6 is subid 6 of ipv6ScopeZoneIndexEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.36.1.6 -+ * Description: -+The zone index for scope 6 on this interface. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 1 -+ * settable 0 -+ * hint: d -+ * -+ * -+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndex6 data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipv6ScopeZoneIndex6_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 -+ipv6ScopeZoneIndex6_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipv6ScopeZoneIndex6_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipv6ScopeZoneIndex6_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndex6_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndex6 data. -+ * copy (* ipv6ScopeZoneIndex6_val_ptr ) from rowreq_ctx->data -+ */ -+ (*ipv6ScopeZoneIndex6_val_ptr) = 0; -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndex6_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndex7 -+ * ipv6ScopeZoneIndex7 is subid 7 of ipv6ScopeZoneIndexEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.36.1.7 -+ * Description: -+The zone index for scope 7 on this interface. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 1 -+ * settable 0 -+ * hint: d -+ * -+ * -+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndex7 data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipv6ScopeZoneIndex7_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 -+ipv6ScopeZoneIndex7_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipv6ScopeZoneIndex7_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipv6ScopeZoneIndex7_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndex7_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndex7 data. -+ * copy (* ipv6ScopeZoneIndex7_val_ptr ) from rowreq_ctx->data -+ */ -+ (*ipv6ScopeZoneIndex7_val_ptr) = 0; -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndex7_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexOrganizationLocal -+ * ipv6ScopeZoneIndexOrganizationLocal is subid 8 of ipv6ScopeZoneIndexEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.36.1.8 -+ * Description: -+The zone index for the organization-local scope on this -+ interface. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 1 -+ * settable 0 -+ * hint: d -+ * -+ * -+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexOrganizationLocal data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipv6ScopeZoneIndexOrganizationLocal_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 -+ipv6ScopeZoneIndexOrganizationLocal_get(ipv6ScopeZoneIndexTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long * -+ ipv6ScopeZoneIndexOrganizationLocal_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipv6ScopeZoneIndexOrganizationLocal_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexOrganizationLocal_get", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexOrganizationLocal data. -+ * copy (* ipv6ScopeZoneIndexOrganizationLocal_val_ptr ) from rowreq_ctx->data -+ */ -+ (*ipv6ScopeZoneIndexOrganizationLocal_val_ptr) = 0; -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexOrganizationLocal_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndex9 -+ * ipv6ScopeZoneIndex9 is subid 9 of ipv6ScopeZoneIndexEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.36.1.9 -+ * Description: -+The zone index for scope 9 on this interface. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 1 -+ * settable 0 -+ * hint: d -+ * -+ * -+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndex9 data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipv6ScopeZoneIndex9_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 -+ipv6ScopeZoneIndex9_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipv6ScopeZoneIndex9_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipv6ScopeZoneIndex9_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndex9_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndex9 data. -+ * copy (* ipv6ScopeZoneIndex9_val_ptr ) from rowreq_ctx->data -+ */ -+ (*ipv6ScopeZoneIndex9_val_ptr) = 0; -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndex9_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexA -+ * ipv6ScopeZoneIndexA is subid 10 of ipv6ScopeZoneIndexEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.36.1.10 -+ * Description: -+The zone index for scope A on this interface. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 1 -+ * settable 0 -+ * hint: d -+ * -+ * -+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexA data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipv6ScopeZoneIndexA_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 -+ipv6ScopeZoneIndexA_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipv6ScopeZoneIndexA_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipv6ScopeZoneIndexA_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexA_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexA data. -+ * copy (* ipv6ScopeZoneIndexA_val_ptr ) from rowreq_ctx->data -+ */ -+ (*ipv6ScopeZoneIndexA_val_ptr) = 0; -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexA_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexB -+ * ipv6ScopeZoneIndexB is subid 11 of ipv6ScopeZoneIndexEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.36.1.11 -+ * Description: -+The zone index for scope B on this interface. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 1 -+ * settable 0 -+ * hint: d -+ * -+ * -+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexB data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipv6ScopeZoneIndexB_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 -+ipv6ScopeZoneIndexB_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipv6ScopeZoneIndexB_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipv6ScopeZoneIndexB_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexB_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexB data. -+ * copy (* ipv6ScopeZoneIndexB_val_ptr ) from rowreq_ctx->data -+ */ -+ (*ipv6ScopeZoneIndexB_val_ptr) = 0; -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexB_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexC -+ * ipv6ScopeZoneIndexC is subid 12 of ipv6ScopeZoneIndexEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.36.1.12 -+ * Description: -+The zone index for scope C on this interface. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 1 -+ * settable 0 -+ * hint: d -+ * -+ * -+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexC data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipv6ScopeZoneIndexC_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 -+ipv6ScopeZoneIndexC_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipv6ScopeZoneIndexC_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipv6ScopeZoneIndexC_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexC_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexC data. -+ * copy (* ipv6ScopeZoneIndexC_val_ptr ) from rowreq_ctx->data -+ */ -+ (*ipv6ScopeZoneIndexC_val_ptr) = 0; -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexC_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipv6ScopeZoneIndexEntry.ipv6ScopeZoneIndexD -+ * ipv6ScopeZoneIndexD is subid 13 of ipv6ScopeZoneIndexEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.36.1.13 -+ * Description: -+The zone index for scope D on this interface. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 1 -+ * settable 0 -+ * hint: d -+ * -+ * -+ * Its syntax is InetZoneIndex (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 ipv6ScopeZoneIndexD data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipv6ScopeZoneIndexD_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 -+ipv6ScopeZoneIndexD_get(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipv6ScopeZoneIndexD_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipv6ScopeZoneIndexD_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexD_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipv6ScopeZoneIndexD data. -+ * copy (* ipv6ScopeZoneIndexD_val_ptr ) from rowreq_ctx->data -+ */ -+ (*ipv6ScopeZoneIndexD_val_ptr) = 0; -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexD_get */ -+ -+ -+/** @{ */ -diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h -new file mode 100644 -index 0000000..bced5af ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h -@@ -0,0 +1,269 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:ipv6ScopeZoneIndexTable.h 14170 2007-04-29 00:12:32Z varun_c$ -+ */ -+#ifndef IPV6SCOPEZONEINDEXTABLE_H -+#define IPV6SCOPEZONEINDEXTABLE_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+/** @addtogroup misc misc: Miscellaneous routines -+ * -+ * @{ -+ */ -+#include -+#include -+ /* -+ * other required module components -+ */ -+ /* *INDENT-OFF* */ -+config_require(ip-mib/data_access/ipv6scopezone) -+config_require(ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface) -+config_require(ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access) -+ /* *INDENT-ON* */ -+ -+ /* -+ * OID and column number definitions for ipv6ScopeZoneIndexTable -+ */ -+#include "ipv6ScopeZoneIndexTable_oids.h" -+ -+ /* -+ * enum definions -+ */ -+#include "ipv6ScopeZoneIndexTable_enums.h" -+ -+ /* -+ ********************************************************************* -+ * function declarations -+ */ -+ void init_ipv6ScopeZoneIndexTable(void); -+ void shutdown_ipv6ScopeZoneIndexTable(void); -+ -+ /* -+ ********************************************************************* -+ * Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipv6ScopeZoneIndexTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * IP-MIB::ipv6ScopeZoneIndexTable is subid 36 of ip. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.36, 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 ipv6ScopeZoneIndexTable registration context. -+ */ -+ typedef netsnmp_data_list ipv6ScopeZoneIndexTable_registration; -+/**********************************************************************/ -+ /* -+ * TODO:110:r: |-> Review ipv6ScopeZoneTable data context structure. -+ * This structure is used to represent the data for ipv6ScopeZoneTable. -+ */ -+ typedef netsnmp_v6scopezone_entry ipv6ScopeZoneIndexTable_data; -+ -+ -+ /* -+ * TODO:120:r: |-> Review ipv6ScopeZoneIndexTable mib index. -+ * This structure is used to represent the index for ipv6ScopeZoneIndexTable. -+ */ -+ typedef struct ipv6ScopeZoneIndexTable_mib_index_s { -+ -+ /* -+ * ipv6ScopeZoneIndexIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ long ipv6ScopeZoneIndexIfIndex; -+ -+ -+ } ipv6ScopeZoneIndexTable_mib_index; -+ -+ /* -+ * TODO:121:r: | |-> Review ipv6ScopeZoneIndexTable max index length. -+ * If you KNOW that your indexes will never exceed a certain -+ * length, update this macro to that length. -+ */ -+#define MAX_ipv6ScopeZoneIndexTable_IDX_LEN 1 -+ -+ /* -+ ********************************************************************* -+ * TODO:130:o: |-> Review ipv6ScopeZoneIndexTable Row request (rowreq) context. -+ * When your functions are called, you will be passed a -+ * ipv6ScopeZoneIndexTable_rowreq_ctx pointer. -+ */ -+ typedef struct ipv6ScopeZoneIndexTable_rowreq_ctx_s { -+ -+ /** this must be first for container compare to work */ -+ netsnmp_index oid_idx; -+ oid oid_tmp[MAX_ipv6ScopeZoneIndexTable_IDX_LEN]; -+ -+ ipv6ScopeZoneIndexTable_mib_index tbl_idx; -+ -+ ipv6ScopeZoneIndexTable_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 ipv6ScopeZoneIndexTable rowreq context. -+ */ -+ -+ /* -+ * storage for future expansion -+ */ -+ netsnmp_data_list *ipv6ScopeZoneIndexTable_data_list; -+ -+ } ipv6ScopeZoneIndexTable_rowreq_ctx; -+ -+ typedef struct ipv6ScopeZoneIndexTable_ref_rowreq_ctx_s { -+ ipv6ScopeZoneIndexTable_rowreq_ctx *rowreq_ctx; -+ } ipv6ScopeZoneIndexTable_ref_rowreq_ctx; -+ -+ /* -+ ********************************************************************* -+ * function prototypes -+ */ -+ int -+ ipv6ScopeZoneIndexTable_pre_request -+ (ipv6ScopeZoneIndexTable_registration * user_context); -+ int -+ ipv6ScopeZoneIndexTable_post_request -+ (ipv6ScopeZoneIndexTable_registration * user_context, int rc); -+ -+ int -+ ipv6ScopeZoneIndexTable_rowreq_ctx_init -+ (ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx, -+ void *user_init_ctx); -+ void -+ ipv6ScopeZoneIndexTable_rowreq_ctx_cleanup -+ (ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx); -+ -+ -+ ipv6ScopeZoneIndexTable_rowreq_ctx -+ *ipv6ScopeZoneIndexTable_row_find_by_mib_index -+ (ipv6ScopeZoneIndexTable_mib_index * mib_idx); -+ -+ ipv6ScopeZoneIndexTable_data * -+ ipv6ScopeZoneIndexTable_allocate_data(void); -+ -+ void -+ ipv6ScopeZoneIndexTable_release_data(ipv6ScopeZoneIndexTable_data * data); -+ -+ extern oid ipv6ScopeZoneIndexTable_oid[]; -+ extern int ipv6ScopeZoneIndexTable_oid_size; -+ -+ -+#include "ipv6ScopeZoneIndexTable_interface.h" -+#include "ipv6ScopeZoneIndexTable_data_access.h" -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipv6ScopeZoneIndexTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * IP-MIB::ipv6ScopeZoneIndexTable is subid 36 of ip. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.36, length: 8 -+ */ -+ /* -+ * indexes -+ */ -+ -+ int -+ ipv6ScopeZoneIndexLinkLocal_get(ipv6ScopeZoneIndexTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long * -+ ipv6ScopeZoneIndexLinkLocal_val_ptr); -+ int -+ ipv6ScopeZoneIndex3_get(ipv6ScopeZoneIndexTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * ipv6ScopeZoneIndex3_val_ptr); -+ int -+ ipv6ScopeZoneIndexAdminLocal_get(ipv6ScopeZoneIndexTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long * -+ ipv6ScopeZoneIndexAdminLocal_val_ptr); -+ int -+ ipv6ScopeZoneIndexSiteLocal_get(ipv6ScopeZoneIndexTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long * -+ ipv6ScopeZoneIndexSiteLocal_val_ptr); -+ int -+ ipv6ScopeZoneIndex6_get(ipv6ScopeZoneIndexTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * ipv6ScopeZoneIndex6_val_ptr); -+ int -+ ipv6ScopeZoneIndex7_get(ipv6ScopeZoneIndexTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * ipv6ScopeZoneIndex7_val_ptr); -+ int -+ ipv6ScopeZoneIndexOrganizationLocal_get -+ (ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipv6ScopeZoneIndexOrganizationLocal_val_ptr); -+ int -+ ipv6ScopeZoneIndex9_get(ipv6ScopeZoneIndexTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * ipv6ScopeZoneIndex9_val_ptr); -+ int -+ ipv6ScopeZoneIndexA_get(ipv6ScopeZoneIndexTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * ipv6ScopeZoneIndexA_val_ptr); -+ int -+ ipv6ScopeZoneIndexB_get(ipv6ScopeZoneIndexTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * ipv6ScopeZoneIndexB_val_ptr); -+ int -+ ipv6ScopeZoneIndexC_get(ipv6ScopeZoneIndexTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * ipv6ScopeZoneIndexC_val_ptr); -+ int -+ ipv6ScopeZoneIndexD_get(ipv6ScopeZoneIndexTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * ipv6ScopeZoneIndexD_val_ptr); -+ -+ -+ int -+ ipv6ScopeZoneIndexTable_indexes_set_tbl_idx -+ (ipv6ScopeZoneIndexTable_mib_index * tbl_idx, -+ long ipv6ScopeZoneIndexIfIndex_val); -+ int -+ ipv6ScopeZoneIndexTable_indexes_set -+ (ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx, -+ long ipv6ScopeZoneIndexIfIndex_val); -+ -+ /* -+ * DUMMY markers, ignore -+ * -+ * TODO:099:x: ************************************************************* -+ * TODO:199:x: ************************************************************* -+ * TODO:299:x: ************************************************************* -+ * TODO:399:x: ************************************************************* -+ * TODO:499:x: ************************************************************* -+ */ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPV6SCOPEZONEINDEXTABLE_H */ -+/** @} */ -diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.c b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.c -new file mode 100644 -index 0000000..7105dbf ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.c -@@ -0,0 +1,304 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:ipv6ScopeZoneIndexTable_data_access.c 14170 2007-04-29 00:12:32Z varun_c$ -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "ipv6ScopeZoneIndexTable.h" -+ -+ -+#include "ipv6ScopeZoneIndexTable_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 ipv6ScopeZoneIndexTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * IP-MIB::ipv6ScopeZoneIndexTable is subid 36 of ip. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.36, length: 8 -+ */ -+ -+/** -+ * initialization for ipv6ScopeZoneIndexTable data access -+ * -+ * This function is called during startup to allow you to -+ * allocate any resources you need for the data table. -+ * -+ * @param ipv6ScopeZoneIndexTable_reg -+ * Pointer to ipv6ScopeZoneIndexTable_registration -+ * -+ * @retval MFD_SUCCESS : success. -+ * @retval MFD_ERROR : unrecoverable error. -+ */ -+int -+ipv6ScopeZoneIndexTable_init_data(ipv6ScopeZoneIndexTable_registration * -+ ipv6ScopeZoneIndexTable_reg) -+{ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_init_data", "called\n")); -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexTable_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 -+ipv6ScopeZoneIndexTable_container_init(netsnmp_container ** -+ container_ptr_ptr, -+ netsnmp_cache * cache) -+{ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_container_init", "called\n")); -+ -+ if (NULL == container_ptr_ptr) { -+ snmp_log(LOG_ERR, -+ "bad container param to ipv6ScopeZoneIndexTable_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 ipv6ScopeZoneIndexTable_container_init\n"); -+ return; -+ } -+ -+ /* -+ * TODO:345:A: Set up ipv6ScopeZoneIndexTable 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 = 60; /* seconds */ -+ -+ -+} /* ipv6ScopeZoneIndexTable_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 ipv6ScopeZoneIndexTable_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 -+ipv6ScopeZoneIndexTable_container_shutdown(netsnmp_container *container_ptr) -+{ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_container_shutdown", "called\n")); -+ -+ if (NULL == container_ptr) { -+ snmp_log(LOG_ERR, -+ "bad params to ipv6ScopeZoneIndexTable_container_shutdown\n"); -+ return; -+ } -+ -+} /* ipv6ScopeZoneIndexTable_container_shutdown */ -+ -+/** -+ * check entry for update -+ * -+ */ -+static void -+_snarf_zoneindex_entry(netsnmp_v6scopezone_entry *scopezone_entry, -+ netsnmp_container *container) -+{ -+ ipv6ScopeZoneIndexTable_rowreq_ctx *rowreq_ctx; -+ -+ DEBUGTRACE; -+ netsnmp_assert(NULL != scopezone_entry); -+ netsnmp_assert(NULL != container); -+ rowreq_ctx = ipv6ScopeZoneIndexTable_allocate_rowreq_ctx(scopezone_entry,NULL); -+ if ((NULL != rowreq_ctx) && -+ (MFD_SUCCESS == ipv6ScopeZoneIndexTable_indexes_set -+ (rowreq_ctx, rowreq_ctx->data->index))) { -+ CONTAINER_INSERT(container, rowreq_ctx); -+ } else { -+ if (rowreq_ctx) { -+ snmp_log(LOG_ERR, "error setting index while loading " -+ "ipv6ScopeZoneIndexTable cache.\n"); -+ ipv6ScopeZoneIndexTable_release_rowreq_ctx(rowreq_ctx); -+ } else -+ netsnmp_access_scopezone_entry_free(scopezone_entry); -+ } -+ -+} -+ -+/** -+ * load initial data -+ * -+ * TODO:350:M: Implement ipv6ScopeZoneIndexTable 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 -+ * ipv6ScopeZoneIndexTable_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 -+ipv6ScopeZoneIndexTable_container_load(netsnmp_container * container) -+{ -+ -+ /* -+ * temporary storage for index values -+ */ -+ /* -+ * ipv6ScopeZoneIndexIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ netsnmp_container *zoneindex = netsnmp_access_scopezone_container_load(NULL, 0); -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_container_load", "called\n")); -+ -+ if (NULL == zoneindex) { -+ DEBUGMSGTL(("ipv6ScopeZoneIndexTable:container_load", -+ "couldn't get scopezone iterator\n")); -+ return MFD_RESOURCE_UNAVAILABLE; -+ } -+ /* -+ * TODO:351:M: |-> Load/update data in the ipv6ScopeZoneIndexTable container. -+ * loop over your ipv6ScopeZoneIndexTable data, allocate a rowreq context, -+ * set the index(es) [and data, optionally] and insert into -+ * the container. -+ */ -+ -+ CONTAINER_FOR_EACH(zoneindex, -+ (netsnmp_container_obj_func *) _snarf_zoneindex_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_scopezone_container_free(zoneindex, -+ 0x0001); -+ -+ DEBUGMSGT(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_container_load", "inserted %d records\n", CONTAINER_SIZE(container))); -+ -+ return MFD_SUCCESS; -+} /* ipv6ScopeZoneIndexTable_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 -+ipv6ScopeZoneIndexTable_container_free(netsnmp_container * container) -+{ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_container_free", "called\n")); -+ -+ /* -+ * TODO:380:M: Free ipv6ScopeZoneIndexTable container data. -+ */ -+} /* ipv6ScopeZoneIndexTable_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 -+ipv6ScopeZoneIndexTable_row_prep(ipv6ScopeZoneIndexTable_rowreq_ctx * -+ rowreq_ctx) -+{ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_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; -+} /* ipv6ScopeZoneIndexTable_row_prep */ -+/** @} */ -diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h -new file mode 100644 -index 0000000..8f98e91 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h -@@ -0,0 +1,70 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:ipv6ScopeZoneIndexTable_data_access.h 14170 2007-04-29 00:12:32Z varun_c$ -+ */ -+#ifndef IPV6SCOPEZONEINDEXTABLE_DATA_ACCESS_H -+#define IPV6SCOPEZONEINDEXTABLE_DATA_ACCESS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+ /* -+ ********************************************************************* -+ * function declarations -+ */ -+ -+ /* -+ ********************************************************************* -+ * Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipv6ScopeZoneIndexTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * IP-MIB::ipv6ScopeZoneIndexTable is subid 36 of ip. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.36, length: 8 -+ */ -+ -+ -+ int -+ ipv6ScopeZoneIndexTable_init_data -+ (ipv6ScopeZoneIndexTable_registration * -+ ipv6ScopeZoneIndexTable_reg); -+ -+ -+ void -+ ipv6ScopeZoneIndexTable_container_init(netsnmp_container ** -+ container_ptr_ptr, -+ netsnmp_cache * -+ cache); -+ void -+ ipv6ScopeZoneIndexTable_container_shutdown(netsnmp_container * -+ container_ptr); -+ -+ int -+ ipv6ScopeZoneIndexTable_container_load(netsnmp_container * -+ container); -+ void -+ ipv6ScopeZoneIndexTable_container_free(netsnmp_container * -+ container); -+ -+#define MAX_LINE_SIZE 256 -+ int -+ ipv6ScopeZoneIndexTable_row_prep(ipv6ScopeZoneIndexTable_rowreq_ctx -+ * rowreq_ctx); -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPV6SCOPEZONEINDEXTABLE_DATA_ACCESS_H */ -diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_enums.h b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_enums.h -new file mode 100644 -index 0000000..a79ec88 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_enums.h -@@ -0,0 +1,39 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $ -+ * -+ * $Id:ipv6ScopeZoneIndexTable_enums.h 14170 2007-04-29 00:12:32Z varun_c$ -+ */ -+#ifndef IPV6SCOPEZONEINDEXTABLE_ENUMS_H -+#define IPV6SCOPEZONEINDEXTABLE_ENUMS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ /* -+ * 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 ipv6ScopeZoneIndexTable -+ * -+ ************************************************************************* -+ *************************************************************************/ -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPV6SCOPEZONEINDEXTABLE_ENUMS_H */ -diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c -new file mode 100644 -index 0000000..40769ad ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c -@@ -0,0 +1,1124 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 15899 $ of $ -+ * -+ * $Id:ipv6ScopeZoneIndexTable_interface.c 14170 2007-04-29 00:12:32Z varun_c$ -+ */ -+/* -+ * ********************************************************************* -+ * ********************************************************************* -+ * ********************************************************************* -+ * *** *** -+ * *** 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 -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "ipv6ScopeZoneIndexTable.h" -+ -+ -+#include -+#include -+ -+#include "ipv6ScopeZoneIndexTable_interface.h" -+ -+#include -+ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipv6ScopeZoneIndexTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * IP-MIB::ipv6ScopeZoneIndexTable is subid 36 of ip. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.36, length: 8 -+ */ -+typedef struct ipv6ScopeZoneIndexTable_interface_ctx_s { -+ -+ netsnmp_container *container; -+ netsnmp_cache *cache; -+ ipv6ScopeZoneIndexTable_registration *user_ctx; -+ -+ netsnmp_table_registration_info tbl_info; -+ -+ netsnmp_baby_steps_access_methods access_multiplexer; -+ -+} ipv6ScopeZoneIndexTable_interface_ctx; -+ -+static ipv6ScopeZoneIndexTable_interface_ctx -+ ipv6ScopeZoneIndexTable_if_ctx; -+ -+static void -+_ipv6ScopeZoneIndexTable_container_init -+(ipv6ScopeZoneIndexTable_interface_ctx * if_ctx); -+static void -+_ipv6ScopeZoneIndexTable_container_shutdown -+(ipv6ScopeZoneIndexTable_interface_ctx * if_ctx); -+static int -+_cache_load(netsnmp_cache * cache, void *vmagic); -+static void -+_cache_free(netsnmp_cache * cache, void *magic); -+ -+ -+netsnmp_container * -+ipv6ScopeZoneIndexTable_container_get(void) -+{ -+ return ipv6ScopeZoneIndexTable_if_ctx.container; -+} -+ -+ipv6ScopeZoneIndexTable_registration * -+ipv6ScopeZoneIndexTable_registration_get(void) -+{ -+ return ipv6ScopeZoneIndexTable_if_ctx.user_ctx; -+} -+ -+ipv6ScopeZoneIndexTable_registration * -+ipv6ScopeZoneIndexTable_registration_set -+ (ipv6ScopeZoneIndexTable_registration * newreg) -+{ -+ ipv6ScopeZoneIndexTable_registration *old = -+ ipv6ScopeZoneIndexTable_if_ctx.user_ctx; -+ ipv6ScopeZoneIndexTable_if_ctx.user_ctx = newreg; -+ return old; -+} -+ -+int -+ipv6ScopeZoneIndexTable_container_size(void) -+{ -+ return CONTAINER_SIZE(ipv6ScopeZoneIndexTable_if_ctx.container); -+} -+ -+/* -+ * mfd multiplexer modes -+ */ -+static Netsnmp_Node_Handler _mfd_ipv6ScopeZoneIndexTable_pre_request; -+static Netsnmp_Node_Handler _mfd_ipv6ScopeZoneIndexTable_post_request; -+static Netsnmp_Node_Handler _mfd_ipv6ScopeZoneIndexTable_object_lookup; -+static Netsnmp_Node_Handler _mfd_ipv6ScopeZoneIndexTable_get_values; -+/** -+ * @internal -+ * Initialize the table ipv6ScopeZoneIndexTable -+ * (Define its contents and how it's structured) -+ */ -+void -+_ipv6ScopeZoneIndexTable_initialize_interface -+ (ipv6ScopeZoneIndexTable_registration * reg_ptr, u_long flags) -+{ -+ netsnmp_baby_steps_access_methods *access_multiplexer = -+ &ipv6ScopeZoneIndexTable_if_ctx.access_multiplexer; -+ netsnmp_table_registration_info *tbl_info = -+ &ipv6ScopeZoneIndexTable_if_ctx.tbl_info; -+ netsnmp_handler_registration *reginfo; -+ netsnmp_mib_handler *handler; -+ int mfd_modes = 0; -+ -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_ipv6ScopeZoneIndexTable_initialize_interface", "called\n")); -+ -+ -+ /************************************************* -+ * -+ * save interface context for ipv6ScopeZoneIndexTable -+ */ -+ /* -+ * Setting up the table's definition -+ */ -+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER, -+ /** index: ipv6ScopeZoneIndexIfIndex */ -+ 0); -+ -+ /* -+ * Define the minimum and maximum accessible columns. This -+ * optimizes retrival. -+ */ -+ tbl_info->min_column = IPV6SCOPEZONEINDEXTABLE_MIN_COL; -+ tbl_info->max_column = IPV6SCOPEZONEINDEXTABLE_MAX_COL; -+ -+ /* -+ * save users context -+ */ -+ ipv6ScopeZoneIndexTable_if_ctx.user_ctx = reg_ptr; -+ -+ /* -+ * call data access initialization code -+ */ -+ ipv6ScopeZoneIndexTable_init_data(reg_ptr); -+ -+ /* -+ * set up the container -+ */ -+ _ipv6ScopeZoneIndexTable_container_init -+ (&ipv6ScopeZoneIndexTable_if_ctx); -+ if (NULL == ipv6ScopeZoneIndexTable_if_ctx.container) { -+ snmp_log(LOG_ERR, -+ "could not initialize container for ipv6ScopeZoneIndexTable\n"); -+ return; -+ } -+ -+ /* -+ * access_multiplexer: REQUIRED wrapper for get request handling -+ */ -+ access_multiplexer->object_lookup = -+ _mfd_ipv6ScopeZoneIndexTable_object_lookup; -+ access_multiplexer->get_values = -+ _mfd_ipv6ScopeZoneIndexTable_get_values; -+ -+ /* -+ * no wrappers yet -+ */ -+ access_multiplexer->pre_request = -+ _mfd_ipv6ScopeZoneIndexTable_pre_request; -+ access_multiplexer->post_request = -+ _mfd_ipv6ScopeZoneIndexTable_post_request; -+ -+ -+ /************************************************* -+ * -+ * Create a registration, save our reg data, register table. -+ */ -+ DEBUGMSGTL(("ipv6ScopeZoneIndexTable:init_ipv6ScopeZoneIndexTable", -+ "Registering ipv6ScopeZoneIndexTable as a mibs-for-dummies table.\n")); -+ handler = -+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer); -+ reginfo = -+ netsnmp_handler_registration_create("ipv6ScopeZoneIndexTable", -+ handler, -+ ipv6ScopeZoneIndexTable_oid, -+ ipv6ScopeZoneIndexTable_oid_size, -+ HANDLER_CAN_BABY_STEP | -+ HANDLER_CAN_RONLY); -+ if (NULL == reginfo) { -+ snmp_log(LOG_ERR, -+ "error registering table ipv6ScopeZoneIndexTable\n"); -+ return; -+ } -+ reginfo->my_reg_void = &ipv6ScopeZoneIndexTable_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, -+ ipv6ScopeZoneIndexTable_if_ctx. -+ container, -+ TABLE_CONTAINER_KEY_NETSNMP_INDEX); -+ netsnmp_inject_handler(reginfo, handler); -+ -+ if (NULL != ipv6ScopeZoneIndexTable_if_ctx.cache) { -+ handler = -+ netsnmp_cache_handler_get(ipv6ScopeZoneIndexTable_if_ctx.cache); -+ netsnmp_inject_handler(reginfo, handler); -+ } -+ -+ /* -+ * register table -+ */ -+ netsnmp_register_table(reginfo, tbl_info); -+ -+} /* _ipv6ScopeZoneIndexTable_initialize_interface */ -+ -+/** -+ * @internal -+ * Shutdown the table ipv6ScopeZoneIndexTable -+ */ -+void -+_ipv6ScopeZoneIndexTable_shutdown_interface -+ (ipv6ScopeZoneIndexTable_registration * reg_ptr) -+{ -+ /* -+ * shutdown the container -+ */ -+ _ipv6ScopeZoneIndexTable_container_shutdown -+ (&ipv6ScopeZoneIndexTable_if_ctx); -+} -+ -+void -+ipv6ScopeZoneIndexTable_valid_columns_set(netsnmp_column_info *vc) -+{ -+ ipv6ScopeZoneIndexTable_if_ctx.tbl_info.valid_columns = vc; -+} /* ipv6ScopeZoneIndexTable_valid_columns_set */ -+ -+/** -+ * @internal -+ * convert the index component stored in the context to an oid -+ */ -+int -+ipv6ScopeZoneIndexTable_index_to_oid(netsnmp_index * oid_idx, -+ ipv6ScopeZoneIndexTable_mib_index * -+ mib_idx) -+{ -+ int err = SNMP_ERR_NOERROR; -+ -+ /* -+ * temp storage for parsing indexes -+ */ -+ /* -+ * ipv6ScopeZoneIndexIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ netsnmp_variable_list var_ipv6ScopeZoneIndexIfIndex; -+ -+ /* -+ * set up varbinds -+ */ -+ memset(&var_ipv6ScopeZoneIndexIfIndex, 0x00, -+ sizeof(var_ipv6ScopeZoneIndexIfIndex)); -+ var_ipv6ScopeZoneIndexIfIndex.type = ASN_INTEGER; -+ -+ /* -+ * chain temp index varbinds together -+ */ -+ var_ipv6ScopeZoneIndexIfIndex.next_variable = NULL; -+ -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_index_to_oid", "called\n")); -+ -+ /* -+ * ipv6ScopeZoneIndexIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ snmp_set_var_value(&var_ipv6ScopeZoneIndexIfIndex, -+ (u_char *) & mib_idx->ipv6ScopeZoneIndexIfIndex, -+ sizeof(mib_idx->ipv6ScopeZoneIndexIfIndex)); -+ -+ -+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len, -+ NULL, 0, &var_ipv6ScopeZoneIndexIfIndex); -+ 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_ipv6ScopeZoneIndexIfIndex); -+ -+ return err; -+} /* ipv6ScopeZoneIndexTable_index_to_oid */ -+ -+/** -+ * extract ipv6ScopeZoneIndexTable indexes from a netsnmp_index -+ * -+ * @retval SNMP_ERR_NOERROR : no error -+ * @retval SNMP_ERR_GENERR : error -+ */ -+int -+ipv6ScopeZoneIndexTable_index_from_oid(netsnmp_index * oid_idx, -+ ipv6ScopeZoneIndexTable_mib_index * -+ mib_idx) -+{ -+ int err = SNMP_ERR_NOERROR; -+ -+ /* -+ * temp storage for parsing indexes -+ */ -+ /* -+ * ipv6ScopeZoneIndexIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ netsnmp_variable_list var_ipv6ScopeZoneIndexIfIndex; -+ -+ /* -+ * set up varbinds -+ */ -+ memset(&var_ipv6ScopeZoneIndexIfIndex, 0x00, -+ sizeof(var_ipv6ScopeZoneIndexIfIndex)); -+ var_ipv6ScopeZoneIndexIfIndex.type = ASN_INTEGER; -+ -+ /* -+ * chain temp index varbinds together -+ */ -+ var_ipv6ScopeZoneIndexIfIndex.next_variable = NULL; -+ -+ -+ DEBUGMSGTL(("verbose:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_index_from_oid", "called\n")); -+ -+ /* -+ * parse the oid into the individual index components -+ */ -+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len, -+ &var_ipv6ScopeZoneIndexIfIndex); -+ if (err == SNMP_ERR_NOERROR) { -+ /* -+ * copy out values -+ */ -+ mib_idx->ipv6ScopeZoneIndexIfIndex = -+ *((long *) var_ipv6ScopeZoneIndexIfIndex.val.string); -+ -+ -+ } -+ -+ /* -+ * parsing may have allocated memory. free it. -+ */ -+ snmp_reset_var_buffers(&var_ipv6ScopeZoneIndexIfIndex); -+ -+ return err; -+} /* ipv6ScopeZoneIndexTable_index_from_oid */ -+ -+ -+/* -+ ********************************************************************* -+ * @internal -+ * allocate resources for a ipv6ScopeZoneIndexTable_rowreq_ctx -+ */ -+ipv6ScopeZoneIndexTable_rowreq_ctx * -+ipv6ScopeZoneIndexTable_allocate_rowreq_ctx(ipv6ScopeZoneIndexTable_data *data, -+ void *user_init_ctx) -+{ -+ ipv6ScopeZoneIndexTable_rowreq_ctx *rowreq_ctx = -+ SNMP_MALLOC_TYPEDEF(ipv6ScopeZoneIndexTable_rowreq_ctx); -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_allocate_rowreq_ctx", "called\n")); -+ -+ if (NULL == rowreq_ctx) { -+ snmp_log(LOG_ERR, "Couldn't allocate memory for a " -+ "ipv6ScopeZoneIndexTable_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 = -+ ipv6ScopeZoneIndexTable_allocate_data())) { -+ SNMP_FREE(rowreq_ctx); -+ return NULL; -+ } -+ } -+ -+ -+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp; -+ -+ rowreq_ctx->ipv6ScopeZoneIndexTable_data_list = NULL; -+ -+ /* -+ * if we allocated data, call init routine -+ */ -+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) { -+ if (SNMPERR_SUCCESS != -+ ipv6ScopeZoneIndexTable_rowreq_ctx_init(rowreq_ctx, -+ user_init_ctx)) { -+ ipv6ScopeZoneIndexTable_release_rowreq_ctx(rowreq_ctx); -+ rowreq_ctx = NULL; -+ } -+ } -+ -+ return rowreq_ctx; -+} /* ipv6ScopeZoneIndexTable_allocate_rowreq_ctx */ -+ -+/* -+ * @internal -+ * release resources for a ipv6ScopeZoneIndexTable_rowreq_ctx -+ */ -+void -+ipv6ScopeZoneIndexTable_release_rowreq_ctx -+ (ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:ipv6ScopeZoneIndexTable_release_rowreq_ctx", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ ipv6ScopeZoneIndexTable_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)) -+ ipv6ScopeZoneIndexTable_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); -+} /* ipv6ScopeZoneIndexTable_release_rowreq_ctx */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_ipv6ScopeZoneIndexTable_pre_request(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration -+ *reginfo, -+ netsnmp_agent_request_info -+ *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ int rc; -+ -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_mfd_ipv6ScopeZoneIndexTable_pre_request", "called\n")); -+ -+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) { -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable", -+ "skipping additional pre_request\n")); -+ return SNMP_ERR_NOERROR; -+ } -+ -+ rc = ipv6ScopeZoneIndexTable_pre_request -+ (ipv6ScopeZoneIndexTable_if_ctx.user_ctx); -+ if (MFD_SUCCESS != rc) { -+ /* -+ * nothing we can do about it but log it -+ */ -+ DEBUGMSGTL(("ipv6ScopeZoneIndexTable", "error %d from " -+ "ipv6ScopeZoneIndexTable_pre_request\n", rc)); -+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc)); -+ } -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_ipv6ScopeZoneIndexTable_pre_request */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_ipv6ScopeZoneIndexTable_post_request(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration -+ *reginfo, -+ netsnmp_agent_request_info -+ *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ ipv6ScopeZoneIndexTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ int rc, packet_rc; -+ -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_mfd_ipv6ScopeZoneIndexTable_post_request", "called\n")); -+ -+ /* -+ * release row context, if deleted -+ */ -+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED)) -+ ipv6ScopeZoneIndexTable_release_rowreq_ctx(rowreq_ctx); -+ -+ /* -+ * wait for last call before calling user -+ */ -+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) { -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable", -+ "waiting for last post_request\n")); -+ return SNMP_ERR_NOERROR; -+ } -+ -+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0); -+ rc = ipv6ScopeZoneIndexTable_post_request -+ (ipv6ScopeZoneIndexTable_if_ctx.user_ctx, packet_rc); -+ if (MFD_SUCCESS != rc) { -+ /* -+ * nothing we can do about it but log it -+ */ -+ DEBUGMSGTL(("ipv6ScopeZoneIndexTable", "error %d from " -+ "ipv6ScopeZoneIndexTable_post_request\n", rc)); -+ } -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_ipv6ScopeZoneIndexTable_post_request */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static ipv6ScopeZoneIndexTable_rowreq_ctx * -+_mfd_ipv6ScopeZoneIndexTable_rowreq_from_index(netsnmp_index * oid_idx, -+ int *rc_ptr) -+{ -+ ipv6ScopeZoneIndexTable_rowreq_ctx *rowreq_ctx; -+ ipv6ScopeZoneIndexTable_mib_index mib_idx; -+ int rc; -+ -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_mfd_ipv6ScopeZoneIndexTable_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 = ipv6ScopeZoneIndexTable_index_from_oid(oid_idx, &mib_idx); -+ if (MFD_SUCCESS != *rc_ptr) { -+ DEBUGMSGT(("ipv6ScopeZoneIndexTable", "error parsing index\n")); -+ return NULL; -+ } -+ -+ /* -+ * allocate new context -+ */ -+ rowreq_ctx = ipv6ScopeZoneIndexTable_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)); -+ -+ -+ /* -+ * 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_ipv6ScopeZoneIndexTable_rowreq_from_index */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_ipv6ScopeZoneIndexTable_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; -+ ipv6ScopeZoneIndexTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_mfd_ipv6ScopeZoneIndexTable_object_lookup", "called\n")); -+ -+ /* -+ * get our context from mfd -+ * ipv6ScopeZoneIndexTable_interface_ctx *if_ctx = -+ * (ipv6ScopeZoneIndexTable_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_ipv6ScopeZoneIndexTable_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 -+ ipv6ScopeZoneIndexTable_row_prep(rowreq_ctx); -+ -+ return SNMP_VALIDATE_ERR(rc); -+} /* _mfd_ipv6ScopeZoneIndexTable_object_lookup */ -+ -+/*********************************************************************** -+ * -+ * GET processing -+ * -+ ***********************************************************************/ -+/* -+ * @internal -+ * Retrieve the value for a particular column -+ */ -+NETSNMP_STATIC_INLINE int -+_ipv6ScopeZoneIndexTable_get_column(ipv6ScopeZoneIndexTable_rowreq_ctx * -+ rowreq_ctx, -+ netsnmp_variable_list * var, -+ int column) -+{ -+ int rc = SNMPERR_SUCCESS; -+ -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_mfd_ipv6ScopeZoneIndexTable_get_column", "called for %d\n", column)); -+ -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ switch (column) { -+ -+ /* -+ * ipv6ScopeZoneIndexLinkLocal(2)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H -+ */ -+ case COLUMN_IPV6SCOPEZONEINDEXLINKLOCAL: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_UNSIGNED; -+ rc = ipv6ScopeZoneIndexLinkLocal_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipv6ScopeZoneIndex3(3)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H -+ */ -+ case COLUMN_IPV6SCOPEZONEINDEX3: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_UNSIGNED; -+ rc = ipv6ScopeZoneIndex3_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipv6ScopeZoneIndexAdminLocal(4)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H -+ */ -+ case COLUMN_IPV6SCOPEZONEINDEXADMINLOCAL: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_UNSIGNED; -+ rc = ipv6ScopeZoneIndexAdminLocal_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipv6ScopeZoneIndexSiteLocal(5)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H -+ */ -+ case COLUMN_IPV6SCOPEZONEINDEXSITELOCAL: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_UNSIGNED; -+ rc = ipv6ScopeZoneIndexSiteLocal_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipv6ScopeZoneIndex6(6)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H -+ */ -+ case COLUMN_IPV6SCOPEZONEINDEX6: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_UNSIGNED; -+ rc = ipv6ScopeZoneIndex6_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipv6ScopeZoneIndex7(7)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H -+ */ -+ case COLUMN_IPV6SCOPEZONEINDEX7: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_UNSIGNED; -+ rc = ipv6ScopeZoneIndex7_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipv6ScopeZoneIndexOrganizationLocal(8)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H -+ */ -+ case COLUMN_IPV6SCOPEZONEINDEXORGANIZATIONLOCAL: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_UNSIGNED; -+ rc = ipv6ScopeZoneIndexOrganizationLocal_get(rowreq_ctx, -+ (u_long *) var->val. -+ string); -+ break; -+ -+ /* -+ * ipv6ScopeZoneIndex9(9)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H -+ */ -+ case COLUMN_IPV6SCOPEZONEINDEX9: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_UNSIGNED; -+ rc = ipv6ScopeZoneIndex9_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipv6ScopeZoneIndexA(10)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H -+ */ -+ case COLUMN_IPV6SCOPEZONEINDEXA: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_UNSIGNED; -+ rc = ipv6ScopeZoneIndexA_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipv6ScopeZoneIndexB(11)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H -+ */ -+ case COLUMN_IPV6SCOPEZONEINDEXB: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_UNSIGNED; -+ rc = ipv6ScopeZoneIndexB_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipv6ScopeZoneIndexC(12)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H -+ */ -+ case COLUMN_IPV6SCOPEZONEINDEXC: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_UNSIGNED; -+ rc = ipv6ScopeZoneIndexC_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipv6ScopeZoneIndexD(13)/InetZoneIndex/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/H -+ */ -+ case COLUMN_IPV6SCOPEZONEINDEXD: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_UNSIGNED; -+ rc = ipv6ScopeZoneIndexD_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ default: -+ if (IPV6SCOPEZONEINDEXTABLE_MIN_COL <= column -+ && column <= IPV6SCOPEZONEINDEXTABLE_MAX_COL) { -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_mfd_ipv6ScopeZoneIndexTable_get_column", "assume column %d is reserved\n", column)); -+ rc = MFD_SKIP; -+ } else { -+ snmp_log(LOG_ERR, -+ "unknown column %d in _ipv6ScopeZoneIndexTable_get_column\n", -+ column); -+ } -+ break; -+ } -+ -+ return rc; -+} /* _ipv6ScopeZoneIndexTable_get_column */ -+ -+int -+_mfd_ipv6ScopeZoneIndexTable_get_values(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration -+ *reginfo, -+ netsnmp_agent_request_info -+ *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ ipv6ScopeZoneIndexTable_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:ipv6ScopeZoneIndexTable:_mfd_ipv6ScopeZoneIndexTable_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 = _ipv6ScopeZoneIndexTable_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_ipv6ScopeZoneIndexTable_get_values */ -+ -+ -+/*********************************************************************** -+ * -+ * SET processing -+ * -+ ***********************************************************************/ -+ -+/* -+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting) -+ */ -+/*********************************************************************** -+ * -+ * DATA ACCESS -+ * -+ ***********************************************************************/ -+/** -+ * @internal -+ */ -+static void -+_container_item_free(ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx, -+ void *context) -+{ -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_container_item_free", -+ "called\n")); -+ -+ if (NULL == rowreq_ctx) -+ return; -+ -+ ipv6ScopeZoneIndexTable_release_rowreq_ctx(rowreq_ctx); -+} /* _container_item_free */ -+ -+/** -+ * @internal -+ */ -+static void -+_container_free(netsnmp_container * container) -+{ -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_container_free", -+ "called\n")); -+ -+ if (NULL == container) { -+ snmp_log(LOG_ERR, -+ "invalid container in ipv6ScopeZoneIndexTable_container_free\n"); -+ return; -+ } -+ -+ /* -+ * call user code -+ */ -+ ipv6ScopeZoneIndexTable_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 -+_ipv6ScopeZoneIndexTable_container_init -+ (ipv6ScopeZoneIndexTable_interface_ctx * if_ctx) -+{ -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_ipv6ScopeZoneIndexTable_container_init", "called\n")); -+ -+ /* -+ * container init -+ */ -+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */ -+ _cache_load, _cache_free, -+ ipv6ScopeZoneIndexTable_oid, -+ ipv6ScopeZoneIndexTable_oid_size); -+ -+ if (NULL == if_ctx->cache) { -+ snmp_log(LOG_ERR, "error creating cache for ipScopeZoneIndexTable\n"); -+ return; -+ } -+ -+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET; -+ -+ ipv6ScopeZoneIndexTable_container_init(&if_ctx->container, if_ctx->cache); -+ if (NULL == if_ctx->container) -+ if_ctx->container = -+ netsnmp_container_find -+ ("ipv6ScopeZoneIndexTable:table_container"); -+ if (NULL == if_ctx->container) { -+ snmp_log(LOG_ERR, "error creating container in " -+ "ipv6ScopeZoneIndexTable_container_init\n"); -+ return; -+ } -+ if (NULL != if_ctx->cache) -+ if_ctx->cache->magic = (void *) if_ctx->container; -+ -+ -+} /* _ipv6ScopeZoneIndexTable_container_init */ -+ -+/** -+ * @internal -+ * shutdown the container with functions or wrappers -+ */ -+void -+_ipv6ScopeZoneIndexTable_container_shutdown -+ (ipv6ScopeZoneIndexTable_interface_ctx * if_ctx) -+{ -+ DEBUGMSGTL(("internal:ipv6ScopeZoneIndexTable:_ipv6ScopeZoneIndexTable_container_shutdown", "called\n")); -+ -+ ipv6ScopeZoneIndexTable_container_shutdown(if_ctx->container); -+ -+ _container_free(if_ctx->container); -+ -+} /* _ipv6ScopeZoneIndexTable_container_shutdown */ -+ -+ -+ipv6ScopeZoneIndexTable_rowreq_ctx * -+ipv6ScopeZoneIndexTable_row_find_by_mib_index -+ (ipv6ScopeZoneIndexTable_mib_index * mib_idx) -+{ -+ ipv6ScopeZoneIndexTable_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 = ipv6ScopeZoneIndexTable_index_to_oid(&oid_idx, mib_idx); -+ if (MFD_SUCCESS != rc) -+ return NULL; -+ -+ rowreq_ctx = -+ CONTAINER_FIND(ipv6ScopeZoneIndexTable_if_ctx.container, &oid_idx); -+ -+ return rowreq_ctx; -+} -+ -+static int -+_cache_load(netsnmp_cache * cache, void *vmagic) -+{ -+ DEBUGMSGTL(("internal:ipScopeZoneIndexTable:_cache_load", "called\n")); -+ -+ if ((NULL == cache) || (NULL == cache->magic)) { -+ snmp_log(LOG_ERR, -+ "invalid cache for ipScopeZoneIndexTable_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 ipv6ScopeZoneIndexTable_container_load((netsnmp_container *) cache-> -+ magic); -+} /* _cache_load */ -+ -+/** -+ * @internal -+ */ -+static void -+_cache_free(netsnmp_cache * cache, void *magic) -+{ -+ netsnmp_container *container; -+ -+ DEBUGMSGTL(("internal:ipScopeZoneIndexTable:_cache_free", "called\n")); -+ -+ if ((NULL == cache) || (NULL == cache->magic)) { -+ snmp_log(LOG_ERR, -+ "invalid cache in ipScopeZoneIndexTable_cache_free\n"); -+ return; -+ } -+ -+ container = (netsnmp_container *) cache->magic; -+ -+ _container_free(container); -+} /* _cache_free */ -+ -diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h -new file mode 100644 -index 0000000..7fc3109 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h -@@ -0,0 +1,98 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 15899 $ of $ -+ * -+ * $Id:ipv6ScopeZoneIndexTable_interface.h 14170 2007-04-29 00:12:32Z varun_c$ -+ */ -+/** @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 IPV6SCOPEZONEINDEXTABLE_INTERFACE_H -+#define IPV6SCOPEZONEINDEXTABLE_INTERFACE_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+#include "ipv6ScopeZoneIndexTable.h" -+ -+ -+ /* -+ ******************************************************************** -+ * Table declarations -+ */ -+ -+ /* -+ * PUBLIC interface initialization routine -+ */ -+ void -+ _ipv6ScopeZoneIndexTable_initialize_interface -+ (ipv6ScopeZoneIndexTable_registration * user_ctx, u_long flags); -+ void -+ _ipv6ScopeZoneIndexTable_shutdown_interface -+ (ipv6ScopeZoneIndexTable_registration * user_ctx); -+ -+ ipv6ScopeZoneIndexTable_registration -+ *ipv6ScopeZoneIndexTable_registration_get(void); -+ -+ ipv6ScopeZoneIndexTable_registration -+ *ipv6ScopeZoneIndexTable_registration_set -+ (ipv6ScopeZoneIndexTable_registration * newreg); -+ -+ netsnmp_container *ipv6ScopeZoneIndexTable_container_get(void); -+ int ipv6ScopeZoneIndexTable_container_size(void); -+ -+ ipv6ScopeZoneIndexTable_rowreq_ctx -+ *ipv6ScopeZoneIndexTable_allocate_rowreq_ctx(ipv6ScopeZoneIndexTable_data *, void *); -+ void -+ ipv6ScopeZoneIndexTable_release_rowreq_ctx -+ (ipv6ScopeZoneIndexTable_rowreq_ctx * rowreq_ctx); -+ -+ int ipv6ScopeZoneIndexTable_index_to_oid(netsnmp_index * -+ oid_idx, -+ ipv6ScopeZoneIndexTable_mib_index -+ * mib_idx); -+ int ipv6ScopeZoneIndexTable_index_from_oid(netsnmp_index * -+ oid_idx, -+ ipv6ScopeZoneIndexTable_mib_index -+ * mib_idx); -+ -+ /* -+ * access to certain internals. use with caution! -+ */ -+ void -+ ipv6ScopeZoneIndexTable_valid_columns_set(netsnmp_column_info *vc); -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPV6SCOPEZONEINDEXTABLE_INTERFACE_H */ -+/** @} */ -diff --git a/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h -new file mode 100644 -index 0000000..134daa2 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h -@@ -0,0 +1,55 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $ -+ * -+ * $Id:ipv6ScopeZoneIndexTable_oids.h 14170 2007-04-29 00:12:32Z varun_c$ -+ */ -+#ifndef IPV6SCOPEZONEINDEXTABLE_OIDS_H -+#define IPV6SCOPEZONEINDEXTABLE_OIDS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+ /* -+ * column number definitions for table ipv6ScopeZoneIndexTable -+ */ -+#define IPV6SCOPEZONEINDEXTABLE_OID 1,3,6,1,2,1,4,36 -+ -+#define COLUMN_IPV6SCOPEZONEINDEXIFINDEX 1 -+ -+#define COLUMN_IPV6SCOPEZONEINDEXLINKLOCAL 2 -+ -+#define COLUMN_IPV6SCOPEZONEINDEX3 3 -+ -+#define COLUMN_IPV6SCOPEZONEINDEXADMINLOCAL 4 -+ -+#define COLUMN_IPV6SCOPEZONEINDEXSITELOCAL 5 -+ -+#define COLUMN_IPV6SCOPEZONEINDEX6 6 -+ -+#define COLUMN_IPV6SCOPEZONEINDEX7 7 -+ -+#define COLUMN_IPV6SCOPEZONEINDEXORGANIZATIONLOCAL 8 -+ -+#define COLUMN_IPV6SCOPEZONEINDEX9 9 -+ -+#define COLUMN_IPV6SCOPEZONEINDEXA 10 -+ -+#define COLUMN_IPV6SCOPEZONEINDEXB 11 -+ -+#define COLUMN_IPV6SCOPEZONEINDEXC 12 -+ -+#define COLUMN_IPV6SCOPEZONEINDEXD 13 -+ -+ -+#define IPV6SCOPEZONEINDEXTABLE_MIN_COL COLUMN_IPV6SCOPEZONEINDEXLINKLOCAL -+#define IPV6SCOPEZONEINDEXTABLE_MAX_COL COLUMN_IPV6SCOPEZONEINDEXD -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPV6SCOPEZONEINDEXTABLE_OIDS_H */ -diff --git a/include/net-snmp/data_access/scopezone.h b/include/net-snmp/data_access/scopezone.h -new file mode 100644 -index 0000000..de5c8bf ---- /dev/null -+++ b/include/net-snmp/data_access/scopezone.h -@@ -0,0 +1,68 @@ -+/* -+ * scopezone data access header -+ * -+ * $Id: scopezone.h 14170 2007-04-29 02:22:12Z varun_c $ -+ */ -+#ifndef NETSNMP_ACCESS_SCOPEZONE_H -+#define NETSNMP_ACCESS_SCOPEZONE_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+/**---------------------------------------------------------------------*/ -+/* -+ * structure definitions -+ * -+ * -+ * NOTE: if you add fields, update code dealing with -+ * them in ipv6scopezone_common.c -+ */ -+typedef struct netsnmp_v6scopezone_entry_s { -+ netsnmp_index oid_index; -+ oid ns_scopezone_index; -+ u_int ns_flags; /* net-snmp flags */ -+ oid index; -+ int scopezone_linklocal; -+ -+} netsnmp_v6scopezone_entry; -+ -+/**---------------------------------------------------------------------*/ -+/* -+ * ACCESS function prototypes -+ */ -+ -+/* -+ * scopezone container init -+ */ -+netsnmp_container * netsnmp_access_scopezone_container_init(u_int init_flags); -+ -+/* -+ * scopezone container load and free -+ */ -+netsnmp_container* -+netsnmp_access_scopezone_container_load(netsnmp_container* container, -+ u_int load_flags); -+ -+void netsnmp_access_scopezone_container_free(netsnmp_container *container, -+ u_int free_flags); -+#define NETSNMP_ACCESS_SCOPEZONE_FREE_NOFLAGS 0x0000 -+#define NETSNMP_ACCESS_SCOPEZONE_FREE_DONT_CLEAR 0x0001 -+#define NETSNMP_ACCESS_SCOPEZONE_FREE_KEEP_CONTAINER 0x0002 -+ -+ -+/* -+ * create/free an scopezone entry -+ */ -+netsnmp_v6scopezone_entry * -+netsnmp_access_scopezone_entry_create(void); -+ -+void netsnmp_access_scopezone_entry_free(netsnmp_v6scopezone_entry * entry); -+ -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif /* NETSNMP_ACCESS_SCOPEZONE_H */ --- -1.6.0.2 - diff --git a/Add-IPv6-support-on-Internet-Address-Translation-Tab.patch b/Add-IPv6-support-on-Internet-Address-Translation-Tab.patch deleted file mode 100644 index d38f533..0000000 --- a/Add-IPv6-support-on-Internet-Address-Translation-Tab.patch +++ /dev/null @@ -1,334 +0,0 @@ -From ecd91d8a2b532bd1a987369e76d75fef454f2bcf Mon Sep 17 00:00:00 2001 -From: Mitsuru Chinen -Date: Mon, 20 Oct 2008 17:33:11 +0900 -Subject: [PATCH] Add IPv6 support on Internet Address Translation Table - -[ 1708243 ] add linux support for ipDefaultRouterTable OID to net-snmp -http://sourceforge.net/tracker/index.php?func=detail&aid=1708243&group_id=12694&atid=312694 - -[ 1724602 ] [Linux] ipDefaultRouterTable improvement -http://sourceforge.net/tracker/index.php?func=detail&aid=1724602&group_id=12694&atid=312694 - -[ 1728223 ] [Linux] add configure check for netlink socket -http://sourceforge.net/tracker/index.php?func=detail&aid=1728223&group_id=12694&atid=312694 - -Signed-off-by: Mitsuru Chinen ---- - agent/mibgroup/ip-mib/data_access/arp_linux.c | 243 +++++++++++++++++++- - .../inetNetToMediaTable_data_access.c | 2 +- - configure.in | 10 + - 3 files changed, 249 insertions(+), 6 deletions(-) - -diff --git a/agent/mibgroup/ip-mib/data_access/arp_linux.c b/agent/mibgroup/ip-mib/data_access/arp_linux.c -index e1d20c1..a25e4d8 100644 ---- a/agent/mibgroup/ip-mib/data_access/arp_linux.c -+++ b/agent/mibgroup/ip-mib/data_access/arp_linux.c -@@ -14,9 +14,32 @@ - #include - #include - #include -+#include -+#include -+#ifdef NETSNMP_ENABLE_IPV6 -+#ifdef HAVE_LINUX_RTNETLINK_H -+#include -+#define NIP6(addr) \ -+ ntohs((addr).s6_addr16[0]), \ -+ ntohs((addr).s6_addr16[1]), \ -+ ntohs((addr).s6_addr16[2]), \ -+ ntohs((addr).s6_addr16[3]), \ -+ ntohs((addr).s6_addr16[4]), \ -+ ntohs((addr).s6_addr16[5]), \ -+ ntohs((addr).s6_addr16[6]), \ -+ ntohs((addr).s6_addr16[7]) -+#define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x" -+#endif -+#endif - - int _load_v4(netsnmp_container *container, int idx_offset); -- -+static int _load_v6(netsnmp_container *container, int idx_offset); -+#ifdef HAVE_LINUX_RTNETLINK_H -+int get_translation_table_info (int sd, int *status, -+ char *buff, size_t size); -+int fillup_entry_info(netsnmp_arp_entry *entry, -+ struct nlmsghdr *nlmp); -+#endif - /** - */ - int -@@ -28,11 +51,10 @@ netsnmp_access_arp_container_arch_load(netsnmp_container *container) - 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; -+#if defined (NETSNMP_ENABLE_IPV6) -+ idx_offset = (rc < 0) ? 0 : rc; - - rc = _load_v6(container, idx_offset); - if(rc < 0) { -@@ -64,7 +86,7 @@ _load_v4(netsnmp_container *container, int idx_offset) - - #define PROCFILE "/proc/net/arp" - if (!(in = fopen(PROCFILE, "r"))) { -- snmp_log(LOG_ERR,"could not open " PROCFILE "\n"); -+ snmp_log(LOG_DEBUG,"could not open " PROCFILE "\n"); - return -2; - } - -@@ -192,3 +214,214 @@ _load_v4(netsnmp_container *container, int idx_offset) - - return idx_offset; - } -+ -+#if defined (NETSNMP_ENABLE_IPV6) -+static int -+_load_v6(netsnmp_container *container, int idx_offset) -+{ -+ char buffer[16384]; -+#if defined(HAVE_LINUX_RTNETLINK_H) -+ struct nlmsghdr *nlmp; -+#endif -+ int sd = 0; -+ int status = 0; -+ int rc = 0; -+ int len, req_len; -+ netsnmp_arp_entry *entry; -+ -+ netsnmp_assert(NULL != container); -+#if defined(HAVE_LINUX_RTNETLINK_H) -+ if((sd = socket (PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE)) < 0) { -+ snmp_log(LOG_ERR,"Unable to create netlink socket\n"); -+ return -2; -+ } -+ -+ if(get_translation_table_info (sd, &status, buffer, sizeof(buffer)) < 0) { -+ snmp_log(LOG_ERR,"Unable to fetch translation table info\n"); -+ close(sd); -+ return -2; -+ } -+ -+ for (nlmp = (struct nlmsghdr *)buffer; status > sizeof(*nlmp); ) { -+ len = nlmp->nlmsg_len; -+ req_len = len - sizeof(*nlmp); -+ if (req_len < 0 || len > status) { -+ snmp_log(LOG_ERR,"invalid length\n"); -+ return -2; -+ } -+ if (!NLMSG_OK (nlmp, status)) { -+ snmp_log(LOG_ERR,"NLMSG not OK\n"); -+ return -2; -+ } -+ entry = netsnmp_access_arp_entry_create(); -+ if(NULL == entry) { -+ rc = -3; -+ break; -+ } -+ entry->ns_arp_index = ++idx_offset; -+ if(fillup_entry_info (entry, nlmp) < 0) { -+ DEBUGMSGTL(("access:arp:load_v6", "filling entry info failed\n")); -+ netsnmp_access_arp_entry_free(entry); -+ status -= NLMSG_ALIGN(len); -+ nlmp = (struct nlmsghdr*)((char*)nlmp + NLMSG_ALIGN(len)); -+ continue; -+ } -+ CONTAINER_INSERT(container, entry); -+ status -= NLMSG_ALIGN(len); -+ nlmp = (struct nlmsghdr*)((char*)nlmp + NLMSG_ALIGN(len)); -+ } -+ -+ close(sd); -+#endif -+ if(rc<0) { -+ return rc; -+ } -+ -+ return idx_offset; -+} -+#if defined(HAVE_LINUX_RTNETLINK_H) -+int -+get_translation_table_info (int sd, int *status, char *buff, size_t size) -+{ -+ struct { -+ struct nlmsghdr n; -+ struct ndmsg r; -+ char buf[1024]; -+ } req; -+ struct rtattr *rta; -+ -+ memset(&req, 0, sizeof(req)); -+ req.n.nlmsg_len = NLMSG_LENGTH (sizeof(struct ndmsg)); -+ req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT; -+ req.n.nlmsg_type = RTM_GETNEIGH; -+ -+ req.r.ndm_family = AF_INET6; -+ rta = (struct rtattr *)(((char *)&req) + NLMSG_ALIGN(req.n.nlmsg_len)); -+ rta->rta_len = RTA_LENGTH(16); -+ -+ if(send(sd, &req, req.n.nlmsg_len, 0) < 0) { -+ snmp_log(LOG_ERR,"Sending request failed\n"); -+ return -1; -+ } -+ if((*status = recv(sd, buff, size, 0)) < 0) { -+ snmp_log(LOG_ERR,"Recieving request failed\n"); -+ return -1; -+ } -+ if(*status == 0) { -+ snmp_log(LOG_ERR,"End of file\n"); -+ return -1; -+ } -+ return 0; -+} -+ -+int -+fillup_entry_info(netsnmp_arp_entry *entry, struct nlmsghdr *nlmp) -+{ -+ struct ndmsg *rtmp; -+ struct in6_addr *in6p; -+ struct rtattr *tb[NDA_MAX+1], *rta; -+ size_t in_len, out_len; -+ unsigned int i; -+ int length; -+ char addr[40]; -+ u_char *buf; -+ u_char *hwaddr; -+ -+ rtmp = (struct ndmsg *)NLMSG_DATA(nlmp); -+ if (nlmp->nlmsg_type != RTM_NEWNEIGH && nlmp->nlmsg_type != RTM_DELNEIGH) -+ return -1; -+ -+ if(rtmp->ndm_state != NUD_NOARP) { -+ memset(tb, 0, sizeof(struct rtattr *) * (NDA_MAX + 1)); -+ length = nlmp->nlmsg_len - NLMSG_LENGTH(sizeof(*rtmp)); -+ /* this is what the kernel-removed NDA_RTA define did */ -+ rta = ((struct rtattr*)(((char*)(rtmp)) + -+ NLMSG_ALIGN(sizeof(struct ndmsg)))); -+ while (RTA_OK(rta, length)) { -+ if (rta->rta_type <= NDA_MAX) -+ tb[rta->rta_type] = rta; -+ rta = RTA_NEXT(rta,length); -+ } -+ if(length) -+ return -1; -+ /* Fill up the index -+ */ -+ entry->if_index = rtmp->ndm_ifindex; -+ /* Fill up ip address */ -+ if (tb[NDA_DST]) { -+ memset(&addr, '\0', sizeof(addr)); -+ in6p = (struct in6_addr *)RTA_DATA(tb[NDA_DST]); -+ sprintf(addr, NIP6_FMT, NIP6(*in6p)); -+ in_len = entry->arp_ipaddress_len = sizeof(entry->arp_ipaddress); -+ netsnmp_assert(16 == in_len); -+ out_len = 0; -+ buf = entry->arp_ipaddress; -+ if(1 != netsnmp_hex_to_binary(&buf, &in_len, -+ &out_len, 0, addr, ":")) { -+ snmp_log(LOG_ERR,"error parsing '%s', skipping\n", -+ entry->arp_ipaddress); -+ return -1; -+ } -+ netsnmp_assert(16 == out_len); -+ entry->arp_ipaddress_len = out_len; -+ } -+ if (tb[NDA_LLADDR]) { -+ memset(&addr, '\0', sizeof(addr)); -+ hwaddr = RTA_DATA(tb[NDA_LLADDR]); -+ entry->arp_physaddress_len = RTA_PAYLOAD(tb[NDA_LLADDR]); -+ buf = entry->arp_physaddress; -+ for (i = 0; i < entry->arp_physaddress_len; i++) -+ entry->arp_physaddress[i] = hwaddr[i]; -+ } -+ -+ switch (rtmp->ndm_state) { -+ case NUD_INCOMPLETE: -+ entry->arp_state = INETNETTOMEDIASTATE_INCOMPLETE; -+ break; -+ case NUD_REACHABLE: -+ case NUD_PERMANENT: -+ entry->arp_state = INETNETTOMEDIASTATE_REACHABLE; -+ break; -+ case NUD_STALE: -+ entry->arp_state = INETNETTOMEDIASTATE_STALE; -+ break; -+ case NUD_DELAY: -+ entry->arp_state = INETNETTOMEDIASTATE_DELAY; -+ break; -+ case NUD_PROBE: -+ entry->arp_state = INETNETTOMEDIASTATE_PROBE; -+ break; -+ case NUD_FAILED: -+ entry->arp_state = INETNETTOMEDIASTATE_INVALID; -+ break; -+ case NUD_NONE: -+ entry->arp_state = INETNETTOMEDIASTATE_UNKNOWN; -+ break; -+ } -+ -+ switch (rtmp->ndm_state) { -+ case NUD_INCOMPLETE: -+ case NUD_FAILED : -+ case NUD_NONE : -+ entry->arp_type = INETNETTOMEDIATYPE_INVALID; -+ break; -+ case NUD_REACHABLE: -+ case NUD_STALE : -+ case NUD_DELAY : -+ case NUD_PROBE : -+ entry->arp_type = INETNETTOMEDIATYPE_DYNAMIC; -+ break; -+ case NUD_PERMANENT: -+ entry->arp_type = INETNETTOMEDIATYPE_STATIC; -+ break; -+ default: -+ entry->arp_type = INETNETTOMEDIATYPE_LOCAL; -+ break; -+ } -+ } else { -+ return -1; /* could not create data for this interface */ -+ } -+ return 0; -+} -+#endif -+#endif -diff --git a/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c -index cad942c..dcc7900 100644 ---- a/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c -+++ b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c -@@ -155,7 +155,7 @@ _snarf_arp_entry(netsnmp_arp_entry *arp_entry, - inetAddressType = INETADDRESSTYPE_IPV4; - break; - -- case 6: -+ case 16: - inetAddressType = INETADDRESSTYPE_IPV6; - break; - -diff --git a/configure.in b/configure.in -index c5e05ba..220506a 100644 ---- a/configure.in -+++ b/configure.in -@@ -3365,6 +3365,16 @@ AC_CHECK_HEADERS(linux/rtnetlink.h,,, - #include - #endif - ]]) -+# linux rtnetlink -+AC_CHECK_HEADERS(linux/rtnetlink.h,,, -+[[ -+#if HAVE_ASM_TYPES_H -+#include -+#endif -+#if HAVE_SYS_SOCKET_H -+#include -+#endif -+]]) - # BSDi3 headers - AC_CHECK_HEADERS(sys/stat.h) - # BSDi3/IRIX headers --- -1.6.0.2 - diff --git a/Fix-for-IPv6-Interface-Table.patch b/Fix-for-IPv6-Interface-Table.patch deleted file mode 100644 index e3c5f1a..0000000 --- a/Fix-for-IPv6-Interface-Table.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 65f75f485f428b0f22ff82c96ebd7d89e49ce7b2 Mon Sep 17 00:00:00 2001 -From: Mitsuru Chinen -Date: Mon, 20 Oct 2008 14:50:37 +0900 -Subject: [PATCH] Fix for IPv6 Interface Table - -From net-snmp patch tracker: -[ 1669048 ] Support ipv6InterfaceIdentifier on Linux -http://sourceforge.net/tracker/index.php?func=detail&aid=1669048&group_id=12694&atid=312694 - -[ 1783423 ] correct ipv6InterfaceIdentifier of loopback device -http://sourceforge.net/tracker/index.php?func=detail&aid=1783423&group_id=12694&atid=312694 - -Signed-off-by: Mitsuru Chinen ---- - .../mibgroup/if-mib/data_access/interface_linux.c | 31 ++++++++++++++++++++ - 1 files changed, 31 insertions(+), 0 deletions(-) - -diff --git a/agent/mibgroup/if-mib/data_access/interface_linux.c b/agent/mibgroup/if-mib/data_access/interface_linux.c -index 245fa99..474a904 100644 ---- a/agent/mibgroup/if-mib/data_access/interface_linux.c -+++ b/agent/mibgroup/if-mib/data_access/interface_linux.c -@@ -36,6 +36,7 @@ typedef __u8 u8; /* ditto */ - #include - - #include -+#include - - #ifndef IF_NAMESIZE - #define IF_NAMESIZE 16 -@@ -635,6 +636,36 @@ netsnmp_arch_interface_container_load(netsnmp_container* container, - entry->type = IANAIFTYPE_OTHER; - } - -+ /* -+ * interface identifier is specified based on physaddr and type -+ */ -+ switch (entry->type) { -+ case IANAIFTYPE_ETHERNETCSMACD: -+ case IANAIFTYPE_ETHERNET3MBIT: -+ case IANAIFTYPE_FASTETHER: -+ case IANAIFTYPE_FASTETHERFX: -+ case IANAIFTYPE_GIGABITETHERNET: -+ case IANAIFTYPE_FDDI: -+ case IANAIFTYPE_ISO88025TOKENRING: -+ if (NULL != entry->paddr && ETH_ALEN != entry->paddr_len) -+ break; -+ -+ entry->v6_if_id_len = entry->paddr_len + 2; -+ memcpy(entry->v6_if_id, entry->paddr, 3); -+ memcpy(entry->v6_if_id + 5, entry->paddr + 3, 3); -+ entry->v6_if_id[0] ^= 2; -+ entry->v6_if_id[3] = 0xFF; -+ entry->v6_if_id[4] = 0xFE; -+ -+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V6_IFID; -+ break; -+ -+ case IANAIFTYPE_SOFTWARELOOPBACK: -+ entry->v6_if_id_len = 0; -+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V6_IFID; -+ break; -+ } -+ - if (IANAIFTYPE_ETHERNETCSMACD == entry->type) - entry->speed = - netsnmp_linux_interface_get_if_speed(fd, entry->name); --- -1.6.0.2 - diff --git a/Fix-for-Internet-Address-Prefix-Table.patch b/Fix-for-Internet-Address-Prefix-Table.patch deleted file mode 100644 index dc3bfd4..0000000 --- a/Fix-for-Internet-Address-Prefix-Table.patch +++ /dev/null @@ -1,876 +0,0 @@ -From 71ffec9f8c1bcd14a7bf6ca7762bc121ba1efaf1 Mon Sep 17 00:00:00 2001 -From: Mitsuru Chinen -Date: Mon, 20 Oct 2008 17:42:57 +0900 -Subject: [PATCH] Fix for Internet Address Prefix Table - -From net-snmp patch tracker: -[ 1705594 ] ipAddressPrefixTable Fixes -http://sourceforge.net/tracker/index.php?func=detail&aid=1705594&group_id=12694&atid=312694 - -[ 1902105 ] hide some log messages introduced by patch 1705594 -http://sourceforge.net/tracker/index.php?func=detail&aid=1902105&group_id=12694&atid=312694 - -Signed-off-by: Mitsuru Chinen ---- - .../mibgroup/if-mib/data_access/interface_linux.c | 186 ++++++++++++++++++++ - .../mibgroup/ip-mib/data_access/ipaddress_common.c | 67 +++++++ - .../mibgroup/ip-mib/data_access/ipaddress_linux.c | 144 +++++++++++++++- - .../ipAddressPrefixTable/ipAddressPrefixTable.c | 7 +- - .../ipAddressPrefixTable_constants.h | 14 ++ - .../ipAddressPrefixTable_data_access.c | 27 +++- - agent/mibgroup/util_funcs.c | 152 ++++++++++++++++- - agent/mibgroup/util_funcs.h | 41 +++++ - include/net-snmp/data_access/ipaddress.h | 19 ++- - 9 files changed, 645 insertions(+), 12 deletions(-) - -diff --git a/agent/mibgroup/if-mib/data_access/interface_linux.c b/agent/mibgroup/if-mib/data_access/interface_linux.c -index 474a904..294963a 100644 ---- a/agent/mibgroup/if-mib/data_access/interface_linux.c -+++ b/agent/mibgroup/if-mib/data_access/interface_linux.c -@@ -29,6 +29,7 @@ typedef __u8 u8; /* ditto */ - #include - #include - #include "if-mib/data_access/interface.h" -+#include "mibgroup/util_funcs.h" - #include "interface_ioctl.h" - - #include -@@ -42,6 +43,15 @@ typedef __u8 u8; /* ditto */ - #define IF_NAMESIZE 16 - #endif - -+#ifdef NETSNMP_ENABLE_IPV6 -+#if defined(HAVE_PTHREAD_H) && defined(HAVE_LINUX_RTNETLINK_H) -+#include -+#include -+#ifdef RTMGRP_IPV6_PREFIX -+#define SUPPORT_PREFIX_FLAGS 1 -+#endif /* RTMGRP_IPV6_PREFIX */ -+#endif /* HAVE_PTHREAD_H && HAVE_LINUX_RTNETLINK_H */ -+#endif /* NETSNMP_ENABLE_IPV6 */ - unsigned int - netsnmp_linux_interface_get_if_speed(int fd, const char *name); - #ifdef HAVE_LINUX_ETHTOOL_H -@@ -59,6 +69,16 @@ static unsigned short retrans_time_factor = 1; - #define PROC_SYS_NET_IPVx_BASE_REACHABLE_TIME "/proc/sys/net/ipv%d/neigh/%s/base_reachable_time" - static const char *proc_sys_basereachable_time; - static unsigned short basereachable_time_ms = 0; -+#ifdef SUPPORT_PREFIX_FLAGS -+prefix_cbx *prefix_head_list = NULL; -+pthread_mutex_t prefix_mutex_lock = PTHREAD_MUTEX_INITIALIZER; -+netsnmp_prefix_listen_info list_info; -+pthread_t thread1; -+#define IF_PREFIX_ONLINK 0x01 -+#define IF_PREFIX_AUTOCONF 0x02 -+ -+void *netsnmp_prefix_listen(netsnmp_prefix_listen_info *listen_info); -+#endif - void - netsnmp_arch_interface_init(void) - { -@@ -91,6 +111,13 @@ netsnmp_arch_interface_init(void) - else { - proc_sys_basereachable_time = PROC_SYS_NET_IPVx_BASE_REACHABLE_TIME; - } -+#ifdef SUPPORT_PREFIX_FLAGS -+ list_info.list_head = &prefix_head_list; -+ list_info.lockinfo = &prefix_mutex_lock; -+ -+ if(pthread_create(&thread1, NULL, netsnmp_prefix_listen, &list_info) < 0) -+ snmp_log(LOG_ERR,"Unable to create thread\n"); -+#endif - } - - /* -@@ -885,3 +912,162 @@ netsnmp_linux_interface_get_if_speed(int fd, const char *name) - } - return retspeed; - } -+#ifdef SUPPORT_PREFIX_FLAGS -+void *netsnmp_prefix_listen(netsnmp_prefix_listen_info *listen_info) -+{ -+ struct { -+ struct nlmsghdr n; -+ struct ifinfomsg r; -+ char buf[1024]; -+ } req; -+ -+ struct rtattr *rta; -+ int status; -+ char buf[16384]; -+ struct nlmsghdr *nlmp; -+ struct rtattr *rtatp; -+ struct in6_addr *in6p; -+ struct sockaddr_nl localaddrinfo; -+ struct ifaddrmsg *ifa; -+ struct prefixmsg *prefix; -+ unsigned groups = 0; -+ struct rtattr *index_table[IFA_MAX+1]; -+ char in6pAddr[40]; -+ int flag1 = 0,flag2 = 0; -+ int onlink = 2,autonomous = 2; /*Assume as false*/ -+ prefix_cbx *new; -+ int iret; -+ int len, req_len, length; -+ int fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); -+ -+ -+ memset(&localaddrinfo, 0, sizeof(struct sockaddr_nl)); -+ memset(&in6pAddr, '\0', sizeof(in6pAddr)); -+ -+ groups |= RTMGRP_IPV6_IFADDR; -+ groups |= RTMGRP_IPV6_PREFIX; -+ localaddrinfo.nl_family = AF_NETLINK; -+ localaddrinfo.nl_groups = groups; -+ -+ if (bind(fd, (struct sockaddr*)&localaddrinfo, sizeof(localaddrinfo)) < 0) { -+ snmp_log(LOG_ERR,"netsnmp_prefix_listen: Bind failed. Exiting thread.\n"); -+ exit(0); -+ } -+ -+ memset(&req, 0, sizeof(req)); -+ req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); -+ req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT; -+ req.n.nlmsg_type = RTM_GETLINK; -+ req.r.ifi_family = AF_INET6; -+ rta = (struct rtattr *)(((char *)&req) + NLMSG_ALIGN(req.n.nlmsg_len)); -+ rta->rta_len = RTA_LENGTH(16); -+ -+ status = send(fd, &req, req.n.nlmsg_len, 0); -+ if (status < 0) { -+ snmp_log(LOG_ERR,"netsnmp_prefix_listen: Send failed. Exiting thread\n"); -+ exit(0); -+ } -+ -+ while(1) { -+ status = recv(fd, buf, sizeof(buf), 0); -+ if (status < 0) { -+ snmp_log(LOG_ERR,"netsnmp_prefix_listen: Recieve failed. Exiting thread\n"); -+ exit(0); -+ } -+ -+ if(status == 0){ -+ DEBUGMSGTL(("access:interface:prefix", "End of File\n")); -+ continue; -+ } -+ -+ for(nlmp = (struct nlmsghdr *)buf; status > sizeof(*nlmp);){ -+ len = nlmp->nlmsg_len; -+ req_len = len - sizeof(*nlmp); -+ -+ if (req_len < 0 || len > status) { -+ snmp_log(LOG_ERR,"netsnmp_prefix_listen: Error in length. Exiting thread\n"); -+ exit(0); -+ } -+ -+ if (!NLMSG_OK(nlmp, status)) { -+ DEBUGMSGTL(("access:interface:prefix", "NLMSG not OK\n")); -+ continue; -+ } -+ -+ if (nlmp->nlmsg_type == RTM_NEWADDR || nlmp->nlmsg_type == RTM_DELADDR) { -+ ifa = NLMSG_DATA(nlmp); -+ length = nlmp->nlmsg_len; -+ length -= NLMSG_LENGTH(sizeof(*ifa)); -+ -+ if (length < 0) { -+ DEBUGMSGTL(("access:interface:prefix", "wrong nlmsg length %d\n", length)); -+ continue; -+ } -+ memset(index_table, 0, sizeof(struct rtattr *) * (IFA_MAX + 1)); -+ if(!ifa->ifa_flags) { -+ rtatp = IFA_RTA(ifa); -+ while (RTA_OK(rtatp, length)) { -+ if (rtatp->rta_type <= IFA_MAX) -+ index_table[rtatp->rta_type] = rtatp; -+ rtatp = RTA_NEXT(rtatp,length); -+ } -+ if (index_table[IFA_ADDRESS]) { -+ in6p = (struct in6_addr *)RTA_DATA(index_table[IFA_ADDRESS]); -+ if(nlmp->nlmsg_type == RTM_DELADDR) { -+ sprintf(in6pAddr, "%04x%04x%04x%04x%04x%04x%04x%04x", NIP6(*in6p)); -+ flag1 = -1; -+ } else { -+ sprintf(in6pAddr, "%04x%04x%04x%04x%04x%04x%04x%04x", NIP6(*in6p)); -+ flag1 = 1; -+ } -+ -+ } -+ } -+ } -+ -+ if(nlmp->nlmsg_type == RTM_NEWPREFIX) { -+ prefix = NLMSG_DATA(nlmp); -+ length = nlmp->nlmsg_len; -+ length -= NLMSG_LENGTH(sizeof(*prefix)); -+ -+ if (length < 0) { -+ DEBUGMSGTL(("access:interface:prefix", "wrong nlmsg length %d\n", length)); -+ continue; -+ } -+ flag2 = 1; -+ if (prefix->prefix_flags & IF_PREFIX_ONLINK) -+ onlink = 1; -+ if (prefix->prefix_flags & IF_PREFIX_AUTOCONF) -+ autonomous = 1; -+ } -+ status -= NLMSG_ALIGN(len); -+ nlmp = (struct nlmsghdr*)((char*)nlmp + NLMSG_ALIGN(len)); -+ } -+ if((flag1 == 1) && (flag2 == 1)){ -+ if(!(new = net_snmp_create_prefix_info (onlink, autonomous, in6pAddr))) -+ DEBUGMSGTL(("access:interface:prefix", "Unable to create prefix info\n")); -+ else { -+ iret = net_snmp_update_prefix_info (listen_info->list_head, new, listen_info->lockinfo); -+ if(iret < 0) { -+ DEBUGMSGTL(("access:interface:prefix", "Unable to add/update prefix info\n")); -+ free(new); -+ } -+ if(iret == 2) /*Only when enrty already exists and we are only updating*/ -+ free(new); -+ } -+ flag1 = flag2 = 0; -+ onlink = autonomous = 2; /*Set to defaults again*/ -+ } else if (flag1 == -1) { -+ iret = net_snmp_delete_prefix_info (listen_info->list_head, in6pAddr, listen_info->lockinfo); -+ if(iret < 0) -+ DEBUGMSGTL(("access:interface:prefix", "Unable to delete the prefix info\n")); -+ if(!iret) -+ DEBUGMSGTL(("access:interface:prefix", "Unable to find the node to delete\n")); -+ flag1 = 0; -+ } -+ } -+ -+} -+#endif -+ -+ -diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_common.c b/agent/mibgroup/ip-mib/data_access/ipaddress_common.c -index 396fc96..3eef0cc 100644 ---- a/agent/mibgroup/ip-mib/data_access/ipaddress_common.c -+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_common.c -@@ -304,6 +304,27 @@ netsnmp_access_ipaddress_entry_update(netsnmp_ipaddress_entry *lhs, - ++changed; - lhs->ia_origin = rhs->ia_origin; - } -+ -+ if (lhs->ia_onlink_flag != rhs->ia_onlink_flag) { -+ ++changed; -+ lhs->ia_onlink_flag = rhs->ia_onlink_flag; -+ } -+ -+ if (lhs->ia_autonomous_flag != rhs->ia_autonomous_flag) { -+ ++changed; -+ lhs->ia_autonomous_flag = rhs->ia_autonomous_flag; -+ } -+ -+ if (lhs->ia_prefered_lifetime != rhs->ia_prefered_lifetime) { -+ ++changed; -+ lhs->ia_prefered_lifetime = rhs->ia_prefered_lifetime; -+ } -+ -+ if (lhs->ia_valid_lifetime != rhs->ia_valid_lifetime) { -+ ++changed; -+ lhs->ia_valid_lifetime = rhs->ia_valid_lifetime; -+ } -+ - - return changed; - } -@@ -428,3 +449,49 @@ static int _access_ipaddress_entry_compare_addr(const void *lhs, - */ - return memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len); - } -+ -+int -+netsnmp_ipaddress_flags_copy(u_long *ipAddressPrefixAdvPreferredLifetime, -+ u_long *ipAddressPrefixAdvValidLifetime, -+ u_long *ipAddressPrefixOnLinkFlag, -+ u_long *ipAddressPrefixAutonomousFlag, -+ u_long *ia_prefered_lifetime, -+ u_long *ia_valid_lifetime, -+ u_char *ia_onlink_flag, -+ u_char *ia_autonomous_flag) -+{ -+ -+ /*Copy all the flags*/ -+ *ipAddressPrefixAdvPreferredLifetime = *ia_prefered_lifetime; -+ *ipAddressPrefixAdvValidLifetime = *ia_valid_lifetime; -+ *ipAddressPrefixOnLinkFlag = *ia_onlink_flag; -+ *ipAddressPrefixAutonomousFlag = *ia_autonomous_flag; -+ return 0; -+} -+ -+int -+netsnmp_ipaddress_prefix_origin_copy(u_long *ipAddressPrefixOrigin, -+ u_char ia_origin, -+ int flags, -+ u_long ipAddressAddrType) -+{ -+ if(ipAddressAddrType == INETADDRESSTYPE_IPV4){ -+ if(ia_origin == 6) /*Random*/ -+ (*ipAddressPrefixOrigin) = 3 /*IPADDRESSPREFIXORIGINTC_WELLKNOWN*/; -+ else -+ (*ipAddressPrefixOrigin) = ia_origin; -+ } else { -+ if(ia_origin == 5) { /*Link Layer*/ -+ if(!flags) /*Global address assigned by router adv*/ -+ (*ipAddressPrefixOrigin) = 5 /*IPADDRESSPREFIXORIGINTC_ROUTERADV*/; -+ else -+ (*ipAddressPrefixOrigin) = 3 /*IPADDRESSPREFIXORIGINTC_WELLKNOWN*/; -+ } -+ else if(ia_origin == 6) /*Random*/ -+ (*ipAddressPrefixOrigin) = 5 /*IPADDRESSPREFIXORIGINTC_ROUTERADV*/; -+ else -+ (*ipAddressPrefixOrigin) = ia_origin; -+ } -+ return 0; -+} -+ -diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c -index 4616649..c6e5fec 100644 ---- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c -+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c -@@ -12,6 +12,8 @@ - #include - - #include "ip-mib/ipAddressTable/ipAddressTable_constants.h" -+#include "ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h" -+#include "mibgroup/util_funcs.h" - - #include - #include -@@ -19,15 +21,29 @@ - #if defined (NETSNMP_ENABLE_IPV6) - #include - #include --#ifdef HAVE_LINUX_RTNETLINK_H -+#if defined(HAVE_PTHREAD_H) && defined(HAVE_LINUX_RTNETLINK_H) - #include -+#include - #include --#endif -+#ifdef RTMGRP_IPV6_PREFIX -+#define SUPPORT_PREFIX_FLAGS 1 -+#endif /* RTMGRP_IPV6_PREFIX */ -+#endif /* HAVE_PTHREAD_H && HAVE_LINUX_RTNETLINK_H */ - #endif - - #include "ipaddress_ioctl.h" -- -+#ifdef SUPPORT_PREFIX_FLAGS -+extern prefix_cbx *prefix_head_list; -+extern pthread_mutex_t prefix_mutex_lock; -+#endif - int _load_v6(netsnmp_container *container, int idx_offset); -+#ifdef HAVE_LINUX_RTNETLINK_H -+int -+netsnmp_access_ipaddress_extra_prefix_info(int index, -+ u_long *preferedlt, -+ ulong *validlt, -+ char *addr); -+#endif - - /* - * initialize arch specific storage -@@ -194,6 +210,7 @@ _load_v6(netsnmp_container *container, int idx_offset) - u_char *buf; - int if_index, pfx_len, scope, flags, rc = 0; - size_t in_len, out_len; -+ prefix_cbx prefix_val; - netsnmp_ipaddress_entry *entry; - _ioctl_extras *extras; - static int log_open_err = 1; -@@ -251,6 +268,7 @@ _load_v6(netsnmp_container *container, int idx_offset) - in_len = entry->ia_address_len = sizeof(entry->ia_address); - netsnmp_assert(16 == in_len); - out_len = 0; -+ entry->flags = flags; - buf = entry->ia_address; - if(1 != netsnmp_hex_to_binary(&buf, &in_len, - &out_len, 0, addr, ":")) { -@@ -341,6 +359,30 @@ _load_v6(netsnmp_container *container, int idx_offset) - entry->ia_storagetype = STORAGETYPE_PERMANENT; - - /* xxx-rks: what can we do with scope? */ -+#ifdef HAVE_LINUX_RTNETLINK_H -+ if(netsnmp_access_ipaddress_extra_prefix_info(entry->if_index, &entry->ia_prefered_lifetime -+ ,&entry->ia_valid_lifetime, addr) < 0){ -+ DEBUGMSGTL(("access:ipaddress:container", "unable to fetch extra prefix info\n")); -+ } -+#else -+ entry->ia_prefered_lifetime = 0; -+ entry->ia_valid_lifetime = 0; -+#endif -+#ifdef SUPPORT_PREFIX_FLAGS -+ memset(&prefix_val, 0, sizeof(prefix_cbx)); -+ if(net_snmp_find_prefix_info(&prefix_head_list, addr, &prefix_val, &prefix_mutex_lock) < 0) { -+ DEBUGMSGTL(("access:ipaddress:container", "unable to find info\n")); -+ entry->ia_onlink_flag = 1; /*Set by default as true*/ -+ entry->ia_autonomous_flag = 2; /*Set by default as false*/ -+ -+ } else { -+ entry->ia_onlink_flag = prefix_val.ipAddressPrefixOnLinkFlag; -+ entry->ia_autonomous_flag = prefix_val.ipAddressPrefixAutonomousFlag; -+ } -+#else -+ entry->ia_onlink_flag = 1; /*Set by default as true*/ -+ entry->ia_autonomous_flag = 2; /*Set by default as false*/ -+#endif - - /* - * add entry to container -@@ -448,4 +490,100 @@ netsnmp_access_other_info_get(int index, int family) - return addr; - #endif - } -+ -+#ifdef HAVE_LINUX_RTNETLINK_H -+int -+netsnmp_access_ipaddress_extra_prefix_info(int index, u_long *preferedlt, -+ ulong *validlt, char *addr) -+{ -+ -+ struct { -+ struct nlmsghdr nlhdr; -+ struct ifaddrmsg ifaceinfo; -+ char buf[1024]; -+ } req; -+ -+ struct rtattr *rta; -+ int status; -+ char buf[16384]; -+ char tmpaddr[40]; -+ struct nlmsghdr *nlmp; -+ struct ifaddrmsg *rtmp; -+ struct rtattr *rtatp; -+ struct ifa_cacheinfo *cache_info; -+ struct in6_addr *in6p; -+ int rtattrlen; -+ int sd; -+ int reqaddr = 0; -+ sd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); -+ if(sd < 0) { -+ snmp_log(LOG_ERR, "could not open netlink socket\n"); -+ return -1; -+ } -+ memset(&req, 0, sizeof(req)); -+ req.nlhdr.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg)); -+ req.nlhdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT; -+ req.nlhdr.nlmsg_type = RTM_GETADDR; -+ req.ifaceinfo.ifa_family = AF_INET6; -+ rta = (struct rtattr *)(((char *)&req) + NLMSG_ALIGN(req.nlhdr.nlmsg_len)); -+ rta->rta_len = RTA_LENGTH(16); /*For ipv6*/ -+ -+ status = send (sd, &req, req.nlhdr.nlmsg_len, 0); -+ if (status < 0) { -+ snmp_log(LOG_ERR, "could not send netlink request\n"); -+ return -1; -+ } -+ status = recv (sd, buf, sizeof(buf), 0); -+ if (status < 0) { -+ snmp_log (LOG_ERR, "could not recieve netlink request\n"); -+ return -1; -+ } -+ if (status == 0) { -+ snmp_log (LOG_ERR, "nothing to read\n"); -+ return -1; -+ } -+ for (nlmp = (struct nlmsghdr *)buf; status > sizeof(*nlmp); ){ -+ -+ int len = nlmp->nlmsg_len; -+ int req_len = len - sizeof(*nlmp); -+ -+ if (req_len < 0 || len > status) { -+ snmp_log (LOG_ERR, "invalid netlink message\n"); -+ return -1; -+ } -+ -+ if (!NLMSG_OK (nlmp, status)) { -+ snmp_log (LOG_ERR, "invalid NLMSG message\n"); -+ return -1; -+ } -+ rtmp = (struct ifaddrmsg *)NLMSG_DATA(nlmp); -+ rtatp = (struct rtattr *)IFA_RTA(rtmp); -+ rtattrlen = IFA_PAYLOAD(nlmp); -+ if(index == rtmp->ifa_index) { -+ for (; RTA_OK(rtatp, rtattrlen); rtatp = RTA_NEXT(rtatp, rtattrlen)) { -+ if(rtatp->rta_type == IFA_ADDRESS) { -+ in6p = (struct in6_addr *)RTA_DATA(rtatp); -+ sprintf(tmpaddr, "%04x%04x%04x%04x%04x%04x%04x%04x", NIP6(*in6p)); -+ if(!strcmp(tmpaddr ,addr)) -+ reqaddr = 1; -+ } -+ if(rtatp->rta_type == IFA_CACHEINFO) { -+ cache_info = (struct ifa_cacheinfo *)RTA_DATA(rtatp); -+ if(reqaddr) { -+ reqaddr = 0; -+ *validlt = cache_info->ifa_valid; -+ *preferedlt = cache_info->ifa_prefered; -+ } -+ -+ } -+ -+ } -+ } -+ status -= NLMSG_ALIGN(len); -+ nlmp = (struct nlmsghdr*)((char*)nlmp + NLMSG_ALIGN(len)); -+ } -+ close(sd); -+ return 0; -+} -+#endif - #endif -diff --git a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c -index ecd26a0..9188f93 100644 ---- a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c -+++ b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c -@@ -392,10 +392,9 @@ ipAddressPrefixOrigin_get(ipAddressPrefixTable_rowreq_ctx * 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_val_ptr) = rowreq_ctx->data.ipAddressPrefixOrigin; -+ -+ return MFD_SUCCESS; - } /* ipAddressPrefixOrigin_get */ - - /*--------------------------------------------------------------------- -diff --git a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h -index d9c0cb0..6dd440d 100644 ---- a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h -+++ b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h -@@ -137,3 +137,17 @@ extern "C" { - } - #endif - #endif /* IPADDRESSPREFIXTABLE_OIDS_H */ -+/**************************************************************** -+* Additional constants and definitions for common implementation -+*/ -+#define INFINITY_LIFE_TIME 0xFFFFFFFFU -+#define NIP6(addr) \ -+ ntohs((addr).s6_addr16[0]), \ -+ ntohs((addr).s6_addr16[1]), \ -+ ntohs((addr).s6_addr16[2]), \ -+ ntohs((addr).s6_addr16[3]), \ -+ ntohs((addr).s6_addr16[4]), \ -+ ntohs((addr).s6_addr16[5]), \ -+ ntohs((addr).s6_addr16[6]), \ -+ ntohs((addr).s6_addr16[7]) -+ -diff --git a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c -index 4cda4de..9e0b5fe 100644 ---- a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c -+++ b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c -@@ -251,6 +251,23 @@ ipAddressPrefixTable_container_load(netsnmp_container *container) - ia_address_len, - addr_rowreq_ctx->data-> - ia_prefix_len); -+ netsnmp_ipaddress_flags_copy(&rowreq_ctx->data. -+ ipAddressPrefixAdvPreferredLifetime, -+ &rowreq_ctx->data. -+ ipAddressPrefixAdvValidLifetime, -+ &rowreq_ctx->data. -+ ipAddressPrefixOnLinkFlag, -+ &rowreq_ctx->data. -+ ipAddressPrefixAutonomousFlag, -+ &addr_rowreq_ctx->data-> -+ ia_prefered_lifetime, -+ &addr_rowreq_ctx->data-> -+ ia_valid_lifetime, -+ &addr_rowreq_ctx->data-> -+ ia_onlink_flag, -+ &addr_rowreq_ctx->data-> -+ ia_autonomous_flag); -+ - if (MFD_SUCCESS != - ipAddressPrefixTable_indexes_set(rowreq_ctx, - addr_rowreq_ctx->data-> -@@ -277,8 +294,14 @@ ipAddressPrefixTable_container_load(netsnmp_container *container) - * 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; -+ netsnmp_ipaddress_prefix_origin_copy(&rowreq_ctx->data. -+ ipAddressPrefixOrigin, -+ addr_rowreq_ctx->data-> -+ ia_origin, -+ addr_rowreq_ctx->data-> -+ flags, -+ addr_rowreq_ctx->tbl_idx. -+ ipAddressAddrType); - - /** defer the rest til row prep */ - -diff --git a/agent/mibgroup/util_funcs.c b/agent/mibgroup/util_funcs.c -index 26826f7..d060721 100644 ---- a/agent/mibgroup/util_funcs.c -+++ b/agent/mibgroup/util_funcs.c -@@ -100,7 +100,9 @@ - # include - # endif - #endif -- -+#ifdef HAVE_PTHREAD_H -+#include -+#endif - #include - #include - -@@ -1292,3 +1294,151 @@ get_pid_from_inode(unsigned long long inode) - } - - #endif /* #ifdef linux */ -+ -+#if defined(HAVE_PTHREAD_H) -+prefix_cbx *net_snmp_create_prefix_info(unsigned long OnLinkFlag, -+ unsigned long AutonomousFlag, -+ char *in6ptr) -+{ -+ prefix_cbx *node = SNMP_MALLOC_TYPEDEF(prefix_cbx); -+ if(!in6ptr) { -+ free(node); -+ return NULL; -+ } -+ if(!node) { -+ free(node); -+ return NULL; -+ } -+ node->next_info = NULL; -+ node->ipAddressPrefixOnLinkFlag = OnLinkFlag; -+ node->ipAddressPrefixAutonomousFlag = AutonomousFlag; -+ memcpy(node->in6p, in6ptr, sizeof(node->in6p)); -+ -+ return node; -+} -+ -+int net_snmp_find_prefix_info(prefix_cbx **head, -+ char *address, -+ prefix_cbx *node_to_find, -+ pthread_mutex_t *lockid) -+{ -+ int iret; -+ memset(node_to_find, 0, sizeof(prefix_cbx)); -+ if(!*head) -+ return -1; -+ memcpy(node_to_find->in6p, address, sizeof(node_to_find->in6p)); -+ -+ iret = net_snmp_search_update_prefix_info(head, node_to_find, 1, lockid); -+ if(iret < 0) { -+ DEBUGMSGTL(("util_funcs:prefix", "Unable to search the list\n")); -+ return -1; -+ } else if (!iret) { -+ DEBUGMSGTL(("util_funcs:prefix", "Could not find prefix info\n")); -+ return -1; -+ } else -+ return 0; -+} -+ -+int net_snmp_update_prefix_info(prefix_cbx **head, -+ prefix_cbx *node_to_update, -+ pthread_mutex_t *lockid) -+{ -+ int iret; -+ iret = net_snmp_search_update_prefix_info(head, node_to_update, 0, lockid); -+ if(iret < 0) { -+ DEBUGMSGTL(("util_funcs:prefix", "Unable to update prefix info\n")); -+ return -1; -+ } else if (!iret) { -+ DEBUGMSGTL(("util_funcs:prefix", "Unable to find the node to update\n")); -+ return -1; -+ } else -+ return 0; -+} -+ -+int net_snmp_search_update_prefix_info(prefix_cbx **head, -+ prefix_cbx *node_to_use, -+ int functionality, -+ pthread_mutex_t *lockid) -+{ -+ -+ /* We define functionality based on need * -+ * 0 - Need to do a search and update. We have to provide the node_to_use structure filled fully * -+ * 1 - Need to do only search. Provide the node_to_use with in6p value filled */ -+ -+ prefix_cbx *temp_node; -+ netsnmp_assert(NULL != head); -+ netsnmp_assert(NULL != node_to_use); -+ -+ if(functionality > 1) -+ return -1; -+ if(!node_to_use) -+ return -1; -+ -+ -+ if (!functionality) { -+ if (!*head) { -+ *head = node_to_use; -+ return 1; -+ } -+ -+ pthread_mutex_lock( lockid ); -+ for (temp_node = *head; temp_node->next_info != NULL ; temp_node = temp_node->next_info) { -+ if (0 == strcmp(temp_node->in6p, node_to_use->in6p)) { -+ temp_node->ipAddressPrefixOnLinkFlag = node_to_use->ipAddressPrefixOnLinkFlag; -+ temp_node->ipAddressPrefixAutonomousFlag = node_to_use->ipAddressPrefixAutonomousFlag; -+ pthread_mutex_unlock( lockid ); -+ return 2; -+ } -+ } -+ temp_node->next_info = node_to_use; -+ pthread_mutex_unlock( lockid ); -+ return 1; -+ } else { -+ pthread_mutex_lock( lockid ); -+ for (temp_node = *head; temp_node != NULL ; temp_node = temp_node->next_info) { -+ if (0 == strcmp(temp_node->in6p, node_to_use->in6p)) { -+ /*need yo put sem here as i read here */ -+ node_to_use->ipAddressPrefixOnLinkFlag = temp_node->ipAddressPrefixOnLinkFlag; -+ node_to_use->ipAddressPrefixAutonomousFlag = temp_node->ipAddressPrefixAutonomousFlag; -+ pthread_mutex_unlock( lockid ); -+ return 1; -+ } -+ } -+ pthread_mutex_unlock( lockid ); -+ return 0; -+ } -+} -+ -+int net_snmp_delete_prefix_info(prefix_cbx **head, -+ char *address, -+ pthread_mutex_t *lockid) -+{ -+ -+ prefix_cbx *temp_node,*prev_node; -+ if(!address) -+ return -1; -+ if(!head) -+ return -1; -+ -+ /*Need to acquire lock here */ -+ pthread_mutex_lock( lockid ); -+ for (temp_node = *head, prev_node = NULL; temp_node; -+ prev_node = temp_node, temp_node = temp_node->next_info) { -+ -+ if (temp_node->in6p && strcmp(temp_node->in6p, address) == 0) { -+ if (prev_node) -+ prev_node->next_info = temp_node->next_info; -+ else -+ *head = temp_node->next_info; -+ free(temp_node); -+ pthread_mutex_unlock( lockid ); -+ return 1; -+ } -+ -+ } -+ /*Release Lock here */ -+ pthread_mutex_unlock( lockid ); -+ return 0; -+} -+#endif -+ -diff --git a/agent/mibgroup/util_funcs.h b/agent/mibgroup/util_funcs.h -index 4a0b99e..aa4257f 100644 ---- a/agent/mibgroup/util_funcs.h -+++ b/agent/mibgroup/util_funcs.h -@@ -8,8 +8,23 @@ - extern "C" { - #endif - -+#ifdef HAVE_PTHREAD_H -+#include -+#endif - #include "struct.h" - -+typedef struct prefix_info -+{ -+ struct prefix_info *next_info; -+ unsigned long ipAddressPrefixOnLinkFlag; -+ unsigned long ipAddressPrefixAutonomousFlag; -+ char in6p[40]; -+}prefix_cbx; -+typedef struct -+{ -+ prefix_cbx **list_head; -+ pthread_mutex_t *lockinfo; -+}netsnmp_prefix_listen_info; - void Exit(int); - int shell_command(struct extensible *); - int exec_command(struct extensible *); -@@ -37,6 +52,32 @@ const char *make_tempfile(void); - #ifdef linux - unsigned int get_pid_from_inode(unsigned long long); - #endif -+prefix_cbx *net_snmp_create_prefix_info(unsigned long OnLinkFlag, -+ unsigned long AutonomousFlag, -+ char *in6ptr); -+int net_snmp_find_prefix_info(prefix_cbx **head, -+ char *address, -+ prefix_cbx *node_to_find, -+ pthread_mutex_t *lockid); -+int net_snmp_update_prefix_info(prefix_cbx **head, -+ prefix_cbx *node_to_update, -+ pthread_mutex_t *lockid); -+int net_snmp_search_update_prefix_info(prefix_cbx **head, -+ prefix_cbx *node_to_use, -+ int functionality, -+ pthread_mutex_t *lockid); -+int net_snmp_delete_prefix_info(prefix_cbx **head, -+ char *address, -+ pthread_mutex_t *lockid); -+#define NIP6(addr) \ -+ ntohs((addr).s6_addr16[0]), \ -+ ntohs((addr).s6_addr16[1]), \ -+ ntohs((addr).s6_addr16[2]), \ -+ ntohs((addr).s6_addr16[3]), \ -+ ntohs((addr).s6_addr16[4]), \ -+ ntohs((addr).s6_addr16[5]), \ -+ ntohs((addr).s6_addr16[6]), \ -+ ntohs((addr).s6_addr16[7]) - - #define satosin(x) ((struct sockaddr_in *) &(x)) - #define SOCKADDR(x) (satosin(x)->sin_addr.s_addr) -diff --git a/include/net-snmp/data_access/ipaddress.h b/include/net-snmp/data_access/ipaddress.h -index b751b47..37083be 100644 ---- a/include/net-snmp/data_access/ipaddress.h -+++ b/include/net-snmp/data_access/ipaddress.h -@@ -47,7 +47,10 @@ typedef struct netsnmp_ipaddress_s { - u_char ia_status; /* IpAddressStatus (1-7) */ - u_char ia_origin; /* IpAddressOrigin (1-6) */ - u_char ia_storagetype; /* IpAddressStorageType (1-5) */ -- -+ u_char ia_onlink_flag; /* IpOnlinkFlag */ -+ u_char ia_autonomous_flag; /*IpAutonomousFlag */ -+ u_long ia_prefered_lifetime;/*IpPreferedLifeTime*/ -+ u_long ia_valid_lifetime;/*IpValidLifeTime*/ - netsnmp_data_list *arch_data; /* arch specific data */ - - } netsnmp_ipaddress_entry; -@@ -142,7 +145,19 @@ int netsnmp_ipaddress_prefix_copy(u_char *dst, u_char *src, - - int netsnmp_ipaddress_ipv4_prefix_len(in_addr_t mask); - -- -+int netsnmp_ipaddress_flags_copy(u_long *ipAddressPrefixAdvPreferredLifetime, -+ u_long *ipAddressPrefixAdvValidLifetime, -+ u_long *ipAddressPrefixOnLinkFlag, -+ u_long *ipAddressPrefixAutonomousFlag, -+ u_long *ia_prefered_lifetime, -+ u_long *ia_valid_lifetime, -+ u_char *ia_onlink_flag, -+ u_char *ia_autonomous_flag); -+ -+int netsnmp_ipaddress_prefix_origin_copy(u_long *ipAddressPrefixOrigin, -+ u_char ia_origin, -+ int flags, -+ u_long ipAddressAddrType); - - /**---------------------------------------------------------------------*/ - --- -1.6.0.2 - diff --git a/Fix-for-Internet-Address-Table.patch b/Fix-for-Internet-Address-Table.patch deleted file mode 100644 index 6a4f055..0000000 --- a/Fix-for-Internet-Address-Table.patch +++ /dev/null @@ -1,405 +0,0 @@ -From 12cb1f471833a7e145bdf7cb4d471d0bd74d73f0 Mon Sep 17 00:00:00 2001 -From: Mitsuru Chinen -Date: Mon, 20 Oct 2008 16:08:06 +0900 -Subject: [PATCH] Fix for Internet Address Table - -From net-snmp patch tracker: -[ 1692817 ] ipAddressTable fixes -http://sourceforge.net/tracker/index.php?func=detail&aid=1692817&group_id=12694&atid=312694 - -[ 1712645 ] meaningful log message on duplicate IP address -http://sourceforge.net/tracker/index.php?func=detail&aid=1712645&group_id=12694&atid=312694 - -[ 1810660 ] Fix broadcast addresses in ipAddressTable on 64 bit -linux -http://sourceforge.net/tracker/index.php?func=detail&aid=1810660&group_id=12694&atid=312694 - -Signed-off-by: Mitsuru Chinen ---- - .../mibgroup/ip-mib/data_access/ipaddress_ioctl.c | 63 +++++++++- - .../mibgroup/ip-mib/data_access/ipaddress_ioctl.h | 13 ++ - .../mibgroup/ip-mib/data_access/ipaddress_linux.c | 121 ++++++++++++++++++-- - .../ip-mib/ipAddressTable/ipAddressTable.c | 5 +- - include/net-snmp/library/container.h | 2 +- - snmplib/container.c | 2 +- - 6 files changed, 189 insertions(+), 17 deletions(-) - -diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c b/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c -index d5e78f0..085653d 100644 ---- a/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c -+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c -@@ -135,7 +135,9 @@ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container, - struct ifreq *ifrp; - struct sockaddr save_addr; - struct sockaddr_in * si; -- netsnmp_ipaddress_entry *entry; -+ netsnmp_ipaddress_entry *entry, *bcastentry; -+ struct address_flag_info addr_info; -+ in_addr_t ipval; - _ioctl_extras *extras; - - if ((sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { -@@ -184,6 +186,7 @@ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container, - 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); -+ ipval = si->sin_addr.s_addr; - memcpy(entry->ia_address, &si->sin_addr.s_addr, - entry->ia_address_len); - -@@ -220,6 +223,26 @@ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container, - } - - /* -+ * get broadcast -+ */ -+ memset(&addr_info, 0, sizeof(struct address_flag_info)); -+#if defined (NETSNMP_ENABLE_IPV6) -+ addr_info = netsnmp_access_other_info_get(entry->if_index, AF_INET); -+ if(addr_info.bcastflg) { -+ bcastentry = netsnmp_access_ipaddress_entry_create(); -+ if(NULL == entry) { -+ rc = -3; -+ break; -+ } -+ bcastentry->if_index = entry->if_index; -+ bcastentry->ns_ia_index = ++idx_offset; -+ bcastentry->ia_address_len = sizeof(addr_info.inp->s_addr); -+ memcpy(bcastentry->ia_address, &addr_info.inp->s_addr, -+ bcastentry->ia_address_len); -+ } -+#endif -+ -+ /* - * get netmask - */ - ifrp->ifr_addr = save_addr; -@@ -232,7 +255,10 @@ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container, - 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); -+ netsnmp_ipaddress_ipv4_prefix_len(ntohl(si->sin_addr.s_addr)); -+ if(addr_info.bcastflg) -+ bcastentry->ia_prefix_len = entry->ia_prefix_len; -+ - - /* - * get flags -@@ -246,7 +272,12 @@ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container, - } - extras->flags = ifrp->ifr_flags; - -- entry->ia_type = IPADDRESSTYPE_UNICAST; /* assume unicast? */ -+ if(addr_info.bcastflg) -+ bcastentry->ia_type = IPADDRESSTYPE_BROADCAST; -+ if(addr_info.anycastflg) -+ entry->ia_type = IPADDRESSTYPE_ANYCAST; -+ else -+ entry->ia_type = IPADDRESSTYPE_UNICAST; - - /** entry->ia_prefix_oid ? */ - -@@ -256,12 +287,23 @@ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container, - * always preferred(1). - */ - entry->ia_status = IPADDRESSSTATUSTC_PREFERRED; -+ if(addr_info.bcastflg) -+ bcastentry->ia_status = IPADDRESSSTATUSTC_PREFERRED; - - /* - * can we figure out if an address is from DHCP? - * use manual until then... - */ -- entry->ia_origin = IPADDRESSORIGINTC_MANUAL; -+ if(IS_APIPA(ipval)) { -+ entry->ia_origin = IPADDRESSORIGINTC_RANDOM; -+ if(addr_info.bcastflg) -+ bcastentry->ia_origin = IPADDRESSORIGINTC_RANDOM; -+ } -+ else { -+ entry->ia_origin = IPADDRESSORIGINTC_MANUAL; -+ if(addr_info.bcastflg) -+ bcastentry->ia_origin = IPADDRESSORIGINTC_MANUAL; -+ } - - DEBUGIF("access:ipaddress:container") { - DEBUGMSGT_NC(("access:ipaddress:container", -@@ -279,12 +321,21 @@ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container, - /* - * add entry to container - */ -- if (CONTAINER_INSERT(container, entry) < 0) -- { -+ if(addr_info.bcastflg){ -+ if (CONTAINER_INSERT(container, bcastentry) < 0) { -+ DEBUGMSGTL(("access:ipaddress:container","error with ipaddress_entry: insert broadcast entry into container failed.\n")); -+ netsnmp_access_ipaddress_entry_free(bcastentry); -+ netsnmp_access_ipaddress_entry_free(entry); -+ continue; -+ } -+ } -+ -+ 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; - } -+ - } - - /* -diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h b/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h -index a7a0ea2..fc9774f 100644 ---- a/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h -+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h -@@ -2,6 +2,17 @@ - extern "C" { - #endif - -+/* -+ * struct for netlink extras -+ */ -+struct address_flag_info { -+ int bcastflg; -+ int anycastflg; -+ struct in_addr *inp; -+}; -+ -+#define IS_APIPA(a) (((in_addr_t)(a << 16)) == 0xFEA90000) -+ - int - _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container, - int idx_offset); -@@ -13,6 +24,8 @@ _netsnmp_ioctl_ipaddress_remove_v4(netsnmp_ipaddress_entry * entry); - int - netsnmp_access_ipaddress_ioctl_get_interface_count(int sd, struct ifconf * ifc); - -+struct address_flag_info -+netsnmp_access_other_info_get(int index, int family); - - /* - * struct ioctl for arch_data -diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c -index 8cb06a2..ac37578 100644 ---- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c -+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c -@@ -19,6 +19,7 @@ - #if defined (NETSNMP_ENABLE_IPV6) - #include - #include -+#include - #include - #endif - -@@ -188,6 +189,7 @@ _load_v6(netsnmp_container *container, int idx_offset) - netsnmp_ipaddress_entry *entry; - _ioctl_extras *extras; - static int log_open_err = 1; -+ struct address_flag_info addr_info; - - netsnmp_assert(NULL != container); - -@@ -268,6 +270,10 @@ _load_v6(netsnmp_container *container, int idx_offset) - * every time it is called. - */ - entry->if_index = netsnmp_access_interface_index_find(if_name); -+ memset(&addr_info, 0, sizeof(struct address_flag_info)); -+#if defined (NETSNMP_ENABLE_IPV6) -+ addr_info = netsnmp_access_other_info_get(entry->if_index, AF_INET6); -+#endif - - /* - #define IPADDRESSSTATUSTC_PREFERRED 1 -@@ -278,7 +284,7 @@ _load_v6(netsnmp_container *container, int idx_offset) - #define IPADDRESSSTATUSTC_TENTATIVE 6 - #define IPADDRESSSTATUSTC_DUPLICATE 7 - */ -- if(flags & IFA_F_PERMANENT) -+ if((flags & IFA_F_PERMANENT) || (!flags) || (flags & IFA_F_TEMPORARY)) - entry->ia_status = IPADDRESSSTATUSTC_PREFERRED; /* ?? */ - else if(flags & IFA_F_DEPRECATED) - entry->ia_status = IPADDRESSSTATUSTC_DEPRECATED; -@@ -294,7 +300,7 @@ _load_v6(netsnmp_container *container, int idx_offset) - * if it's not multi, it must be uni. - * (an ipv6 address is never broadcast) - */ -- if (IN6_IS_ADDR_MULTICAST(entry->ia_address)) -+ if(addr_info.anycastflg) - entry->ia_type = IPADDRESSTYPE_ANYCAST; - else - entry->ia_type = IPADDRESSTYPE_UNICAST; -@@ -314,18 +320,28 @@ _load_v6(netsnmp_container *container, int idx_offset) - * - * 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; -+ if (!flags) -+ entry->ia_origin = IPADDRESSORIGINTC_LINKLAYER; -+ else if (flags & IFA_F_TEMPORARY) -+ entry->ia_origin = IPADDRESSORIGINTC_RANDOM; -+ else if (IN6_IS_ADDR_LINKLOCAL(entry->ia_address)) -+ entry->ia_origin = IPADDRESSORIGINTC_LINKLAYER; -+ else -+ entry->ia_origin = IPADDRESSORIGINTC_MANUAL; -+ -+ if(entry->ia_origin == IPADDRESSORIGINTC_LINKLAYER) -+ entry->ia_storagetype = STORAGETYPE_PERMANENT; - - /* xxx-rks: what can we do with scope? */ - - /* - * add entry to container - */ -- CONTAINER_INSERT(container, entry); -+ 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; -+ } - } - - fclose(in); -@@ -335,4 +351,93 @@ _load_v6(netsnmp_container *container, int idx_offset) - - return idx_offset; - } -+ -+struct address_flag_info -+netsnmp_access_other_info_get(int index, int family) -+{ -+ struct { -+ struct nlmsghdr n; -+ struct ifaddrmsg r; -+ char buf[1024]; -+ } req; -+ struct address_flag_info addr; -+ struct rtattr *rta; -+ int status; -+ char buf[16384]; -+ struct nlmsghdr *nlmp; -+ struct ifaddrmsg *rtmp; -+ struct rtattr *rtatp; -+ int rtattrlen; -+ int sd; -+ -+ memset(&addr, 0, sizeof(struct address_flag_info)); -+ sd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); -+ if(sd < 0) { -+ snmp_log(LOG_ERR, "could not open netlink socket\n"); -+ return addr; -+ } -+ -+ memset(&req, 0, sizeof(req)); -+ req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg)); -+ req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT; -+ req.n.nlmsg_type = RTM_GETADDR; -+ req.r.ifa_family = family; -+ rta = (struct rtattr *)(((char *)&req) + NLMSG_ALIGN(req.n.nlmsg_len)); -+ if(family == AF_INET) -+ rta->rta_len = RTA_LENGTH(4); -+ else -+ rta->rta_len = RTA_LENGTH(16); -+ -+ status = send(sd, &req, req.n.nlmsg_len, 0); -+ if (status < 0) { -+ snmp_log(LOG_ERR, "could not send netlink request\n"); -+ return addr; -+ } -+ -+ status = recv(sd, buf, sizeof(buf), 0); -+ if (status < 0) { -+ snmp_log (LOG_ERR, "could not recieve netlink request\n"); -+ return addr; -+ } -+ -+ if(status == 0) { -+ snmp_log (LOG_ERR, "nothing to read\n"); -+ return addr; -+ } -+ -+ for(nlmp = (struct nlmsghdr *)buf; status > sizeof(*nlmp);) { -+ int len = nlmp->nlmsg_len; -+ int req_len = len - sizeof(*nlmp); -+ -+ if (req_len < 0 || len > status) { -+ snmp_log (LOG_ERR, "invalid netlink message\n"); -+ return addr; -+ } -+ -+ if (!NLMSG_OK(nlmp, status)) { -+ snmp_log (LOG_ERR, "invalid NLMSG message\n"); -+ return addr; -+ } -+ rtmp = (struct ifaddrmsg *)NLMSG_DATA(nlmp); -+ rtatp = (struct rtattr *)IFA_RTA(rtmp); -+ rtattrlen = IFA_PAYLOAD(nlmp); -+ if(index == rtmp->ifa_index){ -+ for (; RTA_OK(rtatp, rtattrlen); rtatp = RTA_NEXT(rtatp, rtattrlen)) { -+ if(rtatp->rta_type == IFA_BROADCAST){ -+ addr.inp = (struct in_addr *)RTA_DATA(rtatp); -+ addr.bcastflg = 1; -+ } -+ if(rtatp->rta_type == IFA_ANYCAST){ -+ addr.inp = (struct in_addr *)RTA_DATA(rtatp); -+ addr.anycastflg = 1; -+ } -+ } -+ } -+ status -= NLMSG_ALIGN(len); -+ nlmp = (struct nlmsghdr*)((char*)nlmp + NLMSG_ALIGN(len)); -+ } -+ close(sd); -+ return addr; -+} - #endif -+ -diff --git a/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c b/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c -index e695ab3..8bb3cbc 100644 ---- a/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c -+++ b/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c -@@ -942,7 +942,10 @@ ipAddressRowStatus_get(ipAddressTable_rowreq_ctx * rowreq_ctx, - netsnmp_assert(NULL != ipAddressRowStatus_val_ptr); - - /** WARNING: this code might not work for netsnmp_ipaddress_entry */ -- (*ipAddressRowStatus_val_ptr) = rowreq_ctx->ipAddressRowStatus; -+ if(rowreq_ctx->data->if_index) -+ (*ipAddressRowStatus_val_ptr) = rowreq_ctx->ipAddressRowStatus; -+ else -+ (*ipAddressRowStatus_val_ptr) = ROWSTATUS_NOTREADY; - - return MFD_SUCCESS; - } /* ipAddressRowStatus_get */ -diff --git a/include/net-snmp/library/container.h b/include/net-snmp/library/container.h -index f88fa21..22684aa 100644 ---- a/include/net-snmp/library/container.h -+++ b/include/net-snmp/library/container.h -@@ -358,7 +358,7 @@ extern "C" { - if(x) { - int rc = x->insert(x,k); - if(rc) -- snmp_log(LOG_ERR,"error on subcontainer '%s' insert (%d)\n", -+ snmp_log(LOG_DEBUG,"error on subcontainer '%s' insert (%d)\n", - x->container_name ? x->container_name : "", rc); - else { - rc = CONTAINER_INSERT_HELPER(x->next, k); -diff --git a/snmplib/container.c b/snmplib/container.c -index e34e922..1255f0a 100644 ---- a/snmplib/container.c -+++ b/snmplib/container.c -@@ -275,7 +275,7 @@ int CONTAINER_INSERT_HELPER(netsnmp_container* x, const void* k) - if(x) { - int rc = x->insert(x,k); - if(rc) -- snmp_log(LOG_ERR,"error on subcontainer '%s' insert (%d)\n", -+ snmp_log(LOG_DEBUG,"error on subcontainer '%s' insert (%d)\n", - x->container_name ? x->container_name : "", rc); - else { - rc = CONTAINER_INSERT_HELPER(x->next, k); --- -1.6.0.2 - diff --git a/Fix-for-tcpConnnectionTable-tcpListenerTable-udpEn.patch b/Fix-for-tcpConnnectionTable-tcpListenerTable-udpEn.patch deleted file mode 100644 index 430cffe..0000000 --- a/Fix-for-tcpConnnectionTable-tcpListenerTable-udpEn.patch +++ /dev/null @@ -1,368 +0,0 @@ -From 757470fe3c79081b3b106f669f39e45f7aaa4baf Mon Sep 17 00:00:00 2001 -From: Mitsuru Chinen -Date: Mon, 20 Oct 2008 14:36:05 +0900 -Subject: [PATCH] Fix for tcpConnnectionTable, tcpListenerTable, udpEndpointTable - -From net-snmp patch tracker: -[ 1670511 ] agent returns 0 for process id in tcp and udp mib -http://sourceforge.net/tracker/index.php?func=detail&aid=1670511&group_id=12694&atid=312694 - -Signed-off-by: Mitsuru Chinen ---- - agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c | 18 ++-- - .../udp-mib/data_access/udp_endpoint_linux.c | 7 +- - .../udp-mib/udpEndpointTable/udpEndpointTable.c | 17 +++- - .../udp-mib/udpEndpointTable/udpEndpointTable.h | 12 ++- - .../udpEndpointTable_data_access.c | 3 +- - agent/mibgroup/util_funcs.c | 100 ++++++++++++++++++++ - agent/mibgroup/util_funcs.h | 4 + - include/net-snmp/data_access/udp_endpoint.h | 1 + - 8 files changed, 146 insertions(+), 16 deletions(-) - -diff --git a/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c b/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c -index 7ffebe6..72495a9 100644 ---- a/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c -+++ b/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c -@@ -11,7 +11,7 @@ - - #include "tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h" - #include "tcp-mib/data_access/tcpConn_private.h" -- -+#include "mibgroup/util_funcs.h" - static int - linux_states[12] = { 1, 5, 3, 4, 6, 7, 11, 1, 8, 9, 2, 10 }; - -@@ -135,15 +135,16 @@ _load4(netsnmp_container *container, u_int load_flags) - while (fgets(line, sizeof(line), in)) { - netsnmp_tcpconn_entry *entry; - int state, rc, local_port, remote_port, tmp_state; -+ unsigned long long inode; - size_t buf_len, offset; - u_char local_addr[10], remote_addr[10]; - u_char *tmp_ptr; - -- if (5 != (rc = sscanf(line, "%*d: %8[0-9A-Z]:%x %8[0-9A-Z]:%x %x", -+ if (6 != (rc = sscanf(line, "%*d: %8[0-9A-Z]:%x %8[0-9A-Z]:%x %x %*x:%*x %*x:%*x %*x %*x %*x %llu", - local_addr, &local_port, -- remote_addr, &remote_port, &tmp_state))) { -+ remote_addr, &remote_port, &tmp_state, &inode))) { - DEBUGMSGT(("access:tcpconn:container", -- "error parsing line (%d != 5)\n", rc)); -+ "error parsing line (%d != 6)\n", rc)); - DEBUGMSGT(("access:tcpconn:container"," line '%s'\n", line)); - continue; - } -@@ -180,6 +181,7 @@ _load4(netsnmp_container *container, u_int load_flags) - entry->loc_port = (unsigned short) local_port; - entry->rmt_port = (unsigned short) remote_port; - entry->tcpConnState = state; -+ entry->pid = get_pid_from_inode(inode); - - /** the addr string may need work */ - buf_len = strlen(local_addr); -@@ -286,15 +288,16 @@ _load6(netsnmp_container *container, u_int load_flags) - while (fgets(line, sizeof(line), in)) { - netsnmp_tcpconn_entry *entry; - int state, rc, local_port, remote_port, tmp_state; -+ unsigned long long inode; - size_t buf_len, offset; - u_char local_addr[48], remote_addr[48]; - u_char *tmp_ptr; - -- if (5 != (rc = sscanf(line, "%*d: %47[0-9A-Z]:%x %47[0-9A-Z]:%x %x", -+ if (6 != (rc = sscanf(line, "%*d: %47[0-9A-Z]:%x %47[0-9A-Z]:%x %x %*x:%*x %*x:%*x %*x %*x %*x %llu", - local_addr, &local_port, -- remote_addr, &remote_port, &tmp_state))) { -+ remote_addr, &remote_port, &tmp_state, &inode))) { - DEBUGMSGT(("access:tcpconn:container", -- "error parsing line (%d != 5)\n", rc)); -+ "error parsing line (%d != 6)\n", rc)); - DEBUGMSGT(("access:tcpconn:container"," line '%s'\n", line)); - continue; - } -@@ -331,6 +334,7 @@ _load6(netsnmp_container *container, u_int load_flags) - entry->loc_port = (unsigned short) local_port; - entry->rmt_port = (unsigned short) remote_port; - entry->tcpConnState = state; -+ entry->pid = get_pid_from_inode(inode); - - /** the addr string may need work */ - buf_len = strlen((char*)local_addr); -diff --git a/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c b/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c -index 4e43e01..70dcace 100644 ---- a/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c -+++ b/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c -@@ -14,7 +14,7 @@ - #include - - #include "udp-mib/udpEndpointTable/udpEndpointTable_constants.h" -- -+#include "mibgroup/util_funcs.h" - #include "udp_endpoint_private.h" - - #include -@@ -222,6 +222,11 @@ _process_line_udp_ep(netsnmp_line_info *line_info, void *mem, - inode = strtoull(ptr, &ptr, 0); - ep->instance = (u_int)inode; - -+ /* -+ * get the pid also -+ */ -+ ep->pid = get_pid_from_inode(inode); -+ - ep->index = (u_int)(lpi->user_context); - lpi->user_context = (void*)((u_int)(lpi->user_context) + 1); - -diff --git a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c -index 5da022f..b2d8b23 100644 ---- a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c -+++ b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c -@@ -223,7 +223,8 @@ udpEndpointTable_indexes_set_tbl_idx(udpEndpointTable_mib_index * tbl_idx, - size_t - udpEndpointRemoteAddress_val_ptr_len, - u_long udpEndpointRemotePort_val, -- u_long udpEndpointInstance_val) -+ u_long udpEndpointInstance_val, -+ u_long udpEndpointProcess_val) - { - DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_indexes_set_tbl_idx", "called\n")); - -@@ -292,6 +293,10 @@ udpEndpointTable_indexes_set_tbl_idx(udpEndpointTable_mib_index * tbl_idx, - * udpEndpointInstance(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/h - */ - tbl_idx->udpEndpointInstance = udpEndpointInstance_val; -+ /* -+ * udpEndpointProcess(8)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/h -+ */ -+ tbl_idx->udpEndpointProcess = udpEndpointProcess_val; - - - return MFD_SUCCESS; -@@ -320,7 +325,8 @@ udpEndpointTable_indexes_set(udpEndpointTable_rowreq_ctx * rowreq_ctx, - char *udpEndpointRemoteAddress_val_ptr, - size_t udpEndpointRemoteAddress_val_ptr_len, - u_long udpEndpointRemotePort_val, -- u_long udpEndpointInstance_val) -+ u_long udpEndpointInstance_val, -+ u_long udpEndpointProcess_val) - { - DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_indexes_set", - "called\n")); -@@ -335,7 +341,8 @@ udpEndpointTable_indexes_set(udpEndpointTable_rowreq_ctx * rowreq_ctx, - udpEndpointRemoteAddress_val_ptr, - udpEndpointRemoteAddress_val_ptr_len, - udpEndpointRemotePort_val, -- udpEndpointInstance_val)) -+ udpEndpointInstance_val, -+ udpEndpointProcess_val)) - return MFD_ERROR; - - /* -@@ -402,9 +409,9 @@ udpEndpointProcess_get(udpEndpointTable_rowreq_ctx * rowreq_ctx, - - /* - * TODO:231:o: |-> Extract the current value of the udpEndpointProcess data. -- * copy (* udpEndpointProcess_val_ptr ) from rowreq_ctx->data -+ * copy (* udpEndpointProcess_val_ptr ) from rowreq_ctx->tbl_idx.udpEndpointProcess - */ -- (*udpEndpointProcess_val_ptr) = rowreq_ctx->data.udpEndpointProcess; -+ (*udpEndpointProcess_val_ptr) = rowreq_ctx->tbl_idx.udpEndpointProcess; - - return MFD_SUCCESS; - } /* udpEndpointProcess_get */ -diff --git a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h -index f023db8..fce1659 100644 ---- a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h -+++ b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h -@@ -132,6 +132,11 @@ config_require(udp-mib/udpEndpointTable/udpEndpointTable_data_access) - */ - u_long udpEndpointInstance; - -+ /* -+ * udpEndpointProcess(8)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/h -+ */ -+ u_long udpEndpointProcess; -+ - - } udpEndpointTable_mib_index; - -@@ -257,7 +262,9 @@ config_require(udp-mib/udpEndpointTable/udpEndpointTable_data_access) - u_long - udpEndpointRemotePort_val, - u_long -- udpEndpointInstance_val); -+ udpEndpointInstance_val, -+ u_long -+ udpEndpointProcess_val); - int - udpEndpointTable_indexes_set(udpEndpointTable_rowreq_ctx * - rowreq_ctx, -@@ -273,7 +280,8 @@ config_require(udp-mib/udpEndpointTable/udpEndpointTable_data_access) - size_t - udpEndpointRemoteAddress_val_ptr_len, - u_long udpEndpointRemotePort_val, -- u_long udpEndpointInstance_val); -+ u_long udpEndpointInstance_val, -+ u_long udpEndpointProcess_val); - - - -diff --git a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c -index af4762f..1e9ef0f 100644 ---- a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c -+++ b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c -@@ -265,7 +265,8 @@ udpEndpointTable_container_load(netsnmp_container *container) - ep->rmt_addr, - ep->rmt_addr_len, - ep->rmt_port, -- ep->instance)) { -+ ep->instance, -+ ep->pid)) { - snmp_log(LOG_ERR, - "error setting index while loading " - "udpEndpointTable data.\n"); -diff --git a/agent/mibgroup/util_funcs.c b/agent/mibgroup/util_funcs.c -index 95ee4bf..26826f7 100644 ---- a/agent/mibgroup/util_funcs.c -+++ b/agent/mibgroup/util_funcs.c -@@ -86,6 +86,20 @@ - #ifdef HAVE_SYS_STAT_H - #include - #endif -+#if HAVE_DIRENT_H -+#include -+#else -+# define dirent direct -+# if HAVE_SYS_NDIR_H -+# include -+# endif -+# if HAVE_SYS_DIR_H -+# include -+# endif -+# if HAVE_NDIR_H -+# include -+# endif -+#endif - - #include - #include -@@ -1192,3 +1206,89 @@ Retrieve_Table_Data(mib_table_t t, int *max_idx) - *max_idx = table->next_index - 1; - return table->data; - } -+ -+#ifdef linux -+# define PROC_PATH "/proc" -+# define FILE_DISP "fd/" -+# define SOCKET_TYPE_1 "socket:[" -+# define SOCKET_TYPE_2 "[0000]:" -+ -+unsigned long long -+extract_inode(char *format) -+{ -+ unsigned long long ret = 0; -+ -+ if (!strncmp(format, SOCKET_TYPE_1, 8)) { -+ ret = strtoull(format + 8, NULL, 0); -+ } else if (!strncmp(format, SOCKET_TYPE_2, 7)) { -+ ret = strtoull(format + 7, NULL, 0); -+ } -+ -+ return ret; -+} -+ -+unsigned int -+get_pid_from_inode(unsigned long long inode) -+{ -+ DIR *procdirs = NULL, *piddirs = NULL; -+ char *name = NULL; -+ char path_name[PATH_MAX + 1]; -+ char socket_lnk[NAME_MAX + 1]; -+ int filelen = 0, readlen = 0, iflag = 0; -+ struct dirent *procinfo, *pidinfo; -+ unsigned int pid; -+ unsigned long long temp_inode; -+ -+ if (!(procdirs = opendir(PROC_PATH))) { -+ snmp_log(LOG_ERR, "snmpd: cannot open /proc\n"); -+ return 0; -+ } -+ -+ while ((procinfo = readdir(procdirs)) != NULL) { -+ name = procinfo->d_name; -+ for (; *name; name++) { -+ if (!isdigit(*name)) -+ break; -+ } -+ if(*name) -+ continue; -+ -+ memset(path_name, '\0', PATH_MAX + 1); -+ filelen = snprintf(path_name, PATH_MAX, -+ PROC_PATH "/%s/" FILE_DISP, procinfo->d_name); -+ if (filelen <= 0 || PATH_MAX < filelen) -+ continue; -+ -+ pid = strtoul(procinfo->d_name, NULL, 0); -+ -+ if (!(piddirs = opendir(path_name))) -+ continue; -+ -+ while ((pidinfo = readdir(piddirs)) != NULL) { -+ if (filelen + strlen(pidinfo->d_name) > PATH_MAX) -+ continue; -+ -+ strcpy(path_name + filelen, pidinfo->d_name); -+ -+ memset(socket_lnk, '\0', NAME_MAX + 1); -+ readlen = readlink(path_name, socket_lnk, NAME_MAX); -+ if (readlen < 0) -+ continue; -+ socket_lnk[readlen] = '\0'; -+ -+ temp_inode = extract_inode(socket_lnk); -+ if (inode == temp_inode) { -+ iflag = 1; -+ break; -+ } -+ } -+ closedir(piddirs); -+ if (iflag == 1) -+ break; -+ } -+ if (procdirs) -+ closedir(procdirs); -+ return pid; -+} -+ -+#endif /* #ifdef linux */ -diff --git a/agent/mibgroup/util_funcs.h b/agent/mibgroup/util_funcs.h -index 1b3fefe..4a0b99e 100644 ---- a/agent/mibgroup/util_funcs.h -+++ b/agent/mibgroup/util_funcs.h -@@ -34,6 +34,10 @@ void string_append_int(char *, int); - void wait_on_exec(struct extensible *); - const char *make_tempfile(void); - -+#ifdef linux -+unsigned int get_pid_from_inode(unsigned long long); -+#endif -+ - #define satosin(x) ((struct sockaddr_in *) &(x)) - #define SOCKADDR(x) (satosin(x)->sin_addr.s_addr) - #ifndef MIB_STATS_CACHE_TIMEOUT -diff --git a/include/net-snmp/data_access/udp_endpoint.h b/include/net-snmp/data_access/udp_endpoint.h -index cc81b02..b9831ec 100644 ---- a/include/net-snmp/data_access/udp_endpoint.h -+++ b/include/net-snmp/data_access/udp_endpoint.h -@@ -41,6 +41,7 @@ extern "C" { - u_short rmt_port; - - u_int instance; -+ u_int pid; - - } netsnmp_udp_endpoint_entry; - --- -1.6.0.2 - diff --git a/Improve-IP-Statistics-tables.patch b/Improve-IP-Statistics-tables.patch deleted file mode 100644 index 75afe35..0000000 --- a/Improve-IP-Statistics-tables.patch +++ /dev/null @@ -1,7453 +0,0 @@ -From 32c13f8502b9520a49fb88a6737801d705fcbb9f Mon Sep 17 00:00:00 2001 -From: Mitsuru Chinen -Date: Mon, 20 Oct 2008 17:57:27 +0900 -Subject: [PATCH] Improve IP Statistics tables - -This patch fixes the ipSystemStatsTable and adds ipIfStatsTable for IPv6. - -From net-snmp patch tracker: -[ 1797111 ] Better support for ipIfStatsTable -http://sourceforge.net/tracker/index.php?func=detail&aid=1797111&group_id=12694&atid=312694 - -Signed-off-by: Mitsuru Chinen ---- - README.agent-mibs | 2 +- - .../ip-mib/data_access/systemstats_common.c | 119 +- - .../ip-mib/data_access/systemstats_linux.c | 389 +++- - agent/mibgroup/ip-mib/ipIfStatsTable.h | 8 + - .../ip-mib/ipIfStatsTable/ipIfStatsTable.c | 216 ++ - .../ip-mib/ipIfStatsTable/ipIfStatsTable.h | 200 ++ - .../ipIfStatsTable/ipIfStatsTable_data_access.c | 408 +++ - .../ipIfStatsTable/ipIfStatsTable_data_access.h | 70 + - .../ipIfStatsTable/ipIfStatsTable_data_get.c | 3015 ++++++++++++++++++++ - .../ipIfStatsTable/ipIfStatsTable_data_get.h | 246 ++ - .../ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h | 56 + - .../ipIfStatsTable/ipIfStatsTable_interface.c | 1395 +++++++++ - .../ipIfStatsTable/ipIfStatsTable_interface.h | 99 + - .../ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h | 122 + - .../ip-mib/ipSystemStatsTable/ipSystemStatsTable.c | 154 +- - .../ipSystemStatsTable_data_access.c | 60 +- - include/net-snmp/data_access/ipstats.h | 66 +- - include/net-snmp/data_access/systemstats.h | 14 +- - 18 files changed, 6494 insertions(+), 145 deletions(-) - create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable.h - create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c - create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h - create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c - create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h - create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c - create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h - create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h - create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c - create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h - create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h - -diff --git a/README.agent-mibs b/README.agent-mibs -index 8716f8d..ff5ce6a 100644 ---- a/README.agent-mibs -+++ b/README.agent-mibs -@@ -152,7 +152,7 @@ IP-MIB - - ipSystemStatsTable L 5.2 M ip-mib/=/* - ipIfStatsTableLastChange.0 --- -- ipIfStatsTable --- -+ ipIfStatsTable L-- 5.5 M ip-mib/=/* - - ipAddrTable (D) U $2 4.2 O mibII/ipAddr.c - ipAddressSpinLock.0 --- -diff --git a/agent/mibgroup/ip-mib/data_access/systemstats_common.c b/agent/mibgroup/ip-mib/data_access/systemstats_common.c -index 83e1867..a09cacf 100644 ---- a/agent/mibgroup/ip-mib/data_access/systemstats_common.c -+++ b/agent/mibgroup/ip-mib/data_access/systemstats_common.c -@@ -1,5 +1,5 @@ - /* -- * Systemstats MIB architecture support -+ * ipSystemStatsTable and ipIfStatsTable MIB architecture support - * - * $Id: systemstats_common.c 11913 2005-02-08 21:58:36Z nba $ - */ -@@ -163,7 +163,7 @@ netsnmp_access_systemstats_entry_get_by_index(netsnmp_container *container, oid - /** - */ - netsnmp_systemstats_entry * --netsnmp_access_systemstats_entry_create(int version) -+netsnmp_access_systemstats_entry_create(int version, int if_index) - { - netsnmp_systemstats_entry *entry = - SNMP_MALLOC_TYPEDEF(netsnmp_systemstats_entry); -@@ -173,10 +173,10 @@ netsnmp_access_systemstats_entry_create(int version) - if(NULL == entry) - return NULL; - -- entry->ns_ip_version = version; -- -- entry->oid_index.len = 1; -- entry->oid_index.oids = (oid *) & entry->ns_ip_version; -+ entry->oid_index.len = 2; -+ entry->oid_index.oids = entry->index; -+ entry->index[0] = version; -+ entry->index[1] = if_index; - - return entry; - } -@@ -217,6 +217,64 @@ _entry_release(netsnmp_systemstats_entry * entry, void *context) - netsnmp_access_systemstats_entry_free(entry); - } - -+/* -+ * Calculates the entries, which are not provided by OS, but can be -+ * computed from the others. -+ */ -+static void -+_calculate_entries(netsnmp_systemstats_entry * entry) -+{ -+ U64 calc_val; -+ -+ /* -+ * HCInForwDatagrams = HCInNoRoutes + HCOutForwDatagrams -+ */ -+ if (!entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS] -+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS] -+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINNOROUTES]) { -+ -+ entry->stats.HCInForwDatagrams = entry->stats.HCInNoRoutes; -+ u64Incr(&entry->stats.HCInForwDatagrams, &entry->stats.HCOutForwDatagrams); -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS] = 1; -+ } -+ -+ /* -+ * HCOutFragReqds = HCOutFragOKs + HCOutFragFails -+ */ -+ if (!entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS] -+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGOKS] -+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGFAILS]) { -+ -+ entry->stats.HCOutFragReqds = entry->stats.HCOutFragOKs; -+ u64Incr(&entry->stats.HCOutFragReqds, &entry->stats.HCOutFragFails); -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS] = 1; -+ } -+ -+ /* -+ * HCOutTransmits = HCOutRequests + HCOutForwDatagrams + HCOutFragCreates -+ * - HCOutFragReqds - HCOutNoRoutes - HCOutDiscards -+ */ -+ if (!entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS] -+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS] -+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS] -+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS] -+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTNOROUTES] -+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES] -+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS]) { -+ -+ U64 tmp, tmp2, tmp3; -+ tmp = entry->stats.HCOutRequests; -+ u64Incr(&tmp, &entry->stats.HCOutForwDatagrams); -+ u64Incr(&tmp, &entry->stats.HCOutFragCreates); -+ -+ u64Subtract(&tmp, &entry->stats.HCOutFragReqds, &tmp2); -+ u64Subtract(&tmp2, &entry->stats.HCOutNoRoutes, &tmp3); -+ u64Subtract(&tmp3, &entry->stats.HCOutDiscards, &entry->stats.HCOutTransmits); -+ -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS] = 1; -+ } -+} -+ - /** - * update entry stats (checking for counter wrap) - * -@@ -233,7 +291,8 @@ netsnmp_access_systemstats_entry_update_stats(netsnmp_systemstats_entry * prev_v - * sanity checks - */ - if ((NULL == prev_vals) || (NULL == new_vals) || -- (prev_vals->ns_ip_version != new_vals->ns_ip_version)) -+ (prev_vals->index[0] != new_vals->index[0]) -+ || (prev_vals->index[1] != new_vals->index[1])) - return -1; - - /* -@@ -241,6 +300,7 @@ netsnmp_access_systemstats_entry_update_stats(netsnmp_systemstats_entry * prev_v - */ - if (0 == need_wrap_check) { - memcpy(&prev_vals->stats, &new_vals->stats, sizeof(new_vals->stats)); -+ _calculate_entries(prev_vals); - return 0; - } - -@@ -257,8 +317,8 @@ netsnmp_access_systemstats_entry_update_stats(netsnmp_systemstats_entry * prev_v - /* - * update straight 32 bit counters - */ -+ memcpy(&prev_vals->stats.columnAvail[0], &new_vals->stats.columnAvail[0], sizeof(new_vals->stats.columnAvail)); - 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; -@@ -266,16 +326,38 @@ netsnmp_access_systemstats_entry_update_stats(netsnmp_systemstats_entry * prev_v - 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.HCInNoRoutes, -+ &new_vals->stats.HCInNoRoutes, -+ &prev_vals->old_stats->HCInNoRoutes, -+ &need_wrap_check); -+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutNoRoutes, -+ &new_vals->stats.HCOutNoRoutes, -+ &prev_vals->old_stats->HCOutNoRoutes, -+ &need_wrap_check); -+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutDiscards, -+ &new_vals->stats.HCOutDiscards, -+ &prev_vals->old_stats->HCOutDiscards, -+ &need_wrap_check); -+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutFragReqds, -+ &new_vals->stats.HCOutFragReqds, -+ &prev_vals->old_stats->HCOutFragReqds, -+ &need_wrap_check); -+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutFragOKs, -+ &new_vals->stats.HCOutFragOKs, -+ &prev_vals->old_stats->HCOutFragOKs, -+ &need_wrap_check); -+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutFragFails, -+ &new_vals->stats.HCOutFragFails, -+ &prev_vals->old_stats->HCOutFragFails, -+ &need_wrap_check); -+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutFragCreates, -+ &new_vals->stats.HCOutFragCreates, -+ &prev_vals->old_stats->HCOutFragCreates, -+ &need_wrap_check); - netsnmp_c64_check32_and_update(&prev_vals->stats.HCInReceives, - &new_vals->stats.HCInReceives, - &prev_vals->old_stats->HCInReceives, -@@ -333,7 +415,7 @@ netsnmp_access_systemstats_entry_update_stats(netsnmp_systemstats_entry * prev_v - &prev_vals->old_stats->HCOutBcastPkts, - &need_wrap_check); - } -- -+ - /* - * if we've decided we no longer need to check wraps, free old stats - */ -@@ -346,7 +428,9 @@ netsnmp_access_systemstats_entry_update_stats(netsnmp_systemstats_entry * prev_v - * careful - old_stats is a pointer to stats... - */ - memcpy(prev_vals->old_stats, &new_vals->stats, sizeof(new_vals->stats)); -- -+ -+ _calculate_entries(prev_vals); -+ - return 0; - } - -@@ -367,7 +451,8 @@ netsnmp_access_systemstats_entry_update(netsnmp_systemstats_entry * lhs, - DEBUGMSGTL(("access:systemstats", "copy\n")); - - if ((NULL == lhs) || (NULL == rhs) || -- (lhs->ns_ip_version != rhs->ns_ip_version)) -+ (lhs->index[0] != rhs->index[0]) -+ || (lhs->index[1] != rhs->index[1])) - return -1; - - /* -diff --git a/agent/mibgroup/ip-mib/data_access/systemstats_linux.c b/agent/mibgroup/ip-mib/data_access/systemstats_linux.c -index 947afe8..552a745 100644 ---- a/agent/mibgroup/ip-mib/data_access/systemstats_linux.c -+++ b/agent/mibgroup/ip-mib/data_access/systemstats_linux.c -@@ -1,5 +1,5 @@ - /* -- * Interface MIB architecture support -+ * ipSystemStatsTable and ipIfStatsTable interface MIB architecture support - * - * $Id: systemstats_linux.c 15220 2006-09-15 00:48:50Z tanders $ - */ -@@ -10,11 +10,22 @@ - #include - #include - -+#include "../ipSystemStatsTable/ipSystemStatsTable.h" -+ -+#include -+#include -+#include -+ - static int _systemstats_v4(netsnmp_container* container, u_int load_flags); -+static int _additional_systemstats_v4(netsnmp_systemstats_entry* entry, -+ u_int load_flags); -+ - #if defined (NETSNMP_ENABLE_IPV6) - static int _systemstats_v6(netsnmp_container* container, u_int load_flags); - #endif - -+static netsnmp_column_info valid_columns; -+static unsigned int my_columns[IPSYSTEMSTATSTABLE_MAX_COL]; - - void - netsnmp_access_systemstats_arch_init(void) -@@ -62,7 +73,7 @@ netsnmp_access_systemstats_container_arch_load(netsnmp_container* 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 -@@ -81,6 +92,9 @@ netsnmp_access_systemstats_container_arch_load(netsnmp_container* container, - #endif - } - -+/* -+ * Based on load_flags, load ipSystemStatsTable or ipIfStatsTable for ipv4 entries. -+ */ - static int - _systemstats_v4(netsnmp_container* container, u_int load_flags) - { -@@ -97,6 +111,11 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags) - - netsnmp_assert(container != NULL); /* load function shoulda checked this */ - -+ if (load_flags & NETSNMP_ACCESS_SYSTEMSTATS_LOAD_IFTABLE) { -+ /* we do not support ipIfStatsTable for ipv4 */ -+ return 0; -+ } -+ - if (!(devin = fopen("/proc/net/snmp", "r"))) { - DEBUGMSGTL(("access:systemstats", - "Failed to load Systemstats Table (linux1)\n")); -@@ -144,7 +163,7 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags) - while (*stats == ' ') /* skip spaces before stats */ - stats++; - -- entry = netsnmp_access_systemstats_entry_create(1); -+ entry = netsnmp_access_systemstats_entry_create(1, 0); - if(NULL == entry) { - netsnmp_access_systemstats_container_free(container, - NETSNMP_ACCESS_SYSTEMSTATS_FREE_NOFLAGS); -@@ -185,23 +204,54 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags) - 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.HCOutForwDatagrams.low = scan_vals[5] & 0xffffffff; -+ entry->stats.HCOutForwDatagrams.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.HCOutDiscards.low = scan_vals[10] & 0xffffffff;; -+ entry->stats.HCOutDiscards.high = scan_vals[10] >> 32; -+ entry->stats.HCOutNoRoutes.low = scan_vals[11] & 0xffffffff;; -+ entry->stats.HCOutNoRoutes.high = scan_vals[11] >> 32; - /* 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]; -+ entry->stats.HCOutFragOKs.low = scan_vals[16] & 0xffffffff;; -+ entry->stats.HCOutFragOKs.high = scan_vals[16] >> 32; -+ entry->stats.HCOutFragFails.low = scan_vals[17] & 0xffffffff;; -+ entry->stats.HCOutFragFails.high = scan_vals[17] >> 32; -+ entry->stats.HCOutFragCreates.low = scan_vals[18] & 0xffffffff;; -+ entry->stats.HCOutFragCreates.high = scan_vals[18] >> 32; -+ -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INHDRERRORS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INADDRERRORS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INUNKNOWNPROTOS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INDISCARDS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINDELIVERS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTNOROUTES] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMREQDS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMOKS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMFAILS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGOKS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGFAILS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_DISCONTINUITYTIME] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REFRESHRATE] = 1; -+ -+ /* -+ * load addtional statistics defined by RFC 4293 -+ * As these are supported linux 2.6.22 or later, it is no problem -+ * if loading them are failed. -+ */ -+ _additional_systemstats_v4(entry, load_flags); - - /* - * add to container -@@ -211,49 +261,106 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags) - return 0; - } - --#if defined (NETSNMP_ENABLE_IPV6) -+#define IP_EXT_HEAD "IpExt:" - static int --_systemstats_v6(netsnmp_container* container, u_int load_flags) -+_additional_systemstats_v4(netsnmp_systemstats_entry* entry, -+ 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; -+ int scan_count; -+ uintmax_t scan_vals[6]; -+ int retval = 0; - -- DEBUGMSGTL(("access:systemstats:container:arch", "load v6 (flags %p)\n", -- load_flags)); -+ DEBUGMSGTL(("access:systemstats:container:arch", -+ "load addtional v4 (flags %p)\n", load_flags)); - -- netsnmp_assert(container != NULL); /* load function shoulda checked this */ -+ if (!(devin = fopen("/proc/net/netstat", "r"))) { -+ DEBUGMSGTL(("access:systemstats", -+ "cannot open /proc/net/netstat\n")); -+ return -2; -+ } - -- 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. -+ * Get header and stat lines - */ -- 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; -+ while (fgets(line, sizeof(line), devin)) { -+ if (strncmp(IP_EXT_HEAD, line, sizeof(IP_EXT_HEAD) - 1) == 0) { -+ /* next line should includes IPv4 addtional statistics */ -+ if ((fgets(line, sizeof(line), devin)) == NULL) { -+ retval = -4; -+ break; -+ } -+ if (strncmp(IP_EXT_HEAD, line, sizeof(IP_EXT_HEAD) - 1) != 0) { -+ retval = -4; -+ break; -+ } -+ -+ memset(scan_vals, 0x0, sizeof(scan_vals)); -+ scan_count = sscanf(line, -+ "%*s" /* ignore `IpExt:' */ -+ "%llu %llu %llu %llu %llu %llu", -+ &scan_vals[0], &scan_vals[1], &scan_vals[2], -+ &scan_vals[3], &scan_vals[4], &scan_vals[5]); -+ if (scan_count < 6) { -+ snmp_log(LOG_ERR, -+ "error scanning addtional systemstats data" -+ "(minimum expected %d, got %d)\n", -+ 6, scan_count); -+ retval = -4; -+ break; -+ } -+ -+ entry->stats.HCInNoRoutes.low = scan_vals[0] & 0xffffffff; -+ entry->stats.HCInNoRoutes.high = scan_vals[0] >> 32; -+ entry->stats.InTruncatedPkts = scan_vals[1]; -+ entry->stats.HCInMcastPkts.low = scan_vals[2] & 0xffffffff; -+ entry->stats.HCInMcastPkts.high = scan_vals[2] >> 32; -+ entry->stats.HCOutMcastPkts.low = scan_vals[3] & 0xffffffff; -+ entry->stats.HCOutMcastPkts.high = scan_vals[3] >> 32; -+ entry->stats.HCInBcastPkts.low = scan_vals[4] & 0xffffffff; -+ entry->stats.HCInBcastPkts.high = scan_vals[4] >> 32; -+ entry->stats.HCOutBcastPkts.low = scan_vals[5] & 0xffffffff; -+ entry->stats.HCOutBcastPkts.high = scan_vals[5] >> 32; -+ -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINNOROUTES] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INTRUNCATEDPKTS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTPKTS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINBCASTPKTS] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTBCASTPKTS] = 1; -+ } - } - -+ fclose(devin); -+ -+ if (retval < 0) -+ DEBUGMSGTL(("access:systemstats", -+ "/proc/net/netstat does not include addtional stats\n")); -+ -+ return retval; -+} -+ -+#if defined (NETSNMP_ENABLE_IPV6) -+ -+/* -+ * Load one /proc/net/snmp6 - like file (e.g. /proc/net/dev_snmp6/*) -+ */ -+ static int -+_systemstats_v6_load_file(netsnmp_systemstats_entry *entry, FILE *devin) -+{ -+ char line[1024]; -+ char *stats, *start = line; -+ int len, rc; -+ int scan_count; -+ uintmax_t scan_val; -+ - /* - * 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. - */ -+ rc = 0; - while (1) { - start = fgets(line, sizeof(line), devin); - if (NULL == start) -@@ -283,77 +390,101 @@ _systemstats_v6(netsnmp_container* container, u_int load_flags) - * 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; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INADDRERRORS] = 1; - } 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.columnAvail[IPSYSTEMSTATSTABLE_HCINDELIVERS] = 1; -+ } else if ('i' == line[6]) { - entry->stats.InDiscards = scan_val; -- else -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INDISCARDS] = 1; -+ } else - rc = 1; - } else if ('H' == line[5]) { - entry->stats.InHdrErrors = scan_val; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INHDRERRORS] = 1; - } else if ('M' == line[5]) { - entry->stats.HCInMcastPkts.low = scan_val & 0xffffffff; - entry->stats.HCInMcastPkts.high = scan_val >> 32; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTPKTS] = 1; - } else if ('N' == line[5]) { -- entry->stats.InNoRoutes = scan_val; -+ entry->stats.HCInNoRoutes.low = scan_val & 0xffffffff; -+ entry->stats.HCInNoRoutes.high = scan_val >> 32; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINNOROUTES] = 1; - } else if ('R' == line[5]) { - entry->stats.HCInReceives.low = scan_val & 0xffffffff; - entry->stats.HCInReceives.high = scan_val >> 32; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES] = 1; - } else if ('T' == line[5]) { - if ('r' == line[6]) { - entry->stats.InTruncatedPkts = scan_val & 0xffffffff; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INTRUNCATEDPKTS] = 1; - } 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; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INUNKNOWNPROTOS] = 1; - } else - rc = 1; - } else if ('O' == line[3]) { /* Out */ - if ('D' == line[6]) { -- entry->stats.OutDiscards = scan_val; -+ entry->stats.HCOutDiscards.low = scan_val & 0xffffffff; -+ entry->stats.HCOutDiscards.high = scan_val >> 32; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS] = 1; - } else if ('F' == line[6]) { - entry->stats.HCOutForwDatagrams.low = scan_val & 0xffffffff; - entry->stats.HCOutForwDatagrams.high = scan_val >> 32; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS] = 1; - } else if ('M' == line[6]) { - entry->stats.HCOutMcastPkts.low = scan_val & 0xffffffff; - entry->stats.HCOutMcastPkts.high = scan_val >> 32; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS] = 1; - } else if ('N' == line[6]) { -- entry->stats.OutNoRoutes = scan_val; -+ entry->stats.HCOutNoRoutes.low = scan_val & 0xffffffff; -+ entry->stats.HCOutNoRoutes.high = scan_val >> 32; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTNOROUTES] = 1; - } else if ('R' == line[6]) { - entry->stats.HCOutRequests.low = scan_val & 0xffffffff; - entry->stats.HCOutRequests.high = scan_val >> 32; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS] = 1; - } else - rc = 1; - } else if ('R' == line[3]) { /* Reasm */ - if ('F' == line[8]) { - entry->stats.ReasmFails = scan_val; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMFAILS] = 1; - } else if ('O' == line[8]) { - entry->stats.ReasmOKs = scan_val; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMOKS] = 1; - } else if ('R' == line[8]) { - entry->stats.ReasmReqds = scan_val; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMREQDS] = 1; - } 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 -+ if ('C' == line[7]) { -+ entry->stats.HCOutFragCreates.low = scan_val & 0xffffffff; -+ entry->stats.HCOutFragCreates.high = scan_val >> 32; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES] = 1; -+ } else if ('O' == line[7]) { -+ entry->stats.HCOutFragOKs.low = scan_val & 0xffffffff; -+ entry->stats.HCOutFragOKs.high = scan_val >> 32; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGOKS] = 1; -+ } else if ('F' == line[7]) { -+ entry->stats.HCOutFragFails.low = scan_val & 0xffffffff; -+ entry->stats.HCOutFragFails.high = scan_val >> 32; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGFAILS] = 1; -+ } else - rc = 1; - } else - rc = 1; -@@ -363,6 +494,47 @@ _systemstats_v6(netsnmp_container* container, u_int load_flags) - else - ++scan_count; - } -+ /* -+ * Let DiscontinuityTime and RefreshRate active -+ */ -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_DISCONTINUITYTIME] = 1; -+ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_REFRESHRATE] = 1; -+ -+ return rc; -+} -+ -+/* -+ * load ipSystemStatsTable for ipv6 entries -+ */ -+static int -+_systemstats_v6_load_systemstats(netsnmp_container* container, u_int load_flags) -+{ -+ FILE *devin; -+ netsnmp_systemstats_entry *entry = NULL; -+ const char *filename = "/proc/net/snmp6"; -+ static int warned_open = 0; -+ int rc = 0; -+ -+ entry = netsnmp_access_systemstats_entry_create(2, 0); -+ 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; -+ } -+ -+ rc = _systemstats_v6_load_file(entry, devin); - - fclose(devin); - -@@ -373,4 +545,119 @@ _systemstats_v6(netsnmp_container* container, u_int load_flags) - - return rc; - } -+ -+#define DEV_SNMP6_DIRNAME "/proc/net/dev_snmp6" -+#define IFINDEX_LINE "ifIndex" -+#define DEV_FILENAME_LEN 64 -+ -+/* -+ * load ipIfStatsTable for ipv6 entries -+ */ -+static int -+_systemstats_v6_load_ifstats(netsnmp_container* container, u_int load_flags) -+{ -+ DIR *dev_snmp6_dir; -+ struct dirent *dev_snmp6_entry; -+ char dev_filename[DEV_FILENAME_LEN]; -+ FILE *devin; -+ char line[1024]; -+ char *stats, *start = line; -+ int rc; -+ char *scan_str; -+ uintmax_t scan_val; -+ netsnmp_systemstats_entry *entry = NULL; -+ -+ /* -+ * try to open /proc/net/dev_snmp6 directory. If we can't, that' ok - -+ * maybe it is not supported by the current running kernel. -+ */ -+ if ((dev_snmp6_dir = opendir(DEV_SNMP6_DIRNAME)) == NULL) { -+ DEBUGMSGTL(("access:ifstats", -+ "Failed to load IPv6 IfStats Table (linux)\n")); -+ return 0; -+ } -+ -+ /* -+ * Read each per interface statistics proc file -+ */ -+ rc = 0; -+ while ((dev_snmp6_entry = readdir(dev_snmp6_dir)) != NULL) { -+ if (dev_snmp6_entry->d_name[0] == '.') -+ continue; -+ -+ if (snprintf(dev_filename, DEV_FILENAME_LEN, "%s/%s", DEV_SNMP6_DIRNAME, -+ dev_snmp6_entry->d_name) > DEV_FILENAME_LEN) { -+ snmp_log(LOG_ERR, "Interface name %s is too long\n", -+ dev_snmp6_entry->d_name); -+ continue; -+ } -+ if (NULL == (devin = fopen(dev_filename, "r"))) { -+ snmp_log(LOG_ERR, "Failed to open %s\n", dev_filename); -+ continue; -+ } -+ -+ /* -+ * If a stat file name is made of digits, the name is interface index. -+ * If it is an interface name, the file includes a line labeled ifIndex. -+ */ -+ if (isdigit(dev_snmp6_entry->d_name[0])) { -+ scan_val = strtoull(dev_snmp6_entry->d_name, NULL, 0); -+ } else { -+ if (NULL == (start = fgets(line, sizeof(line), devin))) { -+ snmp_log(LOG_ERR, "%s doesn't include any lines\n", -+ dev_filename); -+ fclose(devin); -+ continue; -+ } -+ -+ if (0 != strncmp(start, IFINDEX_LINE, 7)) { -+ snmp_log(LOG_ERR, "%s doesn't include ifIndex line", -+ dev_filename); -+ fclose(devin); -+ continue; -+ } -+ -+ scan_str = strrchr(line, ' '); -+ if (NULL == scan_str) { -+ snmp_log(LOG_ERR, "%s is wrong format", dev_filename); -+ fclose(devin); -+ continue; -+ } -+ scan_val = strtoull(scan_str, NULL, 0); -+ } -+ -+ entry = netsnmp_access_systemstats_entry_create(2, scan_val); -+ if(NULL == entry) { -+ fclose(devin); -+ closedir(dev_snmp6_dir); -+ return -3; -+ } -+ -+ _systemstats_v6_load_file(entry, devin); -+ CONTAINER_INSERT(container, entry); -+ fclose(devin); -+ } -+ closedir(dev_snmp6_dir); -+ return 0; -+} -+ -+/* -+ * Based on load_flags, load ipSystemStatsTable or ipIfStatsTable for ipv6 entries. -+ */ -+static int -+_systemstats_v6(netsnmp_container* container, u_int load_flags) -+{ -+ DEBUGMSGTL(("access:systemstats:container:arch", "load v6 (flags %p)\n", -+ load_flags)); -+ -+ netsnmp_assert(container != NULL); /* load function shoulda checked this */ -+ -+ if (load_flags & NETSNMP_ACCESS_SYSTEMSTATS_LOAD_IFTABLE) { -+ /* load ipIfStatsTable */ -+ return _systemstats_v6_load_ifstats(container, load_flags); -+ } else { -+ /* load ipSystemStatsTable */ -+ return _systemstats_v6_load_systemstats(container, load_flags); -+ } -+} - #endif /* NETSNMP_ENABLE_IPV6 */ -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable.h b/agent/mibgroup/ip-mib/ipIfStatsTable.h -new file mode 100644 -index 0000000..da1d85c ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable.h -@@ -0,0 +1,8 @@ -+/* -+ * module to include the modules -+ */ -+ -+config_require(ip-mib/data_access/systemstats) -+config_require(ip-mib/ipIfStatsTable/ipIfStatsTable) -+config_require(ip-mib/ipIfStatsTable/ipIfStatsTable_interface) -+config_require(ip-mib/ipIfStatsTable/ipIfStatsTable_data_access) -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c -new file mode 100644 -index 0000000..6af3529 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c -@@ -0,0 +1,216 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+/** \page MFD helper for ipIfStatsTable -+ * -+ * \section intro Introduction -+ * Introductory text. -+ * -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "ipIfStatsTable.h" -+ -+#include -+ -+#include "ipIfStatsTable_interface.h" -+ -+oid ipIfStatsTable_oid[] = { IPIFSTATSTABLE_OID }; -+int ipIfStatsTable_oid_size = OID_LENGTH(ipIfStatsTable_oid); -+ -+ipIfStatsTable_registration ipIfStatsTable_user_context; -+ -+void initialize_table_ipIfStatsTable(void); -+void shutdown_table_ipIfStatsTable(void); -+ -+ -+/** -+ * Initializes the ipIfStatsTable module -+ */ -+void -+init_ipIfStatsTable(void) -+{ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:init_ipIfStatsTable", "called\n")); -+ -+ /* -+ * TODO:300:o: Perform ipIfStatsTable one-time module initialization. -+ */ -+ -+ /* -+ * here we initialize all the tables we're planning on supporting -+ */ -+ if (should_init("ipIfStatsTable")) -+ initialize_table_ipIfStatsTable(); -+ -+ /* -+ * last changed should be 0 at startup -+ */ -+ ipIfStatsTable_lastChange_set(0); -+} /* init_ipIfStatsTable */ -+ -+/** -+ * Shut-down the ipIfStatsTable module (agent is exiting) -+ */ -+void -+shutdown_ipIfStatsTable(void) -+{ -+ if (should_init("ipIfStatsTable")) -+ shutdown_table_ipIfStatsTable(); -+ -+} -+ -+/** -+ * Initialize the table ipIfStatsTable -+ * (Define its contents and how it's structured) -+ */ -+void -+initialize_table_ipIfStatsTable(void) -+{ -+ ipIfStatsTable_registration *user_context; -+ u_long flags; -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:initialize_table_ipIfStatsTable", -+ "called\n")); -+ -+ /* -+ * TODO:301:o: Perform ipIfStatsTable one-time table initialization. -+ */ -+ -+ /* -+ * TODO:302:o: |->Initialize ipIfStatsTable 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("ipIfStatsTable", NULL, NULL); -+ -+ /* -+ * No support for any flags yet, but in the future you would -+ * set any flags here. -+ */ -+ flags = 0; -+ -+ /* -+ * call interface initialization code -+ */ -+ _ipIfStatsTable_initialize_interface(user_context, flags); -+} /* initialize_table_ipIfStatsTable */ -+ -+/** -+ * Shutdown the table ipIfStatsTable -+ */ -+void -+shutdown_table_ipIfStatsTable(void) -+{ -+ /* -+ * call interface shutdown code -+ */ -+ _ipIfStatsTable_shutdown_interface(&ipIfStatsTable_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 -+ipIfStatsTable_rowreq_ctx_init(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ void *user_init_ctx) -+{ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_rowreq_ctx_init", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:210:o: |-> Perform extra ipIfStatsTable rowreq initialization. (eg DEFVALS) -+ */ -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsTable_rowreq_ctx_init */ -+ -+/** -+ * extra context cleanup -+ * -+ */ -+void -+ipIfStatsTable_rowreq_ctx_cleanup(ipIfStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_rowreq_ctx_cleanup", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:211:o: |-> Perform extra ipIfStatsTable rowreq cleanup. -+ */ -+} /* ipIfStatsTable_rowreq_ctx_cleanup */ -+ -+/** -+ * pre-request callback -+ * -+ * -+ * @retval MFD_SUCCESS : success. -+ * @retval MFD_ERROR : other error -+ */ -+int -+ipIfStatsTable_pre_request(ipIfStatsTable_registration * user_context) -+{ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_pre_request", -+ "called\n")); -+ -+ /* -+ * TODO:510:o: Perform ipIfStatsTable pre-request actions. -+ */ -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsTable_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 -+ipIfStatsTable_post_request(ipIfStatsTable_registration * user_context, -+ int rc) -+{ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_post_request", -+ "called\n")); -+ -+ /* -+ * TODO:511:o: Perform ipIfStatsTable post-request actions. -+ */ -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsTable_post_request */ -+ -+ -+/** @{ */ -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h -new file mode 100644 -index 0000000..8bf0a7a ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h -@@ -0,0 +1,200 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+#ifndef IPIFSTATSTABLE_H -+#define IPIFSTATSTABLE_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+/** @addtogroup misc misc: Miscellaneous routines -+ * -+ * @{ -+ */ -+#include -+#include -+#include -+ -+ /* -+ * other required module components -+ */ -+ /* *INDENT-OFF* */ -+config_require(ip-mib/ipIfStatsTable/ipIfStatsTable_interface) -+config_require(ip-mib/ipIfStatsTable/ipIfStatsTable_data_access) -+config_require(ip-mib/ipIfStatsTable/ipIfStatsTable_data_get) -+ /* *INDENT-ON* */ -+ -+ /* -+ * OID and column number definitions for ipIfStatsTable -+ */ -+#include "ipIfStatsTable_oids.h" -+ -+ /* -+ * enum definions -+ */ -+#include "ipIfStatsTable_enums.h" -+ -+ /* -+ ********************************************************************* -+ * function declarations -+ */ -+ void init_ipIfStatsTable(void); -+ void shutdown_ipIfStatsTable(void); -+ -+ /* -+ ********************************************************************* -+ * Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipIfStatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * IP-MIB::ipIfStatsTable is subid 3 of ipTrafficStats. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.31.3, 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 ipIfStatsTable registration context. -+ */ -+ typedef netsnmp_data_list ipIfStatsTable_registration; -+ -+/**********************************************************************/ -+ /* -+ * TODO:110:r: |-> Review ipIfStatsTable data context structure. -+ * This structure is used to represent the data for ipIfStatsTable. -+ */ -+ typedef netsnmp_systemstats_entry ipIfStatsTable_data; -+ -+ -+ /* -+ * TODO:120:r: |-> Review ipIfStatsTable mib index. -+ * This structure is used to represent the index for ipIfStatsTable. -+ */ -+ typedef struct ipIfStatsTable_mib_index_s { -+ -+ /* -+ * ipIfStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h -+ */ -+ u_long ipIfStatsIPVersion; -+ -+ /* -+ * ipIfStatsIfIndex(2)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ long ipIfStatsIfIndex; -+ -+ -+ } ipIfStatsTable_mib_index; -+ -+ /* -+ * TODO:121:r: | |-> Review ipIfStatsTable max index length. -+ * If you KNOW that your indexes will never exceed a certain -+ * length, update this macro to that length. -+ */ -+#define MAX_ipIfStatsTable_IDX_LEN 2 -+ -+ -+ /* -+ ********************************************************************* -+ * TODO:130:o: |-> Review ipIfStatsTable Row request (rowreq) context. -+ * When your functions are called, you will be passed a -+ * ipIfStatsTable_rowreq_ctx pointer. -+ */ -+ typedef struct ipIfStatsTable_rowreq_ctx_s { -+ -+ /** this must be first for container compare to work */ -+ netsnmp_index oid_idx; -+ oid oid_tmp[MAX_ipIfStatsTable_IDX_LEN]; -+ -+ ipIfStatsTable_mib_index tbl_idx; -+ -+ ipIfStatsTable_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 ipIfStatsTable rowreq context. -+ */ -+ char known_missing; -+ uint32_t ipIfStatsDiscontinuityTime; -+ uint32_t ipIfStatsRefreshRate; -+ -+ /* -+ * storage for future expansion -+ */ -+ netsnmp_data_list *ipIfStatsTable_data_list; -+ -+ } ipIfStatsTable_rowreq_ctx; -+ -+ typedef struct ipIfStatsTable_ref_rowreq_ctx_s { -+ ipIfStatsTable_rowreq_ctx *rowreq_ctx; -+ } ipIfStatsTable_ref_rowreq_ctx; -+ -+ /* -+ ********************************************************************* -+ * function prototypes -+ */ -+ int ipIfStatsTable_pre_request(ipIfStatsTable_registration -+ * user_context); -+ int ipIfStatsTable_post_request(ipIfStatsTable_registration -+ * user_context, int rc); -+ -+ int -+ ipIfStatsTable_rowreq_ctx_init(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, void *user_init_ctx); -+ void -+ ipIfStatsTable_rowreq_ctx_cleanup(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ ipIfStatsTable_data *ipIfStatsTable_allocate_data(void); -+ void ipIfStatsTable_release_data(ipIfStatsTable_data * -+ data); -+ -+ -+ ipIfStatsTable_rowreq_ctx -+ *ipIfStatsTable_row_find_by_mib_index(ipIfStatsTable_mib_index * -+ mib_idx); -+ -+ extern oid ipIfStatsTable_oid[]; -+ extern int ipIfStatsTable_oid_size; -+ -+ -+#include "ipIfStatsTable_interface.h" -+#include "ipIfStatsTable_data_access.h" -+#include "ipIfStatsTable_data_get.h" -+ -+ /* -+ * DUMMY markers, ignore -+ * -+ * TODO:099:x: ************************************************************* -+ * TODO:199:x: ************************************************************* -+ * TODO:299:x: ************************************************************* -+ * TODO:399:x: ************************************************************* -+ * TODO:499:x: ************************************************************* -+ */ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPIFSTATSTABLE_H */ -+/** @} */ -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c -new file mode 100644 -index 0000000..f2ec1a1 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c -@@ -0,0 +1,408 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "ipIfStatsTable.h" -+ -+ -+#include "ipIfStatsTable_data_access.h" -+ -+static int ipis_cache_refresh = IPIFSTATSTABLE_CACHE_TIMEOUT; -+ -+/** @ingroup interface -+ * @addtogroup data_access data_access: Routines to access data -+ * -+ * These routines are used to locate the data used to satisfy -+ * requests. -+ * -+ * @{ -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipIfStatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * IP-MIB::ipIfStatsTable is subid 3 of ipTrafficStats. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.31.3, length: 9 -+ */ -+ -+/** -+ * initialization for ipIfStatsTable data access -+ * -+ * This function is called during startup to allow you to -+ * allocate any resources you need for the data table. -+ * -+ * @param ipIfStatsTable_reg -+ * Pointer to ipIfStatsTable_registration -+ * -+ * @retval MFD_SUCCESS : success. -+ * @retval MFD_ERROR : unrecoverable error. -+ */ -+int -+ipIfStatsTable_init_data(ipIfStatsTable_registration * ipIfStatsTable_reg) -+{ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_init_data", -+ "called\n")); -+ -+ /* -+ * TODO:303:o: Initialize ipIfStatsTable data. -+ */ -+ netsnmp_access_systemstats_init(); -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsTable_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 -+ipIfStatsTable_container_init(netsnmp_container ** container_ptr_ptr, -+ netsnmp_cache * cache) -+{ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_container_init", -+ "called\n")); -+ -+ if (NULL == container_ptr_ptr) { -+ snmp_log(LOG_ERR, -+ "bad container param to ipIfStatsTable_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("ipIfStatsTable:table_container"); -+ if (NULL != *container_ptr_ptr) -+ ipIfStatsTable_container_load(*container_ptr_ptr); -+ if (NULL == cache) { -+ snmp_log(LOG_ERR, -+ "bad cache param to ipIfStatsTable_container_init\n"); -+ return; -+ } -+ -+ /* -+ * TODO:345:A: Set up ipIfStatsTable 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 = IPIFSTATSTABLE_CACHE_TIMEOUT; /* seconds */ -+ -+ cache->flags |= -+ (NETSNMP_CACHE_DONT_AUTO_RELEASE | NETSNMP_CACHE_DONT_FREE_EXPIRED -+ | NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD | -+ NETSNMP_CACHE_AUTO_RELOAD); -+} /* ipIfStatsTable_container_init */ -+ -+/** -+ * check entry for update -+ */ -+static void -+_check_for_updates(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ netsnmp_container *stats) -+{ -+ netsnmp_systemstats_entry *ifstats_entry; -+ -+ /* -+ * check for matching entry. works because indexes are the same. -+ */ -+ ifstats_entry = CONTAINER_FIND(stats, rowreq_ctx->data); -+ if (NULL == ifstats_entry) { -+ DEBUGMSGTL(("ipIfStatsTable: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(("ipIfStatsTable:access", -+ "updating existing entry\n")); -+ -+ /* -+ * Check for changes & update -+ */ -+ netsnmp_access_systemstats_entry_update(rowreq_ctx->data, -+ ifstats_entry); -+ -+ /* -+ * set discontinuity if previously missing. -+ */ -+ if (1 == rowreq_ctx->known_missing) { -+ rowreq_ctx->known_missing = 0; -+ rowreq_ctx->ipIfStatsDiscontinuityTime = -+ netsnmp_get_agent_uptime(); -+ ipIfStatsTable_lastChange_set(netsnmp_get_agent_uptime()); -+ } -+ -+ /* -+ * remove entry from container -+ */ -+ CONTAINER_REMOVE(stats, ifstats_entry); -+ netsnmp_access_systemstats_entry_free(ifstats_entry); -+ } -+} -+ -+/** -+ * add new entry -+ */ -+static void -+_add_new(netsnmp_systemstats_entry *ifstats_entry, -+ netsnmp_container *container) -+{ -+ ipIfStatsTable_rowreq_ctx *rowreq_ctx; -+ -+ DEBUGMSGTL(("ipIfStatsTable:access", "creating new entry\n")); -+ -+ netsnmp_assert(NULL != ifstats_entry); -+ netsnmp_assert(NULL != container); -+ -+ /* -+ * allocate an row context and set the index(es) -+ */ -+ rowreq_ctx = -+ ipIfStatsTable_allocate_rowreq_ctx(ifstats_entry, NULL); -+ if ((NULL != rowreq_ctx) -+ && (MFD_SUCCESS == -+ ipIfStatsTable_indexes_set(rowreq_ctx, -+ ifstats_entry->index[0], -+ ifstats_entry->index[1]))) { -+ rowreq_ctx->ipIfStatsRefreshRate = ipis_cache_refresh * 1000; /* milli-seconds */ -+ CONTAINER_INSERT(container, rowreq_ctx); -+ ipIfStatsTable_lastChange_set(netsnmp_get_agent_uptime()); -+ } else { -+ if (NULL != rowreq_ctx) { -+ snmp_log(LOG_ERR, "error setting index while loading " -+ "ipIfStatsTable cache.\n"); -+ ipIfStatsTable_release_rowreq_ctx(rowreq_ctx); -+ } else { -+ snmp_log(LOG_ERR, "memory allocation failed while loading " -+ "ipIfStatsTable cache.\n"); -+ netsnmp_access_systemstats_entry_free(ifstats_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 ipIfStatsTable_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 -+ipIfStatsTable_container_shutdown(netsnmp_container * container_ptr) -+{ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_container_shutdown", -+ "called\n")); -+ -+ if (NULL == container_ptr) { -+ snmp_log(LOG_ERR, -+ "bad params to ipIfStatsTable_container_shutdown\n"); -+ return; -+ } -+ -+} /* ipIfStatsTable_container_shutdown */ -+ -+/** -+ * load initial data -+ * -+ * TODO:350:M: Implement ipIfStatsTable 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 -+ * ipIfStatsTable_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 -+ipIfStatsTable_container_load(netsnmp_container * container) -+{ -+ netsnmp_container *stats; -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_container_load", -+ "called\n")); -+ -+ netsnmp_assert(NULL != container); -+ -+ stats = netsnmp_access_systemstats_container_load(NULL, NETSNMP_ACCESS_SYSTEMSTATS_LOAD_IFTABLE); -+ if (NULL == stats) -+ return MFD_RESOURCE_UNAVAILABLE; /* msg already logged */ -+ -+ /* -+ * TODO:351:M: |-> Load/update data in the ipIfStatsTable container. -+ * loop over your ipIfStatsTable 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:ipIfStatsTable:ipIfStatsTable_container_load", -+ "%d records\n", CONTAINER_SIZE(container))); -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsTable_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 -+ipIfStatsTable_container_free(netsnmp_container * container) -+{ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_container_free", -+ "called\n")); -+ -+ /* -+ * TODO:380:M: Free ipIfStatsTable container data. -+ */ -+} /* ipIfStatsTable_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 -+ipIfStatsTable_row_prep(ipIfStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_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; -+} /* ipIfStatsTable_row_prep */ -+ -+/** @} */ -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h -new file mode 100644 -index 0000000..5ef7682 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h -@@ -0,0 +1,70 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+#ifndef IPIFSTATSTABLE_DATA_ACCESS_H -+#define IPIFSTATSTABLE_DATA_ACCESS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+ /* -+ ********************************************************************* -+ * function declarations -+ */ -+ -+ /* -+ ********************************************************************* -+ * Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipIfStatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * IP-MIB::ipIfStatsTable is subid 3 of ipTrafficStats. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.31.3, length: 9 -+ */ -+ -+ -+ int ipIfStatsTable_init_data(ipIfStatsTable_registration * -+ ipIfStatsTable_reg); -+ -+ -+ /* -+ * TODO:180:o: Review ipIfStatsTable cache timeout. -+ * The number of seconds before the cache times out -+ */ -+#define IPIFSTATSTABLE_CACHE_TIMEOUT 60 -+ -+ void ipIfStatsTable_container_init(netsnmp_container ** -+ container_ptr_ptr, -+ netsnmp_cache * cache); -+ void ipIfStatsTable_container_shutdown(netsnmp_container * -+ container_ptr); -+ -+ int ipIfStatsTable_container_load(netsnmp_container * -+ container); -+ void ipIfStatsTable_container_free(netsnmp_container * -+ container); -+ -+ int ipIfStatsTable_cache_load(netsnmp_container * -+ container); -+ void ipIfStatsTable_cache_free(netsnmp_container * -+ container); -+ -+ int ipIfStatsTable_row_prep(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPIFSTATSTABLE_DATA_ACCESS_H */ -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c -new file mode 100644 -index 0000000..db673dc ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c -@@ -0,0 +1,3015 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 12088 $ of $ -+ * -+ * $Id:$ -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "ipIfStatsTable.h" -+ -+ -+/** @defgroup data_get data_get: Routines to get data -+ * -+ * TODO:230:M: Implement ipIfStatsTable get routines. -+ * TODO:240:M: Implement ipIfStatsTable mapping routines (if any). -+ * -+ * These routine are used to get the value for individual objects. The -+ * row context is passed, along with a pointer to the memory where the -+ * value should be copied. -+ * -+ * @{ -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipIfStatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * IP-MIB::ipIfStatsTable is subid 3 of ipTrafficStats. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.31.3, length: 9 -+ */ -+ -+/* -+ * --------------------------------------------------------------------- -+ * * TODO:200:r: Implement ipIfStatsTable data context functions. -+ */ -+/* -+ * ipIfStatsTable_allocate_data -+ * -+ * Purpose: create new ipIfStatsTable_data. -+ */ -+ipIfStatsTable_data * -+ipIfStatsTable_allocate_data(void) -+{ -+ /* -+ * TODO:201:r: |-> allocate memory for the ipIfStatsTable data context. -+ */ -+ ipIfStatsTable_data *rtn = SNMP_MALLOC_TYPEDEF(ipIfStatsTable_data); -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_allocate_data", -+ "called\n")); -+ -+ if (NULL == rtn) { -+ snmp_log(LOG_ERR, "unable to malloc memory for new " -+ "ipIfStatsTable_data.\n"); -+ } -+ -+ return rtn; -+} /* ipIfStatsTable_allocate_data */ -+ -+/* -+ * ipIfStatsTable_release_data -+ * -+ * Purpose: release ipIfStatsTable data. -+ */ -+void -+ipIfStatsTable_release_data(ipIfStatsTable_data * data) -+{ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_release_data", -+ "called\n")); -+ -+ /* -+ * TODO:202:r: |-> release memory for the ipIfStatsTable data context. -+ */ -+ free(data); -+} /* ipIfStatsTable_release_data */ -+ -+ -+ -+/** -+ * set mib index(es) -+ * -+ * @param tbl_idx mib index structure -+ * @param ipIfStatsIPVersion_val -+ * @param ipIfStatsIfIndex_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 -+ipIfStatsTable_indexes_set_tbl_idx(ipIfStatsTable_mib_index * tbl_idx, -+ u_long ipIfStatsIPVersion_val, -+ long ipIfStatsIfIndex_val) -+{ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_indexes_set_tbl_idx", "called\n")); -+ -+ /* -+ * ipIfStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h -+ */ -+ /** WARNING: this code might not work for netsnmp_ifstats_entry */ -+ tbl_idx->ipIfStatsIPVersion = ipIfStatsIPVersion_val; -+ -+ /* -+ * ipIfStatsIfIndex(2)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ /** WARNING: this code might not work for netsnmp_ifstats_entry */ -+ tbl_idx->ipIfStatsIfIndex = ipIfStatsIfIndex_val; -+ -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsTable_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 -+ipIfStatsTable_indexes_set(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long ipIfStatsIPVersion_val, -+ long ipIfStatsIfIndex_val) -+{ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_indexes_set", -+ "called\n")); -+ -+ if (MFD_SUCCESS != -+ ipIfStatsTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx, -+ ipIfStatsIPVersion_val, -+ ipIfStatsIfIndex_val)) -+ return MFD_ERROR; -+ -+ /* -+ * convert mib index to oid index -+ */ -+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid); -+ if (0 != ipIfStatsTable_index_to_oid(&rowreq_ctx->oid_idx, -+ &rowreq_ctx->tbl_idx)) { -+ return MFD_ERROR; -+ } -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsTable_indexes_set */ -+ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsInReceives -+ * ipIfStatsInReceives is subid 3 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsInReceives data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsInReceives_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 -+ipIfStatsInReceives_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsInReceives_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsInReceives_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInReceives_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInReceives data. -+ * copy (* ipIfStatsInReceives_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsInReceives_val_ptr) = -+ rowreq_ctx->data->stats.HCInReceives.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsInReceives_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCInReceives -+ * ipIfStatsHCInReceives is subid 4 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.4 -+ * Description: -+The total number of input IP datagrams received, including -+ those received in error. This object counts the same -+ datagrams as ipIfStatsInReceives, 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsHCInReceives data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsHCInReceives_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 -+ipIfStatsHCInReceives_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ U64 * ipIfStatsHCInReceives_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsHCInReceives_val_ptr); -+ -+ /* -+ * TODO:231:o: |-> copy ipIfStatsHCInReceives data. -+ * get (* ipIfStatsHCInReceives_val_ptr ).low and (* ipIfStatsHCInReceives_val_ptr ).high from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsHCInReceives_val_ptr).low = -+ rowreq_ctx->data->stats.HCInReceives.low; -+ (*ipIfStatsHCInReceives_val_ptr).high = -+ rowreq_ctx->data->stats.HCInReceives.high; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsHCInReceives_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsInOctets -+ * ipIfStatsInOctets is subid 5 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.5 -+ * Description: -+The total number of octets received in input IP datagrams, -+ including those received in error. Octets from datagrams -+ counted in ipIfStatsInReceives 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsInOctets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsInOctets_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 -+ipIfStatsInOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsInOctets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsInOctets_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInOctets_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInOctets data. -+ * copy (* ipIfStatsInOctets_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINOCTETS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsInOctets_val_ptr) = -+ rowreq_ctx->data->stats.HCInOctets.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsInOctets_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCInOctets -+ * ipIfStatsHCInOctets is subid 6 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 ipIfStatsInOctets, 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsHCInOctets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsHCInOctets_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 -+ipIfStatsHCInOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ U64 * ipIfStatsHCInOctets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsHCInOctets_val_ptr); -+ -+ /* -+ * TODO:231:o: |-> copy ipIfStatsHCInOctets data. -+ * get (* ipIfStatsHCInOctets_val_ptr ).low and (* ipIfStatsHCInOctets_val_ptr ).high from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINOCTETS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsHCInOctets_val_ptr).low = -+ rowreq_ctx->data->stats.HCInOctets.low; -+ (*ipIfStatsHCInOctets_val_ptr).high = -+ rowreq_ctx->data->stats.HCInOctets.high; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsHCInOctets_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsInHdrErrors -+ * ipIfStatsInHdrErrors is subid 7 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsInHdrErrors data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsInHdrErrors_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 -+ipIfStatsInHdrErrors_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsInHdrErrors_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsInHdrErrors_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInHdrErrors_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInHdrErrors data. -+ * copy (* ipIfStatsInHdrErrors_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INHDRERRORS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsInHdrErrors_val_ptr) = -+ rowreq_ctx->data->stats.InHdrErrors; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsInHdrErrors_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsInNoRoutes -+ * ipIfStatsInNoRoutes is subid 8 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsInNoRoutes data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsInNoRoutes_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 -+ipIfStatsInNoRoutes_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsInNoRoutes_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsInNoRoutes_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInNoRoutes_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInNoRoutes data. -+ * copy (* ipIfStatsInNoRoutes_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINNOROUTES]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsInNoRoutes_val_ptr) = -+ rowreq_ctx->data->stats.HCInNoRoutes.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsInNoRoutes_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsInAddrErrors -+ * ipIfStatsInAddrErrors is subid 9 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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). For entities that -+ 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsInAddrErrors data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsInAddrErrors_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 -+ipIfStatsInAddrErrors_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsInAddrErrors_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsInAddrErrors_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInAddrErrors_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInAddrErrors data. -+ * copy (* ipIfStatsInAddrErrors_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INADDRERRORS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsInAddrErrors_val_ptr) = -+ rowreq_ctx->data->stats.InAddrErrors; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsInAddrErrors_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsInUnknownProtos -+ * ipIfStatsInUnknownProtos is subid 10 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ -+ -+ -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsInUnknownProtos data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsInUnknownProtos_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 -+ipIfStatsInUnknownProtos_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsInUnknownProtos_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsInUnknownProtos_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInUnknownProtos_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInUnknownProtos data. -+ * copy (* ipIfStatsInUnknownProtos_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INUNKNOWNPROTOS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsInUnknownProtos_val_ptr) = -+ rowreq_ctx->data->stats.InUnknownProtos; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsInUnknownProtos_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsInTruncatedPkts -+ * ipIfStatsInTruncatedPkts is subid 11 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsInTruncatedPkts data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsInTruncatedPkts_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 -+ipIfStatsInTruncatedPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsInTruncatedPkts_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsInTruncatedPkts_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInTruncatedPkts_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInTruncatedPkts data. -+ * copy (* ipIfStatsInTruncatedPkts_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INTRUNCATEDPKTS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsInTruncatedPkts_val_ptr) = -+ rowreq_ctx->data->stats.InTruncatedPkts; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsInTruncatedPkts_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsInForwDatagrams -+ * ipIfStatsInForwDatagrams is subid 12 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 that do not act as IP routers, -+ this counter will include only those datagrams that 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsInForwDatagrams data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsInForwDatagrams_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 -+ipIfStatsInForwDatagrams_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsInForwDatagrams_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsInForwDatagrams_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInForwDatagrams_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInForwDatagrams data. -+ * copy (* ipIfStatsInForwDatagrams_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsInForwDatagrams_val_ptr) = -+ rowreq_ctx->data->stats.HCInForwDatagrams.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsInForwDatagrams_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCInForwDatagrams -+ * ipIfStatsHCInForwDatagrams is subid 13 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ -+ -+ -+ ipIfStatsInForwDatagrams, 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsHCInForwDatagrams data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsHCInForwDatagrams_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 -+ipIfStatsHCInForwDatagrams_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ U64 * ipIfStatsHCInForwDatagrams_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsHCInForwDatagrams_val_ptr); -+ -+ /* -+ * TODO:231:o: |-> copy ipIfStatsHCInForwDatagrams data. -+ * get (* ipIfStatsHCInForwDatagrams_val_ptr ).low and (* ipIfStatsHCInForwDatagrams_val_ptr ).high from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsHCInForwDatagrams_val_ptr).low = -+ rowreq_ctx->data->stats.HCInForwDatagrams.low; -+ (*ipIfStatsHCInForwDatagrams_val_ptr).high = -+ rowreq_ctx->data->stats.HCInForwDatagrams.high; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsHCInForwDatagrams_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsReasmReqds -+ * ipIfStatsReasmReqds is subid 14 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.14 -+ * Description: -+The number of IP fragments received that 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsReasmReqds data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsReasmReqds_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 -+ipIfStatsReasmReqds_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsReasmReqds_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsReasmReqds_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsReasmReqds_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsReasmReqds data. -+ * copy (* ipIfStatsReasmReqds_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMREQDS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsReasmReqds_val_ptr) = -+ rowreq_ctx->data->stats.ReasmReqds; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsReasmReqds_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsReasmOKs -+ * ipIfStatsReasmOKs is subid 15 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsReasmOKs data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsReasmOKs_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 -+ipIfStatsReasmOKs_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsReasmOKs_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsReasmOKs_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsReasmOKs_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsReasmOKs data. -+ * copy (* ipIfStatsReasmOKs_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMOKS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsReasmOKs_val_ptr) = -+ rowreq_ctx->data->stats.ReasmOKs; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsReasmOKs_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsReasmFails -+ * ipIfStatsReasmFails is subid 16 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsReasmFails data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsReasmFails_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 -+ipIfStatsReasmFails_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsReasmFails_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsReasmFails_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsReasmFails_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsReasmFails data. -+ * copy (* ipIfStatsReasmFails_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMFAILS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsReasmFails_val_ptr) = -+ rowreq_ctx->data->stats.ReasmFails; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsReasmFails_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsInDiscards -+ * ipIfStatsInDiscards is subid 17 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.17 -+ * Description: -+The number of input IP datagrams for which no problems were -+ encountered to prevent their continued processing, but -+ 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsInDiscards data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsInDiscards_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 -+ipIfStatsInDiscards_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsInDiscards_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsInDiscards_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInDiscards_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInDiscards data. -+ * copy (* ipIfStatsInDiscards_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INDISCARDS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsInDiscards_val_ptr) = -+ rowreq_ctx->data->stats.InDiscards; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsInDiscards_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsInDelivers -+ * ipIfStatsInDelivers is subid 18 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsInDelivers data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsInDelivers_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 -+ipIfStatsInDelivers_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsInDelivers_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsInDelivers_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInDelivers_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInDelivers data. -+ * copy (* ipIfStatsInDelivers_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINDELIVERS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsInDelivers_val_ptr) = -+ rowreq_ctx->data->stats.HCInDelivers.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsInDelivers_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCInDelivers -+ * ipIfStatsHCInDelivers is subid 19 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.19 -+ * Description: -+The total number of datagrams successfully delivered to IP -+ user-protocols (including ICMP). This object counts the -+ same packets as ipIfStatsInDelivers, 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsHCInDelivers data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsHCInDelivers_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 -+ipIfStatsHCInDelivers_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ U64 * ipIfStatsHCInDelivers_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsHCInDelivers_val_ptr); -+ -+ /* -+ * TODO:231:o: |-> copy ipIfStatsHCInDelivers data. -+ * get (* ipIfStatsHCInDelivers_val_ptr ).low and (* ipIfStatsHCInDelivers_val_ptr ).high from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINDELIVERS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsHCInDelivers_val_ptr).low = -+ rowreq_ctx->data->stats.HCInDelivers.low; -+ (*ipIfStatsHCInDelivers_val_ptr).high = -+ rowreq_ctx->data->stats.HCInDelivers.high; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsHCInDelivers_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutRequests -+ * ipIfStatsOutRequests is subid 20 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.20 -+ * Description: -+The total number of IP datagrams that local IP user- -+ protocols (including ICMP) supplied to IP in requests for -+ transmission. Note that this counter does not include any -+ datagrams counted in ipIfStatsOutForwDatagrams. -+ -+ 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsOutRequests data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsOutRequests_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 -+ipIfStatsOutRequests_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsOutRequests_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsOutRequests_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutRequests_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutRequests data. -+ * copy (* ipIfStatsOutRequests_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsOutRequests_val_ptr) = -+ rowreq_ctx->data->stats.HCOutRequests.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsOutRequests_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCOutRequests -+ * ipIfStatsHCOutRequests is subid 21 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.21 -+ * Description: -+The total number of IP datagrams that local IP user- -+ protocols (including ICMP) supplied to IP in requests for -+ transmission. This object counts the same packets as -+ -+ -+ -+ ipIfStatsOutRequests, 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsHCOutRequests data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsHCOutRequests_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 -+ipIfStatsHCOutRequests_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ U64 * ipIfStatsHCOutRequests_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsHCOutRequests_val_ptr); -+ -+ /* -+ * TODO:231:o: |-> copy ipIfStatsHCOutRequests data. -+ * get (* ipIfStatsHCOutRequests_val_ptr ).low and (* ipIfStatsHCOutRequests_val_ptr ).high from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsHCOutRequests_val_ptr).low = -+ rowreq_ctx->data->stats.HCOutRequests.low; -+ (*ipIfStatsHCOutRequests_val_ptr).high = -+ rowreq_ctx->data->stats.HCOutRequests.high; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsHCOutRequests_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutForwDatagrams -+ * ipIfStatsOutForwDatagrams is subid 23 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ that do not act as IP routers, this counter will include -+ only those datagrams that 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsOutForwDatagrams data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsOutForwDatagrams_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 -+ipIfStatsOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsOutForwDatagrams_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsOutForwDatagrams_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutForwDatagrams_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutForwDatagrams data. -+ * copy (* ipIfStatsOutForwDatagrams_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsOutForwDatagrams_val_ptr) = -+ rowreq_ctx->data->stats.HCOutForwDatagrams.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsOutForwDatagrams_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCOutForwDatagrams -+ * ipIfStatsHCOutForwDatagrams is subid 24 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 ipIfStatsOutForwDatagrams, 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 -+ -+ -+ -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsHCOutForwDatagrams data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsHCOutForwDatagrams_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 -+ipIfStatsHCOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ U64 * ipIfStatsHCOutForwDatagrams_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsHCOutForwDatagrams_val_ptr); -+ -+ /* -+ * TODO:231:o: |-> copy ipIfStatsHCOutForwDatagrams data. -+ * get (* ipIfStatsHCOutForwDatagrams_val_ptr ).low and (* ipIfStatsHCOutForwDatagrams_val_ptr ).high from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsHCOutForwDatagrams_val_ptr).low = -+ rowreq_ctx->data->stats.HCOutForwDatagrams.low; -+ (*ipIfStatsHCOutForwDatagrams_val_ptr).high = -+ rowreq_ctx->data->stats.HCOutForwDatagrams.high; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsHCOutForwDatagrams_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutDiscards -+ * ipIfStatsOutDiscards is subid 25 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.25 -+ * Description: -+The number of output IP datagrams for which no problem was -+ encountered to prevent their transmission to their -+ destination, but were discarded (e.g., for lack of -+ buffer space). Note that this counter would include -+ datagrams counted in ipIfStatsOutForwDatagrams 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsOutDiscards data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsOutDiscards_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 -+ipIfStatsOutDiscards_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsOutDiscards_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsOutDiscards_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutDiscards_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutDiscards data. -+ * copy (* ipIfStatsOutDiscards_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsOutDiscards_val_ptr) = -+ rowreq_ctx->data->stats.HCOutDiscards.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsOutDiscards_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutFragReqds -+ * ipIfStatsOutFragReqds is subid 26 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsOutFragReqds data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsOutFragReqds_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 -+ipIfStatsOutFragReqds_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsOutFragReqds_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsOutFragReqds_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutFragReqds_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutFragReqds data. -+ * copy (* ipIfStatsOutFragReqds_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsOutFragReqds_val_ptr) = -+ rowreq_ctx->data->stats.HCOutFragReqds.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsOutFragReqds_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutFragOKs -+ * ipIfStatsOutFragOKs is subid 27 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsOutFragOKs data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsOutFragOKs_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 -+ipIfStatsOutFragOKs_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsOutFragOKs_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsOutFragOKs_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutFragOKs_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutFragOKs data. -+ * copy (* ipIfStatsOutFragOKs_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGOKS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsOutFragOKs_val_ptr) = -+ rowreq_ctx->data->stats.HCOutFragOKs.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsOutFragOKs_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutFragFails -+ * ipIfStatsOutFragFails is subid 28 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsOutFragFails data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsOutFragFails_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 -+ipIfStatsOutFragFails_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsOutFragFails_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsOutFragFails_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutFragFails_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutFragFails data. -+ * copy (* ipIfStatsOutFragFails_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGFAILS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsOutFragFails_val_ptr) = -+ rowreq_ctx->data->stats.HCOutFragFails.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsOutFragFails_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutFragCreates -+ * ipIfStatsOutFragCreates is subid 29 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsOutFragCreates data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsOutFragCreates_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 -+ipIfStatsOutFragCreates_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsOutFragCreates_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsOutFragCreates_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutFragCreates_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutFragCreates data. -+ * copy (* ipIfStatsOutFragCreates_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsOutFragCreates_val_ptr) = -+ rowreq_ctx->data->stats.HCOutFragCreates.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsOutFragCreates_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutTransmits -+ * ipIfStatsOutTransmits is subid 30 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.30 -+ * Description: -+The total number of IP datagrams that this entity supplied -+ to the lower layers for transmission. This includes -+ datagrams generated locally 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsOutTransmits data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsOutTransmits_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 -+ipIfStatsOutTransmits_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsOutTransmits_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsOutTransmits_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutTransmits_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutTransmits data. -+ * copy (* ipIfStatsOutTransmits_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsOutTransmits_val_ptr) = -+ rowreq_ctx->data->stats.HCOutTransmits.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsOutTransmits_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCOutTransmits -+ * ipIfStatsHCOutTransmits is subid 31 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 ipIfStatsOutTransmits, 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsHCOutTransmits data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsHCOutTransmits_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 -+ipIfStatsHCOutTransmits_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ U64 * ipIfStatsHCOutTransmits_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsHCOutTransmits_val_ptr); -+ -+ /* -+ * TODO:231:o: |-> copy ipIfStatsHCOutTransmits data. -+ * get (* ipIfStatsHCOutTransmits_val_ptr ).low and (* ipIfStatsHCOutTransmits_val_ptr ).high from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsHCOutTransmits_val_ptr).low = -+ rowreq_ctx->data->stats.HCOutTransmits.low; -+ (*ipIfStatsHCOutTransmits_val_ptr).high = -+ rowreq_ctx->data->stats.HCOutTransmits.high; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsHCOutTransmits_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutOctets -+ * ipIfStatsOutOctets is subid 32 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.32 -+ * Description: -+The total number of octets in IP datagrams delivered to the -+ lower layers for transmission. Octets from datagrams -+ counted in ipIfStatsOutTransmits 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsOutOctets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsOutOctets_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 -+ipIfStatsOutOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsOutOctets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsOutOctets_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutOctets_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutOctets data. -+ * copy (* ipIfStatsOutOctets_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTOCTETS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsOutOctets_val_ptr) = -+ rowreq_ctx->data->stats.HCOutOctets.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsOutOctets_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCOutOctets -+ * ipIfStatsHCOutOctets is subid 33 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 ipIfStatsOutOctets, 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsHCOutOctets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsHCOutOctets_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 -+ipIfStatsHCOutOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ U64 * ipIfStatsHCOutOctets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsHCOutOctets_val_ptr); -+ -+ /* -+ * TODO:231:o: |-> copy ipIfStatsHCOutOctets data. -+ * get (* ipIfStatsHCOutOctets_val_ptr ).low and (* ipIfStatsHCOutOctets_val_ptr ).high from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTOCTETS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsHCOutOctets_val_ptr).low = -+ rowreq_ctx->data->stats.HCOutOctets.low; -+ (*ipIfStatsHCOutOctets_val_ptr).high = -+ rowreq_ctx->data->stats.HCOutOctets.high; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsHCOutOctets_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsInMcastPkts -+ * ipIfStatsInMcastPkts is subid 34 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsInMcastPkts data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsInMcastPkts_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 -+ipIfStatsInMcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsInMcastPkts_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsInMcastPkts_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInMcastPkts_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInMcastPkts data. -+ * copy (* ipIfStatsInMcastPkts_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTPKTS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsInMcastPkts_val_ptr) = -+ rowreq_ctx->data->stats.HCInMcastPkts.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsInMcastPkts_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCInMcastPkts -+ * ipIfStatsHCInMcastPkts is subid 35 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.35 -+ * Description: -+The number of IP multicast datagrams received. This object -+ counts the same datagrams as ipIfStatsInMcastPkts, 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsHCInMcastPkts data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsHCInMcastPkts_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 -+ipIfStatsHCInMcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ U64 * ipIfStatsHCInMcastPkts_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsHCInMcastPkts_val_ptr); -+ -+ /* -+ * TODO:231:o: |-> copy ipIfStatsHCInMcastPkts data. -+ * get (* ipIfStatsHCInMcastPkts_val_ptr ).low and (* ipIfStatsHCInMcastPkts_val_ptr ).high from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTPKTS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsHCInMcastPkts_val_ptr).low = -+ rowreq_ctx->data->stats.HCInMcastPkts.low; -+ (*ipIfStatsHCInMcastPkts_val_ptr).high = -+ rowreq_ctx->data->stats.HCInMcastPkts.high; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsHCInMcastPkts_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsInMcastOctets -+ * ipIfStatsInMcastOctets is subid 36 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.36 -+ * Description: -+The total number of octets received in IP multicast -+ -+ -+ -+ datagrams. Octets from datagrams counted in -+ ipIfStatsInMcastPkts 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsInMcastOctets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsInMcastOctets_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 -+ipIfStatsInMcastOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsInMcastOctets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsInMcastOctets_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInMcastOctets_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInMcastOctets data. -+ * copy (* ipIfStatsInMcastOctets_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTOCTETS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsInMcastOctets_val_ptr) = -+ rowreq_ctx->data->stats.HCInMcastOctets.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsInMcastOctets_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCInMcastOctets -+ * ipIfStatsHCInMcastOctets is subid 37 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.37 -+ * Description: -+The total number of octets received in IP multicast -+ datagrams. This object counts the same octets as -+ ipIfStatsInMcastOctets, 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsHCInMcastOctets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsHCInMcastOctets_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 -+ipIfStatsHCInMcastOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ U64 * ipIfStatsHCInMcastOctets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsHCInMcastOctets_val_ptr); -+ -+ /* -+ * TODO:231:o: |-> copy ipIfStatsHCInMcastOctets data. -+ * get (* ipIfStatsHCInMcastOctets_val_ptr ).low and (* ipIfStatsHCInMcastOctets_val_ptr ).high from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTOCTETS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsHCInMcastOctets_val_ptr).low = -+ rowreq_ctx->data->stats.HCInMcastOctets.low; -+ (*ipIfStatsHCInMcastOctets_val_ptr).high = -+ rowreq_ctx->data->stats.HCInMcastOctets.high; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsHCInMcastOctets_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutMcastPkts -+ * ipIfStatsOutMcastPkts is subid 38 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsOutMcastPkts data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsOutMcastPkts_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 -+ipIfStatsOutMcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsOutMcastPkts_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsOutMcastPkts_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutMcastPkts_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutMcastPkts data. -+ * copy (* ipIfStatsOutMcastPkts_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsOutMcastPkts_val_ptr) = -+ rowreq_ctx->data->stats.HCOutMcastPkts.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsOutMcastPkts_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCOutMcastPkts -+ * ipIfStatsHCOutMcastPkts is subid 39 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.39 -+ * Description: -+The number of IP multicast datagrams transmitted. This -+ object counts the same datagrams as ipIfStatsOutMcastPkts, -+ 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsHCOutMcastPkts data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsHCOutMcastPkts_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 -+ipIfStatsHCOutMcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ U64 * ipIfStatsHCOutMcastPkts_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsHCOutMcastPkts_val_ptr); -+ -+ /* -+ * TODO:231:o: |-> copy ipIfStatsHCOutMcastPkts data. -+ * get (* ipIfStatsHCOutMcastPkts_val_ptr ).low and (* ipIfStatsHCOutMcastPkts_val_ptr ).high from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsHCOutMcastPkts_val_ptr).low = -+ rowreq_ctx->data->stats.HCOutMcastPkts.low; -+ (*ipIfStatsHCOutMcastPkts_val_ptr).high = -+ rowreq_ctx->data->stats.HCOutMcastPkts.high; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsHCOutMcastPkts_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutMcastOctets -+ * ipIfStatsOutMcastOctets is subid 40 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.40 -+ * Description: -+The total number of octets transmitted in IP multicast -+ datagrams. Octets from datagrams counted in -+ ipIfStatsOutMcastPkts 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsOutMcastOctets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsOutMcastOctets_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 -+ipIfStatsOutMcastOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsOutMcastOctets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsOutMcastOctets_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutMcastOctets_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutMcastOctets data. -+ * copy (* ipIfStatsOutMcastOctets_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTOCTETS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsOutMcastOctets_val_ptr) = -+ rowreq_ctx->data->stats.HCOutMcastOctets.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsOutMcastOctets_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCOutMcastOctets -+ * ipIfStatsHCOutMcastOctets is subid 41 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.41 -+ * Description: -+The total number of octets transmitted in IP multicast -+ datagrams. This object counts the same octets as -+ ipIfStatsOutMcastOctets, 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsHCOutMcastOctets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsHCOutMcastOctets_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 -+ipIfStatsHCOutMcastOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ U64 * ipIfStatsHCOutMcastOctets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsHCOutMcastOctets_val_ptr); -+ -+ /* -+ * TODO:231:o: |-> copy ipIfStatsHCOutMcastOctets data. -+ * get (* ipIfStatsHCOutMcastOctets_val_ptr ).low and (* ipIfStatsHCOutMcastOctets_val_ptr ).high from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTOCTETS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsHCOutMcastOctets_val_ptr).low = -+ rowreq_ctx->data->stats.HCOutMcastOctets.low; -+ (*ipIfStatsHCOutMcastOctets_val_ptr).high = -+ rowreq_ctx->data->stats.HCOutMcastOctets.high; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsHCOutMcastOctets_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsInBcastPkts -+ * ipIfStatsInBcastPkts is subid 42 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsInBcastPkts data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsInBcastPkts_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 -+ipIfStatsInBcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsInBcastPkts_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsInBcastPkts_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsInBcastPkts_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsInBcastPkts data. -+ * copy (* ipIfStatsInBcastPkts_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINBCASTPKTS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsInBcastPkts_val_ptr) = -+ rowreq_ctx->data->stats.HCInBcastPkts.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsInBcastPkts_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCInBcastPkts -+ * ipIfStatsHCInBcastPkts is subid 43 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.43 -+ * Description: -+The number of IP broadcast datagrams received. This object -+ counts the same datagrams as ipIfStatsInBcastPkts, 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsHCInBcastPkts data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsHCInBcastPkts_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 -+ipIfStatsHCInBcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ U64 * ipIfStatsHCInBcastPkts_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsHCInBcastPkts_val_ptr); -+ -+ /* -+ * TODO:231:o: |-> copy ipIfStatsHCInBcastPkts data. -+ * get (* ipIfStatsHCInBcastPkts_val_ptr ).low and (* ipIfStatsHCInBcastPkts_val_ptr ).high from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINBCASTPKTS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsHCInBcastPkts_val_ptr).low = -+ rowreq_ctx->data->stats.HCInBcastPkts.low; -+ (*ipIfStatsHCInBcastPkts_val_ptr).high = -+ rowreq_ctx->data->stats.HCInBcastPkts.high; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsHCInBcastPkts_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsOutBcastPkts -+ * ipIfStatsOutBcastPkts is subid 44 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsOutBcastPkts data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsOutBcastPkts_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 -+ipIfStatsOutBcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsOutBcastPkts_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsOutBcastPkts_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsOutBcastPkts_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsOutBcastPkts data. -+ * copy (* ipIfStatsOutBcastPkts_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTBCASTPKTS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsOutBcastPkts_val_ptr) = -+ rowreq_ctx->data->stats.HCOutBcastPkts.low; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsOutBcastPkts_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsHCOutBcastPkts -+ * ipIfStatsHCOutBcastPkts is subid 45 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.1.45 -+ * Description: -+The number of IP broadcast datagrams transmitted. This -+ object counts the same datagrams as ipIfStatsOutBcastPkts, -+ 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 -+ ipIfStatsDiscontinuityTime. -+ * -+ * 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 ipIfStatsHCOutBcastPkts data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsHCOutBcastPkts_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 -+ipIfStatsHCOutBcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ U64 * ipIfStatsHCOutBcastPkts_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsHCOutBcastPkts_val_ptr); -+ -+ /* -+ * TODO:231:o: |-> copy ipIfStatsHCOutBcastPkts data. -+ * get (* ipIfStatsHCOutBcastPkts_val_ptr ).low and (* ipIfStatsHCOutBcastPkts_val_ptr ).high from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTBCASTPKTS]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsHCOutBcastPkts_val_ptr).low = -+ rowreq_ctx->data->stats.HCOutBcastPkts.low; -+ (*ipIfStatsHCOutBcastPkts_val_ptr).high = -+ rowreq_ctx->data->stats.HCOutBcastPkts.high; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsHCOutBcastPkts_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsDiscontinuityTime -+ * ipIfStatsDiscontinuityTime is subid 46 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 ipIfStatsDiscontinuityTime data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsDiscontinuityTime_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 -+ipIfStatsDiscontinuityTime_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsDiscontinuityTime_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsDiscontinuityTime_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsDiscontinuityTime_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsDiscontinuityTime data. -+ * copy (* ipIfStatsDiscontinuityTime_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_DISCONTINUITYTIME]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsDiscontinuityTime_val_ptr) = -+ rowreq_ctx->ipIfStatsDiscontinuityTime; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsDiscontinuityTime_get */ -+ -+/*--------------------------------------------------------------------- -+ * IP-MIB::ipIfStatsEntry.ipIfStatsRefreshRate -+ * ipIfStatsRefreshRate is subid 47 of ipIfStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.4.31.3.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 ipIfStatsRefreshRate data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param ipIfStatsRefreshRate_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 -+ipIfStatsRefreshRate_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * ipIfStatsRefreshRate_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != ipIfStatsRefreshRate_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsRefreshRate_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the ipIfStatsRefreshRate data. -+ * copy (* ipIfStatsRefreshRate_val_ptr ) from rowreq_ctx->data -+ */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REFRESHRATE]) -+ return MFD_SKIP; -+ -+ (*ipIfStatsRefreshRate_val_ptr) = -+ rowreq_ctx->ipIfStatsRefreshRate; -+ -+ return MFD_SUCCESS; -+} /* ipIfStatsRefreshRate_get */ -+ -+ -+ -+/** @} */ -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h -new file mode 100644 -index 0000000..0cc7e47 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h -@@ -0,0 +1,246 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 12088 $ of $ -+ * -+ * $Id:$ -+ * -+ * @file ipIfStatsTable_data_get.h -+ * -+ * @addtogroup get -+ * -+ * Prototypes for get functions -+ * -+ * @{ -+ */ -+#ifndef IPIFSTATSTABLE_DATA_GET_H -+#define IPIFSTATSTABLE_DATA_GET_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ /* -+ ********************************************************************* -+ * GET function declarations -+ */ -+ -+ /* -+ ********************************************************************* -+ * GET Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipIfStatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * IP-MIB::ipIfStatsTable is subid 3 of ipTrafficStats. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.31.3, length: 9 -+ */ -+ /* -+ * indexes -+ */ -+ -+ int ipIfStatsInReceives_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsInReceives_val_ptr); -+ int ipIfStatsHCInReceives_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ U64 * -+ ipIfStatsHCInReceives_val_ptr); -+ int ipIfStatsInOctets_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsInOctets_val_ptr); -+ int ipIfStatsHCInOctets_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ U64 * -+ ipIfStatsHCInOctets_val_ptr); -+ int ipIfStatsInHdrErrors_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsInHdrErrors_val_ptr); -+ int ipIfStatsInNoRoutes_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsInNoRoutes_val_ptr); -+ int ipIfStatsInAddrErrors_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsInAddrErrors_val_ptr); -+ int ipIfStatsInUnknownProtos_get(ipIfStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long * -+ ipIfStatsInUnknownProtos_val_ptr); -+ int ipIfStatsInTruncatedPkts_get(ipIfStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long * -+ ipIfStatsInTruncatedPkts_val_ptr); -+ int ipIfStatsInForwDatagrams_get(ipIfStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long * -+ ipIfStatsInForwDatagrams_val_ptr); -+ int -+ ipIfStatsHCInForwDatagrams_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ U64 * -+ ipIfStatsHCInForwDatagrams_val_ptr); -+ int ipIfStatsReasmReqds_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsReasmReqds_val_ptr); -+ int ipIfStatsReasmOKs_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsReasmOKs_val_ptr); -+ int ipIfStatsReasmFails_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsReasmFails_val_ptr); -+ int ipIfStatsInDiscards_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsInDiscards_val_ptr); -+ int ipIfStatsInDelivers_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsInDelivers_val_ptr); -+ int ipIfStatsHCInDelivers_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ U64 * -+ ipIfStatsHCInDelivers_val_ptr); -+ int ipIfStatsOutRequests_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsOutRequests_val_ptr); -+ int ipIfStatsHCOutRequests_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ U64 * -+ ipIfStatsHCOutRequests_val_ptr); -+ int ipIfStatsOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long * -+ ipIfStatsOutForwDatagrams_val_ptr); -+ int -+ ipIfStatsHCOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ U64 * -+ ipIfStatsHCOutForwDatagrams_val_ptr); -+ int ipIfStatsOutDiscards_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsOutDiscards_val_ptr); -+ int ipIfStatsOutFragReqds_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsOutFragReqds_val_ptr); -+ int ipIfStatsOutFragOKs_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsOutFragOKs_val_ptr); -+ int ipIfStatsOutFragFails_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsOutFragFails_val_ptr); -+ int ipIfStatsOutFragCreates_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsOutFragCreates_val_ptr); -+ int ipIfStatsOutTransmits_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsOutTransmits_val_ptr); -+ int ipIfStatsHCOutTransmits_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ U64 * -+ ipIfStatsHCOutTransmits_val_ptr); -+ int ipIfStatsOutOctets_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsOutOctets_val_ptr); -+ int ipIfStatsHCOutOctets_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ U64 * -+ ipIfStatsHCOutOctets_val_ptr); -+ int ipIfStatsInMcastPkts_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsInMcastPkts_val_ptr); -+ int ipIfStatsHCInMcastPkts_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ U64 * -+ ipIfStatsHCInMcastPkts_val_ptr); -+ int ipIfStatsInMcastOctets_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsInMcastOctets_val_ptr); -+ int ipIfStatsHCInMcastOctets_get(ipIfStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ U64 * -+ ipIfStatsHCInMcastOctets_val_ptr); -+ int ipIfStatsOutMcastPkts_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsOutMcastPkts_val_ptr); -+ int ipIfStatsHCOutMcastPkts_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ U64 * -+ ipIfStatsHCOutMcastPkts_val_ptr); -+ int ipIfStatsOutMcastOctets_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsOutMcastOctets_val_ptr); -+ int ipIfStatsHCOutMcastOctets_get(ipIfStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ U64 * -+ ipIfStatsHCOutMcastOctets_val_ptr); -+ int ipIfStatsInBcastPkts_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsInBcastPkts_val_ptr); -+ int ipIfStatsHCInBcastPkts_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ U64 * -+ ipIfStatsHCInBcastPkts_val_ptr); -+ int ipIfStatsOutBcastPkts_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsOutBcastPkts_val_ptr); -+ int ipIfStatsHCOutBcastPkts_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ U64 * -+ ipIfStatsHCOutBcastPkts_val_ptr); -+ int -+ ipIfStatsDiscontinuityTime_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsDiscontinuityTime_val_ptr); -+ int ipIfStatsRefreshRate_get(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ ipIfStatsRefreshRate_val_ptr); -+ -+ -+ int -+ ipIfStatsTable_indexes_set_tbl_idx(ipIfStatsTable_mib_index * -+ tbl_idx, -+ u_long ipIfStatsIPVersion_val, -+ long ipIfStatsIfIndex_val); -+ int ipIfStatsTable_indexes_set(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ ipIfStatsIPVersion_val, -+ long ipIfStatsIfIndex_val); -+ -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPIFSTATSTABLE_DATA_GET_H */ -+/** @} */ -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h -new file mode 100644 -index 0000000..c3657d5 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h -@@ -0,0 +1,56 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $ -+ * -+ * $Id:$ -+ */ -+#ifndef IPIFSTATSTABLE_ENUMS_H -+#define IPIFSTATSTABLE_ENUMS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ /* -+ * 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 ipIfStatsTable -+ * -+ ************************************************************************* -+ *************************************************************************/ -+ -+/************************************************************* -+ * constants for enums for the MIB node -+ * ipIfStatsIPVersion (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 /* IPIFSTATSTABLE_ENUMS_H */ -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c -new file mode 100644 -index 0000000..d415a83 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c -@@ -0,0 +1,1395 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 15899 $ of $ -+ * -+ * $Id:$ -+ */ -+/* -+ * ********************************************************************* -+ * ********************************************************************* -+ * ********************************************************************* -+ * *** *** -+ * *** 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 -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "ipIfStatsTable.h" -+ -+ -+#include -+#include -+ -+#include "ipIfStatsTable_interface.h" -+ -+#include -+ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table ipIfStatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * IP-MIB::ipIfStatsTable is subid 3 of ipTrafficStats. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.4.31.3, length: 9 -+ */ -+typedef struct ipIfStatsTable_interface_ctx_s { -+ -+ netsnmp_container *container; -+ netsnmp_cache *cache; -+ -+ ipIfStatsTable_registration *user_ctx; -+ -+ netsnmp_table_registration_info tbl_info; -+ -+ netsnmp_baby_steps_access_methods access_multiplexer; -+ -+ u_long last_changed; -+ -+} ipIfStatsTable_interface_ctx; -+ -+static ipIfStatsTable_interface_ctx ipIfStatsTable_if_ctx; -+ -+static void _ipIfStatsTable_container_init(ipIfStatsTable_interface_ctx -+ * if_ctx); -+static void -+_ipIfStatsTable_container_shutdown(ipIfStatsTable_interface_ctx * if_ctx); -+ -+ -+netsnmp_container * -+ipIfStatsTable_container_get(void) -+{ -+ return ipIfStatsTable_if_ctx.container; -+} -+ -+ipIfStatsTable_registration * -+ipIfStatsTable_registration_get(void) -+{ -+ return ipIfStatsTable_if_ctx.user_ctx; -+} -+ -+ipIfStatsTable_registration * -+ipIfStatsTable_registration_set(ipIfStatsTable_registration * newreg) -+{ -+ ipIfStatsTable_registration *old = ipIfStatsTable_if_ctx.user_ctx; -+ ipIfStatsTable_if_ctx.user_ctx = newreg; -+ return old; -+} -+ -+int -+ipIfStatsTable_container_size(void) -+{ -+ return CONTAINER_SIZE(ipIfStatsTable_if_ctx.container); -+} -+ -+/* -+ * ipIfStatsTableLastChanged, 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 -+ipIfStatsTable_lastChange_set(u_long table_changed) -+{ -+ DEBUGMSGTL(("ipIfStatsTable:lastChanged_set", -+ "called. was %ld, now %ld\n", -+ ipIfStatsTable_if_ctx.last_changed, table_changed)); -+ ipIfStatsTable_if_ctx.last_changed = table_changed; -+} -+ -+/* -+ * mfd multiplexer modes -+ */ -+static Netsnmp_Node_Handler _mfd_ipIfStatsTable_pre_request; -+static Netsnmp_Node_Handler _mfd_ipIfStatsTable_post_request; -+static Netsnmp_Node_Handler _mfd_ipIfStatsTable_object_lookup; -+static Netsnmp_Node_Handler _mfd_ipIfStatsTable_get_values; -+/** -+ * @internal -+ * Initialize the table ipIfStatsTable -+ * (Define its contents and how it's structured) -+ */ -+void -+_ipIfStatsTable_initialize_interface(ipIfStatsTable_registration * reg_ptr, -+ u_long flags) -+{ -+ netsnmp_baby_steps_access_methods *access_multiplexer = -+ &ipIfStatsTable_if_ctx.access_multiplexer; -+ netsnmp_table_registration_info *tbl_info = -+ &ipIfStatsTable_if_ctx.tbl_info; -+ netsnmp_handler_registration *reginfo; -+ netsnmp_mib_handler *handler; -+ int mfd_modes = 0; -+ -+ DEBUGMSGTL(("internal:ipIfStatsTable:_ipIfStatsTable_initialize_interface", "called\n")); -+ -+ -+ /************************************************* -+ * -+ * save interface context for ipIfStatsTable -+ */ -+ /* -+ * Setting up the table's definition -+ */ -+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER, -+ /** index: ipIfStatsIPVersion */ -+ ASN_INTEGER, -+ /** index: ipIfStatsIfIndex */ -+ 0); -+ -+ /* -+ * Define the minimum and maximum accessible columns. This -+ * optimizes retrival. -+ */ -+ tbl_info->min_column = IPIFSTATSTABLE_MIN_COL; -+ tbl_info->max_column = IPIFSTATSTABLE_MAX_COL; -+ -+ /* -+ * save users context -+ */ -+ ipIfStatsTable_if_ctx.user_ctx = reg_ptr; -+ -+ /* -+ * call data access initialization code -+ */ -+ ipIfStatsTable_init_data(reg_ptr); -+ -+ /* -+ * set up the container -+ */ -+ _ipIfStatsTable_container_init(&ipIfStatsTable_if_ctx); -+ if (NULL == ipIfStatsTable_if_ctx.container) { -+ snmp_log(LOG_ERR, -+ "could not initialize container for ipIfStatsTable\n"); -+ return; -+ } -+ -+ /* -+ * access_multiplexer: REQUIRED wrapper for get request handling -+ */ -+ access_multiplexer->object_lookup = _mfd_ipIfStatsTable_object_lookup; -+ access_multiplexer->get_values = _mfd_ipIfStatsTable_get_values; -+ -+ /* -+ * no wrappers yet -+ */ -+ access_multiplexer->pre_request = _mfd_ipIfStatsTable_pre_request; -+ access_multiplexer->post_request = _mfd_ipIfStatsTable_post_request; -+ -+ -+ /************************************************* -+ * -+ * Create a registration, save our reg data, register table. -+ */ -+ DEBUGMSGTL(("ipIfStatsTable:init_ipIfStatsTable", -+ "Registering ipIfStatsTable as a mibs-for-dummies table.\n")); -+ handler = -+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer); -+ reginfo = -+ netsnmp_handler_registration_create("ipIfStatsTable", handler, -+ ipIfStatsTable_oid, -+ ipIfStatsTable_oid_size, -+ HANDLER_CAN_BABY_STEP | -+ HANDLER_CAN_RONLY); -+ if (NULL == reginfo) { -+ snmp_log(LOG_ERR, "error registering table ipIfStatsTable\n"); -+ return; -+ } -+ reginfo->my_reg_void = &ipIfStatsTable_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, -+ ipIfStatsTable_if_ctx. -+ container, -+ TABLE_CONTAINER_KEY_NETSNMP_INDEX); -+ netsnmp_inject_handler(reginfo, handler); -+ -+ /************************************************* -+ * -+ * inject cache helper -+ */ -+ if (NULL != ipIfStatsTable_if_ctx.cache) { -+ handler = netsnmp_cache_handler_get(ipIfStatsTable_if_ctx.cache); -+ netsnmp_inject_handler(reginfo, handler); -+ } -+ -+ /* -+ * register table -+ */ -+ netsnmp_register_table(reginfo, tbl_info); -+ -+ /* -+ * register LastChanged -+ */ -+ { -+ oid lc_oid[] = { IPIFSTATSTABLELASTCHANGE_OID }; -+ netsnmp_register_watched_scalar(netsnmp_create_handler_registration -+ ("ipIfStatsTableLastChanged", NULL, -+ lc_oid, OID_LENGTH(lc_oid), -+ HANDLER_CAN_RONLY), -+ netsnmp_create_watcher_info((void -+ *) -+ &ipIfStatsTable_if_ctx. -+ last_changed, -+ sizeof -+ (u_long), -+ ASN_TIMETICKS, -+ WATCHER_FIXED_SIZE)); -+ } -+} /* _ipIfStatsTable_initialize_interface */ -+ -+/** -+ * @internal -+ * Shutdown the table ipIfStatsTable -+ */ -+void -+_ipIfStatsTable_shutdown_interface(ipIfStatsTable_registration * reg_ptr) -+{ -+ /* -+ * shutdown the container -+ */ -+ _ipIfStatsTable_container_shutdown(&ipIfStatsTable_if_ctx); -+} -+ -+void -+ipIfStatsTable_valid_columns_set(netsnmp_column_info *vc) -+{ -+ ipIfStatsTable_if_ctx.tbl_info.valid_columns = vc; -+} /* ipIfStatsTable_valid_columns_set */ -+ -+/** -+ * @internal -+ * convert the index component stored in the context to an oid -+ */ -+int -+ipIfStatsTable_index_to_oid(netsnmp_index * oid_idx, -+ ipIfStatsTable_mib_index * mib_idx) -+{ -+ int err = SNMP_ERR_NOERROR; -+ -+ /* -+ * temp storage for parsing indexes -+ */ -+ /* -+ * ipIfStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h -+ */ -+ netsnmp_variable_list var_ipIfStatsIPVersion; -+ /* -+ * ipIfStatsIfIndex(2)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ netsnmp_variable_list var_ipIfStatsIfIndex; -+ -+ /* -+ * set up varbinds -+ */ -+ memset(&var_ipIfStatsIPVersion, 0x00, sizeof(var_ipIfStatsIPVersion)); -+ var_ipIfStatsIPVersion.type = ASN_INTEGER; -+ memset(&var_ipIfStatsIfIndex, 0x00, sizeof(var_ipIfStatsIfIndex)); -+ var_ipIfStatsIfIndex.type = ASN_INTEGER; -+ -+ /* -+ * chain temp index varbinds together -+ */ -+ var_ipIfStatsIPVersion.next_variable = &var_ipIfStatsIfIndex; -+ var_ipIfStatsIfIndex.next_variable = NULL; -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_index_to_oid", -+ "called\n")); -+ -+ /* -+ * ipIfStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h -+ */ -+ snmp_set_var_value(&var_ipIfStatsIPVersion, -+ (u_char *) & mib_idx->ipIfStatsIPVersion, -+ sizeof(mib_idx->ipIfStatsIPVersion)); -+ -+ /* -+ * ipIfStatsIfIndex(2)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ snmp_set_var_value(&var_ipIfStatsIfIndex, -+ (u_char *) & mib_idx->ipIfStatsIfIndex, -+ sizeof(mib_idx->ipIfStatsIfIndex)); -+ -+ -+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len, -+ NULL, 0, &var_ipIfStatsIPVersion); -+ 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_ipIfStatsIPVersion); -+ -+ return err; -+} /* ipIfStatsTable_index_to_oid */ -+ -+/** -+ * extract ipIfStatsTable indexes from a netsnmp_index -+ * -+ * @retval SNMP_ERR_NOERROR : no error -+ * @retval SNMP_ERR_GENERR : error -+ */ -+int -+ipIfStatsTable_index_from_oid(netsnmp_index * oid_idx, -+ ipIfStatsTable_mib_index * mib_idx) -+{ -+ int err = SNMP_ERR_NOERROR; -+ -+ /* -+ * temp storage for parsing indexes -+ */ -+ /* -+ * ipIfStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h -+ */ -+ netsnmp_variable_list var_ipIfStatsIPVersion; -+ /* -+ * ipIfStatsIfIndex(2)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H -+ */ -+ netsnmp_variable_list var_ipIfStatsIfIndex; -+ -+ /* -+ * set up varbinds -+ */ -+ memset(&var_ipIfStatsIPVersion, 0x00, sizeof(var_ipIfStatsIPVersion)); -+ var_ipIfStatsIPVersion.type = ASN_INTEGER; -+ memset(&var_ipIfStatsIfIndex, 0x00, sizeof(var_ipIfStatsIfIndex)); -+ var_ipIfStatsIfIndex.type = ASN_INTEGER; -+ -+ /* -+ * chain temp index varbinds together -+ */ -+ var_ipIfStatsIPVersion.next_variable = &var_ipIfStatsIfIndex; -+ var_ipIfStatsIfIndex.next_variable = NULL; -+ -+ -+ DEBUGMSGTL(("verbose:ipIfStatsTable:ipIfStatsTable_index_from_oid", -+ "called\n")); -+ -+ /* -+ * parse the oid into the individual index components -+ */ -+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len, -+ &var_ipIfStatsIPVersion); -+ if (err == SNMP_ERR_NOERROR) { -+ /* -+ * copy out values -+ */ -+ mib_idx->ipIfStatsIPVersion = -+ *((u_long *) var_ipIfStatsIPVersion.val.string); -+ mib_idx->ipIfStatsIfIndex = -+ *((long *) var_ipIfStatsIfIndex.val.string); -+ -+ -+ } -+ -+ /* -+ * parsing may have allocated memory. free it. -+ */ -+ snmp_reset_var_buffers(&var_ipIfStatsIPVersion); -+ -+ return err; -+} /* ipIfStatsTable_index_from_oid */ -+ -+ -+/* -+ ********************************************************************* -+ * @internal -+ * allocate resources for a ipIfStatsTable_rowreq_ctx -+ */ -+ipIfStatsTable_rowreq_ctx * -+ipIfStatsTable_allocate_rowreq_ctx(ipIfStatsTable_data * data, -+ void *user_init_ctx) -+{ -+ ipIfStatsTable_rowreq_ctx *rowreq_ctx = -+ SNMP_MALLOC_TYPEDEF(ipIfStatsTable_rowreq_ctx); -+ -+ DEBUGMSGTL(("internal:ipIfStatsTable:ipIfStatsTable_allocate_rowreq_ctx", "called\n")); -+ -+ if (NULL == rowreq_ctx) { -+ snmp_log(LOG_ERR, "Couldn't allocate memory for a " -+ "ipIfStatsTable_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 = ipIfStatsTable_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->ipIfStatsTable_data_list = NULL; -+ -+ /* -+ * if we allocated data, call init routine -+ */ -+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) { -+ if (SNMPERR_SUCCESS != -+ ipIfStatsTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) { -+ ipIfStatsTable_release_rowreq_ctx(rowreq_ctx); -+ rowreq_ctx = NULL; -+ } -+ } -+ -+ return rowreq_ctx; -+} /* ipIfStatsTable_allocate_rowreq_ctx */ -+ -+/* -+ * @internal -+ * release resources for a ipIfStatsTable_rowreq_ctx -+ */ -+void -+ipIfStatsTable_release_rowreq_ctx(ipIfStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("internal:ipIfStatsTable:ipIfStatsTable_release_rowreq_ctx", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ ipIfStatsTable_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)) -+ ipIfStatsTable_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); -+} /* ipIfStatsTable_release_rowreq_ctx */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_ipIfStatsTable_pre_request(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ int rc; -+ -+ DEBUGMSGTL(("internal:ipIfStatsTable:_mfd_ipIfStatsTable_pre_request", -+ "called\n")); -+ -+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) { -+ DEBUGMSGTL(("internal:ipIfStatsTable", -+ "skipping additional pre_request\n")); -+ return SNMP_ERR_NOERROR; -+ } -+ -+ rc = ipIfStatsTable_pre_request(ipIfStatsTable_if_ctx.user_ctx); -+ if (MFD_SUCCESS != rc) { -+ /* -+ * nothing we can do about it but log it -+ */ -+ DEBUGMSGTL(("ipIfStatsTable", "error %d from " -+ "ipIfStatsTable_pre_request\n", rc)); -+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc)); -+ } -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_ipIfStatsTable_pre_request */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_ipIfStatsTable_post_request(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ ipIfStatsTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ int rc, packet_rc; -+ -+ DEBUGMSGTL(("internal:ipIfStatsTable:_mfd_ipIfStatsTable_post_request", -+ "called\n")); -+ -+ /* -+ * release row context, if deleted -+ */ -+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED)) -+ ipIfStatsTable_release_rowreq_ctx(rowreq_ctx); -+ -+ /* -+ * wait for last call before calling user -+ */ -+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) { -+ DEBUGMSGTL(("internal:ipIfStatsTable", -+ "waiting for last post_request\n")); -+ return SNMP_ERR_NOERROR; -+ } -+ -+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0); -+ rc = ipIfStatsTable_post_request(ipIfStatsTable_if_ctx.user_ctx, -+ packet_rc); -+ if (MFD_SUCCESS != rc) { -+ /* -+ * nothing we can do about it but log it -+ */ -+ DEBUGMSGTL(("ipIfStatsTable", "error %d from " -+ "ipIfStatsTable_post_request\n", rc)); -+ } -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_ipIfStatsTable_post_request */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_ipIfStatsTable_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; -+ ipIfStatsTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ -+ DEBUGMSGTL(("internal:ipIfStatsTable:_mfd_ipIfStatsTable_object_lookup", "called\n")); -+ -+ /* -+ * get our context from mfd -+ * ipIfStatsTable_interface_ctx *if_ctx = -+ * (ipIfStatsTable_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 -+ ipIfStatsTable_row_prep(rowreq_ctx); -+ -+ return SNMP_VALIDATE_ERR(rc); -+} /* _mfd_ipIfStatsTable_object_lookup */ -+ -+/*********************************************************************** -+ * -+ * GET processing -+ * -+ ***********************************************************************/ -+/* -+ * @internal -+ * Retrieve the value for a particular column -+ */ -+NETSNMP_STATIC_INLINE int -+_ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -+ netsnmp_variable_list * var, int column) -+{ -+ int rc = SNMPERR_SUCCESS; -+ -+ DEBUGMSGTL(("internal:ipIfStatsTable:_mfd_ipIfStatsTable_get_column", -+ "called for %d\n", column)); -+ -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ switch (column) { -+ -+ /* -+ * ipIfStatsInReceives(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSINRECEIVES: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsInReceives_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsHCInReceives(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSHCINRECEIVES: -+ var->val_len = sizeof(U64); -+ var->type = ASN_COUNTER64; -+ rc = ipIfStatsHCInReceives_get(rowreq_ctx, -+ (U64 *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsInOctets(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSINOCTETS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsInOctets_get(rowreq_ctx, (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSHCINOCTETS: -+ var->val_len = sizeof(U64); -+ var->type = ASN_COUNTER64; -+ rc = ipIfStatsHCInOctets_get(rowreq_ctx, (U64 *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsInHdrErrors(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSINHDRERRORS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsInHdrErrors_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsInNoRoutes(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSINNOROUTES: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsInNoRoutes_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsInAddrErrors(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSINADDRERRORS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsInAddrErrors_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsInUnknownProtos(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSINUNKNOWNPROTOS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsInUnknownProtos_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsInTruncatedPkts(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSINTRUNCATEDPKTS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsInTruncatedPkts_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsInForwDatagrams(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSINFORWDATAGRAMS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsInForwDatagrams_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsHCInForwDatagrams(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSHCINFORWDATAGRAMS: -+ var->val_len = sizeof(U64); -+ var->type = ASN_COUNTER64; -+ rc = ipIfStatsHCInForwDatagrams_get(rowreq_ctx, -+ (U64 *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsReasmReqds(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSREASMREQDS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsReasmReqds_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsReasmOKs(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSREASMOKS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsReasmOKs_get(rowreq_ctx, (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsReasmFails(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSREASMFAILS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsReasmFails_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsInDiscards(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSINDISCARDS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsInDiscards_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsInDelivers(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSINDELIVERS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsInDelivers_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsHCInDelivers(19)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSHCINDELIVERS: -+ var->val_len = sizeof(U64); -+ var->type = ASN_COUNTER64; -+ rc = ipIfStatsHCInDelivers_get(rowreq_ctx, -+ (U64 *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsOutRequests(20)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSOUTREQUESTS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsOutRequests_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsHCOutRequests(21)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSHCOUTREQUESTS: -+ var->val_len = sizeof(U64); -+ var->type = ASN_COUNTER64; -+ rc = ipIfStatsHCOutRequests_get(rowreq_ctx, -+ (U64 *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsOutForwDatagrams(23)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSOUTFORWDATAGRAMS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsOutForwDatagrams_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsHCOutForwDatagrams(24)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSHCOUTFORWDATAGRAMS: -+ var->val_len = sizeof(U64); -+ var->type = ASN_COUNTER64; -+ rc = ipIfStatsHCOutForwDatagrams_get(rowreq_ctx, -+ (U64 *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsOutDiscards(25)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSOUTDISCARDS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsOutDiscards_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsOutFragReqds(26)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSOUTFRAGREQDS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsOutFragReqds_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsOutFragOKs(27)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSOUTFRAGOKS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsOutFragOKs_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsOutFragFails(28)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSOUTFRAGFAILS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsOutFragFails_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsOutFragCreates(29)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSOUTFRAGCREATES: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsOutFragCreates_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsOutTransmits(30)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSOUTTRANSMITS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsOutTransmits_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsHCOutTransmits(31)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSHCOUTTRANSMITS: -+ var->val_len = sizeof(U64); -+ var->type = ASN_COUNTER64; -+ rc = ipIfStatsHCOutTransmits_get(rowreq_ctx, -+ (U64 *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsOutOctets(32)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSOUTOCTETS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsOutOctets_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsHCOutOctets(33)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSHCOUTOCTETS: -+ var->val_len = sizeof(U64); -+ var->type = ASN_COUNTER64; -+ rc = ipIfStatsHCOutOctets_get(rowreq_ctx, (U64 *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsInMcastPkts(34)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSINMCASTPKTS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsInMcastPkts_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsHCInMcastPkts(35)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSHCINMCASTPKTS: -+ var->val_len = sizeof(U64); -+ var->type = ASN_COUNTER64; -+ rc = ipIfStatsHCInMcastPkts_get(rowreq_ctx, -+ (U64 *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsInMcastOctets(36)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSINMCASTOCTETS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsInMcastOctets_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsHCInMcastOctets(37)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSHCINMCASTOCTETS: -+ var->val_len = sizeof(U64); -+ var->type = ASN_COUNTER64; -+ rc = ipIfStatsHCInMcastOctets_get(rowreq_ctx, -+ (U64 *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsOutMcastPkts(38)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSOUTMCASTPKTS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsOutMcastPkts_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsHCOutMcastPkts(39)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSHCOUTMCASTPKTS: -+ var->val_len = sizeof(U64); -+ var->type = ASN_COUNTER64; -+ rc = ipIfStatsHCOutMcastPkts_get(rowreq_ctx, -+ (U64 *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsOutMcastOctets(40)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSOUTMCASTOCTETS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsOutMcastOctets_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsHCOutMcastOctets(41)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSHCOUTMCASTOCTETS: -+ var->val_len = sizeof(U64); -+ var->type = ASN_COUNTER64; -+ rc = ipIfStatsHCOutMcastOctets_get(rowreq_ctx, -+ (U64 *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsInBcastPkts(42)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSINBCASTPKTS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsInBcastPkts_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsHCInBcastPkts(43)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSHCINBCASTPKTS: -+ var->val_len = sizeof(U64); -+ var->type = ASN_COUNTER64; -+ rc = ipIfStatsHCInBcastPkts_get(rowreq_ctx, -+ (U64 *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsOutBcastPkts(44)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSOUTBCASTPKTS: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = ipIfStatsOutBcastPkts_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsHCOutBcastPkts(45)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSHCOUTBCASTPKTS: -+ var->val_len = sizeof(U64); -+ var->type = ASN_COUNTER64; -+ rc = ipIfStatsHCOutBcastPkts_get(rowreq_ctx, -+ (U64 *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsDiscontinuityTime(46)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSDISCONTINUITYTIME: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_TIMETICKS; -+ rc = ipIfStatsDiscontinuityTime_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * ipIfStatsRefreshRate(47)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_IPIFSTATSREFRESHRATE: -+ var->val_len = sizeof(u_long); -+ var->type = ASN_UNSIGNED; -+ rc = ipIfStatsRefreshRate_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ default: -+ if (IPIFSTATSTABLE_MIN_COL <= column -+ && column <= IPIFSTATSTABLE_MAX_COL) { -+ DEBUGMSGTL(("internal:ipIfStatsTable:_mfd_ipIfStatsTable_get_column", "assume column %d is reserved\n", column)); -+ rc = MFD_SKIP; -+ } else { -+ snmp_log(LOG_ERR, -+ "unknown column %d in _ipIfStatsTable_get_column\n", -+ column); -+ } -+ break; -+ } -+ -+ return rc; -+} /* _ipIfStatsTable_get_column */ -+ -+int -+_mfd_ipIfStatsTable_get_values(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ ipIfStatsTable_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:ipIfStatsTable:_mfd_ipIfStatsTable_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 = _ipIfStatsTable_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_ipIfStatsTable_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:ipIfStatsTable:_cache_load", "called\n")); -+ -+ if ((NULL == cache) || (NULL == cache->magic)) { -+ snmp_log(LOG_ERR, "invalid cache for ipIfStatsTable_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 ipIfStatsTable_container_load((netsnmp_container *) cache-> -+ magic); -+} /* _cache_load */ -+ -+/** -+ * @internal -+ */ -+static void -+_cache_free(netsnmp_cache * cache, void *magic) -+{ -+ netsnmp_container *container; -+ -+ DEBUGMSGTL(("internal:ipIfStatsTable:_cache_free", "called\n")); -+ -+ if ((NULL == cache) || (NULL == cache->magic)) { -+ snmp_log(LOG_ERR, "invalid cache in ipIfStatsTable_cache_free\n"); -+ return; -+ } -+ -+ container = (netsnmp_container *) cache->magic; -+ -+ _container_free(container); -+} /* _cache_free */ -+ -+/** -+ * @internal -+ */ -+static void -+_container_item_free(ipIfStatsTable_rowreq_ctx * rowreq_ctx, void *context) -+{ -+ DEBUGMSGTL(("internal:ipIfStatsTable:_container_item_free", -+ "called\n")); -+ -+ if (NULL == rowreq_ctx) -+ return; -+ -+ ipIfStatsTable_release_rowreq_ctx(rowreq_ctx); -+} /* _container_item_free */ -+ -+/** -+ * @internal -+ */ -+static void -+_container_free(netsnmp_container * container) -+{ -+ DEBUGMSGTL(("internal:ipIfStatsTable:_container_free", "called\n")); -+ -+ if (NULL == container) { -+ snmp_log(LOG_ERR, -+ "invalid container in ipIfStatsTable_container_free\n"); -+ return; -+ } -+ -+ /* -+ * call user code -+ */ -+ ipIfStatsTable_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 -+_ipIfStatsTable_container_init(ipIfStatsTable_interface_ctx * if_ctx) -+{ -+ DEBUGMSGTL(("internal:ipIfStatsTable:_ipIfStatsTable_container_init", -+ "called\n")); -+ -+ /* -+ * cache init -+ */ -+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */ -+ _cache_load, _cache_free, -+ ipIfStatsTable_oid, -+ ipIfStatsTable_oid_size); -+ -+ if (NULL == if_ctx->cache) { -+ snmp_log(LOG_ERR, "error creating cache for ipIfStatsTable\n"); -+ return; -+ } -+ -+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET; -+ -+ ipIfStatsTable_container_init(&if_ctx->container, if_ctx->cache); -+ if (NULL == if_ctx->container) -+ if_ctx->container = -+ netsnmp_container_find("ipIfStatsTable:table_container"); -+ if (NULL == if_ctx->container) { -+ snmp_log(LOG_ERR, "error creating container in " -+ "ipIfStatsTable_container_init\n"); -+ return; -+ } -+ -+ if (NULL != if_ctx->cache) -+ if_ctx->cache->magic = (void *) if_ctx->container; -+} /* _ipIfStatsTable_container_init */ -+ -+/** -+ * @internal -+ * shutdown the container with functions or wrappers -+ */ -+void -+_ipIfStatsTable_container_shutdown(ipIfStatsTable_interface_ctx * if_ctx) -+{ -+ DEBUGMSGTL(("internal:ipIfStatsTable:_ipIfStatsTable_container_shutdown", "called\n")); -+ -+ ipIfStatsTable_container_shutdown(if_ctx->container); -+ -+ _container_free(if_ctx->container); -+ -+} /* _ipIfStatsTable_container_shutdown */ -+ -+ -+ipIfStatsTable_rowreq_ctx * -+ipIfStatsTable_row_find_by_mib_index(ipIfStatsTable_mib_index * mib_idx) -+{ -+ ipIfStatsTable_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 = ipIfStatsTable_index_to_oid(&oid_idx, mib_idx); -+ if (MFD_SUCCESS != rc) -+ return NULL; -+ -+ rowreq_ctx = CONTAINER_FIND(ipIfStatsTable_if_ctx.container, &oid_idx); -+ -+ return rowreq_ctx; -+} -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h -new file mode 100644 -index 0000000..c43de84 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h -@@ -0,0 +1,99 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 15899 $ of $ -+ * -+ * $Id:$ -+ */ -+/** @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 IPIFSTATSTABLE_INTERFACE_H -+#define IPIFSTATSTABLE_INTERFACE_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+#include "ipIfStatsTable.h" -+ -+ -+ /* -+ ******************************************************************** -+ * Table declarations -+ */ -+ -+ /* -+ * PUBLIC interface initialization routine -+ */ -+ void -+ _ipIfStatsTable_initialize_interface(ipIfStatsTable_registration * -+ user_ctx, u_long flags); -+ void -+ _ipIfStatsTable_shutdown_interface(ipIfStatsTable_registration * -+ user_ctx); -+ -+ ipIfStatsTable_registration *ipIfStatsTable_registration_get(void); -+ -+ ipIfStatsTable_registration -+ *ipIfStatsTable_registration_set(ipIfStatsTable_registration * -+ newreg); -+ -+ netsnmp_container *ipIfStatsTable_container_get(void); -+ int ipIfStatsTable_container_size(void); -+ -+ ipIfStatsTable_rowreq_ctx -+ *ipIfStatsTable_allocate_rowreq_ctx(ipIfStatsTable_data *, void *); -+ void -+ ipIfStatsTable_release_rowreq_ctx(ipIfStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int ipIfStatsTable_index_to_oid(netsnmp_index * oid_idx, -+ ipIfStatsTable_mib_index * -+ mib_idx); -+ int ipIfStatsTable_index_from_oid(netsnmp_index * oid_idx, -+ ipIfStatsTable_mib_index -+ * mib_idx); -+ -+ /* -+ * access to certain internals. use with caution! -+ */ -+ void ipIfStatsTable_valid_columns_set(netsnmp_column_info -+ *vc); -+ -+ /* -+ */ -+ void ipIfStatsTable_lastChange_set(u_long uptime); -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPIFSTATSTABLE_INTERFACE_H */ -+/** @} */ -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h -new file mode 100644 -index 0000000..76607a9 ---- /dev/null -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h -@@ -0,0 +1,122 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $ -+ * -+ * $Id:$ -+ */ -+#ifndef IPIFSTATSTABLE_OIDS_H -+#define IPIFSTATSTABLE_OIDS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+ /* -+ * column number definitions for table ipIfStatsTable -+ */ -+#define IPIFSTATSTABLE_OID 1,3,6,1,2,1,4,31,3 -+#define IPIFSTATSTABLELASTCHANGE_OID 1,3,6,1,2,1,4,31,2 -+ -+#define COLUMN_IPIFSTATSIPVERSION 1 -+ -+#define COLUMN_IPIFSTATSIFINDEX 2 -+ -+#define COLUMN_IPIFSTATSINRECEIVES 3 -+ -+#define COLUMN_IPIFSTATSHCINRECEIVES 4 -+ -+#define COLUMN_IPIFSTATSINOCTETS 5 -+ -+#define COLUMN_IPIFSTATSHCINOCTETS 6 -+ -+#define COLUMN_IPIFSTATSINHDRERRORS 7 -+ -+#define COLUMN_IPIFSTATSINNOROUTES 8 -+ -+#define COLUMN_IPIFSTATSINADDRERRORS 9 -+ -+#define COLUMN_IPIFSTATSINUNKNOWNPROTOS 10 -+ -+#define COLUMN_IPIFSTATSINTRUNCATEDPKTS 11 -+ -+#define COLUMN_IPIFSTATSINFORWDATAGRAMS 12 -+ -+#define COLUMN_IPIFSTATSHCINFORWDATAGRAMS 13 -+ -+#define COLUMN_IPIFSTATSREASMREQDS 14 -+ -+#define COLUMN_IPIFSTATSREASMOKS 15 -+ -+#define COLUMN_IPIFSTATSREASMFAILS 16 -+ -+#define COLUMN_IPIFSTATSINDISCARDS 17 -+ -+#define COLUMN_IPIFSTATSINDELIVERS 18 -+ -+#define COLUMN_IPIFSTATSHCINDELIVERS 19 -+ -+#define COLUMN_IPIFSTATSOUTREQUESTS 20 -+ -+#define COLUMN_IPIFSTATSHCOUTREQUESTS 21 -+ -+#define COLUMN_IPIFSTATSOUTFORWDATAGRAMS 23 -+ -+#define COLUMN_IPIFSTATSHCOUTFORWDATAGRAMS 24 -+ -+#define COLUMN_IPIFSTATSOUTDISCARDS 25 -+ -+#define COLUMN_IPIFSTATSOUTFRAGREQDS 26 -+ -+#define COLUMN_IPIFSTATSOUTFRAGOKS 27 -+ -+#define COLUMN_IPIFSTATSOUTFRAGFAILS 28 -+ -+#define COLUMN_IPIFSTATSOUTFRAGCREATES 29 -+ -+#define COLUMN_IPIFSTATSOUTTRANSMITS 30 -+ -+#define COLUMN_IPIFSTATSHCOUTTRANSMITS 31 -+ -+#define COLUMN_IPIFSTATSOUTOCTETS 32 -+ -+#define COLUMN_IPIFSTATSHCOUTOCTETS 33 -+ -+#define COLUMN_IPIFSTATSINMCASTPKTS 34 -+ -+#define COLUMN_IPIFSTATSHCINMCASTPKTS 35 -+ -+#define COLUMN_IPIFSTATSINMCASTOCTETS 36 -+ -+#define COLUMN_IPIFSTATSHCINMCASTOCTETS 37 -+ -+#define COLUMN_IPIFSTATSOUTMCASTPKTS 38 -+ -+#define COLUMN_IPIFSTATSHCOUTMCASTPKTS 39 -+ -+#define COLUMN_IPIFSTATSOUTMCASTOCTETS 40 -+ -+#define COLUMN_IPIFSTATSHCOUTMCASTOCTETS 41 -+ -+#define COLUMN_IPIFSTATSINBCASTPKTS 42 -+ -+#define COLUMN_IPIFSTATSHCINBCASTPKTS 43 -+ -+#define COLUMN_IPIFSTATSOUTBCASTPKTS 44 -+ -+#define COLUMN_IPIFSTATSHCOUTBCASTPKTS 45 -+ -+#define COLUMN_IPIFSTATSDISCONTINUITYTIME 46 -+ -+#define COLUMN_IPIFSTATSREFRESHRATE 47 -+ -+ -+#define IPIFSTATSTABLE_MIN_COL COLUMN_IPIFSTATSINRECEIVES -+#define IPIFSTATSTABLE_MAX_COL COLUMN_IPIFSTATSREFRESHRATE -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* IPIFSTATSTABLE_OIDS_H */ -diff --git a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c -index 4b1acb1..28e8538 100644 ---- a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c -+++ b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c -@@ -387,11 +387,14 @@ ipSystemStatsInReceives_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - "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 - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES]) -+ return MFD_SKIP; -+ - (*ipSystemStatsInReceives_val_ptr) = - rowreq_ctx->data->stats.HCInReceives.low; - -@@ -453,6 +456,9 @@ ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> copy ipSystemStatsHCInReceives data. - * get (* ipSystemStatsHCInReceives_val_ptr ).low and (* ipSystemStatsHCInReceives_val_ptr ).high from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES]) -+ return MFD_SKIP; -+ - (*ipSystemStatsHCInReceives_val_ptr).low = - rowreq_ctx->data->stats.HCInReceives.low; - (*ipSystemStatsHCInReceives_val_ptr).high = -@@ -517,6 +523,9 @@ ipSystemStatsInOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsInOctets data. - * copy (* ipSystemStatsInOctets_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINOCTETS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsInOctets_val_ptr) = - rowreq_ctx->data->stats.HCInOctets.low; - -@@ -574,6 +583,9 @@ ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> copy ipSystemStatsHCInOctets data. - * get (* ipSystemStatsHCInOctets_val_ptr ).low and (* ipSystemStatsHCInOctets_val_ptr ).high from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINOCTETS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsHCInOctets_val_ptr).low = - rowreq_ctx->data->stats.HCInOctets.low; - (*ipSystemStatsHCInOctets_val_ptr).high = -@@ -641,6 +653,9 @@ ipSystemStatsInHdrErrors_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsInHdrErrors data. - * copy (* ipSystemStatsInHdrErrors_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INHDRERRORS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsInHdrErrors_val_ptr) = - rowreq_ctx->data->stats.InHdrErrors; - -@@ -702,8 +717,11 @@ ipSystemStatsInNoRoutes_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsInNoRoutes data. - * copy (* ipSystemStatsInNoRoutes_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINNOROUTES]) -+ return MFD_SKIP; -+ - (*ipSystemStatsInNoRoutes_val_ptr) = -- rowreq_ctx->data->stats.InNoRoutes; -+ rowreq_ctx->data->stats.HCInNoRoutes.low; - - return MFD_SUCCESS; - } /* ipSystemStatsInNoRoutes_get */ -@@ -769,6 +787,9 @@ ipSystemStatsInAddrErrors_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsInAddrErrors data. - * copy (* ipSystemStatsInAddrErrors_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INADDRERRORS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsInAddrErrors_val_ptr) = - rowreq_ctx->data->stats.InAddrErrors; - -@@ -840,6 +861,9 @@ ipSystemStatsInUnknownProtos_get(ipSystemStatsTable_rowreq_ctx * - * TODO:231:o: |-> Extract the current value of the ipSystemStatsInUnknownProtos data. - * copy (* ipSystemStatsInUnknownProtos_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INUNKNOWNPROTOS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsInUnknownProtos_val_ptr) = - rowreq_ctx->data->stats.InUnknownProtos; - -@@ -902,6 +926,9 @@ ipSystemStatsInTruncatedPkts_get(ipSystemStatsTable_rowreq_ctx * - * TODO:231:o: |-> Extract the current value of the ipSystemStatsInTruncatedPkts data. - * copy (* ipSystemStatsInTruncatedPkts_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INTRUNCATEDPKTS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsInTruncatedPkts_val_ptr) = - rowreq_ctx->data->stats.InTruncatedPkts; - -@@ -973,6 +1000,9 @@ ipSystemStatsInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - * TODO:231:o: |-> Extract the current value of the ipSystemStatsInForwDatagrams data. - * copy (* ipSystemStatsInForwDatagrams_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsInForwDatagrams_val_ptr) = - rowreq_ctx->data->stats.HCInForwDatagrams.low; - -@@ -1033,6 +1063,9 @@ ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - * TODO:231:o: |-> copy ipSystemStatsHCInForwDatagrams data. - * get (* ipSystemStatsHCInForwDatagrams_val_ptr ).low and (* ipSystemStatsHCInForwDatagrams_val_ptr ).high from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsHCInForwDatagrams_val_ptr).low = - rowreq_ctx->data->stats.HCInForwDatagrams.low; - (*ipSystemStatsHCInForwDatagrams_val_ptr).high = -@@ -1102,6 +1135,9 @@ ipSystemStatsReasmReqds_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsReasmReqds data. - * copy (* ipSystemStatsReasmReqds_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMREQDS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsReasmReqds_val_ptr) = - rowreq_ctx->data->stats.ReasmReqds; - -@@ -1172,6 +1208,9 @@ ipSystemStatsReasmOKs_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsReasmOKs data. - * copy (* ipSystemStatsReasmOKs_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMOKS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsReasmOKs_val_ptr) = rowreq_ctx->data->stats.ReasmOKs; - - return MFD_SUCCESS; -@@ -1242,6 +1281,9 @@ ipSystemStatsReasmFails_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsReasmFails data. - * copy (* ipSystemStatsReasmFails_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REASMFAILS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsReasmFails_val_ptr) = - rowreq_ctx->data->stats.ReasmFails; - -@@ -1306,6 +1348,9 @@ ipSystemStatsInDiscards_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsInDiscards data. - * copy (* ipSystemStatsInDiscards_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_INDISCARDS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsInDiscards_val_ptr) = - rowreq_ctx->data->stats.InDiscards; - -@@ -1373,6 +1418,9 @@ ipSystemStatsInDelivers_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsInDelivers data. - * copy (* ipSystemStatsInDelivers_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINDELIVERS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsInDelivers_val_ptr) = - rowreq_ctx->data->stats.HCInDelivers.low; - -@@ -1430,6 +1478,9 @@ ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> copy ipSystemStatsHCInDelivers data. - * get (* ipSystemStatsHCInDelivers_val_ptr ).low and (* ipSystemStatsHCInDelivers_val_ptr ).high from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINDELIVERS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsHCInDelivers_val_ptr).low = - rowreq_ctx->data->stats.HCInDelivers.low; - (*ipSystemStatsHCInDelivers_val_ptr).high = -@@ -1495,6 +1546,9 @@ ipSystemStatsOutRequests_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutRequests data. - * copy (* ipSystemStatsOutRequests_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsOutRequests_val_ptr) = - rowreq_ctx->data->stats.HCOutRequests.low; - -@@ -1552,6 +1606,9 @@ ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> copy ipSystemStatsHCOutRequests data. - * get (* ipSystemStatsHCOutRequests_val_ptr ).low and (* ipSystemStatsHCOutRequests_val_ptr ).high from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsHCOutRequests_val_ptr).low = - rowreq_ctx->data->stats.HCOutRequests.low; - (*ipSystemStatsHCOutRequests_val_ptr).high = -@@ -1616,8 +1673,11 @@ ipSystemStatsOutNoRoutes_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutNoRoutes data. - * copy (* ipSystemStatsOutNoRoutes_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTNOROUTES]) -+ return MFD_SKIP; -+ - (*ipSystemStatsOutNoRoutes_val_ptr) = -- rowreq_ctx->data->stats.OutNoRoutes; -+ rowreq_ctx->data->stats.HCOutNoRoutes.low; - - return MFD_SUCCESS; - } /* ipSystemStatsOutNoRoutes_get */ -@@ -1691,6 +1751,9 @@ ipSystemStatsOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutForwDatagrams data. - * copy (* ipSystemStatsOutForwDatagrams_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsOutForwDatagrams_val_ptr) = - rowreq_ctx->data->stats.HCOutForwDatagrams.low; - -@@ -1751,6 +1814,9 @@ ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - * TODO:231:o: |-> copy ipSystemStatsHCOutForwDatagrams data. - * get (* ipSystemStatsHCOutForwDatagrams_val_ptr ).low and (* ipSystemStatsHCOutForwDatagrams_val_ptr ).high from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsHCOutForwDatagrams_val_ptr).low = - rowreq_ctx->data->stats.HCOutForwDatagrams.low; - (*ipSystemStatsHCOutForwDatagrams_val_ptr).high = -@@ -1818,8 +1884,11 @@ ipSystemStatsOutDiscards_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutDiscards data. - * copy (* ipSystemStatsOutDiscards_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsOutDiscards_val_ptr) = -- rowreq_ctx->data->stats.OutDiscards; -+ rowreq_ctx->data->stats.HCOutDiscards.low; - - return MFD_SUCCESS; - } /* ipSystemStatsOutDiscards_get */ -@@ -1887,8 +1956,11 @@ ipSystemStatsOutFragReqds_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutFragReqds data. - * copy (* ipSystemStatsOutFragReqds_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsOutFragReqds_val_ptr) = -- rowreq_ctx->data->stats.OutFragReqds; -+ rowreq_ctx->data->stats.HCOutFragReqds.low; - - return MFD_SUCCESS; - } /* ipSystemStatsOutFragReqds_get */ -@@ -1953,9 +2025,11 @@ ipSystemStatsOutFragOKs_get(ipSystemStatsTable_rowreq_ctx * 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; -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGOKS]) -+ return MFD_SKIP; -+ -+ (*ipSystemStatsOutFragOKs_val_ptr) = -+ rowreq_ctx->data->stats.HCOutFragOKs.low; - - return MFD_SUCCESS; - } /* ipSystemStatsOutFragOKs_get */ -@@ -2023,8 +2097,11 @@ ipSystemStatsOutFragFails_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutFragFails data. - * copy (* ipSystemStatsOutFragFails_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGFAILS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsOutFragFails_val_ptr) = -- rowreq_ctx->data->stats.OutFragFails; -+ rowreq_ctx->data->stats.HCOutFragFails.low; - - return MFD_SUCCESS; - } /* ipSystemStatsOutFragFails_get */ -@@ -2089,8 +2166,11 @@ ipSystemStatsOutFragCreates_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutFragCreates data. - * copy (* ipSystemStatsOutFragCreates_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES]) -+ return MFD_SKIP; -+ - (*ipSystemStatsOutFragCreates_val_ptr) = -- rowreq_ctx->data->stats.OutFragCreates; -+ rowreq_ctx->data->stats.HCOutFragCreates.low; - - return MFD_SUCCESS; - } /* ipSystemStatsOutFragCreates_get */ -@@ -2152,6 +2232,9 @@ ipSystemStatsOutTransmits_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutTransmits data. - * copy (* ipSystemStatsOutTransmits_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsOutTransmits_val_ptr) = - rowreq_ctx->data->stats.HCOutTransmits.low; - -@@ -2209,6 +2292,9 @@ ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> copy ipSystemStatsHCOutTransmits data. - * get (* ipSystemStatsHCOutTransmits_val_ptr ).low and (* ipSystemStatsHCOutTransmits_val_ptr ).high from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsHCOutTransmits_val_ptr).low = - rowreq_ctx->data->stats.HCOutTransmits.low; - (*ipSystemStatsHCOutTransmits_val_ptr).high = -@@ -2273,6 +2359,9 @@ ipSystemStatsOutOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutOctets data. - * copy (* ipSystemStatsOutOctets_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTOCTETS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsOutOctets_val_ptr) = - rowreq_ctx->data->stats.HCOutOctets.low; - -@@ -2330,6 +2419,9 @@ ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> copy ipSystemStatsHCOutOctets data. - * get (* ipSystemStatsHCOutOctets_val_ptr ).low and (* ipSystemStatsHCOutOctets_val_ptr ).high from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTOCTETS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsHCOutOctets_val_ptr).low = - rowreq_ctx->data->stats.HCOutOctets.low; - (*ipSystemStatsHCOutOctets_val_ptr).high = -@@ -2392,6 +2484,9 @@ ipSystemStatsInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsInMcastPkts data. - * copy (* ipSystemStatsInMcastPkts_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTPKTS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsInMcastPkts_val_ptr) = - rowreq_ctx->data->stats.HCInMcastPkts.low; - -@@ -2448,6 +2543,9 @@ ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> copy ipSystemStatsHCInMcastPkts data. - * get (* ipSystemStatsHCInMcastPkts_val_ptr ).low and (* ipSystemStatsHCInMcastPkts_val_ptr ).high from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTPKTS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsHCInMcastPkts_val_ptr).low = - rowreq_ctx->data->stats.HCInMcastPkts.low; - (*ipSystemStatsHCInMcastPkts_val_ptr).high = -@@ -2511,6 +2609,9 @@ ipSystemStatsInMcastOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsInMcastOctets data. - * copy (* ipSystemStatsInMcastOctets_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTOCTETS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsInMcastOctets_val_ptr) = - rowreq_ctx->data->stats.HCInMcastOctets.low; - -@@ -2569,6 +2670,9 @@ ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx * - * TODO:231:o: |-> copy ipSystemStatsHCInMcastOctets data. - * get (* ipSystemStatsHCInMcastOctets_val_ptr ).low and (* ipSystemStatsHCInMcastOctets_val_ptr ).high from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTOCTETS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsHCInMcastOctets_val_ptr).low = - rowreq_ctx->data->stats.HCInMcastOctets.low; - (*ipSystemStatsHCInMcastOctets_val_ptr).high = -@@ -2631,6 +2735,9 @@ ipSystemStatsOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutMcastPkts data. - * copy (* ipSystemStatsOutMcastPkts_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsOutMcastPkts_val_ptr) = - rowreq_ctx->data->stats.HCOutMcastPkts.low; - -@@ -2687,6 +2794,9 @@ ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> copy ipSystemStatsHCOutMcastPkts data. - * get (* ipSystemStatsHCOutMcastPkts_val_ptr ).low and (* ipSystemStatsHCOutMcastPkts_val_ptr ).high from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsHCOutMcastPkts_val_ptr).low = - rowreq_ctx->data->stats.HCOutMcastPkts.low; - (*ipSystemStatsHCOutMcastPkts_val_ptr).high = -@@ -2751,6 +2861,9 @@ ipSystemStatsOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutMcastOctets data. - * copy (* ipSystemStatsOutMcastOctets_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTOCTETS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsOutMcastOctets_val_ptr) = - rowreq_ctx->data->stats.HCOutMcastOctets.low; - -@@ -2813,6 +2926,9 @@ ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx * - * TODO:231:o: |-> copy ipSystemStatsHCOutMcastOctets data. - * get (* ipSystemStatsHCOutMcastOctets_val_ptr ).low and (* ipSystemStatsHCOutMcastOctets_val_ptr ).high from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTOCTETS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsHCOutMcastOctets_val_ptr).low = - rowreq_ctx->data->stats.HCOutMcastOctets.low; - (*ipSystemStatsHCOutMcastOctets_val_ptr).high = -@@ -2875,6 +2991,9 @@ ipSystemStatsInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsInBcastPkts data. - * copy (* ipSystemStatsInBcastPkts_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINBCASTPKTS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsInBcastPkts_val_ptr) = - rowreq_ctx->data->stats.HCInBcastPkts.low; - -@@ -2931,6 +3050,9 @@ ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> copy ipSystemStatsHCInBcastPkts data. - * get (* ipSystemStatsHCInBcastPkts_val_ptr ).low and (* ipSystemStatsHCInBcastPkts_val_ptr ).high from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINBCASTPKTS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsHCInBcastPkts_val_ptr).low = - rowreq_ctx->data->stats.HCInBcastPkts.low; - (*ipSystemStatsHCInBcastPkts_val_ptr).high = -@@ -2993,6 +3115,9 @@ ipSystemStatsOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutBcastPkts data. - * copy (* ipSystemStatsOutBcastPkts_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTBCASTPKTS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsOutBcastPkts_val_ptr) = - rowreq_ctx->data->stats.HCOutBcastPkts.low; - -@@ -3049,6 +3174,9 @@ ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> copy ipSystemStatsHCOutBcastPkts data. - * get (* ipSystemStatsHCOutBcastPkts_val_ptr ).low and (* ipSystemStatsHCOutBcastPkts_val_ptr ).high from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTBCASTPKTS]) -+ return MFD_SKIP; -+ - (*ipSystemStatsHCOutBcastPkts_val_ptr).low = - rowreq_ctx->data->stats.HCOutBcastPkts.low; - (*ipSystemStatsHCOutBcastPkts_val_ptr).high = -@@ -3113,6 +3241,9 @@ ipSystemStatsDiscontinuityTime_get(ipSystemStatsTable_rowreq_ctx * - * TODO:231:o: |-> Extract the current value of the ipSystemStatsDiscontinuityTime data. - * copy (* ipSystemStatsDiscontinuityTime_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_DISCONTINUITYTIME]) -+ return MFD_SKIP; -+ - (*ipSystemStatsDiscontinuityTime_val_ptr) = - rowreq_ctx->ipSystemStatsDiscontinuityTime; - -@@ -3169,6 +3300,9 @@ ipSystemStatsRefreshRate_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * TODO:231:o: |-> Extract the current value of the ipSystemStatsRefreshRate data. - * copy (* ipSystemStatsRefreshRate_val_ptr ) from rowreq_ctx->data - */ -+ if (!rowreq_ctx->data->stats.columnAvail[IPSYSTEMSTATSTABLE_REFRESHRATE]) -+ return MFD_SKIP; -+ - (*ipSystemStatsRefreshRate_val_ptr) = - rowreq_ctx->ipSystemStatsRefreshRate; - -diff --git a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c -index c1d257d..56d163d 100644 ---- a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c -+++ b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c -@@ -19,7 +19,7 @@ - - #include "ipSystemStatsTable_data_access.h" - --static int ipss_cache_refresh = 30; -+static int ipss_cache_refresh = IPSYSTEMSTATSTABLE_CACHE_TIMEOUT; - - /** @ingroup interface - * @addtogroup data_access data_access: Routines to access data -@@ -58,61 +58,10 @@ 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. - */ - -@@ -166,7 +115,9 @@ ipSystemStatsTable_container_init(netsnmp_container **container_ptr_ptr, - * 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; -+ -+ -+ *container_ptr_ptr = netsnmp_container_find("ipSystemStatsTable:table_container"); - - if (NULL == cache) { - snmp_log(LOG_ERR, -@@ -191,6 +142,7 @@ ipSystemStatsTable_container_init(netsnmp_container **container_ptr_ptr, - (NETSNMP_CACHE_DONT_AUTO_RELEASE | NETSNMP_CACHE_DONT_FREE_EXPIRED - | NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD | - NETSNMP_CACHE_AUTO_RELOAD); -+ ipSystemStatsTable_container_load(*container_ptr_ptr); - } /* ipSystemStatsTable_container_init */ - - /** -@@ -266,7 +218,7 @@ _add_new(netsnmp_systemstats_entry *systemstats_entry, - && (MFD_SUCCESS == - ipSystemStatsTable_indexes_set(rowreq_ctx, - systemstats_entry-> -- ns_ip_version))) { -+ index[0]))) { - rowreq_ctx->ipSystemStatsRefreshRate = ipss_cache_refresh * 1000; /* milli-seconds */ - CONTAINER_INSERT(container, rowreq_ctx); - } else { -diff --git a/include/net-snmp/data_access/ipstats.h b/include/net-snmp/data_access/ipstats.h -index 0e7aa1e..0e1bc21 100644 ---- a/include/net-snmp/data_access/ipstats.h -+++ b/include/net-snmp/data_access/ipstats.h -@@ -10,6 +10,40 @@ - extern "C" { - #endif - -+#define IPSYSTEMSTATSTABLE_HCINRECEIVES 1 -+#define IPSYSTEMSTATSTABLE_HCINOCTETS 2 -+#define IPSYSTEMSTATSTABLE_INHDRERRORS 3 -+#define IPSYSTEMSTATSTABLE_HCINNOROUTES 4 -+#define IPSYSTEMSTATSTABLE_INADDRERRORS 5 -+#define IPSYSTEMSTATSTABLE_INUNKNOWNPROTOS 6 -+#define IPSYSTEMSTATSTABLE_INTRUNCATEDPKTS 7 -+#define IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS 8 -+#define IPSYSTEMSTATSTABLE_REASMREQDS 9 -+#define IPSYSTEMSTATSTABLE_REASMOKS 10 -+#define IPSYSTEMSTATSTABLE_REASMFAILS 11 -+#define IPSYSTEMSTATSTABLE_INDISCARDS 12 -+#define IPSYSTEMSTATSTABLE_HCINDELIVERS 13 -+#define IPSYSTEMSTATSTABLE_HCOUTREQUESTS 14 -+#define IPSYSTEMSTATSTABLE_HCOUTNOROUTES 15 -+#define IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS 16 -+#define IPSYSTEMSTATSTABLE_HCOUTDISCARDS 17 -+#define IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS 18 -+#define IPSYSTEMSTATSTABLE_HCOUTFRAGOKS 19 -+#define IPSYSTEMSTATSTABLE_HCOUTFRAGFAILS 20 -+#define IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES 21 -+#define IPSYSTEMSTATSTABLE_HCOUTTRANSMITS 22 -+#define IPSYSTEMSTATSTABLE_HCOUTOCTETS 23 -+#define IPSYSTEMSTATSTABLE_HCINMCASTPKTS 24 -+#define IPSYSTEMSTATSTABLE_HCINMCASTOCTETS 25 -+#define IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS 26 -+#define IPSYSTEMSTATSTABLE_HCOUTMCASTOCTETS 27 -+#define IPSYSTEMSTATSTABLE_HCINBCASTPKTS 28 -+#define IPSYSTEMSTATSTABLE_HCOUTBCASTPKTS 29 -+#define IPSYSTEMSTATSTABLE_DISCONTINUITYTIME 30 -+#define IPSYSTEMSTATSTABLE_REFRESHRATE 31 -+ -+#define IPSYSTEMSTATSTABLE_LAST IPSYSTEMSTATSTABLE_REFRESHRATE -+ - /**---------------------------------------------------------------------*/ - /* - * structure definitions -@@ -20,28 +54,42 @@ extern "C" { - */ - typedef struct netsnmp_ipstats_s { - -+ /* Columns of ipStatsTable. Some of them are HC for computation of the -+ * other columns, when underlying OS does not provide them. -+ * Always fill at least 32 bits, the table is periodically polled -> 32 bit -+ * overflow shall be detected and 64 bit value should be computed automatically. */ - U64 HCInReceives; - U64 HCInOctets; - u_long InHdrErrors; -- u_long InNoRoutes; -+ U64 HCInNoRoutes; - u_long InAddrErrors; - u_long InUnknownProtos; - u_long InTruncatedPkts; -- U64 HCInForwDatagrams; -+ -+ /* optional, can be computed from HCInNoRoutes and HCOutForwDatagrams */ -+ U64 HCInForwDatagrams; -+ - u_long ReasmReqds; - u_long ReasmOKs; - u_long ReasmFails; - u_long InDiscards; - U64 HCInDelivers; - U64 HCOutRequests; -- u_long OutNoRoutes; -+ U64 HCOutNoRoutes; - U64 HCOutForwDatagrams; -- u_long OutDiscards; -- u_long OutFragReqds; -- u_long OutFragOKs; -- u_long OutFragFails; -- u_long OutFragCreates; -+ U64 HCOutDiscards; -+ -+ /* optional, can be computed from HCOutFragOKs + HCOutFragFails*/ -+ U64 HCOutFragReqds; -+ U64 HCOutFragOKs; -+ U64 HCOutFragFails; -+ U64 HCOutFragCreates; -+ -+ /* optional, can be computed from -+ * HCOutRequests +HCOutForwDatagrams + HCOutFragCreates -+ * - HCOutFragReqds - HCOutNoRoutes - HCOutDiscards */ - U64 HCOutTransmits; -+ - U64 HCOutOctets; - U64 HCInMcastPkts; - U64 HCInMcastOctets; -@@ -50,6 +98,8 @@ typedef struct netsnmp_ipstats_s { - U64 HCInBcastPkts; - U64 HCOutBcastPkts; - -+ /* Array of available columns.*/ -+ int columnAvail[IPSYSTEMSTATSTABLE_LAST+1]; - } netsnmp_ipstats; - - -diff --git a/include/net-snmp/data_access/systemstats.h b/include/net-snmp/data_access/systemstats.h -index 53dfd51..47e1076 100644 ---- a/include/net-snmp/data_access/systemstats.h -+++ b/include/net-snmp/data_access/systemstats.h -@@ -22,7 +22,11 @@ extern "C" { - typedef struct netsnmp_systemstats_s { - - netsnmp_index oid_index; /* MUST BE FIRST!! for container use */ -- oid ns_ip_version; -+ /* -+ * Index of the table -+ * First entry = ip version -+ * Second entry = interface index (0 for ipSystemStatsTable */ -+ oid index[2]; - - int flags; /* for net-snmp use */ - -@@ -49,13 +53,15 @@ netsnmp_container * netsnmp_access_systemstats_container_init(u_int init_flags); - #define NETSNMP_ACCESS_SYSTEMSTATS_INIT_NOFLAGS 0x0000 - #define NETSNMP_ACCESS_SYSTEMSTATS_INIT_ADDL_IDX_BY_ADDR 0x0001 - --/* -- * load and free -+/** -+ * Load container. If the NETSNMP_ACCESS_SYSTEMSTATS_LOAD_IFTABLE is set -+ * the ipIfSystemStats table is loaded, else ipSystemStatsTable is loaded. - */ - netsnmp_container* - netsnmp_access_systemstats_container_load(netsnmp_container* container, - u_int load_flags); - #define NETSNMP_ACCESS_SYSTEMSTATS_LOAD_NOFLAGS 0x0000 -+#define NETSNMP_ACCESS_SYSTEMSTATS_LOAD_IFTABLE 0x0001 - - void netsnmp_access_systemstats_container_free(netsnmp_container *container, - u_int free_flags); -@@ -68,7 +74,7 @@ void netsnmp_access_systemstats_container_free(netsnmp_container *container, - * create/free an entry - */ - netsnmp_systemstats_entry * --netsnmp_access_systemstats_entry_create(int version); -+netsnmp_access_systemstats_entry_create(int version, int if_index); - - void netsnmp_access_systemstats_entry_free(netsnmp_systemstats_entry * entry); - --- -1.6.0.2 - diff --git a/baselibs.conf b/baselibs.conf index 7d85d8f..f6d2438 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -2,4 +2,6 @@ libsnmp15 arch ppc package net-snmp-devel requires -net-snmp- requires "libsnmp15- = " - +arch sparcv9 package net-snmp-devel + requires -net-snmp- + requires "libsnmp15- = " diff --git a/net-snmp-5.1.1-pie.patch b/net-snmp-5.1.1-pie.patch index 4d90938..0130478 100644 --- a/net-snmp-5.1.1-pie.patch +++ b/net-snmp-5.1.1-pie.patch @@ -1,8 +1,8 @@ Index: apps/Makefile.in =================================================================== ---- apps/Makefile.in.orig 2007-06-30 00:18:27.000000000 +0200 -+++ apps/Makefile.in 2007-07-02 19:29:01.672262509 +0200 -@@ -115,7 +115,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX +--- apps/Makefile.in.orig ++++ apps/Makefile.in +@@ -121,7 +121,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX $(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS} snmptrapd$(EXEEXT): $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS) @@ -13,9 +13,9 @@ Index: apps/Makefile.in $(LINK) ${CFLAGS} -o $@ snmptrap.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS} Index: agent/Makefile.in =================================================================== ---- agent/Makefile.in.orig 2007-06-30 00:18:27.000000000 +0200 -+++ agent/Makefile.in 2007-07-02 19:29:28.297866574 +0200 -@@ -139,7 +139,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c +--- agent/Makefile.in.orig ++++ agent/Makefile.in +@@ -142,7 +142,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c $(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $? snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBTARG) diff --git a/net-snmp-5.3.0.1_trap-agent-addr_v2.patch b/net-snmp-5.3.0.1_trap-agent-addr_v2.patch deleted file mode 100644 index 2d59d48..0000000 --- a/net-snmp-5.3.0.1_trap-agent-addr_v2.patch +++ /dev/null @@ -1,206 +0,0 @@ -426355: Cannot set source agent address for SNMP traps - -Author: Jan Safranek - -Introduce "v1trapaddress" snmpd config option, which defines agent address -set in SNMPv1 traps, i.e. inside the SNMPv1 TRAP-PDU, not UDP packet -source address. The agent sets arbitrary local address to the TRAP PDU -when this option is ommited. - -Index: snmplib/system.c -=================================================================== ---- snmplib/system.c.orig 2008-06-05 23:11:53.000000000 +0200 -+++ snmplib/system.c 2008-09-06 18:04:38.784302537 +0200 -@@ -77,6 +77,10 @@ SOFTWARE. - #if HAVE_NET_IF_H - #include - #endif -+#if HAVE_NETDB_H -+#include -+#endif -+ - - #if HAVE_SYS_SOCKIO_H - #include -@@ -825,6 +829,84 @@ get_uptime(void) - #endif /* ! WIN32 */ - /*******************************************************************/ - -+int -+get_thisaddr(const char* name, in_addr_t *addr_out) -+{ -+ -+#if HAVE_GETADDRINFO -+ struct addrinfo *addrs = NULL; -+ struct addrinfo hint; -+ int err; -+ -+ memset(&hint, 0, sizeof hint); -+ hint.ai_flags = 0; -+ hint.ai_family = PF_INET; -+ hint.ai_socktype = SOCK_DGRAM; -+ hint.ai_protocol = 0; -+ -+ err = getaddrinfo(name, NULL, &hint, &addrs); -+ if (err != 0) { -+#if HAVE_GAI_STRERROR -+ snmp_log(LOG_ERR, "getaddrinfo: %s %s\n", name, -+ gai_strerror(err)); -+#else -+ snmp_log(LOG_ERR, "getaddrinfo: %s (error %d)\n", name, -+ err); -+#endif -+ return -1; -+ } -+ if (addrs != NULL) { -+ memcpy(addr_out, -+ &((struct sockaddr_in *) addrs->ai_addr)->sin_addr, -+ sizeof(in_addr_t)); -+ freeaddrinfo(addrs); -+ } else { -+ DEBUGMSGTL(("get_thisaddr", -+ "Failed to resolve IPv4 hostname\n")); -+ } -+ return 0; -+ -+#elif HAVE_GETHOSTBYNAME -+ struct hostent *hp = NULL; -+ -+ hp = gethostbyname(host); -+ if (hp == NULL) { -+ DEBUGMSGTL(("get_thisaddr", -+ "hostname (couldn't resolve)\n")); -+ return -1; -+ } else if (hp->h_addrtype != AF_INET) { -+ DEBUGMSGTL(("get_thisaddr", -+ "hostname (not AF_INET!)\n")); -+ return -1; -+ } else { -+ DEBUGMSGTL(("get_thisaddr", -+ "hostname (resolved okay)\n")); -+ memcpy(addr_out, hp->h_addr, sizeof(in_addr_t)); -+ } -+ return 0; -+ -+#elif HAVE_GETIPNODEBYNAME -+ struct hostent *hp = NULL; -+ int err; -+ -+ hp = getipnodebyname(peername, AF_INET, 0, &err); -+ if (hp == NULL) { -+ DEBUGMSGTL(("get_thisaddr", -+ "hostname (couldn't resolve = %d)\n", err)); -+ return -1; -+ } -+ DEBUGMSGTL(("get_thisaddr", -+ "hostname (resolved okay)\n")); -+ memcpy(addr_out, hp->h_addr, sizeof(in_addr_t)); -+ return 0; -+ -+#else /* HAVE_GETIPNODEBYNAME */ -+ return -1; -+#endif -+} -+ -+/*******************************************************************/ -+ - #ifndef HAVE_STRNCASECMP - - /* -Index: man/snmpd.conf.5.def -=================================================================== ---- man/snmpd.conf.5.def.orig 2008-08-07 11:00:04.000000000 +0200 -+++ man/snmpd.conf.5.def 2008-09-06 18:04:38.788301614 +0200 -@@ -641,6 +641,12 @@ Ordinarily the corresponding MIB - object (\fCsnmpEnableAuthenTraps.0\fR) is read-write, but specifying - this directive makes this object read-only, and attempts to set the - value via SET requests will result in a \fInotWritable\fR error response. -+.RE -+.IP "v1trapaddress HOST" -+defines the agent address, which is inserted into SNMPv1 TRAPs. Arbitrary local -+IPv4 address is chosen if this option is ommited. This option is useful mainly -+when the agent is visible from outside world by specific address only (e.g. -+because of network address translation or firewall). - .SS "DisMan Event MIB" - The previous directives can be used to configure where traps should - be sent, but are not concerned with \fIwhen\fR to send such traps -Index: include/net-snmp/agent/ds_agent.h -=================================================================== ---- include/net-snmp/agent/ds_agent.h.orig 2007-05-07 22:23:23.000000000 +0200 -+++ include/net-snmp/agent/ds_agent.h 2008-09-06 18:04:38.823792310 +0200 -@@ -42,6 +42,7 @@ - #define NETSNMP_DS_AGENT_PERL_INIT_FILE 4 /* used by embedded perl */ - #define NETSNMP_DS_SMUX_SOCKET 5 /* ip:port socket addr */ - #define NETSNMP_DS_NOTIF_LOG_CTX 6 /* "" | "snmptrapd" */ -+#define NETSNMP_DS_AGENT_TRAP_ADDR 7 /* used as v1 trap agent addres */ - - /* - * integers -Index: include/net-snmp/library/system.h -=================================================================== ---- include/net-snmp/library/system.h.orig 2007-01-11 23:13:56.000000000 +0100 -+++ include/net-snmp/library/system.h 2008-09-06 18:04:38.855791728 +0200 -@@ -107,6 +107,8 @@ SOFTWARE. - - #include /* For definition of in_addr_t */ - -+ int get_thisaddr(const char* name, -+ in_addr_t *addr_out); - in_addr_t get_myaddr(void); - long get_uptime(void); - -Index: agent/agent_read_config.c -=================================================================== ---- agent/agent_read_config.c.orig 2008-07-24 08:53:02.000000000 +0200 -+++ agent/agent_read_config.c 2008-09-06 18:04:38.880308775 +0200 -@@ -243,6 +243,9 @@ init_agent_read_config(const char *app) - snmpd_free_trapcommunity, - "community-string"); - #endif /* support for community based SNMP */ -+ netsnmp_ds_register_config(ASN_OCTET_STR, app, "v1trapaddress", -+ NETSNMP_DS_APPLICATION_ID, -+ NETSNMP_DS_AGENT_TRAP_ADDR); - #ifdef HAVE_UNISTD_H - register_app_config_handler("agentuser", - snmpd_set_agent_user, NULL, "userid"); -Index: agent/agent_trap.c -=================================================================== ---- agent/agent_trap.c.orig 2007-05-18 00:16:12.000000000 +0200 -+++ agent/agent_trap.c 2008-09-06 18:06:23.367792400 +0200 -@@ -58,6 +58,7 @@ - #include - - #include -+#include - #include - #include - #include -@@ -639,6 +640,8 @@ netsnmp_send_traps(int trap, int specifi - in_addr_t *pdu_in_addr_t; - u_long uptime; - struct trap_sink *sink; -+ const char *v1trapaddress; -+ int res; - - DEBUGMSGTL(( "trap", "send_trap %d %d ", trap, specific)); - DEBUGMSGOID(("trap", enterprise, enterprise_length)); -@@ -792,7 +795,18 @@ netsnmp_send_traps(int trap, int specifi - * Ensure that the v1 trap PDU includes the local IP address - */ - pdu_in_addr_t = (in_addr_t *) template_v1pdu->agent_addr; -- *pdu_in_addr_t = get_myaddr(); -+ -+ v1trapaddress = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID, -+ NETSNMP_DS_AGENT_TRAP_ADDR); -+ if (v1trapaddress != NULL) { -+ /* "v1trapaddress" was specified in config, try to resolve it */ -+ res = get_thisaddr(v1trapaddress, pdu_in_addr_t); -+ } -+ if (v1trapaddress == NULL || res < 0) { -+ /* "v1trapaddress" was not specified in config or the resolution failed, -+ * try any local address */ -+ *pdu_in_addr_t = get_myaddr(); -+ } - } - - diff --git a/net-snmp-5.4.1.2-etherlike-mib-revised_4.patch b/net-snmp-5.4.1.2-etherlike-mib-revised_4.patch deleted file mode 100644 index e2b7e6d..0000000 --- a/net-snmp-5.4.1.2-etherlike-mib-revised_4.patch +++ /dev/null @@ -1,4628 +0,0 @@ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/data_access/dot3stats.h net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/data_access/dot3stats.h ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/data_access/dot3stats.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/data_access/dot3stats.h 2008-12-21 05:19:52.000000000 -0500 -@@ -0,0 +1,7 @@ -+/* -+ * module to include the modules -+ */ -+ -+#if defined(linux) -+config_require(etherlike-mib/data_access/dot3stats_linux) -+#endif -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c 2008-12-21 05:35:33.000000000 -0500 -@@ -0,0 +1,397 @@ -+/* -+ * standard Net-SNMP includes -+ */ -+ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "etherlike-mib/dot3StatsTable/dot3StatsTable.h" -+#include "etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.h" -+#include "etherlike-mib/dot3StatsTable/ioctl_imp_common.h" -+ -+/* -+ * @retval 0 success -+ * @retval -1 getifaddrs failed -+ * @retval -2 memory allocation failed -+ */ -+ -+struct ifname * -+dot3stats_interface_name_list_get (struct ifname *list_head, int *retval) -+{ -+ struct ifaddrs *addrs = NULL, *p = NULL; -+ struct ifname *nameptr1=NULL, *nameptr2 = NULL; -+ -+ DEBUGMSGTL(("access:dot3StatsTable:interface_name_list_get", -+ "called\n")); -+ -+ if ((getifaddrs(&addrs)) < 0) { -+ DEBUGMSGTL(("access:dot3StatsTable:interface_name_list_get", -+ "getifaddrs failed\n")); -+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_name_list_get, getifaddrs failed\n"); -+ *retval = -1; -+ return NULL; -+ } -+ -+ for (p = addrs; p; p = p->ifa_next) { -+ -+ if (!list_head) { -+ if ( (list_head = (struct ifname *) malloc (sizeof(struct ifname))) < 0) { -+ DEBUGMSGTL(("access:dot3StatsTable:interface_name_list_get", -+ "memory allocation failed\n")); -+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_name_list_get, memory allocation failed\n"); -+ freeifaddrs(addrs); -+ *retval = -2; -+ return NULL; -+ } -+ memset (list_head, 0, sizeof (struct ifname)); -+ strncpy (list_head->name, p->ifa_name, IF_NAMESIZE); -+ continue; -+ } -+ -+ for (nameptr1 = list_head; nameptr1; nameptr2 = nameptr1, nameptr1 = nameptr1->ifn_next) -+ if (!strncmp(p->ifa_name, nameptr1->name, IF_NAMESIZE)) -+ break; -+ -+ if (nameptr1) -+ continue; -+ -+ if ( (nameptr2->ifn_next = (struct ifname *) malloc (sizeof(struct ifname))) < 0) { -+ DEBUGMSGTL(("access:dot3StatsTable:interface_name_list_get", -+ "memory allocation failed\n")); -+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_name_list_get, memory allocation failed\n"); -+ interface_name_list_free (list_head); -+ freeifaddrs(addrs); -+ *retval = -2; -+ return NULL; -+ } -+ nameptr2 = nameptr2->ifn_next; -+ memset (nameptr2, 0, sizeof (struct ifname)); -+ strncpy (nameptr2->name, p->ifa_name, IF_NAMESIZE); -+ continue; -+ -+ } -+ -+ freeifaddrs(addrs); -+ return list_head; -+} -+ -+/* -+ * @retval 0 success -+ * @retval -1 invalid pointer -+ */ -+ -+int -+dot3stats_interface_name_list_free (struct ifname *list_head) -+{ -+ struct ifname *nameptr1 = NULL, *nameptr2 = NULL; -+ -+ DEBUGMSGTL(("access:dot3StatsTable:interface_name_list_free", -+ "called\n")); -+ -+ if (!list_head) { -+ snmp_log (LOG_ERR, "access:dot3StatsTable:interface_name_list_free: invalid pointer list_head"); -+ DEBUGMSGTL(("access:dot3StatsTable:interface_name_list_free", -+ "invalid pointer list_head\n")); -+ return -1; -+ } -+ -+ for (nameptr1 = list_head; nameptr1; nameptr1 = nameptr2) { -+ nameptr2 = nameptr1->ifn_next; -+ free (nameptr1); -+ } -+ -+ return 0; -+} -+ -+/* -+ * @retval 0 : not found -+ * @retval !0 : ifIndex -+ */ -+ -+int -+dot3stats_interface_ioctl_ifindex_get (int fd, const char *name) { -+#ifndef SIOCGIFINDEX -+ return 0; -+#else -+ struct ifreq ifrq; -+ int rc = 0; -+ -+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_ifindex_get", "called\n")); -+ -+ rc = _dot3Stats_ioctl_get(fd, SIOCGIFINDEX, &ifrq, name); -+ if (rc < 0) { -+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_ifindex_get", -+ "error on interface '%s'\n", name)); -+ snmp_log (LOG_ERR, "access:dot3StatsTable:interface_ioctl_ifindex_get, error on interface '%s'\n", name); -+ return 0; -+ -+ } -+ -+ return ifrq.ifr_ifindex; -+#endif /* SIOCGIFINDEX */ -+} -+ -+/* -+ * @retval 0 success -+ * @retval -1 cannot get ETHTOOL_DRVINFO failed -+ * @retval -2 nstats zero - no statistcs available -+ * @retval -3 memory allocation for holding the statistics failed -+ * @retval -4 cannot get ETHTOOL_GSTRINGS information -+ * @retval -5 cannot get ETHTOOL_GSTATS information -+ * @retval -6 function not supported if HAVE_LINUX_ETHTOOL_H not defined -+ */ -+ -+ -+int -+interface_ioctl_dot3stats_get (dot3StatsTable_rowreq_ctx *rowreq_ctx, int fd, const char *name) { -+ -+#ifdef HAVE_LINUX_ETHTOOL_H -+ dot3StatsTable_data *data = &rowreq_ctx->data; -+ struct ethtool_drvinfo driver_info; -+ struct ethtool_gstrings *eth_strings; -+ struct ethtool_stats *eth_stats; -+ struct ifreq ifr; -+ unsigned int nstats, size_str, size_stats, i; -+ int err; -+ -+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_get", -+ "called\n")); -+ -+ memset(&ifr, 0, sizeof(ifr)); -+ strcpy(ifr.ifr_name, name); -+ -+ memset(&driver_info, 0, sizeof (driver_info)); -+ driver_info.cmd = ETHTOOL_GDRVINFO; -+ ifr.ifr_data = (char *)&driver_info; -+ -+ err = _dot3Stats_ioctl_get(fd, SIOCETHTOOL, &ifr, name); -+ if (err < 0) { -+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_get", -+ "ETHTOOL_GETDRVINFO failed for interface |%s| \n", name)); -+ return -1; -+ } -+ -+ nstats = driver_info.n_stats; -+ if (nstats < 1) { -+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_get", -+ "no stats available for interface |%s| \n", name)); -+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_ioctl_dot3Stats_get, no stats available for interface |%s| \n", name); -+ return -2; -+ } -+ -+ size_str = nstats * ETH_GSTRING_LEN; -+ size_stats = nstats * sizeof(u64); -+ -+ eth_strings = malloc(size_str + sizeof (struct ethtool_gstrings)); -+ if (!eth_strings) { -+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_get", -+ "no memory available\n")); -+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_ioctl_dot3Stats_get, no memory available\n"); -+ -+ return -3; -+ } -+ memset (eth_strings, 0, (size_str + sizeof (struct ethtool_gstrings))); -+ -+ eth_stats = malloc (size_str + sizeof (struct ethtool_stats)); -+ if (!eth_stats) { -+ free (eth_strings); -+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_get", -+ "no memory available\n")); -+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_ioctl_dot3Stats_get, no memory available\n"); -+ -+ return -3; -+ } -+ memset (eth_stats, 0, (size_str + sizeof (struct ethtool_stats))); -+ -+ eth_strings->cmd = ETHTOOL_GSTRINGS; -+ eth_strings->string_set = ETH_SS_STATS; -+ eth_strings->len = nstats; -+ ifr.ifr_data = (char *) eth_strings; -+ err = _dot3Stats_ioctl_get(fd, SIOCETHTOOL, &ifr, name); -+ if (err < 0) { -+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_get", -+ "cannot get stats strings information for interface |%s| \n", name)); -+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_ioctl_dot3Stats_get, cannot get stats strings information for interface |%s| \n", name); -+ -+ free(eth_strings); -+ free(eth_stats); -+ return -4; -+ } -+ -+ eth_stats->cmd = ETHTOOL_GSTATS; -+ eth_stats->n_stats = nstats; -+ ifr.ifr_data = (char *) eth_stats; -+ err = _dot3Stats_ioctl_get(fd, SIOCETHTOOL, &ifr, name); -+ if (err < 0) { -+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_get", -+ "cannot get stats strings information for interface |%s| \n", name)); -+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_ioctl_dot3Stats_get, cannot get stats information for interface |%s| \n", name); -+ -+ free(eth_strings); -+ free(eth_stats); -+ return -5; -+ } -+ -+ for (i = 0; i < nstats; i++) { -+ char s[ETH_GSTRING_LEN]; -+ -+ strncpy(s, (const char *) ð_strings->data[i * ETH_GSTRING_LEN], -+ ETH_GSTRING_LEN); -+ -+ if (DOT3STATSALIGNMENTERRORS(s)) { -+ data->dot3StatsAlignmentErrors = (u_long)eth_stats->data[i]; -+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSALIGNMENTERRORS_FLAG; -+ } -+ -+ if (DOT3STATSMULTIPLECOLLISIONFRAMES(s)) { -+ data->dot3StatsMultipleCollisionFrames = (u_long)eth_stats->data[i]; -+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSMULTIPLECOLLISIONFRAMES_FLAG; -+ } -+ -+ if (DOT3STATSLATECOLLISIONS(s)) { -+ data->dot3StatsLateCollisions = (u_long)eth_stats->data[i]; -+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSLATECOLLISIONS_FLAG; -+ } -+ -+ if (DOT3STATSSINGLECOLLISIONFRAMES(s)) { -+ data->dot3StatsSingleCollisionFrames = (u_long)eth_stats->data[i]; -+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSSINGLECOLLISIONFRAMES_FLAG; -+ } -+ -+ if (DOT3STATSEXCESSIVECOLLISIONS(s)) { -+ data->dot3StatsExcessiveCollisions = (u_long)eth_stats->data[i]; -+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSEXCESSIVECOLLISIONS_FLAG; -+ } -+ } -+ -+ free(eth_strings); -+ free(eth_stats); -+ -+ return 0; -+#else -+ return -6; -+#endif -+} -+ -+ -+/* -+ * @retval 0 success -+ * @retval -1 ETHTOOL_GSET failed -+ * @retval -2 function not supported if HAVE_LINUX_ETHTOOL_H not defined -+ */ -+ -+int -+interface_ioctl_dot3stats_duplex_get(dot3StatsTable_rowreq_ctx *rowreq_ctx, int fd, const char* name) { -+ -+#ifdef HAVE_LINUX_ETHTOOL_H -+ dot3StatsTable_data *data = &rowreq_ctx->data; -+ struct ethtool_cmd edata; -+ struct ifreq ifr; -+ int err; -+ -+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_duplex_get", -+ "called\n")); -+ -+ memset(&edata, 0, sizeof (edata)); -+ memset(&ifr, 0, sizeof (ifr)); -+ edata.cmd = ETHTOOL_GSET; -+ ifr.ifr_data = (char *)&edata; -+ -+ err = _dot3Stats_ioctl_get (fd, SIOCETHTOOL, &ifr, name); -+ if (err < 0) { -+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_duplex_get", -+ "ETHTOOL_GSET failed\n")); -+ snmp_log (LOG_ERR, "access:dot3StatsTable,interface_ioctl_dot3Stats_duplex_get, ETHTOOL_GSET failed\n"); -+ -+ return -1; -+ } -+ -+ if (err == 0) { -+ rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSDUPLEXSTATUS_FLAG; -+ switch (edata.duplex) { -+ case DUPLEX_HALF: -+ data->dot3StatsDuplexStatus = (u_long) DOT3STATSDUPLEXSTATUS_HALFDUPLEX; -+ break; -+ case DUPLEX_FULL: -+ data->dot3StatsDuplexStatus = (u_long) DOT3STATSDUPLEXSTATUS_FULLDUPLEX; -+ break; -+ default: -+ data->dot3StatsDuplexStatus = (u_long) DOT3STATSDUPLEXSTATUS_UNKNOWN; -+ break; -+ }; -+ } -+ -+ DEBUGMSGTL(("access:dot3StatsTable:interface_ioctl_dot3Stats_duplex_get", -+ "ETHTOOL_GSET processed\n")); -+ return err; -+#else -+ return -2; -+#endif -+} -+ -+ -+ -+/* ioctl wrapper -+ * -+ * @param fd : socket fd to use w/ioctl, or -1 to open/close one -+ * @param which -+ * @param ifrq -+ * param ifentry : ifentry to update -+ * @param name -+ * -+ * @retval 0 : success -+ * @retval -1 : invalid parameters -+ * @retval -2 : couldn't create socket -+ * @retval -3 : ioctl call failed -+ */ -+int -+_dot3Stats_ioctl_get(int fd, int which, struct ifreq *ifrq, const char* name) -+{ -+ int ourfd = -1, rc = 0; -+ -+ DEBUGMSGTL(("access:dot3StatsTable:ioctl", "_dot3Stats_ioctl_get\n")); -+ -+ /* -+ * sanity checks -+ */ -+ if(NULL == name) { -+ DEBUGMSGTL(("access:dot3StatsTable:ioctl", -+ "_dot3Stats_ioctl_get invalid ifname '%s'\n", name)); -+ snmp_log (LOG_ERR, "access:dot3StatsTable:ioctl, _dot3Stats_ioctl_get error on interface '%s'\n", name); -+ return -1; -+ } -+ -+ /* -+ * create socket for ioctls -+ */ -+ if(fd < 0) { -+ fd = ourfd = socket(AF_INET, SOCK_DGRAM, 0); -+ if(ourfd < 0) { -+ DEBUGMSGTL(("access:dot3StatsTable:ioctl", -+ "dot3Stats_ioctl_get couldn't create a socket\n", name)); -+ snmp_log (LOG_ERR, "access:dot3StatsTable:ioctl, _dot3Stats_ioctl_get error on interface '%s'\n", name); -+ -+ return -2; -+ } -+ } -+ -+ strncpy(ifrq->ifr_name, name, sizeof(ifrq->ifr_name)); -+ ifrq->ifr_name[ sizeof(ifrq->ifr_name)-1 ] = 0; -+ rc = ioctl(fd, which, ifrq); -+ if (rc < 0) { -+ DEBUGMSGTL(("access:dot3StatsTable:ioctl", -+ "dot3Stats_ioctl_get ioctl %d returned %d\n", which, rc)); -+ rc = -3; -+ } -+ -+ if(ourfd >= 0) -+ close(ourfd); -+ -+ return rc; -+} -+ -+ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.c net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.c ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.c 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.c 2008-08-08 05:58:09.000000000 -0400 -@@ -0,0 +1,212 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+/** \page MFD helper for dot3StatsTable -+ * -+ * \section intro Introduction -+ * Introductory text. -+ * -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "dot3StatsTable.h" -+ -+#include -+ -+#include "dot3StatsTable_interface.h" -+ -+oid dot3StatsTable_oid[] = { DOT3STATSTABLE_OID }; -+int dot3StatsTable_oid_size = OID_LENGTH(dot3StatsTable_oid); -+ -+dot3StatsTable_registration dot3StatsTable_user_context; -+ -+void initialize_table_dot3StatsTable(void); -+void shutdown_table_dot3StatsTable(void); -+ -+ -+/** -+ * Initializes the dot3StatsTable module -+ */ -+void -+init_dot3StatsTable(void) -+{ -+ DEBUGMSGTL(("verbose:dot3StatsTable:init_dot3StatsTable", "called\n")); -+ -+ /* -+ * TODO:300:o: Perform dot3StatsTable one-time module initialization. -+ */ -+ -+ /* -+ * here we initialize all the tables we're planning on supporting -+ */ -+ if (should_init("dot3StatsTable")) -+ initialize_table_dot3StatsTable(); -+ -+} /* init_dot3StatsTable */ -+ -+/** -+ * Shut-down the dot3StatsTable module (agent is exiting) -+ */ -+void -+shutdown_dot3StatsTable(void) -+{ -+ if (should_init("dot3StatsTable")) -+ shutdown_table_dot3StatsTable(); -+ -+} -+ -+/** -+ * Initialize the table dot3StatsTable -+ * (Define its contents and how it's structured) -+ */ -+void -+initialize_table_dot3StatsTable(void) -+{ -+ dot3StatsTable_registration *user_context; -+ u_long flags; -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:initialize_table_dot3StatsTable", -+ "called\n")); -+ -+ /* -+ * TODO:301:o: Perform dot3StatsTable one-time table initialization. -+ */ -+ -+ /* -+ * TODO:302:o: |->Initialize dot3StatsTable 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("dot3StatsTable", NULL, NULL); -+ -+ /* -+ * No support for any flags yet, but in the future you would -+ * set any flags here. -+ */ -+ flags = 0; -+ -+ /* -+ * call interface initialization code -+ */ -+ _dot3StatsTable_initialize_interface(user_context, flags); -+} /* initialize_table_dot3StatsTable */ -+ -+/** -+ * Shutdown the table dot3StatsTable -+ */ -+void -+shutdown_table_dot3StatsTable(void) -+{ -+ /* -+ * call interface shutdown code -+ */ -+ _dot3StatsTable_shutdown_interface(&dot3StatsTable_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 -+dot3StatsTable_rowreq_ctx_init(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ void *user_init_ctx) -+{ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_rowreq_ctx_init", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:210:o: |-> Perform extra dot3StatsTable rowreq initialization. (eg DEFVALS) -+ */ -+ -+ return MFD_SUCCESS; -+} /* dot3StatsTable_rowreq_ctx_init */ -+ -+/** -+ * extra context cleanup -+ * -+ */ -+void -+dot3StatsTable_rowreq_ctx_cleanup(dot3StatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_rowreq_ctx_cleanup", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:211:o: |-> Perform extra dot3StatsTable rowreq cleanup. -+ */ -+} /* dot3StatsTable_rowreq_ctx_cleanup */ -+ -+/** -+ * pre-request callback -+ * -+ * -+ * @retval MFD_SUCCESS : success. -+ * @retval MFD_ERROR : other error -+ */ -+int -+dot3StatsTable_pre_request(dot3StatsTable_registration * user_context) -+{ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_pre_request", -+ "called\n")); -+ -+ /* -+ * TODO:510:o: Perform dot3StatsTable pre-request actions. -+ */ -+ -+ return MFD_SUCCESS; -+} /* dot3StatsTable_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 -+dot3StatsTable_post_request(dot3StatsTable_registration * user_context, -+ int rc) -+{ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_post_request", -+ "called\n")); -+ -+ /* -+ * TODO:511:o: Perform dot3StatsTable post-request actions. -+ */ -+ -+ return MFD_SUCCESS; -+} /* dot3StatsTable_post_request */ -+ -+ -+/** @{ */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c 2009-01-12 03:38:21.000000000 -0500 -@@ -0,0 +1,413 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "dot3StatsTable.h" -+#include "dot3StatsTable_data_access.h" -+ -+#if defined(linux) -+#include "ioctl_imp_common.h" -+#endif -+ -+/** @ingroup interface -+ * @addtogroup data_access data_access: Routines to access data -+ * -+ * These routines are used to locate the data used to satisfy -+ * requests. -+ * -+ * @{ -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table dot3StatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * EtherLike-MIB::dot3StatsTable is subid 2 of dot3. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.10.7.2, length: 9 -+ */ -+ -+/** -+ * initialization for dot3StatsTable data access -+ * -+ * This function is called during startup to allow you to -+ * allocate any resources you need for the data table. -+ * -+ * @param dot3StatsTable_reg -+ * Pointer to dot3StatsTable_registration -+ * -+ * @retval MFD_SUCCESS : success. -+ * @retval MFD_ERROR : unrecoverable error. -+ */ -+int -+dot3StatsTable_init_data(dot3StatsTable_registration * dot3StatsTable_reg) -+{ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_init_data", -+ "called\n")); -+ -+ /* -+ * TODO:303:o: Initialize dot3StatsTable data. -+ */ -+ -+ return MFD_SUCCESS; -+} /* dot3StatsTable_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 -+dot3StatsTable_container_init(netsnmp_container ** container_ptr_ptr, -+ netsnmp_cache * cache) -+{ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_container_init", -+ "called\n")); -+ -+ if (NULL == container_ptr_ptr) { -+ snmp_log(LOG_ERR, -+ "bad container param to dot3StatsTable_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 dot3StatsTable_container_init\n"); -+ return; -+ } -+ -+ /* -+ * TODO:345:A: Set up dot3StatsTable 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 = DOT3STATSTABLE_CACHE_TIMEOUT; /* seconds */ -+} /* dot3StatsTable_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 dot3StatsTable_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 -+dot3StatsTable_container_shutdown(netsnmp_container * container_ptr) -+{ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_container_shutdown", -+ "called\n")); -+ -+ if (NULL == container_ptr) { -+ snmp_log(LOG_ERR, -+ "bad params to dot3StatsTable_container_shutdown\n"); -+ return; -+ } -+ -+} /* dot3StatsTable_container_shutdown */ -+ -+/** -+ * load initial data -+ * -+ * TODO:350:M: Implement dot3StatsTable 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 -+ * dot3StatsTable_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. -+ * -+ */ -+ -+/* -+ * -+ * @retval MFD_SUCCESS success -+ * @retval MFD_ERROR could not get the interface names -+ * @retval MFD_RESOURCE_UNAVAILABLE failed to allocate memory -+ * @retval -2 could not open a socket -+ */ -+ -+ -+int -+dot3StatsTable_container_load(netsnmp_container * container) -+{ -+ dot3StatsTable_rowreq_ctx *rowreq_ctx; -+ size_t count = 0; -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_container_load", -+ "called\n")); -+ -+ /* -+ * TODO:352:M: | |-> set indexes in new dot3StatsTable rowreq context. -+ * data context will be set from the param (unless NULL, -+ * in which case a new data context will be allocated) -+ */ -+ -+ /* -+ * temporary storage for index values -+ */ -+ -+ /* -+ * dot3StatsIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H -+ */ -+ -+ long dot3StatsIndex; -+ int fd; -+ int rc = 0, retval = 0; -+ -+#if defined(linux) -+ struct ifname *list_head = NULL, *p = NULL; -+#endif -+ -+ /* -+ * create socket for ioctls -+ */ -+ -+ fd = socket(AF_INET, SOCK_DGRAM, 0); -+ if(fd < 0) { -+ snmp_log(LOG_ERR, "could not create socket\n"); -+ return -2; -+ } -+ -+ /* -+ * get the interface names of the devices present in the system, in case of failure retval suggests the reson for failure -+ * and list_head contains null -+ */ -+ -+#if defined(linux) -+ list_head = dot3stats_interface_name_list_get (list_head, &retval); -+ -+ if (!list_head) { -+ snmp_log (LOG_ERR, "access:dot3StatsTable, error getting the interface names present in the system\n"); -+ DEBUGMSGTL(("access:dot3StatsTable", "error getting the interface names present in the system")); -+ return MFD_ERROR; -+ } -+ -+ /* -+ * Walk over the list of interface names present in the system and retreive the statistics -+ */ -+ -+ for (p = list_head; p; p = p->ifn_next) { -+ u_int flags; -+ -+ flags = 0; -+ -+ DEBUGMSGTL(("access:dot3StatsTable", "processing '%s'\n", p->name)); -+ -+ /* -+ * get index via ioctl. -+ */ -+ -+ dot3StatsIndex = (long) dot3stats_interface_ioctl_ifindex_get(-1, p->name); -+ -+ /* -+ * get the dot3stats contents populated, if the device is not an ethernet device -+ * the operation will not be supported and an error message will be logged -+ */ -+ -+ rowreq_ctx = dot3StatsTable_allocate_rowreq_ctx(NULL); -+ if (NULL == rowreq_ctx) { -+ snmp_log(LOG_ERR, "memory allocation for dot3StatsTable failed\n"); -+ return MFD_RESOURCE_UNAVAILABLE; -+ } -+ -+ if (MFD_SUCCESS != -+ dot3StatsTable_indexes_set(rowreq_ctx, dot3StatsIndex)) { -+ snmp_log(LOG_ERR, -+ "error setting index while loading " -+ "dot3StatsTable data.\n"); -+ dot3StatsTable_release_rowreq_ctx(rowreq_ctx); -+ continue; -+ } -+ -+ /* -+ * TODO:352:r: | |-> populate dot3StatsTable data context. -+ * Populate data context here. (optionally, delay until row prep) -+ */ -+ /* -+ * non-TRANSIENT data: no need to copy. set pointer to data -+ */ -+ -+ memset (&rowreq_ctx->data, 0, sizeof (rowreq_ctx->data)); -+ rc = interface_ioctl_dot3stats_get (rowreq_ctx, fd, p->name); -+ -+ if (rc < 0) { -+ snmp_log(LOG_ERR, -+ "error getting the statistics for interface |%s| " -+ "dot3StatsTable data, operation might not be supported\n", p->name); -+ DEBUGMSGTL(("access:dot3StatsTable", "error getting the statistics for interface |%s| " -+ "dot3StatsTable data, operation might not be supported\n", p->name)); -+ dot3StatsTable_release_rowreq_ctx(rowreq_ctx); -+ continue; -+ } -+ -+ rc = interface_ioctl_dot3stats_duplex_get(rowreq_ctx, fd, p->name); -+ if (rc < 0) { -+ snmp_log(LOG_ERR, -+ "error getting the duplex status for |%s| " -+ "dot3StatsTable data, operation might not be supported\n", p->name); -+ DEBUGMSGTL(("access:dot3StatsTable", "error getting the duplex status for |%s| " -+ "dot3StatsTable data, operation might not be supported\n", p->name)); -+ dot3StatsTable_release_rowreq_ctx(rowreq_ctx); -+ continue; -+ } -+ -+ /* -+ * insert into table container -+ */ -+ CONTAINER_INSERT(container, rowreq_ctx); -+ ++count; -+ } -+ -+ /* -+ * free the interface names list -+ */ -+ -+ if ( (dot3stats_interface_name_list_free(list_head)) < 0) { -+ snmp_log(LOG_ERR, "access:dot3StatsTable, error freeing the interface name list \n"); -+ DEBUGMSGTL(("access:dot3StatsTable", "error freeing the interface name list\n")); -+ return MFD_ERROR; -+ } -+#endif -+ -+ DEBUGMSGT(("verbose:dot3StatsTable:dot3StatsTable_container_load", -+ "inserted %d records\n", count)); -+ -+ return MFD_SUCCESS; -+} /* dot3StatsTable_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 -+dot3StatsTable_container_free(netsnmp_container * container) -+{ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_container_free", -+ "called\n")); -+ -+ /* -+ * TODO:380:M: Free dot3StatsTable container data. -+ */ -+} /* dot3StatsTable_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 -+dot3StatsTable_row_prep(dot3StatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_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; -+} /* dot3StatsTable_row_prep */ -+ -+/** @} */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.h net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.h ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.h 2008-08-31 10:26:33.000000000 -0400 -@@ -0,0 +1,74 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+#ifndef DOT3STATSTABLE_DATA_ACCESS_H -+#define DOT3STATSTABLE_DATA_ACCESS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+ /* -+ ********************************************************************* -+ * function declarations -+ */ -+ -+ /* -+ ********************************************************************* -+ * Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table dot3StatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * EtherLike-MIB::dot3StatsTable is subid 2 of dot3. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.10.7.2, length: 9 -+ */ -+ -+ -+ int dot3StatsTable_init_data(dot3StatsTable_registration * -+ dot3StatsTable_reg); -+ -+ -+ /* -+ * TODO:180:o: Review dot3StatsTable cache timeout. -+ * The number of seconds before the cache times out -+ */ -+#define DOT3STATSTABLE_CACHE_TIMEOUT 60 -+ -+ void dot3StatsTable_container_init(netsnmp_container ** -+ container_ptr_ptr, -+ netsnmp_cache * cache); -+ void dot3StatsTable_container_shutdown(netsnmp_container * -+ container_ptr); -+ -+ int dot3StatsTable_container_load(netsnmp_container * -+ container); -+ void dot3StatsTable_container_free(netsnmp_container * -+ container); -+ -+ int dot3StatsTable_cache_load(netsnmp_container * -+ container); -+ void dot3StatsTable_cache_free(netsnmp_container * -+ container); -+ -+#define MAX_LINE_SIZE 256 -+ -+ int dot3StatsTable_row_prep(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* DOT3STATSTABLE_DATA_ACCESS_H */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.c net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.c ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.c 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.c 2008-08-11 13:28:29.000000000 -0400 -@@ -0,0 +1,1450 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 12088 $ of $ -+ * -+ * $Id:$ -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "dot3StatsTable.h" -+ -+ -+/** @defgroup data_get data_get: Routines to get data -+ * -+ * TODO:230:M: Implement dot3StatsTable get routines. -+ * TODO:240:M: Implement dot3StatsTable mapping routines (if any). -+ * -+ * These routine are used to get the value for individual objects. The -+ * row context is passed, along with a pointer to the memory where the -+ * value should be copied. -+ * -+ * @{ -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table dot3StatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * EtherLike-MIB::dot3StatsTable is subid 2 of dot3. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.10.7.2, length: 9 -+ */ -+ -+/* -+ * --------------------------------------------------------------------- -+ * * TODO:200:r: Implement dot3StatsTable data context functions. -+ */ -+ -+ -+/** -+ * set mib index(es) -+ * -+ * @param tbl_idx mib index structure -+ * @param dot3StatsIndex_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 -+dot3StatsTable_indexes_set_tbl_idx(dot3StatsTable_mib_index * tbl_idx, -+ long dot3StatsIndex_val) -+{ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_indexes_set_tbl_idx", "called\n")); -+ -+ /* -+ * dot3StatsIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H -+ */ -+ tbl_idx->dot3StatsIndex = dot3StatsIndex_val; -+ -+ -+ return MFD_SUCCESS; -+} /* dot3StatsTable_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 -+dot3StatsTable_indexes_set(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ long dot3StatsIndex_val) -+{ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_indexes_set", -+ "called\n")); -+ -+ if (MFD_SUCCESS != -+ dot3StatsTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx, -+ dot3StatsIndex_val)) -+ return MFD_ERROR; -+ -+ /* -+ * convert mib index to oid index -+ */ -+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid); -+ if (0 != dot3StatsTable_index_to_oid(&rowreq_ctx->oid_idx, -+ &rowreq_ctx->tbl_idx)) { -+ return MFD_ERROR; -+ } -+ -+ return MFD_SUCCESS; -+} /* dot3StatsTable_indexes_set */ -+ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsAlignmentErrors -+ * dot3StatsAlignmentErrors is subid 2 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.2 -+ * Description: -+A count of frames received on a particular -+ interface that are not an integral number of -+ octets in length and do not pass the FCS check. -+ -+ The count represented by an instance of this -+ object is incremented when the alignmentError -+ status is returned by the MAC service to the -+ LLC (or other MAC user). Received frames for -+ which multiple error conditions pertain are, -+ according to the conventions of IEEE 802.3 -+ Layer Management, counted exclusively according -+ -+ to the error status presented to the LLC. -+ -+ This counter does not increment for group -+ encoding schemes greater than 4 bits per group. -+ -+ For interfaces operating at 10 Gb/s, this -+ counter can roll over in less than 5 minutes if -+ it is incrementing at its maximum rate. Since -+ that amount of time could be less than a -+ management station's poll cycle time, in order -+ to avoid a loss of information, a management -+ station is advised to poll the -+ dot3HCStatsAlignmentErrors object for 10 Gb/s -+ or faster interfaces. -+ -+ 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 ifCounterDiscontinuityTime. -+ * -+ * 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 dot3StatsAlignmentErrors data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsAlignmentErrors_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 -+dot3StatsAlignmentErrors_get(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * dot3StatsAlignmentErrors_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsAlignmentErrors_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsAlignmentErrors_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsAlignmentErrors data. -+ * copy (* dot3StatsAlignmentErrors_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsAlignmentErrors_val_ptr) = -+ rowreq_ctx->data.dot3StatsAlignmentErrors; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsAlignmentErrors_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsFCSErrors -+ * dot3StatsFCSErrors is subid 3 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.3 -+ * Description: -+A count of frames received on a particular -+ interface that are an integral number of octets -+ in length but do not pass the FCS check. This -+ count does not include frames received with -+ frame-too-long or frame-too-short error. -+ -+ The count represented by an instance of this -+ object is incremented when the frameCheckError -+ status is returned by the MAC service to the -+ LLC (or other MAC user). Received frames for -+ which multiple error conditions pertain are, -+ according to the conventions of IEEE 802.3 -+ Layer Management, counted exclusively according -+ to the error status presented to the LLC. -+ -+ Note: Coding errors detected by the physical -+ layer for speeds above 10 Mb/s will cause the -+ frame to fail the FCS check. -+ -+ For interfaces operating at 10 Gb/s, this -+ counter can roll over in less than 5 minutes if -+ -+ it is incrementing at its maximum rate. Since -+ that amount of time could be less than a -+ management station's poll cycle time, in order -+ to avoid a loss of information, a management -+ station is advised to poll the -+ dot3HCStatsFCSErrors object for 10 Gb/s or -+ faster interfaces. -+ -+ 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 ifCounterDiscontinuityTime. -+ * -+ * 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 dot3StatsFCSErrors data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsFCSErrors_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 -+dot3StatsFCSErrors_get(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * dot3StatsFCSErrors_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsFCSErrors_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsFCSErrors_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsFCSErrors data. -+ * copy (* dot3StatsFCSErrors_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsFCSErrors_val_ptr) = rowreq_ctx->data.dot3StatsFCSErrors; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsFCSErrors_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsSingleCollisionFrames -+ * dot3StatsSingleCollisionFrames is subid 4 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.4 -+ * Description: -+A count of frames that are involved in a single -+ collision, and are subsequently transmitted -+ successfully. -+ -+ A frame that is counted by an instance of this -+ object is also counted by the corresponding -+ instance of either the ifOutUcastPkts, -+ ifOutMulticastPkts, or ifOutBroadcastPkts, -+ and is not counted by the corresponding -+ instance of the dot3StatsMultipleCollisionFrames -+ object. -+ -+ This counter does not increment when the -+ interface is operating in full-duplex mode. -+ -+ 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 ifCounterDiscontinuityTime. -+ * -+ * 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 dot3StatsSingleCollisionFrames data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsSingleCollisionFrames_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 -+dot3StatsSingleCollisionFrames_get(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * -+ dot3StatsSingleCollisionFrames_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsSingleCollisionFrames_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsSingleCollisionFrames_get", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsSingleCollisionFrames data. -+ * copy (* dot3StatsSingleCollisionFrames_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsSingleCollisionFrames_val_ptr) = -+ rowreq_ctx->data.dot3StatsSingleCollisionFrames; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsSingleCollisionFrames_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsMultipleCollisionFrames -+ * dot3StatsMultipleCollisionFrames is subid 5 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.5 -+ * Description: -+A count of frames that are involved in more -+ -+ than one collision and are subsequently -+ transmitted successfully. -+ -+ A frame that is counted by an instance of this -+ object is also counted by the corresponding -+ instance of either the ifOutUcastPkts, -+ ifOutMulticastPkts, or ifOutBroadcastPkts, -+ and is not counted by the corresponding -+ instance of the dot3StatsSingleCollisionFrames -+ object. -+ -+ This counter does not increment when the -+ interface is operating in full-duplex mode. -+ -+ 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 ifCounterDiscontinuityTime. -+ * -+ * 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 dot3StatsMultipleCollisionFrames data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsMultipleCollisionFrames_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 -+dot3StatsMultipleCollisionFrames_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsMultipleCollisionFrames_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsMultipleCollisionFrames_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsMultipleCollisionFrames_get", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsMultipleCollisionFrames data. -+ * copy (* dot3StatsMultipleCollisionFrames_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsMultipleCollisionFrames_val_ptr) = -+ rowreq_ctx->data.dot3StatsMultipleCollisionFrames; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsMultipleCollisionFrames_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsSQETestErrors -+ * dot3StatsSQETestErrors is subid 6 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.6 -+ * Description: -+A count of times that the SQE TEST ERROR -+ is received on a particular interface. The -+ SQE TEST ERROR is set in accordance with the -+ rules for verification of the SQE detection -+ mechanism in the PLS Carrier Sense Function as -+ described in IEEE Std. 802.3, 2000 Edition, -+ section 7.2.4.6. -+ -+ This counter does not increment on interfaces -+ operating at speeds greater than 10 Mb/s, or on -+ interfaces operating in full-duplex mode. -+ -+ 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 ifCounterDiscontinuityTime. -+ * -+ * 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 dot3StatsSQETestErrors data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsSQETestErrors_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 -+dot3StatsSQETestErrors_get(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * dot3StatsSQETestErrors_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsSQETestErrors_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsSQETestErrors_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsSQETestErrors data. -+ * copy (* dot3StatsSQETestErrors_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsSQETestErrors_val_ptr) = -+ rowreq_ctx->data.dot3StatsSQETestErrors; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsSQETestErrors_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsDeferredTransmissions -+ * dot3StatsDeferredTransmissions is subid 7 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.7 -+ * Description: -+A count of frames for which the first -+ transmission attempt on a particular interface -+ is delayed because the medium is busy. -+ -+ The count represented by an instance of this -+ object does not include frames involved in -+ collisions. -+ -+ This counter does not increment when the -+ interface is operating in full-duplex mode. -+ -+ 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 ifCounterDiscontinuityTime. -+ * -+ * 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 dot3StatsDeferredTransmissions data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsDeferredTransmissions_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 -+dot3StatsDeferredTransmissions_get(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * -+ dot3StatsDeferredTransmissions_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsDeferredTransmissions_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsDeferredTransmissions_get", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsDeferredTransmissions data. -+ * copy (* dot3StatsDeferredTransmissions_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsDeferredTransmissions_val_ptr) = -+ rowreq_ctx->data.dot3StatsDeferredTransmissions; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsDeferredTransmissions_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsLateCollisions -+ * dot3StatsLateCollisions is subid 8 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.8 -+ * Description: -+The number of times that a collision is -+ detected on a particular interface later than -+ one slotTime into the transmission of a packet. -+ -+ A (late) collision included in a count -+ represented by an instance of this object is -+ also considered as a (generic) collision for -+ purposes of other collision-related -+ statistics. -+ -+ This counter does not increment when the -+ interface is operating in full-duplex mode. -+ -+ 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 ifCounterDiscontinuityTime. -+ * -+ * 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 dot3StatsLateCollisions data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsLateCollisions_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 -+dot3StatsLateCollisions_get(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * dot3StatsLateCollisions_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsLateCollisions_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsLateCollisions_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsLateCollisions data. -+ * copy (* dot3StatsLateCollisions_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsLateCollisions_val_ptr) = -+ rowreq_ctx->data.dot3StatsLateCollisions; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsLateCollisions_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsExcessiveCollisions -+ * dot3StatsExcessiveCollisions is subid 9 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.9 -+ * Description: -+A count of frames for which transmission on a -+ particular interface fails due to excessive -+ collisions. -+ -+ This counter does not increment when the -+ interface is operating in full-duplex mode. -+ -+ 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 ifCounterDiscontinuityTime. -+ * -+ * 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 dot3StatsExcessiveCollisions data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsExcessiveCollisions_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 -+dot3StatsExcessiveCollisions_get(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * -+ dot3StatsExcessiveCollisions_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsExcessiveCollisions_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsExcessiveCollisions_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsExcessiveCollisions data. -+ * copy (* dot3StatsExcessiveCollisions_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsExcessiveCollisions_val_ptr) = -+ rowreq_ctx->data.dot3StatsExcessiveCollisions; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsExcessiveCollisions_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsInternalMacTransmitErrors -+ * dot3StatsInternalMacTransmitErrors is subid 10 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.10 -+ * Description: -+A count of frames for which transmission on a -+ particular interface fails due to an internal -+ MAC sublayer transmit error. A frame is only -+ counted by an instance of this object if it is -+ not counted by the corresponding instance of -+ either the dot3StatsLateCollisions object, the -+ dot3StatsExcessiveCollisions object, or the -+ dot3StatsCarrierSenseErrors object. -+ -+ The precise meaning of the count represented by -+ an instance of this object is implementation- -+ specific. In particular, an instance of this -+ object may represent a count of transmission -+ errors on a particular interface that are not -+ otherwise counted. -+ -+ For interfaces operating at 10 Gb/s, this -+ counter can roll over in less than 5 minutes if -+ it is incrementing at its maximum rate. Since -+ that amount of time could be less than a -+ management station's poll cycle time, in order -+ to avoid a loss of information, a management -+ station is advised to poll the -+ dot3HCStatsInternalMacTransmitErrors object for -+ 10 Gb/s or faster interfaces. -+ -+ 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 ifCounterDiscontinuityTime. -+ * -+ * 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 dot3StatsInternalMacTransmitErrors data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsInternalMacTransmitErrors_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 -+dot3StatsInternalMacTransmitErrors_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsInternalMacTransmitErrors_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsInternalMacTransmitErrors_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsInternalMacTransmitErrors_get", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsInternalMacTransmitErrors data. -+ * copy (* dot3StatsInternalMacTransmitErrors_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsInternalMacTransmitErrors_val_ptr) = -+ rowreq_ctx->data.dot3StatsInternalMacTransmitErrors; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsInternalMacTransmitErrors_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsCarrierSenseErrors -+ * dot3StatsCarrierSenseErrors is subid 11 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.11 -+ * Description: -+The number of times that the carrier sense -+ condition was lost or never asserted when -+ attempting to transmit a frame on a particular -+ interface. -+ -+ The count represented by an instance of this -+ object is incremented at most once per -+ transmission attempt, even if the carrier sense -+ condition fluctuates during a transmission -+ attempt. -+ -+ This counter does not increment when the -+ interface is operating in full-duplex mode. -+ -+ 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 ifCounterDiscontinuityTime. -+ * -+ * 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 dot3StatsCarrierSenseErrors data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsCarrierSenseErrors_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 -+dot3StatsCarrierSenseErrors_get(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * -+ dot3StatsCarrierSenseErrors_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsCarrierSenseErrors_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsCarrierSenseErrors_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsCarrierSenseErrors data. -+ * copy (* dot3StatsCarrierSenseErrors_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsCarrierSenseErrors_val_ptr) = -+ rowreq_ctx->data.dot3StatsCarrierSenseErrors; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsCarrierSenseErrors_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsFrameTooLongs -+ * dot3StatsFrameTooLongs is subid 13 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.13 -+ * Description: -+A count of frames received on a particular -+ interface that exceed the maximum permitted -+ frame size. -+ -+ The count represented by an instance of this -+ object is incremented when the frameTooLong -+ status is returned by the MAC service to the -+ LLC (or other MAC user). Received frames for -+ which multiple error conditions pertain are, -+ according to the conventions of IEEE 802.3 -+ Layer Management, counted exclusively according -+ to the error status presented to the LLC. -+ -+ For interfaces operating at 10 Gb/s, this -+ counter can roll over in less than 80 minutes if -+ it is incrementing at its maximum rate. Since -+ that amount of time could be less than a -+ management station's poll cycle time, in order -+ to avoid a loss of information, a management -+ station is advised to poll the -+ dot3HCStatsFrameTooLongs object for 10 Gb/s -+ or faster interfaces. -+ -+ 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 ifCounterDiscontinuityTime. -+ * -+ * 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 dot3StatsFrameTooLongs data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsFrameTooLongs_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 -+dot3StatsFrameTooLongs_get(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * dot3StatsFrameTooLongs_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsFrameTooLongs_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsFrameTooLongs_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsFrameTooLongs data. -+ * copy (* dot3StatsFrameTooLongs_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsFrameTooLongs_val_ptr) = -+ rowreq_ctx->data.dot3StatsFrameTooLongs; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsFrameTooLongs_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsInternalMacReceiveErrors -+ * dot3StatsInternalMacReceiveErrors is subid 16 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.16 -+ * Description: -+A count of frames for which reception on a -+ particular interface fails due to an internal -+ MAC sublayer receive error. A frame is only -+ counted by an instance of this object if it is -+ not counted by the corresponding instance of -+ either the dot3StatsFrameTooLongs object, the -+ dot3StatsAlignmentErrors object, or the -+ dot3StatsFCSErrors object. -+ -+ The precise meaning of the count represented by -+ an instance of this object is implementation- -+ specific. In particular, an instance of this -+ object may represent a count of receive errors -+ on a particular interface that are not -+ otherwise counted. -+ -+ For interfaces operating at 10 Gb/s, this -+ counter can roll over in less than 5 minutes if -+ -+ it is incrementing at its maximum rate. Since -+ that amount of time could be less than a -+ management station's poll cycle time, in order -+ to avoid a loss of information, a management -+ station is advised to poll the -+ dot3HCStatsInternalMacReceiveErrors object for -+ 10 Gb/s or faster interfaces. -+ -+ 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 ifCounterDiscontinuityTime. -+ * -+ * 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 dot3StatsInternalMacReceiveErrors data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsInternalMacReceiveErrors_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 -+dot3StatsInternalMacReceiveErrors_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsInternalMacReceiveErrors_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsInternalMacReceiveErrors_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsInternalMacReceiveErrors_get", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsInternalMacReceiveErrors data. -+ * copy (* dot3StatsInternalMacReceiveErrors_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsInternalMacReceiveErrors_val_ptr) = -+ rowreq_ctx->data.dot3StatsInternalMacReceiveErrors; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsInternalMacReceiveErrors_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsEtherChipSet -+ * dot3StatsEtherChipSet is subid 17 of dot3StatsEntry. -+ * Its status is Deprecated, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.17 -+ * Description: -+******** THIS OBJECT IS DEPRECATED ******** -+ -+ This object contains an OBJECT IDENTIFIER -+ which identifies the chipset used to -+ realize the interface. Ethernet-like -+ interfaces are typically built out of -+ several different chips. The MIB implementor -+ is presented with a decision of which chip -+ to identify via this object. The implementor -+ should identify the chip which is usually -+ called the Medium Access Control chip. -+ If no such chip is easily identifiable, -+ the implementor should identify the chip -+ which actually gathers the transmit -+ and receive statistics and error -+ indications. This would allow a -+ manager station to correlate the -+ statistics and the chip generating -+ them, giving it the ability to take -+ into account any known anomalies -+ in the chip. -+ -+ This object has been deprecated. Implementation -+ feedback indicates that it is of limited use for -+ debugging network problems in the field, and -+ the administrative overhead involved in -+ maintaining a registry of chipset OIDs is not -+ justified. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 0 -+ * settable 0 -+ * -+ * -+ * Its syntax is OBJECTID (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 dot3StatsEtherChipSet data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsEtherChipSet_val_ptr_ptr -+ * Pointer to storage for a oid variable -+ * @param dot3StatsEtherChipSet_val_ptr_len_ptr -+ * Pointer to a size_t. On entry, it will contain the size (in bytes) -+ * pointed to by dot3StatsEtherChipSet. -+ * 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 (*dot3StatsEtherChipSet_val_ptr_len_ptr) bytes of memory, -+ * allocate it using malloc() and update dot3StatsEtherChipSet_val_ptr_ptr. -+ * DO NOT 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 -+dot3StatsEtherChipSet_get(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ oid ** dot3StatsEtherChipSet_val_ptr_ptr, -+ size_t *dot3StatsEtherChipSet_val_ptr_len_ptr) -+{ -+ /** we should have a non-NULL pointer and enough storage */ -+ netsnmp_assert((NULL != dot3StatsEtherChipSet_val_ptr_ptr) -+ && (NULL != *dot3StatsEtherChipSet_val_ptr_ptr)); -+ netsnmp_assert(NULL != dot3StatsEtherChipSet_val_ptr_len_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsEtherChipSet_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsEtherChipSet data. -+ * copy (* dot3StatsEtherChipSet_val_ptr_ptr ) data and (* dot3StatsEtherChipSet_val_ptr_len_ptr ) from rowreq_ctx->data -+ */ -+ /* -+ * make sure there is enough space for dot3StatsEtherChipSet data -+ */ -+ if ((NULL == (*dot3StatsEtherChipSet_val_ptr_ptr)) || -+ ((*dot3StatsEtherChipSet_val_ptr_len_ptr) < -+ (rowreq_ctx->data.dot3StatsEtherChipSet_len * -+ sizeof(rowreq_ctx->data.dot3StatsEtherChipSet[0])))) { -+ /* -+ * allocate space for dot3StatsEtherChipSet data -+ */ -+ (*dot3StatsEtherChipSet_val_ptr_ptr) = -+ malloc(rowreq_ctx->data.dot3StatsEtherChipSet_len * -+ sizeof(rowreq_ctx->data.dot3StatsEtherChipSet[0])); -+ if (NULL == (*dot3StatsEtherChipSet_val_ptr_ptr)) { -+ snmp_log(LOG_ERR, "could not allocate memory\n"); -+ return MFD_ERROR; -+ } -+ } -+ (*dot3StatsEtherChipSet_val_ptr_len_ptr) = -+ rowreq_ctx->data.dot3StatsEtherChipSet_len * -+ sizeof(rowreq_ctx->data.dot3StatsEtherChipSet[0]); -+ memcpy((*dot3StatsEtherChipSet_val_ptr_ptr), -+ rowreq_ctx->data.dot3StatsEtherChipSet, -+ rowreq_ctx->data.dot3StatsEtherChipSet_len * -+ sizeof(rowreq_ctx->data.dot3StatsEtherChipSet[0])); -+ -+ return MFD_SUCCESS; -+} /* dot3StatsEtherChipSet_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsSymbolErrors -+ * dot3StatsSymbolErrors is subid 18 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.18 -+ * Description: -+For an interface operating at 100 Mb/s, the -+ number of times there was an invalid data symbol -+ when a valid carrier was present. -+ -+ For an interface operating in half-duplex mode -+ at 1000 Mb/s, the number of times the receiving -+ media is non-idle (a carrier event) for a period -+ of time equal to or greater than slotTime, and -+ during which there was at least one occurrence -+ of an event that causes the PHY to indicate -+ 'Data reception error' or 'carrier extend error' -+ on the GMII. -+ -+ For an interface operating in full-duplex mode -+ at 1000 Mb/s, the number of times the receiving -+ media is non-idle (a carrier event) for a period -+ of time equal to or greater than minFrameSize, -+ and during which there was at least one -+ occurrence of an event that causes the PHY to -+ indicate 'Data reception error' on the GMII. -+ -+ For an interface operating at 10 Gb/s, the -+ number of times the receiving media is non-idle -+ (a carrier event) for a period of time equal to -+ or greater than minFrameSize, and during which -+ there was at least one occurrence of an event -+ that causes the PHY to indicate 'Receive Error' -+ on the XGMII. -+ -+ The count represented by an instance of this -+ object is incremented at most once per carrier -+ event, even if multiple symbol errors occur -+ during the carrier event. This count does -+ not increment if a collision is present. -+ -+ This counter does not increment when the -+ interface is operating at 10 Mb/s. -+ -+ For interfaces operating at 10 Gb/s, this -+ counter can roll over in less than 5 minutes if -+ it is incrementing at its maximum rate. Since -+ that amount of time could be less than a -+ -+ management station's poll cycle time, in order -+ to avoid a loss of information, a management -+ station is advised to poll the -+ dot3HCStatsSymbolErrors object for 10 Gb/s -+ or faster interfaces. -+ -+ 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 ifCounterDiscontinuityTime. -+ * -+ * 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 dot3StatsSymbolErrors data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsSymbolErrors_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 -+dot3StatsSymbolErrors_get(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * dot3StatsSymbolErrors_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsSymbolErrors_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsSymbolErrors_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsSymbolErrors data. -+ * copy (* dot3StatsSymbolErrors_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsSymbolErrors_val_ptr) = -+ rowreq_ctx->data.dot3StatsSymbolErrors; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsSymbolErrors_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsDuplexStatus -+ * dot3StatsDuplexStatus is subid 19 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.19 -+ * Description: -+The current mode of operation of the MAC -+ entity. 'unknown' indicates that the current -+ duplex mode could not be determined. -+ -+ Management control of the duplex mode is -+ accomplished through the MAU MIB. When -+ an interface does not support autonegotiation, -+ or when autonegotiation is not enabled, the -+ duplex mode is controlled using -+ ifMauDefaultType. When autonegotiation is -+ supported and enabled, duplex mode is controlled -+ using ifMauAutoNegAdvertisedBits. In either -+ case, the currently operating duplex mode is -+ reflected both in this object and in ifMauType. -+ -+ Note that this object provides redundant -+ information with ifMauType. Normally, redundant -+ objects are discouraged. However, in this -+ instance, it allows a management application to -+ determine the duplex status of an interface -+ without having to know every possible value of -+ ifMauType. This was felt to be sufficiently -+ valuable to justify the redundancy. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 1 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 0 -+ * settable 0 -+ * -+ * Enum range: 3/8. Values: unknown(1), halfDuplex(2), fullDuplex(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 dot3StatsDuplexStatus data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsDuplexStatus_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 -+dot3StatsDuplexStatus_get(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * dot3StatsDuplexStatus_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsDuplexStatus_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsDuplexStatus_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsDuplexStatus data. -+ * copy (* dot3StatsDuplexStatus_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsDuplexStatus_val_ptr) = -+ rowreq_ctx->data.dot3StatsDuplexStatus; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsDuplexStatus_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsRateControlAbility -+ * dot3StatsRateControlAbility is subid 20 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.20 -+ * Description: -+'true' for interfaces operating at speeds above -+ 1000 Mb/s that support Rate Control through -+ lowering the average data rate of the MAC -+ sublayer, with frame granularity, and 'false' -+ otherwise. -+ * -+ * 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 dot3StatsRateControlAbility data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsRateControlAbility_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 -+dot3StatsRateControlAbility_get(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * -+ dot3StatsRateControlAbility_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsRateControlAbility_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsRateControlAbility_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsRateControlAbility data. -+ * copy (* dot3StatsRateControlAbility_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsRateControlAbility_val_ptr) = -+ rowreq_ctx->data.dot3StatsRateControlAbility; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsRateControlAbility_get */ -+ -+/*--------------------------------------------------------------------- -+ * EtherLike-MIB::dot3StatsEntry.dot3StatsRateControlStatus -+ * dot3StatsRateControlStatus is subid 21 of dot3StatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.10.7.2.1.21 -+ * Description: -+The current Rate Control mode of operation of -+ the MAC sublayer of this interface. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 1 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 0 -+ * settable 0 -+ * -+ * Enum range: 3/8. Values: rateControlOff(1), rateControlOn(2), unknown(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 dot3StatsRateControlStatus data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param dot3StatsRateControlStatus_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 -+dot3StatsRateControlStatus_get(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * dot3StatsRateControlStatus_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != dot3StatsRateControlStatus_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsRateControlStatus_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the dot3StatsRateControlStatus data. -+ * copy (* dot3StatsRateControlStatus_val_ptr ) from rowreq_ctx->data -+ */ -+ (*dot3StatsRateControlStatus_val_ptr) = -+ rowreq_ctx->data.dot3StatsRateControlStatus; -+ -+ return MFD_SUCCESS; -+} /* dot3StatsRateControlStatus_get */ -+ -+ -+ -+/** @} */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.h net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.h ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_get.h 2008-08-08 05:58:09.000000000 -0400 -@@ -0,0 +1,143 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 12088 $ of $ -+ * -+ * $Id:$ -+ * -+ * @file dot3StatsTable_data_get.h -+ * -+ * @addtogroup get -+ * -+ * Prototypes for get functions -+ * -+ * @{ -+ */ -+#ifndef DOT3STATSTABLE_DATA_GET_H -+#define DOT3STATSTABLE_DATA_GET_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ /* -+ ********************************************************************* -+ * GET function declarations -+ */ -+ -+ /* -+ ********************************************************************* -+ * GET Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table dot3StatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * EtherLike-MIB::dot3StatsTable is subid 2 of dot3. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.10.7.2, length: 9 -+ */ -+ /* -+ * indexes -+ */ -+ -+ int dot3StatsAlignmentErrors_get(dot3StatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long * -+ dot3StatsAlignmentErrors_val_ptr); -+ int dot3StatsFCSErrors_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsFCSErrors_val_ptr); -+ int -+ dot3StatsSingleCollisionFrames_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsSingleCollisionFrames_val_ptr); -+ int -+ dot3StatsMultipleCollisionFrames_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsMultipleCollisionFrames_val_ptr); -+ int dot3StatsSQETestErrors_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsSQETestErrors_val_ptr); -+ int -+ dot3StatsDeferredTransmissions_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsDeferredTransmissions_val_ptr); -+ int dot3StatsLateCollisions_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsLateCollisions_val_ptr); -+ int -+ dot3StatsExcessiveCollisions_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsExcessiveCollisions_val_ptr); -+ int -+ dot3StatsInternalMacTransmitErrors_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsInternalMacTransmitErrors_val_ptr); -+ int -+ dot3StatsCarrierSenseErrors_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsCarrierSenseErrors_val_ptr); -+ int dot3StatsFrameTooLongs_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsFrameTooLongs_val_ptr); -+ int -+ dot3StatsInternalMacReceiveErrors_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsInternalMacReceiveErrors_val_ptr); -+ int dot3StatsEtherChipSet_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ oid ** -+ dot3StatsEtherChipSet_val_ptr_ptr, -+ size_t -+ *dot3StatsEtherChipSet_val_ptr_len_ptr); -+ int dot3StatsSymbolErrors_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsSymbolErrors_val_ptr); -+ int dot3StatsDuplexStatus_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsDuplexStatus_val_ptr); -+ int -+ dot3StatsRateControlAbility_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsRateControlAbility_val_ptr); -+ int -+ dot3StatsRateControlStatus_get(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ dot3StatsRateControlStatus_val_ptr); -+ -+ -+ int -+ dot3StatsTable_indexes_set_tbl_idx(dot3StatsTable_mib_index * -+ tbl_idx, -+ long dot3StatsIndex_val); -+ int dot3StatsTable_indexes_set(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, -+ long dot3StatsIndex_val); -+ -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* DOT3STATSTABLE_DATA_GET_H */ -+/** @} */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.c net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.c ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.c 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.c 2008-08-08 05:58:09.000000000 -0400 -@@ -0,0 +1,28 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 12077 $ of $ -+ * -+ * $Id:$ -+ * -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "dot3StatsTable.h" -+ -+ -+/** @defgroup data_set data_set: Routines to set data -+ * -+ * These routines are used to set the value for individual objects. The -+ * row context is passed, along with the new value. -+ * -+ * @{ -+ */ -+/** @} */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.h net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.h ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_set.h 2008-08-08 05:58:09.000000000 -0400 -@@ -0,0 +1,28 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 12077 $ of $ -+ * -+ * $Id:$ -+ */ -+#ifndef DOT3STATSTABLE_DATA_SET_H -+#define DOT3STATSTABLE_DATA_SET_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ /* -+ ********************************************************************* -+ * SET function declarations -+ */ -+ -+ /* -+ ********************************************************************* -+ * SET Table declarations -+ */ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* DOT3STATSTABLE_DATA_SET_H */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_enums.h net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_enums.h ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_enums.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_enums.h 2008-08-08 05:58:09.000000000 -0400 -@@ -0,0 +1,89 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $ -+ * -+ * $Id:$ -+ */ -+#ifndef DOT3STATSTABLE_ENUMS_H -+#define DOT3STATSTABLE_ENUMS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ /* -+ * 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 dot3StatsTable -+ * -+ ************************************************************************* -+ *************************************************************************/ -+ -+/************************************************************* -+ * constants for enums for the MIB node -+ * dot3StatsDuplexStatus (INTEGER / ASN_INTEGER) -+ * -+ * since a Textual Convention may be referenced more than once in a -+ * MIB, protect againt redefinitions of the enum values. -+ */ -+#ifndef DOT3STATSDUPLEXSTATUS_ENUMS -+#define DOT3STATSDUPLEXSTATUS_ENUMS -+ -+#define DOT3STATSDUPLEXSTATUS_UNKNOWN 1 -+#define DOT3STATSDUPLEXSTATUS_HALFDUPLEX 2 -+#define DOT3STATSDUPLEXSTATUS_FULLDUPLEX 3 -+ -+#endif /* DOT3STATSDUPLEXSTATUS_ENUMS */ -+ -+ -+/************************************************************* -+ * constants for enums for the MIB node -+ * dot3StatsRateControlAbility (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 -+ * dot3StatsRateControlStatus (INTEGER / ASN_INTEGER) -+ * -+ * since a Textual Convention may be referenced more than once in a -+ * MIB, protect againt redefinitions of the enum values. -+ */ -+#ifndef DOT3STATSRATECONTROLSTATUS_ENUMS -+#define DOT3STATSRATECONTROLSTATUS_ENUMS -+ -+#define DOT3STATSRATECONTROLSTATUS_RATECONTROLOFF 1 -+#define DOT3STATSRATECONTROLSTATUS_RATECONTROLON 2 -+#define DOT3STATSRATECONTROLSTATUS_UNKNOWN 3 -+ -+#endif /* DOT3STATSRATECONTROLSTATUS_ENUMS */ -+ -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* DOT3STATSTABLE_ENUMS_H */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.h net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.h ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable.h 2008-09-09 12:09:11.000000000 -0400 -@@ -0,0 +1,271 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+#ifndef DOT3STATSTABLE_H -+#define DOT3STATSTABLE_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+/** @addtogroup misc misc: Miscellaneous routines -+ * -+ * @{ -+ */ -+#include -+ -+ /* -+ * OID and column number definitions for dot3StatsTable -+ */ -+#include "dot3StatsTable_oids.h" -+ -+ /* -+ * enum definions -+ */ -+#include "dot3StatsTable_enums.h" -+ -+ /* -+ ********************************************************************* -+ * function declarations -+ */ -+ void init_dot3StatsTable(void); -+ void shutdown_dot3StatsTable(void); -+ -+ /* -+ ********************************************************************* -+ * Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table dot3StatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * EtherLike-MIB::dot3StatsTable is subid 2 of dot3. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.10.7.2, 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 dot3StatsTable registration context. -+ */ -+ typedef netsnmp_data_list dot3StatsTable_registration; -+ -+/**********************************************************************/ -+ /* -+ * TODO:110:r: |-> Review dot3StatsTable data context structure. -+ * This structure is used to represent the data for dot3StatsTable. -+ */ -+ /* -+ * This structure contains storage for all the columns defined in the -+ * dot3StatsTable. -+ */ -+ typedef struct dot3StatsTable_data_s { -+ -+ /* -+ * dot3StatsAlignmentErrors(2)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long dot3StatsAlignmentErrors; -+ -+ /* -+ * dot3StatsFCSErrors(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long dot3StatsFCSErrors; -+ -+ /* -+ * dot3StatsSingleCollisionFrames(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long dot3StatsSingleCollisionFrames; -+ -+ /* -+ * dot3StatsMultipleCollisionFrames(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long dot3StatsMultipleCollisionFrames; -+ -+ /* -+ * dot3StatsSQETestErrors(6)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long dot3StatsSQETestErrors; -+ -+ /* -+ * dot3StatsDeferredTransmissions(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long dot3StatsDeferredTransmissions; -+ -+ /* -+ * dot3StatsLateCollisions(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long dot3StatsLateCollisions; -+ -+ /* -+ * dot3StatsExcessiveCollisions(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long dot3StatsExcessiveCollisions; -+ -+ /* -+ * dot3StatsInternalMacTransmitErrors(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long dot3StatsInternalMacTransmitErrors; -+ -+ /* -+ * dot3StatsCarrierSenseErrors(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long dot3StatsCarrierSenseErrors; -+ -+ /* -+ * dot3StatsFrameTooLongs(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long dot3StatsFrameTooLongs; -+ -+ /* -+ * dot3StatsInternalMacReceiveErrors(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long dot3StatsInternalMacReceiveErrors; -+ -+ /* -+ * dot3StatsEtherChipSet(17)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h -+ */ -+ oid dot3StatsEtherChipSet[128]; -+ size_t dot3StatsEtherChipSet_len; /* # of oid elements, not bytes */ -+ -+ /* -+ * dot3StatsSymbolErrors(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long dot3StatsSymbolErrors; -+ -+ /* -+ * dot3StatsDuplexStatus(19)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h -+ */ -+ u_long dot3StatsDuplexStatus; -+ -+ /* -+ * dot3StatsRateControlAbility(20)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h -+ */ -+ u_long dot3StatsRateControlAbility; -+ -+ /* -+ * dot3StatsRateControlStatus(21)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h -+ */ -+ u_long dot3StatsRateControlStatus; -+ -+ } dot3StatsTable_data; -+ -+ -+ /* -+ * TODO:120:r: |-> Review dot3StatsTable mib index. -+ * This structure is used to represent the index for dot3StatsTable. -+ */ -+ typedef struct dot3StatsTable_mib_index_s { -+ -+ /* -+ * dot3StatsIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H -+ */ -+ long dot3StatsIndex; -+ -+ -+ } dot3StatsTable_mib_index; -+ -+ /* -+ * TODO:121:r: | |-> Review dot3StatsTable max index length. -+ * If you KNOW that your indexes will never exceed a certain -+ * length, update this macro to that length. -+ */ -+#define MAX_dot3StatsTable_IDX_LEN 255 -+ -+ -+ /* -+ ********************************************************************* -+ * TODO:130:o: |-> Review dot3StatsTable Row request (rowreq) context. -+ * When your functions are called, you will be passed a -+ * dot3StatsTable_rowreq_ctx pointer. -+ */ -+ typedef struct dot3StatsTable_rowreq_ctx_s { -+ -+ /** this must be first for container compare to work */ -+ netsnmp_index oid_idx; -+ oid oid_tmp[MAX_dot3StatsTable_IDX_LEN]; -+ -+ dot3StatsTable_mib_index tbl_idx; -+ -+ dot3StatsTable_data data; -+ unsigned int column_exists_flags; /* flags for existence */ -+ -+ /* -+ * 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 dot3StatsTable rowreq context. -+ */ -+ -+ /* -+ * storage for future expansion -+ */ -+ netsnmp_data_list *dot3StatsTable_data_list; -+ -+ } dot3StatsTable_rowreq_ctx; -+ -+ typedef struct dot3StatsTable_ref_rowreq_ctx_s { -+ dot3StatsTable_rowreq_ctx *rowreq_ctx; -+ } dot3StatsTable_ref_rowreq_ctx; -+ -+ /* -+ ********************************************************************* -+ * function prototypes -+ */ -+ int dot3StatsTable_pre_request(dot3StatsTable_registration -+ * user_context); -+ int dot3StatsTable_post_request(dot3StatsTable_registration -+ * user_context, int rc); -+ -+ int -+ dot3StatsTable_rowreq_ctx_init(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx, void *user_init_ctx); -+ void -+ dot3StatsTable_rowreq_ctx_cleanup(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ -+ dot3StatsTable_rowreq_ctx -+ *dot3StatsTable_row_find_by_mib_index(dot3StatsTable_mib_index * -+ mib_idx); -+ -+ extern oid dot3StatsTable_oid[]; -+ extern int dot3StatsTable_oid_size; -+ -+ -+#include "dot3StatsTable_interface.h" -+#include "dot3StatsTable_data_access.h" -+#include "dot3StatsTable_data_get.h" -+#include "dot3StatsTable_data_set.h" -+ -+ /* -+ * DUMMY markers, ignore -+ * -+ * TODO:099:x: ************************************************************* -+ * TODO:199:x: ************************************************************* -+ * TODO:299:x: ************************************************************* -+ * TODO:399:x: ************************************************************* -+ * TODO:499:x: ************************************************************* -+ */ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* DOT3STATSTABLE_H */ -+/** @} */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.c net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.c ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.c 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.c 2008-09-12 14:18:46.000000000 -0400 -@@ -0,0 +1,1188 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 15899 $ of $ -+ * -+ * $Id:$ -+ */ -+/* -+ * ********************************************************************* -+ * ********************************************************************* -+ * ********************************************************************* -+ * *** *** -+ * *** 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 -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "dot3StatsTable.h" -+ -+ -+#include -+#include -+ -+#include "dot3StatsTable_interface.h" -+ -+#include -+ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table dot3StatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * EtherLike-MIB::dot3StatsTable is subid 2 of dot3. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.10.7.2, length: 9 -+ */ -+typedef struct dot3StatsTable_interface_ctx_s { -+ -+ netsnmp_container *container; -+ netsnmp_cache *cache; -+ -+ dot3StatsTable_registration *user_ctx; -+ -+ netsnmp_table_registration_info tbl_info; -+ -+ netsnmp_baby_steps_access_methods access_multiplexer; -+ -+} dot3StatsTable_interface_ctx; -+ -+static dot3StatsTable_interface_ctx dot3StatsTable_if_ctx; -+ -+static void _dot3StatsTable_container_init(dot3StatsTable_interface_ctx -+ * if_ctx); -+static void -+_dot3StatsTable_container_shutdown(dot3StatsTable_interface_ctx * if_ctx); -+ -+ -+netsnmp_container * -+dot3StatsTable_container_get(void) -+{ -+ return dot3StatsTable_if_ctx.container; -+} -+ -+dot3StatsTable_registration * -+dot3StatsTable_registration_get(void) -+{ -+ return dot3StatsTable_if_ctx.user_ctx; -+} -+ -+dot3StatsTable_registration * -+dot3StatsTable_registration_set(dot3StatsTable_registration * newreg) -+{ -+ dot3StatsTable_registration *old = dot3StatsTable_if_ctx.user_ctx; -+ dot3StatsTable_if_ctx.user_ctx = newreg; -+ return old; -+} -+ -+int -+dot3StatsTable_container_size(void) -+{ -+ return CONTAINER_SIZE(dot3StatsTable_if_ctx.container); -+} -+ -+/* -+ * mfd multiplexer modes -+ */ -+static Netsnmp_Node_Handler _mfd_dot3StatsTable_pre_request; -+static Netsnmp_Node_Handler _mfd_dot3StatsTable_post_request; -+static Netsnmp_Node_Handler _mfd_dot3StatsTable_object_lookup; -+static Netsnmp_Node_Handler _mfd_dot3StatsTable_get_values; -+/** -+ * @internal -+ * Initialize the table dot3StatsTable -+ * (Define its contents and how it's structured) -+ */ -+void -+_dot3StatsTable_initialize_interface(dot3StatsTable_registration * reg_ptr, -+ u_long flags) -+{ -+ netsnmp_baby_steps_access_methods *access_multiplexer = -+ &dot3StatsTable_if_ctx.access_multiplexer; -+ netsnmp_table_registration_info *tbl_info = -+ &dot3StatsTable_if_ctx.tbl_info; -+ netsnmp_handler_registration *reginfo; -+ netsnmp_mib_handler *handler; -+ int mfd_modes = 0; -+ -+ DEBUGMSGTL(("internal:dot3StatsTable:_dot3StatsTable_initialize_interface", "called\n")); -+ -+ -+ /************************************************* -+ * -+ * save interface context for dot3StatsTable -+ */ -+ /* -+ * Setting up the table's definition -+ */ -+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER, -+ /** index: dot3StatsIndex */ -+ 0); -+ -+ /* -+ * Define the minimum and maximum accessible columns. This -+ * optimizes retrival. -+ */ -+ tbl_info->min_column = DOT3STATSTABLE_MIN_COL; -+ tbl_info->max_column = DOT3STATSTABLE_MAX_COL; -+ -+ /* -+ * save users context -+ */ -+ dot3StatsTable_if_ctx.user_ctx = reg_ptr; -+ -+ /* -+ * call data access initialization code -+ */ -+ dot3StatsTable_init_data(reg_ptr); -+ -+ /* -+ * set up the container -+ */ -+ _dot3StatsTable_container_init(&dot3StatsTable_if_ctx); -+ if (NULL == dot3StatsTable_if_ctx.container) { -+ snmp_log(LOG_ERR, -+ "could not initialize container for dot3StatsTable\n"); -+ return; -+ } -+ -+ /* -+ * access_multiplexer: REQUIRED wrapper for get request handling -+ */ -+ access_multiplexer->object_lookup = _mfd_dot3StatsTable_object_lookup; -+ access_multiplexer->get_values = _mfd_dot3StatsTable_get_values; -+ -+ /* -+ * no wrappers yet -+ */ -+ access_multiplexer->pre_request = _mfd_dot3StatsTable_pre_request; -+ access_multiplexer->post_request = _mfd_dot3StatsTable_post_request; -+ -+ -+ /************************************************* -+ * -+ * Create a registration, save our reg data, register table. -+ */ -+ DEBUGMSGTL(("dot3StatsTable:init_dot3StatsTable", -+ "Registering dot3StatsTable as a mibs-for-dummies table.\n")); -+ handler = -+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer); -+ reginfo = -+ netsnmp_handler_registration_create("dot3StatsTable", handler, -+ dot3StatsTable_oid, -+ dot3StatsTable_oid_size, -+ HANDLER_CAN_BABY_STEP | -+ HANDLER_CAN_RONLY); -+ if (NULL == reginfo) { -+ snmp_log(LOG_ERR, "error registering table dot3StatsTable\n"); -+ return; -+ } -+ reginfo->my_reg_void = &dot3StatsTable_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, -+ dot3StatsTable_if_ctx. -+ container, -+ TABLE_CONTAINER_KEY_NETSNMP_INDEX); -+ netsnmp_inject_handler(reginfo, handler); -+ -+ /************************************************* -+ * -+ * inject cache helper -+ */ -+ if (NULL != dot3StatsTable_if_ctx.cache) { -+ handler = netsnmp_cache_handler_get(dot3StatsTable_if_ctx.cache); -+ netsnmp_inject_handler(reginfo, handler); -+ } -+ -+ /* -+ * register table -+ */ -+ netsnmp_register_table(reginfo, tbl_info); -+ -+} /* _dot3StatsTable_initialize_interface */ -+ -+/** -+ * @internal -+ * Shutdown the table dot3StatsTable -+ */ -+void -+_dot3StatsTable_shutdown_interface(dot3StatsTable_registration * reg_ptr) -+{ -+ /* -+ * shutdown the container -+ */ -+ _dot3StatsTable_container_shutdown(&dot3StatsTable_if_ctx); -+} -+ -+void -+dot3StatsTable_valid_columns_set(netsnmp_column_info *vc) -+{ -+ dot3StatsTable_if_ctx.tbl_info.valid_columns = vc; -+} /* dot3StatsTable_valid_columns_set */ -+ -+/** -+ * @internal -+ * convert the index component stored in the context to an oid -+ */ -+int -+dot3StatsTable_index_to_oid(netsnmp_index * oid_idx, -+ dot3StatsTable_mib_index * mib_idx) -+{ -+ int err = SNMP_ERR_NOERROR; -+ -+ /* -+ * temp storage for parsing indexes -+ */ -+ /* -+ * dot3StatsIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H -+ */ -+ netsnmp_variable_list var_dot3StatsIndex; -+ -+ /* -+ * set up varbinds -+ */ -+ memset(&var_dot3StatsIndex, 0x00, sizeof(var_dot3StatsIndex)); -+ var_dot3StatsIndex.type = ASN_INTEGER; -+ -+ /* -+ * chain temp index varbinds together -+ */ -+ var_dot3StatsIndex.next_variable = NULL; -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_index_to_oid", -+ "called\n")); -+ -+ /* -+ * dot3StatsIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H -+ */ -+ snmp_set_var_value(&var_dot3StatsIndex, -+ (u_char *) & mib_idx->dot3StatsIndex, -+ sizeof(mib_idx->dot3StatsIndex)); -+ -+ -+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len, -+ NULL, 0, &var_dot3StatsIndex); -+ 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_dot3StatsIndex); -+ -+ return err; -+} /* dot3StatsTable_index_to_oid */ -+ -+/** -+ * extract dot3StatsTable indexes from a netsnmp_index -+ * -+ * @retval SNMP_ERR_NOERROR : no error -+ * @retval SNMP_ERR_GENERR : error -+ */ -+int -+dot3StatsTable_index_from_oid(netsnmp_index * oid_idx, -+ dot3StatsTable_mib_index * mib_idx) -+{ -+ int err = SNMP_ERR_NOERROR; -+ -+ /* -+ * temp storage for parsing indexes -+ */ -+ /* -+ * dot3StatsIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H -+ */ -+ netsnmp_variable_list var_dot3StatsIndex; -+ -+ /* -+ * set up varbinds -+ */ -+ memset(&var_dot3StatsIndex, 0x00, sizeof(var_dot3StatsIndex)); -+ var_dot3StatsIndex.type = ASN_INTEGER; -+ -+ /* -+ * chain temp index varbinds together -+ */ -+ var_dot3StatsIndex.next_variable = NULL; -+ -+ -+ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_index_from_oid", -+ "called\n")); -+ -+ /* -+ * parse the oid into the individual index components -+ */ -+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len, -+ &var_dot3StatsIndex); -+ if (err == SNMP_ERR_NOERROR) { -+ /* -+ * copy out values -+ */ -+ mib_idx->dot3StatsIndex = -+ *((long *) var_dot3StatsIndex.val.string); -+ -+ -+ } -+ -+ /* -+ * parsing may have allocated memory. free it. -+ */ -+ snmp_reset_var_buffers(&var_dot3StatsIndex); -+ -+ return err; -+} /* dot3StatsTable_index_from_oid */ -+ -+ -+/* -+ ********************************************************************* -+ * @internal -+ * allocate resources for a dot3StatsTable_rowreq_ctx -+ */ -+dot3StatsTable_rowreq_ctx * -+dot3StatsTable_allocate_rowreq_ctx(void *user_init_ctx) -+{ -+ dot3StatsTable_rowreq_ctx *rowreq_ctx = -+ SNMP_MALLOC_TYPEDEF(dot3StatsTable_rowreq_ctx); -+ -+ DEBUGMSGTL(("internal:dot3StatsTable:dot3StatsTable_allocate_rowreq_ctx", "called\n")); -+ -+ if (NULL == rowreq_ctx) { -+ snmp_log(LOG_ERR, "Couldn't allocate memory for a " -+ "dot3StatsTable_rowreq_ctx.\n"); -+ return NULL; -+ } -+ -+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp; -+ -+ rowreq_ctx->dot3StatsTable_data_list = NULL; -+ -+ /* -+ * if we allocated data, call init routine -+ */ -+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) { -+ if (SNMPERR_SUCCESS != -+ dot3StatsTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) { -+ dot3StatsTable_release_rowreq_ctx(rowreq_ctx); -+ rowreq_ctx = NULL; -+ } -+ } -+ -+ return rowreq_ctx; -+} /* dot3StatsTable_allocate_rowreq_ctx */ -+ -+/* -+ * @internal -+ * release resources for a dot3StatsTable_rowreq_ctx -+ */ -+void -+dot3StatsTable_release_rowreq_ctx(dot3StatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("internal:dot3StatsTable:dot3StatsTable_release_rowreq_ctx", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ dot3StatsTable_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); -+} /* dot3StatsTable_release_rowreq_ctx */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_dot3StatsTable_pre_request(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ int rc; -+ -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_pre_request", -+ "called\n")); -+ -+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) { -+ DEBUGMSGTL(("internal:dot3StatsTable", -+ "skipping additional pre_request\n")); -+ return SNMP_ERR_NOERROR; -+ } -+ -+ rc = dot3StatsTable_pre_request(dot3StatsTable_if_ctx.user_ctx); -+ if (MFD_SUCCESS != rc) { -+ /* -+ * nothing we can do about it but log it -+ */ -+ DEBUGMSGTL(("dot3StatsTable", "error %d from " -+ "dot3StatsTable_pre_request\n", rc)); -+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc)); -+ } -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_dot3StatsTable_pre_request */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_dot3StatsTable_post_request(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ dot3StatsTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ int rc, packet_rc; -+ -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_post_request", -+ "called\n")); -+ -+ /* -+ * release row context, if deleted -+ */ -+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED)) -+ dot3StatsTable_release_rowreq_ctx(rowreq_ctx); -+ -+ /* -+ * wait for last call before calling user -+ */ -+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) { -+ DEBUGMSGTL(("internal:dot3StatsTable", -+ "waiting for last post_request\n")); -+ return SNMP_ERR_NOERROR; -+ } -+ -+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0); -+ rc = dot3StatsTable_post_request(dot3StatsTable_if_ctx.user_ctx, -+ packet_rc); -+ if (MFD_SUCCESS != rc) { -+ /* -+ * nothing we can do about it but log it -+ */ -+ DEBUGMSGTL(("dot3StatsTable", "error %d from " -+ "dot3StatsTable_post_request\n", rc)); -+ } -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_dot3StatsTable_post_request */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_dot3StatsTable_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; -+ dot3StatsTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_object_lookup", "called\n")); -+ -+ /* -+ * get our context from mfd -+ * dot3StatsTable_interface_ctx *if_ctx = -+ * (dot3StatsTable_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 -+ dot3StatsTable_row_prep(rowreq_ctx); -+ -+ return SNMP_VALIDATE_ERR(rc); -+} /* _mfd_dot3StatsTable_object_lookup */ -+ -+/*********************************************************************** -+ * -+ * GET processing -+ * -+ ***********************************************************************/ -+/* -+ * @internal -+ * Retrieve the value for a particular column -+ */ -+NETSNMP_STATIC_INLINE int -+_dot3StatsTable_get_column(dot3StatsTable_rowreq_ctx * rowreq_ctx, -+ netsnmp_variable_list * var, int column) -+{ -+ int rc = SNMPERR_SUCCESS; -+ -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", -+ "called for %d\n", column)); -+ -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ switch (column) { -+ -+ /* -+ * (INDEX) dot3StatsIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H -+ */ -+ case COLUMN_DOT3STATSINDEX: -+ var->type = ASN_INTEGER; -+ var->val_len = sizeof(long); -+ (*var->val.integer) = rowreq_ctx->tbl_idx.dot3StatsIndex; -+ break; -+ -+ /* -+ * dot3StatsAlignmentErrors(2)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_DOT3STATSALIGNMENTERRORS: -+ if (! -+ (COLUMN_DOT3STATSALIGNMENTERRORS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ snmp_log (LOG_ERR, "internal:dot3StatsTable:_mfd_dot3StatsTable_get_column, column %d (dot3StatsAlignmentErrors) doesn't exist for interface with index %ld\n", column, rowreq_ctx->tbl_idx.dot3StatsIndex); -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsAlignmentErrors) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = dot3StatsAlignmentErrors_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * dot3StatsFCSErrors(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_DOT3STATSFCSERRORS: -+ if (! -+ (COLUMN_DOT3STATSFCSERRORS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsFCSErrors) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = dot3StatsFCSErrors_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * dot3StatsSingleCollisionFrames(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_DOT3STATSSINGLECOLLISIONFRAMES: -+ if (! -+ (COLUMN_DOT3STATSSINGLECOLLISIONFRAMES_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ snmp_log (LOG_ERR, "internal:dot3StatsTable:_mfd_dot3StatsTable_get_column, column %d (dot3StatsSingleCollisionFrames) doesn't exist for the interface with index %ld\n", column, rowreq_ctx->tbl_idx.dot3StatsIndex); -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsSingleCollisionFrames) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = dot3StatsSingleCollisionFrames_get(rowreq_ctx, -+ (u_long *) var->val. -+ string); -+ break; -+ -+ /* -+ * dot3StatsMultipleCollisionFrames(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_DOT3STATSMULTIPLECOLLISIONFRAMES: -+ if (! -+ (COLUMN_DOT3STATSMULTIPLECOLLISIONFRAMES_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ snmp_log (LOG_ERR, "internal:dot3StatsTable:_mfd_dot3StatsTable_get_column, column %d (dot3StatsMultipleCollisionFrames) doesn't exist for the interface with index %ld\n", column, rowreq_ctx->tbl_idx.dot3StatsIndex); -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsMultipleCollisionFrames) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = dot3StatsMultipleCollisionFrames_get(rowreq_ctx, -+ (u_long *) var->val. -+ string); -+ break; -+ -+ /* -+ * dot3StatsSQETestErrors(6)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_DOT3STATSSQETESTERRORS: -+ if (! -+ (COLUMN_DOT3STATSSQETESTERRORS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsSQETestErrors) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = dot3StatsSQETestErrors_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * dot3StatsDeferredTransmissions(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_DOT3STATSDEFERREDTRANSMISSIONS: -+ if (! -+ (COLUMN_DOT3STATSDEFERREDTRANSMISSIONS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsDeferredTransmissions) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = dot3StatsDeferredTransmissions_get(rowreq_ctx, -+ (u_long *) var->val. -+ string); -+ break; -+ -+ /* -+ * dot3StatsLateCollisions(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_DOT3STATSLATECOLLISIONS: -+ if (! -+ (COLUMN_DOT3STATSLATECOLLISIONS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ snmp_log (LOG_ERR, "internal:dot3StatsTable:_mfd_dot3StatsTable_get_column, column %d (dot3StatsLateCollisions) doesn't exist for the interface with index %ld\n", column, rowreq_ctx->tbl_idx.dot3StatsIndex); -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsLateCollisions) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = dot3StatsLateCollisions_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * dot3StatsExcessiveCollisions(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_DOT3STATSEXCESSIVECOLLISIONS: -+ if (! -+ (COLUMN_DOT3STATSEXCESSIVECOLLISIONS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ snmp_log (LOG_ERR, "internal:dot3StatsTable:_mfd_dot3StatsTable_get_column, column %d (dot3StatsExcessiveCollisions) doesn't exist for the interface with index %ld\n", column, rowreq_ctx->tbl_idx.dot3StatsIndex); -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsExcessiveCollisions) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = dot3StatsExcessiveCollisions_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * dot3StatsInternalMacTransmitErrors(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_DOT3STATSINTERNALMACTRANSMITERRORS: -+ if (! -+ (COLUMN_DOT3STATSINTERNALMACTRANSMITERRORS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsInternalMacTransmitErrors) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = dot3StatsInternalMacTransmitErrors_get(rowreq_ctx, -+ (u_long *) var->val. -+ string); -+ break; -+ -+ /* -+ * dot3StatsCarrierSenseErrors(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_DOT3STATSCARRIERSENSEERRORS: -+ if (! -+ (COLUMN_DOT3STATSCARRIERSENSEERRORS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsCarrierSenseErrors) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = dot3StatsCarrierSenseErrors_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * dot3StatsFrameTooLongs(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_DOT3STATSFRAMETOOLONGS: -+ if (! -+ (COLUMN_DOT3STATSFRAMETOOLONGS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsFrameTooLongs) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = dot3StatsFrameTooLongs_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * dot3StatsInternalMacReceiveErrors(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_DOT3STATSINTERNALMACRECEIVEERRORS: -+ if (! -+ (COLUMN_DOT3STATSINTERNALMACRECEIVEERRORS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsInternalMacReceiveErrors) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = dot3StatsInternalMacReceiveErrors_get(rowreq_ctx, -+ (u_long *) var->val. -+ string); -+ break; -+ -+ /* -+ * dot3StatsEtherChipSet(17)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h -+ */ -+ case COLUMN_DOT3STATSETHERCHIPSET: -+ if (! -+ (COLUMN_DOT3STATSETHERCHIPSET_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsEtherChipSet) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->type = ASN_OBJECT_ID; -+ rc = dot3StatsEtherChipSet_get(rowreq_ctx, -+ (oid **) & var->val.string, -+ &var->val_len); -+ break; -+ -+ /* -+ * dot3StatsSymbolErrors(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_DOT3STATSSYMBOLERRORS: -+ if (! -+ (COLUMN_DOT3STATSSYMBOLERRORS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsSymbolErrors) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = dot3StatsSymbolErrors_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * dot3StatsDuplexStatus(19)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h -+ */ -+ case COLUMN_DOT3STATSDUPLEXSTATUS: -+ if (! -+ (COLUMN_DOT3STATSDUPLEXSTATUS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ snmp_log (LOG_ERR, "internal:dot3StatsTable:_mfd_dot3StatsTable_get_column, column %d (dot3StatsDuplexStatus) doesn't exist for the interface with index %ld\n", column, rowreq_ctx->tbl_idx.dot3StatsIndex); -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsDuplexStatus) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_INTEGER; -+ rc = dot3StatsDuplexStatus_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * dot3StatsRateControlAbility(20)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h -+ */ -+ case COLUMN_DOT3STATSRATECONTROLABILITY: -+ if (! -+ (COLUMN_DOT3STATSRATECONTROLABILITY_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsRateControlAbility) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_INTEGER; -+ rc = dot3StatsRateControlAbility_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * dot3StatsRateControlStatus(21)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h -+ */ -+ case COLUMN_DOT3STATSRATECONTROLSTATUS: -+ if (! -+ (COLUMN_DOT3STATSRATECONTROLSTATUS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "column %d (dot3StatsRateControlStatus) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_INTEGER; -+ rc = dot3StatsRateControlStatus_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ default: -+ if (DOT3STATSTABLE_MIN_COL <= column -+ && column <= DOT3STATSTABLE_MAX_COL) { -+ DEBUGMSGTL(("internal:dot3StatsTable:_mfd_dot3StatsTable_get_column", "assume column %d is reserved\n", column)); -+ rc = MFD_SKIP; -+ } else { -+ snmp_log(LOG_ERR, -+ "unknown column %d in _dot3StatsTable_get_column\n", -+ column); -+ } -+ break; -+ } -+ -+ return rc; -+} /* _dot3StatsTable_get_column */ -+ -+int -+_mfd_dot3StatsTable_get_values(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ dot3StatsTable_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:dot3StatsTable:_mfd_dot3StatsTable_get_values", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ DEBUGMSGTL(("9:dot3StatsTable:_mfd_dot3StatsTable_get_values", -+ "exists %u\n", rowreq_ctx->column_exists_flags)); -+ -+ 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 = _dot3StatsTable_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_dot3StatsTable_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:dot3StatsTable:_cache_load", "called\n")); -+ -+ if ((NULL == cache) || (NULL == cache->magic)) { -+ snmp_log(LOG_ERR, "invalid cache for dot3StatsTable_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 dot3StatsTable_container_load((netsnmp_container *) cache-> -+ magic); -+} /* _cache_load */ -+ -+/** -+ * @internal -+ */ -+static void -+_cache_free(netsnmp_cache * cache, void *magic) -+{ -+ netsnmp_container *container; -+ -+ DEBUGMSGTL(("internal:dot3StatsTable:_cache_free", "called\n")); -+ -+ if ((NULL == cache) || (NULL == cache->magic)) { -+ snmp_log(LOG_ERR, "invalid cache in dot3StatsTable_cache_free\n"); -+ return; -+ } -+ -+ container = (netsnmp_container *) cache->magic; -+ -+ _container_free(container); -+} /* _cache_free */ -+ -+/** -+ * @internal -+ */ -+static void -+_container_item_free(dot3StatsTable_rowreq_ctx * rowreq_ctx, void *context) -+{ -+ DEBUGMSGTL(("internal:dot3StatsTable:_container_item_free", -+ "called\n")); -+ -+ if (NULL == rowreq_ctx) -+ return; -+ -+ dot3StatsTable_release_rowreq_ctx(rowreq_ctx); -+} /* _container_item_free */ -+ -+/** -+ * @internal -+ */ -+static void -+_container_free(netsnmp_container * container) -+{ -+ DEBUGMSGTL(("internal:dot3StatsTable:_container_free", "called\n")); -+ -+ if (NULL == container) { -+ snmp_log(LOG_ERR, -+ "invalid container in dot3StatsTable_container_free\n"); -+ return; -+ } -+ -+ /* -+ * call user code -+ */ -+ dot3StatsTable_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 -+_dot3StatsTable_container_init(dot3StatsTable_interface_ctx * if_ctx) -+{ -+ DEBUGMSGTL(("internal:dot3StatsTable:_dot3StatsTable_container_init", -+ "called\n")); -+ -+ /* -+ * cache init -+ */ -+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */ -+ _cache_load, _cache_free, -+ dot3StatsTable_oid, -+ dot3StatsTable_oid_size); -+ -+ if (NULL == if_ctx->cache) { -+ snmp_log(LOG_ERR, "error creating cache for dot3StatsTable\n"); -+ return; -+ } -+ -+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET; -+ -+ dot3StatsTable_container_init(&if_ctx->container, if_ctx->cache); -+ if (NULL == if_ctx->container) -+ if_ctx->container = -+ netsnmp_container_find("dot3StatsTable:table_container"); -+ if (NULL == if_ctx->container) { -+ snmp_log(LOG_ERR, "error creating container in " -+ "dot3StatsTable_container_init\n"); -+ return; -+ } -+ -+ if (NULL != if_ctx->cache) -+ if_ctx->cache->magic = (void *) if_ctx->container; -+} /* _dot3StatsTable_container_init */ -+ -+/** -+ * @internal -+ * shutdown the container with functions or wrappers -+ */ -+void -+_dot3StatsTable_container_shutdown(dot3StatsTable_interface_ctx * if_ctx) -+{ -+ DEBUGMSGTL(("internal:dot3StatsTable:_dot3StatsTable_container_shutdown", "called\n")); -+ -+ dot3StatsTable_container_shutdown(if_ctx->container); -+ -+ _container_free(if_ctx->container); -+ -+} /* _dot3StatsTable_container_shutdown */ -+ -+ -+dot3StatsTable_rowreq_ctx * -+dot3StatsTable_row_find_by_mib_index(dot3StatsTable_mib_index * mib_idx) -+{ -+ dot3StatsTable_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 = dot3StatsTable_index_to_oid(&oid_idx, mib_idx); -+ if (MFD_SUCCESS != rc) -+ return NULL; -+ -+ rowreq_ctx = CONTAINER_FIND(dot3StatsTable_if_ctx.container, &oid_idx); -+ -+ return rowreq_ctx; -+} -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.h net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.h ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_interface.h 2008-08-08 05:58:09.000000000 -0400 -@@ -0,0 +1,94 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 15899 $ of $ -+ * -+ * $Id:$ -+ */ -+/** @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 DOT3STATSTABLE_INTERFACE_H -+#define DOT3STATSTABLE_INTERFACE_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+#include "dot3StatsTable.h" -+ -+ -+ /* -+ ******************************************************************** -+ * Table declarations -+ */ -+ -+ /* -+ * PUBLIC interface initialization routine -+ */ -+ void -+ _dot3StatsTable_initialize_interface(dot3StatsTable_registration * -+ user_ctx, u_long flags); -+ void -+ _dot3StatsTable_shutdown_interface(dot3StatsTable_registration * -+ user_ctx); -+ -+ dot3StatsTable_registration *dot3StatsTable_registration_get(void); -+ -+ dot3StatsTable_registration -+ *dot3StatsTable_registration_set(dot3StatsTable_registration * -+ newreg); -+ -+ netsnmp_container *dot3StatsTable_container_get(void); -+ int dot3StatsTable_container_size(void); -+ -+ dot3StatsTable_rowreq_ctx *dot3StatsTable_allocate_rowreq_ctx(void *); -+ void -+ dot3StatsTable_release_rowreq_ctx(dot3StatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int dot3StatsTable_index_to_oid(netsnmp_index * oid_idx, -+ dot3StatsTable_mib_index * -+ mib_idx); -+ int dot3StatsTable_index_from_oid(netsnmp_index * oid_idx, -+ dot3StatsTable_mib_index -+ * mib_idx); -+ -+ /* -+ * access to certain internals. use with caution! -+ */ -+ void dot3StatsTable_valid_columns_set(netsnmp_column_info -+ *vc); -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* DOT3STATSTABLE_INTERFACE_H */ -+/** @} */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_oids.h net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_oids.h ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_oids.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_oids.h 2008-08-23 11:43:41.000000000 -0400 -@@ -0,0 +1,82 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $ -+ * -+ * $Id:$ -+ */ -+#ifndef DOT3STATSTABLE_OIDS_H -+#define DOT3STATSTABLE_OIDS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+ /* -+ * column number definitions for table dot3StatsTable -+ */ -+#define DOT3STATSTABLE_OID 1,3,6,1,2,1,10,7,2 -+ -+#define COLUMN_DOT3STATSINDEX 1 -+#define COLUMN_DOT3STATSINDEX_FLAG (0x1 << 0) -+ -+#define COLUMN_DOT3STATSALIGNMENTERRORS 2 -+#define COLUMN_DOT3STATSALIGNMENTERRORS_FLAG (0x1 << 1) -+ -+#define COLUMN_DOT3STATSFCSERRORS 3 -+#define COLUMN_DOT3STATSFCSERRORS_FLAG (0x1 << 2) -+ -+#define COLUMN_DOT3STATSSINGLECOLLISIONFRAMES 4 -+#define COLUMN_DOT3STATSSINGLECOLLISIONFRAMES_FLAG (0x1 << 3) -+ -+#define COLUMN_DOT3STATSMULTIPLECOLLISIONFRAMES 5 -+#define COLUMN_DOT3STATSMULTIPLECOLLISIONFRAMES_FLAG (0x1 << 4) -+ -+#define COLUMN_DOT3STATSSQETESTERRORS 6 -+#define COLUMN_DOT3STATSSQETESTERRORS_FLAG (0x1 << 5) -+ -+#define COLUMN_DOT3STATSDEFERREDTRANSMISSIONS 7 -+#define COLUMN_DOT3STATSDEFERREDTRANSMISSIONS_FLAG (0x1 << 6) -+ -+#define COLUMN_DOT3STATSLATECOLLISIONS 8 -+#define COLUMN_DOT3STATSLATECOLLISIONS_FLAG (0x1 << 7) -+ -+#define COLUMN_DOT3STATSEXCESSIVECOLLISIONS 9 -+#define COLUMN_DOT3STATSEXCESSIVECOLLISIONS_FLAG (0x1 << 8) -+ -+#define COLUMN_DOT3STATSINTERNALMACTRANSMITERRORS 10 -+#define COLUMN_DOT3STATSINTERNALMACTRANSMITERRORS_FLAG (0x1 << 9) -+ -+#define COLUMN_DOT3STATSCARRIERSENSEERRORS 11 -+#define COLUMN_DOT3STATSCARRIERSENSEERRORS_FLAG (0x1 << 10) -+ -+#define COLUMN_DOT3STATSFRAMETOOLONGS 13 -+#define COLUMN_DOT3STATSFRAMETOOLONGS_FLAG (0x1 << 12) -+ -+#define COLUMN_DOT3STATSINTERNALMACRECEIVEERRORS 16 -+#define COLUMN_DOT3STATSINTERNALMACRECEIVEERRORS_FLAG (0x1 << 15) -+ -+#define COLUMN_DOT3STATSETHERCHIPSET 17 -+#define COLUMN_DOT3STATSETHERCHIPSET_FLAG (0x1 << 16) -+ -+#define COLUMN_DOT3STATSSYMBOLERRORS 18 -+#define COLUMN_DOT3STATSSYMBOLERRORS_FLAG (0x1 << 17) -+ -+#define COLUMN_DOT3STATSDUPLEXSTATUS 19 -+#define COLUMN_DOT3STATSDUPLEXSTATUS_FLAG (0x1 << 18) -+ -+#define COLUMN_DOT3STATSRATECONTROLABILITY 20 -+#define COLUMN_DOT3STATSRATECONTROLABILITY_FLAG (0x1 << 19) -+ -+#define COLUMN_DOT3STATSRATECONTROLSTATUS 21 -+#define COLUMN_DOT3STATSRATECONTROLSTATUS_FLAG (0x1 << 20) -+ -+ -+#define DOT3STATSTABLE_MIN_COL COLUMN_DOT3STATSINDEX -+#define DOT3STATSTABLE_MAX_COL COLUMN_DOT3STATSRATECONTROLSTATUS -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* DOT3STATSTABLE_OIDS_H */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/ioctl_imp_common.h net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/ioctl_imp_common.h ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable/ioctl_imp_common.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable/ioctl_imp_common.h 2009-01-05 01:41:44.000000000 -0500 -@@ -0,0 +1,65 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* use kernel's ethtool.h */ -+ -+#include -+typedef __u64 u64; -+typedef __u32 u32; -+typedef __u16 u16; -+typedef __u8 u8; -+#include -+ -+/* structure for storing the interface names in the system */ -+ -+struct ifname { -+ struct ifname *ifn_next; -+ char name [IF_NAMESIZE]; -+}; -+ -+struct ifname *dot3stats_interface_name_list_get (struct ifname *, int *); -+int dot3stats_interface_name_list_free (struct ifname *list_head); -+int dot3stats_interface_ioctl_ifindex_get (int fd, const char *name); -+int _dot3Stats_ioctl_get(int fd, int which, struct ifreq *ifrq, const char* name); -+int interface_ioctl_dot3stats_get(dot3StatsTable_rowreq_ctx *rowreq_ctx, int fd, const char* name); -+int interface_ioctl_dot3stats_duplex_get(dot3StatsTable_rowreq_ctx *rowreq_ctx, int fd, const char* name); -+ -+ -+/* for maintainability */ -+ -+#define INTEL_RECEIVE_ALIGN_ERRORS "rx_align_errors" -+#define BROADCOM_RECEIVE_ALIGN_ERRORS INTEL_RECEIVE_ALIGN_ERRORS -+ -+#define INTEL_TRANSMIT_MULTIPLE_COLLISIONS "tx_multi_coll_ok" -+#define BROADCOM_TRANSMIT_MULTIPLE_COLLISIONS_BNX2 "tx_multi_collisions" -+#define BROADCOM_TRANSMIT_MULTIPLE_COLLISIONS_TG3 "tx_mult_collisions" -+ -+#define INTEL_TRANSMIT_LATE_COLLISIONS "tx_abort_late_coll" -+#define BROADCOM_TRANSMIT_LATE_COLLISIONS "tx_late_collisions" -+ -+#define INTEL_TRANSMIT_SINGLE_COLLISIONS "tx_single_coll_ok" -+#define BROADCOM_TRANSMIT_SINGLE_COLLISIONS "tx_single_collisions" -+ -+#define BROADCOM_TRANSMIT_EXCESS_COLLISIONS_BNX2 "tx_excess_collisions" -+#define BROADCOM_TRANSMIT_EXCESS_COLLISIONS_TG3 "tx_excessive_collisions" -+ -+ -+#define DOT3STATSALIGNMENTERRORS(x) strstr(x, INTEL_RECEIVE_ALIGN_ERRORS) -+ -+#define DOT3STATSMULTIPLECOLLISIONFRAMES(x) (strstr(x, INTEL_TRANSMIT_MULTIPLE_COLLISIONS)) || \ -+ (strstr(x, BROADCOM_TRANSMIT_MULTIPLE_COLLISIONS_BNX2)) || \ -+ (strstr(x, BROADCOM_TRANSMIT_MULTIPLE_COLLISIONS_TG3)) -+ -+#define DOT3STATSLATECOLLISIONS(x) (strstr(x, INTEL_TRANSMIT_LATE_COLLISIONS)) || \ -+ (strstr(x, BROADCOM_TRANSMIT_LATE_COLLISIONS)) -+ -+#define DOT3STATSSINGLECOLLISIONFRAMES(x) (strstr(x, INTEL_TRANSMIT_SINGLE_COLLISIONS)) || \ -+ (strstr(x, BROADCOM_TRANSMIT_SINGLE_COLLISIONS)) -+ -+#define DOT3STATSEXCESSIVECOLLISIONS(x) (strstr(x, BROADCOM_TRANSMIT_EXCESS_COLLISIONS_BNX2)) || \ -+ (strstr(x, BROADCOM_TRANSMIT_EXCESS_COLLISIONS_TG3)) -+ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable.h net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable.h ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib/dot3StatsTable.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib/dot3StatsTable.h 2008-12-21 05:19:51.000000000 -0500 -@@ -0,0 +1,11 @@ -+/* -+ * module to include the modules -+ */ -+ -+config_require(etherlike-mib/data_access/dot3stats) -+config_require(etherlike-mib/dot3StatsTable/dot3StatsTable) -+config_require(etherlike-mib/dot3StatsTable/dot3StatsTable_data_get) -+config_require(etherlike-mib/dot3StatsTable/dot3StatsTable_data_set) -+config_require(etherlike-mib/dot3StatsTable/dot3StatsTable_data_access) -+config_require(etherlike-mib/dot3StatsTable/dot3StatsTable_interface) -+ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib.h net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib.h ---- net-snmp-5.4.1.2/agent/mibgroup/etherlike-mib.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/etherlike-mib.h 2008-12-21 05:18:00.000000000 -0500 -@@ -0,0 +1,6 @@ -+/* -+ * module to include the modules -+ */ -+ -+config_require(etherlike-mib/dot3StatsTable) -+config_add_mib(EtherLike-MIB) - - diff --git a/net-snmp-5.4.1.2-rmon-mib-revised_3.patch b/net-snmp-5.4.1.2-rmon-mib-revised_3.patch deleted file mode 100644 index 5698fae..0000000 --- a/net-snmp-5.4.1.2-rmon-mib-revised_3.patch +++ /dev/null @@ -1,6966 +0,0 @@ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/data_access/etherstats.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/data_access/etherstats.h ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/data_access/etherstats.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/data_access/etherstats.h 2008-12-21 05:47:47.000000000 -0500 -@@ -0,0 +1,7 @@ -+/* -+ * module to include the modules -+ */ -+ -+#if defined(linux) -+config_require(rmon-mib/data_access/etherstats_linux) -+#endif -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/data_access/etherstats_linux.c net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/data_access/etherstats_linux.c ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/data_access/etherstats_linux.c 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/data_access/etherstats_linux.c 2009-01-12 07:38:52.000000000 -0500 -@@ -0,0 +1,319 @@ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "rmon-mib/etherStatsTable/etherStatsTable.h" -+#include "rmon-mib/etherStatsTable/etherStatsTable_data_access.h" -+#include "rmon-mib/etherStatsTable/ioctl_imp_common.h" -+ -+/* -+ * @retval 0 success -+ * @retval -1 getifaddrs failed -+ * @retval -2 memory allocation failed -+ */ -+ -+struct ifname * -+etherstats_interface_name_list_get (struct ifname *list_head, int *retval) -+{ -+ struct ifaddrs *addrs = NULL, *p = NULL; -+ struct ifname *nameptr1=NULL, *nameptr2 = NULL; -+ -+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get", -+ "called\n")); -+ -+ if ((getifaddrs(&addrs)) < 0) { -+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get", -+ "getifaddrs failed\n")); -+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_name_list_get, getifaddrs failed\n"); -+ *retval = -1; -+ return NULL; -+ } -+ -+ for (p = addrs; p; p = p->ifa_next) { -+ -+ if (!list_head) { -+ if ( (list_head = (struct ifname *) malloc (sizeof(struct ifname))) < 0) { -+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get", -+ "memory allocation failed\n")); -+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_name_list_get, memory allocation failed\n"); -+ freeifaddrs(addrs); -+ *retval = -2; -+ return NULL; -+ } -+ memset (list_head, 0, sizeof (struct ifname)); -+ strncpy (list_head->name, p->ifa_name, IF_NAMESIZE); -+ continue; -+ } -+ for (nameptr1 = list_head; nameptr1; nameptr2 = nameptr1, nameptr1 = nameptr1->ifn_next) -+ if (!strncmp(p->ifa_name, nameptr1->name, IF_NAMESIZE)) -+ break; -+ -+ if (nameptr1) -+ continue; -+ -+ if ( (nameptr2->ifn_next = (struct ifname *) malloc (sizeof(struct ifname))) < 0) { -+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get", -+ "memory allocation failed\n")); -+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_name_list_get, memory allocation failed\n"); -+ interface_name_list_free (list_head); -+ freeifaddrs(addrs); -+ *retval = -2; -+ return NULL; -+ } -+ nameptr2 = nameptr2->ifn_next; -+ memset (nameptr2, 0, sizeof (struct ifname)); -+ strncpy (nameptr2->name, p->ifa_name, IF_NAMESIZE); -+ continue; -+ -+ } -+ -+ freeifaddrs(addrs); -+ *retval = 0; -+ return list_head; -+} -+ -+ -+/* -+ * @retval 0 success -+ * @retval -1 invalid pointer -+ */ -+ -+int -+etherstats_interface_name_list_free (struct ifname *list_head) -+{ -+ struct ifname *nameptr1 = NULL, *nameptr2 = NULL; -+ -+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_free", -+ "called\n")); -+ -+ if (!list_head) { -+ snmp_log (LOG_ERR, "access:etherStatsTable:interface_name_list_free: invalid pointer list_head"); -+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_free", -+ "invalid pointer list_head\n")); -+ return -1; -+ } -+ -+ for (nameptr1 = list_head; nameptr1; nameptr1 = nameptr2) { -+ nameptr2 = nameptr1->ifn_next; -+ free (nameptr1); -+ } -+ -+ return 0; -+} -+ -+/* -+ * @retval 0 : not found -+ * @retval !0 : ifIndex -+ */ -+ -+int -+etherstats_interface_ioctl_ifindex_get (int fd, const char *name) { -+#ifndef SIOCGIFINDEX -+ return 0; -+#else -+ struct ifreq ifrq; -+ int rc = 0; -+ -+ DEBUGMSGTL(("access:etherStatsTable:ioctl", "ifindex_get\n")); -+ -+ rc = _etherStats_ioctl_get(fd, SIOCGIFINDEX, &ifrq, name); -+ if (rc < 0) { -+ DEBUGMSGTL(("access:etherStats:ioctl", -+ "ifindex_get error on inerface '%s'\n", name)); -+ snmp_log (LOG_ERR, "access:etherStatsTable:ioctl, ifindex_get error on inerface '%s'\n", name); -+ return 0; -+ -+ } -+ -+ return ifrq.ifr_ifindex; -+#endif /* SIOCGIFINDEX */ -+} -+ -+/* -+ * @retval 0 success -+ * @retval -1 cannot get ETHTOOL_DRVINFO failed -+ * @retval -2 n_stats zero - no statistcs available -+ * @retval -3 memory allocation for holding the statistics failed -+ * @retval -4 cannot get ETHTOOL_GSTRINGS information -+ * @retval -5 cannot get ETHTOOL_GSTATS information -+ * @retval -6 function not supported if HAVE_LINUX_ETHTOOL_H not defined -+ */ -+ -+int -+interface_ioctl_etherstats_get (etherStatsTable_rowreq_ctx *rowreq_ctx , int fd, const char *name) { -+ -+#ifdef HAVE_LINUX_ETHTOOL_H -+ -+ etherStatsTable_data *data = &rowreq_ctx->data; -+ struct ethtool_drvinfo driver_info; -+ struct ethtool_gstrings *eth_strings; -+ struct ethtool_stats *eth_stats; -+ struct ifreq ifr; -+ unsigned int nstats, size_str, size_stats, i; -+ int err; -+ -+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get", -+ "called\n")); -+ -+ memset(&ifr, 0, sizeof(ifr)); -+ strcpy(ifr.ifr_name, name); -+ -+ memset(&driver_info, 0, sizeof(driver_info)); -+ driver_info.cmd = ETHTOOL_GDRVINFO; -+ ifr.ifr_data = (char *)&driver_info; -+ -+ err = _etherStats_ioctl_get(fd, SIOCETHTOOL, &ifr, name); -+ if (err < 0) { -+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get", -+ "ETHTOOL_GETDRVINFO failed on interface |%s| \n", name)); -+ return -1; -+ } -+ -+ nstats = driver_info.n_stats; -+ if (nstats < 1) { -+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get", -+ "no stats available for interface |%s| \n", name)); -+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, no stats availablei for interface |%s| \n", name); -+ return -2; -+ } -+ -+ size_str = nstats * ETH_GSTRING_LEN; -+ size_stats = nstats * sizeof(u64); -+ -+ eth_strings = malloc(size_str + sizeof (struct ethtool_gstrings)); -+ if (!eth_strings) { -+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get", -+ "no memory available\n")); -+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, no memory available\n"); -+ -+ return -3; -+ } -+ memset (eth_strings, 0, (size_str + sizeof (struct ethtool_gstrings))); -+ -+ eth_stats = malloc (size_str + sizeof (struct ethtool_stats)); -+ if (!eth_stats) { -+ free (eth_strings); -+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get", -+ "no memory available\n")); -+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, no memory available\n"); -+ -+ return -3; -+ } -+ memset (eth_stats, 0, (size_str + sizeof (struct ethtool_stats))); -+ -+ eth_strings->cmd = ETHTOOL_GSTRINGS; -+ eth_strings->string_set = ETH_SS_STATS; -+ eth_strings->len = nstats; -+ ifr.ifr_data = (char *) eth_strings; -+ -+ err = _etherStats_ioctl_get(fd, SIOCETHTOOL, &ifr, name); -+ if (err < 0) { -+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get", -+ "cannot get stats strings information for interface |%s| \n", name)); -+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, cannot get stats strings information for interface |%s| \n", name); -+ -+ free(eth_strings); -+ free(eth_stats); -+ return -4; -+ } -+ -+ eth_stats->cmd = ETHTOOL_GSTATS; -+ eth_stats->n_stats = nstats; -+ ifr.ifr_data = (char *) eth_stats; -+ err = _etherStats_ioctl_get(fd, SIOCETHTOOL, &ifr, name); -+ if (err < 0) { -+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get", -+ "cannot get stats strings information for interface |%s| \n", name)); -+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, cannot get stats information for interface |%s| \n", name); -+ -+ free(eth_strings); -+ free(eth_stats); -+ return -5; -+ } -+ -+ for (i = 0; i < nstats; i++) { -+ char s[ETH_GSTRING_LEN]; -+ -+ strncpy(s, (const char *) ð_strings->data[i * ETH_GSTRING_LEN], -+ ETH_GSTRING_LEN); -+ -+ if (ETHERSTATSJABBERS(s)) { -+ data->etherStatsJabbers = (u_long)eth_stats->data[i]; -+ rowreq_ctx->column_exists_flags |= COLUMN_ETHERSTATSJABBERS_FLAG; -+ } -+ } -+ free(eth_strings); -+ free(eth_stats); -+ -+ return 0; -+#else -+ return -6; -+#endif -+ -+} -+ -+ -+/* ioctl wrapper -+ * -+ * @param fd : socket fd to use w/ioctl, or -1 to open/close one -+ * @param which -+ * @param ifrq -+ * param ifentry : ifentry to update -+ * @param name -+ * -+ * @retval 0 : success -+ * @retval -1 : invalid parameters -+ * @retval -2 : couldn't create socket -+ * @retval -3 : ioctl call failed -+ */ -+int -+_etherStats_ioctl_get(int fd, int which, struct ifreq *ifrq, const char* name) -+{ -+ int ourfd = -1, rc = 0; -+ -+ DEBUGMSGTL(("access:etherStatsTable:ioctl", "_etherStats_ioctl_get\n")); -+ /* -+ * sanity checks -+ */ -+ if(NULL == name) { -+ DEBUGMSGTL(("access:etherStatsTable:ioctl", -+ "_etherStats_ioctl_get invalid ifname '%s'\n", name)); -+ snmp_log (LOG_ERR, "access:etherStatsTable:ioctl, _etherStats_ioctl_get error on inerface '%s'\n", name); -+ return -1; -+ } -+ -+ /* -+ * create socket for ioctls -+ */ -+ if(fd < 0) { -+ fd = ourfd = socket(AF_INET, SOCK_DGRAM, 0); -+ if(ourfd < 0) { -+ DEBUGMSGTL(("access:etherStatsTable:ioctl", -+ "_etherStats_ioctl_get couldn't create a socket\n", name)); -+ snmp_log (LOG_ERR, "access:etherStatsTable:ioctl, _etherStats_ioctl_get error on inerface '%s'\n", name); -+ -+ return -2; -+ } -+ } -+ -+ strncpy(ifrq->ifr_name, name, sizeof(ifrq->ifr_name)); -+ ifrq->ifr_name[ sizeof(ifrq->ifr_name)-1 ] = 0; -+ rc = ioctl(fd, which, ifrq); -+ if (rc < 0) { -+ DEBUGMSGTL(("access:etherStatsTable:ioctl", -+ "_etherStats_ioctl_get ioctl %d returned %d\n", which, rc)); -+ rc = -3; -+ } -+ -+ if(ourfd >= 0) -+ close(ourfd); -+ -+ return rc; -+} -+ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c 2008-08-25 02:37:27.000000000 -0400 -@@ -0,0 +1,229 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+/** \page MFD helper for etherStatsTable -+ * -+ * \section intro Introduction -+ * Introductory text. -+ * -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "etherStatsTable.h" -+ -+#include -+ -+#include "etherStatsTable_interface.h" -+ -+oid etherStatsTable_oid[] = { ETHERSTATSTABLE_OID }; -+int etherStatsTable_oid_size = OID_LENGTH(etherStatsTable_oid); -+ -+etherStatsTable_registration etherStatsTable_user_context; -+ -+void initialize_table_etherStatsTable(void); -+void shutdown_table_etherStatsTable(void); -+ -+ -+/** -+ * Initializes the etherStatsTable module -+ */ -+void -+init_etherStatsTable(void) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:init_etherStatsTable", -+ "called\n")); -+ -+ /* -+ * TODO:300:o: Perform etherStatsTable one-time module initialization. -+ */ -+ -+ /* -+ * here we initialize all the tables we're planning on supporting -+ */ -+ if (should_init("etherStatsTable")) -+ initialize_table_etherStatsTable(); -+ -+} /* init_etherStatsTable */ -+ -+/** -+ * Shut-down the etherStatsTable module (agent is exiting) -+ */ -+void -+shutdown_etherStatsTable(void) -+{ -+ if (should_init("etherStatsTable")) -+ shutdown_table_etherStatsTable(); -+ -+} -+ -+/** -+ * Initialize the table etherStatsTable -+ * (Define its contents and how it's structured) -+ */ -+void -+initialize_table_etherStatsTable(void) -+{ -+ etherStatsTable_registration *user_context; -+ u_long flags; -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:initialize_table_etherStatsTable", -+ "called\n")); -+ -+ /* -+ * TODO:301:o: Perform etherStatsTable one-time table initialization. -+ */ -+ -+ /* -+ * TODO:302:o: |->Initialize etherStatsTable 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("etherStatsTable", NULL, NULL); -+ -+ /* -+ * No support for any flags yet, but in the future you would -+ * set any flags here. -+ */ -+ flags = 0; -+ -+ /* -+ * call interface initialization code -+ */ -+ _etherStatsTable_initialize_interface(user_context, flags); -+} /* initialize_table_etherStatsTable */ -+ -+/** -+ * Shutdown the table etherStatsTable -+ */ -+void -+shutdown_table_etherStatsTable(void) -+{ -+ /* -+ * call interface shutdown code -+ */ -+ _etherStatsTable_shutdown_interface(ðerStatsTable_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 -+etherStatsTable_rowreq_ctx_init(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ void *user_init_ctx) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_rowreq_ctx_init", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:210:o: |-> Perform extra etherStatsTable rowreq initialization. (eg DEFVALS) -+ */ -+ -+ return MFD_SUCCESS; -+} /* etherStatsTable_rowreq_ctx_init */ -+ -+/** -+ * extra context cleanup -+ * -+ */ -+void -+etherStatsTable_rowreq_ctx_cleanup(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_rowreq_ctx_cleanup", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:211:o: |-> Perform extra etherStatsTable rowreq cleanup. -+ */ -+} /* etherStatsTable_rowreq_ctx_cleanup */ -+ -+/** -+ * pre-request callback -+ * -+ * -+ * @retval MFD_SUCCESS : success. -+ * @retval MFD_ERROR : other error -+ */ -+int -+etherStatsTable_pre_request(etherStatsTable_registration * user_context) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_pre_request", -+ "called\n")); -+ -+ /* -+ * TODO:510:o: Perform etherStatsTable pre-request actions. -+ */ -+ -+ return MFD_SUCCESS; -+} /* etherStatsTable_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 -+etherStatsTable_post_request(etherStatsTable_registration * user_context, -+ int rc) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_post_request", -+ "called\n")); -+ -+ /* -+ * TODO:511:o: Perform etherStatsTable post-request actions. -+ */ -+ -+ /* -+ * check to set if any rows were changed. -+ */ -+ if (etherStatsTable_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 -+ */ -+ } -+ -+ etherStatsTable_dirty_set(0); /* clear table dirty flag */ -+ } -+ -+ return MFD_SUCCESS; -+} /* etherStatsTable_post_request */ -+ -+ -+/** @{ */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c 2009-01-12 03:39:26.000000000 -0500 -@@ -0,0 +1,522 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "etherStatsTable.h" -+#include "etherStatsTable_data_access.h" -+ -+#if defined(linux) -+#include "ioctl_imp_common.h" -+#endif -+ -+/** @ingroup interface -+ * @addtogroup data_access data_access: Routines to access data -+ * -+ * These routines are used to locate the data used to satisfy -+ * requests. -+ * -+ * @{ -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table etherStatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * RMON-MIB::etherStatsTable is subid 1 of statistics. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.16.1.1, length: 9 -+ */ -+ -+/** -+ * initialization for etherStatsTable data access -+ * -+ * This function is called during startup to allow you to -+ * allocate any resources you need for the data table. -+ * -+ * @param etherStatsTable_reg -+ * Pointer to etherStatsTable_registration -+ * -+ * @retval MFD_SUCCESS : success. -+ * @retval MFD_ERROR : unrecoverable error. -+ */ -+int -+etherStatsTable_init_data(etherStatsTable_registration * -+ etherStatsTable_reg) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_init_data", -+ "called\n")); -+ -+ /* -+ * TODO:303:o: Initialize etherStatsTable data. -+ */ -+ -+ return MFD_SUCCESS; -+} /* etherStatsTable_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 -+etherStatsTable_container_init(netsnmp_container ** container_ptr_ptr, -+ netsnmp_cache * cache) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_container_init", -+ "called\n")); -+ -+ if (NULL == container_ptr_ptr) { -+ snmp_log(LOG_ERR, -+ "bad container param to etherStatsTable_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 etherStatsTable_container_init\n"); -+ return; -+ } -+ -+ /* -+ * TODO:345:A: Set up etherStatsTable 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 = ETHERSTATSTABLE_CACHE_TIMEOUT; /* seconds */ -+} /* etherStatsTable_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 etherStatsTable_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 -+etherStatsTable_container_shutdown(netsnmp_container * container_ptr) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_container_shutdown", "called\n")); -+ -+ if (NULL == container_ptr) { -+ snmp_log(LOG_ERR, -+ "bad params to etherStatsTable_container_shutdown\n"); -+ return; -+ } -+ -+} /* etherStatsTable_container_shutdown */ -+ -+/** -+ * load initial data -+ * -+ * TODO:350:M: Implement etherStatsTable 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 -+ * etherStatsTable_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 -+etherStatsTable_container_load(netsnmp_container * container) -+{ -+ etherStatsTable_rowreq_ctx *rowreq_ctx; -+ size_t count = 0; -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_container_load", -+ "called\n")); -+ -+ /* -+ * TODO:352:M: | |-> set indexes in new etherStatsTable rowreq context. -+ * data context will be set from the param (unless NULL, -+ * in which case a new data context will be allocated) -+ */ -+ -+ /* -+ * temporary storage for index values -+ */ -+ -+ /* -+ * etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h -+ */ -+ -+ long etherStatsIndex; -+ int fd; -+ int rc = 0, retval = 0; -+ -+#if defined(linux) -+ struct ifname *list_head = NULL, *p = NULL; -+#endif -+ -+ /* -+ * create socket for ioctls -+ */ -+ -+ fd = socket(AF_INET, SOCK_DGRAM, 0); -+ if(fd < 0) { -+ snmp_log(LOG_ERR, "could not create socket\n"); -+ return -2; -+ } -+ -+ /* -+ * get the interface names of the devices present in the system, in case of failure retval suggests the reson for failure -+ * and list_head contains null -+ */ -+ -+#if defined(linux) -+ list_head = etherstats_interface_name_list_get (list_head, &retval); -+ -+ if (!list_head) { -+ snmp_log (LOG_ERR, "access:etherStatsTable, error getting the interface names present in the system\n"); -+ DEBUGMSGTL(("access:etherStatsTable", "error getting the interface names present in the system")); -+ return MFD_ERROR; -+ } -+ -+ /* -+ * Walk over the list of interface names present in the system and retreive the statistics -+ */ -+ -+ for (p = list_head; p; p = p->ifn_next) { -+ u_int flags; -+ -+ flags = 0; -+ -+ DEBUGMSGTL(("access:etherStatsTable", "processing '%s'\n", p->name)); -+ -+ /* -+ * get index via ioctl. -+ */ -+ -+ etherStatsIndex = (long) etherstats_interface_ioctl_ifindex_get(-1, p->name); -+ -+ /* -+ * get the etherstats contents populated, if the device is not an ethernet device -+ * the operation will not be supported and an error message will be logged -+ */ -+ -+ rowreq_ctx = etherStatsTable_allocate_rowreq_ctx(NULL); -+ if (NULL == rowreq_ctx) { -+ snmp_log(LOG_ERR, "memory allocation failed\n"); -+ return MFD_RESOURCE_UNAVAILABLE; -+ } -+ -+ if (MFD_SUCCESS != -+ etherStatsTable_indexes_set(rowreq_ctx, etherStatsIndex)) { -+ snmp_log(LOG_ERR, -+ "error setting index while loading " -+ "etherStatsTable data.\n"); -+ etherStatsTable_release_rowreq_ctx(rowreq_ctx); -+ continue; -+ } -+ -+ /* -+ * TODO:352:r: | |-> populate etherStatsTable data context. -+ * Populate data context here. (optionally, delay until row prep) -+ */ -+ /* -+ * non-TRANSIENT data: no need to copy. set pointer to data -+ */ -+ -+ memset (&rowreq_ctx->data, 0, sizeof (rowreq_ctx->data)); -+ rc = interface_ioctl_etherstats_get (rowreq_ctx, fd, p->name); -+ -+ if (rc < 0) { -+ snmp_log(LOG_ERR, -+ "error getting the statistics for interface |%s| " -+ "etherStatsTable data, operation might not be supported \n", p->name); -+ DEBUGMSGTL(("access:etherStatsTable", "error getting the statistics for interface |%s| " -+ "etherStatsTable data, operation might not be supported\n", p->name)); -+ etherStatsTable_release_rowreq_ctx(rowreq_ctx); -+ continue; -+ } -+ -+ /* -+ * insert into table container -+ */ -+ CONTAINER_INSERT(container, rowreq_ctx); -+ ++count; -+ } -+ -+ /* -+ * free the interface names list -+ */ -+ -+ if ( (etherstats_interface_name_list_free(list_head)) < 0) { -+ snmp_log(LOG_ERR, "access:etherStatsTable, error freeing the interface name list \n"); -+ DEBUGMSGTL(("access:etherStatsTable", "error freeing the interface name list\n")); -+ return MFD_ERROR; -+ } -+#endif -+ -+ DEBUGMSGT(("verbose:etherStatsTable:etherStatsTable_container_load", -+ "inserted %d records\n", count)); -+ -+ return MFD_SUCCESS; -+} -+ /* etherStatsTable_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 -+etherStatsTable_container_free(netsnmp_container * container) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_container_free", -+ "called\n")); -+ -+ /* -+ * TODO:380:M: Free etherStatsTable container data. -+ */ -+} /* etherStatsTable_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 -+etherStatsTable_row_prep(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_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; -+} /* etherStatsTable_row_prep */ -+ -+/* -+ * TODO:420:r: Implement etherStatsTable index validation. -+ */ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsIndex -+ * etherStatsIndex is subid 1 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.1 -+ * Description: -+The value of this object uniquely identifies this -+ etherStats entry. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 1 hashint 0 -+ * settable 0 -+ * -+ * Ranges: 1 - 65535; -+ * -+ * Its syntax is INTEGER32 (based on perltype INTEGER32) -+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long) -+ */ -+/** -+ * check validity of etherStatsIndex 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 -+ * etherStatsTable_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 - 65535 -+ * -+ * If there a no other checks you need to do, simply return MFD_SUCCESS. -+ */ -+int -+etherStatsIndex_check_index(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsIndex_check_index", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:426:M: |-> Check etherStatsTable index etherStatsIndex. -+ * check that index value in the table context is legal. -+ * (rowreq_ctx->tbl_index.etherStatsIndex) -+ */ -+ -+ return MFD_SUCCESS; /* etherStatsIndex index ok */ -+} /* etherStatsIndex_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 etherStatsTable_reg -+ * Pointer to the user registration data -+ * @param etherStatsTable_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 -+etherStatsTable_validate_index(etherStatsTable_registration * -+ etherStatsTable_reg, -+ etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ int rc = MFD_SUCCESS; -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_validate_index", -+ "called\n")); -+ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:430:M: |-> Validate potential etherStatsTable index. -+ */ -+ if (1) { -+ snmp_log(LOG_WARNING, "invalid index for a new row in the " -+ "etherStatsTable 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; -+} /* etherStatsTable_validate_index */ -+ -+/** @} */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.h ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.h 2008-08-31 11:04:55.000000000 -0400 -@@ -0,0 +1,80 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+#ifndef ETHERSTATSTABLE_DATA_ACCESS_H -+#define ETHERSTATSTABLE_DATA_ACCESS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+ /* -+ ********************************************************************* -+ * function declarations -+ */ -+ -+ /* -+ ********************************************************************* -+ * Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table etherStatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * RMON-MIB::etherStatsTable is subid 1 of statistics. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.16.1.1, length: 9 -+ */ -+ -+ -+ int etherStatsTable_init_data(etherStatsTable_registration -+ * etherStatsTable_reg); -+ -+ -+ /* -+ * TODO:180:o: Review etherStatsTable cache timeout. -+ * The number of seconds before the cache times out -+ */ -+#define ETHERSTATSTABLE_CACHE_TIMEOUT 60 -+ -+ void etherStatsTable_container_init(netsnmp_container ** -+ container_ptr_ptr, -+ netsnmp_cache * cache); -+ void etherStatsTable_container_shutdown(netsnmp_container * -+ container_ptr); -+ -+ int etherStatsTable_container_load(netsnmp_container * -+ container); -+ void etherStatsTable_container_free(netsnmp_container * -+ container); -+ -+ int etherStatsTable_cache_load(netsnmp_container * -+ container); -+ void etherStatsTable_cache_free(netsnmp_container * -+ container); -+ -+#define MAX_LINE_SIZE 256 -+ -+ int etherStatsTable_row_prep(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int -+ etherStatsTable_validate_index(etherStatsTable_registration * -+ etherStatsTable_reg, -+ etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsIndex_check_index(etherStatsTable_rowreq_ctx * rowreq_ctx); /* internal */ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* ETHERSTATSTABLE_DATA_ACCESS_H */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c 2008-08-25 09:31:32.000000000 -0400 -@@ -0,0 +1,1411 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 12088 $ of $ -+ * -+ * $Id:$ -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "etherStatsTable.h" -+ -+ -+/** @defgroup data_get data_get: Routines to get data -+ * -+ * TODO:230:M: Implement etherStatsTable get routines. -+ * TODO:240:M: Implement etherStatsTable mapping routines (if any). -+ * -+ * These routine are used to get the value for individual objects. The -+ * row context is passed, along with a pointer to the memory where the -+ * value should be copied. -+ * -+ * @{ -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table etherStatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * RMON-MIB::etherStatsTable is subid 1 of statistics. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.16.1.1, length: 9 -+ */ -+ -+/* -+ * --------------------------------------------------------------------- -+ * * TODO:200:r: Implement etherStatsTable data context functions. -+ */ -+ -+ -+/** -+ * set mib index(es) -+ * -+ * @param tbl_idx mib index structure -+ * @param etherStatsIndex_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 -+etherStatsTable_indexes_set_tbl_idx(etherStatsTable_mib_index * tbl_idx, -+ long etherStatsIndex_val) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_indexes_set_tbl_idx", "called\n")); -+ -+ /* -+ * etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h -+ */ -+ tbl_idx->etherStatsIndex = etherStatsIndex_val; -+ -+ -+ return MFD_SUCCESS; -+} /* etherStatsTable_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 -+etherStatsTable_indexes_set(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ long etherStatsIndex_val) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_indexes_set", -+ "called\n")); -+ -+ if (MFD_SUCCESS != -+ etherStatsTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx, -+ etherStatsIndex_val)) -+ return MFD_ERROR; -+ -+ /* -+ * convert mib index to oid index -+ */ -+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid); -+ if (0 != etherStatsTable_index_to_oid(&rowreq_ctx->oid_idx, -+ &rowreq_ctx->tbl_idx)) { -+ return MFD_ERROR; -+ } -+ -+ return MFD_SUCCESS; -+} /* etherStatsTable_indexes_set */ -+ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsDataSource -+ * etherStatsDataSource is subid 2 of etherStatsEntry. -+ * Its status is Current, and its access level is Create. -+ * OID: .1.3.6.1.2.1.16.1.1.1.2 -+ * Description: -+This object identifies the source of the data that -+ this etherStats entry is configured to analyze. This -+ source can be any ethernet interface on this device. -+ In order to identify a particular interface, this object -+ shall identify the instance of the ifIndex object, -+ defined in RFC 2233 [17], for the desired interface. -+ For example, if an entry were to receive data from -+ interface #1, this object would be set to ifIndex.1. -+ -+ The statistics in this group reflect all packets -+ on the local network segment attached to the identified -+ interface. -+ -+ An agent may or may not be able to tell if fundamental -+ changes to the media of the interface have occurred and -+ necessitate an invalidation of this entry. For example, a -+ hot-pluggable ethernet card could be pulled out and replaced -+ by a token-ring card. In such a case, if the agent has such -+ knowledge of the change, it is recommended that it -+ invalidate this entry. -+ -+ This object may not be modified if the associated -+ etherStatsStatus object is equal to valid(1). -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 0 -+ * settable 1 -+ * -+ * -+ * Its syntax is OBJECTID (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 etherStatsDataSource data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsDataSource_val_ptr_ptr -+ * Pointer to storage for a oid variable -+ * @param etherStatsDataSource_val_ptr_len_ptr -+ * Pointer to a size_t. On entry, it will contain the size (in bytes) -+ * pointed to by etherStatsDataSource. -+ * 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 (*etherStatsDataSource_val_ptr_len_ptr) bytes of memory, -+ * allocate it using malloc() and update etherStatsDataSource_val_ptr_ptr. -+ * DO NOT 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 -+etherStatsDataSource_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ oid ** etherStatsDataSource_val_ptr_ptr, -+ size_t *etherStatsDataSource_val_ptr_len_ptr) -+{ -+ /** we should have a non-NULL pointer and enough storage */ -+ netsnmp_assert((NULL != etherStatsDataSource_val_ptr_ptr) -+ && (NULL != *etherStatsDataSource_val_ptr_ptr)); -+ netsnmp_assert(NULL != etherStatsDataSource_val_ptr_len_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsDataSource_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsDataSource data. -+ * copy (* etherStatsDataSource_val_ptr_ptr ) data and (* etherStatsDataSource_val_ptr_len_ptr ) from rowreq_ctx->data -+ */ -+ /* -+ * make sure there is enough space for etherStatsDataSource data -+ */ -+ if ((NULL == (*etherStatsDataSource_val_ptr_ptr)) || -+ ((*etherStatsDataSource_val_ptr_len_ptr) < -+ (rowreq_ctx->data.etherStatsDataSource_len * -+ sizeof(rowreq_ctx->data.etherStatsDataSource[0])))) { -+ /* -+ * allocate space for etherStatsDataSource data -+ */ -+ (*etherStatsDataSource_val_ptr_ptr) = -+ malloc(rowreq_ctx->data.etherStatsDataSource_len * -+ sizeof(rowreq_ctx->data.etherStatsDataSource[0])); -+ if (NULL == (*etherStatsDataSource_val_ptr_ptr)) { -+ snmp_log(LOG_ERR, "could not allocate memory\n"); -+ return MFD_ERROR; -+ } -+ } -+ (*etherStatsDataSource_val_ptr_len_ptr) = -+ rowreq_ctx->data.etherStatsDataSource_len * -+ sizeof(rowreq_ctx->data.etherStatsDataSource[0]); -+ memcpy((*etherStatsDataSource_val_ptr_ptr), -+ rowreq_ctx->data.etherStatsDataSource, -+ rowreq_ctx->data.etherStatsDataSource_len * -+ sizeof(rowreq_ctx->data.etherStatsDataSource[0])); -+ -+ return MFD_SUCCESS; -+} /* etherStatsDataSource_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsDropEvents -+ * etherStatsDropEvents is subid 3 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.3 -+ * Description: -+The total number of events in which packets -+ were dropped by the probe due to lack of resources. -+ Note that this number is not necessarily the number of -+ packets dropped; it is just the number of times this -+ condition has been detected. -+ * -+ * 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 etherStatsDropEvents data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsDropEvents_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 -+etherStatsDropEvents_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * etherStatsDropEvents_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsDropEvents_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsDropEvents_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsDropEvents data. -+ * copy (* etherStatsDropEvents_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsDropEvents_val_ptr) = -+ rowreq_ctx->data.etherStatsDropEvents; -+ -+ return MFD_SUCCESS; -+} /* etherStatsDropEvents_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsOctets -+ * etherStatsOctets is subid 4 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.4 -+ * Description: -+The total number of octets of data (including -+ those in bad packets) received on the -+ network (excluding framing bits but including -+ FCS octets). -+ -+ This object can be used as a reasonable estimate of -+ 10-Megabit ethernet utilization. If greater precision is -+ desired, the etherStatsPkts and etherStatsOctets objects -+ should be sampled before and after a common interval. The -+ differences in the sampled values are Pkts and Octets, -+ respectively, and the number of seconds in the interval is -+ Interval. These values are used to calculate the Utilization -+ as follows: -+ -+ Pkts * (9.6 + 6.4) + (Octets * .8) -+ Utilization = ------------------------------------- -+ Interval * 10,000 -+ -+ The result of this equation is the value Utilization which -+ is the percent utilization of the ethernet segment on a -+ scale of 0 to 100 percent. -+ * -+ * 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 etherStatsOctets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsOctets_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 -+etherStatsOctets_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * etherStatsOctets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsOctets_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOctets_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsOctets data. -+ * copy (* etherStatsOctets_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsOctets_val_ptr) = rowreq_ctx->data.etherStatsOctets; -+ -+ return MFD_SUCCESS; -+} /* etherStatsOctets_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsPkts -+ * etherStatsPkts is subid 5 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.5 -+ * Description: -+The total number of packets (including bad packets, -+ broadcast packets, and multicast packets) received. -+ * -+ * 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 etherStatsPkts data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsPkts_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 -+etherStatsPkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * etherStatsPkts_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsPkts_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts_get", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsPkts data. -+ * copy (* etherStatsPkts_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsPkts_val_ptr) = rowreq_ctx->data.etherStatsPkts; -+ -+ return MFD_SUCCESS; -+} /* etherStatsPkts_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsBroadcastPkts -+ * etherStatsBroadcastPkts is subid 6 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.6 -+ * Description: -+The total number of good packets received that were -+ directed to the broadcast address. Note that this -+ does not include multicast packets. -+ * -+ * 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 etherStatsBroadcastPkts data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsBroadcastPkts_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 -+etherStatsBroadcastPkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * etherStatsBroadcastPkts_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsBroadcastPkts_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsBroadcastPkts_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsBroadcastPkts data. -+ * copy (* etherStatsBroadcastPkts_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsBroadcastPkts_val_ptr) = -+ rowreq_ctx->data.etherStatsBroadcastPkts; -+ -+ return MFD_SUCCESS; -+} /* etherStatsBroadcastPkts_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsMulticastPkts -+ * etherStatsMulticastPkts is subid 7 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.7 -+ * Description: -+The total number of good packets received that were -+ directed to a multicast address. Note that this number -+ does not include packets directed to the broadcast -+ -+ address. -+ * -+ * 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 etherStatsMulticastPkts data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsMulticastPkts_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 -+etherStatsMulticastPkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * etherStatsMulticastPkts_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsMulticastPkts_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsMulticastPkts_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsMulticastPkts data. -+ * copy (* etherStatsMulticastPkts_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsMulticastPkts_val_ptr) = -+ rowreq_ctx->data.etherStatsMulticastPkts; -+ -+ return MFD_SUCCESS; -+} /* etherStatsMulticastPkts_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsCRCAlignErrors -+ * etherStatsCRCAlignErrors is subid 8 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.8 -+ * Description: -+The total number of packets received that -+ had a length (excluding framing bits, but -+ including FCS octets) of between 64 and 1518 -+ octets, inclusive, but had either a bad -+ Frame Check Sequence (FCS) with an integral -+ number of octets (FCS Error) or a bad FCS with -+ a non-integral number of octets (Alignment Error). -+ * -+ * 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 etherStatsCRCAlignErrors data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsCRCAlignErrors_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 -+etherStatsCRCAlignErrors_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * etherStatsCRCAlignErrors_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsCRCAlignErrors_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsCRCAlignErrors_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsCRCAlignErrors data. -+ * copy (* etherStatsCRCAlignErrors_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsCRCAlignErrors_val_ptr) = -+ rowreq_ctx->data.etherStatsCRCAlignErrors; -+ -+ return MFD_SUCCESS; -+} /* etherStatsCRCAlignErrors_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsUndersizePkts -+ * etherStatsUndersizePkts is subid 9 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.9 -+ * Description: -+The total number of packets received that were -+ less than 64 octets long (excluding framing bits, -+ but including FCS octets) and were otherwise well -+ formed. -+ * -+ * 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 etherStatsUndersizePkts data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsUndersizePkts_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 -+etherStatsUndersizePkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * etherStatsUndersizePkts_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsUndersizePkts_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsUndersizePkts_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsUndersizePkts data. -+ * copy (* etherStatsUndersizePkts_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsUndersizePkts_val_ptr) = -+ rowreq_ctx->data.etherStatsUndersizePkts; -+ -+ return MFD_SUCCESS; -+} /* etherStatsUndersizePkts_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsOversizePkts -+ * etherStatsOversizePkts is subid 10 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.10 -+ * Description: -+The total number of packets received that were -+ longer than 1518 octets (excluding framing bits, -+ but including FCS octets) and were otherwise -+ well formed. -+ * -+ * 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 etherStatsOversizePkts data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsOversizePkts_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 -+etherStatsOversizePkts_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * etherStatsOversizePkts_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsOversizePkts_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOversizePkts_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsOversizePkts data. -+ * copy (* etherStatsOversizePkts_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsOversizePkts_val_ptr) = -+ rowreq_ctx->data.etherStatsOversizePkts; -+ -+ return MFD_SUCCESS; -+} /* etherStatsOversizePkts_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsFragments -+ * etherStatsFragments is subid 11 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.11 -+ * Description: -+The total number of packets received that were less than -+ 64 octets in length (excluding framing bits but including -+ FCS octets) and had either a bad Frame Check Sequence -+ (FCS) with an integral number of octets (FCS Error) or a -+ bad FCS with a non-integral number of octets (Alignment -+ Error). -+ -+ Note that it is entirely normal for etherStatsFragments to -+ increment. This is because it counts both runts (which are -+ normal occurrences due to collisions) and noise hits. -+ * -+ * 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 etherStatsFragments data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsFragments_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 -+etherStatsFragments_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * etherStatsFragments_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsFragments_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsFragments_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsFragments data. -+ * copy (* etherStatsFragments_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsFragments_val_ptr) = rowreq_ctx->data.etherStatsFragments; -+ -+ return MFD_SUCCESS; -+} /* etherStatsFragments_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsJabbers -+ * etherStatsJabbers is subid 12 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.12 -+ * Description: -+The total number of packets received that were -+ longer than 1518 octets (excluding framing bits, -+ but including FCS octets), and had either a bad -+ Frame Check Sequence (FCS) with an integral number -+ of octets (FCS Error) or a bad FCS with a non-integral -+ number of octets (Alignment Error). -+ -+ Note that this definition of jabber is different -+ than the definition in IEEE-802.3 section 8.2.1.5 -+ (10BASE5) and section 10.3.1.4 (10BASE2). These -+ documents define jabber as the condition where any -+ packet exceeds 20 ms. The allowed range to detect -+ jabber is between 20 ms and 150 ms. -+ * -+ * 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 etherStatsJabbers data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsJabbers_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 -+etherStatsJabbers_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * etherStatsJabbers_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsJabbers_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsJabbers_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsJabbers data. -+ * copy (* etherStatsJabbers_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsJabbers_val_ptr) = rowreq_ctx->data.etherStatsJabbers; -+ -+ return MFD_SUCCESS; -+} /* etherStatsJabbers_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsCollisions -+ * etherStatsCollisions is subid 13 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.13 -+ * Description: -+The best estimate of the total number of collisions -+ on this Ethernet segment. -+ -+ The value returned will depend on the location of the -+ RMON probe. Section 8.2.1.3 (10BASE-5) and section -+ 10.3.1.3 (10BASE-2) of IEEE standard 802.3 states that a -+ station must detect a collision, in the receive mode, if -+ three or more stations are transmitting simultaneously. A -+ repeater port must detect a collision when two or more -+ -+ stations are transmitting simultaneously. Thus a probe -+ placed on a repeater port could record more collisions -+ than a probe connected to a station on the same segment -+ would. -+ -+ Probe location plays a much smaller role when considering -+ 10BASE-T. 14.2.1.4 (10BASE-T) of IEEE standard 802.3 -+ defines a collision as the simultaneous presence of signals -+ on the DO and RD circuits (transmitting and receiving -+ at the same time). A 10BASE-T station can only detect -+ collisions when it is transmitting. Thus probes placed on -+ a station and a repeater, should report the same number of -+ collisions. -+ -+ Note also that an RMON probe inside a repeater should -+ ideally report collisions between the repeater and one or -+ more other hosts (transmit collisions as defined by IEEE -+ 802.3k) plus receiver collisions observed on any coax -+ segments to which the repeater is connected. -+ * -+ * 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 etherStatsCollisions data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsCollisions_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 -+etherStatsCollisions_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * etherStatsCollisions_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsCollisions_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsCollisions_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsCollisions data. -+ * copy (* etherStatsCollisions_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsCollisions_val_ptr) = -+ rowreq_ctx->data.etherStatsCollisions; -+ -+ return MFD_SUCCESS; -+} /* etherStatsCollisions_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsPkts64Octets -+ * etherStatsPkts64Octets is subid 14 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.14 -+ * Description: -+The total number of packets (including bad -+ packets) received that were 64 octets in length -+ (excluding framing bits but including FCS octets). -+ * -+ * 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 etherStatsPkts64Octets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsPkts64Octets_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 -+etherStatsPkts64Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * etherStatsPkts64Octets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsPkts64Octets_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts64Octets_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsPkts64Octets data. -+ * copy (* etherStatsPkts64Octets_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsPkts64Octets_val_ptr) = -+ rowreq_ctx->data.etherStatsPkts64Octets; -+ -+ return MFD_SUCCESS; -+} /* etherStatsPkts64Octets_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsPkts65to127Octets -+ * etherStatsPkts65to127Octets is subid 15 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.15 -+ * Description: -+The total number of packets (including bad -+ packets) received that were between -+ 65 and 127 octets in length inclusive -+ (excluding framing bits but including FCS octets). -+ * -+ * 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 etherStatsPkts65to127Octets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsPkts65to127Octets_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 -+etherStatsPkts65to127Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * -+ etherStatsPkts65to127Octets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsPkts65to127Octets_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts65to127Octets_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsPkts65to127Octets data. -+ * copy (* etherStatsPkts65to127Octets_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsPkts65to127Octets_val_ptr) = -+ rowreq_ctx->data.etherStatsPkts65to127Octets; -+ -+ return MFD_SUCCESS; -+} /* etherStatsPkts65to127Octets_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsPkts128to255Octets -+ * etherStatsPkts128to255Octets is subid 16 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.16 -+ * Description: -+The total number of packets (including bad -+ packets) received that were between -+ 128 and 255 octets in length inclusive -+ (excluding framing bits but including FCS octets). -+ * -+ * 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 etherStatsPkts128to255Octets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsPkts128to255Octets_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 -+etherStatsPkts128to255Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * -+ etherStatsPkts128to255Octets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsPkts128to255Octets_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts128to255Octets_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsPkts128to255Octets data. -+ * copy (* etherStatsPkts128to255Octets_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsPkts128to255Octets_val_ptr) = -+ rowreq_ctx->data.etherStatsPkts128to255Octets; -+ -+ return MFD_SUCCESS; -+} /* etherStatsPkts128to255Octets_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsPkts256to511Octets -+ * etherStatsPkts256to511Octets is subid 17 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.17 -+ * Description: -+The total number of packets (including bad -+ packets) received that were between -+ 256 and 511 octets in length inclusive -+ (excluding framing bits but including FCS octets). -+ * -+ * 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 etherStatsPkts256to511Octets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsPkts256to511Octets_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 -+etherStatsPkts256to511Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * -+ etherStatsPkts256to511Octets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsPkts256to511Octets_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts256to511Octets_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsPkts256to511Octets data. -+ * copy (* etherStatsPkts256to511Octets_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsPkts256to511Octets_val_ptr) = -+ rowreq_ctx->data.etherStatsPkts256to511Octets; -+ -+ return MFD_SUCCESS; -+} /* etherStatsPkts256to511Octets_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsPkts512to1023Octets -+ * etherStatsPkts512to1023Octets is subid 18 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.18 -+ * Description: -+The total number of packets (including bad -+ packets) received that were between -+ 512 and 1023 octets in length inclusive -+ (excluding framing bits but including FCS octets). -+ * -+ * 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 etherStatsPkts512to1023Octets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsPkts512to1023Octets_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 -+etherStatsPkts512to1023Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * -+ etherStatsPkts512to1023Octets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsPkts512to1023Octets_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts512to1023Octets_get", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsPkts512to1023Octets data. -+ * copy (* etherStatsPkts512to1023Octets_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsPkts512to1023Octets_val_ptr) = -+ rowreq_ctx->data.etherStatsPkts512to1023Octets; -+ -+ return MFD_SUCCESS; -+} /* etherStatsPkts512to1023Octets_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsPkts1024to1518Octets -+ * etherStatsPkts1024to1518Octets is subid 19 of etherStatsEntry. -+ * Its status is Current, and its access level is ReadOnly. -+ * OID: .1.3.6.1.2.1.16.1.1.1.19 -+ * Description: -+The total number of packets (including bad -+ packets) received that were between -+ 1024 and 1518 octets in length inclusive -+ (excluding framing bits but including FCS octets). -+ * -+ * 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 etherStatsPkts1024to1518Octets data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsPkts1024to1518Octets_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 -+etherStatsPkts1024to1518Octets_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * -+ etherStatsPkts1024to1518Octets_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsPkts1024to1518Octets_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsPkts1024to1518Octets_get", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsPkts1024to1518Octets data. -+ * copy (* etherStatsPkts1024to1518Octets_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsPkts1024to1518Octets_val_ptr) = -+ rowreq_ctx->data.etherStatsPkts1024to1518Octets; -+ -+ return MFD_SUCCESS; -+} /* etherStatsPkts1024to1518Octets_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsOwner -+ * etherStatsOwner is subid 20 of etherStatsEntry. -+ * Its status is Current, and its access level is Create. -+ * OID: .1.3.6.1.2.1.16.1.1.1.20 -+ * Description: -+The entity that configured this entry and is therefore -+ using the resources assigned to it. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 1 hashint 0 -+ * settable 1 -+ * -+ * Ranges: 0 - 127; -+ * -+ * Its syntax is OwnerString (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 127) -+ */ -+/** -+ * Extract the current value of the etherStatsOwner data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsOwner_val_ptr_ptr -+ * Pointer to storage for a char variable -+ * @param etherStatsOwner_val_ptr_len_ptr -+ * Pointer to a size_t. On entry, it will contain the size (in bytes) -+ * pointed to by etherStatsOwner. -+ * 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 (*etherStatsOwner_val_ptr_len_ptr) bytes of memory, -+ * allocate it using malloc() and update etherStatsOwner_val_ptr_ptr. -+ * DO NOT 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 -+etherStatsOwner_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ char **etherStatsOwner_val_ptr_ptr, -+ size_t *etherStatsOwner_val_ptr_len_ptr) -+{ -+ /** we should have a non-NULL pointer and enough storage */ -+ netsnmp_assert((NULL != etherStatsOwner_val_ptr_ptr) -+ && (NULL != *etherStatsOwner_val_ptr_ptr)); -+ netsnmp_assert(NULL != etherStatsOwner_val_ptr_len_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOwner_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsOwner data. -+ * copy (* etherStatsOwner_val_ptr_ptr ) data and (* etherStatsOwner_val_ptr_len_ptr ) from rowreq_ctx->data -+ */ -+ /* -+ * make sure there is enough space for etherStatsOwner data -+ */ -+ if ((NULL == (*etherStatsOwner_val_ptr_ptr)) || -+ ((*etherStatsOwner_val_ptr_len_ptr) < -+ (rowreq_ctx->data.etherStatsOwner_len * -+ sizeof(rowreq_ctx->data.etherStatsOwner[0])))) { -+ /* -+ * allocate space for etherStatsOwner data -+ */ -+ (*etherStatsOwner_val_ptr_ptr) = -+ malloc(rowreq_ctx->data.etherStatsOwner_len * -+ sizeof(rowreq_ctx->data.etherStatsOwner[0])); -+ if (NULL == (*etherStatsOwner_val_ptr_ptr)) { -+ snmp_log(LOG_ERR, "could not allocate memory\n"); -+ return MFD_ERROR; -+ } -+ } -+ (*etherStatsOwner_val_ptr_len_ptr) = -+ rowreq_ctx->data.etherStatsOwner_len * -+ sizeof(rowreq_ctx->data.etherStatsOwner[0]); -+ memcpy((*etherStatsOwner_val_ptr_ptr), -+ rowreq_ctx->data.etherStatsOwner, -+ rowreq_ctx->data.etherStatsOwner_len * -+ sizeof(rowreq_ctx->data.etherStatsOwner[0])); -+ -+ return MFD_SUCCESS; -+} /* etherStatsOwner_get */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsStatus -+ * etherStatsStatus is subid 21 of etherStatsEntry. -+ * Its status is Current, and its access level is Create. -+ * OID: .1.3.6.1.2.1.16.1.1.1.21 -+ * Description: -+The status of this etherStats entry. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 1 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 0 -+ * settable 1 -+ * -+ * Enum range: 2/8. Values: valid(1), createRequest(2), underCreation(3), invalid(4) -+ * -+ * Its syntax is EntryStatus (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 etherStatsStatus data. -+ * -+ * Set a value using the data context for the row. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsStatus_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 -+etherStatsStatus_get(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long * etherStatsStatus_val_ptr) -+{ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != etherStatsStatus_val_ptr); -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsStatus_get", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:231:o: |-> Extract the current value of the etherStatsStatus data. -+ * copy (* etherStatsStatus_val_ptr ) from rowreq_ctx->data -+ */ -+ (*etherStatsStatus_val_ptr) = rowreq_ctx->data.etherStatsStatus; -+ -+ return MFD_SUCCESS; -+} /* etherStatsStatus_get */ -+ -+ -+ -+/** @} */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h 2008-08-25 02:37:27.000000000 -0400 -@@ -0,0 +1,151 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 12088 $ of $ -+ * -+ * $Id:$ -+ * -+ * @file etherStatsTable_data_get.h -+ * -+ * @addtogroup get -+ * -+ * Prototypes for get functions -+ * -+ * @{ -+ */ -+#ifndef ETHERSTATSTABLE_DATA_GET_H -+#define ETHERSTATSTABLE_DATA_GET_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ /* -+ ********************************************************************* -+ * GET function declarations -+ */ -+ -+ /* -+ ********************************************************************* -+ * GET Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table etherStatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * RMON-MIB::etherStatsTable is subid 1 of statistics. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.16.1.1, length: 9 -+ */ -+ /* -+ * indexes -+ */ -+ -+ int etherStatsDataSource_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ oid ** -+ etherStatsDataSource_val_ptr_ptr, -+ size_t -+ *etherStatsDataSource_val_ptr_len_ptr); -+ int etherStatsDropEvents_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ etherStatsDropEvents_val_ptr); -+ int etherStatsOctets_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ etherStatsOctets_val_ptr); -+ int etherStatsPkts_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * etherStatsPkts_val_ptr); -+ int etherStatsBroadcastPkts_get(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long * -+ etherStatsBroadcastPkts_val_ptr); -+ int etherStatsMulticastPkts_get(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long * -+ etherStatsMulticastPkts_val_ptr); -+ int etherStatsCRCAlignErrors_get(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long * -+ etherStatsCRCAlignErrors_val_ptr); -+ int etherStatsUndersizePkts_get(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long * -+ etherStatsUndersizePkts_val_ptr); -+ int etherStatsOversizePkts_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ etherStatsOversizePkts_val_ptr); -+ int etherStatsFragments_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ etherStatsFragments_val_ptr); -+ int etherStatsJabbers_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ etherStatsJabbers_val_ptr); -+ int etherStatsCollisions_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ etherStatsCollisions_val_ptr); -+ int etherStatsPkts64Octets_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ etherStatsPkts64Octets_val_ptr); -+ int -+ etherStatsPkts65to127Octets_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ etherStatsPkts65to127Octets_val_ptr); -+ int -+ etherStatsPkts128to255Octets_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ etherStatsPkts128to255Octets_val_ptr); -+ int -+ etherStatsPkts256to511Octets_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ etherStatsPkts256to511Octets_val_ptr); -+ int -+ etherStatsPkts512to1023Octets_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ etherStatsPkts512to1023Octets_val_ptr); -+ int -+ etherStatsPkts1024to1518Octets_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ etherStatsPkts1024to1518Octets_val_ptr); -+ int etherStatsOwner_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ char **etherStatsOwner_val_ptr_ptr, -+ size_t -+ *etherStatsOwner_val_ptr_len_ptr); -+ int etherStatsStatus_get(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long * -+ etherStatsStatus_val_ptr); -+ -+ -+ int -+ etherStatsTable_indexes_set_tbl_idx(etherStatsTable_mib_index * -+ tbl_idx, -+ long etherStatsIndex_val); -+ int etherStatsTable_indexes_set(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ long etherStatsIndex_val); -+ -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* ETHERSTATSTABLE_DATA_GET_H */ -+/** @} */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c 2008-08-25 02:37:27.000000000 -0400 -@@ -0,0 +1,977 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 12077 $ of $ -+ * -+ * $Id:$ -+ * -+ */ -+/* -+ * standard Net-SNMP includes -+ */ -+#include -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "etherStatsTable.h" -+ -+ -+/** @defgroup data_set data_set: Routines to set data -+ * -+ * These routines are used to set the value for individual objects. The -+ * row context is passed, along with the new value. -+ * -+ * @{ -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table etherStatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * RMON-MIB::etherStatsTable is subid 1 of statistics. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.16.1.1, length: 9 -+ */ -+ /* -+ * 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 -+ * etherStatsTable_allocate_data(), but may need extra -+ * initialization similar to what you may have done in -+ * etherStatsTable_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 (etherStatsTable_rowreq_ctx) -+ * -+ * @retval MFD_SUCCESS : success -+ * @retval MFD_ERROR : error. set will fail. -+ */ -+int -+etherStatsTable_undo_setup(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ int rc = MFD_SUCCESS; -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_undo_setup", -+ "called\n")); -+ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:451:M: |-> Setup etherStatsTable undo. -+ * set up etherStatsTable undo information, in preparation for a set. -+ * Undo storage is in (* etherStatsStatus_val_ptr )* -+ */ -+ -+ return rc; -+} /* etherStatsTable_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 (etherStatsTable_rowreq_ctx) -+ * -+ * @retval MFD_SUCCESS : success -+ * @retval MFD_ERROR : error. set will fail. -+ */ -+int -+etherStatsTable_undo(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ int rc = MFD_SUCCESS; -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_undo", -+ "called\n")); -+ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:451:M: |-> etherStatsTable undo. -+ * etherStatsTable undo information, in response to a failed set. -+ * Undo storage is in (* etherStatsStatus_val_ptr )* -+ */ -+ -+ return rc; -+} /* etherStatsTable_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 (etherStatsTable_rowreq_ctx) -+ * -+ * @retval MFD_SUCCESS : success -+ * @retval MFD_ERROR : error -+ */ -+int -+etherStatsTable_undo_cleanup(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ int rc = MFD_SUCCESS; -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_undo_cleanup", -+ "called\n")); -+ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:452:M: |-> Cleanup etherStatsTable undo. -+ * Undo storage is in (* etherStatsStatus_val_ptr )* -+ */ -+ -+ return rc; -+} /* etherStatsTable_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 -+ * etherStatsTable_oids.h. -+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags. -+ * -+ * @param etherStatsTable_rowreq_ctx -+ * Pointer to the users context. -+ * -+ * @retval MFD_SUCCESS : success -+ * @retval MFD_ERROR : error -+ */ -+int -+etherStatsTable_commit(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ int rc = MFD_SUCCESS; -+ int save_flags; -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_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 etherStatsTable 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_ETHERSTATSDATASOURCE_FLAG) { -+ save_flags &= ~COLUMN_ETHERSTATSDATASOURCE_FLAG; /* clear etherStatsDataSource */ -+ /* -+ * TODO:482:o: |-> commit column etherStatsDataSource. -+ */ -+ rc = -1; -+ if (-1 == rc) { -+ snmp_log(LOG_ERR, -+ "etherStatsTable column etherStatsDataSource commit failed\n"); -+ } else { -+ /* -+ * set flag, in case we need to undo etherStatsDataSource -+ */ -+ rowreq_ctx->column_set_flags |= -+ COLUMN_ETHERSTATSDATASOURCE_FLAG; -+ } -+ } -+ -+ if (save_flags & COLUMN_ETHERSTATSOWNER_FLAG) { -+ save_flags &= ~COLUMN_ETHERSTATSOWNER_FLAG; /* clear etherStatsOwner */ -+ /* -+ * TODO:482:o: |-> commit column etherStatsOwner. -+ */ -+ rc = -1; -+ if (-1 == rc) { -+ snmp_log(LOG_ERR, -+ "etherStatsTable column etherStatsOwner commit failed\n"); -+ } else { -+ /* -+ * set flag, in case we need to undo etherStatsOwner -+ */ -+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSOWNER_FLAG; -+ } -+ } -+ -+ if (save_flags & COLUMN_ETHERSTATSSTATUS_FLAG) { -+ save_flags &= ~COLUMN_ETHERSTATSSTATUS_FLAG; /* clear etherStatsStatus */ -+ /* -+ * TODO:482:o: |-> commit column etherStatsStatus. -+ */ -+ rc = -1; -+ if (-1 == rc) { -+ snmp_log(LOG_ERR, -+ "etherStatsTable column etherStatsStatus commit failed\n"); -+ } else { -+ /* -+ * set flag, in case we need to undo etherStatsStatus -+ */ -+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSSTATUS_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; -+} /* etherStatsTable_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 -+ * etherStatsTable_oids.h. -+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags. -+ * -+ * @param etherStatsTable_rowreq_ctx -+ * Pointer to the users context. -+ * -+ * @retval MFD_SUCCESS : success -+ * @retval MFD_ERROR : error -+ */ -+int -+etherStatsTable_undo_commit(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ int rc = MFD_SUCCESS; -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_undo_commit", -+ "called\n")); -+ -+ /** we should have a non-NULL pointer */ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:485:M: |-> Undo etherStatsTable 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; -+} /* etherStatsTable_undo_commit */ -+ -+/* -+ * TODO:440:M: Implement etherStatsTable node value checks. -+ * TODO:450:M: Implement etherStatsTable undo functions. -+ * TODO:460:M: Implement etherStatsTable set functions. -+ * TODO:480:M: Implement etherStatsTable commit functions. -+ */ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsDataSource -+ * etherStatsDataSource is subid 2 of etherStatsEntry. -+ * Its status is Current, and its access level is Create. -+ * OID: .1.3.6.1.2.1.16.1.1.1.2 -+ * Description: -+This object identifies the source of the data that -+ this etherStats entry is configured to analyze. This -+ source can be any ethernet interface on this device. -+ In order to identify a particular interface, this object -+ shall identify the instance of the ifIndex object, -+ defined in RFC 2233 [17], for the desired interface. -+ For example, if an entry were to receive data from -+ interface #1, this object would be set to ifIndex.1. -+ -+ The statistics in this group reflect all packets -+ on the local network segment attached to the identified -+ interface. -+ -+ An agent may or may not be able to tell if fundamental -+ changes to the media of the interface have occurred and -+ necessitate an invalidation of this entry. For example, a -+ hot-pluggable ethernet card could be pulled out and replaced -+ by a token-ring card. In such a case, if the agent has such -+ knowledge of the change, it is recommended that it -+ invalidate this entry. -+ -+ This object may not be modified if the associated -+ etherStatsStatus object is equal to valid(1). -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 0 -+ * settable 1 -+ * -+ * -+ * Its syntax is OBJECTID (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. -+ */ -+/** -+ * Check that the proposed new value is potentially valid. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsDataSource_val_ptr -+ * A oid containing the new value. -+ * @param etherStatsDataSource_val_ptr_len -+ * The size (in bytes) of the data pointed to by etherStatsDataSource_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). -+ * -+ * 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 -+ * etherStatsTable_check_dependencies() function. -+ * -+ * The following checks have already been done for you: -+ * The syntax is ASN_OBJECT_ID -+ * The length is < sizeof(rowreq_ctx->data.etherStatsDataSource). -+ * -+ * If there a no other checks you need to do, simply return MFD_SUCCESS. -+ * -+ */ -+int -+etherStatsDataSource_check_value(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ oid * etherStatsDataSource_val_ptr, -+ size_t etherStatsDataSource_val_ptr_len) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsDataSource_check_value", -+ "called\n")); -+ -+ /** should never get a NULL pointer */ -+ netsnmp_assert(NULL != rowreq_ctx); -+ netsnmp_assert(NULL != etherStatsDataSource_val_ptr); -+ -+ /* -+ * TODO:441:o: |-> Check for valid etherStatsDataSource value. -+ */ -+ -+ return MFD_SUCCESS; /* etherStatsDataSource value not illegal */ -+} /* etherStatsDataSource_check_value */ -+ -+/** -+ * Save old value information -+ * -+ * @param rowreq_ctx -+ * Pointer to the table context (etherStatsTable_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 -+ * etherStatsTable_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 -+etherStatsDataSource_undo_setup(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsDataSource_undo_setup", -+ "called\n")); -+ -+ /** should never get a NULL pointer */ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:455:o: |-> Setup etherStatsDataSource undo. -+ */ -+ /* -+ * copy etherStatsDataSource and etherStatsDataSource_len data -+ * set rowreq_ctx->undo->etherStatsDataSource from rowreq_ctx->data.etherStatsDataSource -+ */ -+ memcpy(rowreq_ctx->undo->etherStatsDataSource, -+ rowreq_ctx->data.etherStatsDataSource, -+ (rowreq_ctx->data.etherStatsDataSource_len * -+ sizeof(rowreq_ctx->undo->etherStatsDataSource[0]))); -+ rowreq_ctx->undo->etherStatsDataSource_len = -+ rowreq_ctx->data.etherStatsDataSource_len; -+ -+ -+ return MFD_SUCCESS; -+} /* etherStatsDataSource_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 etherStatsDataSource_val_ptr -+ * A oid containing the new value. -+ * @param etherStatsDataSource_val_ptr_len -+ * The size (in bytes) of the data pointed to by etherStatsDataSource_val_ptr -+ */ -+int -+etherStatsDataSource_set(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ oid * etherStatsDataSource_val_ptr, -+ size_t etherStatsDataSource_val_ptr_len) -+{ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsDataSource_set", -+ "called\n")); -+ -+ /** should never get a NULL pointer */ -+ netsnmp_assert(NULL != rowreq_ctx); -+ netsnmp_assert(NULL != etherStatsDataSource_val_ptr); -+ -+ /* -+ * TODO:461:M: |-> Set etherStatsDataSource value. -+ * set etherStatsDataSource value in rowreq_ctx->data -+ */ -+ memcpy(rowreq_ctx->data.etherStatsDataSource, -+ etherStatsDataSource_val_ptr, etherStatsDataSource_val_ptr_len); -+ /** convert bytes to number of oid */ -+ rowreq_ctx->data.etherStatsDataSource_len = -+ etherStatsDataSource_val_ptr_len / -+ sizeof(etherStatsDataSource_val_ptr[0]); -+ -+ return MFD_SUCCESS; -+} /* etherStatsDataSource_set */ -+ -+/** -+ * undo the previous set. -+ * -+ * @param rowreq_ctx -+ * Pointer to the users context. -+ */ -+int -+etherStatsDataSource_undo(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsDataSource_undo", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:456:o: |-> Clean up etherStatsDataSource undo. -+ */ -+ /* -+ * copy etherStatsDataSource and etherStatsDataSource_len data -+ * set rowreq_ctx->data.etherStatsDataSource from rowreq_ctx->undo->etherStatsDataSource -+ */ -+ memcpy(rowreq_ctx->data.etherStatsDataSource, -+ rowreq_ctx->undo->etherStatsDataSource, -+ (rowreq_ctx->undo->etherStatsDataSource_len * -+ sizeof(rowreq_ctx->data.etherStatsDataSource[0]))); -+ rowreq_ctx->data.etherStatsDataSource_len = -+ rowreq_ctx->undo->etherStatsDataSource_len; -+ -+ -+ return MFD_SUCCESS; -+} /* etherStatsDataSource_undo */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsOwner -+ * etherStatsOwner is subid 20 of etherStatsEntry. -+ * Its status is Current, and its access level is Create. -+ * OID: .1.3.6.1.2.1.16.1.1.1.20 -+ * Description: -+The entity that configured this entry and is therefore -+ using the resources assigned to it. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 0 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 1 hashint 0 -+ * settable 1 -+ * -+ * Ranges: 0 - 127; -+ * -+ * Its syntax is OwnerString (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 127) -+ */ -+/** -+ * Check that the proposed new value is potentially valid. -+ * -+ * @param rowreq_ctx -+ * Pointer to the row request context. -+ * @param etherStatsOwner_val_ptr -+ * A char containing the new value. -+ * @param etherStatsOwner_val_ptr_len -+ * The size (in bytes) of the data pointed to by etherStatsOwner_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). -+ * -+ * 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 -+ * etherStatsTable_check_dependencies() function. -+ * -+ * The following checks have already been done for you: -+ * The syntax is ASN_OCTET_STR -+ * The length is < sizeof(rowreq_ctx->data.etherStatsOwner). -+ * The length is in (one of) the range set(s): 0 - 127 -+ * -+ * If there a no other checks you need to do, simply return MFD_SUCCESS. -+ * -+ */ -+int -+etherStatsOwner_check_value(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ char *etherStatsOwner_val_ptr, -+ size_t etherStatsOwner_val_ptr_len) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOwner_check_value", -+ "called\n")); -+ -+ /** should never get a NULL pointer */ -+ netsnmp_assert(NULL != rowreq_ctx); -+ netsnmp_assert(NULL != etherStatsOwner_val_ptr); -+ -+ /* -+ * TODO:441:o: |-> Check for valid etherStatsOwner value. -+ */ -+ -+ return MFD_SUCCESS; /* etherStatsOwner value not illegal */ -+} /* etherStatsOwner_check_value */ -+ -+/** -+ * Save old value information -+ * -+ * @param rowreq_ctx -+ * Pointer to the table context (etherStatsTable_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 -+ * etherStatsTable_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 -+etherStatsOwner_undo_setup(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOwner_undo_setup", -+ "called\n")); -+ -+ /** should never get a NULL pointer */ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:455:o: |-> Setup etherStatsOwner undo. -+ */ -+ /* -+ * copy etherStatsOwner and etherStatsOwner_len data -+ * set rowreq_ctx->undo->etherStatsOwner from rowreq_ctx->data.etherStatsOwner -+ */ -+ memcpy(rowreq_ctx->undo->etherStatsOwner, -+ rowreq_ctx->data.etherStatsOwner, -+ (rowreq_ctx->data.etherStatsOwner_len * -+ sizeof(rowreq_ctx->undo->etherStatsOwner[0]))); -+ rowreq_ctx->undo->etherStatsOwner_len = -+ rowreq_ctx->data.etherStatsOwner_len; -+ -+ -+ return MFD_SUCCESS; -+} /* etherStatsOwner_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 etherStatsOwner_val_ptr -+ * A char containing the new value. -+ * @param etherStatsOwner_val_ptr_len -+ * The size (in bytes) of the data pointed to by etherStatsOwner_val_ptr -+ */ -+int -+etherStatsOwner_set(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ char *etherStatsOwner_val_ptr, -+ size_t etherStatsOwner_val_ptr_len) -+{ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOwner_set", -+ "called\n")); -+ -+ /** should never get a NULL pointer */ -+ netsnmp_assert(NULL != rowreq_ctx); -+ netsnmp_assert(NULL != etherStatsOwner_val_ptr); -+ -+ /* -+ * TODO:461:M: |-> Set etherStatsOwner value. -+ * set etherStatsOwner value in rowreq_ctx->data -+ */ -+ memcpy(rowreq_ctx->data.etherStatsOwner, etherStatsOwner_val_ptr, -+ etherStatsOwner_val_ptr_len); -+ /** convert bytes to number of char */ -+ rowreq_ctx->data.etherStatsOwner_len = -+ etherStatsOwner_val_ptr_len / sizeof(etherStatsOwner_val_ptr[0]); -+ -+ return MFD_SUCCESS; -+} /* etherStatsOwner_set */ -+ -+/** -+ * undo the previous set. -+ * -+ * @param rowreq_ctx -+ * Pointer to the users context. -+ */ -+int -+etherStatsOwner_undo(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsOwner_undo", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:456:o: |-> Clean up etherStatsOwner undo. -+ */ -+ /* -+ * copy etherStatsOwner and etherStatsOwner_len data -+ * set rowreq_ctx->data.etherStatsOwner from rowreq_ctx->undo->etherStatsOwner -+ */ -+ memcpy(rowreq_ctx->data.etherStatsOwner, -+ rowreq_ctx->undo->etherStatsOwner, -+ (rowreq_ctx->undo->etherStatsOwner_len * -+ sizeof(rowreq_ctx->data.etherStatsOwner[0]))); -+ rowreq_ctx->data.etherStatsOwner_len = -+ rowreq_ctx->undo->etherStatsOwner_len; -+ -+ -+ return MFD_SUCCESS; -+} /* etherStatsOwner_undo */ -+ -+/*--------------------------------------------------------------------- -+ * RMON-MIB::etherStatsEntry.etherStatsStatus -+ * etherStatsStatus is subid 21 of etherStatsEntry. -+ * Its status is Current, and its access level is Create. -+ * OID: .1.3.6.1.2.1.16.1.1.1.21 -+ * Description: -+The status of this etherStats entry. -+ * -+ * Attributes: -+ * accessible 1 isscalar 0 enums 1 hasdefval 0 -+ * readable 1 iscolumn 1 ranges 0 hashint 0 -+ * settable 1 -+ * -+ * Enum range: 2/8. Values: valid(1), createRequest(2), underCreation(3), invalid(4) -+ * -+ * Its syntax is EntryStatus (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 etherStatsStatus_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 -+ * etherStatsTable_check_dependencies() function. -+ * -+ * The following checks have already been done for you: -+ * The syntax is ASN_INTEGER -+ * The value is one of valid(1), createRequest(2), underCreation(3), invalid(4) -+ * -+ * If there a no other checks you need to do, simply return MFD_SUCCESS. -+ * -+ */ -+int -+etherStatsStatus_check_value(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long etherStatsStatus_val) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsStatus_check_value", -+ "called\n")); -+ -+ /** should never get a NULL pointer */ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:441:o: |-> Check for valid etherStatsStatus value. -+ */ -+ -+ return MFD_SUCCESS; /* etherStatsStatus value not illegal */ -+} /* etherStatsStatus_check_value */ -+ -+/** -+ * Save old value information -+ * -+ * @param rowreq_ctx -+ * Pointer to the table context (etherStatsTable_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 -+ * etherStatsTable_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 -+etherStatsStatus_undo_setup(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsStatus_undo_setup", -+ "called\n")); -+ -+ /** should never get a NULL pointer */ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:455:o: |-> Setup etherStatsStatus undo. -+ */ -+ /* -+ * copy etherStatsStatus data -+ * set rowreq_ctx->undo->etherStatsStatus from rowreq_ctx->data.etherStatsStatus -+ */ -+ rowreq_ctx->undo->etherStatsStatus = rowreq_ctx->data.etherStatsStatus; -+ -+ -+ return MFD_SUCCESS; -+} /* etherStatsStatus_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 etherStatsStatus_val -+ * A long containing the new value. -+ */ -+int -+etherStatsStatus_set(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long etherStatsStatus_val) -+{ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsStatus_set", -+ "called\n")); -+ -+ /** should never get a NULL pointer */ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:461:M: |-> Set etherStatsStatus value. -+ * set etherStatsStatus value in rowreq_ctx->data -+ */ -+ rowreq_ctx->data.etherStatsStatus = etherStatsStatus_val; -+ -+ return MFD_SUCCESS; -+} /* etherStatsStatus_set */ -+ -+/** -+ * undo the previous set. -+ * -+ * @param rowreq_ctx -+ * Pointer to the users context. -+ */ -+int -+etherStatsStatus_undo(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsStatus_undo", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * TODO:456:o: |-> Clean up etherStatsStatus undo. -+ */ -+ /* -+ * copy etherStatsStatus data -+ * set rowreq_ctx->data.etherStatsStatus from rowreq_ctx->undo->etherStatsStatus -+ */ -+ rowreq_ctx->data.etherStatsStatus = rowreq_ctx->undo->etherStatsStatus; -+ -+ -+ return MFD_SUCCESS; -+} /* etherStatsStatus_undo */ -+ -+/** @} */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h 2008-08-25 02:37:27.000000000 -0400 -@@ -0,0 +1,356 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 12077 $ of $ -+ * -+ * $Id:$ -+ */ -+#ifndef ETHERSTATSTABLE_DATA_SET_H -+#define ETHERSTATSTABLE_DATA_SET_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ /* -+ ********************************************************************* -+ * SET function declarations -+ */ -+ -+ /* -+ ********************************************************************* -+ * SET Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table etherStatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * RMON-MIB::etherStatsTable is subid 1 of statistics. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.16.1.1, length: 9 -+ */ -+ -+ -+ int etherStatsTable_undo_setup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsTable_undo_cleanup(etherStatsTable_rowreq_ctx -+ * rowreq_ctx); -+ int etherStatsTable_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsTable_commit(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsTable_undo_commit(etherStatsTable_rowreq_ctx -+ * rowreq_ctx); -+ -+ -+ int -+ etherStatsDataSource_check_value(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ oid * -+ etherStatsDataSource_val_ptr, -+ size_t -+ etherStatsDataSource_val_ptr_len); -+ int -+ etherStatsDataSource_undo_setup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsDataSource_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ oid * -+ etherStatsDataSource_val_ptr, -+ size_t -+ etherStatsDataSource_val_ptr_len); -+ int etherStatsDataSource_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int -+ etherStatsDropEvents_check_value(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long etherStatsDropEvents_val); -+ int -+ etherStatsDropEvents_undo_setup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsDropEvents_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsDropEvents_val); -+ int etherStatsDropEvents_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int etherStatsOctets_check_value(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long -+ etherStatsOctets_val); -+ int etherStatsOctets_undo_setup(etherStatsTable_rowreq_ctx -+ * rowreq_ctx); -+ int etherStatsOctets_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long etherStatsOctets_val); -+ int etherStatsOctets_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int etherStatsPkts_check_value(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long etherStatsPkts_val); -+ int etherStatsPkts_undo_setup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsPkts_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long etherStatsPkts_val); -+ int etherStatsPkts_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int -+ etherStatsBroadcastPkts_check_value(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsBroadcastPkts_val); -+ int -+ etherStatsBroadcastPkts_undo_setup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsBroadcastPkts_set(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long -+ etherStatsBroadcastPkts_val); -+ int etherStatsBroadcastPkts_undo(etherStatsTable_rowreq_ctx -+ * rowreq_ctx); -+ -+ int -+ etherStatsMulticastPkts_check_value(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsMulticastPkts_val); -+ int -+ etherStatsMulticastPkts_undo_setup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsMulticastPkts_set(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long -+ etherStatsMulticastPkts_val); -+ int etherStatsMulticastPkts_undo(etherStatsTable_rowreq_ctx -+ * rowreq_ctx); -+ -+ int -+ etherStatsCRCAlignErrors_check_value(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsCRCAlignErrors_val); -+ int -+ etherStatsCRCAlignErrors_undo_setup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsCRCAlignErrors_set(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long -+ etherStatsCRCAlignErrors_val); -+ int -+ etherStatsCRCAlignErrors_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int -+ etherStatsUndersizePkts_check_value(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsUndersizePkts_val); -+ int -+ etherStatsUndersizePkts_undo_setup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsUndersizePkts_set(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long -+ etherStatsUndersizePkts_val); -+ int etherStatsUndersizePkts_undo(etherStatsTable_rowreq_ctx -+ * rowreq_ctx); -+ -+ int -+ etherStatsOversizePkts_check_value(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsOversizePkts_val); -+ int -+ etherStatsOversizePkts_undo_setup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsOversizePkts_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsOversizePkts_val); -+ int etherStatsOversizePkts_undo(etherStatsTable_rowreq_ctx -+ * rowreq_ctx); -+ -+ int -+ etherStatsFragments_check_value(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long etherStatsFragments_val); -+ int -+ etherStatsFragments_undo_setup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsFragments_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsFragments_val); -+ int etherStatsFragments_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int -+ etherStatsJabbers_check_value(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long etherStatsJabbers_val); -+ int etherStatsJabbers_undo_setup(etherStatsTable_rowreq_ctx -+ * rowreq_ctx); -+ int etherStatsJabbers_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long etherStatsJabbers_val); -+ int etherStatsJabbers_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int -+ etherStatsCollisions_check_value(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long etherStatsCollisions_val); -+ int -+ etherStatsCollisions_undo_setup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsCollisions_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsCollisions_val); -+ int etherStatsCollisions_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int -+ etherStatsPkts64Octets_check_value(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsPkts64Octets_val); -+ int -+ etherStatsPkts64Octets_undo_setup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsPkts64Octets_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsPkts64Octets_val); -+ int etherStatsPkts64Octets_undo(etherStatsTable_rowreq_ctx -+ * rowreq_ctx); -+ -+ int -+ etherStatsPkts65to127Octets_check_value(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long -+ etherStatsPkts65to127Octets_val); -+ int -+ etherStatsPkts65to127Octets_undo_setup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int -+ etherStatsPkts65to127Octets_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsPkts65to127Octets_val); -+ int -+ etherStatsPkts65to127Octets_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int -+ etherStatsPkts128to255Octets_check_value(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long -+ etherStatsPkts128to255Octets_val); -+ int -+ etherStatsPkts128to255Octets_undo_setup(etherStatsTable_rowreq_ctx -+ * rowreq_ctx); -+ int -+ etherStatsPkts128to255Octets_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsPkts128to255Octets_val); -+ int -+ etherStatsPkts128to255Octets_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int -+ etherStatsPkts256to511Octets_check_value(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long -+ etherStatsPkts256to511Octets_val); -+ int -+ etherStatsPkts256to511Octets_undo_setup(etherStatsTable_rowreq_ctx -+ * rowreq_ctx); -+ int -+ etherStatsPkts256to511Octets_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsPkts256to511Octets_val); -+ int -+ etherStatsPkts256to511Octets_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int -+ etherStatsPkts512to1023Octets_check_value -+ (etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long etherStatsPkts512to1023Octets_val); -+ int -+ etherStatsPkts512to1023Octets_undo_setup(etherStatsTable_rowreq_ctx -+ * rowreq_ctx); -+ int -+ etherStatsPkts512to1023Octets_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsPkts512to1023Octets_val); -+ int -+ etherStatsPkts512to1023Octets_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int -+ etherStatsPkts1024to1518Octets_check_value -+ (etherStatsTable_rowreq_ctx * rowreq_ctx, -+ u_long etherStatsPkts1024to1518Octets_val); -+ int -+ etherStatsPkts1024to1518Octets_undo_setup -+ (etherStatsTable_rowreq_ctx * rowreq_ctx); -+ int -+ etherStatsPkts1024to1518Octets_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long -+ etherStatsPkts1024to1518Octets_val); -+ int -+ etherStatsPkts1024to1518Octets_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int etherStatsOwner_check_value(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ char -+ *etherStatsOwner_val_ptr, -+ size_t -+ etherStatsOwner_val_ptr_len); -+ int etherStatsOwner_undo_setup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ int etherStatsOwner_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ char *etherStatsOwner_val_ptr, -+ size_t -+ etherStatsOwner_val_ptr_len); -+ int etherStatsOwner_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int etherStatsStatus_check_value(etherStatsTable_rowreq_ctx -+ * rowreq_ctx, -+ u_long -+ etherStatsStatus_val); -+ int etherStatsStatus_undo_setup(etherStatsTable_rowreq_ctx -+ * rowreq_ctx); -+ int etherStatsStatus_set(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, -+ u_long etherStatsStatus_val); -+ int etherStatsStatus_undo(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ -+ int -+ etherStatsTable_check_dependencies(etherStatsTable_rowreq_ctx * -+ ctx); -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* ETHERSTATSTABLE_DATA_SET_H */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h 2008-08-25 02:37:27.000000000 -0400 -@@ -0,0 +1,57 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $ -+ * -+ * $Id:$ -+ */ -+#ifndef ETHERSTATSTABLE_ENUMS_H -+#define ETHERSTATSTABLE_ENUMS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ /* -+ * 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 etherStatsTable -+ * -+ ************************************************************************* -+ *************************************************************************/ -+ -+/************************************************************* -+ * constants for enums for the MIB node -+ * etherStatsStatus (EntryStatus / ASN_INTEGER) -+ * -+ * since a Textual Convention may be referenced more than once in a -+ * MIB, protect againt redefinitions of the enum values. -+ */ -+#ifndef ENTRYSTATUS_ENUMS -+#define ENTRYSTATUS_ENUMS -+ -+#define ENTRYSTATUS_VALID 1 -+#define ENTRYSTATUS_CREATEREQUEST 2 -+#define ENTRYSTATUS_UNDERCREATION 3 -+#define ENTRYSTATUS_INVALID 4 -+ -+#endif /* ENTRYSTATUS_ENUMS */ -+ -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* ETHERSTATSTABLE_ENUMS_H */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h 2008-09-09 12:03:42.000000000 -0400 -@@ -0,0 +1,303 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 14170 $ of $ -+ * -+ * $Id:$ -+ */ -+#ifndef ETHERSTATSTABLE_H -+#define ETHERSTATSTABLE_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+/** @addtogroup misc misc: Miscellaneous routines -+ * -+ * @{ -+ */ -+#include -+ -+ /* -+ * OID and column number definitions for etherStatsTable -+ */ -+#include "etherStatsTable_oids.h" -+ -+ /* -+ * enum definions -+ */ -+#include "etherStatsTable_enums.h" -+ -+ /* -+ ********************************************************************* -+ * function declarations -+ */ -+ void init_etherStatsTable(void); -+ void shutdown_etherStatsTable(void); -+ -+ /* -+ ********************************************************************* -+ * Table declarations -+ */ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table etherStatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+ /* -+ * RMON-MIB::etherStatsTable is subid 1 of statistics. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.16.1.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 etherStatsTable registration context. -+ */ -+ typedef netsnmp_data_list etherStatsTable_registration; -+ -+/**********************************************************************/ -+ /* -+ * TODO:110:r: |-> Review etherStatsTable data context structure. -+ * This structure is used to represent the data for etherStatsTable. -+ */ -+ /* -+ * This structure contains storage for all the columns defined in the -+ * etherStatsTable. -+ */ -+ typedef struct etherStatsTable_data_s { -+ -+ /* -+ * etherStatsDataSource(2)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h -+ */ -+ oid etherStatsDataSource[128]; -+ size_t etherStatsDataSource_len; /* # of oid elements, not bytes */ -+ -+ /* -+ * etherStatsDropEvents(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsDropEvents; -+ -+ /* -+ * etherStatsOctets(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsOctets; -+ -+ /* -+ * etherStatsPkts(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsPkts; -+ -+ /* -+ * etherStatsBroadcastPkts(6)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsBroadcastPkts; -+ -+ /* -+ * etherStatsMulticastPkts(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsMulticastPkts; -+ -+ /* -+ * etherStatsCRCAlignErrors(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsCRCAlignErrors; -+ -+ /* -+ * etherStatsUndersizePkts(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsUndersizePkts; -+ -+ /* -+ * etherStatsOversizePkts(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsOversizePkts; -+ -+ /* -+ * etherStatsFragments(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsFragments; -+ -+ /* -+ * etherStatsJabbers(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsJabbers; -+ -+ /* -+ * etherStatsCollisions(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsCollisions; -+ -+ /* -+ * etherStatsPkts64Octets(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsPkts64Octets; -+ -+ /* -+ * etherStatsPkts65to127Octets(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsPkts65to127Octets; -+ -+ /* -+ * etherStatsPkts128to255Octets(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsPkts128to255Octets; -+ -+ /* -+ * etherStatsPkts256to511Octets(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsPkts256to511Octets; -+ -+ /* -+ * etherStatsPkts512to1023Octets(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsPkts512to1023Octets; -+ -+ /* -+ * etherStatsPkts1024to1518Octets(19)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ u_long etherStatsPkts1024to1518Octets; -+ -+ /* -+ * etherStatsOwner(20)/OwnerString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h -+ */ -+ char etherStatsOwner[127]; -+ size_t etherStatsOwner_len; /* # of char elements, not bytes */ -+ -+ /* -+ * etherStatsStatus(21)/EntryStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h -+ */ -+ u_long etherStatsStatus; -+ -+ } etherStatsTable_data; -+ -+ -+ /* -+ ********************************************************************* -+ * TODO:115:o: |-> Review etherStatsTable 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 etherStatsTable_data etherStatsTable_undo_data; -+ -+ /* -+ * TODO:120:r: |-> Review etherStatsTable mib index. -+ * This structure is used to represent the index for etherStatsTable. -+ */ -+ typedef struct etherStatsTable_mib_index_s { -+ -+ /* -+ * etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h -+ */ -+ long etherStatsIndex; -+ -+ -+ } etherStatsTable_mib_index; -+ -+ /* -+ * TODO:121:r: | |-> Review etherStatsTable max index length. -+ * If you KNOW that your indexes will never exceed a certain -+ * length, update this macro to that length. -+ */ -+#define MAX_etherStatsTable_IDX_LEN 1 -+ -+ -+ /* -+ ********************************************************************* -+ * TODO:130:o: |-> Review etherStatsTable Row request (rowreq) context. -+ * When your functions are called, you will be passed a -+ * etherStatsTable_rowreq_ctx pointer. -+ */ -+ typedef struct etherStatsTable_rowreq_ctx_s { -+ -+ /** this must be first for container compare to work */ -+ netsnmp_index oid_idx; -+ oid oid_tmp[MAX_etherStatsTable_IDX_LEN]; -+ -+ etherStatsTable_mib_index tbl_idx; -+ -+ etherStatsTable_data data; -+ unsigned int column_exists_flags; /* flags for existence */ -+ etherStatsTable_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 etherStatsTable rowreq context. -+ */ -+ -+ /* -+ * storage for future expansion -+ */ -+ netsnmp_data_list *etherStatsTable_data_list; -+ -+ } etherStatsTable_rowreq_ctx; -+ -+ typedef struct etherStatsTable_ref_rowreq_ctx_s { -+ etherStatsTable_rowreq_ctx *rowreq_ctx; -+ } etherStatsTable_ref_rowreq_ctx; -+ -+ /* -+ ********************************************************************* -+ * function prototypes -+ */ -+ int -+ etherStatsTable_pre_request(etherStatsTable_registration * -+ user_context); -+ int -+ etherStatsTable_post_request(etherStatsTable_registration * -+ user_context, int rc); -+ -+ int -+ etherStatsTable_rowreq_ctx_init(etherStatsTable_rowreq_ctx * -+ rowreq_ctx, void *user_init_ctx); -+ void -+ etherStatsTable_rowreq_ctx_cleanup(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int etherStatsTable_commit(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ etherStatsTable_rowreq_ctx -+ *etherStatsTable_row_find_by_mib_index(etherStatsTable_mib_index * -+ mib_idx); -+ -+ extern oid etherStatsTable_oid[]; -+ extern int etherStatsTable_oid_size; -+ -+ -+#include "etherStatsTable_interface.h" -+#include "etherStatsTable_data_access.h" -+#include "etherStatsTable_data_get.h" -+#include "etherStatsTable_data_set.h" -+ -+ /* -+ * DUMMY markers, ignore -+ * -+ * TODO:099:x: ************************************************************* -+ * TODO:199:x: ************************************************************* -+ * TODO:299:x: ************************************************************* -+ * TODO:399:x: ************************************************************* -+ * TODO:499:x: ************************************************************* -+ */ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* ETHERSTATSTABLE_H */ -+/** @} */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c 2008-09-12 14:15:42.000000000 -0400 -@@ -0,0 +1,2225 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 15899 $ of $ -+ * -+ * $Id:$ -+ */ -+/* -+ * ********************************************************************* -+ * ********************************************************************* -+ * ********************************************************************* -+ * *** *** -+ * *** 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 -+#include -+#include -+ -+/* -+ * include our parent header -+ */ -+#include "etherStatsTable.h" -+ -+ -+#include -+#include -+ -+#include "etherStatsTable_interface.h" -+ -+#include -+ -+/********************************************************************** -+ ********************************************************************** -+ *** -+ *** Table etherStatsTable -+ *** -+ ********************************************************************** -+ **********************************************************************/ -+/* -+ * RMON-MIB::etherStatsTable is subid 1 of statistics. -+ * Its status is Current. -+ * OID: .1.3.6.1.2.1.16.1.1, length: 9 -+ */ -+typedef struct etherStatsTable_interface_ctx_s { -+ -+ netsnmp_container *container; -+ netsnmp_cache *cache; -+ -+ etherStatsTable_registration *user_ctx; -+ -+ netsnmp_table_registration_info tbl_info; -+ -+ netsnmp_baby_steps_access_methods access_multiplexer; -+ -+ u_int table_dirty; -+ -+} etherStatsTable_interface_ctx; -+ -+static etherStatsTable_interface_ctx etherStatsTable_if_ctx; -+ -+static void -+_etherStatsTable_container_init(etherStatsTable_interface_ctx * if_ctx); -+static void -+_etherStatsTable_container_shutdown(etherStatsTable_interface_ctx * -+ if_ctx); -+ -+ -+netsnmp_container * -+etherStatsTable_container_get(void) -+{ -+ return etherStatsTable_if_ctx.container; -+} -+ -+etherStatsTable_registration * -+etherStatsTable_registration_get(void) -+{ -+ return etherStatsTable_if_ctx.user_ctx; -+} -+ -+etherStatsTable_registration * -+etherStatsTable_registration_set(etherStatsTable_registration * newreg) -+{ -+ etherStatsTable_registration *old = etherStatsTable_if_ctx.user_ctx; -+ etherStatsTable_if_ctx.user_ctx = newreg; -+ return old; -+} -+ -+int -+etherStatsTable_container_size(void) -+{ -+ return CONTAINER_SIZE(etherStatsTable_if_ctx.container); -+} -+ -+u_int -+etherStatsTable_dirty_get(void) -+{ -+ return etherStatsTable_if_ctx.table_dirty; -+} -+ -+void -+etherStatsTable_dirty_set(u_int status) -+{ -+ DEBUGMSGTL(("etherStatsTable:etherStatsTable_dirty_set", -+ "called. was %d, now %d\n", -+ etherStatsTable_if_ctx.table_dirty, status)); -+ etherStatsTable_if_ctx.table_dirty = status; -+} -+ -+/* -+ * mfd multiplexer modes -+ */ -+static Netsnmp_Node_Handler _mfd_etherStatsTable_pre_request; -+static Netsnmp_Node_Handler _mfd_etherStatsTable_post_request; -+static Netsnmp_Node_Handler _mfd_etherStatsTable_object_lookup; -+static Netsnmp_Node_Handler _mfd_etherStatsTable_get_values; -+static Netsnmp_Node_Handler _mfd_etherStatsTable_check_objects; -+static Netsnmp_Node_Handler _mfd_etherStatsTable_undo_setup; -+static Netsnmp_Node_Handler _mfd_etherStatsTable_set_values; -+static Netsnmp_Node_Handler _mfd_etherStatsTable_undo_cleanup; -+static Netsnmp_Node_Handler _mfd_etherStatsTable_undo_values; -+static Netsnmp_Node_Handler _mfd_etherStatsTable_commit; -+static Netsnmp_Node_Handler _mfd_etherStatsTable_undo_commit; -+static Netsnmp_Node_Handler _mfd_etherStatsTable_irreversible_commit; -+ -+NETSNMP_STATIC_INLINE int -+_etherStatsTable_undo_column(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ netsnmp_variable_list * var, int column); -+ -+NETSNMP_STATIC_INLINE int -+_etherStatsTable_check_indexes(etherStatsTable_rowreq_ctx * rowreq_ctx); -+ -+etherStatsTable_data *etherStatsTable_allocate_data(void); -+ -+/** -+ * @internal -+ * Initialize the table etherStatsTable -+ * (Define its contents and how it's structured) -+ */ -+void -+_etherStatsTable_initialize_interface(etherStatsTable_registration * -+ reg_ptr, u_long flags) -+{ -+ netsnmp_baby_steps_access_methods *access_multiplexer = -+ ðerStatsTable_if_ctx.access_multiplexer; -+ netsnmp_table_registration_info *tbl_info = -+ ðerStatsTable_if_ctx.tbl_info; -+ netsnmp_handler_registration *reginfo; -+ netsnmp_mib_handler *handler; -+ int mfd_modes = 0; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_initialize_interface", "called\n")); -+ -+ -+ /************************************************* -+ * -+ * save interface context for etherStatsTable -+ */ -+ /* -+ * Setting up the table's definition -+ */ -+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER, -+ /** index: etherStatsIndex */ -+ 0); -+ -+ /* -+ * Define the minimum and maximum accessible columns. This -+ * optimizes retrival. -+ */ -+ tbl_info->min_column = ETHERSTATSTABLE_MIN_COL; -+ tbl_info->max_column = ETHERSTATSTABLE_MAX_COL; -+ -+ /* -+ * save users context -+ */ -+ etherStatsTable_if_ctx.user_ctx = reg_ptr; -+ -+ /* -+ * call data access initialization code -+ */ -+ etherStatsTable_init_data(reg_ptr); -+ -+ /* -+ * set up the container -+ */ -+ _etherStatsTable_container_init(ðerStatsTable_if_ctx); -+ if (NULL == etherStatsTable_if_ctx.container) { -+ snmp_log(LOG_ERR, -+ "could not initialize container for etherStatsTable\n"); -+ return; -+ } -+ -+ /* -+ * access_multiplexer: REQUIRED wrapper for get request handling -+ */ -+ access_multiplexer->object_lookup = _mfd_etherStatsTable_object_lookup; -+ access_multiplexer->get_values = _mfd_etherStatsTable_get_values; -+ -+ /* -+ * no wrappers yet -+ */ -+ access_multiplexer->pre_request = _mfd_etherStatsTable_pre_request; -+ access_multiplexer->post_request = _mfd_etherStatsTable_post_request; -+ -+ -+ /* -+ * REQUIRED wrappers for set request handling -+ */ -+ access_multiplexer->object_syntax_checks = -+ _mfd_etherStatsTable_check_objects; -+ access_multiplexer->undo_setup = _mfd_etherStatsTable_undo_setup; -+ access_multiplexer->undo_cleanup = _mfd_etherStatsTable_undo_cleanup; -+ access_multiplexer->set_values = _mfd_etherStatsTable_set_values; -+ access_multiplexer->undo_sets = _mfd_etherStatsTable_undo_values; -+ -+ /* -+ * no wrappers yet -+ */ -+ access_multiplexer->commit = _mfd_etherStatsTable_commit; -+ access_multiplexer->undo_commit = _mfd_etherStatsTable_undo_commit; -+ access_multiplexer->irreversible_commit = -+ _mfd_etherStatsTable_irreversible_commit; -+ -+ /************************************************* -+ * -+ * Create a registration, save our reg data, register table. -+ */ -+ DEBUGMSGTL(("etherStatsTable:init_etherStatsTable", -+ "Registering etherStatsTable as a mibs-for-dummies table.\n")); -+ handler = -+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer); -+ reginfo = -+ netsnmp_handler_registration_create("etherStatsTable", handler, -+ etherStatsTable_oid, -+ etherStatsTable_oid_size, -+ HANDLER_CAN_BABY_STEP | -+ HANDLER_CAN_RWRITE); -+ if (NULL == reginfo) { -+ snmp_log(LOG_ERR, "error registering table etherStatsTable\n"); -+ return; -+ } -+ reginfo->my_reg_void = ðerStatsTable_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, -+ etherStatsTable_if_ctx. -+ container, -+ TABLE_CONTAINER_KEY_NETSNMP_INDEX); -+ netsnmp_inject_handler(reginfo, handler); -+ -+ /************************************************* -+ * -+ * inject cache helper -+ */ -+ if (NULL != etherStatsTable_if_ctx.cache) { -+ handler = netsnmp_cache_handler_get(etherStatsTable_if_ctx.cache); -+ netsnmp_inject_handler(reginfo, handler); -+ } -+ -+ /* -+ * register table -+ */ -+ netsnmp_register_table(reginfo, tbl_info); -+ -+} /* _etherStatsTable_initialize_interface */ -+ -+/** -+ * @internal -+ * Shutdown the table etherStatsTable -+ */ -+void -+_etherStatsTable_shutdown_interface(etherStatsTable_registration * reg_ptr) -+{ -+ /* -+ * shutdown the container -+ */ -+ _etherStatsTable_container_shutdown(ðerStatsTable_if_ctx); -+} -+ -+void -+etherStatsTable_valid_columns_set(netsnmp_column_info *vc) -+{ -+ etherStatsTable_if_ctx.tbl_info.valid_columns = vc; -+} /* etherStatsTable_valid_columns_set */ -+ -+/** -+ * @internal -+ * convert the index component stored in the context to an oid -+ */ -+int -+etherStatsTable_index_to_oid(netsnmp_index * oid_idx, -+ etherStatsTable_mib_index * mib_idx) -+{ -+ int err = SNMP_ERR_NOERROR; -+ -+ /* -+ * temp storage for parsing indexes -+ */ -+ /* -+ * etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h -+ */ -+ netsnmp_variable_list var_etherStatsIndex; -+ -+ /* -+ * set up varbinds -+ */ -+ memset(&var_etherStatsIndex, 0x00, sizeof(var_etherStatsIndex)); -+ var_etherStatsIndex.type = ASN_INTEGER; -+ -+ /* -+ * chain temp index varbinds together -+ */ -+ var_etherStatsIndex.next_variable = NULL; -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_index_to_oid", -+ "called\n")); -+ -+ /* -+ * etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h -+ */ -+ snmp_set_var_value(&var_etherStatsIndex, -+ (u_char *) & mib_idx->etherStatsIndex, -+ sizeof(mib_idx->etherStatsIndex)); -+ -+ -+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len, -+ NULL, 0, &var_etherStatsIndex); -+ 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_etherStatsIndex); -+ -+ return err; -+} /* etherStatsTable_index_to_oid */ -+ -+/** -+ * extract etherStatsTable indexes from a netsnmp_index -+ * -+ * @retval SNMP_ERR_NOERROR : no error -+ * @retval SNMP_ERR_GENERR : error -+ */ -+int -+etherStatsTable_index_from_oid(netsnmp_index * oid_idx, -+ etherStatsTable_mib_index * mib_idx) -+{ -+ int err = SNMP_ERR_NOERROR; -+ -+ /* -+ * temp storage for parsing indexes -+ */ -+ /* -+ * etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h -+ */ -+ netsnmp_variable_list var_etherStatsIndex; -+ -+ /* -+ * set up varbinds -+ */ -+ memset(&var_etherStatsIndex, 0x00, sizeof(var_etherStatsIndex)); -+ var_etherStatsIndex.type = ASN_INTEGER; -+ -+ /* -+ * chain temp index varbinds together -+ */ -+ var_etherStatsIndex.next_variable = NULL; -+ -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_index_from_oid", -+ "called\n")); -+ -+ /* -+ * parse the oid into the individual index components -+ */ -+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len, -+ &var_etherStatsIndex); -+ if (err == SNMP_ERR_NOERROR) { -+ /* -+ * copy out values -+ */ -+ mib_idx->etherStatsIndex = -+ *((long *) var_etherStatsIndex.val.string); -+ -+ -+ } -+ -+ /* -+ * parsing may have allocated memory. free it. -+ */ -+ snmp_reset_var_buffers(&var_etherStatsIndex); -+ -+ return err; -+} /* etherStatsTable_index_from_oid */ -+ -+ -+/* -+ * etherStatsTable_allocate_data -+ * -+ * Purpose: create new etherStatsTable_data. -+ */ -+etherStatsTable_data * -+etherStatsTable_allocate_data(void) -+{ -+ etherStatsTable_data *rtn = SNMP_MALLOC_TYPEDEF(etherStatsTable_data); -+ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_allocate_data", -+ "called\n")); -+ -+ if (NULL == rtn) { -+ snmp_log(LOG_ERR, "unable to malloc memory for new " -+ "etherStatsTable_data.\n"); -+ } -+ -+ return rtn; -+} /* etherStatsTable_allocate_data */ -+ -+/* -+ * etherStatsTable_release_data -+ * -+ * Purpose: release etherStatsTable data. -+ */ -+void -+etherStatsTable_release_data(etherStatsTable_data * data) -+{ -+ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_release_data", -+ "called\n")); -+ -+ free(data); -+} /* etherStatsTable_release_data */ -+ -+/* -+ ********************************************************************* -+ * @internal -+ * allocate resources for a etherStatsTable_rowreq_ctx -+ */ -+etherStatsTable_rowreq_ctx * -+etherStatsTable_allocate_rowreq_ctx(void *user_init_ctx) -+{ -+ etherStatsTable_rowreq_ctx *rowreq_ctx = -+ SNMP_MALLOC_TYPEDEF(etherStatsTable_rowreq_ctx); -+ -+ DEBUGMSGTL(("internal:etherStatsTable:etherStatsTable_allocate_rowreq_ctx", "called\n")); -+ -+ if (NULL == rowreq_ctx) { -+ snmp_log(LOG_ERR, "Couldn't allocate memory for a " -+ "etherStatsTable_rowreq_ctx.\n"); -+ return NULL; -+ } -+ -+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp; -+ -+ rowreq_ctx->etherStatsTable_data_list = NULL; -+ -+ /* -+ * if we allocated data, call init routine -+ */ -+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) { -+ if (SNMPERR_SUCCESS != -+ etherStatsTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) { -+ etherStatsTable_release_rowreq_ctx(rowreq_ctx); -+ rowreq_ctx = NULL; -+ } -+ } -+ -+ return rowreq_ctx; -+} /* etherStatsTable_allocate_rowreq_ctx */ -+ -+/* -+ * @internal -+ * release resources for a etherStatsTable_rowreq_ctx -+ */ -+void -+etherStatsTable_release_rowreq_ctx(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ DEBUGMSGTL(("internal:etherStatsTable:etherStatsTable_release_rowreq_ctx", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ etherStatsTable_rowreq_ctx_cleanup(rowreq_ctx); -+ -+ if (rowreq_ctx->undo) -+ etherStatsTable_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); -+} /* etherStatsTable_release_rowreq_ctx */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_etherStatsTable_pre_request(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ int rc; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_pre_request", "called\n")); -+ -+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) { -+ DEBUGMSGTL(("internal:etherStatsTable", -+ "skipping additional pre_request\n")); -+ return SNMP_ERR_NOERROR; -+ } -+ -+ rc = etherStatsTable_pre_request(etherStatsTable_if_ctx.user_ctx); -+ if (MFD_SUCCESS != rc) { -+ /* -+ * nothing we can do about it but log it -+ */ -+ DEBUGMSGTL(("etherStatsTable", "error %d from " -+ "etherStatsTable_pre_request\n", rc)); -+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc)); -+ } -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_etherStatsTable_pre_request */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_etherStatsTable_post_request(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ etherStatsTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ int rc, packet_rc; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_post_request", "called\n")); -+ -+ /* -+ * release row context, if deleted -+ */ -+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED)) -+ etherStatsTable_release_rowreq_ctx(rowreq_ctx); -+ -+ /* -+ * wait for last call before calling user -+ */ -+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) { -+ DEBUGMSGTL(("internal:etherStatsTable", -+ "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) && etherStatsTable_dirty_get()) { -+ /* -+ * we shouldn't get here. the undo steps should also clear -+ * the dirty flags. -+ */ -+ snmp_log(LOG_WARNING, -+ "etherStatsTable dirty flag set in post_request " -+ "but status != SUCCESS.\n"); -+ } -+ -+ rc = etherStatsTable_post_request(etherStatsTable_if_ctx.user_ctx, -+ packet_rc); -+ if (MFD_SUCCESS != rc) { -+ /* -+ * nothing we can do about it but log it -+ */ -+ DEBUGMSGTL(("etherStatsTable", "error %d from " -+ "etherStatsTable_post_request\n", rc)); -+ } -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_etherStatsTable_post_request */ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static etherStatsTable_rowreq_ctx * -+_mfd_etherStatsTable_rowreq_from_index(netsnmp_index * oid_idx, -+ int *rc_ptr) -+{ -+ etherStatsTable_rowreq_ctx *rowreq_ctx; -+ etherStatsTable_mib_index mib_idx; -+ int rc; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_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 = etherStatsTable_index_from_oid(oid_idx, &mib_idx); -+ if (MFD_SUCCESS != *rc_ptr) { -+ DEBUGMSGT(("etherStatsTable", "error parsing index\n")); -+ return NULL; -+ } -+ -+ /* -+ * allocate new context -+ */ -+ rowreq_ctx = etherStatsTable_allocate_rowreq_ctx(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 = _etherStatsTable_check_indexes(rowreq_ctx); -+ if (MFD_SUCCESS != *rc_ptr) { -+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) || -+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME)); -+ etherStatsTable_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_etherStatsTable_rowreq_from_index */ -+ -+ -+/** -+ * @internal -+ * wrapper -+ */ -+static int -+_mfd_etherStatsTable_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; -+ etherStatsTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_object_lookup", "called\n")); -+ -+ /* -+ * get our context from mfd -+ * etherStatsTable_interface_ctx *if_ctx = -+ * (etherStatsTable_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_etherStatsTable_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 -+ etherStatsTable_row_prep(rowreq_ctx); -+ -+ return SNMP_VALIDATE_ERR(rc); -+} /* _mfd_etherStatsTable_object_lookup */ -+ -+/*********************************************************************** -+ * -+ * GET processing -+ * -+ ***********************************************************************/ -+/* -+ * @internal -+ * Retrieve the value for a particular column -+ */ -+NETSNMP_STATIC_INLINE int -+_etherStatsTable_get_column(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ netsnmp_variable_list * var, int column) -+{ -+ int rc = SNMPERR_SUCCESS; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", -+ "called for %d\n", column)); -+ -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ switch (column) { -+ -+ /* -+ * (INDEX) etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h -+ */ -+ case COLUMN_ETHERSTATSINDEX: -+ var->type = ASN_INTEGER; -+ var->val_len = sizeof(long); -+ (*var->val.integer) = rowreq_ctx->tbl_idx.etherStatsIndex; -+ break; -+ -+ /* -+ * etherStatsDataSource(2)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSDATASOURCE: -+ if (! -+ (COLUMN_ETHERSTATSDATASOURCE_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsDataSource) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->type = ASN_OBJECT_ID; -+ rc = etherStatsDataSource_get(rowreq_ctx, -+ (oid **) & var->val.string, -+ &var->val_len); -+ break; -+ -+ /* -+ * etherStatsDropEvents(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSDROPEVENTS: -+ if (! -+ (COLUMN_ETHERSTATSDROPEVENTS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsDropEvents) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsDropEvents_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsOctets(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSOCTETS: -+ if (! -+ (COLUMN_ETHERSTATSOCTETS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsOctets) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsOctets_get(rowreq_ctx, (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsPkts(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSPKTS: -+ if (! -+ (COLUMN_ETHERSTATSPKTS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsPkts) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsPkts_get(rowreq_ctx, (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsBroadcastPkts(6)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSBROADCASTPKTS: -+ if (! -+ (COLUMN_ETHERSTATSBROADCASTPKTS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsBroadcastPkts) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsBroadcastPkts_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsMulticastPkts(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSMULTICASTPKTS: -+ if (! -+ (COLUMN_ETHERSTATSMULTICASTPKTS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsMulticastPkts) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsMulticastPkts_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsCRCAlignErrors(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSCRCALIGNERRORS: -+ if (! -+ (COLUMN_ETHERSTATSCRCALIGNERRORS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsCRCAlignErrors) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsCRCAlignErrors_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsUndersizePkts(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSUNDERSIZEPKTS: -+ if (! -+ (COLUMN_ETHERSTATSUNDERSIZEPKTS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsUndersizePkts) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsUndersizePkts_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsOversizePkts(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSOVERSIZEPKTS: -+ if (! -+ (COLUMN_ETHERSTATSOVERSIZEPKTS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsOversizePkts) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsOversizePkts_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsFragments(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSFRAGMENTS: -+ if (! -+ (COLUMN_ETHERSTATSFRAGMENTS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsFragments) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsFragments_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsJabbers(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSJABBERS: -+ if (! -+ (COLUMN_ETHERSTATSJABBERS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ snmp_log (LOG_ERR, "internal:etherStatsTable:_mfd_etherStatsTable_get_column, column %d (etherStatsJabbers) doesn't exist for the interface with index %ld\n", column, rowreq_ctx->tbl_idx.etherStatsIndex); -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsJabbers) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsJabbers_get(rowreq_ctx, (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsCollisions(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSCOLLISIONS: -+ if (! -+ (COLUMN_ETHERSTATSCOLLISIONS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsCollisions) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsCollisions_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsPkts64Octets(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSPKTS64OCTETS: -+ if (! -+ (COLUMN_ETHERSTATSPKTS64OCTETS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsPkts64Octets) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsPkts64Octets_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsPkts65to127Octets(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSPKTS65TO127OCTETS: -+ if (! -+ (COLUMN_ETHERSTATSPKTS65TO127OCTETS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsPkts65to127Octets) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsPkts65to127Octets_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsPkts128to255Octets(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSPKTS128TO255OCTETS: -+ if (! -+ (COLUMN_ETHERSTATSPKTS128TO255OCTETS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsPkts128to255Octets) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsPkts128to255Octets_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsPkts256to511Octets(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSPKTS256TO511OCTETS: -+ if (! -+ (COLUMN_ETHERSTATSPKTS256TO511OCTETS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsPkts256to511Octets) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsPkts256to511Octets_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsPkts512to1023Octets(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSPKTS512TO1023OCTETS: -+ if (! -+ (COLUMN_ETHERSTATSPKTS512TO1023OCTETS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsPkts512to1023Octets) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsPkts512to1023Octets_get(rowreq_ctx, -+ (u_long *) var->val.string); -+ break; -+ -+ /* -+ * etherStatsPkts1024to1518Octets(19)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSPKTS1024TO1518OCTETS: -+ if (! -+ (COLUMN_ETHERSTATSPKTS1024TO1518OCTETS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsPkts1024to1518Octets) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_COUNTER; -+ rc = etherStatsPkts1024to1518Octets_get(rowreq_ctx, -+ (u_long *) var->val. -+ string); -+ break; -+ -+ /* -+ * etherStatsOwner(20)/OwnerString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h -+ */ -+ case COLUMN_ETHERSTATSOWNER: -+ if (! -+ (COLUMN_ETHERSTATSOWNER_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsOwner) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->type = ASN_OCTET_STR; -+ rc = etherStatsOwner_get(rowreq_ctx, (char **) &var->val.string, -+ &var->val_len); -+ break; -+ -+ /* -+ * etherStatsStatus(21)/EntryStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h -+ */ -+ case COLUMN_ETHERSTATSSTATUS: -+ if (! -+ (COLUMN_ETHERSTATSSTATUS_FLAG & rowreq_ctx-> -+ column_exists_flags)) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "column %d (etherStatsStatus) doesn't exist\n", column)); -+ return MFD_SKIP; -+ } -+ -+ var->val_len = sizeof(u_long); -+ var->type = ASN_INTEGER; -+ rc = etherStatsStatus_get(rowreq_ctx, (u_long *) var->val.string); -+ break; -+ -+ default: -+ if (ETHERSTATSTABLE_MIN_COL <= column -+ && column <= ETHERSTATSTABLE_MAX_COL) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_get_column", "assume column %d is reserved\n", column)); -+ rc = MFD_SKIP; -+ } else { -+ snmp_log(LOG_ERR, -+ "unknown column %d in _etherStatsTable_get_column.\n", -+ column); -+ } -+ break; -+ } -+ -+ return rc; -+} /* _etherStatsTable_get_column */ -+ -+int -+_mfd_etherStatsTable_get_values(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ etherStatsTable_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:etherStatsTable:_mfd_etherStatsTable_get_values", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ DEBUGMSGTL(("9:etherStatsTable:_mfd_etherStatsTable_get_values", -+ "exists %u\n", rowreq_ctx->column_exists_flags)); -+ -+ 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 = _etherStatsTable_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_etherStatsTable_get_values */ -+ -+NETSNMP_STATIC_INLINE int -+_etherStatsTable_check_indexes(etherStatsTable_rowreq_ctx * rowreq_ctx) -+{ -+ int rc = SNMPERR_SUCCESS; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_check_indexes", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ -+ /* -+ * (INDEX) etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h -+ */ -+ /* -+ * check defined range(s). -+ */ -+ if ((SNMPERR_SUCCESS == rc) -+ && ((rowreq_ctx->tbl_idx.etherStatsIndex < 1) -+ || (rowreq_ctx->tbl_idx.etherStatsIndex > 65535)) -+ ) { -+ rc = SNMP_ERR_WRONGVALUE; -+ } -+ if (MFD_SUCCESS != rc) -+ return rc; -+ rc = etherStatsIndex_check_index(rowreq_ctx); -+ if (MFD_SUCCESS != rc) -+ return SNMP_ERR_NOCREATION; -+ -+ /* -+ * if individual parts look ok, check them as a whole -+ */ -+ return etherStatsTable_validate_index(etherStatsTable_if_ctx.user_ctx, -+ rowreq_ctx); -+} /* _etherStatsTable_check_indexes */ -+ -+/*********************************************************************** -+ * -+ * SET processing -+ * -+ ***********************************************************************/ -+ -+/*---------------------------------------------------------------------- -+ * -+ * SET: Syntax checks -+ * -+ *---------------------------------------------------------------------*/ -+/* -+ * @internal -+ * Check the syntax for a particular column -+ */ -+NETSNMP_STATIC_INLINE int -+_etherStatsTable_check_column(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ netsnmp_variable_list * var, int column) -+{ -+ int rc = SNMPERR_SUCCESS; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_check_column", -+ "called for %d\n", column)); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ switch (column) { -+ /* -+ * (INDEX) etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h -+ */ -+ case COLUMN_ETHERSTATSINDEX: -+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */ -+ break; -+ -+ /* -+ * etherStatsDataSource(2)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSDATASOURCE: -+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OBJECT_ID, -+ sizeof(rowreq_ctx->data. -+ etherStatsDataSource)); -+ if (SNMPERR_SUCCESS != rc) { -+ DEBUGMSGTL(("etherStatsTable:_etherStatsTable_check_column:etherStatsDataSource", "varbind validation failed (eg bad type or size)\n")); -+ } else { -+ rc = etherStatsDataSource_check_value(rowreq_ctx, -+ (oid *) 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 etherStatsDataSource_check_value\n", -+ rc); -+ rc = SNMP_ERR_GENERR; -+ } -+ } -+ break; -+ -+ /* -+ * etherStatsDropEvents(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSDROPEVENTS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsOctets(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSOCTETS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsPkts(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSPKTS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsBroadcastPkts(6)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSBROADCASTPKTS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsMulticastPkts(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSMULTICASTPKTS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsCRCAlignErrors(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSCRCALIGNERRORS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsUndersizePkts(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSUNDERSIZEPKTS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsOversizePkts(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSOVERSIZEPKTS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsFragments(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSFRAGMENTS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsJabbers(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSJABBERS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsCollisions(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSCOLLISIONS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsPkts64Octets(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSPKTS64OCTETS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsPkts65to127Octets(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSPKTS65TO127OCTETS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsPkts128to255Octets(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSPKTS128TO255OCTETS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsPkts256to511Octets(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSPKTS256TO511OCTETS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsPkts512to1023Octets(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSPKTS512TO1023OCTETS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsPkts1024to1518Octets(19)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSPKTS1024TO1518OCTETS: -+ rc = SNMP_ERR_NOTWRITABLE; -+ break; -+ -+ /* -+ * etherStatsOwner(20)/OwnerString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h -+ */ -+ case COLUMN_ETHERSTATSOWNER: -+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR, -+ sizeof(rowreq_ctx->data. -+ etherStatsOwner)); -+ /* -+ * check defined range(s). -+ */ -+ if ((SNMPERR_SUCCESS == rc) -+ && ((var->val_len < 0) || (var->val_len > 127)) -+ ) { -+ rc = SNMP_ERR_WRONGLENGTH; -+ } -+ if (SNMPERR_SUCCESS != rc) { -+ DEBUGMSGTL(("etherStatsTable:_etherStatsTable_check_column:etherStatsOwner", "varbind validation failed (eg bad type or size)\n")); -+ } else { -+ rc = etherStatsOwner_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 etherStatsOwner_check_value\n", -+ rc); -+ rc = SNMP_ERR_GENERR; -+ } -+ } -+ break; -+ -+ /* -+ * etherStatsStatus(21)/EntryStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h -+ */ -+ case COLUMN_ETHERSTATSSTATUS: -+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER, -+ sizeof(rowreq_ctx->data. -+ etherStatsStatus)); -+ /* -+ * check that the value is one of defined enums -+ */ -+ if ((SNMPERR_SUCCESS == rc) -+ && (*var->val.integer != ENTRYSTATUS_VALID) -+ && (*var->val.integer != ENTRYSTATUS_CREATEREQUEST) -+ && (*var->val.integer != ENTRYSTATUS_UNDERCREATION) -+ && (*var->val.integer != ENTRYSTATUS_INVALID) -+ ) { -+ rc = SNMP_ERR_WRONGVALUE; -+ } -+ if (SNMPERR_SUCCESS != rc) { -+ DEBUGMSGTL(("etherStatsTable:_etherStatsTable_check_column:etherStatsStatus", "varbind validation failed (eg bad type or size)\n")); -+ } else { -+ rc = etherStatsStatus_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 etherStatsStatus_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 _etherStatsTable_check_column\n", -+ column); -+ } -+ -+ return rc; -+} /* _etherStatsTable_check_column */ -+ -+int -+_mfd_etherStatsTable_check_objects(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ etherStatsTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ netsnmp_table_request_info *tri; -+ int rc; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_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 = _etherStatsTable_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_etherStatsTable_check_objects */ -+ -+ -+/*---------------------------------------------------------------------- -+ * -+ * SET: Undo setup -+ * -+ *---------------------------------------------------------------------*/ -+/* -+ * @internal -+ * Set the value for a particular column -+ */ -+NETSNMP_STATIC_INLINE int -+_etherStatsTable_undo_setup_column(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ int column) -+{ -+ int rc = SNMPERR_SUCCESS; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_undo_setup_column", "called for %d\n", column)); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ switch (column) { -+ -+ /* -+ * etherStatsDataSource(2)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSDATASOURCE: -+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSDATASOURCE_FLAG; -+ rc = etherStatsDataSource_undo_setup(rowreq_ctx); -+ break; -+ -+ /* -+ * etherStatsOwner(20)/OwnerString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h -+ */ -+ case COLUMN_ETHERSTATSOWNER: -+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSOWNER_FLAG; -+ rc = etherStatsOwner_undo_setup(rowreq_ctx); -+ break; -+ -+ /* -+ * etherStatsStatus(21)/EntryStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h -+ */ -+ case COLUMN_ETHERSTATSSTATUS: -+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSSTATUS_FLAG; -+ rc = etherStatsStatus_undo_setup(rowreq_ctx); -+ break; -+ -+ default: -+ snmp_log(LOG_ERR, -+ "unknown column %d in _etherStatsTable_undo_setup_column\n", -+ column); -+ break; -+ } -+ -+ return rc; -+} /* _etherStatsTable_undo_setup_column */ -+ -+ -+/** -+ * @internal -+ * undo setup -+ */ -+int -+_mfd_etherStatsTable_undo_setup(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ int rc; -+ etherStatsTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_undo_setup", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ /* -+ * allocate undo context -+ */ -+ rowreq_ctx->undo = etherStatsTable_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 = etherStatsTable_undo_setup(rowreq_ctx); -+ if (MFD_SUCCESS != rc) { -+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from " -+ "etherStatsTable_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 = _etherStatsTable_undo_setup_column(rowreq_ctx, -+ tri->colnum); -+ if (MFD_SUCCESS != rc) { -+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from " -+ "etherStatsTable_undo_setup_column\n", rc)); -+ netsnmp_set_request_error(agtreq_info, requests, -+ SNMP_VALIDATE_ERR(rc)); -+ } -+ } /* for results */ -+ } -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_etherStatsTable_undo_setup */ -+ -+/** -+ * @internal -+ * undo setup -+ */ -+int -+_mfd_etherStatsTable_undo_cleanup(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ etherStatsTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ int rc; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_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 = etherStatsTable_undo_cleanup(rowreq_ctx); -+ if (MFD_SUCCESS != rc) { -+ /* -+ * nothing we can do about it but log it -+ */ -+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from " -+ "etherStatsTable_undo_cleanup\n", rc)); -+ } -+ -+ /* -+ * release undo context, if needed -+ */ -+ if (rowreq_ctx->undo) { -+ etherStatsTable_release_data(rowreq_ctx->undo); -+ rowreq_ctx->undo = NULL; -+ } -+ -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_etherStatsTable_undo_cleanup */ -+ -+/*---------------------------------------------------------------------- -+ * -+ * SET: Set values -+ * -+ *---------------------------------------------------------------------*/ -+/* -+ * @internal -+ * Set the value for a particular column -+ */ -+NETSNMP_STATIC_INLINE int -+_etherStatsTable_set_column(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ netsnmp_variable_list * var, int column) -+{ -+ int rc = SNMPERR_SUCCESS; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_set_column", -+ "called for %d\n", column)); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ switch (column) { -+ -+ /* -+ * etherStatsDataSource(2)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSDATASOURCE: -+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSDATASOURCE_FLAG; -+ rc = etherStatsDataSource_set(rowreq_ctx, (oid *) var->val.string, -+ var->val_len); -+ break; -+ -+ /* -+ * etherStatsOwner(20)/OwnerString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h -+ */ -+ case COLUMN_ETHERSTATSOWNER: -+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSOWNER_FLAG; -+ rc = etherStatsOwner_set(rowreq_ctx, (char *) var->val.string, -+ var->val_len); -+ break; -+ -+ /* -+ * etherStatsStatus(21)/EntryStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h -+ */ -+ case COLUMN_ETHERSTATSSTATUS: -+ rowreq_ctx->column_set_flags |= COLUMN_ETHERSTATSSTATUS_FLAG; -+ rc = etherStatsStatus_set(rowreq_ctx, -+ *((u_long *) var->val.string)); -+ break; -+ -+ default: -+ snmp_log(LOG_ERR, -+ "unknown column %d in _etherStatsTable_set_column\n", -+ column); -+ rc = SNMP_ERR_GENERR; -+ break; -+ } -+ -+ return rc; -+} /* _etherStatsTable_set_column */ -+ -+int -+_mfd_etherStatsTable_set_values(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ etherStatsTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ netsnmp_table_request_info *tri; -+ int rc = SNMP_ERR_NOERROR; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_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 = _etherStatsTable_set_column(rowreq_ctx, -+ requests->requestvb, tri->colnum); -+ if (MFD_SUCCESS != rc) { -+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from " -+ "etherStatsTable_set_column\n", rc)); -+ netsnmp_set_request_error(agtreq_info, requests, -+ SNMP_VALIDATE_ERR(rc)); -+ } -+ } /* for results */ -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_etherStatsTable_set_values */ -+ -+/*---------------------------------------------------------------------- -+ * -+ * SET: commit -+ * -+ *---------------------------------------------------------------------*/ -+/** -+ * @internal -+ * commit the values -+ */ -+int -+_mfd_etherStatsTable_commit(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ int rc; -+ etherStatsTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_commit", -+ "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ rc = etherStatsTable_commit(rowreq_ctx); -+ if (MFD_SUCCESS != rc) { -+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from " -+ "etherStatsTable_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... -+ */ -+ etherStatsTable_dirty_set(etherStatsTable_dirty_get() + 1); /* set table dirty flag */ -+ } -+ -+ return SNMP_ERR_NOERROR; -+} -+ -+int -+_mfd_etherStatsTable_undo_commit(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ int rc; -+ etherStatsTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_undo_commit", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) { -+ u_int d = etherStatsTable_dirty_get(); -+ -+ netsnmp_assert(d != 0); -+ if (d) -+ etherStatsTable_dirty_set(d - 1); -+ } -+ -+ rc = etherStatsTable_undo_commit(rowreq_ctx); -+ if (MFD_SUCCESS != rc) { -+ /* -+ * nothing we can do about it but log it -+ */ -+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from " -+ "etherStatsTable_undo_commit\n", rc)); -+ } -+ -+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) { -+ snmp_log(LOG_WARNING, -+ "etherStatsTable row dirty flag still set after undo_commit\n"); -+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY; -+ } -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_etherStatsTable_commit */ -+ -+/*---------------------------------------------------------------------- -+ * -+ * SET: Undo -+ * -+ *---------------------------------------------------------------------*/ -+/** -+ * @internal -+ * undo the value for a particular column -+ */ -+NETSNMP_STATIC_INLINE int -+_etherStatsTable_undo_column(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ netsnmp_variable_list * var, int column) -+{ -+ int rc = SNMPERR_SUCCESS; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_undo_column", -+ "called for %d\n", column)); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ switch (column) { -+ -+ /* -+ * etherStatsDataSource(2)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h -+ */ -+ case COLUMN_ETHERSTATSDATASOURCE: -+ rc = etherStatsDataSource_undo(rowreq_ctx); -+ break; -+ -+ /* -+ * etherStatsOwner(20)/OwnerString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h -+ */ -+ case COLUMN_ETHERSTATSOWNER: -+ rc = etherStatsOwner_undo(rowreq_ctx); -+ break; -+ -+ /* -+ * etherStatsStatus(21)/EntryStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h -+ */ -+ case COLUMN_ETHERSTATSSTATUS: -+ rc = etherStatsStatus_undo(rowreq_ctx); -+ break; -+ -+ default: -+ snmp_log(LOG_ERR, -+ "unknown column %d in _etherStatsTable_undo_column\n", -+ column); -+ break; -+ } -+ -+ return rc; -+} /* _etherStatsTable_undo_column */ -+ -+int -+_mfd_etherStatsTable_undo_values(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ int rc; -+ etherStatsTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ netsnmp_table_request_info *tri; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_undo_values", "called\n")); -+ -+ netsnmp_assert(NULL != rowreq_ctx); -+ -+ rc = etherStatsTable_undo(rowreq_ctx); -+ if (MFD_SUCCESS != rc) { -+ /* -+ * nothing we can do about it but log it -+ */ -+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from " -+ "etherStatsTable_undo\n", rc)); -+ } -+ -+ for (; requests; requests = requests->next) { -+ /* -+ * set column data -+ */ -+ tri = netsnmp_extract_table_info(requests); -+ if (NULL == tri) -+ continue; -+ -+ rc = _etherStatsTable_undo_column(rowreq_ctx, requests->requestvb, -+ tri->colnum); -+ if (MFD_SUCCESS != rc) { -+ /* -+ * nothing we can do about it but log it -+ */ -+ DEBUGMSGTL(("etherStatsTable:mfd", "error %d from " -+ "etherStatsTable_undo_column\n", rc)); -+ } -+ } /* for results */ -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_etherStatsTable_undo_values */ -+ -+/*---------------------------------------------------------------------- -+ * -+ * SET: irreversible commit -+ * -+ *---------------------------------------------------------------------*/ -+/** -+ * @internal -+ * commit irreversible actions -+ */ -+int -+_mfd_etherStatsTable_irreversible_commit(netsnmp_mib_handler *handler, -+ netsnmp_handler_registration -+ *reginfo, -+ netsnmp_agent_request_info -+ *agtreq_info, -+ netsnmp_request_info *requests) -+{ -+ etherStatsTable_rowreq_ctx *rowreq_ctx = -+ netsnmp_container_table_row_extract(requests); -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_etherStatsTable_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(etherStatsTable_if_ctx.container, rowreq_ctx); -+ } else { -+ if (rowreq_ctx->column_set_flags) { -+ DEBUGMSGTL(("internal:etherStatsTable:_mfd_irreversible_commit", "updating exists (%p) w/set (%p) = %p\n", rowreq_ctx->column_exists_flags, rowreq_ctx->column_set_flags, (rowreq_ctx->column_exists_flags | rowreq_ctx->column_set_flags))); -+ rowreq_ctx->column_exists_flags |= -+ 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(etherStatsTable_if_ctx.container, rowreq_ctx); -+ } -+ } -+ -+ return SNMP_ERR_NOERROR; -+} /* _mfd_etherStatsTable_irreversible_commit */ -+ -+/*********************************************************************** -+ * -+ * DATA ACCESS -+ * -+ ***********************************************************************/ -+static void _container_free(netsnmp_container * container); -+ -+/** -+ * @internal -+ */ -+static int -+_cache_load(netsnmp_cache * cache, void *vmagic) -+{ -+ DEBUGMSGTL(("internal:etherStatsTable:_cache_load", "called\n")); -+ -+ if ((NULL == cache) || (NULL == cache->magic)) { -+ snmp_log(LOG_ERR, -+ "invalid cache for etherStatsTable_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 etherStatsTable_container_load((netsnmp_container *) cache-> -+ magic); -+} /* _cache_load */ -+ -+/** -+ * @internal -+ */ -+static void -+_cache_free(netsnmp_cache * cache, void *magic) -+{ -+ netsnmp_container *container; -+ -+ DEBUGMSGTL(("internal:etherStatsTable:_cache_free", "called\n")); -+ -+ if ((NULL == cache) || (NULL == cache->magic)) { -+ snmp_log(LOG_ERR, "invalid cache in etherStatsTable_cache_free\n"); -+ return; -+ } -+ -+ container = (netsnmp_container *) cache->magic; -+ -+ _container_free(container); -+} /* _cache_free */ -+ -+/** -+ * @internal -+ */ -+static void -+_container_item_free(etherStatsTable_rowreq_ctx * rowreq_ctx, -+ void *context) -+{ -+ DEBUGMSGTL(("internal:etherStatsTable:_container_item_free", -+ "called\n")); -+ -+ if (NULL == rowreq_ctx) -+ return; -+ -+ etherStatsTable_release_rowreq_ctx(rowreq_ctx); -+} /* _container_item_free */ -+ -+/** -+ * @internal -+ */ -+static void -+_container_free(netsnmp_container * container) -+{ -+ DEBUGMSGTL(("internal:etherStatsTable:_container_free", "called\n")); -+ -+ if (NULL == container) { -+ snmp_log(LOG_ERR, -+ "invalid container in etherStatsTable_container_free\n"); -+ return; -+ } -+ -+ /* -+ * call user code -+ */ -+ etherStatsTable_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 -+_etherStatsTable_container_init(etherStatsTable_interface_ctx * if_ctx) -+{ -+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_container_init", -+ "called\n")); -+ -+ /* -+ * cache init -+ */ -+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */ -+ _cache_load, _cache_free, -+ etherStatsTable_oid, -+ etherStatsTable_oid_size); -+ -+ if (NULL == if_ctx->cache) { -+ snmp_log(LOG_ERR, "error creating cache for etherStatsTable\n"); -+ return; -+ } -+ -+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET; -+ -+ etherStatsTable_container_init(&if_ctx->container, if_ctx->cache); -+ if (NULL == if_ctx->container) -+ if_ctx->container = -+ netsnmp_container_find("etherStatsTable:table_container"); -+ if (NULL == if_ctx->container) { -+ snmp_log(LOG_ERR, "error creating container in " -+ "etherStatsTable_container_init\n"); -+ return; -+ } -+ -+ if (NULL != if_ctx->cache) -+ if_ctx->cache->magic = (void *) if_ctx->container; -+} /* _etherStatsTable_container_init */ -+ -+/** -+ * @internal -+ * shutdown the container with functions or wrappers -+ */ -+void -+_etherStatsTable_container_shutdown(etherStatsTable_interface_ctx * if_ctx) -+{ -+ DEBUGMSGTL(("internal:etherStatsTable:_etherStatsTable_container_shutdown", "called\n")); -+ -+ etherStatsTable_container_shutdown(if_ctx->container); -+ -+ _container_free(if_ctx->container); -+ -+} /* _etherStatsTable_container_shutdown */ -+ -+ -+etherStatsTable_rowreq_ctx * -+etherStatsTable_row_find_by_mib_index(etherStatsTable_mib_index * mib_idx) -+{ -+ etherStatsTable_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 = etherStatsTable_index_to_oid(&oid_idx, mib_idx); -+ if (MFD_SUCCESS != rc) -+ return NULL; -+ -+ rowreq_ctx = -+ CONTAINER_FIND(etherStatsTable_if_ctx.container, &oid_idx); -+ -+ return rowreq_ctx; -+} -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.h ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.h 2008-08-25 02:37:27.000000000 -0400 -@@ -0,0 +1,98 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * version : 15899 $ of $ -+ * -+ * $Id:$ -+ */ -+/** @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 ETHERSTATSTABLE_INTERFACE_H -+#define ETHERSTATSTABLE_INTERFACE_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+#include "etherStatsTable.h" -+ -+ -+ /* -+ ******************************************************************** -+ * Table declarations -+ */ -+ -+ /* -+ * PUBLIC interface initialization routine -+ */ -+ void -+ _etherStatsTable_initialize_interface(etherStatsTable_registration -+ * user_ctx, u_long flags); -+ void -+ _etherStatsTable_shutdown_interface(etherStatsTable_registration * -+ user_ctx); -+ -+ etherStatsTable_registration *etherStatsTable_registration_get(void); -+ -+ etherStatsTable_registration -+ *etherStatsTable_registration_set(etherStatsTable_registration * -+ newreg); -+ -+ netsnmp_container *etherStatsTable_container_get(void); -+ int etherStatsTable_container_size(void); -+ -+ u_int etherStatsTable_dirty_get(void); -+ void etherStatsTable_dirty_set(u_int status); -+ -+ etherStatsTable_rowreq_ctx *etherStatsTable_allocate_rowreq_ctx(void -+ *); -+ void -+ etherStatsTable_release_rowreq_ctx(etherStatsTable_rowreq_ctx * -+ rowreq_ctx); -+ -+ int etherStatsTable_index_to_oid(netsnmp_index * oid_idx, -+ etherStatsTable_mib_index -+ * mib_idx); -+ int etherStatsTable_index_from_oid(netsnmp_index * oid_idx, -+ etherStatsTable_mib_index -+ * mib_idx); -+ -+ /* -+ * access to certain internals. use with caution! -+ */ -+ void etherStatsTable_valid_columns_set(netsnmp_column_info -+ *vc); -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* ETHERSTATSTABLE_INTERFACE_H */ -+/** @} */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h 2008-08-25 02:37:27.000000000 -0400 -@@ -0,0 +1,107 @@ -+/* -+ * Note: this file originally auto-generated by mib2c using -+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $ -+ * -+ * $Id:$ -+ */ -+#ifndef ETHERSTATSTABLE_OIDS_H -+#define ETHERSTATSTABLE_OIDS_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+ /* -+ * column number definitions for table etherStatsTable -+ */ -+#define ETHERSTATSTABLE_OID 1,3,6,1,2,1,16,1,1 -+ -+#define COLUMN_ETHERSTATSINDEX 1 -+#define COLUMN_ETHERSTATSINDEX_FLAG (0x1 << 0) -+ -+#define COLUMN_ETHERSTATSDATASOURCE 2 -+#define COLUMN_ETHERSTATSDATASOURCE_FLAG (0x1 << 1) -+ -+#define COLUMN_ETHERSTATSDROPEVENTS 3 -+#define COLUMN_ETHERSTATSDROPEVENTS_FLAG (0x1 << 2) -+ -+#define COLUMN_ETHERSTATSOCTETS 4 -+#define COLUMN_ETHERSTATSOCTETS_FLAG (0x1 << 3) -+ -+#define COLUMN_ETHERSTATSPKTS 5 -+#define COLUMN_ETHERSTATSPKTS_FLAG (0x1 << 4) -+ -+#define COLUMN_ETHERSTATSBROADCASTPKTS 6 -+#define COLUMN_ETHERSTATSBROADCASTPKTS_FLAG (0x1 << 5) -+ -+#define COLUMN_ETHERSTATSMULTICASTPKTS 7 -+#define COLUMN_ETHERSTATSMULTICASTPKTS_FLAG (0x1 << 6) -+ -+#define COLUMN_ETHERSTATSCRCALIGNERRORS 8 -+#define COLUMN_ETHERSTATSCRCALIGNERRORS_FLAG (0x1 << 7) -+ -+#define COLUMN_ETHERSTATSUNDERSIZEPKTS 9 -+#define COLUMN_ETHERSTATSUNDERSIZEPKTS_FLAG (0x1 << 8) -+ -+#define COLUMN_ETHERSTATSOVERSIZEPKTS 10 -+#define COLUMN_ETHERSTATSOVERSIZEPKTS_FLAG (0x1 << 9) -+ -+#define COLUMN_ETHERSTATSFRAGMENTS 11 -+#define COLUMN_ETHERSTATSFRAGMENTS_FLAG (0x1 << 10) -+ -+#define COLUMN_ETHERSTATSJABBERS 12 -+#define COLUMN_ETHERSTATSJABBERS_FLAG (0x1 << 11) -+ -+#define COLUMN_ETHERSTATSCOLLISIONS 13 -+#define COLUMN_ETHERSTATSCOLLISIONS_FLAG (0x1 << 12) -+ -+#define COLUMN_ETHERSTATSPKTS64OCTETS 14 -+#define COLUMN_ETHERSTATSPKTS64OCTETS_FLAG (0x1 << 13) -+ -+#define COLUMN_ETHERSTATSPKTS65TO127OCTETS 15 -+#define COLUMN_ETHERSTATSPKTS65TO127OCTETS_FLAG (0x1 << 14) -+ -+#define COLUMN_ETHERSTATSPKTS128TO255OCTETS 16 -+#define COLUMN_ETHERSTATSPKTS128TO255OCTETS_FLAG (0x1 << 15) -+ -+#define COLUMN_ETHERSTATSPKTS256TO511OCTETS 17 -+#define COLUMN_ETHERSTATSPKTS256TO511OCTETS_FLAG (0x1 << 16) -+ -+#define COLUMN_ETHERSTATSPKTS512TO1023OCTETS 18 -+#define COLUMN_ETHERSTATSPKTS512TO1023OCTETS_FLAG (0x1 << 17) -+ -+#define COLUMN_ETHERSTATSPKTS1024TO1518OCTETS 19 -+#define COLUMN_ETHERSTATSPKTS1024TO1518OCTETS_FLAG (0x1 << 18) -+ -+#define COLUMN_ETHERSTATSOWNER 20 -+#define COLUMN_ETHERSTATSOWNER_FLAG (0x1 << 19) -+ -+#define COLUMN_ETHERSTATSSTATUS 21 -+#define COLUMN_ETHERSTATSSTATUS_FLAG (0x1 << 20) -+ -+ -+#define ETHERSTATSTABLE_MIN_COL COLUMN_ETHERSTATSINDEX -+#define ETHERSTATSTABLE_MAX_COL COLUMN_ETHERSTATSSTATUS -+ -+ -+ /* -+ * TODO:405:r: Review ETHERSTATSTABLE_SETTABLE_COLS macro. -+ * OR together all the writable cols. -+ */ -+#define ETHERSTATSTABLE_SETTABLE_COLS (COLUMN_ETHERSTATSINDEX_FLAG | COLUMN_ETHERSTATSDATASOURCE_FLAG | COLUMN_ETHERSTATSDROPEVENTS_FLAG | COLUMN_ETHERSTATSOCTETS_FLAG | COLUMN_ETHERSTATSPKTS_FLAG | COLUMN_ETHERSTATSBROADCASTPKTS_FLAG | COLUMN_ETHERSTATSMULTICASTPKTS_FLAG | COLUMN_ETHERSTATSCRCALIGNERRORS_FLAG | COLUMN_ETHERSTATSUNDERSIZEPKTS_FLAG | COLUMN_ETHERSTATSOVERSIZEPKTS_FLAG | COLUMN_ETHERSTATSFRAGMENTS_FLAG | COLUMN_ETHERSTATSJABBERS_FLAG | COLUMN_ETHERSTATSCOLLISIONS_FLAG | COLUMN_ETHERSTATSPKTS64OCTETS_FLAG | COLUMN_ETHERSTATSPKTS65TO127OCTETS_FLAG | COLUMN_ETHERSTATSPKTS128TO255OCTETS_FLAG | COLUMN_ETHERSTATSPKTS256TO511OCTETS_FLAG | COLUMN_ETHERSTATSPKTS512TO1023OCTETS_FLAG | COLUMN_ETHERSTATSPKTS1024TO1518OCTETS_FLAG | COLUMN_ETHERSTATSOWNER_FLAG | COLUMN_ETHERSTATSSTATUS_FLAG) -+ /* -+ * TODO:405:r: Review ETHERSTATSTABLE_REQUIRED_COLS macro. -+ * OR together all the required rows for row creation. -+ * default is writable cols w/out defaults. -+ */ -+#define ETHERSTATSTABLE_REQUIRED_COLS (COLUMN_ETHERSTATSDATASOURCE_FLAG | COLUMN_ETHERSTATSOWNER_FLAG | COLUMN_ETHERSTATSSTATUS_FLAG) -+ -+#define ETHERSTATSTABLE_VALID_COL COLUMN_ETHERSTATSJABBERS_FLAG -+ -+ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* ETHERSTATSTABLE_OIDS_H */ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h 2008-12-21 05:55:16.000000000 -0500 -@@ -0,0 +1,35 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* use kernel's ethtool.h */ -+ -+#include -+typedef __u64 u64; -+typedef __u32 u32; -+typedef __u16 u16; -+typedef __u8 u8; -+#include -+ -+/* structure for storing the interface names in the system */ -+ -+struct ifname { -+ struct ifname *ifn_next; -+ char name [IF_NAMESIZE]; -+}; -+ -+struct ifname *etherstats_interface_name_list_get (struct ifname *, int *); -+int etherstats_interface_name_list_free (struct ifname *list_head); -+int etherstats_interface_ioctl_ifindex_get (int fd, const char *name); -+int _etherStats_ioctl_get(int fd, int which, struct ifreq *ifrq, const char* name); -+int interface_ioctl_etherstats_get(etherStatsTable_rowreq_ctx *rowreq_ctx, int fd, const char* name); -+ -+/* for maintainability */ -+ -+#define BROADCOM_RECEIVE_JABBERS "rx_jabbers" -+ -+#define ETHERSTATSJABBERS(x) strstr(x, BROADCOM_RECEIVE_JABBERS) -+ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable.h ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable.h 2008-12-21 05:47:48.000000000 -0500 -@@ -0,0 +1,11 @@ -+/* -+ * module to include the modules -+ */ -+ -+config_require(rmon-mib/data_access/etherstats) -+config_require(rmon-mib/etherStatsTable/etherStatsTable) -+config_require(rmon-mib/etherStatsTable/etherStatsTable_data_get) -+config_require(rmon-mib/etherStatsTable/etherStatsTable_data_set) -+config_require(rmon-mib/etherStatsTable/etherStatsTable_data_access) -+config_require(rmon-mib/etherStatsTable/etherStatsTable_interface) -+ -diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib.h ---- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib.h 1969-12-31 19:00:00.000000000 -0500 -+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib.h 2008-12-21 05:41:57.000000000 -0500 -@@ -0,0 +1,8 @@ -+/* -+ * module to include the modules -+ */ -+ -+config_require(rmon-mib/etherStatsTable) -+config_add_mib(RMON-MIB) -+ -+ - - diff --git a/net-snmp-5.4.2.1.tar.bz2 b/net-snmp-5.4.2.1.tar.bz2 deleted file mode 100644 index c8271a0..0000000 --- a/net-snmp-5.4.2.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3822eb6850d5b52707b93b1f632a6065d94ecb451bb735bfe9df97ee9987d2e2 -size 3734297 diff --git a/net-snmp-5.4.2_audit.patch b/net-snmp-5.4.2_audit.patch index 31e408a..c0ff114 100644 --- a/net-snmp-5.4.2_audit.patch +++ b/net-snmp-5.4.2_audit.patch @@ -1,8 +1,8 @@ Index: agent/mibgroup/examples/ucdDemoPublic.c =================================================================== ---- agent/mibgroup/examples/ucdDemoPublic.c.orig 2002-12-19 16:07:36.000000000 +0100 -+++ agent/mibgroup/examples/ucdDemoPublic.c 2008-10-24 15:30:26.538387687 +0200 -@@ -219,7 +219,11 @@ write_ucdDemoPublicString(int action, +--- agent/mibgroup/examples/ucdDemoPublic.c.orig ++++ agent/mibgroup/examples/ucdDemoPublic.c +@@ -222,7 +222,11 @@ write_ucdDemoPublicString(int action, } if (action == COMMIT) { if (var_val_len != 0) { @@ -15,55 +15,11 @@ Index: agent/mibgroup/examples/ucdDemoPublic.c publicString[var_val_len] = '\0'; } else publicString[0] = '\0'; -Index: agent/mibgroup/mibII/system_mib.c -=================================================================== ---- agent/mibgroup/mibII/system_mib.c.orig 2006-09-15 02:48:50.000000000 +0200 -+++ agent/mibgroup/mibII/system_mib.c 2008-10-24 15:30:26.550386000 +0200 -@@ -126,7 +126,7 @@ system_parse_config_sysloc(const char *t - char tmpbuf[1024]; - - if (strlen(cptr) >= sizeof(sysLocation)) { -- snprintf(tmpbuf, 1024, -+ snprintf(tmpbuf, sizeof(tmpbuf), - "syslocation token too long (must be < %lu):\n\t%s", - (unsigned long)sizeof(sysLocation), cptr); - config_perror(tmpbuf); -@@ -173,7 +173,7 @@ system_parse_config_syscon(const char *t - char tmpbuf[1024]; - - if (strlen(cptr) >= sizeof(sysContact)) { -- snprintf(tmpbuf, 1024, -+ snprintf(tmpbuf, sizeof(tmpbuf), - "syscontact token too long (must be < %lu):\n\t%s", - (unsigned long)sizeof(sysContact), cptr); - config_perror(tmpbuf); -@@ -220,7 +220,7 @@ system_parse_config_sysname(const char * - char tmpbuf[1024]; - - if (strlen(cptr) >= sizeof(sysName)) { -- snprintf(tmpbuf, 1024, -+ snprintf(tmpbuf, sizeof(tmpbuf), - "sysname token too long (must be < %lu):\n\t%s", - (unsigned long)sizeof(sysName), cptr); - config_perror(tmpbuf); -Index: agent/mibgroup/mibII/var_route.c -=================================================================== ---- agent/mibgroup/mibII/var_route.c.orig 2008-07-28 16:39:55.000000000 +0200 -+++ agent/mibgroup/mibII/var_route.c 2008-10-24 15:30:26.582385351 +0200 -@@ -1381,7 +1381,7 @@ Route_Scan_Reload(void) - /* - * Sort it! - */ -- qsort((char *) rthead, rtsize, sizeof(rthead[0]), qsort_compare); -+ qsort((char *) rthead, rtsize, sizeof(rthead[0]), (int (*) (const void*, const void*)) qsort_compare); - } - #endif - #endif Index: agent/mibgroup/util_funcs.c =================================================================== ---- agent/mibgroup/util_funcs.c.orig 2007-08-16 16:12:47.000000000 +0200 -+++ agent/mibgroup/util_funcs.c 2008-10-24 15:30:26.598384777 +0200 -@@ -140,6 +140,10 @@ make_tempfile(void) +--- agent/mibgroup/util_funcs.c.orig ++++ agent/mibgroup/util_funcs.c +@@ -142,6 +142,10 @@ make_tempfile(void) } #endif if (fd >= 0) { @@ -76,8 +32,8 @@ Index: agent/mibgroup/util_funcs.c return name; Index: agent/auto_nlist.c =================================================================== ---- agent/auto_nlist.c.orig 2008-06-05 23:11:53.000000000 +0200 -+++ agent/auto_nlist.c 2008-10-24 15:30:26.630385059 +0200 +--- agent/auto_nlist.c.orig ++++ agent/auto_nlist.c @@ -64,6 +64,7 @@ auto_nlist_value(const char *string) it->nl[0].n_name = (char *) malloc(strlen(string) + 2); #if defined(aix4) || defined(aix5) || defined(aix6) @@ -96,8 +52,8 @@ Index: agent/auto_nlist.c #endif Index: apps/snmptest.c =================================================================== ---- apps/snmptest.c.orig 2008-05-29 11:59:06.000000000 +0200 -+++ apps/snmptest.c 2008-10-24 15:30:26.650386319 +0200 +--- apps/snmptest.c.orig ++++ apps/snmptest.c @@ -456,6 +456,7 @@ input_variable(netsnmp_variable_list * v goto getValue; } @@ -106,48 +62,20 @@ Index: apps/snmptest.c vp->val_len = strlen(buf) - 1; } else if (ch == 'x') { size_t buf_len = 256; -Index: apps/snmptrapd_handlers.c -=================================================================== ---- apps/snmptrapd_handlers.c.orig 2007-06-08 12:44:37.000000000 +0200 -+++ apps/snmptrapd_handlers.c 2008-10-24 15:30:26.682736940 +0200 -@@ -24,6 +24,9 @@ - #include - #endif - -+#include -+#include -+ - #include - #include - #include -@@ -863,10 +866,11 @@ do_external(char *cmd, struct hostent *h - #else - char command_buf[128]; - char file_buf[L_tmpnam]; -+ int win_fd; - - tmpnam(file_buf); -- file = fopen(file_buf, "w"); -- if (!file) { -+ win_fd = open(file_buf, O_RDWR | O_CREAT | O_EXCL, 0600); -+ if (win_fd < 0 || (file = fdopen(win_fd, "w")) == NULL) - fprintf(stderr, "fopen: %s: %s\n", file_buf, strerror(errno)); - } else { - send_handler_data(file, host, pdu, transport); Index: snmplib/parse.c =================================================================== ---- snmplib/parse.c.orig 2008-04-07 16:00:44.000000000 +0200 -+++ snmplib/parse.c 2008-10-24 15:30:26.706385615 +0200 -@@ -4191,7 +4191,7 @@ static struct node * - parse(FILE * fp, struct node *root) - { +--- snmplib/parse.c.orig ++++ snmplib/parse.c +@@ -4231,7 +4231,7 @@ parse(FILE * fp, struct node *root) + extern void xmalloc_stats(FILE *); + #endif char token[MAXTOKEN]; - char name[MAXTOKEN]; + char name[MAXTOKEN+1]; int type = LABEL; int lasttype = LABEL; -@@ -4283,7 +4283,8 @@ parse(FILE * fp, struct node *root) +@@ -4323,7 +4323,8 @@ parse(FILE * fp, struct node *root) case ENDOFFILE: continue; default: @@ -157,7 +85,7 @@ Index: snmplib/parse.c type = get_token(fp, token, MAXTOKEN); nnp = NULL; if (type == MACRO) { -@@ -4300,7 +4301,8 @@ parse(FILE * fp, struct node *root) +@@ -4340,7 +4341,8 @@ parse(FILE * fp, struct node *root) print_error(name, "is a reserved word", lasttype); continue; /* see if we can parse the rest of the file */ } @@ -169,8 +97,8 @@ Index: snmplib/parse.c Index: snmplib/tools.c =================================================================== ---- snmplib/tools.c.orig 2007-02-21 14:58:27.000000000 +0100 -+++ snmplib/tools.c 2008-10-24 15:30:26.750385578 +0200 +--- snmplib/tools.c.orig ++++ snmplib/tools.c @@ -696,7 +696,7 @@ dump_snmpEngineID(const u_char * estring /* * s += snprintf(s, remaining_len+3, "\"%s\"", esp); @@ -182,8 +110,8 @@ Index: snmplib/tools.c /*NOTREACHED*/ case 5: /* Octets. */ Index: testing/TESTCONF.sh =================================================================== ---- testing/TESTCONF.sh.orig 2006-08-07 17:34:16.000000000 +0200 -+++ testing/TESTCONF.sh 2008-10-24 15:30:26.774385440 +0200 +--- testing/TESTCONF.sh.orig ++++ testing/TESTCONF.sh @@ -77,8 +77,8 @@ if [ "x$SNMP_TMPDIR" = "x" -a "x$SNMP_HE fi SNMP_TMP_PERSISTENTDIR=$SNMP_TMPDIR/persist @@ -197,8 +125,8 @@ Index: testing/TESTCONF.sh if [ "x$SNMP_SAVE_TMPDIR" = "x" ]; then Index: testing/eval_suite.sh =================================================================== ---- testing/eval_suite.sh.orig 2002-04-20 09:30:29.000000000 +0200 -+++ testing/eval_suite.sh 2008-10-24 15:30:26.798384612 +0200 +--- testing/eval_suite.sh.orig ++++ testing/eval_suite.sh @@ -79,7 +79,11 @@ exit 0 PROGRAM= ARGUMENTS="$*" diff --git a/net-snmp-5.4.2_autoconf.patch b/net-snmp-5.4.2_autoconf.patch deleted file mode 100644 index b2f393d..0000000 --- a/net-snmp-5.4.2_autoconf.patch +++ /dev/null @@ -1,40 +0,0 @@ -Index: configure.in -=================================================================== ---- configure.in.orig 2008-09-05 11:27:25.000000000 +0200 -+++ configure.in 2008-10-24 15:30:38.018389374 +0200 -@@ -1025,7 +1025,7 @@ AC_SUBST(LINKCC) - AC_AIX - - # system check --AC_CANONICAL_TARGET -+AC_CANONICAL_TARGET([]) - changequote(, ) - PARTIALTARGETOS=`echo $target_os | sed 's/[-._].*//'` - changequote([, ]) -@@ -2756,8 +2756,6 @@ AC_ARG_WITH(libwrap, - [ - AC_MSG_RESULT([no]) - # Linux RedHat 6.1 won't link libwrap without libnsl -- AC_CHECK_FUNC(yp_get_default_domain, , -- AC_CHECK_LIB(nsl, yp_get_default_domain)) - AC_MSG_CHECKING([for TCP wrappers library -lwrap linked with -lnsl]) - AC_TRY_LINK([#include - #include -@@ -4555,7 +4553,7 @@ fi - # we need to have a local variable `hz' in scope and set to a useful - # value whenever we use one of these constants. - # --AC_CACHE_CHECK(whether TCP timers depend on \`hz',ac_cv_TCPTV_NEEDS_HZ, -+AC_CACHE_CHECK(whether TCP timers depend on hz,ac_cv_TCPTV_NEEDS_HZ, - [AC_EGREP_CPP(hz, - [#include - TCPTV_SRTTDFLT -@@ -4609,7 +4607,7 @@ fi - - ME=`$WHOAMI` - if test -f /etc/resolv.conf; then -- LOC=`cat /etc/resolv.conf | grep '^domain' | tail -1 | awk '{print $NF}'` -+ LOC=`cat /etc/resolv.conf | grep '^domain' | tail -n 1 | awk '{print $NF}'` - else - LOC="@no.where" - fi diff --git a/net-snmp-5.4.2_net-snmp-config_headercheck.patch b/net-snmp-5.4.2_net-snmp-config_headercheck.patch index 0e4de91..d5075f0 100644 --- a/net-snmp-5.4.2_net-snmp-config_headercheck.patch +++ b/net-snmp-5.4.2_net-snmp-config_headercheck.patch @@ -1,9 +1,9 @@ Index: net-snmp-config.in =================================================================== ---- net-snmp-config.in.orig 2008-07-30 19:28:08.000000000 +0200 -+++ net-snmp-config.in 2008-10-24 15:30:56.926874746 +0200 -@@ -27,6 +27,14 @@ check_build_dir() - fi +--- net-snmp-config.in.orig ++++ net-snmp-config.in +@@ -41,6 +41,14 @@ count() + echo $# } +check_devel_files() @@ -17,7 +17,7 @@ Index: net-snmp-config.in prefix=@prefix@ exec_prefix=@exec_prefix@ includedir=@includedir@ -@@ -105,9 +113,11 @@ else +@@ -120,9 +128,11 @@ else ;; #################################################### compile --base-cflags) @@ -29,7 +29,7 @@ Index: net-snmp-config.in echo @CFLAGS@ @DEVFLAGS@ @CPPFLAGS@ -I. -I${NSC_INCLUDEDIR} ;; --srcdir) -@@ -118,6 +128,7 @@ else +@@ -133,6 +143,7 @@ else echo $NSC_LIBDIR ;; --ldflags|--ld*) @@ -37,7 +37,7 @@ Index: net-snmp-config.in echo $NSC_LDFLAGS ;; --build-lib-dirs) -@@ -151,30 +162,38 @@ else +@@ -166,30 +177,38 @@ else ;; #################################################### client lib --libs) @@ -76,7 +76,7 @@ Index: net-snmp-config.in echo $NSC_LDFLAGS $NSC_AGENTLIBS ;; #################################################### -@@ -316,6 +335,7 @@ else +@@ -215,6 +234,7 @@ else #################################################### --compile-subagent) diff --git a/net-snmp-5.4.2_overflow.patch b/net-snmp-5.4.2_overflow.patch index 01b5a16..70ddbb8 100644 --- a/net-snmp-5.4.2_overflow.patch +++ b/net-snmp-5.4.2_overflow.patch @@ -1,8 +1,8 @@ Index: snmplib/mib.c =================================================================== ---- snmplib/mib.c.orig 2008-07-30 09:57:19.000000000 +0200 -+++ snmplib/mib.c 2008-10-24 15:30:42.854387100 +0200 -@@ -1489,7 +1489,7 @@ sprint_realloc_gauge(u_char ** buf, size +--- snmplib/mib.c.orig ++++ snmplib/mib.c +@@ -1507,7 +1507,7 @@ sprint_realloc_gauge(u_char ** buf, size return 0; } } else { @@ -11,7 +11,7 @@ Index: snmplib/mib.c if (!snmp_strcat (buf, buf_len, out_len, allow_realloc, (const u_char *) tmp)) { return 0; -@@ -1553,7 +1553,7 @@ sprint_realloc_counter(u_char ** buf, si +@@ -1571,7 +1571,7 @@ sprint_realloc_counter(u_char ** buf, si return 0; } } diff --git a/net-snmp-5.4.2_perl_tk_warning.patch b/net-snmp-5.4.2_perl_tk_warning.patch index e63120c..56f0966 100644 --- a/net-snmp-5.4.2_perl_tk_warning.patch +++ b/net-snmp-5.4.2_perl_tk_warning.patch @@ -1,7 +1,7 @@ Index: local/tkmib =================================================================== ---- local/tkmib.orig 2006-07-27 21:48:25.000000000 +0200 -+++ local/tkmib 2008-10-24 15:31:02.574384593 +0200 +--- local/tkmib.orig ++++ local/tkmib @@ -27,10 +27,9 @@ instructions. if (!$havetk) { diff --git a/net-snmp-5.4.2_snmpconf-selinux.patch b/net-snmp-5.4.2_snmpconf-selinux.patch index 8a6e3e1..2bb385f 100644 --- a/net-snmp-5.4.2_snmpconf-selinux.patch +++ b/net-snmp-5.4.2_snmpconf-selinux.patch @@ -2,8 +2,8 @@ https://bugzilla.redhat.com/show_bug.cgi?id=248329 Index: local/snmpconf =================================================================== ---- local/snmpconf.orig 2005-08-16 17:59:16.000000000 +0200 -+++ local/snmpconf 2008-10-24 15:31:06.798387241 +0200 +--- local/snmpconf.orig ++++ local/snmpconf @@ -682,6 +682,7 @@ sub output_files { } } diff --git a/net-snmp-5.4.2_testing.empty_arptable.patch b/net-snmp-5.4.2_testing.empty_arptable.patch index 87bf37c..eacb196 100644 --- a/net-snmp-5.4.2_testing.empty_arptable.patch +++ b/net-snmp-5.4.2_testing.empty_arptable.patch @@ -1,7 +1,7 @@ Index: testing/rfc1213/snmpfun.sh =================================================================== ---- testing/rfc1213/snmpfun.sh.orig 2004-12-10 16:15:52.000000000 +0100 -+++ testing/rfc1213/snmpfun.sh 2008-10-24 15:30:46.066386937 +0200 +--- testing/rfc1213/snmpfun.sh.orig ++++ testing/rfc1213/snmpfun.sh @@ -1,4 +1,3 @@ - # functions used by RFC-1213 MIB test modules @@ -80,8 +80,8 @@ Index: testing/rfc1213/snmpfun.sh + Index: testing/rfc1213/test_fun =================================================================== ---- testing/rfc1213/test_fun.orig 2004-10-16 22:44:35.000000000 +0200 -+++ testing/rfc1213/test_fun 2008-10-24 15:30:46.066386937 +0200 +--- testing/rfc1213/test_fun.orig ++++ testing/rfc1213/test_fun @@ -51,6 +51,9 @@ test_finish() if [ x$1 == x"PASS" ];then pass_num=`expr $pass_num + 1` diff --git a/net-snmp-5.4.2_velocity-mib.patch b/net-snmp-5.4.2_velocity-mib.patch index 7476845..650d3b4 100644 --- a/net-snmp-5.4.2_velocity-mib.patch +++ b/net-snmp-5.4.2_velocity-mib.patch @@ -1,7 +1,7 @@ Index: LICENSE.VELOCITY =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ LICENSE.VELOCITY 2008-10-24 15:34:16.302888835 +0200 +--- /dev/null ++++ LICENSE.VELOCITY @@ -0,0 +1,41 @@ +/* Portions of these files are subject to the following copyright(s). See + * the Net-SNMP's COPYING file for more details and other copyrights @@ -46,8 +46,8 @@ Index: LICENSE.VELOCITY + */ Index: agent/mibgroup/velocity.h =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ agent/mibgroup/velocity.h 2008-10-24 15:34:16.322885644 +0200 +--- /dev/null ++++ agent/mibgroup/velocity.h @@ -0,0 +1,28 @@ +/* + * Velocity 'wrapper' interface which is an extension of the host resources @@ -79,8 +79,8 @@ Index: agent/mibgroup/velocity.h +config_add_mib(VELOCITY-TYPES) Index: agent/mibgroup/velocity/velocity_app.c =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ agent/mibgroup/velocity/velocity_app.c 2008-10-24 15:34:16.406884701 +0200 +--- /dev/null ++++ agent/mibgroup/velocity/velocity_app.c @@ -0,0 +1,499 @@ +#include + @@ -583,8 +583,8 @@ Index: agent/mibgroup/velocity/velocity_app.c + Index: agent/mibgroup/velocity/velocity_app.h =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ agent/mibgroup/velocity/velocity_app.h 2008-10-24 15:34:16.422385429 +0200 +--- /dev/null ++++ agent/mibgroup/velocity/velocity_app.h @@ -0,0 +1,38 @@ +/* + * Application watching mib group @@ -626,8 +626,8 @@ Index: agent/mibgroup/velocity/velocity_app.h +#endif /* _MIBGROUP_APP_H */ Index: agent/mibgroup/velocity/velocity_swrun.c =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ agent/mibgroup/velocity/velocity_swrun.c 2008-10-24 15:34:16.438385053 +0200 +--- /dev/null ++++ agent/mibgroup/velocity/velocity_swrun.c @@ -0,0 +1,1595 @@ +/* + * Velocity MIB - Running Software group implementation - velocity_swrun.c @@ -2226,8 +2226,8 @@ Index: agent/mibgroup/velocity/velocity_swrun.c +} Index: agent/mibgroup/velocity/velocity_swrun.h =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ agent/mibgroup/velocity/velocity_swrun.h 2008-10-24 15:34:16.482385229 +0200 +--- /dev/null ++++ agent/mibgroup/velocity/velocity_swrun.h @@ -0,0 +1,13 @@ +/* + * Velocity MIB - Running Software group interface - velocity_swrun.h @@ -2244,8 +2244,8 @@ Index: agent/mibgroup/velocity/velocity_swrun.h +#endif /* _MIBGROUP_VELOCITYSWRUN_H */ Index: agent/mibgroup/velocity/velocity_system.c =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ agent/mibgroup/velocity/velocity_system.c 2008-10-24 15:34:16.506385667 +0200 +--- /dev/null ++++ agent/mibgroup/velocity/velocity_system.c @@ -0,0 +1,403 @@ +/* + * Velocity MIB - system group implementation - velocity_system.c @@ -2652,8 +2652,8 @@ Index: agent/mibgroup/velocity/velocity_system.c +#endif /* UTMP_FILE */ Index: agent/mibgroup/velocity/velocity_system.h =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ agent/mibgroup/velocity/velocity_system.h 2008-10-24 15:34:16.522385240 +0200 +--- /dev/null ++++ agent/mibgroup/velocity/velocity_system.h @@ -0,0 +1,12 @@ +/* + * Velocity MIB - system group interface - velocity_system.h @@ -2669,8 +2669,8 @@ Index: agent/mibgroup/velocity/velocity_system.h +#endif /* _MIBGROUP_VELOCITYSYSTEM_H */ Index: mibs/VELOCITY-MIB.txt =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mibs/VELOCITY-MIB.txt 2008-10-24 15:34:16.550885795 +0200 +--- /dev/null ++++ mibs/VELOCITY-MIB.txt @@ -0,0 +1,671 @@ +VELOCITY-MIB DEFINITIONS ::= BEGIN + @@ -3345,8 +3345,8 @@ Index: mibs/VELOCITY-MIB.txt +END Index: mibs/VELOCITY-TYPES.txt =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mibs/VELOCITY-TYPES.txt 2008-10-24 15:34:16.591898815 +0200 +--- /dev/null ++++ mibs/VELOCITY-TYPES.txt @@ -0,0 +1,23 @@ +VELOCITY-TYPES DEFINITIONS ::= BEGIN + diff --git a/net-snmp-5.4.2_vendorperl.patch b/net-snmp-5.4.2_vendorperl.patch index 47aeba7..559d276 100644 --- a/net-snmp-5.4.2_vendorperl.patch +++ b/net-snmp-5.4.2_vendorperl.patch @@ -1,8 +1,8 @@ Index: Makefile.in =================================================================== ---- Makefile.in.orig 2007-06-08 22:32:56.000000000 +0200 -+++ Makefile.in 2008-10-24 15:30:52.442885040 +0200 -@@ -169,7 +169,7 @@ perlmakefiles: net-snmp-config-x +--- Makefile.in.orig ++++ Makefile.in +@@ -175,7 +175,7 @@ perlmakefiles: net-snmp-config-x fi perlinstall: diff --git a/net-snmp-5.4.x_embedded_perl_error_message.patch b/net-snmp-5.4.x_embedded_perl_error_message.patch deleted file mode 100644 index 6936d57..0000000 --- a/net-snmp-5.4.x_embedded_perl_error_message.patch +++ /dev/null @@ -1,13 +0,0 @@ -=== agent/snmp_perl.c -================================================================== ---- agent/snmp_perl.c (revision 17294) -+++ agent/snmp_perl.c (local) -@@ -58,7 +58,7 @@ - return; - - bail_out: -- snmp_log(LOG_ERR, "embedded perl support failed to initalize\n"); -+ snmp_log(LOG_ERR, "embedded perl support failed to initialize\n"); - netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, - NETSNMP_DS_AGENT_DISABLE_PERL, 1); - return; diff --git a/net-snmp-5.5.tar.bz2 b/net-snmp-5.5.tar.bz2 new file mode 100644 index 0000000..8ce9d50 --- /dev/null +++ b/net-snmp-5.5.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b8eb82e4e947c6969ddde288f429b738b8f90300a8c4e00d2211955b404073d +size 3968691 diff --git a/net-snmp.changes b/net-snmp.changes index 73c3186..96fa238 100644 --- a/net-snmp.changes +++ b/net-snmp.changes @@ -1,3 +1,29 @@ +------------------------------------------------------------------- +Tue Dec 22 09:41:44 UTC 2009 - lchiquitto@novell.com + +- update to version 5.5: + new features and lots of bug fixes, including: + - fix hrSWRunPath for processes other than init (bnc#486270) +- remove patches that are now upstream: + Add-Default-Router-Table-support.patch + Add-ICMP-Statistics-Tables-support.patch + Add-IPv6-Scope-Zone-Index.patch + Add-IPv6-support-on-Internet-Address-Translation-Tab.patch + Fix-for-IPv6-Interface-Table.patch + Fix-for-Internet-Address-Prefix-Table.patch + Fix-for-Internet-Address-Table.patch + Fix-for-tcpConnnectionTable-tcpListenerTable-udpEn.patch + Improve-IP-Statistics-tables.patch + net-snmp-5.3.0.1_trap-agent-addr_v2.patch + net-snmp-5.4.1.2-etherlike-mib-revised_4.patch + net-snmp-5.4.x_embedded_perl_error_message.patch + +------------------------------------------------------------------- +Sat Dec 19 14:00:41 CET 2009 - jengelh@medozas.de + +- add baselibs.conf as a source +- add baselib defs for SPARC + ------------------------------------------------------------------- Sun Aug 30 15:17:12 UTC 2009 - aj@suse.de @@ -141,7 +167,6 @@ Fri Sep 12 18:44:53 CEST 2008 - mrueckert@suse.de net-snmp-5.4.1.2-rmon-mib.patch net-snmp-5.4.2_fix_dell_patches.patch - ------------------------------------------------------------------- Sat Sep 6 16:15:57 CEST 2008 - mrueckert@suse.de diff --git a/net-snmp.spec b/net-snmp.spec index cda3f01..1c9d433 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -1,7 +1,7 @@ # -# spec file for package net-snmp (Version 5.4.2.1) +# spec file for package net-snmp (Version 5.5) # -# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,10 +19,10 @@ Name: net-snmp -Version: 5.4.2.1 -Release: 10 +Version: 5.5 +Release: 1 # -License: BSD 3-clause (or similar) ; MIT License (or similar) +License: BSD3c(or similar) ; MIT License (or similar) Group: Productivity/Networking/Other # %define pkg_name net-snmp @@ -64,8 +64,9 @@ Source5: net-snmp.logrotate Source6: test_installed Source7: net-snmp.sysconfig Source8: net-snmp-rpmlintrc +Source9: baselibs.conf Patch: net-snmp-5.4.2_audit.patch -Patch1: net-snmp-5.4.2_autoconf.patch +#Patch1: net-snmp-5.4.2_autoconf.patch # unused patch atm Patch2: net-snmp-5.2.1-socket_path.diff Patch3: net-snmp-5.4.rc2-versinfo.diff @@ -76,21 +77,8 @@ Patch7: net-snmp-5.4.2_vendorperl.patch Patch8: net-snmp-5.4.2_net-snmp-config_headercheck.patch Patch9: net-snmp-5.4.2_perl_tk_warning.patch Patch10: net-snmp-5.4.2_snmpconf-selinux.patch -Patch11: net-snmp-5.3.0.1_trap-agent-addr_v2.patch -Patch12: net-snmp-5.4.1.2-etherlike-mib-revised_4.patch -Patch13: net-snmp-5.4.1.2-rmon-mib-revised_3.patch -Patch14: net-snmp-5.4.2_velocity-mib.patch -Patch15: Fix-for-tcpConnnectionTable-tcpListenerTable-udpEn.patch -Patch16: Fix-for-IPv6-Interface-Table.patch -Patch17: Fix-for-Internet-Address-Table.patch -Patch18: Add-ICMP-Statistics-Tables-support.patch -Patch19: Add-Default-Router-Table-support.patch -Patch20: Add-IPv6-support-on-Internet-Address-Translation-Tab.patch -Patch21: Fix-for-Internet-Address-Prefix-Table.patch -Patch22: Add-IPv6-Scope-Zone-Index.patch -Patch23: Improve-IP-Statistics-tables.patch -Patch24: net-snmp-5.4.x_embedded_perl_error_message.patch -Patch25: net-snmp-5.4.2.1-rpm4.7.patch +Patch11: net-snmp-5.4.2_velocity-mib.patch +Patch12: net-snmp-5.4.2.1-rpm4.7.patch # Summary: SNMP Daemon @@ -110,7 +98,7 @@ Authors: %define library_name libsnmp15 %package -n libsnmp15 -License: BSD 3-clause (or similar) ; MIT License (or similar) +License: BSD3c(or similar) ; MIT License (or similar) Group: Productivity/Networking/Other Requires: snmp-mibs = %{version} # we link libperl @@ -134,7 +122,7 @@ Authors: Wes Hardaker %package devel -License: BSD 3-clause (or similar) ; MIT License (or similar) +License: BSD3c(or similar) ; MIT License (or similar) Group: Development/Libraries/C and C++ # bug437293 %ifarch ppc64 @@ -144,7 +132,7 @@ Obsoletes: net-snmp-devel-64bit Requires: %{library_name} = %{version} # for mib2c Requires: perl-SNMP = %{version} -Requires: openssl-devel rpm-devel tcpd-devel +Requires: libopenssl-devel rpm-devel tcpd-devel perl zlib-devel %if 0%{?with_sensors} Requires: libsensors3-devel %endif @@ -165,7 +153,7 @@ Authors: Wes Hardaker %package -n snmp-mibs -License: BSD 3-clause (or similar) ; MIT License (or similar) +License: BSD3c(or similar) ; MIT License (or similar) Group: Productivity/Networking/Other # Summary: MIB files from net-snmp @@ -185,13 +173,13 @@ Authors: -------- Wes Hardaker -%package -n perl-SNMP -License: GPL v2 or later +%package -n perl-SNMP +License: GPLv2+ Group: Development/Libraries/Perl Requires: %{pkg_name} = %{version} %perl_requires # -Summary: Perl-SNMP +Summary: Perl5 SNMP Extension Module %description -n perl-SNMP The Perl5 'SNMP' Extension Module v3.1.0 for the UCD SNMPv3 library. @@ -205,7 +193,7 @@ Authors: %prep %setup -q -n %{pkg_name}-%{version} %patch -%patch1 +#%patch1 %patch2 %patch3 %patch4 @@ -216,20 +204,7 @@ Authors: %patch9 %patch10 %patch11 -%patch12 -p1 -%patch13 -p1 -%patch14 -%patch15 -p1 -%patch16 -p1 -%patch17 -p1 -%patch18 -p1 -%patch19 -p1 -%patch20 -p1 -%patch21 -p1 -%patch22 -p1 -%patch23 -p1 -%patch24 -%patch25 +%patch12 find -name "CVS" -type d | xargs -r %{__rm} -rfv find -name ".cvsignore" | xargs -r %{__rm} -fv @@ -384,6 +359,7 @@ fi %{_bindir}/snmpvacm %{_bindir}/snmpwalk %{_bindir}/traptoemail +%{_bindir}/net-snmp-create-v3-user %dir %{_prefix}/lib/net-snmp %dir %{_prefix}/lib/net-snmp/agents %{_mandir}/man[158]/*