Ubuntu安装net-snmp

环境:

Ubuntu:

Linux Linux-host 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed Aug 14 16:19:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

 

net-snmp:

5.7.3

 

perl:

This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux

 

1,下载源码

http://www.net-snmp.org/download.html

2,解压,修改

在不修改的情况下直接配置配置编译会报错误,具体错误意思是定义的一个结构体U64与编译时依赖的Perl有冲突,所以导致失败,因此需要修改改结构体名字,此处将编译所涉及的文件中的所有U64改为struct counter64,主要修改一下文件:

changed    agent/mibgroup/if-mib/ifXTable/ifXTable.c
changed    agent/mibgroup/if-mib/ifXTable/ifXTable.h
changed    agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c
changed    agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c
changed    agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
changed    agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c
changed    configure
changed    configure.in
changed    include/net-snmp/data_access/ipstats.h
changed    include/net-snmp/library/int64.h
changed    snmplib/asn1.c
changed    snmplib/int64.c
changed    snmplib/read_config.c

其他还有一些其他文件需要修改,编译报错的时候,根据报错信息修改就行,此处参考:https://sourceforge.net/p/net-snmp/code/ci/31613e8b1eb7515ddc7cb89d72755a671c9c41f5/#diff-8

修改完之后编译还会报错,找不到库,比如:

libnetsnmptrapd*
libnetsnmpagent*
libnetsnmpmibs* 

这些库找不到只有先编译不使用perl模块的版本,然后再将这些库拷贝到/lib使其编译通过再说。

 

 

参考修改的部分如果连接失效,那就看这里吧:

agent/mibgroup/if-mib/ifXTable/ifXTable.cDiffSwitch to side-by-side view

--- a/agent/mibgroup/if-mib/ifXTable/ifXTable.c
+++ b/agent/mibgroup/if-mib/ifXTable/ifXTable.c
@@ -701,7 +701,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ifHCInOctets data.
@@ -711,7 +711,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ifHCInOctets_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -719,7 +719,7 @@
  */
 int
 ifHCInOctets_get(ifXTable_rowreq_ctx * rowreq_ctx,
-                 U64 * ifHCInOctets_val_ptr)
+                 struct counter64 *ifHCInOctets_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ifHCInOctets_val_ptr);
@@ -758,7 +758,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64
  */
 /**
  * Extract the current value of the ifHCInUcastPkts data.
@@ -768,7 +768,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ifHCInUcastPkts_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -776,7 +776,7 @@
  */
 int
 ifHCInUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
-                    U64 * ifHCInUcastPkts_val_ptr)
+                    struct counter64 *ifHCInUcastPkts_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ifHCInUcastPkts_val_ptr);
@@ -817,7 +817,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64
  */
 /**
  * Extract the current value of the ifHCInMulticastPkts data.
@@ -827,7 +827,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ifHCInMulticastPkts_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -835,7 +835,7 @@
  */
 int
 ifHCInMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
-                        U64 * ifHCInMulticastPkts_val_ptr)
+                        struct counter64 *ifHCInMulticastPkts_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ifHCInMulticastPkts_val_ptr);
@@ -876,7 +876,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ifHCInBroadcastPkts data.
@@ -886,7 +886,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ifHCInBroadcastPkts_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -894,7 +894,7 @@
  */
 int
 ifHCInBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
-                        U64 * ifHCInBroadcastPkts_val_ptr)
+                        struct counter64 *ifHCInBroadcastPkts_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ifHCInBroadcastPkts_val_ptr);
@@ -934,7 +934,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ifHCOutOctets data.
@@ -944,7 +944,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ifHCOutOctets_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -952,7 +952,7 @@
  */
 int
 ifHCOutOctets_get(ifXTable_rowreq_ctx * rowreq_ctx,
-                  U64 * ifHCOutOctets_val_ptr)
+                  struct counter64 *ifHCOutOctets_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ifHCOutOctets_val_ptr);
@@ -992,7 +992,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ifHCOutUcastPkts data.
@@ -1002,7 +1002,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ifHCOutUcastPkts_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -1010,7 +1010,7 @@
  */
 int
 ifHCOutUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
-                     U64 * ifHCOutUcastPkts_val_ptr)
+                     struct counter64 *ifHCOutUcastPkts_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ifHCOutUcastPkts_val_ptr);
@@ -1053,7 +1053,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ifHCOutMulticastPkts data.
@@ -1063,7 +1063,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ifHCOutMulticastPkts_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -1071,7 +1071,7 @@
  */
 int
 ifHCOutMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
-                         U64 * ifHCOutMulticastPkts_val_ptr)
+                         struct counter64 *ifHCOutMulticastPkts_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ifHCOutMulticastPkts_val_ptr);
@@ -1113,7 +1113,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ifHCOutBroadcastPkts data.
@@ -1123,7 +1123,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ifHCOutBroadcastPkts_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -1131,7 +1131,7 @@
  */
 int
 ifHCOutBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
-                         U64 * ifHCOutBroadcastPkts_val_ptr)
+                         struct counter64 *ifHCOutBroadcastPkts_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ifHCOutBroadcastPkts_val_ptr);

agent/mibgroup/if-mib/ifXTable/ifXTable.hDiffSwitch to side-by-side view

