mib.c
2015-08-21 14:46
357 查看
函数 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中的节点,根据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);
}
}
相关文章推荐
- POJ - 3842 An Industrial Spy dfs(水)
- 11G新特性 -- Expression Statistics
- C/C++的类型安全
- Android手机访问相册和打开照相机
- 软件测试总结02
- php获取从搜索引擎点击网站的关键词
- Activiti工作流引擎使用
- Office 365 Certification 考试心得
- Optimizing HLSL Shaders( HLSL Shaders的优化)
- ReactiveCocoa与Functional Reactive Programming
- __weak与__block区别
- Spring bean scopes example
- hdu5412CRB and Queries(整体二分)
- POJ 1459 Power Network(最大流)
- Linux下利用backtrace追踪函数调用堆栈以及定位段错误
- C#连接数据库
- wamp,xampp,phpStudy等在安装拓展的时候出现的问题
- 蚁群算法求解旅行商问题(附c和matlab源代码)
- WPF:如何在工作线程中更新窗体的UI元素(Dispatcher机制)
- Shell编程(运算符)