aboutsummaryrefslogtreecommitdiff
path: root/example/ndpi_util.c
diff options
context:
space:
mode:
authorCampus <campus@ntop.org>2017-02-21 13:04:17 +0100
committerCampus <campus@ntop.org>2017-02-21 13:04:17 +0100
commitc2c92b2e9bd8ac9d82b2056ed7887827679c990a (patch)
treea52e563a0dbd1898f3d6ffcc5a50e6eb1c297bae /example/ndpi_util.c
parente68aeb69ebedc1b6b80f3ab6797f3df9b7dc7fe3 (diff)
added double tagging 802.1Q in dissection of vlan pkt
Diffstat (limited to 'example/ndpi_util.c')
-rw-r--r--example/ndpi_util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/example/ndpi_util.c b/example/ndpi_util.c
index 09b8c58b6..7741faf36 100644
--- a/example/ndpi_util.c
+++ b/example/ndpi_util.c
@@ -1,7 +1,7 @@
/*
* ndpi_util.c
*
- * Copyright (C) 2011-16 - ntop.org
+ * Copyright (C) 2011-17 - ntop.org
*
* This file is part of nDPI, an open source deep packet inspection
* library based on the OpenDPI and PACE technology by ipoque GmbH
@@ -717,6 +717,12 @@ void ndpi_workflow_process_packet (struct ndpi_workflow * workflow,
type = (packet[ip_offset+2] << 8) + packet[ip_offset+3];
ip_offset += 4;
vlan_packet = 1;
+ // double tagging for 802.1Q
+ if(type == 0x8100) {
+ vlan_id = ((packet[ip_offset] << 8) + packet[ip_offset+1]) & 0xFFF;
+ type = (packet[ip_offset+2] << 8) + packet[ip_offset+3];
+ ip_offset += 4;
+ }
break;
case MPLS_UNI:
case MPLS_MULTI: