]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output: Log ethernet type 12514/head
authorJeff Lucovsky <jlucovsky@oisf.net>
Tue, 1 Oct 2024 13:19:25 +0000 (09:19 -0400)
committerVictor Julien <victor@inliniac.net>
Thu, 30 Jan 2025 20:52:10 +0000 (21:52 +0100)
Issue 7129

When configured with the existing "ethernet" switch, include the ether
type in the output.

This is most useful with anomaly records indicating unknown ethertypes.

etc/schema.json
src/output-json.c

index d14ddbcf67226d36823d51fd858afcdcf4f46eb7..3a877aabb96ed9e0759934df62d4dfc65858d934 100644 (file)
                 "src_mac": {
                     "type": "string"
                 },
+                "ether_type": {
+                    "type": "integer",
+                    "description": "Ethernet type value "
+                },
                 "dest_macs": {
                     "type": "array",
                     "minItems": 1,
index 2880a25d87f91eb655a5bd152480c1ec4aeda86b..0109a1c5ee5617f28e342de3477c45afc998332d 100644 (file)
@@ -734,6 +734,7 @@ static int CreateJSONEther(
         if (PacketIsEthernet(p)) {
             const EthernetHdr *ethh = PacketGetEthernet(p);
             jb_open_object(js, "ether");
+            jb_set_uint(js, "ether_type", ethh->eth_type);
             const uint8_t *src;
             const uint8_t *dst;
             switch (dir) {