diff options
author | Luca Deri <deri@ntop.org> | 2022-11-16 17:48:28 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2022-11-16 17:48:28 +0100 |
commit | 4231f4805965544994fa8d5b0d0ec56573c5f5d2 (patch) | |
tree | 50559d9a88aebb854df3d40cc03f91b170051c6f | |
parent | 388d01a345a4cfa6d1e9b544899c48326b61ca5b (diff) |
Added support for Linux Cooked Capture v2
-rw-r--r-- | example/reader_util.c | 7 | ||||
-rw-r--r-- | example/reader_util.h | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/example/reader_util.c b/example/reader_util.c index ef522a84e..8c43f24ef 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -1709,6 +1709,7 @@ int ndpi_is_datalink_supported(int datalink_type) { case DLT_IEEE802_11_RADIO: case DLT_RAW: case DLT_PPI: + case LINKTYPE_LINUX_SLL2: return 1; default: return 0; @@ -1874,6 +1875,12 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow, ip_offset = 16 + eth_offset; break; + /* Linux Cooked Capture v2 - 276 */ + case LINKTYPE_LINUX_SLL2: + type = (packet[eth_offset+10] << 8) + packet[eth_offset+11]; + ip_offset = 20 + eth_offset; + break; + /* Radiotap link-layer - 127 */ case DLT_IEEE802_11_RADIO: radiotap = (struct ndpi_radiotap_header *) &packet[eth_offset]; diff --git a/example/reader_util.h b/example/reader_util.h index 6d343551e..ce296e2d2 100644 --- a/example/reader_util.h +++ b/example/reader_util.h @@ -424,4 +424,8 @@ extern int nDPI_LogLevel; #define LOG(...) {} #endif +#ifndef LINKTYPE_LINUX_SLL2 +#define LINKTYPE_LINUX_SLL2 276 +#endif + #endif |