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

📄 ipv4interfacetable.c

📁 开发snmp的开发包有两个开放的SNMP开发库
💻 C
📖 第 1 页 / 共 3 页
字号:
/* * Note: this file originally auto-generated by mib2c using *       version : 1.48 $ of : mfd-top.m2c,v $  * * $Id: ipv4InterfaceTable.c 14169 2006-01-25 16:28:12Z dts12 $ *//** \page MFD helper for ipv4InterfaceTable * * \section intro Introduction * Introductory text. * *//* * 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 "ipv4InterfaceTable.h"#include <net-snmp/agent/mib_modules.h>#include "ipv4InterfaceTable_interface.h"oid             ipv4InterfaceTable_oid[] = { IPV4INTERFACETABLE_OID };int             ipv4InterfaceTable_oid_size =OID_LENGTH(ipv4InterfaceTable_oid);ipv4InterfaceTable_registration ipv4InterfaceTable_user_context;void            initialize_table_ipv4InterfaceTable(void);void            shutdown_table_ipv4InterfaceTable(void);/** * Initializes the ipv4InterfaceTable module */voidinit_ipv4InterfaceTable(void){    DEBUGMSGTL(("verbose:ipv4InterfaceTable:init_ipv4InterfaceTable",                "called\n"));    /*     * TODO:300:o: Perform ipv4InterfaceTable one-time module initialization.     */    /*     * we depend on the ifTable, so we put our init in with it     * to guarantee order of execution.     */    init_ifTable();    /*     * last changed should be 0 at startup     */    ipv4InterfaceTable_lastChange_set(0);}                               /* init_ipv4InterfaceTable *//** * Shut-down the ipv4InterfaceTable module (agent is exiting) */voidshutdown_ipv4InterfaceTable(void){    if (should_init("ipv4InterfaceTable"))        shutdown_table_ipv4InterfaceTable();}/** * Initialize the table ipv4InterfaceTable  *    (Define its contents and how it's structured) */voidinitialize_table_ipv4InterfaceTable(void){    ipv4InterfaceTable_registration *user_context;    u_long          flags;    DEBUGMSGTL(("verbose:ipv4InterfaceTable:initialize_table_ipv4InterfaceTable", "called\n"));    /*     * TODO:301:o: Perform ipv4InterfaceTable one-time table initialization.     */    /*     * TODO:302:o: |->Initialize ipv4InterfaceTable user context     * if you'd like to pass in a pointer to some data for this     * table, allocate or set it up here.     */    /*     * a netsnmp_data_list is a simple way to store void pointers. A simple     * string token is used to add, find or remove pointers.     */    user_context =        netsnmp_create_data_list("ipv4InterfaceTable", NULL, NULL);    /*     * No support for any flags yet, but in the future you would     * set any flags here.     */    flags = 0;    /*     * call interface initialization code     */    _ipv4InterfaceTable_initialize_interface(user_context, flags);}                               /* initialize_table_ipv4InterfaceTable *//** * Shutdown the table ipv4InterfaceTable  */voidshutdown_table_ipv4InterfaceTable(void){    /*     * call interface shutdown code     */    _ipv4InterfaceTable_shutdown_interface        (&ipv4InterfaceTable_user_context);}/** * extra context initialization (eg default values) * * @param rowreq_ctx    : row request context * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate) * * @retval MFD_SUCCESS  : no errors * @retval MFD_ERROR    : error (context allocate will fail) */intipv4InterfaceTable_rowreq_ctx_init(ipv4InterfaceTable_rowreq_ctx *                                   rowreq_ctx, void *user_init_ctx){    DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_rowreq_ctx_init", "called\n"));    netsnmp_assert(NULL != rowreq_ctx);    /*     * TODO:210:o: |-> Perform extra ipv4InterfaceTable rowreq initialization. (eg DEFVALS)     */    rowreq_ctx->data.ipv4InterfaceRetransmitTime = 1000;    return MFD_SUCCESS;}                               /* ipv4InterfaceTable_rowreq_ctx_init *//** * extra context cleanup * @param rowreq_ctx * */voidipv4InterfaceTable_rowreq_ctx_cleanup(ipv4InterfaceTable_rowreq_ctx *                                      rowreq_ctx){    DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_rowreq_ctx_cleanup", "called\n"));    netsnmp_assert(NULL != rowreq_ctx);    /*     * TODO:211:o: |-> Perform extra ipv4InterfaceTable rowreq cleanup.     */}                               /* ipv4InterfaceTable_rowreq_ctx_cleanup *//** * pre-request callback * * @param user_context * * @retval MFD_SUCCESS              : success. * @retval MFD_ERROR                : other error */intipv4InterfaceTable_pre_request(ipv4InterfaceTable_registration *                               user_context){    DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_pre_request", "called\n"));    /*     * TODO:510:o: Perform ipv4InterfaceTable pre-request actions.     */    return MFD_SUCCESS;}                               /* ipv4InterfaceTable_pre_request *//** * post-request callback * * Note: *   New rows have been inserted into the container, and *   deleted rows have been removed from the container and *   released. * * @param user_context * @param rc : MFD_SUCCESS if all requests succeeded * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR   : other error (ignored) */intipv4InterfaceTable_post_request(ipv4InterfaceTable_registration *                                user_context, int rc){    DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_post_request", "called\n"));    /*     * TODO:511:o: Perform ipv4InterfaceTable post-request actions.     */    /*     * check to set if any rows were changed.     */    if (ipv4InterfaceTable_dirty_get()) {        /*         * check if request was successful. If so, this would be         * a good place to save data to its persistent store.         */        if (MFD_SUCCESS == rc) {            /*             * save changed rows, if you haven't already             */        }        ipv4InterfaceTable_dirty_set(0);        /* clear table dirty flag */    }    return MFD_SUCCESS;}                               /* ipv4InterfaceTable_post_request *//********************************************************************** ********************************************************************** *** *** Table ipv4InterfaceTable *** ********************************************************************** **********************************************************************//* * IP-MIB::ipv4InterfaceTable is subid 28 of ip. * Its status is Current. * OID: .1.3.6.1.2.1.4.28, length: 8 *//* * --------------------------------------------------------------------- * * TODO:200:r: Implement ipv4InterfaceTable data context functions. *//*--------------------------------------------------------------------- * IP-MIB::ipv4InterfaceEntry.ipv4InterfaceReasmMaxSize * ipv4InterfaceReasmMaxSize is subid 2 of ipv4InterfaceEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.28.1.2 * Description:The size of the largest IPv4 datagram which this entity can            re-assemble from incoming IPv4 fragmented datagrams received            on this interface. * * Attributes: *   accessible 1     isscalar 0     enums  0      hasdefval 0 *   readable   1     iscolumn 1     ranges 1      hashint   0 *   settable   0 * * Ranges:  0 - 65535; * * Its syntax is INTEGER32 (based on perltype INTEGER32) * The net-snmp type is ASN_INTEGER. The C type decl is long (long) *//** * Extract the current value of the ipv4InterfaceReasmMaxSize data. * * Set a value using the data context for the row. * * @param rowreq_ctx *        Pointer to the row request context. * @param ipv4InterfaceReasmMaxSize_val_ptr *        Pointer to storage for a long variable * * @retval MFD_SUCCESS         : success * @retval MFD_SKIP            : skip this node (no value for now) * @retval MFD_ERROR           : Any other error */intipv4InterfaceReasmMaxSize_get(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,                              long *ipv4InterfaceReasmMaxSize_val_ptr){   /** we should have a non-NULL pointer */    netsnmp_assert(NULL != ipv4InterfaceReasmMaxSize_val_ptr);    DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceReasmMaxSize_get",                "called\n"));    netsnmp_assert(NULL != rowreq_ctx);    if (!        (rowreq_ctx->data.ifentry->         ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V4_REASMMAX))        return MFD_SKIP;    /*     * TODO:231:o: |-> Extract the current value of the ipv4InterfaceReasmMaxSize data.     * copy (* ipv4InterfaceReasmMaxSize_val_ptr ) from rowreq_ctx->data     */    (*ipv4InterfaceReasmMaxSize_val_ptr) =        rowreq_ctx->data.ipv4InterfaceReasmMaxSize;    return MFD_SUCCESS;}                               /* ipv4InterfaceReasmMaxSize_get */

⌨️ 快捷键说明

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