Debian Codegraph @

agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.c

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