/* Initializes the expExpressionConf module */ void init_expExpressionConf(void) { init_expr_table_data(); /* * Register config handler for user-level (fixed) expressions... * XXX - TODO */ snmpd_register_config_handler("expression", parse_expression, NULL, NULL); /* * ... and persistent storage of dynamically configured entries. */ snmpd_register_config_handler("_expETable", parse_expETable, NULL, NULL); /* * Register to save (non-fixed) entries when the agent shuts down */ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA, store_expETable, NULL); }
/* Initializes the expExpressionErrorTable module */ void init_expErrorTable(void) { static oid expErrorTable_oid[] = { 1, 3, 6, 1, 2, 1, 90, 1, 2, 2 }; size_t expErrorTable_oid_len = OID_LENGTH(expErrorTable_oid); netsnmp_handler_registration *reg; netsnmp_table_registration_info *table_info; /* * Ensure the expression table container is available... */ init_expr_table_data(); /* * ... then set up the MIB interface to the expExpressionErrorTable slice */ reg = netsnmp_create_handler_registration("expErrorTable", expErrorTable_handler, expErrorTable_oid, expErrorTable_oid_len, HANDLER_CAN_RWRITE); table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info); netsnmp_table_helper_add_indexes(table_info, /* index: expExpressionOwner */ ASN_OCTET_STR, /* index: expExpressionName */ ASN_OCTET_STR, 0); table_info->min_column = COLUMN_EXPERRORTIME; table_info->max_column = COLUMN_EXPERRORINSTANCE; /* Register this using the (common) expr_table_data container */ netsnmp_tdata_register(reg, expr_table_data, table_info); DEBUGMSGTL(("disman:expr:init", "Expression Error Table container (%p)\n", expr_table_data)); }
/** Initialize the expExpression module */ void init_expExpression(void) { init_expr_table_data(); }