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 "mteTriggerBooleanTable.h"
29 #include "mteTriggerTable.h"
33 * mteTriggerBooleanTable_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 mteTriggerBooleanTable_variables_oid[] =
41 { 1, 3, 6, 1, 2, 1, 88, 1, 2, 5 };
45 * variable2 mteTriggerBooleanTable_variables:
46 * this variable defines function callbacks and type return information
47 * for the mteTriggerBooleanTable mib section
51 struct variable2 mteTriggerBooleanTable_variables[] = {
53 * magic number , variable type , ro/rw , callback fn , L, oidsuffix
55 #define MTETRIGGERBOOLEANCOMPARISON 3
56 {MTETRIGGERBOOLEANCOMPARISON, ASN_INTEGER, RWRITE,
57 var_mteTriggerBooleanTable, 2, {1, 1}},
58 #define MTETRIGGERBOOLEANVALUE 4
59 {MTETRIGGERBOOLEANVALUE, ASN_INTEGER, RWRITE,
60 var_mteTriggerBooleanTable, 2, {1, 2}},
61 #define MTETRIGGERBOOLEANSTARTUP 5
62 {MTETRIGGERBOOLEANSTARTUP, ASN_INTEGER, RWRITE,
63 var_mteTriggerBooleanTable, 2, {1, 3}},
64 #define MTETRIGGERBOOLEANOBJECTSOWNER 6
65 {MTETRIGGERBOOLEANOBJECTSOWNER, ASN_OCTET_STR, RWRITE,
66 var_mteTriggerBooleanTable, 2, {1, 4}},
67 #define MTETRIGGERBOOLEANOBJECTS 7
68 {MTETRIGGERBOOLEANOBJECTS, ASN_OCTET_STR, RWRITE,
69 var_mteTriggerBooleanTable, 2, {1, 5}},
70 #define MTETRIGGERBOOLEANEVENTOWNER 8
71 {MTETRIGGERBOOLEANEVENTOWNER, ASN_OCTET_STR, RWRITE,
72 var_mteTriggerBooleanTable, 2, {1, 6}},
73 #define MTETRIGGERBOOLEANEVENT 9
74 {MTETRIGGERBOOLEANEVENT, ASN_OCTET_STR, RWRITE,
75 var_mteTriggerBooleanTable, 2, {1, 7}},
79 * (L = length of the oidsuffix)
84 * global storage of our data, saved in and configured by header_complex()
86 extern struct header_complex_index *mteTriggerTableStorage;
90 * init_mteTriggerBooleanTable():
91 * Initialization routine. This is called when the agent starts up.
92 * At a minimum, registration of your variables should take place here.
95 init_mteTriggerBooleanTable(void)
97 DEBUGMSGTL(("mteTriggerBooleanTable", "initializing... "));
101 * register ourselves with the agent to handle our mib tree
103 REGISTER_MIB("mteTriggerBooleanTable",
104 mteTriggerBooleanTable_variables, variable2,
105 mteTriggerBooleanTable_variables_oid);
107 DEBUGMSGTL(("mteTriggerBooleanTable", "done.\n"));
111 * var_mteTriggerBooleanTable():
112 * Handle this table separately from the scalar value case.
113 * The workings of this are basically the same as for var_mteTriggerBooleanTable above.
116 var_mteTriggerBooleanTable(struct variable *vp,
120 size_t * var_len, WriteMethod ** write_method)
124 struct mteTriggerTable_data *StorageTmp = NULL;
127 DEBUGMSGTL(("mteTriggerBooleanTable",
128 "var_mteTriggerBooleanTable: Entering... \n"));
130 * this assumes you have registered all your data properly
133 header_complex(mteTriggerTableStorage, vp, name, length, exact,
134 var_len, write_method)) == NULL)
137 if (!(StorageTmp->mteTriggerTest[0] & MTETRIGGERTEST_BOOLEAN))
141 * this is where we do the value assignments for the mib results.
146 case MTETRIGGERBOOLEANCOMPARISON:
147 *write_method = write_mteTriggerBooleanComparison;
148 *var_len = sizeof(StorageTmp->mteTriggerBooleanComparison);
149 return (u_char *) & StorageTmp->mteTriggerBooleanComparison;
151 case MTETRIGGERBOOLEANVALUE:
152 *write_method = write_mteTriggerBooleanValue;
153 *var_len = sizeof(StorageTmp->mteTriggerBooleanValue);
154 return (u_char *) & StorageTmp->mteTriggerBooleanValue;
156 case MTETRIGGERBOOLEANSTARTUP:
157 *write_method = write_mteTriggerBooleanStartup;
158 *var_len = sizeof(StorageTmp->mteTriggerBooleanStartup);
159 return (u_char *) & StorageTmp->mteTriggerBooleanStartup;
161 case MTETRIGGERBOOLEANOBJECTSOWNER:
162 *write_method = write_mteTriggerBooleanObjectsOwner;
163 *var_len = StorageTmp->mteTriggerBooleanObjectsOwnerLen;
164 return (u_char *) StorageTmp->mteTriggerBooleanObjectsOwner;
166 case MTETRIGGERBOOLEANOBJECTS:
167 *write_method = write_mteTriggerBooleanObjects;
168 *var_len = StorageTmp->mteTriggerBooleanObjectsLen;
169 return (u_char *) StorageTmp->mteTriggerBooleanObjects;
171 case MTETRIGGERBOOLEANEVENTOWNER:
172 *write_method = write_mteTriggerBooleanEventOwner;
173 *var_len = StorageTmp->mteTriggerBooleanEventOwnerLen;
174 return (u_char *) StorageTmp->mteTriggerBooleanEventOwner;
176 case MTETRIGGERBOOLEANEVENT:
177 *write_method = write_mteTriggerBooleanEvent;
178 *var_len = StorageTmp->mteTriggerBooleanEventLen;
179 return (u_char *) StorageTmp->mteTriggerBooleanEvent;
192 write_mteTriggerBooleanComparison(int action,
197 oid * name, size_t name_len)
200 struct mteTriggerTable_data *StorageTmp = NULL;
203 (sizeof(mteTriggerBooleanTable_variables_oid) / sizeof(oid) + 3 -
207 DEBUGMSGTL(("mteTriggerBooleanTable",
208 "write_mteTriggerBooleanComparison entering action=%d... \n",
211 header_complex(mteTriggerTableStorage, NULL,
212 &name[sizeof(mteTriggerBooleanTable_variables_oid)
213 / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
215 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
220 if (var_val_type != ASN_INTEGER) {
222 "write to mteTriggerBooleanComparison not ASN_INTEGER\n");
223 return SNMP_ERR_WRONGTYPE;
225 if (StorageTmp->storageType != ST_NONVOLATILE)
226 return SNMP_ERR_NOTWRITABLE;
232 * memory reseveration, final preparation...
239 * Release any resources that have been allocated
246 * The variable has been stored in long_ret for
247 * you to use, and you have just been asked to do something with
248 * it. Note that anything done here must be reversable in the UNDO case
250 tmpvar = StorageTmp->mteTriggerBooleanComparison;
251 StorageTmp->mteTriggerBooleanComparison = *((long *) var_val);
257 * Back out any changes made in the ACTION case
259 StorageTmp->mteTriggerBooleanComparison = tmpvar;
265 * Things are working well, so it's now safe to make the change
266 * permanently. Make sure that anything done here can't fail!
271 return SNMP_ERR_NOERROR;
277 write_mteTriggerBooleanValue(int action,
281 u_char * statP, oid * name, size_t name_len)
284 struct mteTriggerTable_data *StorageTmp = NULL;
287 (sizeof(mteTriggerBooleanTable_variables_oid) / sizeof(oid) + 3 -
291 DEBUGMSGTL(("mteTriggerBooleanTable",
292 "write_mteTriggerBooleanValue entering action=%d... \n",
295 header_complex(mteTriggerTableStorage, NULL,
296 &name[sizeof(mteTriggerBooleanTable_variables_oid)
297 / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
299 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
304 if (var_val_type != ASN_INTEGER) {
306 "write to mteTriggerBooleanValue not ASN_INTEGER\n");
307 return SNMP_ERR_WRONGTYPE;
309 if (StorageTmp->storageType != ST_NONVOLATILE)
310 return SNMP_ERR_NOTWRITABLE;
316 * memory reseveration, final preparation...
323 * Release any resources that have been allocated
330 * The variable has been stored in long_ret for
331 * you to use, and you have just been asked to do something with
332 * it. Note that anything done here must be reversable in the UNDO case
334 tmpvar = StorageTmp->mteTriggerBooleanValue;
335 StorageTmp->mteTriggerBooleanValue = *((long *) var_val);
341 * Back out any changes made in the ACTION case
343 StorageTmp->mteTriggerBooleanValue = tmpvar;
349 * Things are working well, so it's now safe to make the change
350 * permanently. Make sure that anything done here can't fail!
355 return SNMP_ERR_NOERROR;
361 write_mteTriggerBooleanStartup(int action,
365 u_char * statP, oid * name, size_t name_len)
368 struct mteTriggerTable_data *StorageTmp = NULL;
371 (sizeof(mteTriggerBooleanTable_variables_oid) / sizeof(oid) + 3 -
375 DEBUGMSGTL(("mteTriggerBooleanTable",
376 "write_mteTriggerBooleanStartup entering action=%d... \n",
379 header_complex(mteTriggerTableStorage, NULL,
380 &name[sizeof(mteTriggerBooleanTable_variables_oid)
381 / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
383 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
388 if (var_val_type != ASN_INTEGER) {
390 "write to mteTriggerBooleanStartup not ASN_INTEGER\n");
391 return SNMP_ERR_WRONGTYPE;
393 if (StorageTmp->storageType != ST_NONVOLATILE)
394 return SNMP_ERR_NOTWRITABLE;
400 * memory reseveration, final preparation...
407 * Release any resources that have been allocated
414 * The variable has been stored in long_ret for
415 * you to use, and you have just been asked to do something with
416 * it. Note that anything done here must be reversable in the UNDO case
418 tmpvar = StorageTmp->mteTriggerBooleanStartup;
419 StorageTmp->mteTriggerBooleanStartup = *((long *) var_val);
425 * Back out any changes made in the ACTION case
427 StorageTmp->mteTriggerBooleanStartup = tmpvar;
433 * Things are working well, so it's now safe to make the change
434 * permanently. Make sure that anything done here can't fail!
439 return SNMP_ERR_NOERROR;
445 write_mteTriggerBooleanObjectsOwner(int action,
450 oid * name, size_t name_len)
453 struct mteTriggerTable_data *StorageTmp = NULL;
454 static size_t tmplen;
457 (sizeof(mteTriggerBooleanTable_variables_oid) / sizeof(oid) + 3 -
461 DEBUGMSGTL(("mteTriggerBooleanTable",
462 "write_mteTriggerBooleanObjectsOwner entering action=%d... \n",
465 header_complex(mteTriggerTableStorage, NULL,
466 &name[sizeof(mteTriggerBooleanTable_variables_oid)
467 / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
469 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
474 if (var_val_type != ASN_OCTET_STR) {
476 "write to mteTriggerBooleanObjectsOwner not ASN_OCTET_STR\n");
477 return SNMP_ERR_WRONGTYPE;
479 if (StorageTmp->storageType != ST_NONVOLATILE)
480 return SNMP_ERR_NOTWRITABLE;
486 * memory reseveration, final preparation...
493 * Release any resources that have been allocated
500 * The variable has been stored in string for
501 * you to use, and you have just been asked to do something with
502 * it. Note that anything done here must be reversable in the UNDO case
504 tmpvar = StorageTmp->mteTriggerBooleanObjectsOwner;
505 tmplen = StorageTmp->mteTriggerBooleanObjectsOwnerLen;
506 StorageTmp->mteTriggerBooleanObjectsOwner =
507 netsnmp_strdup_and_null(var_val, var_val_len);
508 StorageTmp->mteTriggerBooleanObjectsOwnerLen = var_val_len;
514 * Back out any changes made in the ACTION case
516 SNMP_FREE(StorageTmp->mteTriggerBooleanObjectsOwner);
517 StorageTmp->mteTriggerBooleanObjectsOwner = tmpvar;
518 StorageTmp->mteTriggerBooleanObjectsOwnerLen = tmplen;
524 * Things are working well, so it's now safe to make the change
525 * permanently. Make sure that anything done here can't fail!
530 return SNMP_ERR_NOERROR;
536 write_mteTriggerBooleanObjects(int action,
540 u_char * statP, oid * name, size_t name_len)
543 struct mteTriggerTable_data *StorageTmp = NULL;
544 static size_t tmplen;
547 (sizeof(mteTriggerBooleanTable_variables_oid) / sizeof(oid) + 3 -
551 DEBUGMSGTL(("mteTriggerBooleanTable",
552 "write_mteTriggerBooleanObjects entering action=%d... \n",
555 header_complex(mteTriggerTableStorage, NULL,
556 &name[sizeof(mteTriggerBooleanTable_variables_oid)
557 / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
559 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
564 if (var_val_type != ASN_OCTET_STR) {
566 "write to mteTriggerBooleanObjects not ASN_OCTET_STR\n");
567 return SNMP_ERR_WRONGTYPE;
569 if (StorageTmp->storageType != ST_NONVOLATILE)
570 return SNMP_ERR_NOTWRITABLE;
576 * memory reseveration, final preparation...
583 * Release any resources that have been allocated
590 * The variable has been stored in string for
591 * you to use, and you have just been asked to do something with
592 * it. Note that anything done here must be reversable in the UNDO case
594 tmpvar = StorageTmp->mteTriggerBooleanObjects;
595 tmplen = StorageTmp->mteTriggerBooleanObjectsLen;
596 StorageTmp->mteTriggerBooleanObjects =
597 netsnmp_strdup_and_null(var_val, var_val_len);
598 StorageTmp->mteTriggerBooleanObjectsLen = var_val_len;
604 * Back out any changes made in the ACTION case
606 SNMP_FREE(StorageTmp->mteTriggerBooleanObjects);
607 StorageTmp->mteTriggerBooleanObjects = tmpvar;
608 StorageTmp->mteTriggerBooleanObjectsLen = tmplen;
614 * Things are working well, so it's now safe to make the change
615 * permanently. Make sure that anything done here can't fail!
620 return SNMP_ERR_NOERROR;
626 write_mteTriggerBooleanEventOwner(int action,
631 oid * name, size_t name_len)
634 struct mteTriggerTable_data *StorageTmp = NULL;
635 static size_t tmplen;
638 (sizeof(mteTriggerBooleanTable_variables_oid) / sizeof(oid) + 3 -
642 DEBUGMSGTL(("mteTriggerBooleanTable",
643 "write_mteTriggerBooleanEventOwner entering action=%d... \n",
646 header_complex(mteTriggerTableStorage, NULL,
647 &name[sizeof(mteTriggerBooleanTable_variables_oid)
648 / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
650 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
655 if (var_val_type != ASN_OCTET_STR) {
657 "write to mteTriggerBooleanEventOwner not ASN_OCTET_STR\n");
658 return SNMP_ERR_WRONGTYPE;
660 if (StorageTmp->storageType != ST_NONVOLATILE)
661 return SNMP_ERR_NOTWRITABLE;
667 * memory reseveration, final preparation...
674 * Release any resources that have been allocated
681 * The variable has been stored in string for
682 * you to use, and you have just been asked to do something with
683 * it. Note that anything done here must be reversable in the UNDO case
685 tmpvar = StorageTmp->mteTriggerBooleanEventOwner;
686 tmplen = StorageTmp->mteTriggerBooleanEventOwnerLen;
687 StorageTmp->mteTriggerBooleanEventOwner =
688 netsnmp_strdup_and_null(var_val, var_val_len);
689 StorageTmp->mteTriggerBooleanEventOwnerLen = var_val_len;
695 * Back out any changes made in the ACTION case
697 SNMP_FREE(StorageTmp->mteTriggerBooleanEventOwner);
698 StorageTmp->mteTriggerBooleanEventOwner = tmpvar;
699 StorageTmp->mteTriggerBooleanEventOwnerLen = tmplen;
705 * Things are working well, so it's now safe to make the change
706 * permanently. Make sure that anything done here can't fail!
711 return SNMP_ERR_NOERROR;
717 write_mteTriggerBooleanEvent(int action,
721 u_char * statP, oid * name, size_t name_len)
724 struct mteTriggerTable_data *StorageTmp = NULL;
725 static size_t tmplen;
728 (sizeof(mteTriggerBooleanTable_variables_oid) / sizeof(oid) + 3 -
732 DEBUGMSGTL(("mteTriggerBooleanTable",
733 "write_mteTriggerBooleanEvent entering action=%d... \n",
736 header_complex(mteTriggerTableStorage, NULL,
737 &name[sizeof(mteTriggerBooleanTable_variables_oid)
738 / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
740 return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
745 if (var_val_type != ASN_OCTET_STR) {
747 "write to mteTriggerBooleanEvent not ASN_OCTET_STR\n");
748 return SNMP_ERR_WRONGTYPE;
750 if (StorageTmp->storageType != ST_NONVOLATILE)
751 return SNMP_ERR_NOTWRITABLE;
757 * memory reseveration, final preparation...
764 * Release any resources that have been allocated
771 * The variable has been stored in string for
772 * you to use, and you have just been asked to do something with
773 * it. Note that anything done here must be reversable in the UNDO case
775 tmpvar = StorageTmp->mteTriggerBooleanEvent;
776 tmplen = StorageTmp->mteTriggerBooleanEventLen;
777 StorageTmp->mteTriggerBooleanEvent =
778 netsnmp_strdup_and_null(var_val, var_val_len);
779 StorageTmp->mteTriggerBooleanEventLen = var_val_len;
785 * Back out any changes made in the ACTION case
787 SNMP_FREE(StorageTmp->mteTriggerBooleanEvent);
788 StorageTmp->mteTriggerBooleanEvent = tmpvar;
789 StorageTmp->mteTriggerBooleanEventLen = tmplen;
795 * Things are working well, so it's now safe to make the change
796 * permanently. Make sure that anything done here can't fail!
801 return SNMP_ERR_NOERROR;