📄 udpendpointtable_interface.c
字号:
/* * Note: this file originally auto-generated by mib2c using * version : 1.67 $ of : mfd-interface.m2c,v $ * * $Id: udpEndpointTable_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 "udpEndpointTable.h"#include <net-snmp/agent/table_container.h>#include <net-snmp/library/container.h>#include "udpEndpointTable_interface.h"#include <ctype.h>/********************************************************************** ********************************************************************** *** *** Table udpEndpointTable *** ********************************************************************** **********************************************************************//* * UDP-MIB::udpEndpointTable is subid 7 of udp. * Its status is Current. * OID: .1.3.6.1.2.1.7.7, length: 8 */typedef struct udpEndpointTable_interface_ctx_s { netsnmp_container *container; netsnmp_cache *cache; udpEndpointTable_registration *user_ctx; netsnmp_table_registration_info tbl_info; netsnmp_baby_steps_access_methods access_multiplexer;} udpEndpointTable_interface_ctx;static udpEndpointTable_interface_ctx udpEndpointTable_if_ctx;static void _udpEndpointTable_container_init(udpEndpointTable_interface_ctx * if_ctx);static void _udpEndpointTable_container_shutdown(udpEndpointTable_interface_ctx * if_ctx);netsnmp_container *udpEndpointTable_container_get(void){ return udpEndpointTable_if_ctx.container;}udpEndpointTable_registration *udpEndpointTable_registration_get(void){ return udpEndpointTable_if_ctx.user_ctx;}udpEndpointTable_registration *udpEndpointTable_registration_set(udpEndpointTable_registration * newreg){ udpEndpointTable_registration *old = udpEndpointTable_if_ctx.user_ctx; udpEndpointTable_if_ctx.user_ctx = newreg; return old;}intudpEndpointTable_container_size(void){ return CONTAINER_SIZE(udpEndpointTable_if_ctx.container);}/* * mfd multiplexer modes */static Netsnmp_Node_Handler _mfd_udpEndpointTable_pre_request;static Netsnmp_Node_Handler _mfd_udpEndpointTable_post_request;static Netsnmp_Node_Handler _mfd_udpEndpointTable_object_lookup;static Netsnmp_Node_Handler _mfd_udpEndpointTable_get_values;/** * @internal * Initialize the table udpEndpointTable * (Define its contents and how it's structured) */void_udpEndpointTable_initialize_interface(udpEndpointTable_registration * reg_ptr, u_long flags){ netsnmp_baby_steps_access_methods *access_multiplexer = &udpEndpointTable_if_ctx.access_multiplexer; netsnmp_table_registration_info *tbl_info = &udpEndpointTable_if_ctx.tbl_info; netsnmp_handler_registration *reginfo; netsnmp_mib_handler *handler; int mfd_modes = 0; DEBUGMSGTL(("internal:udpEndpointTable:_udpEndpointTable_initialize_interface", "called\n")); /************************************************* * * save interface context for udpEndpointTable */ /* * Setting up the table's definition */ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER, /** index: udpEndpointLocalAddressType */ ASN_OCTET_STR, /** index: udpEndpointLocalAddress */ ASN_UNSIGNED, /** index: udpEndpointLocalPort */ ASN_INTEGER, /** index: udpEndpointRemoteAddressType */ ASN_OCTET_STR, /** index: udpEndpointRemoteAddress */ ASN_UNSIGNED, /** index: udpEndpointRemotePort */ ASN_UNSIGNED, /** index: udpEndpointInstance */ 0); /* * Define the minimum and maximum accessible columns. This * optimizes retrival. */ tbl_info->min_column = UDPENDPOINTTABLE_MIN_COL; tbl_info->max_column = UDPENDPOINTTABLE_MAX_COL; /* * save users context */ udpEndpointTable_if_ctx.user_ctx = reg_ptr; /* * call data access initialization code */ udpEndpointTable_init_data(reg_ptr); /* * set up the container */ _udpEndpointTable_container_init(&udpEndpointTable_if_ctx); if (NULL == udpEndpointTable_if_ctx.container) { snmp_log(LOG_ERR, "could not initialize container for udpEndpointTable\n"); return; } /* * access_multiplexer: REQUIRED wrapper for get request handling */ access_multiplexer->object_lookup = _mfd_udpEndpointTable_object_lookup; access_multiplexer->get_values = _mfd_udpEndpointTable_get_values; /* * no wrappers yet */ access_multiplexer->pre_request = _mfd_udpEndpointTable_pre_request; access_multiplexer->post_request = _mfd_udpEndpointTable_post_request; /************************************************* * * Create a registration, save our reg data, register table. */ DEBUGMSGTL(("udpEndpointTable:init_udpEndpointTable", "Registering udpEndpointTable as a mibs-for-dummies table.\n")); handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer); reginfo = netsnmp_handler_registration_create("udpEndpointTable", handler, udpEndpointTable_oid, udpEndpointTable_oid_size, HANDLER_CAN_BABY_STEP | HANDLER_CAN_RONLY); if (NULL == reginfo) { snmp_log(LOG_ERR, "error registering table udpEndpointTable\n"); return; } reginfo->my_reg_void = &udpEndpointTable_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, udpEndpointTable_if_ctx. container, TABLE_CONTAINER_KEY_NETSNMP_INDEX); netsnmp_inject_handler(reginfo, handler); /************************************************* * * inject cache helper */ if (NULL != udpEndpointTable_if_ctx.cache) { handler = netsnmp_cache_handler_get(udpEndpointTable_if_ctx.cache); netsnmp_inject_handler(reginfo, handler); } /* * register table */ netsnmp_register_table(reginfo, tbl_info);} /* _udpEndpointTable_initialize_interface *//** * @internal * Shutdown the table udpEndpointTable */void_udpEndpointTable_shutdown_interface(udpEndpointTable_registration * reg_ptr){ /* * shutdown the container */ _udpEndpointTable_container_shutdown(&udpEndpointTable_if_ctx);}voidudpEndpointTable_valid_columns_set(netsnmp_column_info *vc){ udpEndpointTable_if_ctx.tbl_info.valid_columns = vc;} /* udpEndpointTable_valid_columns_set *//** * @internal * convert the index component stored in the context to an oid */intudpEndpointTable_index_to_oid(netsnmp_index * oid_idx, udpEndpointTable_mib_index * mib_idx){ int err = SNMP_ERR_NOERROR; /* * temp storage for parsing indexes */ /* * udpEndpointLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h */ netsnmp_variable_list var_udpEndpointLocalAddressType; /* * udpEndpointLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h */ netsnmp_variable_list var_udpEndpointLocalAddress; /* * udpEndpointLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H */ netsnmp_variable_list var_udpEndpointLocalPort; /* * udpEndpointRemoteAddressType(4)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h */ netsnmp_variable_list var_udpEndpointRemoteAddressType; /* * udpEndpointRemoteAddress(5)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h */ netsnmp_variable_list var_udpEndpointRemoteAddress; /* * udpEndpointRemotePort(6)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H */ netsnmp_variable_list var_udpEndpointRemotePort; /* * udpEndpointInstance(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/h */ netsnmp_variable_list var_udpEndpointInstance; /* * set up varbinds */ memset(&var_udpEndpointLocalAddressType, 0x00, sizeof(var_udpEndpointLocalAddressType)); var_udpEndpointLocalAddressType.type = ASN_INTEGER;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -