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

📄 mibtcp.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,6,x
int  TcpGetVar(VARLIST *pVar)
{
	U32		u32Index;
	U32		u32GetFirstIndex;
	U32		u32GetIndex;

	MibFuncPara para;

	switch(pVar->oid[6])
	{
		case 1://TcpRtoAlgorithm:
		case 2://TcpRtoMin
		case 3://TcpRtoMax
		case 4://TcpMaxConn
		case 5://TcpActiveOpens
		case 6://TcpPassiveOpens
		case 7://TcpAttemptFails
		case 8://TcpEstabResets
		case 9://TcpCurrEstab
		case 10://TcpInSegs
		case 11://TcpOutSegs
		case 12://TcpRetransSegs
		case 14://TcpInErrs
		case 15://TcpOutRsts
			u32Index = pVar->oid[6];
			u32GetFirstIndex	= g_MFIndex.TCP.Get.RtoAlgorithm_____ps32GetValue;
			u32GetIndex = u32GetFirstIndex + u32Index - 1;				
			pVar->type = TAG_INTERGER;
			break;
			
		case 13://TcpConnTable:
			if(pVar->oid[7] == 1)
			{
				u32Index = pVar->oid[8];
				u32GetFirstIndex	= g_MFIndex.TCP.Get.ConnState________ps32GetValue;
				u32GetIndex = u32GetFirstIndex + u32Index - 1;				

				switch(pVar->oid[8])
				{
					case 1://TcpConnState
					case 3://TcpConnLocalPort
					case 5://TcpConnRemPort
						pVar->type = TAG_INTERGER;
						break;
						
					case 2://TcpConnLocalAddress
					case 4://TcpConnRemAddress
						pVar->type = TAG_OCTET;
						break;
						
					default:
						return ERROR;
				}
			}
			break;
			
		default:
			return ERROR;
	}

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

	return Mib2Get(pVar, &para);
}

⌨️ 快捷键说明

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