--- a/agent/mibgroup/if-mib/ifXTable/ifXTable.h
+++ b/agent/mibgroup/if-mib/ifXTable/ifXTable.h
@@ -143,28 +143,28 @@
                                            u_long *
                                            ifOutBroadcastPkts_val_ptr);
     int             ifHCInOctets_get(ifXTable_rowreq_ctx * rowreq_ctx,
-                                     U64 * ifHCInOctets_val_ptr);
+                                     struct counter64 *ifHCInOctets_val_ptr);
     int             ifHCInUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
-                                        U64 * ifHCInUcastPkts_val_ptr);
+                                        struct counter64 *ifHCInUcastPkts_val_ptr);
     int             ifHCInMulticastPkts_get(ifXTable_rowreq_ctx *
                                             rowreq_ctx,
-                                            U64 *
+                                            struct counter64 *
                                             ifHCInMulticastPkts_val_ptr);
     int             ifHCInBroadcastPkts_get(ifXTable_rowreq_ctx *
                                             rowreq_ctx,
-                                            U64 *
+                                            struct counter64 *
                                             ifHCInBroadcastPkts_val_ptr);
     int             ifHCOutOctets_get(ifXTable_rowreq_ctx * rowreq_ctx,
-                                      U64 * ifHCOutOctets_val_ptr);
+                                      struct counter64 *ifHCOutOctets_val_ptr);
     int             ifHCOutUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
-                                         U64 * ifHCOutUcastPkts_val_ptr);
+                                         struct counter64 *ifHCOutUcastPkts_val_ptr);
     int             ifHCOutMulticastPkts_get(ifXTable_rowreq_ctx *
                                              rowreq_ctx,
-                                             U64 *
+                                             struct counter64 *
                                              ifHCOutMulticastPkts_val_ptr);
     int             ifHCOutBroadcastPkts_get(ifXTable_rowreq_ctx *
                                              rowreq_ctx,
-                                             U64 *
+                                             struct counter64 *
                                              ifHCOutBroadcastPkts_val_ptr);
     int             ifLinkUpDownTrapEnable_get(ifXTable_rowreq_ctx *
                                                rowreq_ctx,
@@ -284,86 +284,86 @@
 
     int             ifHCInOctets_check_value(ifXTable_rowreq_ctx *
                                              rowreq_ctx,
-                                             U64 ifHCInOctets_val);
+                                             struct counter64 ifHCInOctets_val);
     int             ifHCInOctets_undo_setup(ifXTable_rowreq_ctx *
                                             rowreq_ctx);
     int             ifHCInOctets_set(ifXTable_rowreq_ctx * rowreq_ctx,
-                                     U64 ifHCInOctets_val);
+                                     struct counter64 ifHCInOctets_val);
     int             ifHCInOctets_undo(ifXTable_rowreq_ctx * rowreq_ctx);
 
     int             ifHCInUcastPkts_check_value(ifXTable_rowreq_ctx *
                                                 rowreq_ctx,
-                                                U64 ifHCInUcastPkts_val);
+                                                struct counter64 ifHCInUcastPkts_val);
     int             ifHCInUcastPkts_undo_setup(ifXTable_rowreq_ctx *
                                                rowreq_ctx);
     int             ifHCInUcastPkts_set(ifXTable_rowreq_ctx * rowreq_ctx,
-                                        U64 ifHCInUcastPkts_val);
+                                        struct counter64 ifHCInUcastPkts_val);
     int             ifHCInUcastPkts_undo(ifXTable_rowreq_ctx * rowreq_ctx);
 
     int             ifHCInMulticastPkts_check_value(ifXTable_rowreq_ctx *
                                                     rowreq_ctx,
-                                                    U64
+                                                    struct counter64
                                                     ifHCInMulticastPkts_val);
     int             ifHCInMulticastPkts_undo_setup(ifXTable_rowreq_ctx *
                                                    rowreq_ctx);
     int             ifHCInMulticastPkts_set(ifXTable_rowreq_ctx *
                                             rowreq_ctx,
-                                            U64 ifHCInMulticastPkts_val);
+                                            struct counter64 ifHCInMulticastPkts_val);
     int             ifHCInMulticastPkts_undo(ifXTable_rowreq_ctx *
                                              rowreq_ctx);
 
     int             ifHCInBroadcastPkts_check_value(ifXTable_rowreq_ctx *
                                                     rowreq_ctx,
-                                                    U64
+                                                    struct counter64
                                                     ifHCInBroadcastPkts_val);
     int             ifHCInBroadcastPkts_undo_setup(ifXTable_rowreq_ctx *
                                                    rowreq_ctx);
     int             ifHCInBroadcastPkts_set(ifXTable_rowreq_ctx *
                                             rowreq_ctx,
-                                            U64 ifHCInBroadcastPkts_val);
+                                            struct counter64 ifHCInBroadcastPkts_val);
     int             ifHCInBroadcastPkts_undo(ifXTable_rowreq_ctx *
                                              rowreq_ctx);
 
     int             ifHCOutOctets_check_value(ifXTable_rowreq_ctx *
                                               rowreq_ctx,
-                                              U64 ifHCOutOctets_val);
+                                              struct counter64 ifHCOutOctets_val);
     int             ifHCOutOctets_undo_setup(ifXTable_rowreq_ctx *
                                              rowreq_ctx);
     int             ifHCOutOctets_set(ifXTable_rowreq_ctx * rowreq_ctx,
-                                      U64 ifHCOutOctets_val);
+                                      struct counter64 ifHCOutOctets_val);
     int             ifHCOutOctets_undo(ifXTable_rowreq_ctx * rowreq_ctx);
 
     int             ifHCOutUcastPkts_check_value(ifXTable_rowreq_ctx *
                                                  rowreq_ctx,
-                                                 U64 ifHCOutUcastPkts_val);
+                                                 struct counter64 ifHCOutUcastPkts_val);
     int             ifHCOutUcastPkts_undo_setup(ifXTable_rowreq_ctx *
                                                 rowreq_ctx);
     int             ifHCOutUcastPkts_set(ifXTable_rowreq_ctx * rowreq_ctx,
-                                         U64 ifHCOutUcastPkts_val);
+                                         struct counter64 ifHCOutUcastPkts_val);
     int             ifHCOutUcastPkts_undo(ifXTable_rowreq_ctx *
                                           rowreq_ctx);
 
     int             ifHCOutMulticastPkts_check_value(ifXTable_rowreq_ctx *
                                                      rowreq_ctx,
-                                                     U64
+                                                     struct counter64
                                                      ifHCOutMulticastPkts_val);
     int             ifHCOutMulticastPkts_undo_setup(ifXTable_rowreq_ctx *
                                                     rowreq_ctx);
     int             ifHCOutMulticastPkts_set(ifXTable_rowreq_ctx *
                                              rowreq_ctx,
-                                             U64 ifHCOutMulticastPkts_val);
+                                             struct counter64 ifHCOutMulticastPkts_val);
     int             ifHCOutMulticastPkts_undo(ifXTable_rowreq_ctx *
                                               rowreq_ctx);
 
     int             ifHCOutBroadcastPkts_check_value(ifXTable_rowreq_ctx *
                                                      rowreq_ctx,
-                                                     U64
+                                                     struct counter64
                                                      ifHCOutBroadcastPkts_val);
     int             ifHCOutBroadcastPkts_undo_setup(ifXTable_rowreq_ctx *
                                                     rowreq_ctx);
     int             ifHCOutBroadcastPkts_set(ifXTable_rowreq_ctx *
                                              rowreq_ctx,
-                                             U64 ifHCOutBroadcastPkts_val);
+                                             struct counter64 ifHCOutBroadcastPkts_val);
     int             ifHCOutBroadcastPkts_undo(ifXTable_rowreq_ctx *
                                               rowreq_ctx);
 

