2 ######################################################################
4 ######################################################################
7 * Note: this file originally auto-generated by mib2c using
8 * $Id: mib2c.create-dataset.conf,v 5.3 2002/12/05 00:29:45 hardaker Exp $
13 /* function declarations */
14 void init_$name(void);
16 void initialize_table_$i(void);
17 Netsnmp_Node_Handler ${i}_handler;
21 /* column number definitions for table $i */
23 #define COLUMN_$c.uc $c.subid
26 #endif /* $name.uc_H */
27 ######################################################################
29 ######################################################################
32 * Note: this file originally auto-generated by mib2c using
33 * $Id: mib2c.create-dataset.conf,v 5.3 2002/12/05 00:29:45 hardaker Exp $
36 #include <net-snmp/net-snmp-config.h>
37 #include <net-snmp/net-snmp-includes.h>
38 #include <net-snmp/agent/net-snmp-agent-includes.h>
42 /** Initialize the $i table by defining its contents and how it's structured */
44 initialize_table_$i(void)
46 static oid ${i}_oid[] = {$i.commaoid};
47 size_t ${i}_oid_len = OID_LENGTH(${i}_oid);
48 netsnmp_table_data_set *table_set;
50 /* create the table structure itself */
51 table_set = netsnmp_create_table_data_set("$i");
53 /* comment this out or delete if you don't support creation of new rows */
54 table_set->allow_creation = 1;
56 /***************************************************
59 DEBUGMSGTL(("initialize_table_$i",
60 "adding indexes to table $i\n"));
61 netsnmp_table_set_add_indexes(table_set,
63 $idx.type, /* index: $idx */
67 DEBUGMSGTL(("initialize_table_$i",
68 "adding column types to table $i\n"));
69 netsnmp_table_set_multi_add_default_row(table_set,
71 COLUMN_$c.uc, $c.type, $c.settable,
76 /* registering the table with the master agent */
77 /* note: if you don't need a subhandler to deal with any aspects
78 of the request, change ${i}_handler to "NULL" */
79 netsnmp_register_table_data_set(netsnmp_create_handler_registration("$i", ${i}_handler,
87 /** Initializes the $name module */
92 /* here we initialize all the tables we're planning on supporting */
94 initialize_table_$i();
99 /** handles requests for the $i table, if anything else needs to be done */
102 netsnmp_mib_handler *handler,
103 netsnmp_handler_registration *reginfo,
104 netsnmp_agent_request_info *reqinfo,
105 netsnmp_request_info *requests) {
106 /* perform anything here that you need to do. The requests have
107 already been processed by the master table_dataset handler, but
108 this gives you chance to act on the request in some other way
110 return SNMP_ERR_NOERROR;