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

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 "mteTriggerExistenceTable.h"
  24. #include "mteTriggerTable.h"
  25. /*
  26.  * mteTriggerExistenceTable_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             mteTriggerExistenceTable_variables_oid[] =
  32.     { 1, 3, 6, 1, 2, 1, 88, 1, 2, 4 };
  33. /*
  34.  * variable2 mteTriggerExistenceTable_variables:
  35.  *   this variable defines function callbacks and type return information 
  36.  *   for the mteTriggerExistenceTable mib section 
  37.  */
  38. struct variable2 mteTriggerExistenceTable_variables[] = {
  39.     /*
  40.      * magic number        , variable type , ro/rw , callback fn  , L, oidsuffix 
  41.      */
  42. #define   MTETRIGGEREXISTENCETEST  3
  43.     {MTETRIGGEREXISTENCETEST, ASN_BIT_STR, RWRITE,
  44.      var_mteTriggerExistenceTable, 2, {1, 1}},
  45. #define   MTETRIGGEREXISTENCESTARTUP  4
  46.     {MTETRIGGEREXISTENCESTARTUP, ASN_BIT_STR, RWRITE,
  47.      var_mteTriggerExistenceTable, 2, {1, 2}},
  48. #define   MTETRIGGEREXISTENCEOBJECTSOWNER  5
  49.     {MTETRIGGEREXISTENCEOBJECTSOWNER, ASN_OCTET_STR, RWRITE,
  50.      var_mteTriggerExistenceTable, 2, {1, 3}},
  51. #define   MTETRIGGEREXISTENCEOBJECTS  6
  52.     {MTETRIGGEREXISTENCEOBJECTS, ASN_OCTET_STR, RWRITE,
  53.      var_mteTriggerExistenceTable, 2, {1, 4}},
  54. #define   MTETRIGGEREXISTENCEEVENTOWNER  7
  55.     {MTETRIGGEREXISTENCEEVENTOWNER, ASN_OCTET_STR, RWRITE,
  56.      var_mteTriggerExistenceTable, 2, {1, 5}},
  57. #define   MTETRIGGEREXISTENCEEVENT  8
  58.     {MTETRIGGEREXISTENCEEVENT, ASN_OCTET_STR, RWRITE,
  59.      var_mteTriggerExistenceTable, 2, {1, 6}},
  60. };
  61. /*
  62.  * (L = length of the oidsuffix) 
  63.  */
  64. /*
  65.  * global storage of our data, saved in and configured by header_complex() 
  66.  */
  67. extern struct header_complex_index *mteTriggerTableStorage;
  68. /*
  69.  * init_mteTriggerExistenceTable():
  70.  *   Initialization routine.  This is called when the agent starts up.
  71.  *   At a minimum, registration of your variables should take place here.
  72.  */
  73. void
  74. init_mteTriggerExistenceTable(void)
  75. {
  76.     DEBUGMSGTL(("mteTriggerExistenceTable", "initializing...  "));
  77.     /*
  78.      * register ourselves with the agent to handle our mib tree 
  79.      */
  80.     REGISTER_MIB("mteTriggerExistenceTable",
  81.                  mteTriggerExistenceTable_variables, variable2,
  82.                  mteTriggerExistenceTable_variables_oid);
  83.     /*
  84.      * place any other initialization junk you need here 
  85.      */
  86.     DEBUGMSGTL(("mteTriggerExistenceTable", "done.n"));
  87. }
  88. /*
  89.  * var_mteTriggerExistenceTable():
  90.  *   Handle this table separately from the scalar value case.
  91.  *   The workings of this are basically the same as for var_mteTriggerExistenceTable above.
  92.  */
  93. unsigned char  *
  94. var_mteTriggerExistenceTable(struct variable *vp,
  95.                              oid * name,
  96.                              size_t * length,
  97.                              int exact,
  98.                              size_t * var_len, WriteMethod ** write_method)
  99. {
  100.     struct mteTriggerTable_data *StorageTmp = NULL;
  101.     DEBUGMSGTL(("mteTriggerExistenceTable",
  102.                 "var_mteTriggerExistenceTable: Entering...  n"));
  103.     /*
  104.      * this assumes you have registered all your data properly
  105.      */
  106.     if ((StorageTmp =
  107.          header_complex(mteTriggerTableStorage, vp, name, length, exact,
  108.                         var_len, write_method)) == NULL)
  109.         return NULL;
  110.     if (!(StorageTmp->mteTriggerTest[0] & MTETRIGGERTEST_EXISTENCE))
  111.         return NULL;
  112.     /*
  113.      * this is where we do the value assignments for the mib results.
  114.      */
  115.     switch (vp->magic) {
  116.     case MTETRIGGEREXISTENCETEST:
  117.         *write_method = write_mteTriggerExistenceTest;
  118.         *var_len = StorageTmp->mteTriggerExistenceTestLen;
  119.         return (u_char *) StorageTmp->mteTriggerExistenceTest;
  120.     case MTETRIGGEREXISTENCESTARTUP:
  121.         *write_method = write_mteTriggerExistenceStartup;
  122.         *var_len = StorageTmp->mteTriggerExistenceStartupLen;
  123.         return (u_char *) StorageTmp->mteTriggerExistenceStartup;
  124.     case MTETRIGGEREXISTENCEOBJECTSOWNER:
  125.         *write_method = write_mteTriggerExistenceObjectsOwner;
  126.         *var_len = StorageTmp->mteTriggerExistenceObjectsOwnerLen;
  127.         return (u_char *) StorageTmp->mteTriggerExistenceObjectsOwner;
  128.     case MTETRIGGEREXISTENCEOBJECTS:
  129.         *write_method = write_mteTriggerExistenceObjects;
  130.         *var_len = StorageTmp->mteTriggerExistenceObjectsLen;
  131.         return (u_char *) StorageTmp->mteTriggerExistenceObjects;
  132.     case MTETRIGGEREXISTENCEEVENTOWNER:
  133.         *write_method = write_mteTriggerExistenceEventOwner;
  134.         *var_len = StorageTmp->mteTriggerExistenceEventOwnerLen;
  135.         return (u_char *) StorageTmp->mteTriggerExistenceEventOwner;
  136.     case MTETRIGGEREXISTENCEEVENT:
  137.         *write_method = write_mteTriggerExistenceEvent;
  138.         *var_len = StorageTmp->mteTriggerExistenceEventLen;
  139.         return (u_char *) StorageTmp->mteTriggerExistenceEvent;
  140.     default:
  141.         ERROR_MSG("");
  142.     }
  143.     return NULL;
  144. }
  145. int
  146. write_mteTriggerExistenceTest(int action,
  147.                               u_char * var_val,
  148.                               u_char var_val_type,
  149.                               size_t var_val_len,
  150.                               u_char * statP, oid * name, size_t name_len)
  151. {
  152.     static char    *tmpvar;
  153.     struct mteTriggerTable_data *StorageTmp = NULL;
  154.     static size_t   tmplen;
  155.     size_t          newlen =
  156.         name_len -
  157.         (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
  158.          1);
  159.     DEBUGMSGTL(("mteTriggerExistenceTable",
  160.                 "write_mteTriggerExistenceTest entering action=%d...  n",
  161.                 action));
  162.     if ((StorageTmp =
  163.          header_complex(mteTriggerTableStorage, NULL,
  164.                         &name[sizeof
  165.                               (mteTriggerExistenceTable_variables_oid) /
  166.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  167.                         NULL)) == NULL)
  168.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  169.     switch (action) {
  170.     case RESERVE1:
  171.         if (var_val_type != ASN_OCTET_STR) {
  172.             fprintf(stderr,
  173.                     "write to mteTriggerExistenceTest not ASN_OCTET_STRn");
  174.             return SNMP_ERR_WRONGTYPE;
  175.         }
  176.         if (StorageTmp->storageType != ST_NONVOLATILE)
  177.             return SNMP_ERR_NOTWRITABLE;
  178.         break;
  179.     case RESERVE2:
  180.         /*
  181.          * memory reseveration, final preparation... 
  182.          */
  183.         break;
  184.     case FREE:
  185.         /*
  186.          * Release any resources that have been allocated 
  187.          */
  188.         break;
  189.     case ACTION:
  190.         /*
  191.          * The variable has been stored in string for
  192.          * you to use, and you have just been asked to do something with
  193.          * it.  Note that anything done here must be reversable in the UNDO case 
  194.          */
  195.         tmpvar = StorageTmp->mteTriggerExistenceTest;
  196.         tmplen = StorageTmp->mteTriggerExistenceTestLen;
  197.         memdup((u_char **) & StorageTmp->mteTriggerExistenceTest, var_val,
  198.                var_val_len);
  199.         StorageTmp->mteTriggerExistenceTestLen = var_val_len;
  200.         break;
  201.     case UNDO:
  202.         /*
  203.          * Back out any changes made in the ACTION case 
  204.          */
  205.         SNMP_FREE(StorageTmp->mteTriggerExistenceTest);
  206.         StorageTmp->mteTriggerExistenceTest = tmpvar;
  207.         StorageTmp->mteTriggerExistenceTestLen = tmplen;
  208.         break;
  209.     case COMMIT:
  210.         /*
  211.          * Things are working well, so it's now safe to make the change
  212.          * permanently.  Make sure that anything done here can't fail! 
  213.          */
  214.         SNMP_FREE(tmpvar);
  215.         break;
  216.     }
  217.     return SNMP_ERR_NOERROR;
  218. }
  219. int
  220. write_mteTriggerExistenceStartup(int action,
  221.                                  u_char * var_val,
  222.                                  u_char var_val_type,
  223.                                  size_t var_val_len,
  224.                                  u_char * statP,
  225.                                  oid * name, size_t name_len)
  226. {
  227.     static char    *tmpvar;
  228.     struct mteTriggerTable_data *StorageTmp = NULL;
  229.     static size_t   tmplen;
  230.     size_t          newlen =
  231.         name_len -
  232.         (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
  233.          1);
  234.     DEBUGMSGTL(("mteTriggerExistenceTable",
  235.                 "write_mteTriggerExistenceStartup entering action=%d...  n",
  236.                 action));
  237.     if ((StorageTmp =
  238.          header_complex(mteTriggerTableStorage, NULL,
  239.                         &name[sizeof
  240.                               (mteTriggerExistenceTable_variables_oid) /
  241.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  242.                         NULL)) == NULL)
  243.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  244.     switch (action) {
  245.     case RESERVE1:
  246.         if (var_val_type != ASN_OCTET_STR) {
  247.             fprintf(stderr,
  248.                     "write to mteTriggerExistenceStartup not ASN_OCTET_STRn");
  249.             return SNMP_ERR_WRONGTYPE;
  250.         }
  251.         if (StorageTmp->storageType != ST_NONVOLATILE)
  252.             return SNMP_ERR_NOTWRITABLE;
  253.         break;
  254.     case RESERVE2:
  255.         /*
  256.          * memory reseveration, final preparation... 
  257.          */
  258.         break;
  259.     case FREE:
  260.         /*
  261.          * Release any resources that have been allocated 
  262.          */
  263.         break;
  264.     case ACTION:
  265.         /*
  266.          * The variable has been stored in string for
  267.          * you to use, and you have just been asked to do something with
  268.          * it.  Note that anything done here must be reversable in the UNDO case 
  269.          */
  270.         tmpvar = StorageTmp->mteTriggerExistenceStartup;
  271.         tmplen = StorageTmp->mteTriggerExistenceStartupLen;
  272.         memdup((u_char **) & StorageTmp->mteTriggerExistenceStartup,
  273.                var_val, var_val_len);
  274.         StorageTmp->mteTriggerExistenceStartupLen = var_val_len;
  275.         break;
  276.     case UNDO:
  277.         /*
  278.          * Back out any changes made in the ACTION case 
  279.          */
  280.         SNMP_FREE(StorageTmp->mteTriggerExistenceStartup);
  281.         StorageTmp->mteTriggerExistenceStartup = tmpvar;
  282.         StorageTmp->mteTriggerExistenceStartupLen = tmplen;
  283.         break;
  284.     case COMMIT:
  285.         /*
  286.          * Things are working well, so it's now safe to make the change
  287.          * permanently.  Make sure that anything done here can't fail! 
  288.          */
  289.         SNMP_FREE(tmpvar);
  290.         break;
  291.     }
  292.     return SNMP_ERR_NOERROR;
  293. }
  294. int
  295. write_mteTriggerExistenceObjectsOwner(int action,
  296.                                       u_char * var_val,
  297.                                       u_char var_val_type,
  298.                                       size_t var_val_len,
  299.                                       u_char * statP,
  300.                                       oid * name, size_t name_len)
  301. {
  302.     static char    *tmpvar;
  303.     struct mteTriggerTable_data *StorageTmp = NULL;
  304.     static size_t   tmplen;
  305.     size_t          newlen =
  306.         name_len -
  307.         (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
  308.          1);
  309.     DEBUGMSGTL(("mteTriggerExistenceTable",
  310.                 "write_mteTriggerExistenceObjectsOwner entering action=%d...  n",
  311.                 action));
  312.     if ((StorageTmp =
  313.          header_complex(mteTriggerTableStorage, NULL,
  314.                         &name[sizeof
  315.                               (mteTriggerExistenceTable_variables_oid) /
  316.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  317.                         NULL)) == NULL)
  318.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  319.     switch (action) {
  320.     case RESERVE1:
  321.         if (var_val_type != ASN_OCTET_STR) {
  322.             fprintf(stderr,
  323.                     "write to mteTriggerExistenceObjectsOwner not ASN_OCTET_STRn");
  324.             return SNMP_ERR_WRONGTYPE;
  325.         }
  326.         if (StorageTmp->storageType != ST_NONVOLATILE)
  327.             return SNMP_ERR_NOTWRITABLE;
  328.         break;
  329.     case RESERVE2:
  330.         /*
  331.          * memory reseveration, final preparation... 
  332.          */
  333.         break;
  334.     case FREE:
  335.         /*
  336.          * Release any resources that have been allocated 
  337.          */
  338.         break;
  339.     case ACTION:
  340.         /*
  341.          * The variable has been stored in string for
  342.          * you to use, and you have just been asked to do something with
  343.          * it.  Note that anything done here must be reversable in the UNDO case 
  344.          */
  345.         tmpvar = StorageTmp->mteTriggerExistenceObjectsOwner;
  346.         tmplen = StorageTmp->mteTriggerExistenceObjectsOwnerLen;
  347.         memdup((u_char **) & StorageTmp->mteTriggerExistenceObjectsOwner,
  348.                var_val, var_val_len);
  349.         StorageTmp->mteTriggerExistenceObjectsOwnerLen = var_val_len;
  350.         break;
  351.     case UNDO:
  352.         /*
  353.          * Back out any changes made in the ACTION case 
  354.          */
  355.         SNMP_FREE(StorageTmp->mteTriggerExistenceObjectsOwner);
  356.         StorageTmp->mteTriggerExistenceObjectsOwner = tmpvar;
  357.         StorageTmp->mteTriggerExistenceObjectsOwnerLen = tmplen;
  358.         break;
  359.     case COMMIT:
  360.         /*
  361.          * Things are working well, so it's now safe to make the change
  362.          * permanently.  Make sure that anything done here can't fail! 
  363.          */
  364.         SNMP_FREE(tmpvar);
  365.         break;
  366.     }
  367.     return SNMP_ERR_NOERROR;
  368. }
  369. int
  370. write_mteTriggerExistenceObjects(int action,
  371.                                  u_char * var_val,
  372.                                  u_char var_val_type,
  373.                                  size_t var_val_len,
  374.                                  u_char * statP,
  375.                                  oid * name, size_t name_len)
  376. {
  377.     static char    *tmpvar;
  378.     struct mteTriggerTable_data *StorageTmp = NULL;
  379.     static size_t   tmplen;
  380.     size_t          newlen =
  381.         name_len -
  382.         (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
  383.          1);
  384.     DEBUGMSGTL(("mteTriggerExistenceTable",
  385.                 "write_mteTriggerExistenceObjects entering action=%d...  n",
  386.                 action));
  387.     if ((StorageTmp =
  388.          header_complex(mteTriggerTableStorage, NULL,
  389.                         &name[sizeof
  390.                               (mteTriggerExistenceTable_variables_oid) /
  391.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  392.                         NULL)) == NULL)
  393.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  394.     switch (action) {
  395.     case RESERVE1:
  396.         if (var_val_type != ASN_OCTET_STR) {
  397.             fprintf(stderr,
  398.                     "write to mteTriggerExistenceObjects not ASN_OCTET_STRn");
  399.             return SNMP_ERR_WRONGTYPE;
  400.         }
  401.         if (StorageTmp->storageType != ST_NONVOLATILE)
  402.             return SNMP_ERR_NOTWRITABLE;
  403.         break;
  404.     case RESERVE2:
  405.         /*
  406.          * memory reseveration, final preparation... 
  407.          */
  408.         break;
  409.     case FREE:
  410.         /*
  411.          * Release any resources that have been allocated 
  412.          */
  413.         break;
  414.     case ACTION:
  415.         /*
  416.          * The variable has been stored in string for
  417.          * you to use, and you have just been asked to do something with
  418.          * it.  Note that anything done here must be reversable in the UNDO case 
  419.          */
  420.         tmpvar = StorageTmp->mteTriggerExistenceObjects;
  421.         tmplen = StorageTmp->mteTriggerExistenceObjectsLen;
  422.         memdup((u_char **) & StorageTmp->mteTriggerExistenceObjects,
  423.                var_val, var_val_len);
  424.         StorageTmp->mteTriggerExistenceObjectsLen = var_val_len;
  425.         break;
  426.     case UNDO:
  427.         /*
  428.          * Back out any changes made in the ACTION case 
  429.          */
  430.         SNMP_FREE(StorageTmp->mteTriggerExistenceObjects);
  431.         StorageTmp->mteTriggerExistenceObjects = tmpvar;
  432.         StorageTmp->mteTriggerExistenceObjectsLen = tmplen;
  433.         break;
  434.     case COMMIT:
  435.         /*
  436.          * Things are working well, so it's now safe to make the change
  437.          * permanently.  Make sure that anything done here can't fail! 
  438.          */
  439.         SNMP_FREE(tmpvar);
  440.         break;
  441.     }
  442.     return SNMP_ERR_NOERROR;
  443. }
  444. int
  445. write_mteTriggerExistenceEventOwner(int action,
  446.                                     u_char * var_val,
  447.                                     u_char var_val_type,
  448.                                     size_t var_val_len,
  449.                                     u_char * statP,
  450.                                     oid * name, size_t name_len)
  451. {
  452.     static char    *tmpvar;
  453.     struct mteTriggerTable_data *StorageTmp = NULL;
  454.     static size_t   tmplen;
  455.     size_t          newlen =
  456.         name_len -
  457.         (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
  458.          1);
  459.     DEBUGMSGTL(("mteTriggerExistenceTable",
  460.                 "write_mteTriggerExistenceEventOwner entering action=%d...  n",
  461.                 action));
  462.     if ((StorageTmp =
  463.          header_complex(mteTriggerTableStorage, NULL,
  464.                         &name[sizeof
  465.                               (mteTriggerExistenceTable_variables_oid) /
  466.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  467.                         NULL)) == NULL)
  468.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  469.     switch (action) {
  470.     case RESERVE1:
  471.         if (var_val_type != ASN_OCTET_STR) {
  472.             fprintf(stderr,
  473.                     "write to mteTriggerExistenceEventOwner not ASN_OCTET_STRn");
  474.             return SNMP_ERR_WRONGTYPE;
  475.         }
  476.         if (StorageTmp->storageType != ST_NONVOLATILE)
  477.             return SNMP_ERR_NOTWRITABLE;
  478.         break;
  479.     case RESERVE2:
  480.         /*
  481.          * memory reseveration, final preparation... 
  482.          */
  483.         break;
  484.     case FREE:
  485.         /*
  486.          * Release any resources that have been allocated 
  487.          */
  488.         break;
  489.     case ACTION:
  490.         /*
  491.          * The variable has been stored in string for
  492.          * you to use, and you have just been asked to do something with
  493.          * it.  Note that anything done here must be reversable in the UNDO case 
  494.          */
  495.         tmpvar = StorageTmp->mteTriggerExistenceEventOwner;
  496.         tmplen = StorageTmp->mteTriggerExistenceEventOwnerLen;
  497.         memdup((u_char **) & StorageTmp->mteTriggerExistenceEventOwner,
  498.                var_val, var_val_len);
  499.         StorageTmp->mteTriggerExistenceEventOwnerLen = var_val_len;
  500.         break;
  501.     case UNDO:
  502.         /*
  503.          * Back out any changes made in the ACTION case 
  504.          */
  505.         SNMP_FREE(StorageTmp->mteTriggerExistenceEventOwner);
  506.         StorageTmp->mteTriggerExistenceEventOwner = tmpvar;
  507.         StorageTmp->mteTriggerExistenceEventOwnerLen = tmplen;
  508.         break;
  509.     case COMMIT:
  510.         /*
  511.          * Things are working well, so it's now safe to make the change
  512.          * permanently.  Make sure that anything done here can't fail! 
  513.          */
  514.         SNMP_FREE(tmpvar);
  515.         break;
  516.     }
  517.     return SNMP_ERR_NOERROR;
  518. }
  519. int
  520. write_mteTriggerExistenceEvent(int action,
  521.                                u_char * var_val,
  522.                                u_char var_val_type,
  523.                                size_t var_val_len,
  524.                                u_char * statP, oid * name, size_t name_len)
  525. {
  526.     static char    *tmpvar;
  527.     struct mteTriggerTable_data *StorageTmp = NULL;
  528.     static size_t   tmplen;
  529.     size_t          newlen =
  530.         name_len -
  531.         (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
  532.          1);
  533.     DEBUGMSGTL(("mteTriggerExistenceTable",
  534.                 "write_mteTriggerExistenceEvent entering action=%d...  n",
  535.                 action));
  536.     if ((StorageTmp =
  537.          header_complex(mteTriggerTableStorage, NULL,
  538.                         &name[sizeof
  539.                               (mteTriggerExistenceTable_variables_oid) /
  540.                               sizeof(oid) + 3 - 1], &newlen, 1, NULL,
  541.                         NULL)) == NULL)
  542.         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
  543.     switch (action) {
  544.     case RESERVE1:
  545.         if (var_val_type != ASN_OCTET_STR) {
  546.             fprintf(stderr,
  547.                     "write to mteTriggerExistenceEvent not ASN_OCTET_STRn");
  548.             return SNMP_ERR_WRONGTYPE;
  549.         }
  550.         if (StorageTmp->storageType != ST_NONVOLATILE)
  551.             return SNMP_ERR_NOTWRITABLE;
  552.         break;
  553.     case RESERVE2:
  554.         /*
  555.          * memory reseveration, final preparation... 
  556.          */
  557.         break;
  558.     case FREE:
  559.         /*
  560.          * Release any resources that have been allocated 
  561.          */
  562.         break;
  563.     case ACTION:
  564.         /*
  565.          * The variable has been stored in string for
  566.          * you to use, and you have just been asked to do something with
  567.          * it.  Note that anything done here must be reversable in the UNDO case 
  568.          */
  569.         tmpvar = StorageTmp->mteTriggerExistenceEvent;
  570.         tmplen = StorageTmp->mteTriggerExistenceEventLen;
  571.         memdup((u_char **) & StorageTmp->mteTriggerExistenceEvent, var_val,
  572.                var_val_len);
  573.         StorageTmp->mteTriggerExistenceEventLen = var_val_len;
  574.         break;
  575.     case UNDO:
  576.         /*
  577.          * Back out any changes made in the ACTION case 
  578.          */
  579.         SNMP_FREE(StorageTmp->mteTriggerExistenceEvent);
  580.         StorageTmp->mteTriggerExistenceEvent = tmpvar;
  581.         StorageTmp->mteTriggerExistenceEventLen = tmplen;
  582.         break;
  583.     case COMMIT:
  584.         /*
  585.          * Things are working well, so it's now safe to make the change
  586.          * permanently.  Make sure that anything done here can't fail! 
  587.          */
  588.         SNMP_FREE(tmpvar);
  589.         break;
  590.     }
  591.     return SNMP_ERR_NOERROR;
  592. }