agent/mibgroup/if-mib/ifXTable/ifXTable_interface.cDiffSwitch to side-by-side view

--- a/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c
+++ b/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c
@@ -705,72 +705,72 @@
          * ifHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IFHCINOCTETS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
-        rc = ifHCInOctets_get(rowreq_ctx, (U64 *) var->val.string);
+        rc = ifHCInOctets_get(rowreq_ctx, (struct counter64 *) var->val.string);
         break;
 
         /*
          * ifHCInUcastPkts(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IFHCINUCASTPKTS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
-        rc = ifHCInUcastPkts_get(rowreq_ctx, (U64 *) var->val.string);
+        rc = ifHCInUcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string);
         break;
 
         /*
          * ifHCInMulticastPkts(8)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IFHCINMULTICASTPKTS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
-        rc = ifHCInMulticastPkts_get(rowreq_ctx, (U64 *) var->val.string);
+        rc = ifHCInMulticastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string);
         break;
 
         /*
          * ifHCInBroadcastPkts(9)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IFHCINBROADCASTPKTS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
-        rc = ifHCInBroadcastPkts_get(rowreq_ctx, (U64 *) var->val.string);
+        rc = ifHCInBroadcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string);
         break;
 
         /*
          * ifHCOutOctets(10)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IFHCOUTOCTETS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
-        rc = ifHCOutOctets_get(rowreq_ctx, (U64 *) var->val.string);
+        rc = ifHCOutOctets_get(rowreq_ctx, (struct counter64 *) var->val.string);
         break;
 
         /*
          * ifHCOutUcastPkts(11)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IFHCOUTUCASTPKTS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
-        rc = ifHCOutUcastPkts_get(rowreq_ctx, (U64 *) var->val.string);
+        rc = ifHCOutUcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string);
         break;
 
         /*
          * ifHCOutMulticastPkts(12)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IFHCOUTMULTICASTPKTS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
-        rc = ifHCOutMulticastPkts_get(rowreq_ctx, (U64 *) var->val.string);
+        rc = ifHCOutMulticastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string);
         break;
 
         /*
          * ifHCOutBroadcastPkts(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IFHCOUTBROADCASTPKTS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
-        rc = ifHCOutBroadcastPkts_get(rowreq_ctx, (U64 *) var->val.string);
+        rc = ifHCOutBroadcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string);
         break;
 
         /*

agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.cDiffSwitch to side-by-side view

--- a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c
+++ b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c
@@ -429,7 +429,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ipSystemStatsHCInReceives data.
@@ -439,7 +439,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ipSystemStatsHCInReceives_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -447,7 +447,7 @@
  */
 int
 ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
-                              U64 * ipSystemStatsHCInReceives_val_ptr)
+                              struct counter64 *ipSystemStatsHCInReceives_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ipSystemStatsHCInReceives_val_ptr);
@@ -550,7 +550,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ipSystemStatsHCInOctets data.
@@ -560,7 +560,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ipSystemStatsHCInOctets_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -568,7 +568,7 @@
  */
 int
 ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
-                            U64 * ipSystemStatsHCInOctets_val_ptr)
+                            struct counter64 *ipSystemStatsHCInOctets_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ipSystemStatsHCInOctets_val_ptr);
@@ -1007,7 +1007,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ipSystemStatsHCInForwDatagrams data.
@@ -1017,7 +1017,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ipSystemStatsHCInForwDatagrams_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -1026,7 +1026,7 @@
 int
 ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
                                    rowreq_ctx,
