-int configure_fticks(char **reporting, char **mac, char **key) {
- int r = 0;
-
- if (*reporting == NULL)
- goto out;
-
- if (strcasecmp(*reporting, "None") == 0)
- options.fticks_reporting = RSP_FTICKS_REPORTING_NONE;
- else if (strcasecmp(*reporting, "Basic") == 0)
- options.fticks_reporting = RSP_FTICKS_REPORTING_BASIC;
- else if (strcasecmp(*reporting, "Full") == 0)
- options.fticks_reporting = RSP_FTICKS_REPORTING_FULL;
- else {
- debugx(1, DBG_ERR, "config error: invalid F-Ticks-Reporting value: %s",
- *reporting);
- r = 1;
- goto out;
- }
-
- if (strcasecmp(*mac, "Static") == 0)
- options.fticks_mac = RSP_FTICKS_MAC_STATIC;
- else if (strcasecmp(*mac, "Original") == 0)
- options.fticks_mac = RSP_FTICKS_MAC_ORIGINAL;
- else if (strcasecmp(*mac, "VendorHashed") == 0)
- options.fticks_mac = RSP_FTICKS_MAC_VENDOR_HASHED;
- else if (strcasecmp(*mac, "VendorKeyHashed") == 0)
- options.fticks_mac = RSP_FTICKS_MAC_VENDOR_KEY_HASHED;
- else if (strcasecmp(*mac, "FullyHashed") == 0)
- options.fticks_mac = RSP_FTICKS_MAC_FULLY_HASHED;
- else if (strcasecmp(*mac, "FullyKeyHashed") == 0)
- options.fticks_mac = RSP_FTICKS_MAC_FULLY_KEY_HASHED;
- else {
- debugx(1, DBG_ERR, "config error: invalid F-Ticks-MAC value: %s", *mac);
- r = 1;
- goto out;
- }
-
- if (*key == NULL
- && (options.fticks_mac == RSP_FTICKS_MAC_VENDOR_KEY_HASHED
- || options.fticks_mac == RSP_FTICKS_MAC_FULLY_KEY_HASHED)) {
- debugx(1, DBG_ERR,
- "config error: F-Ticks-MAC %s requires an F-Ticks-Key", *mac);
- options.fticks_mac = RSP_FTICKS_MAC_STATIC;
- r = 1;
- goto out;
- }
-
- if (*key != NULL)
- options.fticks_key = *key;
-
-out:
- if (*reporting != NULL) {
- free(*reporting);
- *reporting = NULL;
- }
- if (*mac != NULL) {
- free(*mac);
- *mac = NULL;
- }
- return r;
-}
-