Skip to content

Enable filter functionality for DLT_DSA_TAG_DSA and DLT_DSA_TAG_EDSA. #1195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions gencode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,20 @@ init_linktype(compiler_state_t *cstate, pcap_t *p)
cstate->off_nl_nosnap = 3; /* 802.3+802.2 */
break;

case DLT_DSA_TAG_DSA:
cstate->off_linktype.constant_part = 16;
cstate->off_linkpl.constant_part = 18; /* Ethernet header length */
cstate->off_nl = 0; /* Ethernet II */
cstate->off_nl_nosnap = OFFSET_NOT_SET; /* no 802.2 LLC */
break;

case DLT_DSA_TAG_EDSA:
cstate->off_linktype.constant_part = 20;
cstate->off_linkpl.constant_part = 22; /* Ethernet header length */
cstate->off_nl = 0; /* Ethernet II */
cstate->off_nl_nosnap = OFFSET_NOT_SET; /* no 802.2 LLC */
break;

default:
/*
* For values in the range in which we've assigned new
Expand Down Expand Up @@ -7535,6 +7549,8 @@ gen_ecode(compiler_state_t *cstate, const char *s, struct qual q)
case DLT_EN10MB:
case DLT_NETANALYZER:
case DLT_NETANALYZER_TRANSPARENT:
case DLT_DSA_TAG_DSA:
case DLT_DSA_TAG_EDSA:
tmp = gen_prevlinkhdr_check(cstate);
b = gen_ehostop(cstate, cstate->e, (int)q.dir);
if (tmp != NULL)
Expand Down Expand Up @@ -8356,6 +8372,8 @@ gen_multicast(compiler_state_t *cstate, int proto)
case DLT_EN10MB:
case DLT_NETANALYZER:
case DLT_NETANALYZER_TRANSPARENT:
case DLT_DSA_TAG_DSA:
case DLT_DSA_TAG_EDSA:
b1 = gen_prevlinkhdr_check(cstate);
/* ether[0] & 1 != 0 */
b0 = gen_mac_multicast(cstate, 0);
Expand Down