mteTriggerThresholdTable.c
上传用户:wxp200602
上传日期:2007-10-30
资源大小:4028k
文件大小:50k
源码类别:

SNMP编程

开发平台:

Unix_Linux

  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.  * This should always be included first before anything else 
  7.  */
  8. #include <net-snmp/net-snmp-config.h>
  9. #if HAVE_STDLIB_H
  10. #include <stdlib.h>
  11. #endif
  12. #if HAVE_STRING_H
  13. #include <string.h>
  14. #else
  15. #include <strings.h>
  16. #endif
  17. /*
  18.  * minimal include directives 
  19.  */
  20. #include <net-snmp/net-snmp-includes.h>
  21. #include <net-snmp/agent/net-snmp-agent-includes.h>
  22. #include "header_complex.h"
  23. #include "mteTriggerThresholdTable.h"
  24. #include "mteTriggerTable.h"
  25. /*
  26.  * mteTriggerThresholdTable_variables_oid:
  27.  *   this is the top level oid that we want to register under.  This
  28.  *   is essentially a prefix, with the suffix appearing in the
  29.  *   variable below.
  30.  */
  31. oid             mteTriggerThresholdTable_variables_oid[] =
  32.     { 1, 3, 6, 1, 2, 1, 88, 1, 2, 6 };
  33. /*
  34.  * variable2 mteTriggerThresholdTable_variables:
  35.  *   this variable defines function callbacks and type return information 
  36.  *   for the mteTriggerThresholdTable mib section 
  37.  */
  38. struct variable2 mteTriggerThresholdTable_variables[] = {
  39.     /*
  40.      * magic number        , variable type , ro/rw , callback fn  , L, oidsuffix 
  41.      */
  42. #define   MTETRIGGERTHRESHOLDSTARTUP  3
  43.     {MTETRIGGERTHRESHOLDSTARTUP, ASN_INTEGER, RWRITE,
  44.      var_mteTriggerThresholdTable, 2, {1, 1}},
  45. #define   MTETRIGGERTHRESHOLDRISING  4
  46.     {MTETRIGGERTHRESHOLDRISING, ASN_INTEGER, RWRITE,
  47.      var_mteTriggerThresholdTable, 2, {1, 2}},
  48. #define   MTETRIGGERTHRESHOLDFALLING  5
  49.     {MTETRIGGERTHRESHOLDFALLING, ASN_INTEGER, RWRITE,
  50.      var_mteTriggerThresholdTable, 2, {1, 3}},
  51. #define   MTETRIGGERTHRESHOLDDELTARISING  6
  52.     {MTETRIGGERTHRESHOLDDELTARISING, ASN_INTEGER, RWRITE,
  53.      var_mteTriggerThresholdTable, 2, {1, 4}},
  54. #define   MTETRIGGERTHRESHOLDDELTAFALLING  7
  55.     {MTETRIGGERTHRESHOLDDELTAFALLING, ASN_INTEGER, RWRITE,
  56.      var_mteTriggerThresholdTable, 2, {1, 5}},
  57. #define   MTETRIGGERTHRESHOLDOBJECTSOWNER  8
  58.     {MTETRIGGERTHRESHOLDOBJECTSOWNER, ASN_OCTET_STR, RWRITE,
  59.      var_mteTriggerThresholdTable, 2, {1, 6}},
  60. #define   MTETRIGGERTHRESHOLDOBJECTS  9
  61.     {MTETRIGGERTHRESHOLDOBJECTS, ASN_OCTET_STR, RWRITE,
  62.      var_mteTriggerThresholdTable, 2, {1, 7}},
  63. #define   MTETRIGGERTHRESHOLDRISINGEVENTOWNER  10
  64.     {MTETRIGGERTHRESHOLDRISINGEVENTOWNER, ASN_OCTET_STR, RWRITE,
  65.      var_mteTriggerThresholdTable, 2, {1, 8}},
  66. #define   MTETRIGGERTHRESHOLDRISINGEVENT  11
  67.     {MTETRIGGERTHRESHOLDRISINGEVENT, ASN_OCTET_STR, RWRITE,
  68.      var_mteTriggerThresholdTable, 2, {1, 9}},
  69. #define   MTETRIGGERTHRESHOLDFALLINGEVENTOWNER  12
  70.     {MTETRIGGERTHRESHOLDFALLINGEVENTOWNER, ASN_OCTET_STR, RWRITE,
  71.      var_mteTriggerThresholdTable, 2, {1, 10}},
  72. #define   MTETRIGGERTHRESHOLDFALLINGEVENT  13
  73.     {MTETRIGGERTHRESHOLDFALLINGEVENT, ASN_OCTET_STR, RWRITE,
  74.      var_mteTriggerThresholdTable, 2, {1, 11}},
  75. #define   MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER  14
  76.     {MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER, ASN_OCTET_STR, RWRITE,
  77.      var_mteTriggerThresholdTable, 2, {1, 12}},
  78. #define   MTETRIGGERTHRESHOLDDELTARISINGEVENT  15
  79.     {MTETRIGGERTHRESHOLDDELTARISINGEVENT, ASN_OCTET_STR, RWRITE,
  80.      var_mteTriggerThresholdTable, 2, {1, 13}},
  81. #define   MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER  16
  82.     {MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER, ASN_OCTET_STR, RWRITE,
  83.      var_mteTriggerThresholdTable, 2, {1, 14}},
  84. #define   MTETRIGGERTHRESHOLDDELTAFALLINGEVENT  17
  85.     {MTETRIGGERTHRESHOLDDELTAFALLINGEVENT, ASN_OCTET_STR, RWRITE,
  86.      var_mteTriggerThresholdTable, 2, {1, 15}},
  87. };
  88. /*
  89.  * (L = length of the oidsuffix) 
  90.  */
  91. /*
  92.  * global storage of our data, saved in and configured by header_complex() 
  93.  */
  94. extern struct header_complex_index *mteTriggerTableStorage;
  95. /*
  96.  * init_mteTriggerThresholdTable():
  97.  *   Initialization routine.  This is called when the agent starts up.
  98.  *   At a minimum, registration of your variables should take place here.
  99.  */
  100. void
  101. init_mteTriggerThresholdTable(void)
  102. {
  103.     DEBUGMSGTL(("mteTriggerThresholdTable", "initializing...  "));
  104.     /*
  105.      * register ourselves with the agent to handle our mib tree 
  106.      */
  107.     REGISTER_MIB("mteTriggerThresholdTable",
  108.                  mteTriggerThresholdTable_variables, variable2,
  109.                  mteTriggerThresholdTable_variables_oid);
  110.     DEBUGMSGTL(("mteTriggerThresholdTable", "done.n"));
  111. }
  112. /*
  113.  * var_mteTriggerThresholdTable():
  114.  *   Handle this table separately from the scalar value case.
  115.  *   The workings of this are basically the same as for var_mteTriggerThresholdTable above.
  116.  */
  117. unsigned char  *
  118. var_mteTriggerThresholdTable(struct variable *vp,
  119.                              oid * name,
  120.                              size_t * length,
  121.                              int exact,
  122.                              size_t * var_len, WriteMethod ** write_method)
  123. {
  124.     struct mteTriggerTable_data *StorageTmp = NULL;
  125.     DEBUGMSGTL(("mteTriggerThresholdTable",
  126.                 "var_mteTriggerThresholdTable: Entering...  n"));
  127.     /*
  128.      * this assumes you have registered all your data properly
  129.      */
  130.     if ((StorageTmp =
  131.          header_complex(mteTriggerTableStorage, vp, name, length, exact,
  132.                         var_len, write_method)) == NULL)
  133.         return NULL;
  134.     if (!(StorageTmp->mteTriggerTest[0] & MTETRIGGERTEST_THRESHOLD))
  135.         return NULL;
  136.     /*
  137.      * this is where we do the value assignments for the mib results.
  138.      */
  139.     switch (vp->magic) {
  140.     case MTETRIGGERTHRESHOLDSTARTUP:
  141.         *write_method = write_mteTriggerThresholdStartup;
  142.         *var_len = sizeof(StorageTmp->mteTriggerThresholdStartup);
  143.         return (u_char *) & StorageTmp->mteTriggerThresholdStartup;
  144.     case MTETRIGGERTHRESHOLDRISING:
  145.         *write_method = write_mteTriggerThresholdRising;
  146.         *var_len = sizeof(StorageTmp->mteTriggerThresholdRising);
  147.         return (u_char *) & StorageTmp->mteTriggerThresholdRising;
  148.     case MTETRIGGERTHRESHOLDFALLING:
  149.         *write_method = write_mteTriggerThresholdFalling;
  150.         *var_len = sizeof(StorageTmp->mteTriggerThresholdFalling);
  151.         return (u_char *) & StorageTmp->mteTriggerThresholdFalling;
  152.     case MTETRIGGERTHRESHOLDDELTARISING:
  153.         *write_method = write_mteTriggerThresholdDeltaRising;
  154.         *var_len = sizeof(StorageTmp->mteTriggerThresholdDeltaRising);
  155.         return (u_char *) & StorageTmp->mteTriggerThresholdDeltaRising;
  156.     case MTETRIGGERTHRESHOLDDELTAFALLING:
  157.         *write_method = write_mteTriggerThresholdDeltaFalling;
  158.         *var_len = sizeof(StorageTmp->mteTriggerThresholdDeltaFalling);
  159.         return (u_char *) & StorageTmp->mteTriggerThresholdDeltaFalling;
  160.     case MTETRIGGERTHRESHOLDOBJECTSOWNER:
  161.         *write_method = write_mteTriggerThresholdObjectsOwner;
  162.         *var_len = StorageTmp->mteTriggerThresholdObjectsOwnerLen;
  163.         return (u_char *) StorageTmp->mteTriggerThresholdObjectsOwner;
  164.     case MTETRIGGERTHRESHOLDOBJECTS:
  165.         *write_method = write_mteTriggerThresholdObjects;
  166.         *var_len = StorageTmp->mteTriggerThresholdObjectsLen;
  167.         return (u_char *) StorageTmp->mteTriggerThresholdObjects;
  168.     case MTETRIGGERTHRESHOLDRISINGEVENTOWNER:
  169.         *write_method = write_mteTriggerThresholdRisingEventOwner;
  170.         *var_len = StorageTmp->mteTriggerThresholdRisingEventOwnerLen;
  171.         return (u_char *) StorageTmp->mteTriggerThresholdRisingEventOwner;
  172.     case MTETRIGGERTHRESHOLDRISINGEVENT:
  173.         *write_method = write_mteTriggerThresholdRisingEvent;
  174.         *var_len = StorageTmp->mteTriggerThresholdRisingEventLen;
  175.         return (u_char *) StorageTmp->mteTriggerThresholdRisingEvent;
  176.     case MTETRIGGERTHRESHOLDFALLINGEVENTOWNER:
  177.         *write_method = write_mteTriggerThresholdFallingEventOwner;
  178.         *var_len = StorageTmp->mteTriggerThresholdFallingEventOwnerLen;
  179.         return (u_char *) StorageTmp->mteTriggerThresholdFallingEventOwner;
  180.     case MTETRIGGERTHRESHOLDFALLINGEVENT:
  181.         *write_method = write_mteTriggerThresholdFallingEvent;
  182.         *var_len = StorageTmp->mteTriggerThresholdFallingEventLen;
  183.         return (u_char *) StorageTmp->mteTriggerThresholdFallingEvent;
  184.     case MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER:
  185.         *write_method = write_mteTriggerThresholdDeltaRisingEventOwner;
  186.         *var_len = StorageTmp->mteTriggerThresholdDeltaRisingEventOwnerLen;
  187.         return (u_char *) StorageTmp->
  188.             mteTriggerThresholdDeltaRisingEventOwner;
  189.     case MTETRIGGERTHRESHOLDDELTARISINGEVENT:
  190.         *write_method = write_mteTriggerThresholdDeltaRisingEvent;
  191.         *var_len = StorageTmp->mteTriggerThresholdDeltaRisingEventLen;
  192.         return (u_char *) StorageTmp->mteTriggerThresholdDeltaRisingEvent;
  193.     case MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER:
  194.         *write_method = write_mteTriggerThresholdDeltaFallingEventOwner;
  195.         *var_len =
  196.             StorageTmp->mteTriggerThresholdDeltaFallingEventOwnerLen;
  197.         return (u_char *) StorageTmp->
  198.             mteTriggerThresholdDeltaFallingEventOwner;
  199.     case MTETRIGGERTHRESHOLDDELTAFALLINGEVENT:
  200.         *write_method = write_mteTriggerThresholdDeltaFallingEvent;
  201.         *var_len = StorageTmp->mteTriggerThresholdDeltaFallingEventLen;
  202.         return (u_char *) StorageTmp->mteTriggerThresholdDeltaFallingEvent;
  203.     default:
  204.         ERROR_MSG("");
  205.     }
  206.     return NULL;
  207. }
  208. int
  209. write_mteTriggerThresholdStartup(int action,
  210.                                  u_char * var_val,
  211.                                  u_char var_val_type,
  212.                                  size_t var_val_len,
  213.                                  u_char * statP,
  214.                                  oid * name, size_t name_len)
  215. {
  216.     static int      tmpvar;
  217.     struct mteTriggerTable_data *StorageTmp = NULL;
  218.     size_t          newlen =
  219.         name_len -
  220.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  221.          1);
  222.     DEBUGMSGTL(("mteTriggerThresholdTable",
  223.                 "write_mteTriggerThresholdStartup entering action=%d...  n",
  224.                 action));
  225.     if ((StorageTmp =
  226.          header_complex(mteTriggerTableStorage, NULL,
  227.                         &name[sizeof
  228.                               (mteTriggerThresholdTable_variables_oid) /
  229.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  230.                         NULL)) == NULL)
  231.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  232.     switch (action) {
  233.     case RESERVE1:
  234.         if (var_val_type != ASN_INTEGER) {
  235.             fprintf(stderr,
  236.                     "write to mteTriggerThresholdStartup not ASN_INTEGERn");
  237.             return SNMP_ERR_WRONGTYPE;
  238.         }
  239.         if (StorageTmp->storageType != ST_NONVOLATILE)
  240.             return SNMP_ERR_NOTWRITABLE;
  241.         break;
  242.     case RESERVE2:
  243.         /*
  244.          * memory reseveration, final preparation... 
  245.          */
  246.         break;
  247.     case FREE:
  248.         /*
  249.          * Release any resources that have been allocated 
  250.          */
  251.         break;
  252.     case ACTION:
  253.         /*
  254.          * The variable has been stored in long_ret for
  255.          * you to use, and you have just been asked to do something with
  256.          * it.  Note that anything done here must be reversable in the UNDO case 
  257.          */
  258.         tmpvar = StorageTmp->mteTriggerThresholdStartup;
  259.         StorageTmp->mteTriggerThresholdStartup = *((long *) var_val);
  260.         break;
  261.     case UNDO:
  262.         /*
  263.          * Back out any changes made in the ACTION case 
  264.          */
  265.         StorageTmp->mteTriggerThresholdStartup = tmpvar;
  266.         break;
  267.     case COMMIT:
  268.         /*
  269.          * Things are working well, so it's now safe to make the change
  270.          * permanently.  Make sure that anything done here can't fail! 
  271.          */
  272.         break;
  273.     }
  274.     return SNMP_ERR_NOERROR;
  275. }
  276. int
  277. write_mteTriggerThresholdRising(int action,
  278.                                 u_char * var_val,
  279.                                 u_char var_val_type,
  280.                                 size_t var_val_len,
  281.                                 u_char * statP,
  282.                                 oid * name, size_t name_len)
  283. {
  284.     static int      tmpvar;
  285.     struct mteTriggerTable_data *StorageTmp = NULL;
  286.     size_t          newlen =
  287.         name_len -
  288.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  289.          1);
  290.     DEBUGMSGTL(("mteTriggerThresholdTable",
  291.                 "write_mteTriggerThresholdRising entering action=%d...  n",
  292.                 action));
  293.     if ((StorageTmp =
  294.          header_complex(mteTriggerTableStorage, NULL,
  295.                         &name[sizeof
  296.                               (mteTriggerThresholdTable_variables_oid) /
  297.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  298.                         NULL)) == NULL)
  299.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  300.     switch (action) {
  301.     case RESERVE1:
  302.         if (var_val_type != ASN_INTEGER) {
  303.             fprintf(stderr,
  304.                     "write to mteTriggerThresholdRising not ASN_INTEGERn");
  305.             return SNMP_ERR_WRONGTYPE;
  306.         }
  307.         if (StorageTmp->storageType != ST_NONVOLATILE)
  308.             return SNMP_ERR_NOTWRITABLE;
  309.         break;
  310.     case RESERVE2:
  311.         /*
  312.          * memory reseveration, final preparation... 
  313.          */
  314.         break;
  315.     case FREE:
  316.         /*
  317.          * Release any resources that have been allocated 
  318.          */
  319.         break;
  320.     case ACTION:
  321.         /*
  322.          * The variable has been stored in long_ret for
  323.          * you to use, and you have just been asked to do something with
  324.          * it.  Note that anything done here must be reversable in the UNDO case 
  325.          */
  326.         tmpvar = StorageTmp->mteTriggerThresholdRising;
  327.         StorageTmp->mteTriggerThresholdRising = *((long *) var_val);
  328.         break;
  329.     case UNDO:
  330.         /*
  331.          * Back out any changes made in the ACTION case 
  332.          */
  333.         StorageTmp->mteTriggerThresholdRising = tmpvar;
  334.         break;
  335.     case COMMIT:
  336.         /*
  337.          * Things are working well, so it's now safe to make the change
  338.          * permanently.  Make sure that anything done here can't fail! 
  339.          */
  340.         break;
  341.     }
  342.     return SNMP_ERR_NOERROR;
  343. }
  344. int
  345. write_mteTriggerThresholdFalling(int action,
  346.                                  u_char * var_val,
  347.                                  u_char var_val_type,
  348.                                  size_t var_val_len,
  349.                                  u_char * statP,
  350.                                  oid * name, size_t name_len)
  351. {
  352.     static int      tmpvar;
  353.     struct mteTriggerTable_data *StorageTmp = NULL;
  354.     size_t          newlen =
  355.         name_len -
  356.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  357.          1);
  358.     DEBUGMSGTL(("mteTriggerThresholdTable",
  359.                 "write_mteTriggerThresholdFalling 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.     switch (action) {
  369.     case RESERVE1:
  370.         if (var_val_type != ASN_INTEGER) {
  371.             fprintf(stderr,
  372.                     "write to mteTriggerThresholdFalling not ASN_INTEGERn");
  373.             return SNMP_ERR_WRONGTYPE;
  374.         }
  375.         if (StorageTmp->storageType != ST_NONVOLATILE)
  376.             return SNMP_ERR_NOTWRITABLE;
  377.         break;
  378.     case RESERVE2:
  379.         /*
  380.          * memory reseveration, final preparation... 
  381.          */
  382.         break;
  383.     case FREE:
  384.         /*
  385.          * Release any resources that have been allocated 
  386.          */
  387.         break;
  388.     case ACTION:
  389.         /*
  390.          * The variable has been stored in long_ret for
  391.          * you to use, and you have just been asked to do something with
  392.          * it.  Note that anything done here must be reversable in the UNDO case 
  393.          */
  394.         tmpvar = StorageTmp->mteTriggerThresholdFalling;
  395.         StorageTmp->mteTriggerThresholdFalling = *((long *) var_val);
  396.         break;
  397.     case UNDO:
  398.         /*
  399.          * Back out any changes made in the ACTION case 
  400.          */
  401.         StorageTmp->mteTriggerThresholdFalling = tmpvar;
  402.         break;
  403.     case COMMIT:
  404.         /*
  405.          * Things are working well, so it's now safe to make the change
  406.          * permanently.  Make sure that anything done here can't fail! 
  407.          */
  408.         break;
  409.     }
  410.     return SNMP_ERR_NOERROR;
  411. }
  412. int
  413. write_mteTriggerThresholdDeltaRising(int action,
  414.                                      u_char * var_val,
  415.                                      u_char var_val_type,
  416.                                      size_t var_val_len,
  417.                                      u_char * statP,
  418.                                      oid * name, size_t name_len)
  419. {
  420.     static int      tmpvar;
  421.     struct mteTriggerTable_data *StorageTmp = NULL;
  422.     size_t          newlen =
  423.         name_len -
  424.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  425.          1);
  426.     DEBUGMSGTL(("mteTriggerThresholdTable",
  427.                 "write_mteTriggerThresholdDeltaRising entering action=%d...  n",
  428.                 action));
  429.     if ((StorageTmp =
  430.          header_complex(mteTriggerTableStorage, NULL,
  431.                         &name[sizeof
  432.                               (mteTriggerThresholdTable_variables_oid) /
  433.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  434.                         NULL)) == NULL)
  435.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  436.     switch (action) {
  437.     case RESERVE1:
  438.         if (var_val_type != ASN_INTEGER) {
  439.             fprintf(stderr,
  440.                     "write to mteTriggerThresholdDeltaRising not ASN_INTEGERn");
  441.             return SNMP_ERR_WRONGTYPE;
  442.         }
  443.         if (StorageTmp->storageType != ST_NONVOLATILE)
  444.             return SNMP_ERR_NOTWRITABLE;
  445.         break;
  446.     case RESERVE2:
  447.         /*
  448.          * memory reseveration, final preparation... 
  449.          */
  450.         break;
  451.     case FREE:
  452.         /*
  453.          * Release any resources that have been allocated 
  454.          */
  455.         break;
  456.     case ACTION:
  457.         /*
  458.          * The variable has been stored in long_ret for
  459.          * you to use, and you have just been asked to do something with
  460.          * it.  Note that anything done here must be reversable in the UNDO case 
  461.          */
  462.         tmpvar = StorageTmp->mteTriggerThresholdDeltaRising;
  463.         StorageTmp->mteTriggerThresholdDeltaRising = *((long *) var_val);
  464.         break;
  465.     case UNDO:
  466.         /*
  467.          * Back out any changes made in the ACTION case 
  468.          */
  469.         StorageTmp->mteTriggerThresholdDeltaRising = tmpvar;
  470.         break;
  471.     case COMMIT:
  472.         /*
  473.          * Things are working well, so it's now safe to make the change
  474.          * permanently.  Make sure that anything done here can't fail! 
  475.          */
  476.         break;
  477.     }
  478.     return SNMP_ERR_NOERROR;
  479. }
  480. int
  481. write_mteTriggerThresholdDeltaFalling(int action,
  482.                                       u_char * var_val,
  483.                                       u_char var_val_type,
  484.                                       size_t var_val_len,
  485.                                       u_char * statP,
  486.                                       oid * name, size_t name_len)
  487. {
  488.     static int      tmpvar;
  489.     struct mteTriggerTable_data *StorageTmp = NULL;
  490.     size_t          newlen =
  491.         name_len -
  492.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  493.          1);
  494.     DEBUGMSGTL(("mteTriggerThresholdTable",
  495.                 "write_mteTriggerThresholdDeltaFalling entering action=%d...  n",
  496.                 action));
  497.     if ((StorageTmp =
  498.          header_complex(mteTriggerTableStorage, NULL,
  499.                         &name[sizeof
  500.                               (mteTriggerThresholdTable_variables_oid) /
  501.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  502.                         NULL)) == NULL)
  503.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  504.     switch (action) {
  505.     case RESERVE1:
  506.         if (var_val_type != ASN_INTEGER) {
  507.             fprintf(stderr,
  508.                     "write to mteTriggerThresholdDeltaFalling not ASN_INTEGERn");
  509.             return SNMP_ERR_WRONGTYPE;
  510.         }
  511.         if (StorageTmp->storageType != ST_NONVOLATILE)
  512.             return SNMP_ERR_NOTWRITABLE;
  513.         break;
  514.     case RESERVE2:
  515.         /*
  516.          * memory reseveration, final preparation... 
  517.          */
  518.         break;
  519.     case FREE:
  520.         /*
  521.          * Release any resources that have been allocated 
  522.          */
  523.         break;
  524.     case ACTION:
  525.         /*
  526.          * The variable has been stored in long_ret for
  527.          * you to use, and you have just been asked to do something with
  528.          * it.  Note that anything done here must be reversable in the UNDO case 
  529.          */
  530.         tmpvar = StorageTmp->mteTriggerThresholdDeltaFalling;
  531.         StorageTmp->mteTriggerThresholdDeltaFalling = *((long *) var_val);
  532.         break;
  533.     case UNDO:
  534.         /*
  535.          * Back out any changes made in the ACTION case 
  536.          */
  537.         StorageTmp->mteTriggerThresholdDeltaFalling = tmpvar;
  538.         break;
  539.     case COMMIT:
  540.         /*
  541.          * Things are working well, so it's now safe to make the change
  542.          * permanently.  Make sure that anything done here can't fail! 
  543.          */
  544.         break;
  545.     }
  546.     return SNMP_ERR_NOERROR;
  547. }
  548. int
  549. write_mteTriggerThresholdObjectsOwner(int action,
  550.                                       u_char * var_val,
  551.                                       u_char var_val_type,
  552.                                       size_t var_val_len,
  553.                                       u_char * statP,
  554.                                       oid * name, size_t name_len)
  555. {
  556.     static char    *tmpvar;
  557.     struct mteTriggerTable_data *StorageTmp = NULL;
  558.     static size_t   tmplen;
  559.     size_t          newlen =
  560.         name_len -
  561.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  562.          1);
  563.     DEBUGMSGTL(("mteTriggerThresholdTable",
  564.                 "write_mteTriggerThresholdObjectsOwner entering action=%d...  n",
  565.                 action));
  566.     if ((StorageTmp =
  567.          header_complex(mteTriggerTableStorage, NULL,
  568.                         &name[sizeof
  569.                               (mteTriggerThresholdTable_variables_oid) /
  570.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  571.                         NULL)) == NULL)
  572.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  573.     switch (action) {
  574.     case RESERVE1:
  575.         if (var_val_type != ASN_OCTET_STR) {
  576.             fprintf(stderr,
  577.                     "write to mteTriggerThresholdObjectsOwner not ASN_OCTET_STRn");
  578.             return SNMP_ERR_WRONGTYPE;
  579.         }
  580.         if (StorageTmp->storageType != ST_NONVOLATILE)
  581.             return SNMP_ERR_NOTWRITABLE;
  582.         break;
  583.     case RESERVE2:
  584.         /*
  585.          * memory reseveration, final preparation... 
  586.          */
  587.         break;
  588.     case FREE:
  589.         /*
  590.          * Release any resources that have been allocated 
  591.          */
  592.         break;
  593.     case ACTION:
  594.         /*
  595.          * The variable has been stored in string for
  596.          * you to use, and you have just been asked to do something with
  597.          * it.  Note that anything done here must be reversable in the UNDO case 
  598.          */
  599.         tmpvar = StorageTmp->mteTriggerThresholdObjectsOwner;
  600.         tmplen = StorageTmp->mteTriggerThresholdObjectsOwnerLen;
  601.         memdup((u_char **) & StorageTmp->mteTriggerThresholdObjectsOwner,
  602.                var_val, var_val_len);
  603.         StorageTmp->mteTriggerThresholdObjectsOwnerLen = var_val_len;
  604.         break;
  605.     case UNDO:
  606.         /*
  607.          * Back out any changes made in the ACTION case 
  608.          */
  609.         SNMP_FREE(StorageTmp->mteTriggerThresholdObjectsOwner);
  610.         StorageTmp->mteTriggerThresholdObjectsOwner = tmpvar;
  611.         StorageTmp->mteTriggerThresholdObjectsOwnerLen = tmplen;
  612.         break;
  613.     case COMMIT:
  614.         /*
  615.          * Things are working well, so it's now safe to make the change
  616.          * permanently.  Make sure that anything done here can't fail! 
  617.          */
  618.         SNMP_FREE(tmpvar);
  619.         break;
  620.     }
  621.     return SNMP_ERR_NOERROR;
  622. }
  623. int
  624. write_mteTriggerThresholdObjects(int action,
  625.                                  u_char * var_val,
  626.                                  u_char var_val_type,
  627.                                  size_t var_val_len,
  628.                                  u_char * statP,
  629.                                  oid * name, size_t name_len)
  630. {
  631.     static char    *tmpvar;
  632.     struct mteTriggerTable_data *StorageTmp = NULL;
  633.     static size_t   tmplen;
  634.     size_t          newlen =
  635.         name_len -
  636.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  637.          1);
  638.     DEBUGMSGTL(("mteTriggerThresholdTable",
  639.                 "write_mteTriggerThresholdObjects entering action=%d...  n",
  640.                 action));
  641.     if ((StorageTmp =
  642.          header_complex(mteTriggerTableStorage, NULL,
  643.                         &name[sizeof
  644.                               (mteTriggerThresholdTable_variables_oid) /
  645.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  646.                         NULL)) == NULL)
  647.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  648.     switch (action) {
  649.     case RESERVE1:
  650.         if (var_val_type != ASN_OCTET_STR) {
  651.             fprintf(stderr,
  652.                     "write to mteTriggerThresholdObjects not ASN_OCTET_STRn");
  653.             return SNMP_ERR_WRONGTYPE;
  654.         }
  655.         if (StorageTmp->storageType != ST_NONVOLATILE)
  656.             return SNMP_ERR_NOTWRITABLE;
  657.         break;
  658.     case RESERVE2:
  659.         /*
  660.          * memory reseveration, final preparation... 
  661.          */
  662.         break;
  663.     case FREE:
  664.         /*
  665.          * Release any resources that have been allocated 
  666.          */
  667.         break;
  668.     case ACTION:
  669.         /*
  670.          * The variable has been stored in string for
  671.          * you to use, and you have just been asked to do something with
  672.          * it.  Note that anything done here must be reversable in the UNDO case 
  673.          */
  674.         tmpvar = StorageTmp->mteTriggerThresholdObjects;
  675.         tmplen = StorageTmp->mteTriggerThresholdObjectsLen;
  676.         memdup((u_char **) & StorageTmp->mteTriggerThresholdObjects,
  677.                var_val, var_val_len);
  678.         StorageTmp->mteTriggerThresholdObjectsLen = var_val_len;
  679.         break;
  680.     case UNDO:
  681.         /*
  682.          * Back out any changes made in the ACTION case 
  683.          */
  684.         SNMP_FREE(StorageTmp->mteTriggerThresholdObjects);
  685.         StorageTmp->mteTriggerThresholdObjects = tmpvar;
  686.         StorageTmp->mteTriggerThresholdObjectsLen = tmplen;
  687.         break;
  688.     case COMMIT:
  689.         /*
  690.          * Things are working well, so it's now safe to make the change
  691.          * permanently.  Make sure that anything done here can't fail! 
  692.          */
  693.         SNMP_FREE(tmpvar);
  694.         break;
  695.     }
  696.     return SNMP_ERR_NOERROR;
  697. }
  698. int
  699. write_mteTriggerThresholdRisingEventOwner(int action,
  700.                                           u_char * var_val,
  701.                                           u_char var_val_type,
  702.                                           size_t var_val_len,
  703.                                           u_char * statP,
  704.                                           oid * name, size_t name_len)
  705. {
  706.     static char    *tmpvar;
  707.     struct mteTriggerTable_data *StorageTmp = NULL;
  708.     static size_t   tmplen;
  709.     size_t          newlen =
  710.         name_len -
  711.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  712.          1);
  713.     DEBUGMSGTL(("mteTriggerThresholdTable",
  714.                 "write_mteTriggerThresholdRisingEventOwner entering action=%d...  n",
  715.                 action));
  716.     if ((StorageTmp =
  717.          header_complex(mteTriggerTableStorage, NULL,
  718.                         &name[sizeof
  719.                               (mteTriggerThresholdTable_variables_oid) /
  720.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  721.                         NULL)) == NULL)
  722.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  723.     switch (action) {
  724.     case RESERVE1:
  725.         if (var_val_type != ASN_OCTET_STR) {
  726.             fprintf(stderr,
  727.                     "write to mteTriggerThresholdRisingEventOwner not ASN_OCTET_STRn");
  728.             return SNMP_ERR_WRONGTYPE;
  729.         }
  730.         if (StorageTmp->storageType != ST_NONVOLATILE)
  731.             return SNMP_ERR_NOTWRITABLE;
  732.         break;
  733.     case RESERVE2:
  734.         /*
  735.          * memory reseveration, final preparation... 
  736.          */
  737.         break;
  738.     case FREE:
  739.         /*
  740.          * Release any resources that have been allocated 
  741.          */
  742.         break;
  743.     case ACTION:
  744.         /*
  745.          * The variable has been stored in string for
  746.          * you to use, and you have just been asked to do something with
  747.          * it.  Note that anything done here must be reversable in the UNDO case 
  748.          */
  749.         tmpvar = StorageTmp->mteTriggerThresholdRisingEventOwner;
  750.         tmplen = StorageTmp->mteTriggerThresholdRisingEventOwnerLen;
  751.         memdup((u_char **) & StorageTmp->
  752.                mteTriggerThresholdRisingEventOwner, var_val, var_val_len);
  753.         StorageTmp->mteTriggerThresholdRisingEventOwnerLen = var_val_len;
  754.         break;
  755.     case UNDO:
  756.         /*
  757.          * Back out any changes made in the ACTION case 
  758.          */
  759.         SNMP_FREE(StorageTmp->mteTriggerThresholdRisingEventOwner);
  760.         StorageTmp->mteTriggerThresholdRisingEventOwner = tmpvar;
  761.         StorageTmp->mteTriggerThresholdRisingEventOwnerLen = tmplen;
  762.         break;
  763.     case COMMIT:
  764.         /*
  765.          * Things are working well, so it's now safe to make the change
  766.          * permanently.  Make sure that anything done here can't fail! 
  767.          */
  768.         SNMP_FREE(tmpvar);
  769.         break;
  770.     }
  771.     return SNMP_ERR_NOERROR;
  772. }
  773. int
  774. write_mteTriggerThresholdRisingEvent(int action,
  775.                                      u_char * var_val,
  776.                                      u_char var_val_type,
  777.                                      size_t var_val_len,
  778.                                      u_char * statP,
  779.                                      oid * name, size_t name_len)
  780. {
  781.     static char    *tmpvar;
  782.     struct mteTriggerTable_data *StorageTmp = NULL;
  783.     static size_t   tmplen;
  784.     size_t          newlen =
  785.         name_len -
  786.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  787.          1);
  788.     DEBUGMSGTL(("mteTriggerThresholdTable",
  789.                 "write_mteTriggerThresholdRisingEvent entering action=%d...  n",
  790.                 action));
  791.     if ((StorageTmp =
  792.          header_complex(mteTriggerTableStorage, NULL,
  793.                         &name[sizeof
  794.                               (mteTriggerThresholdTable_variables_oid) /
  795.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  796.                         NULL)) == NULL)
  797.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  798.     switch (action) {
  799.     case RESERVE1:
  800.         if (var_val_type != ASN_OCTET_STR) {
  801.             fprintf(stderr,
  802.                     "write to mteTriggerThresholdRisingEvent not ASN_OCTET_STRn");
  803.             return SNMP_ERR_WRONGTYPE;
  804.         }
  805.         if (StorageTmp->storageType != ST_NONVOLATILE)
  806.             return SNMP_ERR_NOTWRITABLE;
  807.         break;
  808.     case RESERVE2:
  809.         /*
  810.          * memory reseveration, final preparation... 
  811.          */
  812.         break;
  813.     case FREE:
  814.         /*
  815.          * Release any resources that have been allocated 
  816.          */
  817.         break;
  818.     case ACTION:
  819.         /*
  820.          * The variable has been stored in string for
  821.          * you to use, and you have just been asked to do something with
  822.          * it.  Note that anything done here must be reversable in the UNDO case 
  823.          */
  824.         tmpvar = StorageTmp->mteTriggerThresholdRisingEvent;
  825.         tmplen = StorageTmp->mteTriggerThresholdRisingEventLen;
  826.         memdup((u_char **) & StorageTmp->mteTriggerThresholdRisingEvent,
  827.                var_val, var_val_len);
  828.         StorageTmp->mteTriggerThresholdRisingEventLen = var_val_len;
  829.         break;
  830.     case UNDO:
  831.         /*
  832.          * Back out any changes made in the ACTION case 
  833.          */
  834.         SNMP_FREE(StorageTmp->mteTriggerThresholdRisingEvent);
  835.         StorageTmp->mteTriggerThresholdRisingEvent = tmpvar;
  836.         StorageTmp->mteTriggerThresholdRisingEventLen = tmplen;
  837.         break;
  838.     case COMMIT:
  839.         /*
  840.          * Things are working well, so it's now safe to make the change
  841.          * permanently.  Make sure that anything done here can't fail! 
  842.          */
  843.         SNMP_FREE(tmpvar);
  844.         break;
  845.     }
  846.     return SNMP_ERR_NOERROR;
  847. }
  848. int
  849. write_mteTriggerThresholdFallingEventOwner(int action,
  850.                                            u_char * var_val,
  851.                                            u_char var_val_type,
  852.                                            size_t var_val_len,
  853.                                            u_char * statP,
  854.                                            oid * name, size_t name_len)
  855. {
  856.     static char    *tmpvar;
  857.     struct mteTriggerTable_data *StorageTmp = NULL;
  858.     static size_t   tmplen;
  859.     size_t          newlen =
  860.         name_len -
  861.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  862.          1);
  863.     DEBUGMSGTL(("mteTriggerThresholdTable",
  864.                 "write_mteTriggerThresholdFallingEventOwner entering action=%d...  n",
  865.                 action));
  866.     if ((StorageTmp =
  867.          header_complex(mteTriggerTableStorage, NULL,
  868.                         &name[sizeof
  869.                               (mteTriggerThresholdTable_variables_oid) /
  870.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  871.                         NULL)) == NULL)
  872.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  873.     switch (action) {
  874.     case RESERVE1:
  875.         if (var_val_type != ASN_OCTET_STR) {
  876.             fprintf(stderr,
  877.                     "write to mteTriggerThresholdFallingEventOwner not ASN_OCTET_STRn");
  878.             return SNMP_ERR_WRONGTYPE;
  879.         }
  880.         if (StorageTmp->storageType != ST_NONVOLATILE)
  881.             return SNMP_ERR_NOTWRITABLE;
  882.         break;
  883.     case RESERVE2:
  884.         /*
  885.          * memory reseveration, final preparation... 
  886.          */
  887.         break;
  888.     case FREE:
  889.         /*
  890.          * Release any resources that have been allocated 
  891.          */
  892.         break;
  893.     case ACTION:
  894.         /*
  895.          * The variable has been stored in string for
  896.          * you to use, and you have just been asked to do something with
  897.          * it.  Note that anything done here must be reversable in the UNDO case 
  898.          */
  899.         tmpvar = StorageTmp->mteTriggerThresholdFallingEventOwner;
  900.         tmplen = StorageTmp->mteTriggerThresholdFallingEventOwnerLen;
  901.         memdup((u_char **) & StorageTmp->
  902.                mteTriggerThresholdFallingEventOwner, var_val, var_val_len);
  903.         StorageTmp->mteTriggerThresholdFallingEventOwnerLen = var_val_len;
  904.         break;
  905.     case UNDO:
  906.         /*
  907.          * Back out any changes made in the ACTION case 
  908.          */
  909.         SNMP_FREE(StorageTmp->mteTriggerThresholdFallingEventOwner);
  910.         StorageTmp->mteTriggerThresholdFallingEventOwner = tmpvar;
  911.         StorageTmp->mteTriggerThresholdFallingEventOwnerLen = tmplen;
  912.         break;
  913.     case COMMIT:
  914.         /*
  915.          * Things are working well, so it's now safe to make the change
  916.          * permanently.  Make sure that anything done here can't fail! 
  917.          */
  918.         SNMP_FREE(tmpvar);
  919.         break;
  920.     }
  921.     return SNMP_ERR_NOERROR;
  922. }
  923. int
  924. write_mteTriggerThresholdFallingEvent(int action,
  925.                                       u_char * var_val,
  926.                                       u_char var_val_type,
  927.                                       size_t var_val_len,
  928.                                       u_char * statP,
  929.                                       oid * name, size_t name_len)
  930. {
  931.     static char    *tmpvar;
  932.     struct mteTriggerTable_data *StorageTmp = NULL;
  933.     static size_t   tmplen;
  934.     size_t          newlen =
  935.         name_len -
  936.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  937.          1);
  938.     DEBUGMSGTL(("mteTriggerThresholdTable",
  939.                 "write_mteTriggerThresholdFallingEvent entering action=%d...  n",
  940.                 action));
  941.     if ((StorageTmp =
  942.          header_complex(mteTriggerTableStorage, NULL,
  943.                         &name[sizeof
  944.                               (mteTriggerThresholdTable_variables_oid) /
  945.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  946.                         NULL)) == NULL)
  947.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  948.     switch (action) {
  949.     case RESERVE1:
  950.         if (var_val_type != ASN_OCTET_STR) {
  951.             fprintf(stderr,
  952.                     "write to mteTriggerThresholdFallingEvent not ASN_OCTET_STRn");
  953.             return SNMP_ERR_WRONGTYPE;
  954.         }
  955.         if (StorageTmp->storageType != ST_NONVOLATILE)
  956.             return SNMP_ERR_NOTWRITABLE;
  957.         break;
  958.     case RESERVE2:
  959.         /*
  960.          * memory reseveration, final preparation... 
  961.          */
  962.         break;
  963.     case FREE:
  964.         /*
  965.          * Release any resources that have been allocated 
  966.          */
  967.         break;
  968.     case ACTION:
  969.         /*
  970.          * The variable has been stored in string for
  971.          * you to use, and you have just been asked to do something with
  972.          * it.  Note that anything done here must be reversable in the UNDO case 
  973.          */
  974.         tmpvar = StorageTmp->mteTriggerThresholdFallingEvent;
  975.         tmplen = StorageTmp->mteTriggerThresholdFallingEventLen;
  976.         memdup((u_char **) & StorageTmp->mteTriggerThresholdFallingEvent,
  977.                var_val, var_val_len);
  978.         StorageTmp->mteTriggerThresholdFallingEventLen = var_val_len;
  979.         break;
  980.     case UNDO:
  981.         /*
  982.          * Back out any changes made in the ACTION case 
  983.          */
  984.         SNMP_FREE(StorageTmp->mteTriggerThresholdFallingEvent);
  985.         StorageTmp->mteTriggerThresholdFallingEvent = tmpvar;
  986.         StorageTmp->mteTriggerThresholdFallingEventLen = tmplen;
  987.         break;
  988.     case COMMIT:
  989.         /*
  990.          * Things are working well, so it's now safe to make the change
  991.          * permanently.  Make sure that anything done here can't fail! 
  992.          */
  993.         SNMP_FREE(tmpvar);
  994.         break;
  995.     }
  996.     return SNMP_ERR_NOERROR;
  997. }
  998. int
  999. write_mteTriggerThresholdDeltaRisingEventOwner(int action,
  1000.                                                u_char * var_val,
  1001.                                                u_char var_val_type,
  1002.                                                size_t var_val_len,
  1003.                                                u_char * statP,
  1004.                                                oid * name, size_t name_len)
  1005. {
  1006.     static char    *tmpvar;
  1007.     struct mteTriggerTable_data *StorageTmp = NULL;
  1008.     static size_t   tmplen;
  1009.     size_t          newlen =
  1010.         name_len -
  1011.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  1012.          1);
  1013.     DEBUGMSGTL(("mteTriggerThresholdTable",
  1014.                 "write_mteTriggerThresholdDeltaRisingEventOwner entering action=%d...  n",
  1015.                 action));
  1016.     if ((StorageTmp =
  1017.          header_complex(mteTriggerTableStorage, NULL,
  1018.                         &name[sizeof
  1019.                               (mteTriggerThresholdTable_variables_oid) /
  1020.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  1021.                         NULL)) == NULL)
  1022.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  1023.     switch (action) {
  1024.     case RESERVE1:
  1025.         if (var_val_type != ASN_OCTET_STR) {
  1026.             fprintf(stderr,
  1027.                     "write to mteTriggerThresholdDeltaRisingEventOwner not ASN_OCTET_STRn");
  1028.             return SNMP_ERR_WRONGTYPE;
  1029.         }
  1030.         if (StorageTmp->storageType != ST_NONVOLATILE)
  1031.             return SNMP_ERR_NOTWRITABLE;
  1032.         break;
  1033.     case RESERVE2:
  1034.         /*
  1035.          * memory reseveration, final preparation... 
  1036.          */
  1037.         break;
  1038.     case FREE:
  1039.         /*
  1040.          * Release any resources that have been allocated 
  1041.          */
  1042.         break;
  1043.     case ACTION:
  1044.         /*
  1045.          * The variable has been stored in string for
  1046.          * you to use, and you have just been asked to do something with
  1047.          * it.  Note that anything done here must be reversable in the UNDO case 
  1048.          */
  1049.         tmpvar = StorageTmp->mteTriggerThresholdDeltaRisingEventOwner;
  1050.         tmplen = StorageTmp->mteTriggerThresholdDeltaRisingEventOwnerLen;
  1051.         memdup((u_char **) & StorageTmp->
  1052.                mteTriggerThresholdDeltaRisingEventOwner, var_val,
  1053.                var_val_len);
  1054.         StorageTmp->mteTriggerThresholdDeltaRisingEventOwnerLen =
  1055.             var_val_len;
  1056.         break;
  1057.     case UNDO:
  1058.         /*
  1059.          * Back out any changes made in the ACTION case 
  1060.          */
  1061.         SNMP_FREE(StorageTmp->mteTriggerThresholdDeltaRisingEventOwner);
  1062.         StorageTmp->mteTriggerThresholdDeltaRisingEventOwner = tmpvar;
  1063.         StorageTmp->mteTriggerThresholdDeltaRisingEventOwnerLen = tmplen;
  1064.         break;
  1065.     case COMMIT:
  1066.         /*
  1067.          * Things are working well, so it's now safe to make the change
  1068.          * permanently.  Make sure that anything done here can't fail! 
  1069.          */
  1070.         SNMP_FREE(tmpvar);
  1071.         break;
  1072.     }
  1073.     return SNMP_ERR_NOERROR;
  1074. }
  1075. int
  1076. write_mteTriggerThresholdDeltaRisingEvent(int action,
  1077.                                           u_char * var_val,
  1078.                                           u_char var_val_type,
  1079.                                           size_t var_val_len,
  1080.                                           u_char * statP,
  1081.                                           oid * name, size_t name_len)
  1082. {
  1083.     static char    *tmpvar;
  1084.     struct mteTriggerTable_data *StorageTmp = NULL;
  1085.     static size_t   tmplen;
  1086.     size_t          newlen =
  1087.         name_len -
  1088.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  1089.          1);
  1090.     DEBUGMSGTL(("mteTriggerThresholdTable",
  1091.                 "write_mteTriggerThresholdDeltaRisingEvent entering action=%d...  n",
  1092.                 action));
  1093.     if ((StorageTmp =
  1094.          header_complex(mteTriggerTableStorage, NULL,
  1095.                         &name[sizeof
  1096.                               (mteTriggerThresholdTable_variables_oid) /
  1097.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  1098.                         NULL)) == NULL)
  1099.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  1100.     switch (action) {
  1101.     case RESERVE1:
  1102.         if (var_val_type != ASN_OCTET_STR) {
  1103.             fprintf(stderr,
  1104.                     "write to mteTriggerThresholdDeltaRisingEvent not ASN_OCTET_STRn");
  1105.             return SNMP_ERR_WRONGTYPE;
  1106.         }
  1107.         if (StorageTmp->storageType != ST_NONVOLATILE)
  1108.             return SNMP_ERR_NOTWRITABLE;
  1109.         break;
  1110.     case RESERVE2:
  1111.         /*
  1112.          * memory reseveration, final preparation... 
  1113.          */
  1114.         break;
  1115.     case FREE:
  1116.         /*
  1117.          * Release any resources that have been allocated 
  1118.          */
  1119.         break;
  1120.     case ACTION:
  1121.         /*
  1122.          * The variable has been stored in string for
  1123.          * you to use, and you have just been asked to do something with
  1124.          * it.  Note that anything done here must be reversable in the UNDO case 
  1125.          */
  1126.         tmpvar = StorageTmp->mteTriggerThresholdDeltaRisingEvent;
  1127.         tmplen = StorageTmp->mteTriggerThresholdDeltaRisingEventLen;
  1128.         memdup((u_char **) & StorageTmp->
  1129.                mteTriggerThresholdDeltaRisingEvent, var_val, var_val_len);
  1130.         StorageTmp->mteTriggerThresholdDeltaRisingEventLen = var_val_len;
  1131.         break;
  1132.     case UNDO:
  1133.         /*
  1134.          * Back out any changes made in the ACTION case 
  1135.          */
  1136.         SNMP_FREE(StorageTmp->mteTriggerThresholdDeltaRisingEvent);
  1137.         StorageTmp->mteTriggerThresholdDeltaRisingEvent = tmpvar;
  1138.         StorageTmp->mteTriggerThresholdDeltaRisingEventLen = tmplen;
  1139.         break;
  1140.     case COMMIT:
  1141.         /*
  1142.          * Things are working well, so it's now safe to make the change
  1143.          * permanently.  Make sure that anything done here can't fail! 
  1144.          */
  1145.         SNMP_FREE(tmpvar);
  1146.         break;
  1147.     }
  1148.     return SNMP_ERR_NOERROR;
  1149. }
  1150. int
  1151. write_mteTriggerThresholdDeltaFallingEventOwner(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,
  1157.                                                 size_t name_len)
  1158. {
  1159.     static char    *tmpvar;
  1160.     struct mteTriggerTable_data *StorageTmp = NULL;
  1161.     static size_t   tmplen;
  1162.     size_t          newlen =
  1163.         name_len -
  1164.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  1165.          1);
  1166.     DEBUGMSGTL(("mteTriggerThresholdTable",
  1167.                 "write_mteTriggerThresholdDeltaFallingEventOwner entering action=%d...  n",
  1168.                 action));
  1169.     if ((StorageTmp =
  1170.          header_complex(mteTriggerTableStorage, NULL,
  1171.                         &name[sizeof
  1172.                               (mteTriggerThresholdTable_variables_oid) /
  1173.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  1174.                         NULL)) == NULL)
  1175.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  1176.     switch (action) {
  1177.     case RESERVE1:
  1178.         if (var_val_type != ASN_OCTET_STR) {
  1179.             fprintf(stderr,
  1180.                     "write to mteTriggerThresholdDeltaFallingEventOwner not ASN_OCTET_STRn");
  1181.             return SNMP_ERR_WRONGTYPE;
  1182.         }
  1183.         if (StorageTmp->storageType != ST_NONVOLATILE)
  1184.             return SNMP_ERR_NOTWRITABLE;
  1185.         break;
  1186.     case RESERVE2:
  1187.         /*
  1188.          * memory reseveration, final preparation... 
  1189.          */
  1190.         break;
  1191.     case FREE:
  1192.         /*
  1193.          * Release any resources that have been allocated 
  1194.          */
  1195.         break;
  1196.     case ACTION:
  1197.         /*
  1198.          * The variable has been stored in string for
  1199.          * you to use, and you have just been asked to do something with
  1200.          * it.  Note that anything done here must be reversable in the UNDO case 
  1201.          */
  1202.         tmpvar = StorageTmp->mteTriggerThresholdDeltaFallingEventOwner;
  1203.         tmplen = StorageTmp->mteTriggerThresholdDeltaFallingEventOwnerLen;
  1204.         memdup((u_char **) & StorageTmp->
  1205.                mteTriggerThresholdDeltaFallingEventOwner, var_val,
  1206.                var_val_len);
  1207.         StorageTmp->mteTriggerThresholdDeltaFallingEventOwnerLen =
  1208.             var_val_len;
  1209.         break;
  1210.     case UNDO:
  1211.         /*
  1212.          * Back out any changes made in the ACTION case 
  1213.          */
  1214.         SNMP_FREE(StorageTmp->mteTriggerThresholdDeltaFallingEventOwner);
  1215.         StorageTmp->mteTriggerThresholdDeltaFallingEventOwner = tmpvar;
  1216.         StorageTmp->mteTriggerThresholdDeltaFallingEventOwnerLen = tmplen;
  1217.         break;
  1218.     case COMMIT:
  1219.         /*
  1220.          * Things are working well, so it's now safe to make the change
  1221.          * permanently.  Make sure that anything done here can't fail! 
  1222.          */
  1223.         SNMP_FREE(tmpvar);
  1224.         break;
  1225.     }
  1226.     return SNMP_ERR_NOERROR;
  1227. }
  1228. int
  1229. write_mteTriggerThresholdDeltaFallingEvent(int action,
  1230.                                            u_char * var_val,
  1231.                                            u_char var_val_type,
  1232.                                            size_t var_val_len,
  1233.                                            u_char * statP,
  1234.                                            oid * name, size_t name_len)
  1235. {
  1236.     static char    *tmpvar;
  1237.     struct mteTriggerTable_data *StorageTmp = NULL;
  1238.     static size_t   tmplen;
  1239.     size_t          newlen =
  1240.         name_len -
  1241.         (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
  1242.          1);
  1243.     DEBUGMSGTL(("mteTriggerThresholdTable",
  1244.                 "write_mteTriggerThresholdDeltaFallingEvent entering action=%d...  n",
  1245.                 action));
  1246.     if ((StorageTmp =
  1247.          header_complex(mteTriggerTableStorage, NULL,
  1248.                         &name[sizeof
  1249.                               (mteTriggerThresholdTable_variables_oid) /
  1250.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  1251.                         NULL)) == NULL)
  1252.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  1253.     switch (action) {
  1254.     case RESERVE1:
  1255.         if (var_val_type != ASN_OCTET_STR) {
  1256.             fprintf(stderr,
  1257.                     "write to mteTriggerThresholdDeltaFallingEvent not ASN_OCTET_STRn");
  1258.             return SNMP_ERR_WRONGTYPE;
  1259.         }
  1260.         if (StorageTmp->storageType != ST_NONVOLATILE)
  1261.             return SNMP_ERR_NOTWRITABLE;
  1262.         break;
  1263.     case RESERVE2:
  1264.         /*
  1265.          * memory reseveration, final preparation... 
  1266.          */
  1267.         break;
  1268.     case FREE:
  1269.         /*
  1270.          * Release any resources that have been allocated 
  1271.          */
  1272.         break;
  1273.     case ACTION:
  1274.         /*
  1275.          * The variable has been stored in string for
  1276.          * you to use, and you have just been asked to do something with
  1277.          * it.  Note that anything done here must be reversable in the UNDO case 
  1278.          */
  1279.         tmpvar = StorageTmp->mteTriggerThresholdDeltaFallingEvent;
  1280.         tmplen = StorageTmp->mteTriggerThresholdDeltaFallingEventLen;
  1281.         memdup((u_char **) & StorageTmp->
  1282.                mteTriggerThresholdDeltaFallingEvent, var_val, var_val_len);
  1283.         StorageTmp->mteTriggerThresholdDeltaFallingEventLen = var_val_len;
  1284.         break;
  1285.     case UNDO:
  1286.         /*
  1287.          * Back out any changes made in the ACTION case 
  1288.          */
  1289.         SNMP_FREE(StorageTmp->mteTriggerThresholdDeltaFallingEvent);
  1290.         StorageTmp->mteTriggerThresholdDeltaFallingEvent = tmpvar;
  1291.         StorageTmp->mteTriggerThresholdDeltaFallingEventLen = tmplen;
  1292.         break;
  1293.     case COMMIT:
  1294.         /*
  1295.          * Things are working well, so it's now safe to make the change
  1296.          * permanently.  Make sure that anything done here can't fail! 
  1297.          */
  1298.         SNMP_FREE(tmpvar);
  1299.         break;
  1300.     }
  1301.     return SNMP_ERR_NOERROR;
  1302. }