⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tcpconnectiontable_interface.c

📁 开发snmp的开发包有两个开放的SNMP开发库
💻 C
📖 第 1 页 / 共 5 页
字号:
/* * Note: this file originally auto-generated by mib2c using *       version : 1.67 $ of : mfd-interface.m2c,v $  * * $Id: tcpConnectionTable_interface.c 15015 2006-08-17 15:06:43Z rstory $ *//* * ********************************************************************* * ********************************************************************* * ********************************************************************* * ***                                                               *** * ***  NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE  *** * ***                                                               *** * ***                                                               *** * ***       THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE.      *** * ***                                                               *** * ***                                                               *** * ***       THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND      *** * ***                                                               *** * ***                                                               *** * ***    IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES.   *** * ***                                                               *** * ***                                                               *** * ********************************************************************* * ********************************************************************* * ********************************************************************* *//* * standard Net-SNMP includes  */#include <net-snmp/net-snmp-config.h>#include <net-snmp/net-snmp-includes.h>#include <net-snmp/agent/net-snmp-agent-includes.h>/* * include our parent header  */#include "tcpConnectionTable.h"#include <net-snmp/agent/table_container.h>#include <net-snmp/library/container.h>#include "tcpConnectionTable_interface.h"#include <ctype.h>/********************************************************************** ********************************************************************** *** *** Table tcpConnectionTable *** ********************************************************************** **********************************************************************//* * TCP-MIB::tcpConnectionTable is subid 19 of tcp. * Its status is Current. * OID: .1.3.6.1.2.1.6.19, length: 8 */typedef struct tcpConnectionTable_interface_ctx_s {    netsnmp_container *container;    netsnmp_cache  *cache;    tcpConnectionTable_registration *user_ctx;    netsnmp_table_registration_info tbl_info;    netsnmp_baby_steps_access_methods access_multiplexer;    u_int           table_dirty;} tcpConnectionTable_interface_ctx;static tcpConnectionTable_interface_ctx tcpConnectionTable_if_ctx;static void                _tcpConnectionTable_container_init(tcpConnectionTable_interface_ctx *                                                   if_ctx);static void                _tcpConnectionTable_container_shutdown(tcpConnectionTable_interface_ctx *                                                       if_ctx);netsnmp_container *tcpConnectionTable_container_get(void){    return tcpConnectionTable_if_ctx.container;}tcpConnectionTable_registration *tcpConnectionTable_registration_get(void){    return tcpConnectionTable_if_ctx.user_ctx;}tcpConnectionTable_registration *tcpConnectionTable_registration_set(tcpConnectionTable_registration *                                    newreg){    tcpConnectionTable_registration *old =        tcpConnectionTable_if_ctx.user_ctx;    tcpConnectionTable_if_ctx.user_ctx = newreg;    return old;}inttcpConnectionTable_container_size(void){    return CONTAINER_SIZE(tcpConnectionTable_if_ctx.container);}u_inttcpConnectionTable_dirty_get(void){    return tcpConnectionTable_if_ctx.table_dirty;}voidtcpConnectionTable_dirty_set(u_int status){    DEBUGMSGTL(("tcpConnectionTable:tcpConnectionTable_dirty_set",                "called. was %d, now %d\n",                tcpConnectionTable_if_ctx.table_dirty, status));    tcpConnectionTable_if_ctx.table_dirty = status;}/* * mfd multiplexer modes */static Netsnmp_Node_Handler _mfd_tcpConnectionTable_pre_request;static Netsnmp_Node_Handler _mfd_tcpConnectionTable_post_request;static Netsnmp_Node_Handler _mfd_tcpConnectionTable_object_lookup;static Netsnmp_Node_Handler _mfd_tcpConnectionTable_get_values;static Netsnmp_Node_Handler _mfd_tcpConnectionTable_check_objects;static Netsnmp_Node_Handler _mfd_tcpConnectionTable_undo_setup;static Netsnmp_Node_Handler _mfd_tcpConnectionTable_set_values;static Netsnmp_Node_Handler _mfd_tcpConnectionTable_undo_cleanup;static Netsnmp_Node_Handler _mfd_tcpConnectionTable_undo_values;static Netsnmp_Node_Handler _mfd_tcpConnectionTable_commit;static Netsnmp_Node_Handler _mfd_tcpConnectionTable_undo_commit;static Netsnmp_Node_Handler _mfd_tcpConnectionTable_irreversible_commit;static Netsnmp_Node_Handler _mfd_tcpConnectionTable_check_dependencies;NETSNMP_STATIC_INLINE int                _tcpConnectionTable_undo_column(tcpConnectionTable_rowreq_ctx * rowreq_ctx,                                                netsnmp_variable_list *                                                var, int column);/** * @internal * Initialize the table tcpConnectionTable  *    (Define its contents and how it's structured) */void_tcpConnectionTable_initialize_interface(tcpConnectionTable_registration *                                         reg_ptr, u_long flags){    netsnmp_baby_steps_access_methods *access_multiplexer =        &tcpConnectionTable_if_ctx.access_multiplexer;    netsnmp_table_registration_info *tbl_info =        &tcpConnectionTable_if_ctx.tbl_info;    netsnmp_handler_registration *reginfo;    netsnmp_mib_handler *handler;    int             mfd_modes = 0;    DEBUGMSGTL(("internal:tcpConnectionTable:_tcpConnectionTable_initialize_interface", "called\n"));    /*************************************************     *     * save interface context for tcpConnectionTable     */    /*     * Setting up the table's definition     */    netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,                                               /** index: tcpConnectionLocalAddressType */                                     ASN_OCTET_STR,                                                 /** index: tcpConnectionLocalAddress */                                     ASN_UNSIGNED,                                                /** index: tcpConnectionLocalPort */                                     ASN_INTEGER,                                               /** index: tcpConnectionRemAddressType */                                     ASN_OCTET_STR,                                                 /** index: tcpConnectionRemAddress */                                     ASN_UNSIGNED,                                                /** index: tcpConnectionRemPort */                                     0);    /*     * Define the minimum and maximum accessible columns.  This     * optimizes retrival.      */    tbl_info->min_column = TCPCONNECTIONTABLE_MIN_COL;    tbl_info->max_column = TCPCONNECTIONTABLE_MAX_COL;    /*     * save users context     */    tcpConnectionTable_if_ctx.user_ctx = reg_ptr;    /*     * call data access initialization code     */    tcpConnectionTable_init_data(reg_ptr);    /*     * set up the container     */    _tcpConnectionTable_container_init(&tcpConnectionTable_if_ctx);    if (NULL == tcpConnectionTable_if_ctx.container) {        snmp_log(LOG_ERR,                 "could not initialize container for tcpConnectionTable\n");        return;    }    /*     * access_multiplexer: REQUIRED wrapper for get request handling     */    access_multiplexer->object_lookup =        _mfd_tcpConnectionTable_object_lookup;    access_multiplexer->get_values = _mfd_tcpConnectionTable_get_values;    /*     * no wrappers yet     */    access_multiplexer->pre_request = _mfd_tcpConnectionTable_pre_request;    access_multiplexer->post_request =        _mfd_tcpConnectionTable_post_request;    /*     * REQUIRED wrappers for set request handling     */    access_multiplexer->object_syntax_checks =        _mfd_tcpConnectionTable_check_objects;    access_multiplexer->undo_setup = _mfd_tcpConnectionTable_undo_setup;    access_multiplexer->undo_cleanup =        _mfd_tcpConnectionTable_undo_cleanup;    access_multiplexer->set_values = _mfd_tcpConnectionTable_set_values;    access_multiplexer->undo_sets = _mfd_tcpConnectionTable_undo_values;    /*     * no wrappers yet     */    access_multiplexer->commit = _mfd_tcpConnectionTable_commit;    access_multiplexer->undo_commit = _mfd_tcpConnectionTable_undo_commit;    access_multiplexer->irreversible_commit =        _mfd_tcpConnectionTable_irreversible_commit;    /*     * REQUIRED for tables with dependencies     */    access_multiplexer->consistency_checks =        _mfd_tcpConnectionTable_check_dependencies;    /*************************************************     *     * Create a registration, save our reg data, register table.     */    DEBUGMSGTL(("tcpConnectionTable:init_tcpConnectionTable",                "Registering tcpConnectionTable as a mibs-for-dummies table.\n"));    handler =        netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);    reginfo =        netsnmp_handler_registration_create("tcpConnectionTable", handler,                                            tcpConnectionTable_oid,                                            tcpConnectionTable_oid_size,                                            HANDLER_CAN_BABY_STEP |                                            HANDLER_CAN_RWRITE);    if (NULL == reginfo) {        snmp_log(LOG_ERR, "error registering table tcpConnectionTable\n");        return;    }    reginfo->my_reg_void = &tcpConnectionTable_if_ctx;    /*************************************************     *     * set up baby steps handler, create it and inject it     */    if (access_multiplexer->object_lookup)        mfd_modes |= BABY_STEP_OBJECT_LOOKUP;    if (access_multiplexer->set_values)        mfd_modes |= BABY_STEP_SET_VALUES;    if (access_multiplexer->irreversible_commit)        mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;    if (access_multiplexer->object_syntax_checks)        mfd_modes |= BABY_STEP_CHECK_OBJECT;    if (access_multiplexer->pre_request)        mfd_modes |= BABY_STEP_PRE_REQUEST;    if (access_multiplexer->post_request)        mfd_modes |= BABY_STEP_POST_REQUEST;    if (access_multiplexer->undo_setup)        mfd_modes |= BABY_STEP_UNDO_SETUP;    if (access_multiplexer->undo_cleanup)        mfd_modes |= BABY_STEP_UNDO_CLEANUP;    if (access_multiplexer->undo_sets)        mfd_modes |= BABY_STEP_UNDO_SETS;    if (access_multiplexer->row_creation)        mfd_modes |= BABY_STEP_ROW_CREATE;    if (access_multiplexer->consistency_checks)        mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;    if (access_multiplexer->commit)        mfd_modes |= BABY_STEP_COMMIT;    if (access_multiplexer->undo_commit)        mfd_modes |= BABY_STEP_UNDO_COMMIT;    handler = netsnmp_baby_steps_handler_get(mfd_modes);    netsnmp_inject_handler(reginfo, handler);    /*************************************************     *     * inject row_merge helper with prefix rootoid_len + 2 (entry.col)     */    handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);    netsnmp_inject_handler(reginfo, handler);    /*************************************************     *     * inject container_table helper     */    handler =        netsnmp_container_table_handler_get(tbl_info,                                            tcpConnectionTable_if_ctx.                                            container,                                            TABLE_CONTAINER_KEY_NETSNMP_INDEX);    netsnmp_inject_handler(reginfo, handler);    /*************************************************     *     * inject cache helper     */    if (NULL != tcpConnectionTable_if_ctx.cache) {        handler =            netsnmp_cache_handler_get(tcpConnectionTable_if_ctx.cache);        netsnmp_inject_handler(reginfo, handler);    }    /*     * register table     */    netsnmp_register_table(reginfo, tbl_info);}                               /* _tcpConnectionTable_initialize_interface *//** * @internal * Shutdown the table tcpConnectionTable */void_tcpConnectionTable_shutdown_interface(tcpConnectionTable_registration *                                       reg_ptr){    /*

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -