void mib_initialize_table_ipRouteTable(void) { oid ipRouteTable_oid[] = {1,3,6,1,2,1,4,21}; const size_t ipRouteTable_oid_len = OID_LENGTH(ipRouteTable_oid); netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; reg = netsnmp_create_handler_registration( "ipRouteTable", mib_ipRouteTable_handler, ipRouteTable_oid, ipRouteTable_oid_len, HANDLER_CAN_RWRITE ); table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info ); netsnmp_table_helper_add_indexes(table_info, ASN_IPADDRESS, 0); table_info->min_column = COLUMN_IPROUTEDEST; table_info->max_column = COLUMN_IPROUTEINFO; iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info ); iinfo->get_first_data_point = mib_ipRouteTable_get_first; iinfo->get_next_data_point = mib_ipRouteTable_get_next; iinfo->table_reginfo = table_info; netsnmp_register_table_iterator( reg, iinfo ); }
/******************************************************************************* 函数名称 : mib_initialize_table_historyControlTable 功能描述 : 表historyControlTable的初始化函数 输入参数 : 无 输出参数 : 无 返 回 值 : 无 -------------------------------------------------------------------------------- 最近一次修改记录 : 修改作者 : 修改目的 : 修改日期 : *******************************************************************************/ void mib_initialize_table_historyControlTable(void) { oid historyControlTable_oid[] = {1,3,6,1,2,1,16,2,1}; const size_t historyControlTable_oid_len = OID_LENGTH(historyControlTable_oid); netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; reg = netsnmp_create_handler_registration( "historyControlTable", mib_historyControlTable_handler, historyControlTable_oid, historyControlTable_oid_len, HANDLER_CAN_RWRITE ); table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info ); netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: historyControlIndex */ 0); table_info->min_column = COLUMN_HISTORYCONTROLINDEX; table_info->max_column = COLUMN_HISTORYCONTROLSTATUS; iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info ); iinfo->get_first_data_point = mib_historyControlTable_get_first; iinfo->get_next_data_point = mib_historyControlTable_get_next; iinfo->table_reginfo = table_info; netsnmp_register_table_iterator( reg, iinfo ); /* Conplat TODO: Initialise the contents of the table here */ }
/** Initialize the raidSetTable table by defining its contents and how it's structured */ void initialize_table_raidSetTable(void) { static oid raidSetTable_oid[] = {1,3,6,1,4,1,20038,2,1,6,2}; size_t raidSetTable_oid_len = OID_LENGTH(raidSetTable_oid); netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; reg = netsnmp_create_handler_registration( "raidSetTable", raidSetTable_handler, raidSetTable_oid, raidSetTable_oid_len, HANDLER_CAN_RONLY ); table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info ); netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: raidSetIndex */ 0); table_info->min_column = COLUMN_RAIDSETNAME; table_info->max_column = COLUMN_RAIDSETCOMMENTS; iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info ); iinfo->get_first_data_point = raidSetTable_get_first_data_point; iinfo->get_next_data_point = raidSetTable_get_next_data_point; iinfo->table_reginfo = table_info; netsnmp_register_table_iterator( reg, iinfo ); /* Initialise the contents of the table here */ update_setlist(); }
/** Initialize the dot118021xSecurityTable table by defining its contents and how it's structured */ void initialize_table_dot118021xSecurityTable(void) { static oid dot118021xSecurityTable_oid[128] = {0}; size_t dot118021xSecurityTable_oid_len = 0; mad_dev_oid(dot118021xSecurityTable_oid,DOT118021XTABLE,&dot118021xSecurityTable_oid_len,enterprise_pvivate_oid); netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; reg = netsnmp_create_handler_registration( "dot118021xSecurityTable", dot118021xSecurityTable_handler, dot118021xSecurityTable_oid, dot118021xSecurityTable_oid_len, HANDLER_CAN_RWRITE ); table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info ); netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: security8021xIndex */ 0); table_info->min_column = SECURITY802MIN; table_info->max_column = SECURITY802MAX; iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info ); iinfo->get_first_data_point = dot118021xSecurityTable_get_first_data_point; iinfo->get_next_data_point = dot118021xSecurityTable_get_next_data_point; iinfo->table_reginfo = table_info; netsnmp_register_table_iterator( reg, iinfo ); /* Initialise the contents of the table here */ }
/** Initialize the dot11QosWirelessTable table by defining its contents and how it's structured */ void initialize_table_dot11QosWirelessTable(void) { static oid dot11QosWirelessTable_oid[128] = {0}; size_t dot11QosWirelessTable_oid_len = 0; mad_dev_oid(dot11QosWirelessTable_oid,QOSWIRELESSTABLE,&dot11QosWirelessTable_oid_len,enterprise_pvivate_oid); netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; reg = netsnmp_create_handler_registration( "dot11QosWirelessTable", dot11QosWirelessTable_handler, dot11QosWirelessTable_oid, dot11QosWirelessTable_oid_len, HANDLER_CAN_RWRITE ); table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info ); netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: globalWtpID */ ASN_INTEGER, /* index: RadioLocalID */ ASN_INTEGER, /* index: QosType */ 0); table_info->min_column = QOSWIRELESSMIN; table_info->max_column = QOSWIRELESSMAX; iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info ); iinfo->get_first_data_point = dot11QosWirelessTable_get_first_data_point; iinfo->get_next_data_point = dot11QosWirelessTable_get_next_data_point; iinfo->table_reginfo = table_info; netsnmp_register_table_iterator( reg, iinfo ); netsnmp_inject_handler(reg,netsnmp_get_cache_handler(DOT1DTPFDBTABLE_CACHE_TIMEOUT,dot11QosWirelessTable_load, dot11QosWirelessTable_removeEntry,dot11QosWirelessTable_oid, dot11QosWirelessTable_oid_len)); /* Initialise the contents of the table here */ }
/** Initialize the xsanNodeTable table by defining its contents and how it's structured */ void initialize_table_xsanNodeTable(void) { static oid xsanNodeTable_oid[] = {1,3,6,1,4,1,20038,2,1,1,3}; size_t xsanNodeTable_oid_len = OID_LENGTH(xsanNodeTable_oid); netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; reg = netsnmp_create_handler_registration( "xsanNodeTable", xsanNodeTable_handler, xsanNodeTable_oid, xsanNodeTable_oid_len, HANDLER_CAN_RONLY ); table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info ); netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: xsanVolumeIndex */ ASN_INTEGER, /* index: xsanStripeGroupIndex */ ASN_INTEGER, /* index: xsanNodeIndex */ 0); table_info->min_column = COLUMN_XSANNODEINDEX; table_info->max_column = COLUMN_XSANNODESIZE; iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info ); iinfo->get_first_data_point = xsanNodeTable_get_first_data_point; iinfo->get_next_data_point = xsanNodeTable_get_next_data_point; iinfo->table_reginfo = table_info; netsnmp_register_table_iterator( reg, iinfo ); update_node_list(); update_node_list_detail(); }
/** Initialize the xsanAffinityTable table by defining its contents and how it's structured */ void initialize_table_xsanAffinityTable(void) { static oid xsanAffinityTable_oid[] = {1,3,6,1,4,1,20038,2,1,1,4}; size_t xsanAffinityTable_oid_len = OID_LENGTH(xsanAffinityTable_oid); netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; reg = netsnmp_create_handler_registration( "xsanAffinityTable", xsanAffinityTable_handler, xsanAffinityTable_oid, xsanAffinityTable_oid_len, HANDLER_CAN_RONLY ); table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info ); netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: xsanVolumeIndex */ ASN_INTEGER, /* index: xsanAffinityIndex */ 0); table_info->min_column = COLUMN_XSANAFFINITYINDEX; table_info->max_column = COLUMN_XSANAFFINITYUSEDMBYTES; iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info ); iinfo->get_first_data_point = xsanAffinityTable_get_first_data_point; iinfo->get_next_data_point = xsanAffinityTable_get_next_data_point; iinfo->table_reginfo = table_info; netsnmp_register_table_iterator( reg, iinfo ); /* Initialise the contents of the table here */ update_affinities(); }
/** Initialize the vmCpuTable table by defining its contents and how it's structured */ void initialize_table_vmCpuTable(void) { const oid vmCpuTable_oid[] = {1,3,6,1,2,1,VM_MIB_OID,1,5}; const size_t vmCpuTable_oid_len = OID_LENGTH(vmCpuTable_oid); netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; DEBUGMSGTL(("vmCpuTable:init", "initializing table vmCpuTable\n")); reg = netsnmp_create_handler_registration( "vmCpuTable", vmCpuTable_handler, vmCpuTable_oid, vmCpuTable_oid_len, HANDLER_CAN_RONLY ); table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info ); netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: vmIndex */ ASN_INTEGER, /* index: vmCpuIndex */ 0); table_info->min_column = COLUMN_VMCPUINDEX; table_info->max_column = COLUMN_VMCPUCORETIME; iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info ); iinfo->get_first_data_point = vmCpuTable_get_first_data_point; iinfo->get_next_data_point = vmCpuTable_get_next_data_point; iinfo->table_reginfo = table_info; netsnmp_register_table_iterator( reg, iinfo ); /* Initialise the contents of the table here */ }
/******************************************************************************* 函数名称 : mib_initialize_table_dot1qPortVlanTable 功能描述 : 表dot1qPortVlanTable的初始化函数 输入参数 : 无 输出参数 : 无 返 回 值 : 无 -------------------------------------------------------------------------------- 最近一次修改记录 : 修改作者 : 修改目的 : 修改日期 : *******************************************************************************/ void mib_initialize_table_dot1qPortVlanTable(void) { oid dot1qPortVlanTable_oid[] = {1,3,6,1,2,1,17,7,1,4,5}; const size_t dot1qPortVlanTable_oid_len = OID_LENGTH(dot1qPortVlanTable_oid); netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; reg = netsnmp_create_handler_registration( "dot1qPortVlanTable", mib_dot1qPortVlanTable_handler, dot1qPortVlanTable_oid, dot1qPortVlanTable_oid_len, HANDLER_CAN_RWRITE ); table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info ); netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: ifIndex */ 0); table_info->min_column = COLUMN_DOT1QPVID; table_info->max_column = COLUMN_DOT1QPORTGVRPLASTPDUORIGIN; iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info ); iinfo->get_first_data_point = mib_dot1qPortVlanTable_get_first; iinfo->get_next_data_point = mib_dot1qPortVlanTable_get_next; iinfo->table_reginfo = table_info; netsnmp_register_table_iterator( reg, iinfo ); /* Conplat TODO: Initialise the contents of the table here */ }
/** Initialize the qosObjectTable table by defining its contents and how it's structured */ void initialize_table_qosObjectTable(void) { static oid qosObjectTable_oid[] = { 1, 3, 6, 1, 4, 1, 18756, 1 }; netsnmp_table_registration_info *table_info; netsnmp_handler_registration *my_handler; netsnmp_iterator_info *iinfo; /** create the table registration information structures */ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info); /** if your table is read only, it's easiest to change the HANDLER_CAN_RWRITE definition below to HANDLER_CAN_RONLY */ my_handler = netsnmp_create_handler_registration("qosObjectTable", qosObjectTable_handler, qosObjectTable_oid, OID_LENGTH (qosObjectTable_oid), HANDLER_CAN_RWRITE); if (!my_handler || !table_info || !iinfo) { snmp_log(LOG_ERR, "malloc failed in initialize_table_qosObjectTable"); return; /** Serious error. */ } /*************************************************** * Setting up the table's definition */ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /** index: qosDeviceType */ ASN_INTEGER, /** index: qosDeviceIndex */ ASN_UNSIGNED, /** index: qosMajorHandle */ ASN_UNSIGNED, /* index: qosMinorHandle */ 0); /** Define the minimum and maximum accessible columns. This optimizes retrival. */ table_info->min_column = 1; table_info->max_column = 35; /** iterator access routines */ iinfo->get_first_data_point = qosObjectTable_get_first_data_point; iinfo->get_next_data_point = qosObjectTable_get_next_data_point; /** tie the two structures together */ iinfo->table_reginfo = table_info; /*************************************************** * registering the table with the master agent */ DEBUGMSGTL(("initialize_table_qosObjectTable", "Registering table qosObjectTable as a table iterator\n")); netsnmp_register_table_iterator(my_handler, iinfo); }
/** Initialize the pcapFilterTable table by defining its contents and how it's structured */ void initialize_table_pcapFilterTable(void) { static oid pcapFilterTable_oid[] = {1,3,6,1,4,1,8072,2,3000,2,1}; netsnmp_handler_registration *my_handler = NULL; netsnmp_table_registration_info *table_info = NULL; netsnmp_iterator_info *iinfo = NULL; table_info = SNMP_MALLOC_TYPEDEF (netsnmp_table_registration_info); iinfo = SNMP_MALLOC_TYPEDEF (netsnmp_iterator_info); my_handler = netsnmp_create_handler_registration ( "pcapFilterTable", pcapFilterTable_handler, pcapFilterTable_oid, OID_LENGTH (pcapFilterTable_oid), HANDLER_CAN_RONLY ); if (!my_handler || !table_info || !iinfo) return; netsnmp_table_helper_add_indexes (table_info, ASN_INTEGER, 0); table_info->min_column = COLUMN_IFDESCR; table_info->max_column = COLUMN_FLTTERMINAL; iinfo->get_first_data_point = pcapFilterTable_getFirst; iinfo->get_next_data_point = pcapFilterTable_getNext; iinfo->table_reginfo = table_info; netsnmp_register_table_iterator (my_handler, iinfo); }
/** Initialize the dot11WtpWirelessCapStatTable table by defining its contents and how it's structured */ void initialize_table_dot11WtpWirelessCapStatTable(void) { static oid dot11WtpWirelessCapStatTable_oid[128] = {0}; size_t dot11WtpWirelessCapStatTable_oid_len = 0; mad_dev_oid(dot11WtpWirelessCapStatTable_oid,WTPCAPSTATTABLE,&dot11WtpWirelessCapStatTable_oid_len,enterprise_pvivate_oid); netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; reg = netsnmp_create_handler_registration( "dot11WtpWirelessCapStatTable", dot11WtpWirelessCapStatTable_handler, dot11WtpWirelessCapStatTable_oid, dot11WtpWirelessCapStatTable_oid_len, HANDLER_CAN_RONLY ); table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info ); netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR, /* index: wtpMacAddr */ ASN_INTEGER, /* index: wtpWirelessIfIndex */ 0); table_info->min_column = WTPCAPSTATTABLE_MIN_COLUMN; table_info->max_column = WTPCAPSTATTABLE_MAX_COLUMN; iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info ); iinfo->get_first_data_point = dot11WtpWirelessCapStatTable_get_first_data_point; iinfo->get_next_data_point = dot11WtpWirelessCapStatTable_get_next_data_point; iinfo->table_reginfo = table_info; netsnmp_register_table_iterator( reg, iinfo ); netsnmp_inject_handler(reg,netsnmp_get_cache_handler(DOT1DTPFDBTABLE_CACHE_TIMEOUT,dot11WtpWirelessCapStatTable_load, dot11WtpWirelessCapStatTable_removeEntry,dot11WtpWirelessCapStatTable_oid, dot11WtpWirelessCapStatTable_oid_len)); /* Initialise the contents of the table here */ }
void mib_initialize_table_dot1dBasePortTable(void) { oid dot1dBasePortTable_oid[] = {1,3,6,1,2,1,17,1,4}; const size_t dot1dBasePortTable_oid_len = OID_LENGTH(dot1dBasePortTable_oid); netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; reg = netsnmp_create_handler_registration( "dot1dBasePortTable", mib_dot1dBasePortTable_handler, dot1dBasePortTable_oid, dot1dBasePortTable_oid_len, HANDLER_CAN_RONLY ); table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info ); netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, 0); table_info->min_column = COLUMN_DOT1DBASEPORT; table_info->max_column = COLUMN_DOT1DBASEPORTMTUEXCEEDEDDISCARDS; iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info ); iinfo->get_first_data_point = mib_dot1dBasePortTable_get_first; iinfo->get_next_data_point = mib_dot1dBasePortTable_get_next; iinfo->table_reginfo = table_info; netsnmp_register_table_iterator( reg, iinfo ); }
/** Initializes the expValueTable module */ void init_expValueTable(void) { static oid expValueTable_oid[] = { 1, 3, 6, 1, 2, 1, 90, 1, 3, 1 }; size_t expValueTable_oid_len = OID_LENGTH(expValueTable_oid); netsnmp_handler_registration *reg; netsnmp_table_registration_info *table_info; reg = netsnmp_create_handler_registration("expValueTable", expValueTable_handler, expValueTable_oid, expValueTable_oid_len, HANDLER_CAN_RONLY); table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR, /* expExpressionOwner */ ASN_OCTET_STR, /* expExpressionName */ /* expValueInstance */ ASN_PRIV_IMPLIED_OBJECT_ID, 0); table_info->min_column = COLUMN_EXPVALUECOUNTER32VAL; table_info->max_column = COLUMN_EXPVALUECOUNTER64VAL; netsnmp_register_table(reg, table_info); DEBUGMSGTL(("disman:expr:init", "Expression Value Table\n")); }
/** Initializes the schedTable module */ void init_schedTable(void) { static oid schedTable_oid[] = { 1, 3, 6, 1, 2, 1, 63, 1, 2 }; size_t schedTable_oid_len = OID_LENGTH(schedTable_oid); netsnmp_handler_registration *reg; netsnmp_table_registration_info *table_info; DEBUGMSGTL(("disman:schedule:init", "Initializing table\n")); /* * Ensure the schedule table container is available... */ init_schedule_container(); /* * ... then set up the MIB interface. */ reg = netsnmp_create_handler_registration("schedTable", schedTable_handler, schedTable_oid, schedTable_oid_len, HANDLER_CAN_RWRITE); table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR, /* index: schedOwner */ ASN_OCTET_STR, /* index: schedName */ 0); table_info->min_column = COLUMN_SCHEDDESCR; table_info->max_column = COLUMN_SCHEDTRIGGERS; netsnmp_tdata_register(reg, schedule_table, table_info); }
/** initialize neIeee8021QBridgeVlanCurrentTable table mapper **/ void neIeee8021QBridgeVlanCurrentTable_init (void) { extern oid neIeee8021QBridgeVlanCurrentTable_oid[]; netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; reg = netsnmp_create_handler_registration ( "neIeee8021QBridgeVlanCurrentTable", &neIeee8021QBridgeVlanCurrentTable_mapper, neIeee8021QBridgeVlanCurrentTable_oid, OID_LENGTH (neIeee8021QBridgeVlanCurrentTable_oid), HANDLER_CAN_RWRITE ); table_info = xBuffer_cAlloc (sizeof (netsnmp_table_registration_info)); netsnmp_table_helper_add_indexes (table_info, ASN_TIMETICKS /* index: ieee8021QBridgeVlanTimeMark */, ASN_UNSIGNED /* index: ieee8021QBridgeVlanCurrentComponentId */, ASN_UNSIGNED /* index: ieee8021QBridgeVlanIndex */, 0); table_info->min_column = NEIEEE8021QBRIDGEVLANCURRENTADMINFLAGS; table_info->max_column = NEIEEE8021QBRIDGEVLANCURRENTIFINDEX; iinfo = xBuffer_cAlloc (sizeof (netsnmp_iterator_info)); iinfo->get_first_data_point = &neIeee8021QBridgeVlanCurrentTable_getFirst; iinfo->get_next_data_point = &neIeee8021QBridgeVlanCurrentTable_getNext; iinfo->get_data_point = &neIeee8021QBridgeVlanCurrentTable_get; iinfo->table_reginfo = table_info; iinfo->flags |= NETSNMP_ITERATOR_FLAG_SORTED; netsnmp_register_table_iterator (reg, iinfo); /* Initialise the contents of the table here */ }
/** initialize neIeee8021BridgeBaseTable table mapper **/ void neIeee8021BridgeBaseTable_init (void) { extern oid neIeee8021BridgeBaseTable_oid[]; netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; reg = netsnmp_create_handler_registration ( "neIeee8021BridgeBaseTable", &neIeee8021BridgeBaseTable_mapper, neIeee8021BridgeBaseTable_oid, OID_LENGTH (neIeee8021BridgeBaseTable_oid), HANDLER_CAN_RWRITE ); table_info = xBuffer_cAlloc (sizeof (netsnmp_table_registration_info)); netsnmp_table_helper_add_indexes (table_info, ASN_UNSIGNED /* index: ieee8021BridgeBaseComponentId */, 0); table_info->min_column = NEIEEE8021BRIDGEBASECHASSISID; table_info->max_column = NEIEEE8021BRIDGEBASEOPERSTATE; iinfo = xBuffer_cAlloc (sizeof (netsnmp_iterator_info)); iinfo->get_first_data_point = &neIeee8021BridgeBaseTable_getFirst; iinfo->get_next_data_point = &neIeee8021BridgeBaseTable_getNext; iinfo->get_data_point = &neIeee8021BridgeBaseTable_get; iinfo->table_reginfo = table_info; iinfo->flags |= NETSNMP_ITERATOR_FLAG_SORTED; netsnmp_register_table_iterator (reg, iinfo); /* Initialise the contents of the table here */ }
/** Initialize the dot11WtpKeyConfigTable table by defining its contents and how it's structured */ void initialize_table_dot11WtpKeyConfigTable(void) { static oid dot11WtpKeyConfigTable_oid[128] = {0}; size_t dot11WtpKeyConfigTable_oid_len = 0; mad_dev_oid(dot11WtpKeyConfigTable_oid,WTPKEYCONFIGTABLE,&dot11WtpKeyConfigTable_oid_len,enterprise_pvivate_oid); netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; reg = netsnmp_create_handler_registration( "dot11WtpKeyConfigTable", dot11WtpKeyConfigTable_handler, dot11WtpKeyConfigTable_oid, dot11WtpKeyConfigTable_oid_len, HANDLER_CAN_RWRITE ); table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info ); netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: CipherKeyIndex */ 0); table_info->min_column = WTPKEYCONFMIN; table_info->max_column = WTPKEYCONFMAX; iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info ); iinfo->get_first_data_point = dot11WtpKeyConfigTable_get_first_data_point; iinfo->get_next_data_point = dot11WtpKeyConfigTable_get_next_data_point; iinfo->table_reginfo = table_info; netsnmp_register_table_iterator( reg, iinfo ); netsnmp_inject_handler(reg,netsnmp_get_cache_handler(DOT1DTPFDBTABLE_CACHE_TIMEOUT,dot11WtpKeyConfigTable_load, dot11WtpKeyConfigTable_removeEntry, dot11WtpKeyConfigTable_oid, dot11WtpKeyConfigTable_oid_len)); /* Initialise the contents of the table here */ }
/** Initialize the netSnmpHostsTable table by defining its contents and how it's structured */ void initialize_table_netSnmpHostsTable(void) { static oid netSnmpHostsTable_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 2, 2, 2 }; netsnmp_table_registration_info *table_info; netsnmp_handler_registration *my_handler; netsnmp_iterator_info *iinfo; /** create the table registration information structures */ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info); /** if your table is read only, it's easiest to change the HANDLER_CAN_RWRITE definition below to HANDLER_CAN_RONLY */ my_handler = netsnmp_create_handler_registration("netSnmpHostsTable", netSnmpHostsTable_handler, netSnmpHostsTable_oid, OID_LENGTH (netSnmpHostsTable_oid), HANDLER_CAN_RWRITE); if (!my_handler || !table_info || !iinfo) { snmp_log(LOG_ERR, "malloc failed in initialize_table_netSnmpHostsTable"); return; /** Serious error. */ } /*************************************************** * Setting up the table's definition */ netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR, /** index: netSnmpHostName */ 0); /** Define the minimum and maximum accessible columns. This optimizes retrieval. */ table_info->min_column = 2; table_info->max_column = 5; /** iterator access routines */ iinfo->get_first_data_point = netSnmpHostsTable_get_first_data_point; iinfo->get_next_data_point = netSnmpHostsTable_get_next_data_point; /** you may wish to set these as well */ iinfo->make_data_context = netSnmpHostsTable_context_convert_function; iinfo->free_data_context = netSnmpHostsTable_data_free; iinfo->free_loop_context_at_end = netSnmpHostsTable_loop_free; /** tie the two structures together */ iinfo->table_reginfo = table_info; /*************************************************** * registering the table with the master agent */ DEBUGMSGTL(("initialize_table_netSnmpHostsTable", "Registering table netSnmpHostsTable as a table iterator\n")); netsnmp_register_table_iterator2(my_handler, iinfo); }
/** Initialize the nsModuleTable table by defining it's contents and how it's structured */ void initialize_table_nsModuleTable(void) { const oid nsModuleTable_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 2, 1 }; netsnmp_table_registration_info *table_info; netsnmp_handler_registration *my_handler; netsnmp_iterator_info *iinfo; /* * create the table structure itself */ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info); /* * if your table is read only, it's easiest to change the * HANDLER_CAN_RWRITE definition below to HANDLER_CAN_RONLY */ my_handler = netsnmp_create_handler_registration("nsModuleTable", nsModuleTable_handler, nsModuleTable_oid, OID_LENGTH (nsModuleTable_oid), HANDLER_CAN_RWRITE); if (!my_handler || !table_info || !iinfo) { if (my_handler) netsnmp_handler_registration_free(my_handler); SNMP_FREE(table_info); SNMP_FREE(iinfo); return; /* mallocs failed */ } /*************************************************** * Setting up the table's definition */ netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR, /* context name */ ASN_OBJECT_ID, /* reg point */ ASN_INTEGER, /* priority */ 0); table_info->min_column = 4; table_info->max_column = 6; /* * iterator access routines */ iinfo->get_first_data_point = nsModuleTable_get_first_data_point; iinfo->get_next_data_point = nsModuleTable_get_next_data_point; iinfo->free_loop_context_at_end = nsModuleTable_free; iinfo->table_reginfo = table_info; /*************************************************** * registering the table with the master agent */ DEBUGMSGTL(("initialize_table_nsModuleTable", "Registering table nsModuleTable as a table iterator\n")); netsnmp_register_table_iterator(my_handler, iinfo); }
void init_nsCache(void) { netsnmp_table_registration_info *table_info; netsnmp_iterator_info *iinfo; /* * Register the scalar objects... */ DEBUGMSGTL(("nsCacheScalars", "Initializing\n")); netsnmp_register_scalar( netsnmp_create_handler_registration( "nsCacheTimeout", handle_nsCacheTimeout, nsCacheTimeout_oid, OID_LENGTH(nsCacheTimeout_oid), HANDLER_CAN_RWRITE) ); netsnmp_register_scalar( netsnmp_create_handler_registration( "nsCacheEnabled", handle_nsCacheEnabled, nsCacheEnabled_oid, OID_LENGTH(nsCacheEnabled_oid), HANDLER_CAN_RWRITE) ); /* * ... and the table. * We need to define the column structure and indexing.... */ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); if (!table_info) { return; } netsnmp_table_helper_add_indexes(table_info, ASN_PRIV_IMPLIED_OBJECT_ID, 0); table_info->min_column = NSCACHE_TIMEOUT; table_info->max_column = NSCACHE_STATUS; /* * .... and the iteration information .... */ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info); if (!iinfo) { return; } iinfo->get_first_data_point = get_first_cache_entry; iinfo->get_next_data_point = get_next_cache_entry; iinfo->table_reginfo = table_info; /* * .... and register the table with the agent. */ netsnmp_register_table_iterator( netsnmp_create_handler_registration( "tzCacheTable", handle_nsCacheTable, nsCacheTable_oid, OID_LENGTH(nsCacheTable_oid), HANDLER_CAN_RWRITE), iinfo); }
void init_tcpTable(void) { netsnmp_table_registration_info *table_info; netsnmp_iterator_info *iinfo; netsnmp_handler_registration *reginfo; DEBUGMSGTL(("mibII/tcpTable", "Initialising TCP Table\n")); /* * Create the table data structure, and define the indexing.... */ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); if (!table_info) { return; } netsnmp_table_helper_add_indexes(table_info, ASN_IPADDRESS, ASN_INTEGER, ASN_IPADDRESS, ASN_INTEGER, 0); table_info->min_column = TCPCONNSTATE; table_info->max_column = TCPCONNREMOTEPORT; /* * .... and iteration information .... */ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info); if (!iinfo) { return; } iinfo->get_first_data_point = tcpTable_first_entry; iinfo->get_next_data_point = tcpTable_next_entry; iinfo->table_reginfo = table_info; #if defined(WIN32) || defined(solaris2) iinfo->flags |= NETSNMP_ITERATOR_FLAG_SORTED; #endif /* WIN32 || solaris2 */ /* * .... and register the table with the agent. */ reginfo = netsnmp_create_handler_registration("tcpTable", tcpTable_handler, tcpTable_oid, OID_LENGTH(tcpTable_oid), HANDLER_CAN_RONLY), netsnmp_register_table_iterator(reginfo, iinfo); /* * .... with a local cache * (except for Solaris, which uses a different approach) */ netsnmp_inject_handler( reginfo, netsnmp_get_cache_handler(TCP_STATS_CACHE_TIMEOUT, tcpTable_load, tcpTable_free, tcpTable_oid, OID_LENGTH(tcpTable_oid))); }
/* * Initialize the swRaidTable table by defining its contents and how it's structured */ void initialize_table_swRaidTable(void) { static oid swRaidTable_oid[] = { SWRAIDTABLE_OID }; netsnmp_table_registration_info *table_info; netsnmp_handler_registration *my_handler; netsnmp_iterator_info *iinfo; /* * create the table registration information structures */ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info); my_handler = netsnmp_create_handler_registration("swRaidTable", swRaidTable_handler, swRaidTable_oid, OID_LENGTH (swRaidTable_oid), HANDLER_CAN_RONLY); if (!my_handler || !table_info || !iinfo) { snmp_log(LOG_ERR, "malloc failed in initialize_table_swRaidTable"); return; } /* * setup the table's definition */ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, 0); /* * Define the minimum and maximum accessible columns. This * optimizes retrival. */ table_info->min_column = SWRAIDTABLE_MIN_COL; table_info->max_column = SWRAIDTABLE_MAX_COL; /* * iterator access routines */ iinfo->get_first_data_point = swRaidTable_get_first_data_point; iinfo->get_next_data_point = swRaidTable_get_next_data_point; /* * tie the two structures together */ iinfo->table_reginfo = table_info; /* * registering the table with the master agent */ netsnmp_register_table_iterator(my_handler, iinfo); }
void init_udpTable(void) { netsnmp_table_registration_info *table_info; netsnmp_iterator_info *iinfo; netsnmp_handler_registration *reginfo; DEBUGMSGTL(("mibII/udpTable", "Initialising UDP Table\n")); /* * Create the table data structure, and define the indexing.... */ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); if (!table_info) { return; } netsnmp_table_helper_add_indexes(table_info, ASN_IPADDRESS, ASN_INTEGER, 0); table_info->min_column = UDPLOCALADDRESS; table_info->max_column = UDPLOCALPORT; /* * .... and iteration information .... */ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info); if (!iinfo) { return; } iinfo->get_first_data_point = udpTable_first_entry; iinfo->get_next_data_point = udpTable_next_entry; iinfo->table_reginfo = table_info; #if defined (WIN32) || defined (cygwin) iinfo->flags |= NETSNMP_ITERATOR_FLAG_SORTED; #endif /* WIN32 || cygwin */ /* * .... and register the table with the agent. */ reginfo = netsnmp_create_handler_registration("udpTable", udpTable_handler, udpTable_oid, OID_LENGTH(udpTable_oid), HANDLER_CAN_RONLY), netsnmp_register_table_iterator(reginfo, iinfo); /* * .... with a local cache */ netsnmp_inject_handler( reginfo, netsnmp_get_cache_handler(UDP_STATS_CACHE_TIMEOUT, udpTable_load, udpTable_free, udpTable_oid, OID_LENGTH(udpTable_oid))); }
/** Initializes the nsVacmAccessTable module */ void init_register_nsVacm_context(const char *context) { /* * Initialize the nsVacmAccessTable table by defining its * contents and how it's structured */ const oid nsVacmAccessTable_oid[] = { 1,3,6,1,4,1,8072,1,9,1 }; netsnmp_handler_registration *reg; netsnmp_iterator_info *iinfo; netsnmp_table_registration_info *table_info; #ifndef NETSNMP_NO_WRITE_SUPPORT reg = netsnmp_create_handler_registration( "nsVacmAccessTable", nsVacmAccessTable_handler, nsVacmAccessTable_oid, OID_LENGTH(nsVacmAccessTable_oid), HANDLER_CAN_RWRITE); #else /* !NETSNMP_NO_WRITE_SUPPORT */ reg = netsnmp_create_handler_registration( "nsVacmAccessTable", nsVacmAccessTable_handler, nsVacmAccessTable_oid, OID_LENGTH(nsVacmAccessTable_oid), HANDLER_CAN_RONLY); #endif /* !NETSNMP_NO_WRITE_SUPPORT */ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR, /* index: vacmGroupName */ ASN_OCTET_STR, /* index: vacmAccessContextPrefix */ ASN_INTEGER, /* index: vacmAccessSecurityModel */ ASN_INTEGER, /* index: vacmAccessSecurityLevel */ ASN_OCTET_STR, /* index: nsVacmAuthType */ 0); table_info->min_column = COLUMN_NSVACMCONTEXTMATCH; table_info->max_column = COLUMN_NSVACMACCESSSTATUS; iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info); iinfo->get_first_data_point = nsVacmAccessTable_get_first_data_point; iinfo->get_next_data_point = nsVacmAccessTable_get_next_data_point; iinfo->table_reginfo = table_info; if ( context && context[0] ) reg->contextName = strdup(context); netsnmp_register_table_iterator2(reg, iinfo); }
void init_nsLogging(void) { netsnmp_table_registration_info *table_info; netsnmp_iterator_info *iinfo; const oid nsLoggingTable_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 7, 2, 1}; /* * Register the table. * We need to define the column structure and indexing.... */ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); if (!table_info) { return; } netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, ASN_PRIV_IMPLIED_OCTET_STR, 0); table_info->min_column = NSLOGGING_TYPE; table_info->max_column = NSLOGGING_STATUS; /* * .... and the iteration information .... */ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info); if (!iinfo) { return; } iinfo->get_first_data_point = get_first_logging_entry; iinfo->get_next_data_point = get_next_logging_entry; iinfo->table_reginfo = table_info; /* * .... and register the table with the agent. */ netsnmp_register_table_iterator2( netsnmp_create_handler_registration( "tzLoggingTable", handle_nsLoggingTable, nsLoggingTable_oid, OID_LENGTH(nsLoggingTable_oid), HANDLER_CAN_RWRITE), iinfo); }
/* Initializes the mteEventTable module */ void init_mteEventTable(void) { static oid mteEventTable_oid[] = { 1, 3, 6, 1, 2, 1, 88, 1, 4, 2 }; size_t mteEventTable_oid_len = OID_LENGTH(mteEventTable_oid); netsnmp_handler_registration *reg; /* * Ensure the (combined) table container is available... */ init_event_table_data(); /* * ... then set up the MIB interface to the mteEventTable slice */ #ifndef NETSNMP_NO_WRITE_SUPPORT reg = netsnmp_create_handler_registration("mteEventTable", mteEventTable_handler, mteEventTable_oid, mteEventTable_oid_len, HANDLER_CAN_RWRITE); #else /* !NETSNMP_NO_WRITE_SUPPORT */ reg = netsnmp_create_handler_registration("mteEventTable", mteEventTable_handler, mteEventTable_oid, mteEventTable_oid_len, HANDLER_CAN_RONLY); #endif /* !NETSNMP_NO_WRITE_SUPPORT */ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR, /* index: mteOwner */ /* index: mteEventName */ ASN_PRIV_IMPLIED_OCTET_STR, 0); table_info->min_column = COLUMN_MTEEVENTCOMMENT; table_info->max_column = COLUMN_MTEEVENTENTRYSTATUS; /* Register this using the (common) event_table_data container */ netsnmp_tdata_register(reg, event_table_data, table_info); DEBUGMSGTL(("disman:event:init", "Event Table container (%p)\n", event_table_data)); }
/** Initializes the mteTriggerThresholdTable module */ void init_mteTriggerThresholdTable(void) { static oid mteTThreshTable_oid[] = { 1, 3, 6, 1, 2, 1, 88, 1, 2, 6 }; size_t mteTThreshTable_oid_len = OID_LENGTH(mteTThreshTable_oid); netsnmp_handler_registration *reg; /* * Ensure the (combined) table container is available... */ init_trigger_table_data(); /* * ... then set up the MIB interface to the mteTriggerThresholdTable slice */ #ifndef NETSNMP_NO_WRITE_SUPPORT reg = netsnmp_create_handler_registration("mteTriggerThresholdTable", mteTriggerThresholdTable_handler, mteTThreshTable_oid, mteTThreshTable_oid_len, HANDLER_CAN_RWRITE); #else /* !NETSNMP_NO_WRITE_SUPPORT */ reg = netsnmp_create_handler_registration("mteTriggerThresholdTable", mteTriggerThresholdTable_handler, mteTThreshTable_oid, mteTThreshTable_oid_len, HANDLER_CAN_RONLY); #endif /* !NETSNMP_NO_WRITE_SUPPORT */ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR, /* index: mteOwner */ /* index: mteTriggerName */ ASN_PRIV_IMPLIED_OCTET_STR, 0); table_info->min_column = COLUMN_MTETRIGGERTHRESHOLDSTARTUP; table_info->max_column = COLUMN_MTETRIGGERTHRESHOLDDELTAFALLINGEVENT; /* Register this using the (common) trigger_table_data container */ netsnmp_tdata_register(reg, trigger_table_data, table_info); DEBUGMSGTL(("disman:event:init", "Trigger Threshold Table\n")); }
/** Initializes the mteObjectsTable module */ void init_mteObjectsTable(void) { static oid mteObjectsTable_oid[] = { 1, 3, 6, 1, 2, 1, 88, 1, 3, 1 }; size_t mteObjectsTable_oid_len = OID_LENGTH(mteObjectsTable_oid); netsnmp_handler_registration *reg; /* * Ensure the object table container is available... */ init_objects_table_data(); /* * ... then set up the MIB interface to this table */ #ifndef NETSNMP_NO_WRITE_SUPPORT reg = netsnmp_create_handler_registration("mteObjectsTable", mteObjectsTable_handler, mteObjectsTable_oid, mteObjectsTable_oid_len, HANDLER_CAN_RWRITE); #else /* !NETSNMP_NO_WRITE_SUPPORT */ reg = netsnmp_create_handler_registration("mteObjectsTable", mteObjectsTable_handler, mteObjectsTable_oid, mteObjectsTable_oid_len, HANDLER_CAN_RONLY); #endif /* !NETSNMP_NO_WRITE_SUPPORT */ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR, /* index: mteOwner */ ASN_OCTET_STR, /* index: mteObjectsName */ ASN_UNSIGNED, /* index: mteObjectsIndex */ 0); table_info->min_column = COLUMN_MTEOBJECTSID; table_info->max_column = COLUMN_MTEOBJECTSENTRYSTATUS; netsnmp_tdata_register(reg, objects_table_data, table_info); }
void init_subagent(switch_memory_pool_t *pool) { static oid identity_oid[] = { 1,3,6,1,4,1,27880,1,1 }; static oid systemStats_oid[] = { 1,3,6,1,4,1,27880,1,2 }; static oid channelList_oid[] = { 1,3,6,1,4,1,27880,1,9 }; DEBUGMSGTL(("init_subagent", "mod_snmp subagent initializing\n")); netsnmp_register_scalar_group(netsnmp_create_handler_registration("identity", handle_identity, identity_oid, OID_LENGTH(identity_oid), HANDLER_CAN_RONLY), 1, 2); netsnmp_register_scalar_group(netsnmp_create_handler_registration("systemStats", handle_systemStats, systemStats_oid, OID_LENGTH(systemStats_oid), HANDLER_CAN_RONLY), 1, 11); ch_table_info = switch_core_alloc(pool, sizeof(netsnmp_table_registration_info)); netsnmp_table_helper_add_indexes(ch_table_info, ASN_INTEGER, 0); ch_table_info->min_column = CH_INDEX; ch_table_info->max_column = CH_WRITE_BITRATE; ch_table = netsnmp_tdata_create_table("channelList", 0); ch_reginfo = netsnmp_create_handler_registration("channelList", handle_channelList, channelList_oid, OID_LENGTH(channelList_oid), HANDLER_CAN_RONLY); netsnmp_tdata_register(ch_reginfo, ch_table, ch_table_info); netsnmp_inject_handler(ch_reginfo, netsnmp_get_cache_handler(5, channelList_load, channelList_free, channelList_oid, OID_LENGTH(channelList_oid))); }