-                                   U64 *
+                                   struct counter64 *
                                    ipSystemStatsHCInForwDatagrams_val_ptr)
 {
    /** we should have a non-NULL pointer */
@@ -1406,7 +1406,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ipSystemStatsHCInDelivers data.
@@ -1416,7 +1416,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ipSystemStatsHCInDelivers_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -1424,7 +1424,7 @@
  */
 int
 ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
-                              U64 * ipSystemStatsHCInDelivers_val_ptr)
+                              struct counter64 *ipSystemStatsHCInDelivers_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ipSystemStatsHCInDelivers_val_ptr);
@@ -1528,7 +1528,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ipSystemStatsHCOutRequests data.
@@ -1538,7 +1538,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ipSystemStatsHCOutRequests_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -1546,7 +1546,7 @@
  */
 int
 ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
-                               U64 * ipSystemStatsHCOutRequests_val_ptr)
+                               struct counter64 *ipSystemStatsHCOutRequests_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ipSystemStatsHCOutRequests_val_ptr);
@@ -1725,7 +1725,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ipSystemStatsHCOutForwDatagrams data.
@@ -1735,7 +1735,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ipSystemStatsHCOutForwDatagrams_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -1744,7 +1744,7 @@
 int
 ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
                                     rowreq_ctx,
-                                    U64 *
+                                    struct counter64 *
                                     ipSystemStatsHCOutForwDatagrams_val_ptr)
 {
    /** we should have a non-NULL pointer */
@@ -2185,7 +2185,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ipSystemStatsHCOutTransmits data.
@@ -2195,7 +2195,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ipSystemStatsHCOutTransmits_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -2203,7 +2203,7 @@
  */
 int
 ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
-                                U64 * ipSystemStatsHCOutTransmits_val_ptr)
+                                struct counter64 *ipSystemStatsHCOutTransmits_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ipSystemStatsHCOutTransmits_val_ptr);
@@ -2306,7 +2306,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ipSystemStatsHCOutOctets data.
@@ -2316,7 +2316,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ipSystemStatsHCOutOctets_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -2324,7 +2324,7 @@
  */
 int
 ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
-                             U64 * ipSystemStatsHCOutOctets_val_ptr)
+                             struct counter64 *ipSystemStatsHCOutOctets_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ipSystemStatsHCOutOctets_val_ptr);
@@ -2424,7 +2424,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ipSystemStatsHCInMcastPkts data.
@@ -2434,7 +2434,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ipSystemStatsHCInMcastPkts_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -2442,7 +2442,7 @@
  */
 int
 ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
-                               U64 * ipSystemStatsHCInMcastPkts_val_ptr)
+                               struct counter64 *ipSystemStatsHCInMcastPkts_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ipSystemStatsHCInMcastPkts_val_ptr);
@@ -2543,7 +2543,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ipSystemStatsHCInMcastOctets data.
@@ -2553,7 +2553,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ipSystemStatsHCInMcastOctets_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -2562,7 +2562,7 @@
 int
 ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
                                  rowreq_ctx,
-                                 U64 *
+                                 struct counter64 *
                                  ipSystemStatsHCInMcastOctets_val_ptr)
 {
    /** we should have a non-NULL pointer */
@@ -2663,7 +2663,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ipSystemStatsHCOutMcastPkts data.
@@ -2673,7 +2673,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ipSystemStatsHCOutMcastPkts_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -2681,7 +2681,7 @@
  */
 int
 ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
-                                U64 * ipSystemStatsHCOutMcastPkts_val_ptr)
+                                struct counter64 *ipSystemStatsHCOutMcastPkts_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ipSystemStatsHCOutMcastPkts_val_ptr);
@@ -2787,7 +2787,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ipSystemStatsHCOutMcastOctets data.
@@ -2797,7 +2797,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ipSystemStatsHCOutMcastOctets_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -2806,7 +2806,7 @@
 int
 ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
                                   rowreq_ctx,
-                                  U64 *
+                                  struct counter64 *
                                   ipSystemStatsHCOutMcastOctets_val_ptr)
 {
    /** we should have a non-NULL pointer */
@@ -2907,7 +2907,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ipSystemStatsHCInBcastPkts data.
@@ -2917,7 +2917,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ipSystemStatsHCInBcastPkts_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -2925,7 +2925,7 @@
  */
 int
 ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
-                               U64 * ipSystemStatsHCInBcastPkts_val_ptr)
+                               struct counter64 *ipSystemStatsHCInBcastPkts_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ipSystemStatsHCInBcastPkts_val_ptr);
@@ -3025,7 +3025,7 @@
  *
  *
  * Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type is struct counter64.
  */
 /**
  * Extract the current value of the ipSystemStatsHCOutBcastPkts data.
@@ -3035,7 +3035,7 @@
  * @param rowreq_ctx
  *        Pointer to the row request context.
  * @param ipSystemStatsHCOutBcastPkts_val_ptr
- *        Pointer to storage for a U64 variable
+ *        Pointer to storage for a struct counter64 variable
  *
  * @retval MFD_SUCCESS         : success
  * @retval MFD_SKIP            : skip this node (no value for now)
@@ -3043,7 +3043,7 @@
  */
 int
 ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
