]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2811: pt 1: Correct Peer table OID numbering
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 20 Dec 2009 10:18:22 +0000 (23:18 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 20 Dec 2009 10:18:22 +0000 (23:18 +1300)
The IPv6 alterations to the cache_peer table display should not have
altered existing OID numbers. This fixes that by bumping the new table
format to a new OID number .1.3.6.1.4.1.3495.1.5.1.3 for version 3 of the
table.

NP: version 1 of the table was in 2.0->2.5, and 3.0
    version 2 of the table was in 2.6+

include/cache_snmp.h
src/mib.txt
src/snmp_core.cc

index 058164549c39ffb4d9914fdc1760982337aa2e86..2617757125897d0a93d6ec6c5b3e9a8c648d66df 100644 (file)
@@ -236,7 +236,7 @@ enum {
     MESH_END
 };
 
-/* cachePeerTable CachePeerEntry */
+/* CachePeerTableEntry (version 3) */
 enum {
     MESH_PTBL_START     = 0,
     MESH_PTBL_INDEX     = 1,  /* cachePeerIndex  */
index 81b5ebd3d120c9413dff7561c4e27d8dfe7823a2..dba27db7c13db24f44d964c6f22ba0b6f62d596c 100644 (file)
@@ -724,15 +724,15 @@ squid MODULE-IDENTITY
         ::= { cacheMesh 1 }
 
        cachePeerEntry OBJECT-TYPE
-               SYNTAX CachePeerEntry
+               SYNTAX CachePeerTableEntry
                MAX-ACCESS not-accessible
                STATUS current
                DESCRIPTION
-                       " An entry in cachePeerTable "
+                       " An entry in cachePeerTable (version 3) "
                INDEX   { cachePeerIndex }
-       ::= { cachePeerTable 1 }
+       ::= { cachePeerTable 3 }
 
-       CachePeerEntry ::= SEQUENCE {
+       CachePeerTableEntry ::= SEQUENCE {
          cachePeerIndex        CachePeerTableIndex, 
          cachePeerName         DisplayString,
          cachePeerAddressType  InetAddressType,
index 3f140057a1c16039da089922dcfe86a9b2ea12a9..6b825b618c7cbe52739e733c8ca94d204f6c7378 100644 (file)
@@ -235,27 +235,30 @@ snmpInit(void)
     /* cachePeerTable - 1.3.6.1.4.1.3495.1.5.1 */
     snmpAddNodeStr("1.3.6.1.4.1.3495.1.5", MESH_PTBL, NULL, NULL);
 
-    /* CachePeerEntry - 1.3.6.1.4.1.3495.1.5.1.1 */
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1", 1, NULL, NULL);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_INDEX, snmp_meshPtblFn, peer_Inst);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_NAME, snmp_meshPtblFn, peer_Inst);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_ADDR_TYPE, snmp_meshPtblFn, peer_Inst);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_ADDR, snmp_meshPtblFn, peer_Inst);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_HTTP, snmp_meshPtblFn, peer_Inst);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_ICP, snmp_meshPtblFn, peer_Inst);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_TYPE, snmp_meshPtblFn, peer_Inst);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_STATE, snmp_meshPtblFn, peer_Inst);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_SENT, snmp_meshPtblFn, peer_Inst);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_PACKED, snmp_meshPtblFn, peer_Inst);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_FETCHES, snmp_meshPtblFn, peer_Inst);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_RTT, snmp_meshPtblFn, peer_Inst);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_IGN, snmp_meshPtblFn, peer_Inst);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_KEEPAL_S, snmp_meshPtblFn, peer_Inst);
-    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.1", MESH_PTBL_KEEPAL_R, snmp_meshPtblFn, peer_Inst);
-
+    /* CachePeerTableEntry (version 3) - 1.3.6.1.4.1.3495.1.5.1.3 */
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1", 3, NULL, NULL);
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_INDEX, snmp_meshPtblFn, peer_Inst);
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_NAME, snmp_meshPtblFn, peer_Inst);
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_ADDR_TYPE, snmp_meshPtblFn, peer_Inst);
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_ADDR, snmp_meshPtblFn, peer_Inst);
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_HTTP, snmp_meshPtblFn, peer_Inst);
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_ICP, snmp_meshPtblFn, peer_Inst);
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_TYPE, snmp_meshPtblFn, peer_Inst);
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_STATE, snmp_meshPtblFn, peer_Inst);
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_SENT, snmp_meshPtblFn, peer_Inst);
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_PACKED, snmp_meshPtblFn, peer_Inst);
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_FETCHES, snmp_meshPtblFn, peer_Inst);
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_RTT, snmp_meshPtblFn, peer_Inst);
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_IGN, snmp_meshPtblFn, peer_Inst);
+    snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_KEEPAL_S, snmp_meshPtblFn, peer_Inst);
+    mib_tree_last = snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.1.3", MESH_PTBL_KEEPAL_R, snmp_meshPtblFn, peer_Inst);
+
+#if 0
     /* cacheClientTable - 1.3.6.1.4.1.3495.1.5.2 */
     snmpAddNodeStr("1.3.6.1.4.1.3495.1.5", MESH_CTBL, NULL, NULL);
 
+    /* BUG 2811: we NEED to create a reliable index for the clientDb and morph this to version 3 of the table. */
+
     /* cacheClientEntry - 1.3.6.1.4.1.3495.1.5.2.1 */
     snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.2", 1, NULL, NULL);
     snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.2.1", MESH_CTBL_ADDR_TYPE, snmp_meshCtblFn, client_Inst);
@@ -268,6 +271,7 @@ snmpInit(void)
     snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.2.1", MESH_CTBL_ICPBYTES, snmp_meshCtblFn, client_Inst);
     snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.2.1", MESH_CTBL_ICPHITS, snmp_meshCtblFn, client_Inst);
     mib_tree_last = snmpAddNodeStr("1.3.6.1.4.1.3495.1.5.2.1", MESH_CTBL_ICPHITBYTES, snmp_meshCtblFn, client_Inst);
+#endif
 
     debugs(49, 9, "snmpInit: Completed SNMP mib tree structure");
 }
@@ -883,7 +887,7 @@ snmpTreeEntry(oid entry, snint len, mib_tree_entry * current)
     mib_tree_entry *next = NULL;
     int count = 0;
 
-    while ((!next) && (count < current->children)) {
+    while ((!next) && current && (count < current->children)) {
         if (current->leaves[count]->name[len] == entry) {
             next = current->leaves[count];
         }