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

📄 mtetriggerthresholdtable.c

📁 开发snmp的开发包有两个开放的SNMP开发库
💻 C
📖 第 1 页 / 共 4 页
字号:
                        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 mteTriggerThresholdObjects 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->mteTriggerThresholdObjects;        tmplen = StorageTmp->mteTriggerThresholdObjectsLen;        memdup((u_char **) & StorageTmp->mteTriggerThresholdObjects,               var_val, var_val_len);        StorageTmp->mteTriggerThresholdObjectsLen = var_val_len;        break;    case UNDO:        /*         * Back out any changes made in the ACTION case          */        SNMP_FREE(StorageTmp->mteTriggerThresholdObjects);        StorageTmp->mteTriggerThresholdObjects = tmpvar;        StorageTmp->mteTriggerThresholdObjectsLen = 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_mteTriggerThresholdRisingEventOwner(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_mteTriggerThresholdRisingEventOwner 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 mteTriggerThresholdRisingEventOwner 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->mteTriggerThresholdRisingEventOwner;        tmplen = StorageTmp->mteTriggerThresholdRisingEventOwnerLen;        memdup((u_char **) & StorageTmp->               mteTriggerThresholdRisingEventOwner, var_val, var_val_len);        StorageTmp->mteTriggerThresholdRisingEventOwnerLen = var_val_len;        break;    case UNDO:        /*         * Back out any changes made in the ACTION case          */        SNMP_FREE(StorageTmp->mteTriggerThresholdRisingEventOwner);        StorageTmp->mteTriggerThresholdRisingEventOwner = tmpvar;        StorageTmp->mteTriggerThresholdRisingEventOwnerLen = 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_mteTriggerThresholdRisingEvent(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_mteTriggerThresholdRisingEvent 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 mteTriggerThresholdRisingEvent 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->mteTriggerThresholdRisingEvent;        tmplen = StorageTmp->mteTriggerThresholdRisingEventLen;        memdup((u_char **) & StorageTmp->mteTriggerThresholdRisingEvent,               var_val, var_val_len);        StorageTmp->mteTriggerThresholdRisingEventLen = var_val_len;        break;    case UNDO:        /*         * Back out any changes made in the ACTION case          */        SNMP_FREE(StorageTmp->mteTriggerThresholdRisingEvent);        StorageTmp->mteTriggerThresholdRisingEvent = tmpvar;        StorageTmp->mteTriggerThresholdRisingEventLen = 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_mteTriggerThresholdFallingEventOwner(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_mteTriggerThresholdFallingEventOwner 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 mteTriggerThresholdFallingEventOwner 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->mteTriggerThresholdFallingEventOwner;        tmplen = StorageTmp->mteTriggerThresholdFallingEventOwnerLen;        memdup((u_char **) & StorageTmp->               mteTriggerThresholdFallingEventOwner, var_val, var_val_len);        StorageTmp->mteTriggerThresholdFallingEventOwnerLen = var_val_len;        break;    case UNDO:        /*         * Back out any changes made in the ACTION case          */        SNMP_FREE(StorageTmp->mteTriggerThresholdFallingEventOwner);        StorageTmp->mteTriggerThresholdFallingEventOwner = tmpvar;        StorageTmp->mteTriggerThresholdFallingEventOwnerLen = 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_mteTriggerThresholdFallingEvent(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_mteTriggerThresholdFallingEvent 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 mteTriggerThresholdFallingEvent 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 

⌨️ 快捷键说明

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