-                                U64 * ipSystemStatsHCOutBcastPkts_val_ptr)
+                                struct counter64 *ipSystemStatsHCOutBcastPkts_val_ptr)
 {
    /** we should have a non-NULL pointer */
     netsnmp_assert(NULL != ipSystemStatsHCOutBcastPkts_val_ptr);

agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.hDiffSwitch to side-by-side view

--- a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+++ b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
@@ -303,7 +303,7 @@
         
         ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx *
                                       rowreq_ctx,
-                                      U64 *
+                                      struct counter64 *
                                       ipSystemStatsHCInReceives_val_ptr);
     int             ipSystemStatsInOctets_get(ipSystemStatsTable_rowreq_ctx
                                               * rowreq_ctx,
@@ -327,7 +327,7 @@
         
         ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx *
                                     rowreq_ctx,
-                                    U64 * ipSystemStatsHCInOctets_val_ptr);
+                                    struct counter64 *ipSystemStatsHCInOctets_val_ptr);
     int
      
         
@@ -466,7 +466,7 @@
         
         ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
                                            rowreq_ctx,
-                                           U64 *
+                                           struct counter64 *
                                            ipSystemStatsHCInForwDatagrams_val_ptr);
     int
      
@@ -570,7 +570,7 @@
         
         ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx *
                                       rowreq_ctx,
-                                      U64 *
+                                      struct counter64 *
                                       ipSystemStatsHCInDelivers_val_ptr);
     int
      
@@ -610,7 +610,7 @@
         
         ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx *
                                        rowreq_ctx,
-                                       U64 *
+                                       struct counter64 *
                                        ipSystemStatsHCOutRequests_val_ptr);
     int
      
@@ -670,7 +670,7 @@
         
         ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
                                             rowreq_ctx,
-                                            U64 *
+                                            struct counter64 *
                                             ipSystemStatsHCOutForwDatagrams_val_ptr);
     int
      
@@ -810,7 +810,7 @@
         
         ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx *
                                         rowreq_ctx,
-                                        U64 *
+                                        struct counter64 *
                                         ipSystemStatsHCOutTransmits_val_ptr);
     int
      
@@ -850,7 +850,7 @@
         
         ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx *
                                      rowreq_ctx,
-                                     U64 *
+                                     struct counter64 *
                                      ipSystemStatsHCOutOctets_val_ptr);
     int
      
@@ -890,7 +890,7 @@
         
         ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
                                        rowreq_ctx,
-                                       U64 *
+                                       struct counter64 *
                                        ipSystemStatsHCInMcastPkts_val_ptr);
     int
      
@@ -930,7 +930,7 @@
         
         ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
                                          rowreq_ctx,
-                                         U64 *
+                                         struct counter64 *
                                          ipSystemStatsHCInMcastOctets_val_ptr);
     int
      
@@ -970,7 +970,7 @@
         
         ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
                                         rowreq_ctx,
-                                        U64 *
+                                        struct counter64 *
                                         ipSystemStatsHCOutMcastPkts_val_ptr);
     int
      
@@ -1010,7 +1010,7 @@
         
         ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
                                           rowreq_ctx,
-                                          U64 *
+                                          struct counter64 *
                                           ipSystemStatsHCOutMcastOctets_val_ptr);
     int
      
@@ -1050,7 +1050,7 @@
         
         ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
                                        rowreq_ctx,
-                                       U64 *
+                                       struct counter64 *
                                        ipSystemStatsHCInBcastPkts_val_ptr);
     int
      
@@ -1090,7 +1090,7 @@
         
         ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
                                         rowreq_ctx,
-                                        U64 *
+                                        struct counter64 *
                                         ipSystemStatsHCOutBcastPkts_val_ptr);
     int
      

agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.cDiffSwitch to side-by-side view

