Index: /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB.txt
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB.txt	(revision 39868)
+++ /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB.txt	(working copy)
@@ -3696,8 +3696,10 @@
 	infBandWidth
 		Counter64,
 	infPktsPerSec
+		Counter64,
+	infSpeedBits
 		Counter64
-       }	
+       }
 
 
 infIndex OBJECT-TYPE
@@ -3712,7 +3714,7 @@
             network management system to the next re-
             initialization."
     ::= { infEntry 1 }
-     
+
 infDescr OBJECT-TYPE
     SYNTAX  DisplayString (SIZE (0..255))
     MAX-ACCESS  read-only
@@ -3911,7 +3913,7 @@
             higher (sub-)layer, which were addressed to a multicast 
             address at this sub-layer."
     ::= { infEntry 21 }
-		
+
 infOutMcastPkts OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
@@ -3922,7 +3924,7 @@
             multicast address at this sub-layer, including those that
             were discarded or not sent."
     ::= { infEntry 22 }
-	
+
 infInBcastPkts OBJECT-TYPE
     SYNTAX  Counter64
     MAX-ACCESS  read-only
@@ -3932,7 +3934,7 @@
             higher (sub-)layer, which were addressed to a broadcast 
             address at this sub-layer."
     ::= { infEntry 23 }
-		
+
 infOutBcastPkts OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
@@ -3943,7 +3945,7 @@
             broadcast address at this sub-layer, including those that
             were discarded or not sent."
     ::= { infEntry 24 }
-	
+
 infOutDiscards OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
@@ -3956,35 +3958,48 @@
             free up buffer space."
     ::= { infEntry 25 }
 
-infSpeed OBJECT-TYPE SYNTAX      
-	Gauge32
+infSpeed OBJECT-TYPE
+    SYNTAX      Gauge32
     MAX-ACCESS  read-only
     STATUS      current
-    DESCRIPTION 
+    DESCRIPTION
             "An estimate of the interface's current bandwidth in 
             1,000,000 bits per second. For interfaces which do not
             vary in bandwidth or for those where no accurate estimation
             can be made, this object should contain the nominal bandwidth.
             For a sub-layer which has no concept of bandwidth, this object
-            should be zero." 
+            should be zero."
     ::= { infEntry 26 }
 
-infBandWidth    OBJECT-TYPE 
+infBandWidth    OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
     STATUS      current
-    DESCRIPTION 
-            "Total throughput (bit/s) collected at an interval for the interface." 
+    DESCRIPTION
+            "Total throughput (bit/s) collected at an interval for the interface."
     ::= { infEntry 27 }
-    
-infPktsPerSec   OBJECT-TYPE 
+
+infPktsPerSec   OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
     STATUS      current
-    DESCRIPTION 
-            "Packets per seconds collected at an interval for the interface." 
+    DESCRIPTION
+            "Packets per seconds collected at an interval for the interface."
     ::= { infEntry 28 }
 
+infSpeedBits OBJECT-TYPE
+    SYNTAX      Counter64
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+            "An estimate of the interface's current bandwidth in
+            bits per second. For interfaces which do not vary in
+            bandwidth or for those where no accurate estimation can
+            be made, this object should contain the nominal bandwidth.
+            For a sub-layer which has no concept of bandwidth, this
+            object should be zero."
+    ::= { infEntry 29 }
+
 infTotalInOctetsBandwidth    OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
Index: /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB_cn.txt
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB_cn.txt	(revision 39868)
+++ /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB_cn.txt	(working copy)
@@ -3607,8 +3607,10 @@
 	infBandWidth
 		Counter64,
 	infPktsPerSec
+		Counter64,
+	infSpeedBits
 		Counter64
-       }	
+       }
 
 
 infIndex OBJECT-TYPE
@@ -3618,7 +3620,7 @@
     DESCRIPTION
             "每个接口的唯一值。它的取值范围在1到接口数的值之间。每个接口的值，至少要从该实体的网络管理系统的一次重新初始化到下一次重新初始化之间，始终保持不变。"
     ::= { infEntry 1 }
-     
+
 infDescr OBJECT-TYPE
     SYNTAX  DisplayString (SIZE (0..255))
     MAX-ACCESS  read-only
@@ -3782,7 +3784,7 @@
     DESCRIPTION
             "由该子层向更高（子）层传送的发往该子层的多播地址的报文数量。"
     ::= { infEntry 21 }
