Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

Mine
Tuesday, October 2nd, 2007 at 3:38:08pm UTC 

  1. Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
  2. ===================================================================
  3. --- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c   (revision 16711)
  4. +++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c   (working copy)
  5. @@ -258,9 +258,10 @@
  6.      if ((NULL != rowreq_ctx) &&
  7.          (MFD_SUCCESS ==
  8.           ipAddressTable_indexes_set(rowreq_ctx,
  9. +                                    ipaddress_entry->ia_address_len + 1,
  10. +                                    ipaddress_entry->ia_address,
  11.                                      ipaddress_entry->ia_address_len,
  12. -                                    ipaddress_entry->ia_address,
  13. -                                    ipaddress_entry->ia_address_len))) {
  14. +                                    ipaddress_entry->if_index))) {
  15.          if (CONTAINER_INSERT(container, rowreq_ctx) < 0) {
  16.              DEBUGMSGTL (("ipAddressTable:access","container insert failed for new entry\n"));
  17.              ipAddressTable_release_rowreq_ctx(rowreq_ctx);
  18. Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
  19. ===================================================================
  20. --- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c       (revision 16711)
  21. +++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c       (working copy)
  22. @@ -348,10 +348,18 @@
  23.          *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4;
  24.          break;
  25.  
  26. +    case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4Z:
  27. +        *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4Z;
  28. +        break;
  29. +
  30.      case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6:
  31.          *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV6;
  32.          break;
  33.  
  34. +    case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6Z:
  35. +        *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV6Z;
  36. +        break;
  37. +
  38.      default:
  39.          snmp_log(LOG_ERR, "couldn't map value %ld for ipAddressAddrType\n",
  40.                   raw_ipAddressAddrType_val);
  41. @@ -382,8 +390,11 @@
  42.  ipAddressTable_indexes_set_tbl_idx(ipAddressTable_mib_index * tbl_idx,
  43.                                     u_long ipAddressAddrType_val,
  44.                                     char *ipAddressAddr_val_ptr,
  45. -                                   size_t ipAddressAddr_val_ptr_len)
  46. +                                   size_t ipAddressAddr_val_ptr_len,
  47. +                                   u_long ipAddressAddr_ifIndex)
  48.  {
  49. +    uint32_t zone = htonl(ipAddressAddr_ifIndex);
  50. +
  51.      DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set_tbl_idx", "called\n"));
  52.  
  53.      /*
  54. @@ -409,6 +420,11 @@
  55.      memcpy(tbl_idx->ipAddressAddr, ipAddressAddr_val_ptr,
  56.             ipAddressAddr_val_ptr_len * sizeof(ipAddressAddr_val_ptr[0]));
  57.  
  58. +    /** zone */
  59. +    tbl_idx->ipAddressAddr_len += sizeof(zone);
  60. +    memcpy(&tbl_idx->ipAddressAddr[ipAddressAddr_val_ptr_len *
  61. +                                   sizeof(ipAddressAddr_val_ptr[0])],
  62. +           &zone, sizeof(zone));
  63.  
  64.      return MFD_SUCCESS;
  65.  }                               /* ipAddressTable_indexes_set_tbl_idx */
  66. @@ -430,7 +446,8 @@
  67.  ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
  68.                             u_long ipAddressAddrType_val,
  69.                             char *ipAddressAddr_val_ptr,
  70. -                           size_t ipAddressAddr_val_ptr_len)
  71. +                           size_t ipAddressAddr_val_ptr_len,
  72. +                           u_long ipAddressAddr_ifIndex)
  73.  {
  74.      DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set",
  75.                  "called\n"));
  76. @@ -439,7 +456,8 @@
  77.          ipAddressTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
  78.                                             ipAddressAddrType_val,
  79.                                             ipAddressAddr_val_ptr,
  80. -                                           ipAddressAddr_val_ptr_len))
  81. +                                           ipAddressAddr_val_ptr_len,
  82. +                                           ipAddressAddr_ifIndex))
  83.          return MFD_ERROR;
  84.  
  85.      /*
  86. Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
  87. ===================================================================
  88. --- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h     (revision 16711)
  89. +++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h     (working copy)
  90. @@ -106,7 +106,9 @@
  91.       * simplistic map of address length to type
  92.       */
  93.  #define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4  4
  94. +#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4Z 5
  95.  #define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6  16
  96. +#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6Z 17
  97.  
  98.  
  99.  /*************************************************************
  100. Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
  101. ===================================================================
  102. --- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h       (revision 16711)
  103. +++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h       (working copy)
  104. @@ -273,14 +273,16 @@
  105.                                             u_long ipAddressAddrType_val,
  106.                                             char *ipAddressAddr_val_ptr,
  107.                                             size_t
  108. -                                           ipAddressAddr_val_ptr_len);
  109. +                                           ipAddressAddr_val_ptr_len,
  110. +                                           u_long ipAddressAddr_ifIndex);
  111.      int             ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx *
  112.                                                 rowreq_ctx,
  113.                                                 u_long
  114.                                                 ipAddressAddrType_val,
  115.                                                 char *ipAddressAddr_val_ptr,
  116.                                                 size_t
  117. -                                               ipAddressAddr_val_ptr_len);
  118. +                                               ipAddressAddr_val_ptr_len,
  119. +                                               u_long ipAddressAddr_ifIndex);
  120.  
  121.  
  122.  
  123. Index: agent/mibgroup/ip-mib/data_access/ipaddress_common.c
  124. ===================================================================
  125. --- agent/mibgroup/ip-mib/data_access/ipaddress_common.c        (revision 16711)
  126. +++ agent/mibgroup/ip-mib/data_access/ipaddress_common.c        (working copy)
  127. @@ -411,6 +415,7 @@
  128.  {
  129.      const netsnmp_ipaddress_entry *lh = (const netsnmp_ipaddress_entry *)lhs;
  130.      const netsnmp_ipaddress_entry *rh = (const netsnmp_ipaddress_entry *)rhs;
  131. +    int   rc;
  132.  
  133.      netsnmp_assert(NULL != lhs);
  134.      netsnmp_assert(NULL != rhs);
  135. @@ -426,5 +431,17 @@
  136.      /*
  137.       * length equal, compare address
  138.       */
  139. -    return memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
  140. +    rc = memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
  141. +    if (rc)
  142. +        return rc;
  143. +
  144. +    /*
  145. +     * address same, compare ifIndex
  146. +     */
  147. +    if (lh->if_index < rh->if_index)
  148. +        return -1;
  149. +    else if (lh->if_index > rh->if_index)
  150. +        return 1;
  151. +
  152. +    return 0;
  153.  }

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right
worth-right