Debian Codegraph @

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