--- a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c
+++ b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c
@@ -653,10 +653,10 @@
          * ipSystemStatsHCInReceives(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IPSYSTEMSTATSHCINRECEIVES:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
         rc = ipSystemStatsHCInReceives_get(rowreq_ctx,
-                                           (U64 *) var->val.string);
+                                           (struct counter64 *) var->val.string);
         break;
 
         /*
@@ -673,10 +673,10 @@
          * ipSystemStatsHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IPSYSTEMSTATSHCINOCTETS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
         rc = ipSystemStatsHCInOctets_get(rowreq_ctx,
-                                         (U64 *) var->val.string);
+                                         (struct counter64 *) var->val.string);
         break;
 
         /*
@@ -743,10 +743,10 @@
          * ipSystemStatsHCInForwDatagrams(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IPSYSTEMSTATSHCINFORWDATAGRAMS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
         rc = ipSystemStatsHCInForwDatagrams_get(rowreq_ctx,
-                                                (U64 *) var->val.string);
+                                                (struct counter64 *) var->val.string);
         break;
 
         /*
@@ -803,10 +803,10 @@
          * ipSystemStatsHCInDelivers(19)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IPSYSTEMSTATSHCINDELIVERS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
         rc = ipSystemStatsHCInDelivers_get(rowreq_ctx,
-                                           (U64 *) var->val.string);
+                                           (struct counter64 *) var->val.string);
         break;
 
         /*
@@ -823,10 +823,10 @@
          * ipSystemStatsHCOutRequests(21)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IPSYSTEMSTATSHCOUTREQUESTS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
         rc = ipSystemStatsHCOutRequests_get(rowreq_ctx,
-                                            (U64 *) var->val.string);
+                                            (struct counter64 *) var->val.string);
         break;
 
         /*
@@ -853,10 +853,10 @@
          * ipSystemStatsHCOutForwDatagrams(24)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IPSYSTEMSTATSHCOUTFORWDATAGRAMS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
         rc = ipSystemStatsHCOutForwDatagrams_get(rowreq_ctx,
-                                                 (U64 *) var->val.string);
+                                                 (struct counter64 *) var->val.string);
         break;
 
         /*
@@ -923,10 +923,10 @@
          * ipSystemStatsHCOutTransmits(31)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IPSYSTEMSTATSHCOUTTRANSMITS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
         rc = ipSystemStatsHCOutTransmits_get(rowreq_ctx,
-                                             (U64 *) var->val.string);
+                                             (struct counter64 *) var->val.string);
         break;
 
         /*
@@ -943,10 +943,10 @@
          * ipSystemStatsHCOutOctets(33)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IPSYSTEMSTATSHCOUTOCTETS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
         rc = ipSystemStatsHCOutOctets_get(rowreq_ctx,
-                                          (U64 *) var->val.string);
+                                          (struct counter64 *) var->val.string);
         break;
 
         /*
@@ -963,10 +963,10 @@
          * ipSystemStatsHCInMcastPkts(35)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IPSYSTEMSTATSHCINMCASTPKTS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
         rc = ipSystemStatsHCInMcastPkts_get(rowreq_ctx,
-                                            (U64 *) var->val.string);
+                                            (struct counter64 *) var->val.string);
         break;
 
         /*
@@ -983,10 +983,10 @@
          * ipSystemStatsHCInMcastOctets(37)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IPSYSTEMSTATSHCINMCASTOCTETS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
         rc = ipSystemStatsHCInMcastOctets_get(rowreq_ctx,
-                                              (U64 *) var->val.string);
+                                              (struct counter64 *) var->val.string);
         break;
 
         /*
@@ -1003,10 +1003,10 @@
          * ipSystemStatsHCOutMcastPkts(39)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IPSYSTEMSTATSHCOUTMCASTPKTS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
         rc = ipSystemStatsHCOutMcastPkts_get(rowreq_ctx,
-                                             (U64 *) var->val.string);
+                                             (struct counter64 *) var->val.string);
         break;
 
         /*
@@ -1023,10 +1023,10 @@
          * ipSystemStatsHCOutMcastOctets(41)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IPSYSTEMSTATSHCOUTMCASTOCTETS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
         rc = ipSystemStatsHCOutMcastOctets_get(rowreq_ctx,
-                                               (U64 *) var->val.string);
+                                               (struct counter64 *) var->val.string);
         break;
 
         /*
@@ -1043,10 +1043,10 @@
          * ipSystemStatsHCInBcastPkts(43)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IPSYSTEMSTATSHCINBCASTPKTS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
         rc = ipSystemStatsHCInBcastPkts_get(rowreq_ctx,
-                                            (U64 *) var->val.string);
+                                            (struct counter64 *) var->val.string);
         break;
 
         /*
@@ -1063,10 +1063,10 @@
          * ipSystemStatsHCOutBcastPkts(45)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h 
          */
     case COLUMN_IPSYSTEMSTATSHCOUTBCASTPKTS:
-        var->val_len = sizeof(U64);
+        var->val_len = sizeof(struct counter64);
         var->type = ASN_COUNTER64;
         rc = ipSystemStatsHCOutBcastPkts_get(rowreq_ctx,
-                                             (U64 *) var->val.string);
+                                             (struct counter64 *) var->val.string);
         break;
 
         /*

configureDiffSwitch to side-by-side view

--- a/configure
+++ b/configure
@@ -21661,6 +21661,8 @@
 #   Compiler flags:
 #
 
+CFLAGS="-DNETSNMP_REMOVE_U64 $CFLAGS"
+
 # The Net-SNMP source code is not strict-aliasing safe, so add
 # -fno-strict-aliasing to $CFLAGS if the compiler supports it.
 echo "$as_me:$LINENO: checking whether the compiler supports -fno-strict-aliasing" >&5

configure.inDiffSwitch to side-by-side view

--- a/configure.in
+++ b/configure.in
@@ -2434,6 +2434,8 @@
 
 #   Compiler flags:
 #
+
+CFLAGS="-DNETSNMP_REMOVE_U64 $CFLAGS"
 
 # The Net-SNMP source code is not strict-aliasing safe, so add
 # -fno-strict-aliasing to $CFLAGS if the compiler supports it.

include/net-snmp/data_access/ipstats.hDiffSwitch to side-by-side view

--- a/include/net-snmp/data_access/ipstats.h
+++ b/include/net-snmp/data_access/ipstats.h
@@ -20,35 +20,35 @@
  */
 typedef struct netsnmp_ipstats_s {
 
-   U64             HCInReceives;
-   U64             HCInOctets;
+   struct counter64 HCInReceives;
+   struct counter64 HCInOctets;
    u_long          InHdrErrors;
    u_long          InNoRoutes;
    u_long          InAddrErrors;
    u_long          InUnknownProtos;
    u_long          InTruncatedPkts;
-   U64             HCInForwDatagrams;
+   struct counter64 HCInForwDatagrams;
    u_long          ReasmReqds;
    u_long          ReasmOKs;
    u_long          ReasmFails;
    u_long          InDiscards;
-   U64             HCInDelivers;
-   U64             HCOutRequests;
+   struct counter64 HCInDelivers;
+   struct counter64 HCOutRequests;
    u_long          OutNoRoutes;
-   U64             HCOutForwDatagrams;
+   struct counter64 HCOutForwDatagrams;
    u_long          OutDiscards;
    u_long          OutFragReqds;
    u_long          OutFragOKs;
    u_long          OutFragFails;
    u_long          OutFragCreates;
-   U64             HCOutTransmits;
-   U64             HCOutOctets;
-   U64             HCInMcastPkts;
-   U64             HCInMcastOctets;
-   U64             HCOutMcastPkts;
-   U64             HCOutMcastOctets;
-   U64             HCInBcastPkts;
-   U64             HCOutBcastPkts;
+   struct counter64 HCOutTransmits;
+   struct counter64 HCOutOctets;
+   struct counter64 HCInMcastPkts;
+   struct counter64 HCInMcastOctets;
+   struct counter64 HCOutMcastPkts;
+   struct counter64 HCOutMcastOctets;
+   struct counter64 HCInBcastPkts;
+   struct counter64 HCOutBcastPkts;
 
 } netsnmp_ipstats;
 

