Debian Codegraph @

agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c

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