-		
+
 infOutMcastPkts OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
@@ -3790,7 +3792,7 @@
     DESCRIPTION
             "更高层协议要求传送的发往该子层多播地址的报文总数，包括丢弃的或没发出的报文。"
     ::= { infEntry 22 }
-	
+
 infInBcastPkts OBJECT-TYPE
     SYNTAX  Counter64
     MAX-ACCESS  read-only
@@ -3798,7 +3800,7 @@
     DESCRIPTION
             "由该子层向更高（子）层传送的发往该子层广播地址的报文数量。"
     ::= { infEntry 23 }
-		
+
 infOutBcastPkts OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
@@ -3806,7 +3808,7 @@
     DESCRIPTION
             "更高层协议要求传送的发往该子层广播地址的报文总数，包括丢弃的或没发出的报文。"
     ::= { infEntry 24 }
-	
+
 infOutDiscards OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
@@ -3815,30 +3817,38 @@
             "被选为要丢弃的、未向更高协议层传送的出向报文的数量，即使这些报文未检测到错误。丢弃这样的报文的一个可能原因是为了释放缓存空间。"
     ::= { infEntry 25 }
 
-infSpeed OBJECT-TYPE SYNTAX      
-	Gauge32
+infSpeed OBJECT-TYPE
+    SYNTAX      Gauge32
     MAX-ACCESS  read-only
     STATUS      current
-    DESCRIPTION 
-            "以1,000,000 bits/s为单位估算的接口当前带宽。对于带宽不变或者无法准确估算带宽的接口，该项应包含标称带宽。对于没有带宽概念的子层，该项OID值应为0。" 
+    DESCRIPTION
+            "以1,000,000 bits/s为单位估算的接口当前带宽。对于带宽不变或者无法准确估算带宽的接口，该项应包含标称带宽。对于没有带宽概念的子层，该项OID值应为0。"
     ::= { infEntry 26 }
 
-infBandWidth    OBJECT-TYPE 
+infBandWidth    OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
     STATUS      current
-    DESCRIPTION 
-            "按照一定间隔统计的接口吞吐率（bits/s）。" 
+    DESCRIPTION
+            "按照一定间隔统计的接口吞吐率（bits/s）。"
     ::= { infEntry 27 }
-    
-infPktsPerSec   OBJECT-TYPE 
+
+infPktsPerSec   OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
     STATUS      current
-    DESCRIPTION 
-            "按照一定间隔统计的接口每秒报文数（PPS）。" 
+    DESCRIPTION
+            "按照一定间隔统计的接口每秒报文数（PPS）。"
     ::= { infEntry 28 }
 
+infSpeedBits OBJECT-TYPE
+    SYNTAX      Counter64
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+            "以bits/s为单位估算的接口当前带宽。对于带宽不变或者无法准确估算带宽的接口，该项应包含标称带宽。对于没有带宽概念的子层，该项OID值应为0。"
+    ::= { infEntry 29 }
+
 infTotalInOctetsBandwidth    OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
Index: /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB_foreign.txt
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB_foreign.txt	(revision 39868)
+++ /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB_foreign.txt	(working copy)
@@ -3688,8 +3688,10 @@
 	infBandWidth
 		Counter64,
 	infPktsPerSec
+		Counter64,
+	infSpeedBits
 		Counter64
-       }	
+       }
 
 
 infIndex OBJECT-TYPE
@@ -3704,7 +3706,7 @@
             network management system to the next re-
             initialization."
     ::= { infEntry 1 }
-     
+
 infDescr OBJECT-TYPE
     SYNTAX  DisplayString (SIZE (0..255))
     MAX-ACCESS  read-only
@@ -3903,7 +3905,7 @@
             higher (sub-)layer, which were addressed to a multicast 
             address at this sub-layer."
     ::= { infEntry 21 }
-		
+
 infOutMcastPkts OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
@@ -3914,7 +3916,7 @@
             multicast address at this sub-layer, including those that
             were discarded or not sent."
     ::= { infEntry 22 }
-	
+
 infInBcastPkts OBJECT-TYPE
     SYNTAX  Counter64
     MAX-ACCESS  read-only
