📄 iftable.h
字号:
/* * Note: this file originally auto-generated by mib2c using * version : 1.48 $ of : mfd-top.m2c,v $ * * $Id: ifTable.h 15461 2006-10-19 20:38:00Z hardaker $ */#ifndef IFTABLE_H#define IFTABLE_H#ifdef __cplusplusextern "C" {#endif/** @ingroup agent * @defgroup misc misc: Miscellaneous routines * * @{ */#include <net-snmp/library/asn1.h>#include <net-snmp/data_access/interface.h> /* * other required module components */ /* *INDENT-OFF* */config_require(if-mib/data_access/interface)config_require(if-mib/ifTable/ifTable_interface)config_require(if-mib/ifTable/ifTable_data_access)/* * conflicts with mibII/interfaces */config_exclude(mibII/interfaces) /* *INDENT-ON* */ /* * OID, column number and enum definions for ifTable */#include "ifTable_constants.h" /* ********************************************************************* * function declarations */ void init_ifTable(void); void shutdown_ifTable(void); /* ********************************************************************* * Table declarations *//********************************************************************** ********************************************************************** *** *** Table ifTable *** ********************************************************************** **********************************************************************/ /* * IF-MIB::ifTable is subid 2 of interfaces. * Its status is Current. * OID: .1.3.6.1.2.1.2.2, length: 8 */ /* ********************************************************************* * When you register your mib, you get to provide a generic * pointer that will be passed back to you for most of the * functions calls. * * TODO:100:r: Review all context structures */ /* * TODO:101:o: |-> Review ifTable registration context. */ typedef netsnmp_data_list ifTable_registration;/**********************************************************************/ /* * TODO:110:r: |-> Review ifTable data context structure. * This structure is used to represent the data for ifTable. */ /* * This structure contains storage for all the columns defined in the * ifTable. */ typedef struct ifTable_data_s { /* * ifDescr(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */ /* * ifType(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */ /* * ifMtu(4)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */ /* * ifSpeed(5)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifPhysAddress(6)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h */ /* * ifAdminStatus(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ /* * ifOperStatus(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */ /* * ifLastChange(9)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifInOctets(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifInUcastPkts(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifInNUcastPkts(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifInDiscards(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifInErrors(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifInUnknownProtos(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifOutOctets(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifOutUcastPkts(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifOutNUcastPkts(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifOutDiscards(19)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifOutErrors(20)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifOutQLen(21)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifSpecific(22)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h */#ifdef IFTABLE_HAS_IFSPECIFIC oid ifSpecific[128]; size_t ifSpecific_len; /* # of oid elements, not bytes */#endif#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE /* * ifXTable stuff */ /* * ifName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */ /* * ifInMulticastPkts(2)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifInBroadcastPkts(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifOutMulticastPkts(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifOutBroadcastPkts(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ /* * ifHCInUcastPkts(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ /* * ifHCInMulticastPkts(8)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ /* * ifHCInBroadcastPkts(9)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ /* * ifHCOutOctets(10)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ /* * ifHCOutUcastPkts(11)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ /* * ifHCOutMulticastPkts(12)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ /* * ifHCOutBroadcastPkts(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ /* * ifLinkUpDownTrapEnable(14)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ u_long ifLinkUpDownTrapEnable; /* * ifHighSpeed(15)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h */ /* * ifPromiscuousMode(16)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ /* * ifConnectorPresent(17)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */ /* * ifAlias(18)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */ char ifAlias[64]; size_t ifAlias_len; /* # of char elements, not bytes */ /* * ifCounterDiscontinuityTime(19)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifCounterDiscontinuityTime;#endif /* USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE */ /* * some data kept externally */ netsnmp_interface_entry *ifentry; } ifTable_data; /* ********************************************************************* * TODO:115:o: |-> Review ifTable undo context. * We're just going to use the same data structure for our * undo_context. If you want to do something more efficent, * define your typedef here. */ typedef ifTable_data ifTable_undo_data; /* * TODO:120:r: |-> Review ifTable mib index. * This structure is used to represent the index for ifTable. */ typedef struct ifTable_mib_index_s { /* * ifIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H */ long ifIndex; } ifTable_mib_index; /* * TODO:121:r: | |-> Review ifTable max index length. * If you KNOW that your indexes will never exceed a certain * length, update this macro to that length. */#define MAX_ifTable_IDX_LEN 1 /* ********************************************************************* * TODO:130:o: |-> Review ifTable Row request (rowreq) context. * When your functions are called, you will be passed a * ifTable_rowreq_ctx pointer. */ typedef struct ifTable_rowreq_ctx_s { /** this must be first for container compare to work */ netsnmp_index oid_idx; oid oid_tmp[MAX_ifTable_IDX_LEN]; ifTable_mib_index tbl_idx; ifTable_data data; ifTable_undo_data *undo; unsigned int column_set_flags; /* flags for set columns */ /* * flags per row. Currently, the first (lower) 8 bits are reserved * for the user. See mfd.h for other flags. */ u_int rowreq_flags; /* * TODO:131:o: | |-> Add useful data to ifTable rowreq context. */ char known_missing; u_char undo_ref_count; /* * storage for future expansion */ netsnmp_data_list *ifTable_data_list; } ifTable_rowreq_ctx; typedef struct ifTable_ref_rowreq_ctx_s { ifTable_rowreq_ctx *rowreq_ctx; } ifTable_ref_rowreq_ctx; /*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -