Switch from u8 to u16 to allow for more classtypes.
Rename Signature::class to Signature::class_id to make it clear
it is an id.
phdr->generator_id = htonl(pa->s->gid);
phdr->signature_id = htonl(pa->s->id);
phdr->signature_revision = htonl(pa->s->rev);
- phdr->classification_id = htonl(pa->s->class);
+ phdr->classification_id = htonl(pa->s->class_id);
phdr->priority_id = htonl(pa->s->prio);
SCMutexLock(&file_ctx->fp_mutex);
phdr->generator_id = htonl(pa->s->gid);
phdr->signature_id = htonl(pa->s->id);
phdr->signature_revision = htonl(pa->s->rev);
- phdr->classification_id = htonl(pa->s->class);
+ phdr->classification_id = htonl(pa->s->class_id);
phdr->priority_id = htonl(pa->s->prio);
/* check and enforce the filesize limit */
{
char parsed_ct_name[1024] = "";
- if ((s->class > 0) || (s->class_msg != NULL)) {
+ if ((s->class_id > 0) || (s->class_msg != NULL)) {
SCLogWarning(SC_ERR_CONFLICTING_RULE_KEYWORDS, "duplicated 'classtype' "
"keyword detected. Using instance with highest priority");
}
if ((s->init_data->init_flags & SIG_FLAG_INIT_PRIO_EXPLICT) != 0) {
/* don't touch Signature::prio */
- s->class = ct->classtype_id;
+ s->class_id = ct->classtype_id;
s->class_msg = ct->classtype_desc;
} else if (s->prio == -1) {
s->prio = ct->priority;
- s->class = ct->classtype_id;
+ s->class_id = ct->classtype_id;
s->class_msg = ct->classtype_desc;
} else {
if (ct->priority < s->prio) {
s->prio = ct->priority;
- s->class = ct->classtype_id;
+ s->class_id = ct->classtype_id;
s->class_msg = ct->classtype_desc;
}
}
DetectProto proto;
/** classification id **/
- uint8_t class;
+ uint16_t class_id;
/** ipv4 match arrays */
uint16_t addr_dst_match4_cnt;
void SCClassConfClasstypeHashFree(void *ch);
static const char *SCClassConfGetConfFilename(const DetectEngineCtx *de_ctx);
-static SCClassConfClasstype *SCClassConfAllocClasstype(uint8_t classtype_id,
+static SCClassConfClasstype *SCClassConfAllocClasstype(uint16_t classtype_id,
const char *classtype, const char *classtype_desc, int priority);
static void SCClassConfDeAllocClasstype(SCClassConfClasstype *ct);
* \retval 0 On success.
* \retval -1 On failure.
*/
-static int SCClassConfAddClasstype(char *rawstr, uint8_t index, DetectEngineCtx *de_ctx)
+static int SCClassConfAddClasstype(char *rawstr, uint16_t index, DetectEngineCtx *de_ctx)
{
char ct_name[64];
char ct_desc[512];
char ct_priority_str[16];
int ct_priority = 0;
- uint8_t ct_id = index;
+ uint16_t ct_id = index;
SCClassConfClasstype *ct_new = NULL;
SCClassConfClasstype *ct_lookup = NULL;
static void SCClassConfParseFile(DetectEngineCtx *de_ctx, FILE *fd)
{
char line[1024];
- uint8_t i = 1;
+ uint16_t i = 1;
while (fgets(line, sizeof(line), fd) != NULL) {
if (SCClassConfIsLineBlankOrComment(line))
* \retval ct Pointer to the new instance of SCClassConfClasstype on success;
* NULL on failure.
*/
-static SCClassConfClasstype *SCClassConfAllocClasstype(uint8_t classtype_id,
+static SCClassConfClasstype *SCClassConfAllocClasstype(uint16_t classtype_id,
const char *classtype,
const char *classtype_desc,
int priority)
*/
typedef struct SCClassConfClasstype_ {
/* The index of the classification within classification.confg */
- uint8_t classtype_id;
+ uint16_t classtype_id;
/* The priority this classification type carries */
int priority;