⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mtetriggerthresholdtable.c

📁 开发snmp的开发包有两个开放的SNMP开发库
💻 C
📖 第 1 页 / 共 4 页
字号:
         * it.  Note that anything done here must be reversable in the UNDO case          */        tmpvar = StorageTmp->mteTriggerThresholdRising;        StorageTmp->mteTriggerThresholdRising = *((long *) var_val);        break;    case UNDO:        /*         * Back out any changes made in the ACTION case          */        StorageTmp->mteTriggerThresholdRising = tmpvar;        break;    case COMMIT:        /*         * Things are working well, so it's now safe to make the change         * permanently.  Make sure that anything done here can't fail!          */        break;    }    return SNMP_ERR_NOERROR;}intwrite_mteTriggerThresholdFalling(int action,                                 u_char * var_val,                                 u_char var_val_type,                                 size_t var_val_len,                                 u_char * statP,                                 oid * name, size_t name_len){    static int      tmpvar;    struct mteTriggerTable_data *StorageTmp = NULL;    size_t          newlen =        name_len -        (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -         1);    DEBUGMSGTL(("mteTriggerThresholdTable",                "write_mteTriggerThresholdFalling entering action=%d...  \n",                action));    if ((StorageTmp =         header_complex(mteTriggerTableStorage, NULL,                        &name[sizeof                              (mteTriggerThresholdTable_variables_oid) /                              sizeof(oid) + 3 - 1], &newlen, 1, NULL,                        NULL)) == NULL)        return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */    switch (action) {    case RESERVE1:        if (var_val_type != ASN_INTEGER) {            fprintf(stderr,                    "write to mteTriggerThresholdFalling not ASN_INTEGER\n");            return SNMP_ERR_WRONGTYPE;        }        if (StorageTmp->storageType != ST_NONVOLATILE)            return SNMP_ERR_NOTWRITABLE;        break;    case RESERVE2:        /*         * memory reseveration, final preparation...          */        break;    case FREE:        /*         * Release any resources that have been allocated          */        break;    case ACTION:        /*         * The variable has been stored in long_ret for         * you to use, and you have just been asked to do something with         * it.  Note that anything done here must be reversable in the UNDO case          */        tmpvar = StorageTmp->mteTriggerThresholdFalling;        StorageTmp->mteTriggerThresholdFalling = *((long *) var_val);        break;    case UNDO:        /*         * Back out any changes made in the ACTION case          */        StorageTmp->mteTriggerThresholdFalling = tmpvar;        break;    case COMMIT:        /*         * Things are working well, so it's now safe to make the change         * permanently.  Make sure that anything done here can't fail!          */        break;    }    return SNMP_ERR_NOERROR;}intwrite_mteTriggerThresholdDeltaRising(int action,                                     u_char * var_val,                                     u_char var_val_type,                                     size_t var_val_len,                                     u_char * statP,                                     oid * name, size_t name_len){    static int      tmpvar;    struct mteTriggerTable_data *StorageTmp = NULL;    size_t          newlen =        name_len -        (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -         1);    DEBUGMSGTL(("mteTriggerThresholdTable",                "write_mteTriggerThresholdDeltaRising entering action=%d...  \n",                action));    if ((StorageTmp =         header_complex(mteTriggerTableStorage, NULL,                        &name[sizeof                              (mteTriggerThresholdTable_variables_oid) /                              sizeof(oid) + 3 - 1], &newlen, 1, NULL,                        NULL)) == NULL)        return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */    switch (action) {    case RESERVE1:        if (var_val_type != ASN_INTEGER) {            fprintf(stderr,                    "write to mteTriggerThresholdDeltaRising not ASN_INTEGER\n");            return SNMP_ERR_WRONGTYPE;        }        if (StorageTmp->storageType != ST_NONVOLATILE)            return SNMP_ERR_NOTWRITABLE;        break;    case RESERVE2:        /*         * memory reseveration, final preparation...          */        break;    case FREE:        /*         * Release any resources that have been allocated          */        break;    case ACTION:        /*         * The variable has been stored in long_ret for         * you to use, and you have just been asked to do something with         * it.  Note that anything done here must be reversable in the UNDO case          */        tmpvar = StorageTmp->mteTriggerThresholdDeltaRising;        StorageTmp->mteTriggerThresholdDeltaRising = *((long *) var_val);        break;    case UNDO:        /*         * Back out any changes made in the ACTION case          */        StorageTmp->mteTriggerThresholdDeltaRising = tmpvar;        break;    case COMMIT:        /*         * Things are working well, so it's now safe to make the change         * permanently.  Make sure that anything done here can't fail!          */        break;    }    return SNMP_ERR_NOERROR;}intwrite_mteTriggerThresholdDeltaFalling(int action,                                      u_char * var_val,                                      u_char var_val_type,                                      size_t var_val_len,                                      u_char * statP,                                      oid * name, size_t name_len){    static int      tmpvar;    struct mteTriggerTable_data *StorageTmp = NULL;    size_t          newlen =        name_len -        (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -         1);    DEBUGMSGTL(("mteTriggerThresholdTable",                "write_mteTriggerThresholdDeltaFalling entering action=%d...  \n",                action));    if ((StorageTmp =         header_complex(mteTriggerTableStorage, NULL,                        &name[sizeof                              (mteTriggerThresholdTable_variables_oid) /                              sizeof(oid) + 3 - 1], &newlen, 1, NULL,                        NULL)) == NULL)        return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */    switch (action) {    case RESERVE1:        if (var_val_type != ASN_INTEGER) {            fprintf(stderr,                    "write to mteTriggerThresholdDeltaFalling not ASN_INTEGER\n");            return SNMP_ERR_WRONGTYPE;        }        if (StorageTmp->storageType != ST_NONVOLATILE)            return SNMP_ERR_NOTWRITABLE;        break;    case RESERVE2:        /*         * memory reseveration, final preparation...          */        break;    case FREE:        /*         * Release any resources that have been allocated          */        break;    case ACTION:        /*         * The variable has been stored in long_ret for         * you to use, and you have just been asked to do something with         * it.  Note that anything done here must be reversable in the UNDO case          */        tmpvar = StorageTmp->mteTriggerThresholdDeltaFalling;        StorageTmp->mteTriggerThresholdDeltaFalling = *((long *) var_val);        break;    case UNDO:        /*         * Back out any changes made in the ACTION case          */        StorageTmp->mteTriggerThresholdDeltaFalling = tmpvar;        break;    case COMMIT:        /*         * Things are working well, so it's now safe to make the change         * permanently.  Make sure that anything done here can't fail!          */        break;    }    return SNMP_ERR_NOERROR;}intwrite_mteTriggerThresholdObjectsOwner(int action,                                      u_char * var_val,                                      u_char var_val_type,                                      size_t var_val_len,                                      u_char * statP,                                      oid * name, size_t name_len){    static char    *tmpvar;    struct mteTriggerTable_data *StorageTmp = NULL;    static size_t   tmplen;    size_t          newlen =        name_len -        (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -         1);    DEBUGMSGTL(("mteTriggerThresholdTable",                "write_mteTriggerThresholdObjectsOwner entering action=%d...  \n",                action));    if ((StorageTmp =         header_complex(mteTriggerTableStorage, NULL,                        &name[sizeof                              (mteTriggerThresholdTable_variables_oid) /                              sizeof(oid) + 3 - 1], &newlen, 1, NULL,                        NULL)) == NULL)        return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */    switch (action) {    case RESERVE1:        if (var_val_type != ASN_OCTET_STR) {            fprintf(stderr,                    "write to mteTriggerThresholdObjectsOwner not ASN_OCTET_STR\n");            return SNMP_ERR_WRONGTYPE;        }        if (StorageTmp->storageType != ST_NONVOLATILE)            return SNMP_ERR_NOTWRITABLE;        break;    case RESERVE2:        /*         * memory reseveration, final preparation...          */        break;    case FREE:        /*         * Release any resources that have been allocated          */        break;    case ACTION:        /*         * The variable has been stored in string for         * you to use, and you have just been asked to do something with         * it.  Note that anything done here must be reversable in the UNDO case          */        tmpvar = StorageTmp->mteTriggerThresholdObjectsOwner;        tmplen = StorageTmp->mteTriggerThresholdObjectsOwnerLen;        memdup((u_char **) & StorageTmp->mteTriggerThresholdObjectsOwner,               var_val, var_val_len);        StorageTmp->mteTriggerThresholdObjectsOwnerLen = var_val_len;        break;    case UNDO:        /*         * Back out any changes made in the ACTION case          */        SNMP_FREE(StorageTmp->mteTriggerThresholdObjectsOwner);        StorageTmp->mteTriggerThresholdObjectsOwner = tmpvar;        StorageTmp->mteTriggerThresholdObjectsOwnerLen = tmplen;        break;    case COMMIT:        /*         * Things are working well, so it's now safe to make the change         * permanently.  Make sure that anything done here can't fail!          */        SNMP_FREE(tmpvar);        break;    }    return SNMP_ERR_NOERROR;}intwrite_mteTriggerThresholdObjects(int action,                                 u_char * var_val,                                 u_char var_val_type,                                 size_t var_val_len,                                 u_char * statP,                                 oid * name, size_t name_len){    static char    *tmpvar;    struct mteTriggerTable_data *StorageTmp = NULL;    static size_t   tmplen;    size_t          newlen =        name_len -        (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -         1);    DEBUGMSGTL(("mteTriggerThresholdTable",                "write_mteTriggerThresholdObjects entering action=%d...  \n",                action));    if ((StorageTmp =         header_complex(mteTriggerTableStorage, NULL,                        &name[sizeof                              (mteTriggerThresholdTable_variables_oid) /                              sizeof(oid) + 3 - 1], &newlen, 1, NULL,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -