Пример #1
0
/**
 * \brief Loads the Reference info from the reference.config file.
 *
 *        The reference.config file contains references that can be used in
 *        Signatures.  Each line of the file should  have the following format -
 *        config reference: system_name, reference_url.
 *
 * \param de_ctx Pointer to the Detection Engine Context that should be updated
 *               with reference information.
 *
 * \retval  0 On success.
 * \retval -1 On failure.
 */
int SCRConfLoadReferenceConfigFile(DetectEngineCtx *de_ctx)
{
    if (SCRConfInitContext(de_ctx) == -1) {
        printf("\nPlease check the \"reference-file\" option in your suricata.yaml file.\n");
        exit(EXIT_FAILURE);
        return -1;
    }

    SCRConfParseFile(de_ctx);
    SCRConfDeInitContext(de_ctx);

    return 0;
}
Пример #2
0
/**
 * \brief Loads the Reference info from the reference.config file.
 *
 *        The reference.config file contains references that can be used in
 *        Signatures.  Each line of the file should  have the following format -
 *        config reference: system_name, reference_url.
 *
 * \param de_ctx Pointer to the Detection Engine Context that should be updated
 *               with reference information.
 *
 * \retval  0 On success.
 * \retval -1 On failure.
 */
int SCRConfLoadReferenceConfigFile(DetectEngineCtx *de_ctx, FILE *fd)
{
    fd = SCRConfInitContextAndLocalResources(de_ctx, fd);
    if (fd == NULL) {
#ifdef UNITTESTS
        if (RunmodeIsUnittests() && fd == NULL) {
            return -1;
        }
#endif
        SCLogError(SC_ERR_OPENING_FILE, "please check the \"reference-config-file\" "
                "option in your suricata.yaml file");
        return -1;
    }

    SCRConfParseFile(de_ctx, fd);
    SCRConfDeInitLocalResources(de_ctx, fd);

    return 0;
}