@@ -3924,7 +3926,7 @@
             higher (sub-)layer, which were addressed to a broadcast 
             address at this sub-layer."
     ::= { infEntry 23 }
-		
+
 infOutBcastPkts OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
@@ -3935,7 +3937,7 @@
             broadcast address at this sub-layer, including those that
             were discarded or not sent."
     ::= { infEntry 24 }
-	
+
 infOutDiscards OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
@@ -3948,35 +3950,48 @@
             free up buffer space."
     ::= { infEntry 25 }
 
-infSpeed OBJECT-TYPE SYNTAX      
-	Gauge32
+infSpeed OBJECT-TYPE
+    SYNTAX      Gauge32
     MAX-ACCESS  read-only
     STATUS      current
-    DESCRIPTION 
+    DESCRIPTION
             "An estimate of the interface's current bandwidth in 
             1,000,000 bits per second. For interfaces which do not
             vary in bandwidth or for those where no accurate estimation
             can be made, this object should contain the nominal bandwidth.
             For a sub-layer which has no concept of bandwidth, this object
-            should be zero." 
+            should be zero."
     ::= { infEntry 26 }
 
-infBandWidth    OBJECT-TYPE 
+infBandWidth    OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
     STATUS      current
-    DESCRIPTION 
-            "Total throughput (bit/s) collected at an interval for the interface." 
+    DESCRIPTION
+            "Total throughput (bit/s) collected at an interval for the interface."
     ::= { infEntry 27 }
-    
-infPktsPerSec   OBJECT-TYPE 
+
+infPktsPerSec   OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
     STATUS      current
-    DESCRIPTION 
-            "Packets per seconds collected at an interval for the interface." 
+    DESCRIPTION
+            "Packets per seconds collected at an interval for the interface."
     ::= { infEntry 28 }
 
+infSpeedBits OBJECT-TYPE
+    SYNTAX      Counter64
+    MAX-ACCESS  read-only
+    STATUS      current
+    DESCRIPTION
+            "An estimate of the interface's current bandwidth in
+            bits per second. For interfaces which do not vary in
+            bandwidth or for those where no accurate estimation can
+            be made, this object should contain the nominal bandwidth.
+            For a sub-layer which has no concept of bandwidth, this
+            object should be zero."
+    ::= { infEntry 29 }
+
 infTotalInOctetsBandwidth    OBJECT-TYPE
     SYNTAX      Counter64
     MAX-ACCESS  read-only
Index: /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/ifTraffic.c
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/ifTraffic.c	(revision 39868)
+++ /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/ifTraffic.c	(working copy)
@@ -148,6 +148,9 @@
 #define INFPKTSPERSEC	28
  {INFPKTSPERSEC, ASN_COUNTER64,	NETSNMP_OLDAPI_RONLY,
  var_infTable, 3,  { 4 , 1, 28 }},
+ #define INFSPEEDBITS	29
+{INFSPEEDBITS,  ASN_COUNTER64,  NETSNMP_OLDAPI_RONLY,
+ var_infTable, 3,  { 4 , 1, 29 }},
 
 
 #define INFTOTALINOCTETSBANDWIDTH		5
@@ -501,6 +504,7 @@
     static struct counter64 c64;
     static struct in_addr in_address;
     static struct in6_addr in6_address;
+    static uint64_t bits_per_sec;
     uint32_t count, idx, buflen;
     u_long uint64_v;
     uint64_t * uint64_p;
@@ -669,6 +673,18 @@
 		ulong_ret = 0;
 	}
 	return (u_char*)&ulong_ret;
+	case INFSPEEDBITS:
+	/* get_if_speed returns value in Mb */
+	speed = get_if_speed(nic_ca[idx].nic_ether_p->nic_hw_p->hw_id);
+	if (speed > 0) {
+		/* convert to bits/sec: the constants above define Mb as 1, so speed is in millions of bits */
+		bits_per_sec = (uint64_t) speed * 1000000UL;
+	} else {
+		/* speed not available: return 0 */
+		bits_per_sec = 0;
+	}
+	to_counter64(&c64, bits_per_sec);
+	return (u_char *)&c64;
 	case INFBANDWIDTH:
 	to_counter64(&c64, ((ifn_p->if_stats.bandwidth_in_bytes + ifn_p->if_stats.bandwidth_out_bytes)/bandwidth_timer << 3));
 	return (u_char*)&c64;