include/net-snmp/library/int64.hDiffSwitch to side-by-side view

--- a/include/net-snmp/library/int64.h
+++ b/include/net-snmp/library/int64.h
@@ -5,27 +5,39 @@
 extern          "C" {
 #endif
 
+#ifndef NETSNMP_REMOVE_U64
+    /*
+     * Note: using the U64 typedef is deprecated because this typedef conflicts
+     * with a typedef with the same name defined in the Perl header files.
+     */
     typedef struct counter64 U64;
+#endif
 
 #define I64CHARSZ 21
 
-    void            divBy10(U64, U64 *, unsigned int *);
-    void            multBy10(U64, U64 *);
-    void            incrByU16(U64 *, unsigned int);
-    void            incrByU32(U64 *, unsigned int);
-    void            zeroU64(U64 *);
-    int             isZeroU64(const U64 *);
-    void            printU64(char *, const U64 *);
-    void            printI64(char *, const U64 *);
-    int             read64(U64 *, const char *);
-    void            u64Subtract(const U64 * pu64one, const U64 * pu64two,
-                                U64 * pu64out);
-    void            u64Incr(U64 * pu64out, const U64 * pu64one);
-    void            u64UpdateCounter(U64 * pu64out, const U64 * pu64one,
-                                     const U64 * pu64two);
-    void            u64Copy(U64 * pu64one, const U64 * pu64two);
+    void            divBy10(struct counter64, struct counter64 *,
+                            unsigned int *);
+    void            multBy10(struct counter64, struct counter64 *);
+    void            incrByU16(struct counter64 *, unsigned int);
+    void            incrByU32(struct counter64 *, unsigned int);
+    void            zeroU64(struct counter64 *);
+    int             isZeroU64(const struct counter64 *);
+    void            printU64(char *, const struct counter64 *);
+    void            printI64(char *, const struct counter64 *);
+    int             read64(struct counter64 *, const char *);
+    void            u64Subtract(const struct counter64 *pu64one,
+                                const struct counter64 *pu64two,
+                                struct counter64 *pu64out);
+    void            u64Incr(struct counter64 *pu64out,
+                            const struct counter64 *pu64one);
+    void            u64UpdateCounter(struct counter64 *pu64out,
+                                     const struct counter64 *pu64one,
+                                     const struct counter64 *pu64two);
+    void            u64Copy(struct counter64 *pu64one,
+                            const struct counter64 *pu64two);
 
-    int             netsnmp_c64_check_for_32bit_wrap(U64 *old_val, U64 *new_val,
+    int             netsnmp_c64_check_for_32bit_wrap(struct counter64 *old_val,
+                                                     struct counter64 *new_val,
                                                      int adjust);
     int             netsnmp_c64_check32_and_update(struct counter64 *prev_val,
                                                    struct counter64 *new_val,

snmplib/asn1.cDiffSwitch to side-by-side view

--- a/snmplib/asn1.c
+++ b/snmplib/asn1.c
@@ -1773,7 +1773,7 @@
 asn_parse_unsigned_int64(u_char * data,
                          size_t * datalength,
                          u_char * type,
-                         struct counter64 * cp, size_t countersize)
+                         struct counter64 *cp, size_t countersize)
 {
     /*
      * ASN.1 integer ::= 0x02 asnlength byte {byte}*
@@ -1869,7 +1869,7 @@
 asn_build_unsigned_int64(u_char * data,
                          size_t * datalength,
                          u_char type,
-                         const struct counter64 * cp, size_t countersize)
+                         const struct counter64 *cp, size_t countersize)
 {
     /*
      * ASN.1 integer ::= 0x02 asnlength byte {byte}*
@@ -2023,7 +2023,7 @@
 asn_parse_signed_int64(u_char * data,
                        size_t * datalength,
                        u_char * type,
-                       struct counter64 * cp, size_t countersize)
+                       struct counter64 *cp, size_t countersize)
 {
     static const char *errpre = "parse int64";
     const int       int64sizelimit = (4 * 2) + 1;
@@ -2127,7 +2127,7 @@
 asn_build_signed_int64(u_char * data,
                        size_t * datalength,
                        u_char type,
-                       const struct counter64 * cp, size_t countersize)
+                       const struct counter64 *cp, size_t countersize)
 {
     /*
      * ASN.1 integer ::= 0x02 asnlength byte {byte}*

snmplib/int64.cDiffSwitch to side-by-side view

--- a/snmplib/int64.c
+++ b/snmplib/int64.c
@@ -34,7 +34,7 @@
  * @param[out] puR   Remainder.
  */
 void
-divBy10(U64 u64, U64 * pu64Q, unsigned int *puR)
+divBy10(struct counter64 u64, struct counter64 *pu64Q, unsigned int *puR)
 {
     unsigned long   ulT;
     unsigned long   ulQ;
@@ -84,7 +84,7 @@
  * @param[out] pu64P Product.
  */
 void
-multBy10(U64 u64, U64 * pu64P)
+multBy10(struct counter64 u64, struct counter64 *pu64P)
 {
     unsigned long   ulT;
     unsigned long   ulP;
@@ -131,7 +131,7 @@
  *
  */
 void
-incrByU16(U64 * pu64, unsigned int u16)
+incrByU16(struct counter64 *pu64, unsigned int u16)
 {
     incrByU32(pu64, u16);
 }
@@ -144,7 +144,7 @@
  *
  */
 void
-incrByU32(U64 * pu64, unsigned int u32)
+incrByU32(struct counter64 *pu64, unsigned int u32)
 {
     uint32_t tmp;
 
@@ -162,7 +162,8 @@
  * @param[out] pu64out pu64one - pu64two.
  */
 void
-u64Subtract(const U64 * pu64one, const U64 * pu64two, U64 * pu64out)
+u64Subtract(const struct counter64 *pu64one, const struct counter64 *pu64two,
+            struct counter64 *pu64out)
 {
     int carry;
 
@@ -178,7 +179,7 @@
  * @param[in,out] pu64out pu64out += pu64one.
  */
 void
-u64Incr(U64 * pu64out, const U64 * pu64one)
+u64Incr(struct counter64 *pu64out, const struct counter64 *pu64one)
 {
     pu64out->high = (uint32_t)(pu64out->high + pu64one->high);
     incrByU32(pu64out, pu64one->low);
@@ -192,9 +193,10 @@
  * @param[out] pu64out pu64out += (pu64one - pu64two)
  */
 void
-u64UpdateCounter(U64 * pu64out, const U64 * pu64one, const U64 * pu64two)
-{
-    U64 tmp;
+u64UpdateCounter(struct counter64 *pu64out, const struct counter64 *pu64one,
+                 const struct counter64 *pu64two)
+{
+    struct counter64 tmp;
 
     u64Subtract(pu64one, pu64two, &tmp);
     u64Incr(pu64out, &tmp);
@@ -207,7 +209,7 @@
  * @param[out] pu64one Where to store the copy - *pu64one = *pu64two.
  */
 void
-u64Copy(U64 * pu64one, const U64 * pu64two)
+u64Copy(struct counter64 *pu64one, const struct counter64 *pu64two)
 {
     *pu64one = *pu64two;
 }
@@ -218,7 +220,7 @@
  * @param[in] pu64 Number to be zeroed.
  */
 void
-zeroU64(U64 * pu64)
+zeroU64(struct counter64 *pu64)
 {
     pu64->low = 0;
     pu64->high = 0;
@@ -230,7 +232,7 @@
  * @param[in] pu64 Number to be checked.
  */
 int
-isZeroU64(const U64 * pu64)
+isZeroU64(const struct counter64 *pu64)
 {
     return pu64->low == 0 && pu64->high == 0;
 }
@@ -331,8 +333,10 @@
  * @retval -2 : look like we have 64 bit values, but sums aren't consistent
  */
 int
-netsnmp_c64_check32_and_update(struct counter64 *prev_val, struct counter64 *new_val,
-                               struct counter64 *old_prev_val, int *need_wrap_check)
+netsnmp_c64_check32_and_update(struct counter64 *prev_val,
+                               struct counter64 *new_val,
+                               struct counter64 *old_prev_val,
+                               int *need_wrap_check)
 {
     int rc;
 
@@ -388,10 +392,10 @@
 /** Convert an unsigned 64-bit number to ASCII. */
 void
 printU64(char *buf, /* char [I64CHARSZ+1]; */
-         const U64 * pu64)
-{
-    U64             u64a;
-    U64             u64b;
+         const struct counter64 *pu64)
+{
+    struct counter64 u64a;
+    struct counter64 u64b;
 
     char            aRes[I64CHARSZ + 1];
     unsigned int    u;
@@ -412,9 +416,9 @@
 /** Convert a signed 64-bit number to ASCII. */
 void
 printI64(char *buf, /* char [I64CHARSZ+1]; */
-         const U64 * pu64)
-{
-    U64             u64a;
+         const struct counter64 *pu64)
+{
+    struct counter64 u64a;
 
     if (pu64->high & 0x80000000) {
         u64a.high = (uint32_t) ~pu64->high;
@@ -427,11 +431,11 @@
     }
 }
 
-/** Convert a signed 64-bit integer from ASCII to U64. */
+/** Convert a signed 64-bit integer from ASCII to struct counter64. */
 int
-read64(U64 * i64, const char *str)
-{
-    U64             i64p;
+read64(struct counter64 *i64, const char *str)
+{
+    struct counter64 i64p;
     unsigned int    u;
     int             sign = 0;
     int             ok = 0;

snmplib/read_config.cDiffSwitch to side-by-side view

--- a/snmplib/read_config.c
+++ b/snmplib/read_config.c
@@ -1973,10 +1973,10 @@
 
     case ASN_COUNTER64:
     {
-        if (*len < sizeof(U64))
+        if (*len < sizeof(struct counter64))
             return NULL;
-        *len = sizeof(U64);
-        read64((U64 *) dataptr, readfrom);
+        *len = sizeof(struct counter64);
+        read64((struct counter64 *) dataptr, readfrom);
         readfrom = skip_token(readfrom);
         return readfrom;
     }

About

你可能感兴趣的:(问题相关,ubuntu)