| 1 |
/* |
| 2 |
* Note: this file originally auto-generated by mib2c using |
| 3 |
* version : 14170 $ of $ |
| 4 |
* |
| 5 |
* $Id:$ |
| 6 |
*/ |
| 7 |
/** \page MFD helper for dot3StatsTable |
| 8 |
* |
| 9 |
* \section intro Introduction |
| 10 |
* Introductory text. |
| 11 |
* |
| 12 |
*/ |
| 13 |
/* |
| 14 |
* standard Net-SNMP includes |
| 15 |
*/ |
| 16 |
#include <net-snmp/net-snmp-config.h> |
| 17 |
#include <net-snmp/net-snmp-includes.h> |
| 18 |
#include <net-snmp/agent/net-snmp-agent-includes.h> |
| 19 |
|
| 20 |
/* |
| 21 |
* include our parent header |
| 22 |
*/ |
| 23 |
#include "dot3StatsTable.h" |
| 24 |
|
| 25 |
#include <net-snmp/agent/mib_modules.h> |
| 26 |
|
| 27 |
#include "dot3StatsTable_interface.h" |
| 28 |
|
| 29 |
oid dot3StatsTable_oid[] = { DOT3STATSTABLE_OID }; |
| 30 |
int dot3StatsTable_oid_size = OID_LENGTH(dot3StatsTable_oid); |
| 31 |
|
| 32 |
static dot3StatsTable_registration *dot3StatsTable_user_context_p; |
| 33 |
|
| 34 |
static void initialize_table_dot3StatsTable(void); |
| 35 |
static void shutdown_table_dot3StatsTable(void); |
| 36 |
|
| 37 |
|
| 38 |
/** |
| 39 |
* Initializes the dot3StatsTable module |
| 40 |
*/ |
| 41 |
void |
| 42 |
init_dot3StatsTable(void) |
| 43 |
{ |
| 44 |
DEBUGMSGTL(("verbose:dot3StatsTable:init_dot3StatsTable", "called\n")); |
| 45 |
|
| 46 |
/* |
| 47 |
* TODO:300:o: Perform dot3StatsTable one-time module initialization. |
| 48 |
*/ |
| 49 |
|
| 50 |
/* |
| 51 |
* here we initialize all the tables we're planning on supporting |
| 52 |
*/ |
| 53 |
if (should_init("dot3StatsTable")) |
| 54 |
initialize_table_dot3StatsTable(); |
| 55 |
|
| 56 |
} /* init_dot3StatsTable */ |
| 57 |
|
| 58 |
/** |
| 59 |
* Shut-down the dot3StatsTable module (agent is exiting) |
| 60 |
*/ |
| 61 |
void |
| 62 |
shutdown_dot3StatsTable(void) |
| 63 |
{ |
| 64 |
if (should_init("dot3StatsTable")) |
| 65 |
shutdown_table_dot3StatsTable(); |
| 66 |
|
| 67 |
} |
| 68 |
|
| 69 |
/** |
| 70 |
* Initialize the table dot3StatsTable |
| 71 |
* (Define its contents and how it's structured) |
| 72 |
*/ |
| 73 |
void |
| 74 |
initialize_table_dot3StatsTable(void) |
| 75 |
{ |
| 76 |
u_long flags; |
| 77 |
|
| 78 |
DEBUGMSGTL(("verbose:dot3StatsTable:initialize_table_dot3StatsTable", |
| 79 |
"called\n")); |
| 80 |
|
| 81 |
/* |
| 82 |
* TODO:301:o: Perform dot3StatsTable one-time table initialization. |
| 83 |
*/ |
| 84 |
|
| 85 |
/* |
| 86 |
* TODO:302:o: |->Initialize dot3StatsTable user context |
| 87 |
* if you'd like to pass in a pointer to some data for this |
| 88 |
* table, allocate or set it up here. |
| 89 |
*/ |
| 90 |
/* |
| 91 |
* a netsnmp_data_list is a simple way to store void pointers. A simple |
| 92 |
* string token is used to add, find or remove pointers. |
| 93 |
*/ |
| 94 |
dot3StatsTable_user_context_p |
| 95 |
= netsnmp_create_data_list("dot3StatsTable", NULL, NULL); |
| 96 |
|
| 97 |
/* |
| 98 |
* No support for any flags yet, but in the future you would |
| 99 |
* set any flags here. |
| 100 |
*/ |
| 101 |
flags = 0; |
| 102 |
|
| 103 |
/* |
| 104 |
* call interface initialization code |
| 105 |
*/ |
| 106 |
_dot3StatsTable_initialize_interface(dot3StatsTable_user_context_p, flags); |
| 107 |
} /* initialize_table_dot3StatsTable */ |
| 108 |
|
| 109 |
/** |
| 110 |
* Shutdown the table dot3StatsTable |
| 111 |
*/ |
| 112 |
void |
| 113 |
shutdown_table_dot3StatsTable(void) |
| 114 |
{ |
| 115 |
/* |
| 116 |
* call interface shutdown code |
| 117 |
*/ |
| 118 |
_dot3StatsTable_shutdown_interface(dot3StatsTable_user_context_p); |
| 119 |
netsnmp_free_all_list_data(dot3StatsTable_user_context_p); |
| 120 |
dot3StatsTable_user_context_p = NULL; |
| 121 |
} |
| 122 |
|
| 123 |
/** |
| 124 |
* extra context initialization (eg default values) |
| 125 |
* |
| 126 |
* @param rowreq_ctx : row request context |
| 127 |
* @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate) |
| 128 |
* |
| 129 |
* @retval MFD_SUCCESS : no errors |
| 130 |
* @retval MFD_ERROR : error (context allocate will fail) |
| 131 |
*/ |
| 132 |
int |
| 133 |
dot3StatsTable_rowreq_ctx_init(dot3StatsTable_rowreq_ctx * rowreq_ctx, |
| 134 |
void *user_init_ctx) |
| 135 |
{ |
| 136 |
DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_rowreq_ctx_init", |
| 137 |
"called\n")); |
| 138 |
|
| 139 |
netsnmp_assert(NULL != rowreq_ctx); |
| 140 |
|
| 141 |
/* |
| 142 |
* TODO:210:o: |-> Perform extra dot3StatsTable rowreq initialization. (eg DEFVALS) |
| 143 |
*/ |
| 144 |
|
| 145 |
return MFD_SUCCESS; |
| 146 |
} /* dot3StatsTable_rowreq_ctx_init */ |
| 147 |
|
| 148 |
/** |
| 149 |
* extra context cleanup |
| 150 |
* |
| 151 |
*/ |
| 152 |
void |
| 153 |
dot3StatsTable_rowreq_ctx_cleanup(dot3StatsTable_rowreq_ctx * rowreq_ctx) |
| 154 |
{ |
| 155 |
DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_rowreq_ctx_cleanup", |
| 156 |
"called\n")); |
| 157 |
|
| 158 |
netsnmp_assert(NULL != rowreq_ctx); |
| 159 |
|
| 160 |
/* |
| 161 |
* TODO:211:o: |-> Perform extra dot3StatsTable rowreq cleanup. |
| 162 |
*/ |
| 163 |
} /* dot3StatsTable_rowreq_ctx_cleanup */ |
| 164 |
|
| 165 |
/** |
| 166 |
* pre-request callback |
| 167 |
* |
| 168 |
* |
| 169 |
* @retval MFD_SUCCESS : success. |
| 170 |
* @retval MFD_ERROR : other error |
| 171 |
*/ |
| 172 |
int |
| 173 |
dot3StatsTable_pre_request(dot3StatsTable_registration * user_context) |
| 174 |
{ |
| 175 |
DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_pre_request", |
| 176 |
"called\n")); |
| 177 |
|
| 178 |
/* |
| 179 |
* TODO:510:o: Perform dot3StatsTable pre-request actions. |
| 180 |
*/ |
| 181 |
|
| 182 |
return MFD_SUCCESS; |
| 183 |
} /* dot3StatsTable_pre_request */ |
| 184 |
|
| 185 |
/** |
| 186 |
* post-request callback |
| 187 |
* |
| 188 |
* Note: |
| 189 |
* New rows have been inserted into the container, and |
| 190 |
* deleted rows have been removed from the container and |
| 191 |
* released. |
| 192 |
* |
| 193 |
* @param user_context |
| 194 |
* @param rc : MFD_SUCCESS if all requests succeeded |
| 195 |
* |
| 196 |
* @retval MFD_SUCCESS : success. |
| 197 |
* @retval MFD_ERROR : other error (ignored) |
| 198 |
*/ |
| 199 |
int |
| 200 |
dot3StatsTable_post_request(dot3StatsTable_registration * user_context, |
| 201 |
int rc) |
| 202 |
{ |
| 203 |
DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_post_request", |
| 204 |
"called\n")); |
| 205 |
|
| 206 |
/* |
| 207 |
* TODO:511:o: Perform dot3StatsTable post-request actions. |
| 208 |
*/ |
| 209 |
|
| 210 |
return MFD_SUCCESS; |
| 211 |
} /* dot3StatsTable_post_request */ |
| 212 |
|
| 213 |
|
| 214 |
/** @{ */ |