* \retval 0 On success.
* \retval -1 On failure.
*/
-static int SCRConfAddReference(char *rawstr, DetectEngineCtx *de_ctx)
+int SCRConfAddReference(DetectEngineCtx *de_ctx, const char *line)
{
char system[REFERENCE_SYSTEM_NAME_MAX];
char url[REFERENCE_CONTENT_NAME_MAX];
int ret = 0;
int ov[MAX_SUBSTRINGS];
- ret = pcre_exec(regex, regex_study, rawstr, strlen(rawstr), 0, 0, ov, 30);
+ ret = pcre_exec(regex, regex_study, line, strlen(line), 0, 0, ov, 30);
if (ret < 0) {
SCLogError(SC_ERR_REFERENCE_CONFIG, "Invalid Reference Config in "
"reference.config file");
}
/* retrieve the reference system */
- ret = pcre_copy_substring((char *)rawstr, ov, 30, 1, system, sizeof(system));
+ ret = pcre_copy_substring((char *)line, ov, 30, 1, system, sizeof(system));
if (ret < 0) {
SCLogError(SC_ERR_PCRE_GET_SUBSTRING, "pcre_copy_substring() failed");
goto error;
}
/* retrieve the reference url */
- ret = pcre_copy_substring((char *)rawstr, ov, 30, 2, url, sizeof(url));
+ ret = pcre_copy_substring((char *)line, ov, 30, 2, url, sizeof(url));
if (ret < 0) {
SCLogError(SC_ERR_PCRE_GET_SUBSTRING, "pcre_copy_substring() failed");
goto error;
if (SCRConfIsLineBlankOrComment(line))
continue;
- SCRConfAddReference(line, de_ctx);
+ SCRConfAddReference(de_ctx, line);
i++;
}