michael@588: Index: agent/mibgroup/ip-mib/data_access/ipaddress_common.c michael@588: --- agent/mibgroup/ip-mib/data_access/ipaddress_common.c.orig 2011-09-28 06:53:47.000000000 +0200 michael@588: +++ agent/mibgroup/ip-mib/data_access/ipaddress_common.c 2012-02-18 21:20:51.943118452 +0100 michael@588: @@ -452,6 +452,7 @@ michael@588: { michael@588: const netsnmp_ipaddress_entry *lh = (const netsnmp_ipaddress_entry *)lhs; michael@588: const netsnmp_ipaddress_entry *rh = (const netsnmp_ipaddress_entry *)rhs; michael@588: + int rc; michael@588: michael@588: netsnmp_assert(NULL != lhs); michael@588: netsnmp_assert(NULL != rhs); michael@588: @@ -467,7 +468,19 @@ michael@588: /* michael@588: * length equal, compare address michael@588: */ michael@588: - return memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len); michael@588: + rc = memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len); michael@588: + if (rc) michael@588: + return rc; michael@588: + michael@588: + /* michael@588: + * address same, compare ifIndex michael@588: + */ michael@588: + if (lh->if_index < rh->if_index) michael@588: + return -1; michael@588: + else if (lh->if_index > rh->if_index) michael@588: + return 1; michael@588: + michael@588: + return 0; michael@588: } michael@588: michael@588: #ifndef NETSNMP_FEATURE_REMOVE_IPADDRESS_COMMON_COPY_UTILITIES michael@588: Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h michael@588: --- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h.orig 2011-09-28 06:53:47.000000000 +0200 michael@588: +++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h 2012-02-18 21:20:51.939850024 +0100 michael@588: @@ -106,7 +106,9 @@ michael@588: * simplistic map of address length to type michael@588: */ michael@588: #define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4 4 michael@588: +#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4Z 5 michael@588: #define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6 16 michael@588: +#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6Z 17 michael@588: michael@588: michael@588: /************************************************************* michael@588: Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c michael@588: --- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c.orig 2012-02-18 21:02:55.315118127 +0100 michael@588: +++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c 2012-02-18 21:20:51.933373869 +0100 michael@588: @@ -262,9 +262,10 @@ michael@588: if ((NULL != rowreq_ctx) && michael@588: (MFD_SUCCESS == michael@588: ipAddressTable_indexes_set(rowreq_ctx, michael@588: - ipaddress_entry->ia_address_len, michael@588: + ipaddress_entry->ia_address_len + 1, michael@588: ipaddress_entry->ia_address, michael@588: - ipaddress_entry->ia_address_len))) { michael@588: + ipaddress_entry->ia_address_len, michael@588: + ipaddress_entry->if_index))) { michael@588: if (CONTAINER_INSERT(container, rowreq_ctx) < 0) { michael@588: DEBUGMSGTL (("ipAddressTable:access","container insert failed for new entry\n")); michael@588: ipAddressTable_release_rowreq_ctx(rowreq_ctx); michael@588: Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c michael@588: --- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c.orig 2011-09-28 06:53:47.000000000 +0200 michael@588: +++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c 2012-02-18 21:24:03.877503380 +0100 michael@588: @@ -355,10 +355,18 @@ michael@588: *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4; michael@588: break; michael@588: michael@588: + case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4Z: michael@588: + *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4Z; michael@588: + break; michael@588: + michael@588: case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6: michael@588: *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV6; michael@588: break; michael@588: michael@588: + case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6Z: michael@588: + *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV6Z; michael@588: + break; michael@588: + michael@588: default: michael@588: snmp_log(LOG_ERR, "couldn't map value %ld for ipAddressAddrType\n", michael@588: raw_ipAddressAddrType_val); michael@588: @@ -389,8 +397,10 @@ michael@588: ipAddressTable_indexes_set_tbl_idx(ipAddressTable_mib_index * tbl_idx, michael@588: long ipAddressAddrType_val, michael@588: u_char *ipAddressAddr_val_ptr, michael@588: - size_t ipAddressAddr_val_ptr_len) michael@588: + size_t ipAddressAddr_val_ptr_len, michael@588: + long ipAddressAddr_ifIndex) michael@588: { michael@588: + uint32_t zone = htonl(ipAddressAddr_ifIndex); michael@588: DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set_tbl_idx", "called\n")); michael@588: michael@588: /* michael@588: @@ -416,6 +426,11 @@ michael@588: memcpy(tbl_idx->ipAddressAddr, ipAddressAddr_val_ptr, michael@588: ipAddressAddr_val_ptr_len * sizeof(ipAddressAddr_val_ptr[0])); michael@588: michael@588: + /** zone */ michael@588: + tbl_idx->ipAddressAddr_len += sizeof(zone); michael@588: + memcpy(&tbl_idx->ipAddressAddr[ipAddressAddr_val_ptr_len * michael@588: + sizeof(ipAddressAddr_val_ptr[0])], michael@588: + &zone, sizeof(zone)); michael@588: michael@588: return MFD_SUCCESS; michael@588: } /* ipAddressTable_indexes_set_tbl_idx */ michael@588: @@ -437,7 +452,8 @@ michael@588: ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx * rowreq_ctx, michael@588: u_long ipAddressAddrType_val, michael@588: u_char *ipAddressAddr_val_ptr, michael@588: - size_t ipAddressAddr_val_ptr_len) michael@588: + size_t ipAddressAddr_val_ptr_len, michael@588: + long ipAddressAddr_ifIndex) michael@588: { michael@588: DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set", michael@588: "called\n")); michael@588: @@ -446,7 +462,8 @@ michael@588: ipAddressTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx, michael@588: ipAddressAddrType_val, michael@588: ipAddressAddr_val_ptr, michael@588: - ipAddressAddr_val_ptr_len)) michael@588: + ipAddressAddr_val_ptr_len, michael@588: + ipAddressAddr_ifIndex)) michael@588: return MFD_ERROR; michael@588: michael@588: /* michael@588: Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h michael@588: --- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h.orig 2011-09-28 06:53:47.000000000 +0200 michael@588: +++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h 2012-02-18 21:25:15.751422674 +0100 michael@588: @@ -273,14 +273,16 @@ michael@588: long ipAddressAddrType_val, michael@588: u_char *ipAddressAddr_val_ptr, michael@588: size_t michael@588: - ipAddressAddr_val_ptr_len); michael@588: + ipAddressAddr_val_ptr_len, michael@588: + long ipAddressAddr_ifIndex); michael@588: int ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx * michael@588: rowreq_ctx, michael@588: u_long michael@588: ipAddressAddrType_val, michael@588: u_char *ipAddressAddr_val_ptr, michael@588: size_t michael@588: - ipAddressAddr_val_ptr_len); michael@588: + ipAddressAddr_val_ptr_len, michael@588: + long ipAddressAddr_ifIndex); michael@588: michael@588: michael@588: