⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mibsystem.c

📁 VxWorks操作系统下的SNMP协议以及MIB协议的实现源码,并且实现了HP标准打印类的MIB框架.
💻 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,1,x
int  SystemGetVar(VARLIST *pVar)
{	
	U32		u32Index	= pVar->oid[6];
	U32		u32GetIndex	= g_MFIndex.System.Get.Descript_pcBuf_s32BufSize_ps32Used +\
						  u32Index - 1;
	MibFuncPara para;
	
	if (7 < u32Index || u32Index == 0)
	{
		return ERROR;
	}
	
	switch (u32Index)
	{
		case 3:
		case 7:
			pVar->type = TAG_INTERGER;
			break;
		default:
			pVar->type = TAG_OCTET;
	}

	if (OK != Mib2GetOne(u32GetIndex, &para))
	{
		return ERROR;
	}

	return Mib2Get(pVar, &para);
}


int  SystemSetVar(VARLIST *pVar)
{
	U32	u32Index = pVar->oid[6];
	U32	u32SetIndex;

	switch(u32Index)
	{
		case 1://SYS_DESCRIBE:
		case 2://SYS_VERSIONID:
		case 3://SYS_UPTIME:
		case 7://SYS_SERVICES:
			return PDU_READONLY;;
		case 4://SYS_CONTACT:
			u32SetIndex = g_MFIndex.System.Set.Contact__pcBuf_s32BufSize;
			break;
		case 5://SYS_NAME:
			u32SetIndex = g_MFIndex.System.Set.Name_____pcBuf_s32BufSize;
			break;
		case 6://SYS_LOCATION:
			u32SetIndex = g_MFIndex.System.Set.Location_pcBuf_s32BufSize;
			break;
		default:
			return PDU_NOSUCHNAME;			
	}
	
	
	return Mib2Set(pVar, u32SetIndex);
			
;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -