📄 ipv6interfacetable.c
字号:
/* * Note: this file originally auto-generated by mib2c using * version : 1.48 $ of : mfd-top.m2c,v $ * * $Id: ipv6InterfaceTable.c 15946 2007-03-12 21:28:23Z dts12 $ *//** \page MFD helper for ipv6InterfaceTable * * \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 "ipv6InterfaceTable.h"#include <net-snmp/agent/mib_modules.h>#include "ipv6InterfaceTable_interface.h"oid ipv6InterfaceTable_oid[] = { IPV6INTERFACETABLE_OID };int ipv6InterfaceTable_oid_size =OID_LENGTH(ipv6InterfaceTable_oid);ipv6InterfaceTable_registration ipv6InterfaceTable_user_context;void initialize_table_ipv6InterfaceTable(void);void shutdown_table_ipv6InterfaceTable(void);/** * Initializes the ipv6InterfaceTable module */voidinit_ipv6InterfaceTable(void){ DEBUGMSGTL(("verbose:ipv6InterfaceTable:init_ipv6InterfaceTable", "called\n")); /* * TODO:300:o: Perform ipv6InterfaceTable 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 */ ipv6InterfaceTable_lastChange_set(0);} /* init_ipv6InterfaceTable *//** * Shut-down the ipv6InterfaceTable module (agent is exiting) */voidshutdown_ipv6InterfaceTable(void){ if (should_init("ipv6InterfaceTable")) shutdown_table_ipv6InterfaceTable();}/** * Initialize the table ipv6InterfaceTable * (Define its contents and how it's structured) */voidinitialize_table_ipv6InterfaceTable(void){ ipv6InterfaceTable_registration *user_context; u_long flags; DEBUGMSGTL(("verbose:ipv6InterfaceTable:initialize_table_ipv6InterfaceTable", "called\n")); /* * TODO:301:o: Perform ipv6InterfaceTable one-time table initialization. */ /* * TODO:302:o: |->Initialize ipv6InterfaceTable 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("ipv6InterfaceTable", NULL, NULL); /* * No support for any flags yet, but in the future you would * set any flags here. */ flags = 0; /* * call interface initialization code */ _ipv6InterfaceTable_initialize_interface(user_context, flags);} /* initialize_table_ipv6InterfaceTable *//** * Shutdown the table ipv6InterfaceTable */voidshutdown_table_ipv6InterfaceTable(void){ /* * call interface shutdown code */ _ipv6InterfaceTable_shutdown_interface (&ipv6InterfaceTable_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) */intipv6InterfaceTable_rowreq_ctx_init(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx, void *user_init_ctx){ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_rowreq_ctx_init", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:210:o: |-> Perform extra ipv6InterfaceTable rowreq initialization. (eg DEFVALS) */ return MFD_SUCCESS;} /* ipv6InterfaceTable_rowreq_ctx_init *//** * extra context cleanup * @param rowreq_ctx */voidipv6InterfaceTable_rowreq_ctx_cleanup(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_rowreq_ctx_cleanup", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:211:o: |-> Perform extra ipv6InterfaceTable rowreq cleanup. */} /* ipv6InterfaceTable_rowreq_ctx_cleanup *//** * pre-request callback * * @param user_context * * @retval MFD_SUCCESS : success. * @retval MFD_ERROR : other error */intipv6InterfaceTable_pre_request(ipv6InterfaceTable_registration * user_context){ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_pre_request", "called\n")); /* * TODO:510:o: Perform ipv6InterfaceTable pre-request actions. */ return MFD_SUCCESS;} /* ipv6InterfaceTable_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) */intipv6InterfaceTable_post_request(ipv6InterfaceTable_registration * user_context, int rc){ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_post_request", "called\n")); /* * TODO:511:o: Perform ipv6InterfaceTable post-request actions. */ /* * check to set if any rows were changed. */ if (ipv6InterfaceTable_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 */ } ipv6InterfaceTable_dirty_set(0); /* clear table dirty flag */ } return MFD_SUCCESS;} /* ipv6InterfaceTable_post_request *//********************************************************************** ********************************************************************** *** *** Table ipv6InterfaceTable *** ********************************************************************** **********************************************************************//* * IP-MIB::ipv6InterfaceTable is subid 30 of ip. * Its status is Current. * OID: .1.3.6.1.2.1.4.30, length: 8 *//* * --------------------------------------------------------------------- * * TODO:200:r: Implement ipv6InterfaceTable data context functions. *//*--------------------------------------------------------------------- * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceReasmMaxSize * ipv6InterfaceReasmMaxSize is subid 2 of ipv6InterfaceEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.30.1.2 * Description:The size of the largest IPv6 datagram which this entity can re-assemble from incoming IPv6 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: 1500 - 65535; * * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32) * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long) *//** * Extract the current value of the ipv6InterfaceReasmMaxSize data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipv6InterfaceReasmMaxSize_val_ptr * Pointer to storage for a u_long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */intipv6InterfaceReasmMaxSize_get(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx, u_long * ipv6InterfaceReasmMaxSize_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipv6InterfaceReasmMaxSize_val_ptr); DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceReasmMaxSize_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); if (! (rowreq_ctx->data.ifentry-> ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX)) return MFD_SKIP; /* * TODO:231:o: |-> Extract the current value of the ipv6InterfaceReasmMaxSize data. * copy (* ipv6InterfaceReasmMaxSize_val_ptr ) from rowreq_ctx->data */ (*ipv6InterfaceReasmMaxSize_val_ptr) = rowreq_ctx->data.ipv6InterfaceReasmMaxSize; return MFD_SUCCESS;} /* ipv6InterfaceReasmMaxSize_get *//*--------------------------------------------------------------------- * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceIdentifier * ipv6InterfaceIdentifier is subid 3 of ipv6InterfaceEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.30.1.3 * Description:The Interface Identifier for this interface. The Interface Identifier is combined with an address prefix to form an interface address. By default, the Interface Identifier is auto-configured according to the rules of the link type this interface is attached to. A zero length identifier may be used where appropriate. One possible example is a loopback interface. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: 2x: * * Ranges: 0 - 8; * * Its syntax is Ipv6AddressIfIdentifierTC (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length. (Max 8) *//** * Extract the current value of the ipv6InterfaceIdentifier data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipv6InterfaceIdentifier_val_ptr_ptr
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -