|
|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
/* Copyright (C) 2014 Open Information Security Foundation
|
|
|
|
|
/* Copyright (C) 2014-2020 Open Information Security Foundation
|
|
|
|
|
*
|
|
|
|
|
* You can copy, redistribute or modify this Program under the terms of
|
|
|
|
|
* the GNU General Public License version 2 as published by the Free
|
|
|
|
|
@ -106,13 +106,6 @@ static JsonBuilder *CreateEveHeaderFromFlow(const Flow *f, const char *event_typ
|
|
|
|
|
dp = f->sp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char proto[16];
|
|
|
|
|
if (SCProtoNameValid(f->proto) == TRUE) {
|
|
|
|
|
strlcpy(proto, known_proto[f->proto], sizeof(proto));
|
|
|
|
|
} else {
|
|
|
|
|
snprintf(proto, sizeof(proto), "%03" PRIu32, f->proto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* time */
|
|
|
|
|
jb_set_string(js, "timestamp", timebuf);
|
|
|
|
|
|
|
|
|
|
@ -164,7 +157,15 @@ static JsonBuilder *CreateEveHeaderFromFlow(const Flow *f, const char *event_typ
|
|
|
|
|
jb_set_uint(js, "dest_port", dp);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (SCProtoNameValid(f->proto)) {
|
|
|
|
|
jb_set_string(js, "proto", known_proto[f->proto]);
|
|
|
|
|
} else {
|
|
|
|
|
char proto[4];
|
|
|
|
|
snprintf(proto, sizeof(proto), "%"PRIu8"", f->proto);
|
|
|
|
|
jb_set_string(js, "proto", proto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (f->proto) {
|
|
|
|
|
case IPPROTO_ICMP:
|
|
|
|
|
case IPPROTO_ICMPV6: {
|
|
|
|
|
|