📄 mibif.c
字号:
#include "VxWorks.h"
#include "sockLib.h"
#include "inetLib.h"
#include "taskLib.h"
#include "stdioLib.h"
#include "strLib.h"
#include "ioLib.h"
#include "fioLib.h"
#include "snmp.h"
#include "Mib2Func.h"
//0x2b,6,1,2,1,2,x
int InterfaceGetVar(VARLIST *pVar)
{
U32 u32Index;
U32 u32GetIndex;
MibFuncPara para;
switch(pVar->oid[6])
{
case 1://IFNUMBER:
u32GetIndex = g_MFIndex.IF.Get.Number_______ps32GetValue;
pVar->type = TAG_INTERGER;
break;
case 2://IFTABLE:
if(pVar->oid[7] == 1)
{
u32Index = pVar->oid[8];
if (22 < u32Index || u32Index == 0)
{
return ERROR;
}
if (u32Index == 2 || u32Index == 6)
{//ifDescr | ifPhyAddress
pVar->type = TAG_OCTET;
}
else
{//Other
pVar->type = TAG_INTERGER;
}
u32GetIndex = g_MFIndex.IF.Get.Index_________ps32GetValue +\
u32Index - 1;
}
break;
default:
return ERROR;
}
if (OK != Mib2GetOne(u32GetIndex, ¶))
{
return ERROR;
}
return Mib2Get(pVar, ¶);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -