4u2change/msdb.c
short msdb_communityGetRevoked(
    const uint8_t *community,
    short         *revoked) {
    FILE          *fp     = NULL;
    uint8_t       rev[16];
    short         ret_val = MSDB_FAILURE;

    memset(rev, 0, sizeof(revoked));

    if (NULL == community) {
        MSDB_ERROR("%s", "MSDB Community Get Revoked, no community specified!");
    } else if (NULL != (fp = openCommunityFile(community))) {
        if (!parseDataAttribute(fp, "Revoked:", (uint8_t *)&rev)) {
            if (strcasecmp((char *)rev, "true") == 0) {
                *revoked = 1; 
            }
            else {
                *revoked = 0;
            }
            ret_val  = MSDB_SUCCESS;
            memset(rev, 0, sizeof(rev));
        }
        else {
            MSDB_ERROR("MSDB Community Get Revoked, unable to get Revoke status from community <%s>!",
                community);
        }
        fclose(fp);
    }
    else {
        MSDB_ERROR("%s", "MSDB Get Revoked, failed to retrieve Revoke status!");
    }

    return ret_val;
}
/***************************************************************************/
/**
 * Get the stored Revoked indicator for the specified community.
 *
 * @param[in]  community The name of the community from which to get the 
 *                       revoked indicator.
 * @param[out] revoked   The Revoked indicator, on success.
 *
 * @return MSDB_SUCCESS or MSDB_FAILURE
 ******************************************************************************/
Get the stored Revoked indicator for the specified community.
@param[in]  community The name of the community from which to get the
revoked indicator.
@param[out] revoked   The Revoked indicator, on success.


Get the stored Revoked indicator for the specified community . @param [ in ] community The name of the community from which to get the revoked indicator . @param [ out ] revoked The Revoked indicator on success .
short msdb_communityGetRevoked(
    const uint8_t *community,
    short         *revoked) {
    FILE          *fp     = NULL;
    uint8_t       rev[16];
    short         ret_val = MSDB_FAILURE;
    memset(rev, 0, sizeof(revoked));
    if (NULL == community) {
        MSDB_ERROR("%s", "MSDB Community Get Revoked, no community specified!");
    } else if (NULL != (fp = openCommunityFile(community))) {
        if (!parseDataAttribute(fp, "Revoked:", (uint8_t *)&rev)) {
            if (strcasecmp((char *)rev, "true") == 0) {
                *revoked = 1; 
            }
            else {
                *revoked = 0;
            }
            ret_val  = MSDB_SUCCESS;
            memset(rev, 0, sizeof(rev));
        }
        else {
            MSDB_ERROR("MSDB Community Get Revoked, unable to get Revoke status from community <%s>!",
                community);
        }
        fclose(fp);
    }
    else {
        MSDB_ERROR("%s", "MSDB Get Revoked, failed to retrieve Revoke status!");
    }
    return ret_val;
}
short msdb_communityGetRevoked ( const uint8_t * community , short * revoked ) { FILE * fp = NULL ; uint8_t rev [ 16 ] ; short ret_val = MSDB_FAILURE ; memset ( rev , 0 , sizeof ( revoked ) ) ; if ( NULL == community ) { MSDB_ERROR ( " " , " " ) ; } else if ( NULL != ( fp = openCommunityFile ( community ) ) ) { if ( ! parseDataAttribute ( fp , " " , ( uint8_t * ) & rev ) ) { if ( strcasecmp ( ( char * ) rev , " " ) == 0 ) { * revoked = 1 ; } else { * revoked = 0 ; } ret_val = MSDB_SUCCESS ; memset ( rev , 0 , sizeof ( rev ) ) ; } else { MSDB_ERROR ( " " , community ) ; } fclose ( fp ) ; } else { MSDB_ERROR ( " " , " " ) ; } return ret_val ; }
Get the stored Revoked indicator for the specified community.
Get the stored Revoked indicator for the specified community .