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