2 * This file was generated by mib2c and is intended for use as
3 * a mib module for the ucd-snmp snmpd agent.
8 * This should always be included first before anything else
10 #include <net-snmp/net-snmp-config.h>
22 * minimal include directives
24 #include <net-snmp/net-snmp-includes.h>
25 #include <net-snmp/agent/net-snmp-agent-includes.h>
27 #include "header_complex.h"
28 #include "mteTriggerExistenceTable.h"
29 #include "mteTriggerTable.h"
33 * mteTriggerExistenceTable_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
40 oid mteTriggerExistenceTable_variables_oid[] =
41 { 1, 3, 6, 1, 2, 1, 88, 1, 2, 4 };
45 * variable2 mteTriggerExistenceTable_variables:
46 * this variable defines function callbacks and type return information
47 * for the mteTriggerExistenceTable mib section
51 struct variable2 mteTriggerExistenceTable_variables[] = {
53 * magic number , variable type , ro/rw , callback fn , L, oidsuffix
55 #define MTETRIGGEREXISTENCETEST 3
56 {MTETRIGGEREXISTENCETEST, ASN_BIT_STR, RWRITE,
57 var_mteTriggerExistenceTable, 2, {1, 1}},
58 #define MTETRIGGEREXISTENCESTARTUP 4
59 {MTETRIGGEREXISTENCESTARTUP, ASN_BIT_STR, RWRITE,
60 var_mteTriggerExistenceTable, 2, {1, 2}},
61 #define MTETRIGGEREXISTENCEOBJECTSOWNER 5
62 {MTETRIGGEREXISTENCEOBJECTSOWNER, ASN_OCTET_STR, RWRITE,
63 var_mteTriggerExistenceTable, 2, {1, 3}},
64 #define MTETRIGGEREXISTENCEOBJECTS 6
65 {MTETRIGGEREXISTENCEOBJECTS, ASN_OCTET_STR, RWRITE,
66 var_mteTriggerExistenceTable, 2, {1, 4}},
67 #define MTETRIGGEREXISTENCEEVENTOWNER 7
68 {MTETRIGGEREXISTENCEEVENTOWNER, ASN_OCTET_STR, RWRITE,
69 var_mteTriggerExistenceTable, 2, {1, 5}},
70 #define MTETRIGGEREXISTENCEEVENT 8
71 {MTETRIGGEREXISTENCEEVENT, ASN_OCTET_STR, RWRITE,
72 var_mteTriggerExistenceTable, 2, {1, 6}},
76 * (L = length of the oidsuffix)
81 * global storage of our data, saved in and configured by header_complex()
83 extern struct header_complex_index *mteTriggerTableStorage;
89 * init_mteTriggerExistenceTable():
90 * Initialization routine. This is called when the agent starts up.
91 * At a minimum, registration of your variables should take place here.
94 init_mteTriggerExistenceTable(void)
96 DEBUGMSGTL(("mteTriggerExistenceTable", "initializing... "));
100 * register ourselves with the agent to handle our mib tree
102 REGISTER_MIB("mteTriggerExistenceTable",
103 mteTriggerExistenceTable_variables, variable2,
104 mteTriggerExistenceTable_variables_oid);
108 * place any other initialization junk you need here
112 DEBUGMSGTL(("mteTriggerExistenceTable", "done.\n"));
116 * var_mteTriggerExistenceTable():
117 * Handle this table separately from the scalar value case.
118 * The workings of this are basically the same as for var_mteTriggerExistenceTable above.
121 var_mteTriggerExistenceTable(struct variable *vp,
125 size_t * var_len, WriteMethod ** write_method)
129 struct mteTriggerTable_data *StorageTmp = NULL;
132 DEBUGMSGTL(("mteTriggerExistenceTable",
133 "var_mteTriggerExistenceTable: Entering... \n"));
135 * this assumes you have registered all your data properly
138 header_complex(mteTriggerTableStorage, vp, name, length, exact,
139 var_len, write_method)) == NULL)
142 if (!(StorageTmp->mteTriggerTest[0] & MTETRIGGERTEST_EXISTENCE))
146 * this is where we do the value assignments for the mib results.
151 case MTETRIGGEREXISTENCETEST:
152 *write_method = write_mteTriggerExistenceTest;
153 *var_len = StorageTmp->mteTriggerExistenceTestLen;
154 return (u_char *) StorageTmp->mteTriggerExistenceTest;
156 case MTETRIGGEREXISTENCESTARTUP:
157 *write_method = write_mteTriggerExistenceStartup;
158 *var_len = StorageTmp->mteTriggerExistenceStartupLen;
159 return (u_char *) StorageTmp->mteTriggerExistenceStartup;
161 case MTETRIGGEREXISTENCEOBJECTSOWNER:
162 *write_method = write_mteTriggerExistenceObjectsOwner;
163 *var_len = StorageTmp->mteTriggerExistenceObjectsOwnerLen;
164 return (u_char *) StorageTmp->mteTriggerExistenceObjectsOwner;
166 case MTETRIGGEREXISTENCEOBJECTS:
167 *write_method = write_mteTriggerExistenceObjects;
168 *var_len = StorageTmp->mteTriggerExistenceObjectsLen;
169 return (u_char *) StorageTmp->mteTriggerExistenceObjects;
171 case MTETRIGGEREXISTENCEEVENTOWNER:
172 *write_method = write_mteTriggerExistenceEventOwner;
173 *var_len = StorageTmp->mteTriggerExistenceEventOwnerLen;
174 return (u_char *) StorageTmp->mteTriggerExistenceEventOwner;
176 case MTETRIGGEREXISTENCEEVENT:
177 *write_method = write_mteTriggerExistenceEvent;
178 *var_len = StorageTmp->mteTriggerExistenceEventLen;
179 return (u_char *) StorageTmp->mteTriggerExistenceEvent;
192 write_mteTriggerExistenceTest(int action,
196 u_char * statP, oid * name, size_t name_len)
199 struct mteTriggerTable_data *StorageTmp = NULL;
200 static size_t tmplen;
203 (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
207 DEBUGMSGTL(("mteTriggerExistenceTable",
208 "write_mteTriggerExistenceTest entering action=%d... \n",
211 header_complex(mteTriggerTableStorage, NULL,
213 (mteTriggerExistenceTable_variables_oid) /
214 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
216 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
221 if (var_val_type != ASN_OCTET_STR) {
223 "write to mteTriggerExistenceTest not ASN_OCTET_STR\n");
224 return SNMP_ERR_WRONGTYPE;
226 if (StorageTmp->storageType != ST_NONVOLATILE)
227 return SNMP_ERR_NOTWRITABLE;
233 * memory reseveration, final preparation...
240 * Release any resources that have been allocated
247 * The variable has been stored in string for
248 * you to use, and you have just been asked to do something with
249 * it. Note that anything done here must be reversable in the UNDO case
251 tmpvar = StorageTmp->mteTriggerExistenceTest;
252 tmplen = StorageTmp->mteTriggerExistenceTestLen;
253 memdup((u_char **) & StorageTmp->mteTriggerExistenceTest, var_val,
255 StorageTmp->mteTriggerExistenceTestLen = var_val_len;
261 * Back out any changes made in the ACTION case
263 SNMP_FREE(StorageTmp->mteTriggerExistenceTest);
264 StorageTmp->mteTriggerExistenceTest = tmpvar;
265 StorageTmp->mteTriggerExistenceTestLen = tmplen;
271 * Things are working well, so it's now safe to make the change
272 * permanently. Make sure that anything done here can't fail!
277 return SNMP_ERR_NOERROR;
283 write_mteTriggerExistenceStartup(int action,
288 oid * name, size_t name_len)
291 struct mteTriggerTable_data *StorageTmp = NULL;
292 static size_t tmplen;
295 (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
299 DEBUGMSGTL(("mteTriggerExistenceTable",
300 "write_mteTriggerExistenceStartup entering action=%d... \n",
303 header_complex(mteTriggerTableStorage, NULL,
305 (mteTriggerExistenceTable_variables_oid) /
306 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
308 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
313 if (var_val_type != ASN_OCTET_STR) {
315 "write to mteTriggerExistenceStartup not ASN_OCTET_STR\n");
316 return SNMP_ERR_WRONGTYPE;
318 if (StorageTmp->storageType != ST_NONVOLATILE)
319 return SNMP_ERR_NOTWRITABLE;
325 * memory reseveration, final preparation...
332 * Release any resources that have been allocated
339 * The variable has been stored in string for
340 * you to use, and you have just been asked to do something with
341 * it. Note that anything done here must be reversable in the UNDO case
343 tmpvar = StorageTmp->mteTriggerExistenceStartup;
344 tmplen = StorageTmp->mteTriggerExistenceStartupLen;
345 memdup((u_char **) & StorageTmp->mteTriggerExistenceStartup,
346 var_val, var_val_len);
347 StorageTmp->mteTriggerExistenceStartupLen = var_val_len;
353 * Back out any changes made in the ACTION case
355 SNMP_FREE(StorageTmp->mteTriggerExistenceStartup);
356 StorageTmp->mteTriggerExistenceStartup = tmpvar;
357 StorageTmp->mteTriggerExistenceStartupLen = tmplen;
363 * Things are working well, so it's now safe to make the change
364 * permanently. Make sure that anything done here can't fail!
369 return SNMP_ERR_NOERROR;
375 write_mteTriggerExistenceObjectsOwner(int action,
380 oid * name, size_t name_len)
383 struct mteTriggerTable_data *StorageTmp = NULL;
384 static size_t tmplen;
387 (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
391 DEBUGMSGTL(("mteTriggerExistenceTable",
392 "write_mteTriggerExistenceObjectsOwner entering action=%d... \n",
395 header_complex(mteTriggerTableStorage, NULL,
397 (mteTriggerExistenceTable_variables_oid) /
398 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
400 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
405 if (var_val_type != ASN_OCTET_STR) {
407 "write to mteTriggerExistenceObjectsOwner not ASN_OCTET_STR\n");
408 return SNMP_ERR_WRONGTYPE;
410 if (StorageTmp->storageType != ST_NONVOLATILE)
411 return SNMP_ERR_NOTWRITABLE;
417 * memory reseveration, final preparation...
424 * Release any resources that have been allocated
431 * The variable has been stored in string for
432 * you to use, and you have just been asked to do something with
433 * it. Note that anything done here must be reversable in the UNDO case
435 tmpvar = StorageTmp->mteTriggerExistenceObjectsOwner;
436 tmplen = StorageTmp->mteTriggerExistenceObjectsOwnerLen;
437 memdup((u_char **) & StorageTmp->mteTriggerExistenceObjectsOwner,
438 var_val, var_val_len);
439 StorageTmp->mteTriggerExistenceObjectsOwnerLen = var_val_len;
445 * Back out any changes made in the ACTION case
447 SNMP_FREE(StorageTmp->mteTriggerExistenceObjectsOwner);
448 StorageTmp->mteTriggerExistenceObjectsOwner = tmpvar;
449 StorageTmp->mteTriggerExistenceObjectsOwnerLen = tmplen;
455 * Things are working well, so it's now safe to make the change
456 * permanently. Make sure that anything done here can't fail!
461 return SNMP_ERR_NOERROR;
467 write_mteTriggerExistenceObjects(int action,
472 oid * name, size_t name_len)
475 struct mteTriggerTable_data *StorageTmp = NULL;
476 static size_t tmplen;
479 (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
483 DEBUGMSGTL(("mteTriggerExistenceTable",
484 "write_mteTriggerExistenceObjects entering action=%d... \n",
487 header_complex(mteTriggerTableStorage, NULL,
489 (mteTriggerExistenceTable_variables_oid) /
490 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
492 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
497 if (var_val_type != ASN_OCTET_STR) {
499 "write to mteTriggerExistenceObjects not ASN_OCTET_STR\n");
500 return SNMP_ERR_WRONGTYPE;
502 if (StorageTmp->storageType != ST_NONVOLATILE)
503 return SNMP_ERR_NOTWRITABLE;
509 * memory reseveration, final preparation...
516 * Release any resources that have been allocated
523 * The variable has been stored in string for
524 * you to use, and you have just been asked to do something with
525 * it. Note that anything done here must be reversable in the UNDO case
527 tmpvar = StorageTmp->mteTriggerExistenceObjects;
528 tmplen = StorageTmp->mteTriggerExistenceObjectsLen;
529 memdup((u_char **) & StorageTmp->mteTriggerExistenceObjects,
530 var_val, var_val_len);
531 StorageTmp->mteTriggerExistenceObjectsLen = var_val_len;
537 * Back out any changes made in the ACTION case
539 SNMP_FREE(StorageTmp->mteTriggerExistenceObjects);
540 StorageTmp->mteTriggerExistenceObjects = tmpvar;
541 StorageTmp->mteTriggerExistenceObjectsLen = tmplen;
547 * Things are working well, so it's now safe to make the change
548 * permanently. Make sure that anything done here can't fail!
553 return SNMP_ERR_NOERROR;
559 write_mteTriggerExistenceEventOwner(int action,
564 oid * name, size_t name_len)
567 struct mteTriggerTable_data *StorageTmp = NULL;
568 static size_t tmplen;
571 (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
575 DEBUGMSGTL(("mteTriggerExistenceTable",
576 "write_mteTriggerExistenceEventOwner entering action=%d... \n",
579 header_complex(mteTriggerTableStorage, NULL,
581 (mteTriggerExistenceTable_variables_oid) /
582 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
584 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
589 if (var_val_type != ASN_OCTET_STR) {
591 "write to mteTriggerExistenceEventOwner not ASN_OCTET_STR\n");
592 return SNMP_ERR_WRONGTYPE;
594 if (StorageTmp->storageType != ST_NONVOLATILE)
595 return SNMP_ERR_NOTWRITABLE;
601 * memory reseveration, final preparation...
608 * Release any resources that have been allocated
615 * The variable has been stored in string for
616 * you to use, and you have just been asked to do something with
617 * it. Note that anything done here must be reversable in the UNDO case
619 tmpvar = StorageTmp->mteTriggerExistenceEventOwner;
620 tmplen = StorageTmp->mteTriggerExistenceEventOwnerLen;
621 memdup((u_char **) & StorageTmp->mteTriggerExistenceEventOwner,
622 var_val, var_val_len);
623 StorageTmp->mteTriggerExistenceEventOwnerLen = var_val_len;
629 * Back out any changes made in the ACTION case
631 SNMP_FREE(StorageTmp->mteTriggerExistenceEventOwner);
632 StorageTmp->mteTriggerExistenceEventOwner = tmpvar;
633 StorageTmp->mteTriggerExistenceEventOwnerLen = tmplen;
639 * Things are working well, so it's now safe to make the change
640 * permanently. Make sure that anything done here can't fail!
645 return SNMP_ERR_NOERROR;
651 write_mteTriggerExistenceEvent(int action,
655 u_char * statP, oid * name, size_t name_len)
658 struct mteTriggerTable_data *StorageTmp = NULL;
659 static size_t tmplen;
662 (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
666 DEBUGMSGTL(("mteTriggerExistenceTable",
667 "write_mteTriggerExistenceEvent entering action=%d... \n",
670 header_complex(mteTriggerTableStorage, NULL,
672 (mteTriggerExistenceTable_variables_oid) /
673 sizeof(oid) + 3 - 1], &newlen, 1, NULL,
675 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
680 if (var_val_type != ASN_OCTET_STR) {
682 "write to mteTriggerExistenceEvent not ASN_OCTET_STR\n");
683 return SNMP_ERR_WRONGTYPE;
685 if (StorageTmp->storageType != ST_NONVOLATILE)
686 return SNMP_ERR_NOTWRITABLE;
692 * memory reseveration, final preparation...
699 * Release any resources that have been allocated
706 * The variable has been stored in string for
707 * you to use, and you have just been asked to do something with
708 * it. Note that anything done here must be reversable in the UNDO case
710 tmpvar = StorageTmp->mteTriggerExistenceEvent;
711 tmplen = StorageTmp->mteTriggerExistenceEventLen;
712 memdup((u_char **) & StorageTmp->mteTriggerExistenceEvent, var_val,
714 StorageTmp->mteTriggerExistenceEventLen = var_val_len;
720 * Back out any changes made in the ACTION case
722 SNMP_FREE(StorageTmp->mteTriggerExistenceEvent);
723 StorageTmp->mteTriggerExistenceEvent = tmpvar;
724 StorageTmp->mteTriggerExistenceEventLen = tmplen;
730 * Things are working well, so it's now safe to make the change
731 * permanently. Make sure that anything done here can't fail!
736 return SNMP_ERR_NOERROR;