Debian Codegraph @

agent/mibgroup/disman/mteTriggerThresholdTable.c

raw
1 /*
2 * This file was generated by mib2c and is intended for use as
3 * a mib module for the ucd-snmp snmpd agent.
4 */
5
6
7 /*
8 * This should always be included first before anything else
9 */
10 #include <net-snmp/net-snmp-config.h>
11 #ifdef HAVE_STDLIB_H
12 #include <stdlib.h>
13 #endif
14 #ifdef HAVE_STRING_H
15 #include <string.h>
16 #else
17 #include <strings.h>
18 #endif
19
20
21 /*
22 * minimal include directives
23 */
24 #include <net-snmp/net-snmp-includes.h>
25 #include <net-snmp/agent/net-snmp-agent-includes.h>
26
27 #include "header_complex.h"
28 #include "mteTriggerThresholdTable.h"
29 #include "mteTriggerTable.h"
30
31
32 /*
33 * mteTriggerThresholdTable_variables_oid:
34 * this is the top level oid that we want to register under. This
35 * is essentially a prefix, with the suffix appearing in the
36 * variable below.
37 */
38
39
40 oid mteTriggerThresholdTable_variables_oid[] =
41 { 1, 3, 6, 1, 2, 1, 88, 1, 2, 6 };
42
43
44 /*
45 * variable2 mteTriggerThresholdTable_variables:
46 * this variable defines function callbacks and type return information
47 * for the mteTriggerThresholdTable mib section
48 */
49
50
51 #ifndef NETSNMP_NO_WRITE_SUPPORT
52 struct variable2 mteTriggerThresholdTable_variables[] = {
53 /*
54 * magic number , variable type , ro/rw , callback fn , L, oidsuffix
55 */
56 #define MTETRIGGERTHRESHOLDSTARTUP 3
57 {MTETRIGGERTHRESHOLDSTARTUP, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
58 var_mteTriggerThresholdTable, 2, {1, 1}},
59 #define MTETRIGGERTHRESHOLDRISING 4
60 {MTETRIGGERTHRESHOLDRISING, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
61 var_mteTriggerThresholdTable, 2, {1, 2}},
62 #define MTETRIGGERTHRESHOLDFALLING 5
63 {MTETRIGGERTHRESHOLDFALLING, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
64 var_mteTriggerThresholdTable, 2, {1, 3}},
65 #define MTETRIGGERTHRESHOLDDELTARISING 6
66 {MTETRIGGERTHRESHOLDDELTARISING, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
67 var_mteTriggerThresholdTable, 2, {1, 4}},
68 #define MTETRIGGERTHRESHOLDDELTAFALLING 7
69 {MTETRIGGERTHRESHOLDDELTAFALLING, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE,
70 var_mteTriggerThresholdTable, 2, {1, 5}},
71 #define MTETRIGGERTHRESHOLDOBJECTSOWNER 8
72 {MTETRIGGERTHRESHOLDOBJECTSOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
73 var_mteTriggerThresholdTable, 2, {1, 6}},
74 #define MTETRIGGERTHRESHOLDOBJECTS 9
75 {MTETRIGGERTHRESHOLDOBJECTS, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
76 var_mteTriggerThresholdTable, 2, {1, 7}},
77 #define MTETRIGGERTHRESHOLDRISINGEVENTOWNER 10
78 {MTETRIGGERTHRESHOLDRISINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
79 var_mteTriggerThresholdTable, 2, {1, 8}},
80 #define MTETRIGGERTHRESHOLDRISINGEVENT 11
81 {MTETRIGGERTHRESHOLDRISINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
82 var_mteTriggerThresholdTable, 2, {1, 9}},
83 #define MTETRIGGERTHRESHOLDFALLINGEVENTOWNER 12
84 {MTETRIGGERTHRESHOLDFALLINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
85 var_mteTriggerThresholdTable, 2, {1, 10}},
86 #define MTETRIGGERTHRESHOLDFALLINGEVENT 13
87 {MTETRIGGERTHRESHOLDFALLINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
88 var_mteTriggerThresholdTable, 2, {1, 11}},
89 #define MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER 14
90 {MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
91 var_mteTriggerThresholdTable, 2, {1, 12}},
92 #define MTETRIGGERTHRESHOLDDELTARISINGEVENT 15
93 {MTETRIGGERTHRESHOLDDELTARISINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
94 var_mteTriggerThresholdTable, 2, {1, 13}},
95 #define MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER 16
96 {MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
97 var_mteTriggerThresholdTable, 2, {1, 14}},
98 #define MTETRIGGERTHRESHOLDDELTAFALLINGEVENT 17
99 {MTETRIGGERTHRESHOLDDELTAFALLINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RWRITE,
100 var_mteTriggerThresholdTable, 2, {1, 15}},
101 };
102 #else /* !NETSNMP_NO_WRITE_SUPPORT */
103 struct variable2 mteTriggerThresholdTable_variables[] = {
104 /*
105 * magic number , variable type , ro/rw , callback fn , L, oidsuffix
106 */
107 #define MTETRIGGERTHRESHOLDSTARTUP 3
108 {MTETRIGGERTHRESHOLDSTARTUP, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
109 var_mteTriggerThresholdTable, 2, {1, 1}},
110 #define MTETRIGGERTHRESHOLDRISING 4
111 {MTETRIGGERTHRESHOLDRISING, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
112 var_mteTriggerThresholdTable, 2, {1, 2}},
113 #define MTETRIGGERTHRESHOLDFALLING 5
114 {MTETRIGGERTHRESHOLDFALLING, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
115 var_mteTriggerThresholdTable, 2, {1, 3}},
116 #define MTETRIGGERTHRESHOLDDELTARISING 6
117 {MTETRIGGERTHRESHOLDDELTARISING, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
118 var_mteTriggerThresholdTable, 2, {1, 4}},
119 #define MTETRIGGERTHRESHOLDDELTAFALLING 7
120 {MTETRIGGERTHRESHOLDDELTAFALLING, ASN_INTEGER, NETSNMP_OLDAPI_RONLY,
121 var_mteTriggerThresholdTable, 2, {1, 5}},
122 #define MTETRIGGERTHRESHOLDOBJECTSOWNER 8
123 {MTETRIGGERTHRESHOLDOBJECTSOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
124 var_mteTriggerThresholdTable, 2, {1, 6}},
125 #define MTETRIGGERTHRESHOLDOBJECTS 9
126 {MTETRIGGERTHRESHOLDOBJECTS, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
127 var_mteTriggerThresholdTable, 2, {1, 7}},
128 #define MTETRIGGERTHRESHOLDRISINGEVENTOWNER 10
129 {MTETRIGGERTHRESHOLDRISINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
130 var_mteTriggerThresholdTable, 2, {1, 8}},
131 #define MTETRIGGERTHRESHOLDRISINGEVENT 11
132 {MTETRIGGERTHRESHOLDRISINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
133 var_mteTriggerThresholdTable, 2, {1, 9}},
134 #define MTETRIGGERTHRESHOLDFALLINGEVENTOWNER 12
135 {MTETRIGGERTHRESHOLDFALLINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
136 var_mteTriggerThresholdTable, 2, {1, 10}},
137 #define MTETRIGGERTHRESHOLDFALLINGEVENT 13
138 {MTETRIGGERTHRESHOLDFALLINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
139 var_mteTriggerThresholdTable, 2, {1, 11}},
140 #define MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER 14
141 {MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
142 var_mteTriggerThresholdTable, 2, {1, 12}},
143 #define MTETRIGGERTHRESHOLDDELTARISINGEVENT 15
144 {MTETRIGGERTHRESHOLDDELTARISINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
145 var_mteTriggerThresholdTable, 2, {1, 13}},
146 #define MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER 16
147 {MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
148 var_mteTriggerThresholdTable, 2, {1, 14}},
149 #define MTETRIGGERTHRESHOLDDELTAFALLINGEVENT 17
150 {MTETRIGGERTHRESHOLDDELTAFALLINGEVENT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY,
151 var_mteTriggerThresholdTable, 2, {1, 15}},
152 };
153 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
154
155
156 /*
157 * (L = length of the oidsuffix)
158 */
159
160
161 /*
162 * init_mteTriggerThresholdTable():
163 * Initialization routine. This is called when the agent starts up.
164 * At a minimum, registration of your variables should take place here.
165 */
166 void
167 init_mteTriggerThresholdTable(void)
168 {
169 DEBUGMSGTL(("mteTriggerThresholdTable", "initializing... "));
170
171
172 /*
173 * register ourselves with the agent to handle our mib tree
174 */
175 REGISTER_MIB("mteTriggerThresholdTable",
176 mteTriggerThresholdTable_variables, variable2,
177 mteTriggerThresholdTable_variables_oid);
178
179
180 DEBUGMSGTL(("mteTriggerThresholdTable", "done.\n"));
181 }
182
183 /*
184 * var_mteTriggerThresholdTable():
185 * Handle this table separately from the scalar value case.
186 * The workings of this are basically the same as for var_mteTriggerThresholdTable above.
187 */
188 unsigned char *
189 var_mteTriggerThresholdTable(struct variable *vp,
190 oid * name,
191 size_t * length,
192 int exact,
193 size_t * var_len, WriteMethod ** write_method)
194 {
195
196
197 struct mteTriggerTable_data *StorageTmp = NULL;
198
199
200 DEBUGMSGTL(("mteTriggerThresholdTable",
201 "var_mteTriggerThresholdTable: Entering... \n"));
202
203 /* set default value */
204 *write_method = NULL;
205
206 /*
207 * this assumes you have registered all your data properly
208 */
209 if ((StorageTmp =
210 header_complex(mteTriggerTableStorage, vp, name, length, exact,
211 var_len, write_method)) == NULL)
212 return NULL;
213
214
215 if (!(StorageTmp->mteTriggerTest[0] & MTETRIGGERTEST_THRESHOLD))
216 return NULL;
217
218 /*
219 * this is where we do the value assignments for the mib results.
220 */
221 switch (vp->magic) {
222
223
224 case MTETRIGGERTHRESHOLDSTARTUP:
225 #ifndef NETSNMP_NO_WRITE_SUPPORT
226 *write_method = write_mteTriggerThresholdStartup;
227 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
228 *var_len = sizeof(StorageTmp->mteTriggerThresholdStartup);
229 return (u_char *) & StorageTmp->mteTriggerThresholdStartup;
230
231 case MTETRIGGERTHRESHOLDRISING:
232 #ifndef NETSNMP_NO_WRITE_SUPPORT
233 *write_method = write_mteTriggerThresholdRising;
234 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
235 *var_len = sizeof(StorageTmp->mteTriggerThresholdRising);
236 return (u_char *) & StorageTmp->mteTriggerThresholdRising;
237
238 case MTETRIGGERTHRESHOLDFALLING:
239 #ifndef NETSNMP_NO_WRITE_SUPPORT
240 *write_method = write_mteTriggerThresholdFalling;
241 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
242 *var_len = sizeof(StorageTmp->mteTriggerThresholdFalling);
243 return (u_char *) & StorageTmp->mteTriggerThresholdFalling;
244
245 case MTETRIGGERTHRESHOLDDELTARISING:
246 #ifndef NETSNMP_NO_WRITE_SUPPORT
247 *write_method = write_mteTriggerThresholdDeltaRising;
248 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
249 *var_len = sizeof(StorageTmp->mteTriggerThresholdDeltaRising);
250 return (u_char *) & StorageTmp->mteTriggerThresholdDeltaRising;
251
252 case MTETRIGGERTHRESHOLDDELTAFALLING:
253 #ifndef NETSNMP_NO_WRITE_SUPPORT
254 *write_method = write_mteTriggerThresholdDeltaFalling;
255 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
256 *var_len = sizeof(StorageTmp->mteTriggerThresholdDeltaFalling);
257 return (u_char *) & StorageTmp->mteTriggerThresholdDeltaFalling;
258
259 case MTETRIGGERTHRESHOLDOBJECTSOWNER:
260 #ifndef NETSNMP_NO_WRITE_SUPPORT
261 *write_method = write_mteTriggerThresholdObjectsOwner;
262 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
263 *var_len = StorageTmp->mteTriggerThresholdObjectsOwnerLen;
264 return (u_char *) StorageTmp->mteTriggerThresholdObjectsOwner;
265
266 case MTETRIGGERTHRESHOLDOBJECTS:
267 #ifndef NETSNMP_NO_WRITE_SUPPORT
268 *write_method = write_mteTriggerThresholdObjects;
269 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
270 *var_len = StorageTmp->mteTriggerThresholdObjectsLen;
271 return (u_char *) StorageTmp->mteTriggerThresholdObjects;
272
273 case MTETRIGGERTHRESHOLDRISINGEVENTOWNER:
274 #ifndef NETSNMP_NO_WRITE_SUPPORT
275 *write_method = write_mteTriggerThresholdRisingEventOwner;
276 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
277 *var_len = StorageTmp->mteTriggerThresholdRisingEventOwnerLen;
278 return (u_char *) StorageTmp->mteTriggerThresholdRisingEventOwner;
279
280 case MTETRIGGERTHRESHOLDRISINGEVENT:
281 #ifndef NETSNMP_NO_WRITE_SUPPORT
282 *write_method = write_mteTriggerThresholdRisingEvent;
283 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
284 *var_len = StorageTmp->mteTriggerThresholdRisingEventLen;
285 return (u_char *) StorageTmp->mteTriggerThresholdRisingEvent;
286
287 case MTETRIGGERTHRESHOLDFALLINGEVENTOWNER:
288 #ifndef NETSNMP_NO_WRITE_SUPPORT
289 *write_method = write_mteTriggerThresholdFallingEventOwner;
290 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
291 *var_len = StorageTmp->mteTriggerThresholdFallingEventOwnerLen;
292 return (u_char *) StorageTmp->mteTriggerThresholdFallingEventOwner;
293
294 case MTETRIGGERTHRESHOLDFALLINGEVENT:
295 #ifndef NETSNMP_NO_WRITE_SUPPORT
296 *write_method = write_mteTriggerThresholdFallingEvent;
297 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
298 *var_len = StorageTmp->mteTriggerThresholdFallingEventLen;
299 return (u_char *) StorageTmp->mteTriggerThresholdFallingEvent;
300
301 case MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER:
302 #ifndef NETSNMP_NO_WRITE_SUPPORT
303 *write_method = write_mteTriggerThresholdDeltaRisingEventOwner;
304 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
305 *var_len = StorageTmp->mteTriggerThresholdDeltaRisingEventOwnerLen;
306 return (u_char *) StorageTmp->
307 mteTriggerThresholdDeltaRisingEventOwner;
308
309 case MTETRIGGERTHRESHOLDDELTARISINGEVENT:
310 #ifndef NETSNMP_NO_WRITE_SUPPORT
311 *write_method = write_mteTriggerThresholdDeltaRisingEvent;
312 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
313 *var_len = StorageTmp->mteTriggerThresholdDeltaRisingEventLen;
314 return (u_char *) StorageTmp->mteTriggerThresholdDeltaRisingEvent;
315
316 case MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER:
317 #ifndef NETSNMP_NO_WRITE_SUPPORT
318 *write_method = write_mteTriggerThresholdDeltaFallingEventOwner;
319 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
320 *var_len =
321 StorageTmp->mteTriggerThresholdDeltaFallingEventOwnerLen;
322 return (u_char *) StorageTmp->
323 mteTriggerThresholdDeltaFallingEventOwner;
324
325 case MTETRIGGERTHRESHOLDDELTAFALLINGEVENT:
326 #ifndef NETSNMP_NO_WRITE_SUPPORT
327 *write_method = write_mteTriggerThresholdDeltaFallingEvent;
328 #endif /* !NETSNMP_NO_WRITE_SUPPORT */
329 *var_len = StorageTmp->mteTriggerThresholdDeltaFallingEventLen;
330 return (u_char *) StorageTmp->mteTriggerThresholdDeltaFallingEvent;
331
332
333 default:
334 ERROR_MSG("");
335 }
336 return NULL;
337 }
338
339
340
341 #ifndef NETSNMP_NO_WRITE_SUPPORT
342 int
343 write_mteTriggerThresholdStartup(int action,
344 u_char * var_val,
345 u_char var_val_type,
346 size_t var_val_len,
347 u_char * statP,
348 oid * name, size_t name_len)
349 {
350 static int tmpvar;
351 struct mteTriggerTable_data *StorageTmp = NULL;
352 size_t newlen =
353 name_len -
354 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
355 1);
356
357
358 DEBUGMSGTL(("mteTriggerThresholdTable",
359 "write_mteTriggerThresholdStartup entering action=%d... \n",
360 action));
361 if ((StorageTmp =
362 header_complex(mteTriggerTableStorage, NULL,
363 &name[sizeof
364 (mteTriggerThresholdTable_variables_oid) /
365 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
366 NULL)) == NULL)
367 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
368
369
370 switch (action) {
371 case RESERVE1:
372 if (var_val_type != ASN_INTEGER) {
373 fprintf(stderr,
374 "write to mteTriggerThresholdStartup not ASN_INTEGER\n");
375 return SNMP_ERR_WRONGTYPE;
376 }
377 if (StorageTmp->storageType != ST_NONVOLATILE)
378 return SNMP_ERR_NOTWRITABLE;
379 break;
380
381
382 case RESERVE2:
383 /*
384 * memory reseveration, final preparation...
385 */
386 break;
387
388
389 case FREE:
390 /*
391 * Release any resources that have been allocated
392 */
393 break;
394
395
396 case ACTION:
397 /*
398 * The variable has been stored in long_ret for
399 * you to use, and you have just been asked to do something with
400 * it. Note that anything done here must be reversable in the UNDO case
401 */
402 tmpvar = StorageTmp->mteTriggerThresholdStartup;
403 StorageTmp->mteTriggerThresholdStartup = *((long *) var_val);
404 break;
405
406
407 case UNDO:
408 /*
409 * Back out any changes made in the ACTION case
410 */
411 StorageTmp->mteTriggerThresholdStartup = tmpvar;
412 break;
413
414
415 case COMMIT:
416 /*
417 * Things are working well, so it's now safe to make the change
418 * permanently. Make sure that anything done here can't fail!
419 */
420
421 break;
422 }
423 return SNMP_ERR_NOERROR;
424 }
425
426
427
428 int
429 write_mteTriggerThresholdRising(int action,
430 u_char * var_val,
431 u_char var_val_type,
432 size_t var_val_len,
433 u_char * statP,
434 oid * name, size_t name_len)
435 {
436 static int tmpvar;
437 struct mteTriggerTable_data *StorageTmp = NULL;
438 size_t newlen =
439 name_len -
440 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
441 1);
442
443
444 DEBUGMSGTL(("mteTriggerThresholdTable",
445 "write_mteTriggerThresholdRising entering action=%d... \n",
446 action));
447 if ((StorageTmp =
448 header_complex(mteTriggerTableStorage, NULL,
449 &name[sizeof
450 (mteTriggerThresholdTable_variables_oid) /
451 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
452 NULL)) == NULL)
453 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
454
455
456 switch (action) {
457 case RESERVE1:
458 if (var_val_type != ASN_INTEGER) {
459 fprintf(stderr,
460 "write to mteTriggerThresholdRising not ASN_INTEGER\n");
461 return SNMP_ERR_WRONGTYPE;
462 }
463 if (StorageTmp->storageType != ST_NONVOLATILE)
464 return SNMP_ERR_NOTWRITABLE;
465 break;
466
467
468 case RESERVE2:
469 /*
470 * memory reseveration, final preparation...
471 */
472 break;
473
474
475 case FREE:
476 /*
477 * Release any resources that have been allocated
478 */
479 break;
480
481
482 case ACTION:
483 /*
484 * The variable has been stored in long_ret for
485 * you to use, and you have just been asked to do something with
486 * it. Note that anything done here must be reversable in the UNDO case
487 */
488 tmpvar = StorageTmp->mteTriggerThresholdRising;
489 StorageTmp->mteTriggerThresholdRising = *((long *) var_val);
490 break;
491
492
493 case UNDO:
494 /*
495 * Back out any changes made in the ACTION case
496 */
497 StorageTmp->mteTriggerThresholdRising = tmpvar;
498 break;
499
500
501 case COMMIT:
502 /*
503 * Things are working well, so it's now safe to make the change
504 * permanently. Make sure that anything done here can't fail!
505 */
506
507 break;
508 }
509 return SNMP_ERR_NOERROR;
510 }
511
512
513
514 int
515 write_mteTriggerThresholdFalling(int action,
516 u_char * var_val,
517 u_char var_val_type,
518 size_t var_val_len,
519 u_char * statP,
520 oid * name, size_t name_len)
521 {
522 static int tmpvar;
523 struct mteTriggerTable_data *StorageTmp = NULL;
524 size_t newlen =
525 name_len -
526 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
527 1);
528
529
530 DEBUGMSGTL(("mteTriggerThresholdTable",
531 "write_mteTriggerThresholdFalling entering action=%d... \n",
532 action));
533 if ((StorageTmp =
534 header_complex(mteTriggerTableStorage, NULL,
535 &name[sizeof
536 (mteTriggerThresholdTable_variables_oid) /
537 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
538 NULL)) == NULL)
539 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
540
541
542 switch (action) {
543 case RESERVE1:
544 if (var_val_type != ASN_INTEGER) {
545 fprintf(stderr,
546 "write to mteTriggerThresholdFalling not ASN_INTEGER\n");
547 return SNMP_ERR_WRONGTYPE;
548 }
549 if (StorageTmp->storageType != ST_NONVOLATILE)
550 return SNMP_ERR_NOTWRITABLE;
551 break;
552
553
554 case RESERVE2:
555 /*
556 * memory reseveration, final preparation...
557 */
558 break;
559
560
561 case FREE:
562 /*
563 * Release any resources that have been allocated
564 */
565 break;
566
567
568 case ACTION:
569 /*
570 * The variable has been stored in long_ret for
571 * you to use, and you have just been asked to do something with
572 * it. Note that anything done here must be reversable in the UNDO case
573 */
574 tmpvar = StorageTmp->mteTriggerThresholdFalling;
575 StorageTmp->mteTriggerThresholdFalling = *((long *) var_val);
576 break;
577
578
579 case UNDO:
580 /*
581 * Back out any changes made in the ACTION case
582 */
583 StorageTmp->mteTriggerThresholdFalling = tmpvar;
584 break;
585
586
587 case COMMIT:
588 /*
589 * Things are working well, so it's now safe to make the change
590 * permanently. Make sure that anything done here can't fail!
591 */
592
593 break;
594 }
595 return SNMP_ERR_NOERROR;
596 }
597
598
599
600 int
601 write_mteTriggerThresholdDeltaRising(int action,
602 u_char * var_val,
603 u_char var_val_type,
604 size_t var_val_len,
605 u_char * statP,
606 oid * name, size_t name_len)
607 {
608 static int tmpvar;
609 struct mteTriggerTable_data *StorageTmp = NULL;
610 size_t newlen =
611 name_len -
612 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
613 1);
614
615
616 DEBUGMSGTL(("mteTriggerThresholdTable",
617 "write_mteTriggerThresholdDeltaRising entering action=%d... \n",
618 action));
619 if ((StorageTmp =
620 header_complex(mteTriggerTableStorage, NULL,
621 &name[sizeof
622 (mteTriggerThresholdTable_variables_oid) /
623 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
624 NULL)) == NULL)
625 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
626
627
628 switch (action) {
629 case RESERVE1:
630 if (var_val_type != ASN_INTEGER) {
631 fprintf(stderr,
632 "write to mteTriggerThresholdDeltaRising not ASN_INTEGER\n");
633 return SNMP_ERR_WRONGTYPE;
634 }
635 if (StorageTmp->storageType != ST_NONVOLATILE)
636 return SNMP_ERR_NOTWRITABLE;
637 break;
638
639
640 case RESERVE2:
641 /*
642 * memory reseveration, final preparation...
643 */
644 break;
645
646
647 case FREE:
648 /*
649 * Release any resources that have been allocated
650 */
651 break;
652
653
654 case ACTION:
655 /*
656 * The variable has been stored in long_ret for
657 * you to use, and you have just been asked to do something with
658 * it. Note that anything done here must be reversable in the UNDO case
659 */
660 tmpvar = StorageTmp->mteTriggerThresholdDeltaRising;
661 StorageTmp->mteTriggerThresholdDeltaRising = *((long *) var_val);
662 break;
663
664
665 case UNDO:
666 /*
667 * Back out any changes made in the ACTION case
668 */
669 StorageTmp->mteTriggerThresholdDeltaRising = tmpvar;
670 break;
671
672
673 case COMMIT:
674 /*
675 * Things are working well, so it's now safe to make the change
676 * permanently. Make sure that anything done here can't fail!
677 */
678
679 break;
680 }
681 return SNMP_ERR_NOERROR;
682 }
683
684
685
686 int
687 write_mteTriggerThresholdDeltaFalling(int action,
688 u_char * var_val,
689 u_char var_val_type,
690 size_t var_val_len,
691 u_char * statP,
692 oid * name, size_t name_len)
693 {
694 static int tmpvar;
695 struct mteTriggerTable_data *StorageTmp = NULL;
696 size_t newlen =
697 name_len -
698 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
699 1);
700
701
702 DEBUGMSGTL(("mteTriggerThresholdTable",
703 "write_mteTriggerThresholdDeltaFalling entering action=%d... \n",
704 action));
705 if ((StorageTmp =
706 header_complex(mteTriggerTableStorage, NULL,
707 &name[sizeof
708 (mteTriggerThresholdTable_variables_oid) /
709 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
710 NULL)) == NULL)
711 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
712
713
714 switch (action) {
715 case RESERVE1:
716 if (var_val_type != ASN_INTEGER) {
717 fprintf(stderr,
718 "write to mteTriggerThresholdDeltaFalling not ASN_INTEGER\n");
719 return SNMP_ERR_WRONGTYPE;
720 }
721 if (StorageTmp->storageType != ST_NONVOLATILE)
722 return SNMP_ERR_NOTWRITABLE;
723 break;
724
725
726 case RESERVE2:
727 /*
728 * memory reseveration, final preparation...
729 */
730 break;
731
732
733 case FREE:
734 /*
735 * Release any resources that have been allocated
736 */
737 break;
738
739
740 case ACTION:
741 /*
742 * The variable has been stored in long_ret for
743 * you to use, and you have just been asked to do something with
744 * it. Note that anything done here must be reversable in the UNDO case
745 */
746 tmpvar = StorageTmp->mteTriggerThresholdDeltaFalling;
747 StorageTmp->mteTriggerThresholdDeltaFalling = *((long *) var_val);
748 break;
749
750
751 case UNDO:
752 /*
753 * Back out any changes made in the ACTION case
754 */
755 StorageTmp->mteTriggerThresholdDeltaFalling = tmpvar;
756 break;
757
758
759 case COMMIT:
760 /*
761 * Things are working well, so it's now safe to make the change
762 * permanently. Make sure that anything done here can't fail!
763 */
764
765 break;
766 }
767 return SNMP_ERR_NOERROR;
768 }
769
770
771
772 int
773 write_mteTriggerThresholdObjectsOwner(int action,
774 u_char * var_val,
775 u_char var_val_type,
776 size_t var_val_len,
777 u_char * statP,
778 oid * name, size_t name_len)
779 {
780 static char *tmpvar;
781 struct mteTriggerTable_data *StorageTmp = NULL;
782 static size_t tmplen;
783 size_t newlen =
784 name_len -
785 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
786 1);
787
788
789 DEBUGMSGTL(("mteTriggerThresholdTable",
790 "write_mteTriggerThresholdObjectsOwner entering action=%d... \n",
791 action));
792 if ((StorageTmp =
793 header_complex(mteTriggerTableStorage, NULL,
794 &name[sizeof
795 (mteTriggerThresholdTable_variables_oid) /
796 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
797 NULL)) == NULL)
798 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
799
800
801 switch (action) {
802 case RESERVE1:
803 if (var_val_type != ASN_OCTET_STR) {
804 fprintf(stderr,
805 "write to mteTriggerThresholdObjectsOwner not ASN_OCTET_STR\n");
806 return SNMP_ERR_WRONGTYPE;
807 }
808 if (StorageTmp->storageType != ST_NONVOLATILE)
809 return SNMP_ERR_NOTWRITABLE;
810 break;
811
812
813 case RESERVE2:
814 /*
815 * memory reseveration, final preparation...
816 */
817 break;
818
819
820 case FREE:
821 /*
822 * Release any resources that have been allocated
823 */
824 break;
825
826
827 case ACTION:
828 /*
829 * The variable has been stored in string for
830 * you to use, and you have just been asked to do something with
831 * it. Note that anything done here must be reversable in the UNDO case
832 */
833 tmpvar = StorageTmp->mteTriggerThresholdObjectsOwner;
834 tmplen = StorageTmp->mteTriggerThresholdObjectsOwnerLen;
835 StorageTmp->mteTriggerThresholdObjectsOwner =
836 netsnmp_memdup(var_val, var_val_len);
837 StorageTmp->mteTriggerThresholdObjectsOwnerLen = var_val_len;
838 break;
839
840
841 case UNDO:
842 /*
843 * Back out any changes made in the ACTION case
844 */
845 SNMP_FREE(StorageTmp->mteTriggerThresholdObjectsOwner);
846 StorageTmp->mteTriggerThresholdObjectsOwner = tmpvar;
847 StorageTmp->mteTriggerThresholdObjectsOwnerLen = tmplen;
848 break;
849
850
851 case COMMIT:
852 /*
853 * Things are working well, so it's now safe to make the change
854 * permanently. Make sure that anything done here can't fail!
855 */
856 SNMP_FREE(tmpvar);
857 break;
858 }
859 return SNMP_ERR_NOERROR;
860 }
861
862
863
864 int
865 write_mteTriggerThresholdObjects(int action,
866 u_char * var_val,
867 u_char var_val_type,
868 size_t var_val_len,
869 u_char * statP,
870 oid * name, size_t name_len)
871 {
872 static char *tmpvar;
873 struct mteTriggerTable_data *StorageTmp = NULL;
874 static size_t tmplen;
875 size_t newlen =
876 name_len -
877 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
878 1);
879
880
881 DEBUGMSGTL(("mteTriggerThresholdTable",
882 "write_mteTriggerThresholdObjects entering action=%d... \n",
883 action));
884 if ((StorageTmp =
885 header_complex(mteTriggerTableStorage, NULL,
886 &name[sizeof
887 (mteTriggerThresholdTable_variables_oid) /
888 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
889 NULL)) == NULL)
890 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
891
892
893 switch (action) {
894 case RESERVE1:
895 if (var_val_type != ASN_OCTET_STR) {
896 fprintf(stderr,
897 "write to mteTriggerThresholdObjects not ASN_OCTET_STR\n");
898 return SNMP_ERR_WRONGTYPE;
899 }
900 if (StorageTmp->storageType != ST_NONVOLATILE)
901 return SNMP_ERR_NOTWRITABLE;
902 break;
903
904
905 case RESERVE2:
906 /*
907 * memory reseveration, final preparation...
908 */
909 break;
910
911
912 case FREE:
913 /*
914 * Release any resources that have been allocated
915 */
916 break;
917
918
919 case ACTION:
920 /*
921 * The variable has been stored in string for
922 * you to use, and you have just been asked to do something with
923 * it. Note that anything done here must be reversable in the UNDO case
924 */
925 tmpvar = StorageTmp->mteTriggerThresholdObjects;
926 tmplen = StorageTmp->mteTriggerThresholdObjectsLen;
927 StorageTmp->mteTriggerThresholdObjects =
928 netsnmp_memdup(var_val, var_val_len);
929 StorageTmp->mteTriggerThresholdObjectsLen = var_val_len;
930 break;
931
932
933 case UNDO:
934 /*
935 * Back out any changes made in the ACTION case
936 */
937 SNMP_FREE(StorageTmp->mteTriggerThresholdObjects);
938 StorageTmp->mteTriggerThresholdObjects = tmpvar;
939 StorageTmp->mteTriggerThresholdObjectsLen = tmplen;
940 break;
941
942
943 case COMMIT:
944 /*
945 * Things are working well, so it's now safe to make the change
946 * permanently. Make sure that anything done here can't fail!
947 */
948 SNMP_FREE(tmpvar);
949 break;
950 }
951 return SNMP_ERR_NOERROR;
952 }
953
954
955
956 int
957 write_mteTriggerThresholdRisingEventOwner(int action,
958 u_char * var_val,
959 u_char var_val_type,
960 size_t var_val_len,
961 u_char * statP,
962 oid * name, size_t name_len)
963 {
964 static char *tmpvar;
965 struct mteTriggerTable_data *StorageTmp = NULL;
966 static size_t tmplen;
967 size_t newlen =
968 name_len -
969 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
970 1);
971
972
973 DEBUGMSGTL(("mteTriggerThresholdTable",
974 "write_mteTriggerThresholdRisingEventOwner entering action=%d... \n",
975 action));
976 if ((StorageTmp =
977 header_complex(mteTriggerTableStorage, NULL,
978 &name[sizeof
979 (mteTriggerThresholdTable_variables_oid) /
980 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
981 NULL)) == NULL)
982 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
983
984
985 switch (action) {
986 case RESERVE1:
987 if (var_val_type != ASN_OCTET_STR) {
988 fprintf(stderr,
989 "write to mteTriggerThresholdRisingEventOwner not ASN_OCTET_STR\n");
990 return SNMP_ERR_WRONGTYPE;
991 }
992 if (StorageTmp->storageType != ST_NONVOLATILE)
993 return SNMP_ERR_NOTWRITABLE;
994 break;
995
996
997 case RESERVE2:
998 /*
999 * memory reseveration, final preparation...
1000 */
1001 break;
1002
1003
1004 case FREE:
1005 /*
1006 * Release any resources that have been allocated
1007 */
1008 break;
1009
1010
1011 case ACTION:
1012 /*
1013 * The variable has been stored in string for
1014 * you to use, and you have just been asked to do something with
1015 * it. Note that anything done here must be reversable in the UNDO case
1016 */
1017 tmpvar = StorageTmp->mteTriggerThresholdRisingEventOwner;
1018 tmplen = StorageTmp->mteTriggerThresholdRisingEventOwnerLen;
1019 StorageTmp->mteTriggerThresholdRisingEventOwner =
1020 netsnmp_memdup(var_val, var_val_len);
1021 StorageTmp->mteTriggerThresholdRisingEventOwnerLen = var_val_len;
1022 break;
1023
1024
1025 case UNDO:
1026 /*
1027 * Back out any changes made in the ACTION case
1028 */
1029 SNMP_FREE(StorageTmp->mteTriggerThresholdRisingEventOwner);
1030 StorageTmp->mteTriggerThresholdRisingEventOwner = tmpvar;
1031 StorageTmp->mteTriggerThresholdRisingEventOwnerLen = tmplen;
1032 break;
1033
1034
1035 case COMMIT:
1036 /*
1037 * Things are working well, so it's now safe to make the change
1038 * permanently. Make sure that anything done here can't fail!
1039 */
1040 SNMP_FREE(tmpvar);
1041 break;
1042 }
1043 return SNMP_ERR_NOERROR;
1044 }
1045
1046
1047
1048 int
1049 write_mteTriggerThresholdRisingEvent(int action,
1050 u_char * var_val,
1051 u_char var_val_type,
1052 size_t var_val_len,
1053 u_char * statP,
1054 oid * name, size_t name_len)
1055 {
1056 static char *tmpvar;
1057 struct mteTriggerTable_data *StorageTmp = NULL;
1058 static size_t tmplen;
1059 size_t newlen =
1060 name_len -
1061 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
1062 1);
1063
1064
1065 DEBUGMSGTL(("mteTriggerThresholdTable",
1066 "write_mteTriggerThresholdRisingEvent entering action=%d... \n",
1067 action));
1068 if ((StorageTmp =
1069 header_complex(mteTriggerTableStorage, NULL,
1070 &name[sizeof
1071 (mteTriggerThresholdTable_variables_oid) /
1072 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
1073 NULL)) == NULL)
1074 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
1075
1076
1077 switch (action) {
1078 case RESERVE1:
1079 if (var_val_type != ASN_OCTET_STR) {
1080 fprintf(stderr,
1081 "write to mteTriggerThresholdRisingEvent not ASN_OCTET_STR\n");
1082 return SNMP_ERR_WRONGTYPE;
1083 }
1084 if (StorageTmp->storageType != ST_NONVOLATILE)
1085 return SNMP_ERR_NOTWRITABLE;
1086 break;
1087
1088
1089 case RESERVE2:
1090 /*
1091 * memory reseveration, final preparation...
1092 */
1093 break;
1094
1095
1096 case FREE:
1097 /*
1098 * Release any resources that have been allocated
1099 */
1100 break;
1101
1102
1103 case ACTION:
1104 /*
1105 * The variable has been stored in string for
1106 * you to use, and you have just been asked to do something with
1107 * it. Note that anything done here must be reversable in the UNDO case
1108 */
1109 tmpvar = StorageTmp->mteTriggerThresholdRisingEvent;
1110 tmplen = StorageTmp->mteTriggerThresholdRisingEventLen;
1111 StorageTmp->mteTriggerThresholdRisingEvent =
1112 netsnmp_memdup(var_val, var_val_len);
1113 StorageTmp->mteTriggerThresholdRisingEventLen = var_val_len;
1114 break;
1115
1116
1117 case UNDO:
1118 /*
1119 * Back out any changes made in the ACTION case
1120 */
1121 SNMP_FREE(StorageTmp->mteTriggerThresholdRisingEvent);
1122 StorageTmp->mteTriggerThresholdRisingEvent = tmpvar;
1123 StorageTmp->mteTriggerThresholdRisingEventLen = tmplen;
1124 break;
1125
1126
1127 case COMMIT:
1128 /*
1129 * Things are working well, so it's now safe to make the change
1130 * permanently. Make sure that anything done here can't fail!
1131 */
1132 SNMP_FREE(tmpvar);
1133 break;
1134 }
1135 return SNMP_ERR_NOERROR;
1136 }
1137
1138
1139
1140 int
1141 write_mteTriggerThresholdFallingEventOwner(int action,
1142 u_char * var_val,
1143 u_char var_val_type,
1144 size_t var_val_len,
1145 u_char * statP,
1146 oid * name, size_t name_len)
1147 {
1148 static char *tmpvar;
1149 struct mteTriggerTable_data *StorageTmp = NULL;
1150 static size_t tmplen;
1151 size_t newlen =
1152 name_len -
1153 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
1154 1);
1155
1156
1157 DEBUGMSGTL(("mteTriggerThresholdTable",
1158 "write_mteTriggerThresholdFallingEventOwner entering action=%d... \n",
1159 action));
1160 if ((StorageTmp =
1161 header_complex(mteTriggerTableStorage, NULL,
1162 &name[sizeof
1163 (mteTriggerThresholdTable_variables_oid) /
1164 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
1165 NULL)) == NULL)
1166 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
1167
1168
1169 switch (action) {
1170 case RESERVE1:
1171 if (var_val_type != ASN_OCTET_STR) {
1172 fprintf(stderr,
1173 "write to mteTriggerThresholdFallingEventOwner not ASN_OCTET_STR\n");
1174 return SNMP_ERR_WRONGTYPE;
1175 }
1176 if (StorageTmp->storageType != ST_NONVOLATILE)
1177 return SNMP_ERR_NOTWRITABLE;
1178 break;
1179
1180
1181 case RESERVE2:
1182 /*
1183 * memory reseveration, final preparation...
1184 */
1185 break;
1186
1187
1188 case FREE:
1189 /*
1190 * Release any resources that have been allocated
1191 */
1192 break;
1193
1194
1195 case ACTION:
1196 /*
1197 * The variable has been stored in string for
1198 * you to use, and you have just been asked to do something with
1199 * it. Note that anything done here must be reversable in the UNDO case
1200 */
1201 tmpvar = StorageTmp->mteTriggerThresholdFallingEventOwner;
1202 tmplen = StorageTmp->mteTriggerThresholdFallingEventOwnerLen;
1203 StorageTmp->mteTriggerThresholdFallingEventOwner =
1204 netsnmp_memdup(var_val, var_val_len);
1205 StorageTmp->mteTriggerThresholdFallingEventOwnerLen = var_val_len;
1206 break;
1207
1208
1209 case UNDO:
1210 /*
1211 * Back out any changes made in the ACTION case
1212 */
1213 SNMP_FREE(StorageTmp->mteTriggerThresholdFallingEventOwner);
1214 StorageTmp->mteTriggerThresholdFallingEventOwner = tmpvar;
1215 StorageTmp->mteTriggerThresholdFallingEventOwnerLen = tmplen;
1216 break;
1217
1218
1219 case COMMIT:
1220 /*
1221 * Things are working well, so it's now safe to make the change
1222 * permanently. Make sure that anything done here can't fail!
1223 */
1224 SNMP_FREE(tmpvar);
1225 break;
1226 }
1227 return SNMP_ERR_NOERROR;
1228 }
1229
1230
1231
1232 int
1233 write_mteTriggerThresholdFallingEvent(int action,
1234 u_char * var_val,
1235 u_char var_val_type,
1236 size_t var_val_len,
1237 u_char * statP,
1238 oid * name, size_t name_len)
1239 {
1240 static char *tmpvar;
1241 struct mteTriggerTable_data *StorageTmp = NULL;
1242 static size_t tmplen;
1243 size_t newlen =
1244 name_len -
1245 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
1246 1);
1247
1248
1249 DEBUGMSGTL(("mteTriggerThresholdTable",
1250 "write_mteTriggerThresholdFallingEvent entering action=%d... \n",
1251 action));
1252 if ((StorageTmp =
1253 header_complex(mteTriggerTableStorage, NULL,
1254 &name[sizeof
1255 (mteTriggerThresholdTable_variables_oid) /
1256 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
1257 NULL)) == NULL)
1258 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
1259
1260
1261 switch (action) {
1262 case RESERVE1:
1263 if (var_val_type != ASN_OCTET_STR) {
1264 fprintf(stderr,
1265 "write to mteTriggerThresholdFallingEvent not ASN_OCTET_STR\n");
1266 return SNMP_ERR_WRONGTYPE;
1267 }
1268 if (StorageTmp->storageType != ST_NONVOLATILE)
1269 return SNMP_ERR_NOTWRITABLE;
1270 break;
1271
1272
1273 case RESERVE2:
1274 /*
1275 * memory reseveration, final preparation...
1276 */
1277 break;
1278
1279
1280 case FREE:
1281 /*
1282 * Release any resources that have been allocated
1283 */
1284 break;
1285
1286
1287 case ACTION:
1288 /*
1289 * The variable has been stored in string for
1290 * you to use, and you have just been asked to do something with
1291 * it. Note that anything done here must be reversable in the UNDO case
1292 */
1293 tmpvar = StorageTmp->mteTriggerThresholdFallingEvent;
1294 tmplen = StorageTmp->mteTriggerThresholdFallingEventLen;
1295 StorageTmp->mteTriggerThresholdFallingEvent =
1296 netsnmp_memdup(var_val, var_val_len);
1297 StorageTmp->mteTriggerThresholdFallingEventLen = var_val_len;
1298 break;
1299
1300
1301 case UNDO:
1302 /*
1303 * Back out any changes made in the ACTION case
1304 */
1305 SNMP_FREE(StorageTmp->mteTriggerThresholdFallingEvent);
1306 StorageTmp->mteTriggerThresholdFallingEvent = tmpvar;
1307 StorageTmp->mteTriggerThresholdFallingEventLen = tmplen;
1308 break;
1309
1310
1311 case COMMIT:
1312 /*
1313 * Things are working well, so it's now safe to make the change
1314 * permanently. Make sure that anything done here can't fail!
1315 */
1316 SNMP_FREE(tmpvar);
1317 break;
1318 }
1319 return SNMP_ERR_NOERROR;
1320 }
1321
1322
1323
1324 int
1325 write_mteTriggerThresholdDeltaRisingEventOwner(int action,
1326 u_char * var_val,
1327 u_char var_val_type,
1328 size_t var_val_len,
1329 u_char * statP,
1330 oid * name, size_t name_len)
1331 {
1332 static char *tmpvar;
1333 struct mteTriggerTable_data *StorageTmp = NULL;
1334 static size_t tmplen;
1335 size_t newlen =
1336 name_len -
1337 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
1338 1);
1339
1340
1341 DEBUGMSGTL(("mteTriggerThresholdTable",
1342 "write_mteTriggerThresholdDeltaRisingEventOwner entering action=%d... \n",
1343 action));
1344 if ((StorageTmp =
1345 header_complex(mteTriggerTableStorage, NULL,
1346 &name[sizeof
1347 (mteTriggerThresholdTable_variables_oid) /
1348 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
1349 NULL)) == NULL)
1350 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
1351
1352
1353 switch (action) {
1354 case RESERVE1:
1355 if (var_val_type != ASN_OCTET_STR) {
1356 fprintf(stderr,
1357 "write to mteTriggerThresholdDeltaRisingEventOwner not ASN_OCTET_STR\n");
1358 return SNMP_ERR_WRONGTYPE;
1359 }
1360 if (StorageTmp->storageType != ST_NONVOLATILE)
1361 return SNMP_ERR_NOTWRITABLE;
1362 break;
1363
1364
1365 case RESERVE2:
1366 /*
1367 * memory reseveration, final preparation...
1368 */
1369 break;
1370
1371
1372 case FREE:
1373 /*
1374 * Release any resources that have been allocated
1375 */
1376 break;
1377
1378
1379 case ACTION:
1380 /*
1381 * The variable has been stored in string for
1382 * you to use, and you have just been asked to do something with
1383 * it. Note that anything done here must be reversable in the UNDO case
1384 */
1385 tmpvar = StorageTmp->mteTriggerThresholdDeltaRisingEventOwner;
1386 tmplen = StorageTmp->mteTriggerThresholdDeltaRisingEventOwnerLen;
1387 StorageTmp->mteTriggerThresholdDeltaRisingEventOwner =
1388 netsnmp_memdup(var_val, var_val_len);
1389 StorageTmp->mteTriggerThresholdDeltaRisingEventOwnerLen =
1390 var_val_len;
1391 break;
1392
1393
1394 case UNDO:
1395 /*
1396 * Back out any changes made in the ACTION case
1397 */
1398 SNMP_FREE(StorageTmp->mteTriggerThresholdDeltaRisingEventOwner);
1399 StorageTmp->mteTriggerThresholdDeltaRisingEventOwner = tmpvar;
1400 StorageTmp->mteTriggerThresholdDeltaRisingEventOwnerLen = tmplen;
1401 break;
1402
1403
1404 case COMMIT:
1405 /*
1406 * Things are working well, so it's now safe to make the change
1407 * permanently. Make sure that anything done here can't fail!
1408 */
1409 SNMP_FREE(tmpvar);
1410 break;
1411 }
1412 return SNMP_ERR_NOERROR;
1413 }
1414
1415
1416
1417 int
1418 write_mteTriggerThresholdDeltaRisingEvent(int action,
1419 u_char * var_val,
1420 u_char var_val_type,
1421 size_t var_val_len,
1422 u_char * statP,
1423 oid * name, size_t name_len)
1424 {
1425 static char *tmpvar;
1426 struct mteTriggerTable_data *StorageTmp = NULL;
1427 static size_t tmplen;
1428 size_t newlen =
1429 name_len -
1430 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
1431 1);
1432
1433
1434 DEBUGMSGTL(("mteTriggerThresholdTable",
1435 "write_mteTriggerThresholdDeltaRisingEvent entering action=%d... \n",
1436 action));
1437 if ((StorageTmp =
1438 header_complex(mteTriggerTableStorage, NULL,
1439 &name[sizeof
1440 (mteTriggerThresholdTable_variables_oid) /
1441 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
1442 NULL)) == NULL)
1443 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
1444
1445
1446 switch (action) {
1447 case RESERVE1:
1448 if (var_val_type != ASN_OCTET_STR) {
1449 fprintf(stderr,
1450 "write to mteTriggerThresholdDeltaRisingEvent not ASN_OCTET_STR\n");
1451 return SNMP_ERR_WRONGTYPE;
1452 }
1453 if (StorageTmp->storageType != ST_NONVOLATILE)
1454 return SNMP_ERR_NOTWRITABLE;
1455 break;
1456
1457
1458 case RESERVE2:
1459 /*
1460 * memory reseveration, final preparation...
1461 */
1462 break;
1463
1464
1465 case FREE:
1466 /*
1467 * Release any resources that have been allocated
1468 */
1469 break;
1470
1471
1472 case ACTION:
1473 /*
1474 * The variable has been stored in string for
1475 * you to use, and you have just been asked to do something with
1476 * it. Note that anything done here must be reversable in the UNDO case
1477 */
1478 tmpvar = StorageTmp->mteTriggerThresholdDeltaRisingEvent;
1479 tmplen = StorageTmp->mteTriggerThresholdDeltaRisingEventLen;
1480 StorageTmp->mteTriggerThresholdDeltaRisingEvent =
1481 netsnmp_memdup(var_val, var_val_len);
1482 StorageTmp->mteTriggerThresholdDeltaRisingEventLen = var_val_len;
1483 break;
1484
1485
1486 case UNDO:
1487 /*
1488 * Back out any changes made in the ACTION case
1489 */
1490 SNMP_FREE(StorageTmp->mteTriggerThresholdDeltaRisingEvent);
1491 StorageTmp->mteTriggerThresholdDeltaRisingEvent = tmpvar;
1492 StorageTmp->mteTriggerThresholdDeltaRisingEventLen = tmplen;
1493 break;
1494
1495
1496 case COMMIT:
1497 /*
1498 * Things are working well, so it's now safe to make the change
1499 * permanently. Make sure that anything done here can't fail!
1500 */
1501 SNMP_FREE(tmpvar);
1502 break;
1503 }
1504 return SNMP_ERR_NOERROR;
1505 }
1506
1507
1508
1509 int
1510 write_mteTriggerThresholdDeltaFallingEventOwner(int action,
1511 u_char * var_val,
1512 u_char var_val_type,
1513 size_t var_val_len,
1514 u_char * statP,
1515 oid * name,
1516 size_t name_len)
1517 {
1518 static char *tmpvar;
1519 struct mteTriggerTable_data *StorageTmp = NULL;
1520 static size_t tmplen;
1521 size_t newlen =
1522 name_len -
1523 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
1524 1);
1525
1526
1527 DEBUGMSGTL(("mteTriggerThresholdTable",
1528 "write_mteTriggerThresholdDeltaFallingEventOwner entering action=%d... \n",
1529 action));
1530 if ((StorageTmp =
1531 header_complex(mteTriggerTableStorage, NULL,
1532 &name[sizeof
1533 (mteTriggerThresholdTable_variables_oid) /
1534 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
1535 NULL)) == NULL)
1536 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
1537
1538
1539 switch (action) {
1540 case RESERVE1:
1541 if (var_val_type != ASN_OCTET_STR) {
1542 fprintf(stderr,
1543 "write to mteTriggerThresholdDeltaFallingEventOwner not ASN_OCTET_STR\n");
1544 return SNMP_ERR_WRONGTYPE;
1545 }
1546 if (StorageTmp->storageType != ST_NONVOLATILE)
1547 return SNMP_ERR_NOTWRITABLE;
1548 break;
1549
1550
1551 case RESERVE2:
1552 /*
1553 * memory reseveration, final preparation...
1554 */
1555 break;
1556
1557
1558 case FREE:
1559 /*
1560 * Release any resources that have been allocated
1561 */
1562 break;
1563
1564
1565 case ACTION:
1566 /*
1567 * The variable has been stored in string for
1568 * you to use, and you have just been asked to do something with
1569 * it. Note that anything done here must be reversable in the UNDO case
1570 */
1571 tmpvar = StorageTmp->mteTriggerThresholdDeltaFallingEventOwner;
1572 tmplen = StorageTmp->mteTriggerThresholdDeltaFallingEventOwnerLen;
1573 StorageTmp->mteTriggerThresholdDeltaFallingEventOwner =
1574 netsnmp_memdup(var_val, var_val_len);
1575 StorageTmp->mteTriggerThresholdDeltaFallingEventOwnerLen =
1576 var_val_len;
1577 break;
1578
1579
1580 case UNDO:
1581 /*
1582 * Back out any changes made in the ACTION case
1583 */
1584 SNMP_FREE(StorageTmp->mteTriggerThresholdDeltaFallingEventOwner);
1585 StorageTmp->mteTriggerThresholdDeltaFallingEventOwner = tmpvar;
1586 StorageTmp->mteTriggerThresholdDeltaFallingEventOwnerLen = tmplen;
1587 break;
1588
1589
1590 case COMMIT:
1591 /*
1592 * Things are working well, so it's now safe to make the change
1593 * permanently. Make sure that anything done here can't fail!
1594 */
1595 SNMP_FREE(tmpvar);
1596 break;
1597 }
1598 return SNMP_ERR_NOERROR;
1599 }
1600
1601
1602
1603 int
1604 write_mteTriggerThresholdDeltaFallingEvent(int action,
1605 u_char * var_val,
1606 u_char var_val_type,
1607 size_t var_val_len,
1608 u_char * statP,
1609 oid * name, size_t name_len)
1610 {
1611 static char *tmpvar;
1612 struct mteTriggerTable_data *StorageTmp = NULL;
1613 static size_t tmplen;
1614 size_t newlen =
1615 name_len -
1616 (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
1617 1);
1618
1619
1620 DEBUGMSGTL(("mteTriggerThresholdTable",
1621 "write_mteTriggerThresholdDeltaFallingEvent entering action=%d... \n",
1622 action));
1623 if ((StorageTmp =
1624 header_complex(mteTriggerTableStorage, NULL,
1625 &name[sizeof
1626 (mteTriggerThresholdTable_variables_oid) /
1627 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
1628 NULL)) == NULL)
1629 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
1630
1631
1632 switch (action) {
1633 case RESERVE1:
1634 if (var_val_type != ASN_OCTET_STR) {
1635 fprintf(stderr,
1636 "write to mteTriggerThresholdDeltaFallingEvent not ASN_OCTET_STR\n");
1637 return SNMP_ERR_WRONGTYPE;
1638 }
1639 if (StorageTmp->storageType != ST_NONVOLATILE)
1640 return SNMP_ERR_NOTWRITABLE;
1641 break;
1642
1643
1644 case RESERVE2:
1645 /*
1646 * memory reseveration, final preparation...
1647 */
1648 break;
1649
1650
1651 case FREE:
1652 /*
1653 * Release any resources that have been allocated
1654 */
1655 break;
1656
1657
1658 case ACTION:
1659 /*
1660 * The variable has been stored in string for
1661 * you to use, and you have just been asked to do something with
1662 * it. Note that anything done here must be reversable in the UNDO case
1663 */
1664 tmpvar = StorageTmp->mteTriggerThresholdDeltaFallingEvent;
1665 tmplen = StorageTmp->mteTriggerThresholdDeltaFallingEventLen;
1666 StorageTmp->mteTriggerThresholdDeltaFallingEvent =
1667 netsnmp_memdup(var_val, var_val_len);
1668 StorageTmp->mteTriggerThresholdDeltaFallingEventLen = var_val_len;
1669 break;
1670
1671
1672 case UNDO:
1673 /*
1674 * Back out any changes made in the ACTION case
1675 */
1676 SNMP_FREE(StorageTmp->mteTriggerThresholdDeltaFallingEvent);
1677 StorageTmp->mteTriggerThresholdDeltaFallingEvent = tmpvar;
1678 StorageTmp->mteTriggerThresholdDeltaFallingEventLen = tmplen;
1679 break;
1680
1681
1682 case COMMIT:
1683 /*
1684 * Things are working well, so it's now safe to make the change
1685 * permanently. Make sure that anything done here can't fail!
1686 */
1687 SNMP_FREE(tmpvar);
1688 break;
1689 }
1690 return SNMP_ERR_NOERROR;
1691 }
1692
1693 #endif /* !NETSNMP_NO_WRITE_SUPPORT */