snmp 的dpi 300dpi是什么意思思

IPDR vs DPI 两者有何区别_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
IPDR vs DPI 两者有何区别
上传于||暂无简介
阅读已结束,如果下载本文需要使用1下载券
想免费下载本文?
定制HR最喜欢的简历
你可能喜欢1369人阅读
前奏参见如下:
.cn/s/blog_8f3de3250100xhao.html
http://blog.csdn.net/hepeng597/article/details/8782868
http://blog.csdn.net/rheostat/article/details/8172580
问题解决:
http://bbs.csdn.net/topics/
&* Note: this file originally auto-generated by mib2c using
#include &net-snmp/net-snmp-config.h&
#include &net-snmp/net-snmp-includes.h&
#include &net-snmp/agent/net-snmp-agent-includes.h&
#include &dpiProject.h&
#define NNN & &30
#define STRMAX & &200
#define COLUMN_MIN & &1
#define COLUMN_MAX & &11
struct dpiTaskTable_entry *
dpiTaskTable_createEntry(u_long &gnTaskId, char *gnTaskName, size_t gnTaskName_len);
/** Initializes the dpiProject module */
init_dpiProject(void)
& /* here we initialize all the tables we're planning on supporting */
& & initialize_table_dpiTaskTable();
/** Initialize the dpiTaskTable table by defining its contents and how it's structured */
initialize_table_dpiTaskTable(void)
& & const oid dpiTaskTable_oid[] = {1,3,6,1,4,1,,0,0};
& & const size_t dpiTaskTable_oid_len & = OID_LENGTH(dpiTaskTable_oid);
& & netsnmp_handler_registration & &*
& & netsnmp_iterator_info & & & & & *
& & netsnmp_table_registration_info *table_
& & DEBUGMSGTL((&dpiProject:init&, &initializing table dpiTaskTable\n&));
& & reg = netsnmp_create_handler_registration(
& & & & & & & &dpiTaskTable&, & & dpiTaskTable_handler,
& & & & & & & dpiTaskTable_oid, dpiTaskTable_oid_len,
& & & & & & & HANDLER_CAN_RONLY
& & & & & & & );
& & table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
& & netsnmp_table_helper_add_indexes(table_info,
& & & & & & & & & & & & & &ASN_UNSIGNED, &/* index: gnTaskId */
& & & & & & & & & & & & & &0);
& & //定义最大最小列数
& & table_info-&min_column = COLUMN_MIN;
& & table_info-&max_column = COLUMN_MAX;
& & iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info );
& & iinfo-&get_first_data_point = dpiTaskTable_get_first_data_
& & iinfo-&get_next_data_point &= dpiTaskTable_get_next_data_
& & iinfo-&table_reginfo & & & &= table_
& & netsnmp_register_table_iterator( reg, iinfo );
& & netsnmp_inject_handler_before( reg,&
& & & & netsnmp_get_cache_handler(DPITASKTABLE_TIMEOUT,
& & & & & & & & & & & & & & & & & dpiTaskTable_load, dpiTaskTable_free,
& & & & & & & & & & & & & & & & & dpiTaskTable_oid, dpiTaskTable_oid_len),
& & & & & & TABLE_ITERATOR_NAME);
& & /* Initialise the contents of the table here */
& & //初始化表格
& & dpiTaskTable_createEntry(1, &dpi agent1&, strlen(&dpi agent1&));
& & dpiTaskTable_createEntry(2, &dpi agent1&, strlen(&dpi agent1&));
& & dpiTaskTable_createEntry(3, &dpi agent1&, strlen(&dpi agent1&));
& & /* Typical data structure for a row entry */
//总共11列
struct dpiTaskTable_entry {
& & /* Index values */
& & //u_long gnTaskId;
& & /* Column values */
& & u_long gnTaskId;
& & char gnTaskName[NNN];
& & size_t gnTaskName_
& & //char gnTaskState[NNN];
& & //size_t gnTaskState_
& & //u_long gnTaskCpuU
& & //u_long gnTaskMemoryU
& & //char gnTaskStartTime[NNN];
& & //size_t gnTaskStartTime_
& & //char gnTaskUpTime[NNN];
& & //size_t gnTaskUpTime_
& & /* Illustrate using a simple linked list */
& & struct dpiTaskTable_entry *
struct dpiTaskTable_entry &*dpiTaskTable_
/* create a new row in the (unsorted) table */
struct dpiTaskTable_entry *
dpiTaskTable_createEntry(u_long &gnTaskId, char *gnTaskName, size_t gnTaskName_len)&
& & struct dpiTaskTable_entry *
& & entry = SNMP_MALLOC_TYPEDEF(struct dpiTaskTable_entry);
& & if (!entry)
& & & & return NULL;
& & entry-&gnTaskId = gnTaskId;
& & snmp_log(LOG_ERR,&entry-&gnTaskId(%d)\n&, &entry-&gnTaskId);
& & //实现创建表
& & entry-&gnTaskName_len = gnTaskName_
& & strncpy(entry-&gnTaskName, gnTaskName, gnTaskName_len);
& & entry-&next = dpiTaskTable_
& & dpiTaskTable_head =
/* remove a row from the table */
dpiTaskTable_removeEntry( struct dpiTaskTable_entry *entry ) {
& & struct dpiTaskTable_entry *ptr, *
& & if (!entry)
& & & & & &/* Nothing to remove */
& & for ( ptr &= dpiTaskTable_head, prev = NULL;
& & & & & ptr != NULL;
& & & & & prev = ptr, ptr = ptr-&next ) {
& & & & if ( ptr == entry )
& & & & & &
& & if ( !ptr )
& & & & & &/* Can't find it */
& & if ( prev == NULL )
& & & & dpiTaskTable_head = ptr-&
& & & & prev-&next = ptr-&
& & SNMP_FREE( entry ); & /* XXX - release any other internal resources */
/* Example cache handling - set up linked list from a suitable file */
dpiTaskTable_load( netsnmp_cache *cache, void *vmagic ) {
& & FILE *
& & struct dpiTaskTable_entry *
& & char buf[STRMAX];
& & /* The basic load routine template assumes that the data to
& & & &be reported is held in a file - with one row of the file
& & & &for each row of the table.
& & & & & If your data is available via a different API, you
& & & &should amend this initial block (and the control of the
& & & &'while' loop) accordingly.
& & & & & 'XXX' marks where the template is incomplete and
& & & &code will definitely need to be added. */
& & fp = fopen( &/data/for/dpiTaskTable&, &r& );
& & if ( !fp ) {
& & & & return -1;
& & while ( fgets( buf, STRMAX, fp )) {
& & & & this = SNMP_MALLOC_TYPEDEF( struct dpiTaskTable_entry );
& & & & /* XXX - Unpick 'buf' to extract the individual field values
& & & & & & & & &and then populate the 'this' data structure with them */
& & & & this-&next = dpiTaskTable_
& & & & dpiTaskTable_head = & &/* Iterate helper is fine with unordered lists! */
& & fclose(fp);
& & return 0; &/* OK */
dpiTaskTable_free( netsnmp_cache *cache, void *vmagic ) {
& & struct dpiTaskTable_entry *this, *
& & for ( this = dpiTaskTable_ this=that ) {
& & & & that = this-&
& & & & SNMP_FREE( this ); & /* XXX - release any other internal resources */
& & dpiTaskTable_head = NULL;
/* Example iterator hook routines - using 'get_next' to do most of the work */
netsnmp_variable_list *
dpiTaskTable_get_first_data_point(void **my_loop_context,
& & & & & & & & & & & & & void **my_data_context,
& & & & & & & & & & & & & netsnmp_variable_list *put_index_data,
& & & & & & & & & & & & & netsnmp_iterator_info *mydata)
& & *my_loop_context = dpiTaskTable_
& & return dpiTaskTable_get_next_data_point(my_loop_context, my_data_context,
& & & & & & & & & & & & & & & & & & put_index_data, &mydata );
netsnmp_variable_list *
dpiTaskTable_get_next_data_point(void **my_loop_context,
& & & & & & & & & & & & & void **my_data_context,
& & & & & & & & & & & & & netsnmp_variable_list *put_index_data,
& & & & & & & & & & & & & netsnmp_iterator_info *mydata)
& & struct dpiTaskTable_entry *entry = (struct dpiTaskTable_entry *)*my_loop_
& & netsnmp_variable_list *idx = put_index_
& & if ( entry ) {
& & & & snmp_set_var_typed_integer( idx, ASN_UNSIGNED, entry-&gnTaskId );
& & & & idx = idx-&next_
& & & & *my_data_context = (void *)
& & & & *my_loop_context = (void *)entry-&
& & & & return put_index_
& & } else {
& & & & return NULL;
/** handles requests for the dpiTaskTable table */
dpiTaskTable_handler(
& & netsnmp_mib_handler & & & & & & & *handler,
& & netsnmp_handler_registration & & &*reginfo,
& & netsnmp_agent_request_info & & & &*reqinfo,
& & netsnmp_request_info & & & & & & &*requests) {
& & netsnmp_request_info & & & *
& & netsnmp_table_request_info *table_
& & struct dpiTaskTable_entry & & & & &*table_
& & DEBUGMSGTL((&dpiProject:handler&, &Processing request (%d)\n&, reqinfo-&mode));
& & switch (reqinfo-&mode) {
& & & & /*
& & & & &* Read-support (also covers GetNext requests)
& & & & &*/
& & case MODE_GET:
& & & & for (request= request=request-&next) {
& & & & & & table_entry = (struct dpiTaskTable_entry *)
& & & & & & & & & & & & & & & netsnmp_extract_iterator_context(request);
& & & & & & table_info &= & & netsnmp_extract_table_info( & & &request);
& & & & & & switch (table_info-&colnum) {
& & & & & & case COLUMN_GNTASKID:
& & & & & & & & if ( !table_entry ) {
& & & & & & & & & & netsnmp_set_request_error(reqinfo, request,
& & & & & & & & & & & & & & & & & & & & & & & SNMP_NOSUCHINSTANCE);
& & & & & & & & & &
& & & & & & & & }
& & & & & & & & snmp_set_var_typed_integer( request-&requestvb, ASN_UNSIGNED,
& & & & & & & & & & & & & & & & & & & & & & table_entry-&gnTaskId);
& & & & & & & &
& & & & & & case COLUMN_GNTASKNAME:
& & & & & & & & if ( !table_entry ) {
& & & & & & & & & & netsnmp_set_request_error(reqinfo, request,
& & & & & & & & & & & & & & & & & & & & & & & SNMP_NOSUCHINSTANCE);
& & & & & & & & & &
& & & & & & & & }
& & & & & & & & snmp_set_var_typed_value( request-&requestvb, ASN_OCTET_STR,
& & & & & & & & & & & & & & & & & & & & & table_entry-&gnTaskName,
& & & & & & & & & & & & & & & & & & & & & table_entry-&gnTaskName_len);
& & & & & & & &
& & & & & & case COLUMN_GNTASKSTATE:
& & & & & & & & if ( !table_entry ) {
& & & & & & & & & & netsnmp_set_request_error(reqinfo, request,
& & & & & & & & & & & & & & & & & & & & & & & SNMP_NOSUCHINSTANCE);
& & & & & & & & & &
& & & & & & & & }
& & & & & & & & snmp_set_var_typed_value( request-&requestvb, ASN_OCTET_STR,
& & & & & & & & & & & & & & & & & & & & & table_entry-&gnTaskState,
& & & & & & & & & & & & & & & & & & & & & table_entry-&gnTaskState_len);
& & & & & & & &
& & & & & & case COLUMN_GNTASKCPUUSAGE:
& & & & & & & & if ( !table_entry ) {
& & & & & & & & & & netsnmp_set_request_error(reqinfo, request,
& & & & & & & & & & & & & & & & & & & & & & & SNMP_NOSUCHINSTANCE);
& & & & & & & & & &
& & & & & & & & }
& & & & & & & & snmp_set_var_typed_integer( request-&requestvb, ASN_UNSIGNED,
& & & & & & & & & & & & & & & & & & & & & & table_entry-&gnTaskCpuUsage);
& & & & & & & &
& & & & & & case COLUMN_GNTASKMEMORYUSED:
& & & & & & & & if ( !table_entry ) {
& & & & & & & & & & netsnmp_set_request_error(reqinfo, request,
& & & & & & & & & & & & & & & & & & & & & & & SNMP_NOSUCHINSTANCE);
& & & & & & & & & &
& & & & & & & & }
& & & & & & & & snmp_set_var_typed_integer( request-&requestvb, ASN_UNSIGNED,
& & & & & & & & & & & & & & & & & & & & & & table_entry-&gnTaskMemoryUsed);
& & & & & & & &
& & & & & & case COLUMN_GNTASKSTARTTIME:
& & & & & & & & if ( !table_entry ) {
& & & & & & & & & & netsnmp_set_request_error(reqinfo, request,
& & & & & & & & & & & & & & & & & & & & & & & SNMP_NOSUCHINSTANCE);
& & & & & & & & & &
& & & & & & & & }
& & & & & & & & snmp_set_var_typed_value( request-&requestvb, ASN_OCTET_STR,
& & & & & & & & & & & & & & & & & & & & & table_entry-&gnTaskStartTime,
& & & & & & & & & & & & & & & & & & & & & table_entry-&gnTaskStartTime_len);
& & & & & & & &
& & & & & & case COLUMN_GNTASKUPTIME:
& & & & & & & & if ( !table_entry ) {
& & & & & & & & & & netsnmp_set_request_error(reqinfo, request,
& & & & & & & & & & & & & & & & & & & & & & & SNMP_NOSUCHINSTANCE);
& & & & & & & & & &
& & & & & & & & }
& & & & & & & & snmp_set_var_typed_value( request-&requestvb, ASN_OCTET_STR,
& & & & & & & & & & & & & & & & & & & & & table_entry-&gnTaskUpTime,
& & & & & & & & & & & & & & & & & & & & & table_entry-&gnTaskUpTime_len);
& & & & & & & &
& & & & & & default:
& & & & & & & & netsnmp_set_request_error(reqinfo, request,
& & & & & & & & & & & & & & & & & & & & & SNMP_NOSUCHOBJECT);
& & & & & & & &
& & & & & & }
& & return SNMP_ERR_NOERROR;
主要是通过m2c 工具生成.c.h文件
1.生成代码模板:变量:env MIBS=&+/usr/local/share/snmp/mibs/XXX-MIB.txt& mib2c xxx(对应xxx.c,xxx.h)
& & & & & & & & 表格:env MIBS=&+/usr/local/share/snmp/mibs/XXX-MIB.txt& mib2c -c mib2c.iterate.conf xxx(对应xxx.c,xxx.h)
2.修改模板代码。通过devInfo_handler模块提供的api
& 模板代码流程:init_dpiProject-》initialize_table_xxxTable-》xxxTable_createEntry
& 修改处:
& 1.在initialize_table_xxxTable修改表格列数最小最大值
& 2.initialize_table_xxxTable加人xxxTable_createEntry初始化
& 3.在xxxTable_createEntry实现表格数据获取(过devInfo_handler模块提供的api)
有三种实现集成到net snmp当中的方式:静态、动态、子代理。本模块采用子代理方式
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:260206次
积分:3600
积分:3600
排名:第7335名
原创:66篇
转载:148篇
评论:33条
(1)(7)(11)(5)(1)(1)(4)(10)(2)(1)(12)(1)(1)(14)(7)(1)(1)(3)(7)(10)(7)(13)(25)(26)(13)(8)(3)(2)(1)(2)(17)(1)(1)北京八里科技有限公司&-&威胁情报|信息安全云服务|性能测试仪&-&您可靠的合作伙伴
DPI协议识别特征库
DPI协议识别特征库
支持超过2000种协议的识别和检测!每周都会有专门的团队进行更新!DPI系统技术要求_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
DPI系统技术要求
上传于||暂无简介
阅读已结束,如果下载本文需要使用1下载券
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩6页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢 上传我的文档
 下载
 收藏
该文档贡献者很忙,什么也没留下。
 下载此文档
正在努力加载中...
DPI(深度包检测)技术
下载积分:1000
内容提示:DPI(深度包检测)技术
文档格式:DOC|
浏览次数:23|
上传日期: 22:33:04|
文档星级:
该用户还上传了这些文档
DPI(深度包检测)技术
官方公共微信

我要回帖

更多关于 鼠标dpi是什么意思 的文章

 

随机推荐