Skip to content

Commit

Permalink
output: Log ethernet type
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jlucovsky committed Oct 1, 2024
1 parent 80687cc commit b73296c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions etc/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1732,6 +1732,10 @@
"src_mac": {
"type": "string"
},
"ether_type": {
"type": "integer",
"description": "Ethernet type value "
},
"dest_macs": {
"type": "array",
"minItems": 1,
Expand Down
1 change: 1 addition & 0 deletions src/output-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,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) {
Expand Down

0 comments on commit b73296c

Please sign in to comment.