Debian Codegraph @

agent/mibgroup/mibII/ipCidrRouteTable_checkfns.c

raw
1 /*
2 * Note: this file originally auto-generated by mib2c using
3 * : mib2c.check_values.conf,v 1.1 2003/02/06 06:07:12 hardaker Exp $
4 */
5
6 /*
7 * standard headers
8 */
9 #include <net-snmp/net-snmp-config.h>
10 #include <net-snmp/net-snmp-includes.h>
11 #include "ipCidrRouteTable_checkfns.h"
12 #include "ipCidrRouteTable_enums.h"
13
14 /** Decides if an incoming value for the ipCidrRouteIfIndex mib node is legal.
15 * @param type The incoming data type.
16 * @param val The value to be checked.
17 * @param val_len The length of data stored in val (in bytes).
18 * @return 0 if the incoming value is legal, an SNMP error code otherwise.
19 */
20 int
21 check_ipCidrRouteIfIndex(int type, long *val, size_t val_len)
22 {
23
24 /** Check to see that we were called legally */
25 if (!val)
26 return SNMP_ERR_GENERR;
27
28 /** Check the incoming type for correctness */
29 if (type != ASN_INTEGER)
30 return SNMP_ERR_WRONGTYPE;
31
32
33 /** looks ok */
34 return SNMP_ERR_NOERROR;
35 }
36
37 /** Decides if an incoming value for the ipCidrRouteType mib node is legal.
38 * @param type The incoming data type.
39 * @param val The value to be checked.
40 * @param val_len The length of data stored in val (in bytes).
41 * @return 0 if the incoming value is legal, an SNMP error code otherwise.
42 */
43 int
44 check_ipCidrRouteType(int type, long *val, size_t val_len)
45 {
46
47 /** Check to see that we were called legally */
48 if (!val)
49 return SNMP_ERR_GENERR;
50
51 /** Check the incoming type for correctness */
52 if (type != ASN_INTEGER)
53 return SNMP_ERR_WRONGTYPE;
54
55 /** Check the enums. Legal values continue. */
56 switch (*val) {
57 case IPCIDRROUTETYPE_OTHER:
58 case IPCIDRROUTETYPE_REJECT:
59 case IPCIDRROUTETYPE_LOCAL:
60 case IPCIDRROUTETYPE_REMOTE:
61 break;
62
63 /** not a legal enum value. return an error */
64 default:
65 return SNMP_ERR_INCONSISTENTVALUE;
66 }
67
68 /** looks ok */
69 return SNMP_ERR_NOERROR;
70 }
71
72 /** Decides if an incoming value for the ipCidrRouteInfo mib node is legal.
73 * @param type The incoming data type.
74 * @param val The value to be checked.
75 * @param val_len The length of data stored in val (in bytes).
76 * @return 0 if the incoming value is legal, an SNMP error code otherwise.
77 */
78 int
79 check_ipCidrRouteInfo(int type, oid * val, size_t val_len)
80 {
81
82 /** Check to see that we were called legally */
83 if (!val)
84 return SNMP_ERR_GENERR;
85
86 /** Check the incoming type for correctness */
87 if (type != ASN_OBJECT_ID)
88 return SNMP_ERR_WRONGTYPE;
89
90 /** looks ok */
91 return SNMP_ERR_NOERROR;
92 }
93
94 /** Decides if an incoming value for the ipCidrRouteNextHopAS mib node is legal.
95 * @param type The incoming data type.
96 * @param val The value to be checked.
97 * @param val_len The length of data stored in val (in bytes).
98 * @return 0 if the incoming value is legal, an SNMP error code otherwise.
99 */
100 int
101 check_ipCidrRouteNextHopAS(int type, long *val, size_t val_len)
102 {
103
104 /** Check to see that we were called legally */
105 if (!val)
106 return SNMP_ERR_GENERR;
107
108 /** Check the incoming type for correctness */
109 if (type != ASN_INTEGER)
110 return SNMP_ERR_WRONGTYPE;
111
112
113 /** looks ok */
114 return SNMP_ERR_NOERROR;
115 }
116
117 /** Decides if an incoming value for the ipCidrRouteMetric1 mib node is legal.
118 * @param type The incoming data type.
119 * @param val The value to be checked.
120 * @param val_len The length of data stored in val (in bytes).
121 * @return 0 if the incoming value is legal, an SNMP error code otherwise.
122 */
123 int
124 check_ipCidrRouteMetric1(int type, long *val, size_t val_len)
125 {
126
127 /** Check to see that we were called legally */
128 if (!val)
129 return SNMP_ERR_GENERR;
130
131 /** Check the incoming type for correctness */
132 if (type != ASN_INTEGER)
133 return SNMP_ERR_WRONGTYPE;
134
135
136 /** looks ok */
137 return SNMP_ERR_NOERROR;
138 }
139
140 /** Decides if an incoming value for the ipCidrRouteMetric2 mib node is legal.
141 * @param type The incoming data type.
142 * @param val The value to be checked.
143 * @param val_len The length of data stored in val (in bytes).
144 * @return 0 if the incoming value is legal, an SNMP error code otherwise.
145 */
146 int
147 check_ipCidrRouteMetric2(int type, long *val, size_t val_len)
148 {
149
150 /** Check to see that we were called legally */
151 if (!val)
152 return SNMP_ERR_GENERR;
153
154 /** Check the incoming type for correctness */
155 if (type != ASN_INTEGER)
156 return SNMP_ERR_WRONGTYPE;
157
158
159 /** looks ok */
160 return SNMP_ERR_NOERROR;
161 }
162
163 /** Decides if an incoming value for the ipCidrRouteMetric3 mib node is legal.
164 * @param type The incoming data type.
165 * @param val The value to be checked.
166 * @param val_len The length of data stored in val (in bytes).
167 * @return 0 if the incoming value is legal, an SNMP error code otherwise.
168 */
169 int
170 check_ipCidrRouteMetric3(int type, long *val, size_t val_len)
171 {
172
173 /** Check to see that we were called legally */
174 if (!val)
175 return SNMP_ERR_GENERR;
176
177 /** Check the incoming type for correctness */
178 if (type != ASN_INTEGER)
179 return SNMP_ERR_WRONGTYPE;
180
181
182 /** looks ok */
183 return SNMP_ERR_NOERROR;
184 }
185
186 /** Decides if an incoming value for the ipCidrRouteMetric4 mib node is legal.
187 * @param type The incoming data type.
188 * @param val The value to be checked.
189 * @param val_len The length of data stored in val (in bytes).
190 * @return 0 if the incoming value is legal, an SNMP error code otherwise.
191 */
192 int
193 check_ipCidrRouteMetric4(int type, long *val, size_t val_len)
194 {
195
196 /** Check to see that we were called legally */
197 if (!val)
198 return SNMP_ERR_GENERR;
199
200 /** Check the incoming type for correctness */
201 if (type != ASN_INTEGER)
202 return SNMP_ERR_WRONGTYPE;
203
204
205 /** looks ok */
206 return SNMP_ERR_NOERROR;
207 }
208
209 /** Decides if an incoming value for the ipCidrRouteMetric5 mib node is legal.
210 * @param type The incoming data type.
211 * @param val The value to be checked.
212 * @param val_len The length of data stored in val (in bytes).
213 * @return 0 if the incoming value is legal, an SNMP error code otherwise.
214 */
215 int
216 check_ipCidrRouteMetric5(int type, long *val, size_t val_len)
217 {
218
219 /** Check to see that we were called legally */
220 if (!val)
221 return SNMP_ERR_GENERR;
222
223 /** Check the incoming type for correctness */
224 if (type != ASN_INTEGER)
225 return SNMP_ERR_WRONGTYPE;
226
227
228 /** looks ok */
229 return SNMP_ERR_NOERROR;
230 }
231
232 /** Decides if an incoming value for the ipCidrRouteStatus mib node is legal.
233 * @param type The incoming data type.
234 * @param val The value to be checked.
235 * @param val_len The length of data stored in val (in bytes).
236 * @return 0 if the incoming value is legal, an SNMP error code otherwise.
237 */
238 int
239 check_ipCidrRouteStatus(int type, long *val, size_t val_len)
240 {
241
242 /** Check to see that we were called legally */
243 if (!val)
244 return SNMP_ERR_GENERR;
245
246 /** Check the incoming type for correctness */
247 if (type != ASN_INTEGER)
248 return SNMP_ERR_WRONGTYPE;
249
250 /** Check the enums. Legal values continue. */
251 switch (*val) {
252 case IPCIDRROUTESTATUS_ACTIVE:
253 case IPCIDRROUTESTATUS_NOTINSERVICE:
254 case IPCIDRROUTESTATUS_NOTREADY:
255 case IPCIDRROUTESTATUS_CREATEANDGO:
256 case IPCIDRROUTESTATUS_CREATEANDWAIT:
257 case IPCIDRROUTESTATUS_DESTROY:
258 break;
259
260 /** not a legal enum value. return an error */
261 default:
262 return SNMP_ERR_INCONSISTENTVALUE;
263 }
264
265 /** looks ok */
266 return SNMP_ERR_NOERROR;
267 }