码迷,mamicode.com
首页 > 其他好文 > 详细

mib.c

时间:2015-08-21 15:24:19      阅读:269      评论:0      收藏:0      [点我收藏+]

标签:

函数 sprint_realloc_by_type  (E:\code\net-snmp-5.4.2.1\snmplib\mib.c)的主要作用是:

解析传入的mib中的节点,根据mib节点类型,将其转换为可以识别的数字存入buffer中。

int
sprint_realloc_by_type(u_char ** buf, size_t * buf_len, size_t * out_len,
                       int allow_realloc,
                       const netsnmp_variable_list * var,
                       const struct enum_list *enums,
                       const char *hint, const char *units)

{     DEBUGMSGTL(("output", "sprint_by_type, type %d\n", var->type));

    switch (var->type) {    

    case ASN_INTEGER:        

       return sprint_realloc_integer(buf, buf_len, out_len, allow_realloc, var, enums, hint, units);    

            case ASN_OCTET_STR:        

      return sprint_realloc_octet_string(buf, buf_len, out_len, allow_realloc, var, enums, hint,  units);

             .................    

      /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */    

     default:        

       DEBUGMSGTL(("sprint_by_type", "bad type: %d\n", var->type));        

      return sprint_realloc_badtype(buf, buf_len, out_len, allow_realloc, var, enums, hint, units);    

    }

}

 

mib.c

标签:

原文地址:http://www.cnblogs.com/rohens-hbg/p/4747862.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!