mib.h
资源名称:SNMP范例源代码.zip [点击查看]
上传用户:shgx688
上传日期:2009-12-27
资源大小:855k
文件大小:2k
源码类别:
SNMP编程
开发平台:
MultiPlatform
- /*******************************************************************************
- * mib - <one-line description of header file's purpose>
- *
- * DESCRIPTION:
- * <a more verbose description of header file's purpose>
- *
- * SEE_ALSO:
- * <optional, cross reference to other modules or documentation>
- *
- * NOMANUAL <this will be removed later>
- */
- #ifndef _MIB_H
- #define _MIB_H
- #define MIB_READ IDB_SNMP_MIB_READ
- #define MIB_WRITE IDB_SNMP_MIB_WRITE
- #define READ_ONLY 0
- #define READ_WRITE 1
- typedef struct mib_element_s {
- ul32 Id[SNMP_SIZE_SMALLOBJECTID];
- u16 IdLen;
- u32 Rqs;
- u16 Type;
- u16 Support;
- } mib_element_t;
- /*
- typedef struct mib_community_s {
- u8 Comm[SNMP_SIZE_COMM];
- u16 CommLen;
- u16 Support;
- } mib_community_t;
- */
- typedef struct mib_object_s {
- ul32 Id[28];
- u16 IdLen;
- u32 Rqs;
- u16 Type;
- u16 Support;
- } mib_object_t;
- // local data structure.
- #define MAX_MOUDLE_NUM 16
- typedef struct system_s {
- u8 sysDescr[SNMP_SIZE_BUFCHR];
- u32 sysObjectID[SNMP_SIZE_BUFCHR];
- u32 sysUpTime;
- u8 sysContact[SNMP_SIZE_BUFCHR];
- u8 sysName[SNMP_SIZE_BUFCHR];
- u8 sysLocation[SNMP_SIZE_BUFCHR];
- l32 sysServices;
- } system_t;
- typedef struct snmp_s {
- l32 snmpInPkts;
- l32 snmpInBadVersions;
- l32 snmpInBadCommunityUses;
- l32 snmpInASNParseErrs;
- u16 snmpEnableAuthenTraps;
- l32 snmpSilentDrops;
- l32 snmpProxyDrops;
- } snmp_t;
- typedef struct txfxDevice_s {
- u16 txfxDevSoftwareVersion;
- u16 txfxDeviceType;
- u16 txfxDeviceHardwareVersion;
- l32 txfxDeviceModuleNum;
- } txfxDevice_t;
- typedef struct txfxModule_s {
- u16 txfxModuleType;
- l32 txfxModuleTimeElapsed;
- u16 txfxModuleAdminStatus;
- u16 txfxModuleHardwareVer;
- u16 txfxModuleSlot;
- u16 txfxModuleOpertionalStatus;
- u16 txfxModuleOnOff;
- u16 txfxModuleCapicity;
- u16 txfxModuleLinkAlt;
- u16 txfxModuleTxMode;
- u16 txfxModuleState;
- } txfxModule_t;
- u16 MibRequest(u32 listLen, snmp_object_t *list, u16 *errindex);
- int MibInit(mib_element_t *Obj, u16 ObjSze);/* initialized the MIB tree*/
- void MibObjectInit();
- #endif