?? mibfunc.h
字號:
#ifndef _H_MIB
#define _H_MIB
/****************************************
注意事項:
最后一個參數(shù)為index時,index指明多個同類設(shè)備之一,
假設(shè)有三網(wǎng)卡,index指定第幾個網(wǎng)卡。
index == 0 為缺省設(shè)備,第一設(shè)備。
若函數(shù)帶index參數(shù),
首先判斷:
if(index > 實際設(shè)備數(shù)目)
return Error_Index(2)
函數(shù)名帶get_前綴
1.參數(shù)類型為<< *temp >>的函數(shù)
if ( 取值成功 )
(*temp) = 系統(tǒng)相應(yīng)值
return OK
els
return ERROR
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
2.參數(shù)類型為<< buf,*cbNeeded,*cbUsed >>
if((*cbNeeded) < 實際buf大小)
(*cbNeeded) = 需要的buf大小
return ERROR_NeedMoreBuf(3)
else if( 取值成功 )
memcpy(buf,eeprom,(*cbNeeded))
(*cbUsed) = (*cbNeeded)
return OK
else
return ERROR
函數(shù)名帶set_前綴
1.參數(shù)為<< temp >>,直接將相應(yīng)系統(tǒng)參數(shù)改為傳入?yún)?shù)
if 數(shù)值合法 & 賦值成功
return OK
else
return ERROR
2.參數(shù)類型為<< buf,size >>,作用為寫入內(nèi)存或EEPROM
if(size > 256) size = 256
memcpy(eeprom,buf,size)
return OK
if 寫入失敗
return ERROR
**************************************************/
/////////Priner MIB專用MIB庫//////////////////////////
/*
int get_startSeries
int get_startSWVersion
int get_startTonerLevel
int get_startInputNumber
int get_startInputIndex
int get_startInputStatus
int get_startInputPaper
int get_startLEDNumber
int get_startLEDIndex
int get_startLEDStatus
int get_startLCDStatus
int get_startLCDMsg
int get_startPrtStatus
int get_startLPTNumber
int get_startLPTIndex
int get_startLPTStatus
int get_startLPTJobInfo
int get_StartLPTMode
int get_startLPTManage
int get_startLPTTimeout
int get_startLPTMemo
int get_startUSBNumber
int get_startUSBIndex
int get_startUSBStatus
int get_startUSBJobInfo
int get_startPrtOffline
int get_startPrtReboot
*/
/////////系統(tǒng) system MIB接口函數(shù)/////////////////////
int get_sysUpTime(unsigned long *temp);
int get_sysService(unsigned long *temp);
int get_sysDescr(char *buf,int *cbNeeded,int *cbUsed);
int get_sysContact(char *buf,int *cbNeeded,int *cbUsed);
int set_sysContact(char *buf,int size);
int get_sysName(char *buf,int *cbNeeded,int *cbUsed);
int set_sysName(char *buf,int size);
int get_sysLocation(char *buf,int *cbNeeded,int *cbUsed);
int set_sysLocation(char *buf,int size);
/////////接口 Interface MIB接口函數(shù)//////////////////
int get_ifDescr(char *buf,int *cbNeeded,int *cbUsed);
int get_ifPhyAddress(char *buf,int *cbNeeded,int *cbUsed);
int set_ifPhyAddress(char *buf,int size);
int get_ifNumber(long *temp); //有幾個設(shè)備
int get_ifType(long *temp,int index);
int get_ifMtu(long *temp,int index);
int get_ifSpeed(long *temp,int index);
int get_ifAdminStatus(long *temp,int index);
int get_ifOperStatus(long *temp,int index);
int get_ifLastChange(long *temp,int index);
int get_ifInOctets(long *temp,int index);
int get_ifInUcastPkts(long *temp,int index);
int get_ifInNUcastPkts(long *temp,int index);
int get_ifInDiscards(long *temp,int index);
int get_ifInErrors(long *temp,int index);
int get_ifInUnknownProto(long *temp,int index);
int get_ifInOutOctets(long *temp,int index);
int get_ifOutUcastPkts(long *temp,int index);
int get_ifOutNUcastPkts(long *temp,int index);
int get_ifOutDiscards(long *temp,int index);
int get_ifOutErrors(long *temp,int index);
int get_ifOutQLen(long *temp,int index);
int get_ifSpecific(long *temp,int index);
/////////IP MIB 接口函數(shù)////////////////////
int get_ipForwarding(long *temp);
int set_ipForwarding(long temp);
int get_ipDefaultTTL(long *temp);
int set_ipDefaultTTL(long temp);
int get_ipInReceives(long *temp);
int get_ipInHdrErrors(long *temp);
int get_ipInAddrErrors(long *temp);
int get_ipForwDatagrams(long *temp);
int get_ipInUnknownProtos(long *temp);
int get_ipInDiscards(long *temp);
int get_ipInDelivers(long *temp);
int get_ipOutRequests(long *temp);
int get_ipOutDiscards(long *temp);
int get_ipOutNoRoutes(long *temp);
int get_ipReasmTimeout(long *temp);
int get_ipReasmReqds(long *temp);
int get_ipReasmOKs(long *temp);
int get_ipReasmFails(long *temp);
int get_ipFragOKs(long *temp);
int get_ipFragFails(long *temp);
int get_ipFragCreates(long *temp);
int get_ipAdEntAddr(char *buf,int *cbNeeded,int *cbUsed);
int get_ipAdEntIfIndex(long *temp);//本IP層對應(yīng)的唯一的網(wǎng)絡(luò)設(shè)備
int get_ipAdEntNetMask(char *buf,int *cbNeeded,int *cbUsed);
int get_ipAdEntBcastAddr(long *temp);
int get_ipAdEntReasmMaxSize(long *temp);
int get_ipRouteDest(char *buf,int *cbNeeded,int *cbUsed);
int set_ipRouteDest(char *buf,int size);
int get_ipRouteIfIndex(long *temp);
int set_ipRouteIfIndex(long temp);
int get_ipRouteMetric1(long *temp,int index);
int set_ipRouteMetric1(long temp,int index);
int get_ipRouteMetric2(long *temp,int index);
int set_ipRouteMetric2(long temp,int index);
int get_ipRouteMetric3(long *temp,int index);
int set_ipRouteMetric3(long temp,int index);
int get_ipRouteMetric4(long *temp,int index);
int set_ipRouteMetric4(long temp,int index);
int get_ipRouteNextHop(char *buf,int *cbNeeded,int *cbUsed,int index);
int set_ipRouteNextHop(char *buf,int size,int index);
int get_ipRouteType(long *temp,int index);
int set_ipRouteType(long temp,int index);
int get_ipRouteProto(long *temp,int index);
int set_ipRouteProto(long temp,int index);
int get_ipRouteAge(long *temp,int index);
int set_ipRouteAge(long temp,int index);
int get_ipRouteMask(char *buf,int *cbNeeded,int *cbUsed,int index);
int set_ipRouteMask(char *buf,int size,int index);
int get_ipRouteMetric5(long *temp,int index);
int set_ipRouteMetric5(long temp,int index);
int get_ipNetToMediaIfIndex(long *temp);
int get_ipNetToMediaPhysAddress(char *buf,int *cbNeeded,int *cbUsed,int index);
int set_ipNetToMediaPhysAddress(char *buf,int size,int index);
int get_ipNetToMediaNetAddress(char *buf,int *cbNeeded,int *cbUsed,int index);
int set_ipNetToMediaNetAddress(char *buf,int size,int index);
int get_ipNetToMediaType(long *temp,int index);
int set_ipNetToMediaType(long temp,int index);
int get_ipRoutingDiscards(long *temp,int index);
///////ICMP MIB接口函數(shù)/////////////////////////////
int get_IcmpInMsgs(long *temp);
int get_icmpInErrors(long *temp);
int get_icmpInDestUnreachs(long *temp);
int get_icmpInTimeExcds(long *temp);
int get_icmpInParmProbs(long *temp);
int get_icmpInSrcQeunchs(long *temp);
int get_icmpInRedirects(long *temp);
int get_icmpInEchos(long *temp);
int get_icmpInEchoReps(long *temp);
int get_icmpInTimestamps(long *temp);
int get_icmpInTimestampReps(long *temp);
int get_icmpInAddrMasks(long *temp);
int get_icmpInAddrMaskReps(long *temp);
int get_icmpOutMsgs(long *temp);
int get_icmpOutErrors(long *temp);
int get_icmpOutDestUnreachs(long *temp);
int get_icmpOutTimeExcds(long *temp);
int get_icmpOutParmProbs(long *temp);
int get_icmpOutSrcQuenchs(long *temp);
int get_icmpOutRedirects(long *temp);
int get_icmpOutEchos(long *temp);
int get_icmpOutEchoReps(long *temp);
int get_icmpOutTimestamps(long *temp);
int get_icmpOutTimestampReps(long *temp);
int get_icmpOutAddrMasks(long *temp);
int get_icmpOutAddrMaskReps(long *temp);
///////TCP MIB 接口函數(shù)////////////////////////////
int get_tcpRtoAlgorithm(long *temp);
int get_tcpRtoMin(long *temp);
int get_tcpRtoMax(long *temp);
int get_tcpMaxConn(long *temp);
int get_tcpActiveOpens(long *temp);
int get_tcpPassiveOpens(long *temp);
int get_tcpAttemptFails(long *temp);
int get_tcpEstabResets(long *temp);
int get_tcpCurrEstab(long *temp);
int get_tcpInSegs(long *temp);
int get_tcpOutSegs(long *temp);
int get_tcpRetransSegs(long *temp);
int get_tcpConnState(long *temp);
int get_tcpConnLocalAddress(char *buf,int *cbNeeded,int *cbUsed);
int get_tcpConnLocalPort(long *temp);
int get_tcpConnRemAddress(char *buf,int *cbNeeded,int *cbUsed);
int get_tcpConnRemPort(long *temp);
int get_tcpOutRsts(long *temp);
int get_tcpInErrs(long *temp);
///////UDP MIB 接口函數(shù)////////////////////////////
int get_udpInDatagrams(long *temp);
int get_udpNoPorts(long *temp);
int get_udpInErrors(long *temp);
int get_udpOutDatagrams(long *temp);
int get_udpLocalAddress(char *buf,int *cbNeeded,int *cbUsed);
int get_udpLocalPort(long *temp);
#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -