/* * Note: this file originally auto-generated by mib2c using * version : 1.24 $ of : mfd-top.m2c,v $ * * $Id$ */ #ifndef IFTABLE_H #define IFTABLE_H #ifdef __cplusplus extern "C" { #endif /** @defgroup misc misc: Miscelaneous routines * * @{ */ #include /* * other required module components */ /* *INDENT-OFF* */ config_require(ifTable_interface); config_require(ifTable_data_access); config_require(ifTable_data_get); config_require(ifTable_data_set); /* *INDENT-ON* */ /* * OID and column number definitions for */ #include "ifTable_oids.h" /* * enum definions */ #include "ifTable_enums.h" /* ********************************************************************* * function declarations */ void init_ifTable(void); /* ********************************************************************* * Table declarations */ /********************************************************************** ********************************************************************** *** *** Table ifTable *** ********************************************************************** **********************************************************************/ /* * ifTable is subid 2 of interfaces. * It's 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. */ typedef netsnmp_data_list *ifTable_registration_ptr; /**********************************************************************/ /* * data context */ /* * 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 */ char ifDescr[255]; size_t ifDescr_len; /* # of char elements, not bytes */ /* * ifType(3)/IANAifType/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */ u_long ifType; /* * ifMtu(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */ long ifMtu; /* * ifSpeed(5)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifSpeed; /* * ifPhysAddress(6)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/H */ char ifPhysAddress[65535]; size_t ifPhysAddress_len; /* # of char elements, not bytes */ /* * ifAdminStatus(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ u_long ifAdminStatus; /* * ifOperStatus(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */ u_long ifOperStatus; /* * ifLastChange(9)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifLastChange; /* * ifInOctets(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifInOctets; /* * ifInUcastPkts(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifInUcastPkts; /* * ifInNUcastPkts(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifInNUcastPkts; /* * ifInDiscards(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifInDiscards; /* * ifInErrors(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifInErrors; /* * ifInUnknownProtos(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifInUnknownProtos; /* * ifOutOctets(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifOutOctets; /* * ifOutUcastPkts(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifOutUcastPkts; /* * ifOutNUcastPkts(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifOutNUcastPkts; /* * ifOutDiscards(19)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifOutDiscards; /* * ifOutErrors(20)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifOutErrors; /* * ifOutQLen(21)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h */ u_long ifOutQLen; /* * ifSpecific(22)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h */ oid ifSpecific[128]; size_t ifSpecific_len; /* # of oid elements, not bytes */ } ifTable_data; /* ********************************************************************* * 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; /* * This structure is used to represent the index for a table. */ 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; /* ********************************************************************* * Row request 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_OID_LEN]; /* xxx-rks: shrink this */ ifTable_mib_index tbl_idx; ifTable_data data; ifTable_undo_data *undo; unsigned int set_flags; /** implementor's context pointer provided during registration */ ifTable_registration_ptr ifTable_reg; /* * TODO: * add any other useful data * (e.g. flags for when a column has been set) */ /* * 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; /* ********************************************************************* * function prototypes */ int ifTable_pre_request(ifTable_registration_ptr user_context); int ifTable_post_request(ifTable_registration_ptr user_context); int ifTable_check_dependencies(ifTable_rowreq_ctx * rowreq_ctx); int ifTable_commit(ifTable_rowreq_ctx * rowreq_ctx); extern oid ifTable_oid[]; extern int ifTable_oid_size; #include "ifTable_interface.h" #include "ifTable_data_access.h" #include "ifTable_data_get.h" #include "ifTable_data_set.h" #ifndef MFD_SUCCESS #define MFD_SUCCESS SNMP_ERR_NOERROR #define MFD_SKIP SNMP_NOSUCHINSTANCE #define MFD_ERROR SNMP_ERR_GENERR #define MFD_RESOURCE_UNAVAILABLE SNMP_ERR_RESOURCEUNAVAILABLE #define MFD_NOT_VALID_NOW SNMP_ERR_INCONSISTENTVALUE #define MFD_NOT_VALID_EVER SNMP_ERR_WRONGVALUE #define MFD_CANNOT_CREATE_NOW SNMP_ERR_INCONSISTENTNAME #define MFD_CANNOT_CREATE_EVER SNMP_ERR_NOCREATION #define MFD_END_OF_DATA SNMP_ENDOFMIBVIEW #endif #ifdef __cplusplus }; #endif #endif /* IFTABLE_H */