Skip to content

Commit

Permalink
Parse VLAN encapsulated TECMP packets. (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
aamereller authored Sep 19, 2022
1 parent 79646eb commit aa62ac8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.17)

# Project name and a few useful settings. Other commands can pick up the results
project(LIBTECMP
VERSION 0.1
VERSION 0.2
DESCRIPTION "TECMP Library"
)

Expand Down
5 changes: 5 additions & 0 deletions src/tecmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ int tecmp_next(

uint16_t ether = ntoh16(*((uint16_t*)(raw_frame + 12)));

// VLAN ethertypes
if ((ether == 0x8100) || (ether == 0x88A8) || (ether == 0x9100)) {
uint32_t skip = 4;
return tecmp_next(raw_frame + skip, raw_frame_size - skip, iterator, header, data);
}
// Ethertype mismatch
if (!(ether == 0x2090 || ether == 0x99FE)) {
return EINVAL;
Expand Down

0 comments on commit aa62ac8

Please sign in to comment.