Skip to content

Commit 8a8d0f0

Browse files
committed
Allocate DLT_LINUX_DSA_UNKNOWN.
1 parent 5648ff0 commit 8a8d0f0

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

pcap-common.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,10 @@
13001300
*/
13011301
#define LINKTYPE_DECT_NR 301
13021302

1303-
#define LINKTYPE_HIGH_MATCHING_MAX 301 /* highest value in the "matching" range */
1303+
// See DLT_LINUX_DSA_UNKNOWN.
1304+
#define LINKTYPE_LINUX_DSA_UNKNOWN 302
1305+
1306+
#define LINKTYPE_HIGH_MATCHING_MAX 302 /* highest value in the "matching" range */
13041307

13051308
/*
13061309
* The DLT_ and LINKTYPE_ values in the "matching" range should be the

pcap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3345,6 +3345,7 @@ static struct dlt_choice dlt_choices[] = {
33453345
DLT_CHOICE(USER13, "Private use 13"),
33463346
DLT_CHOICE(USER14, "Private use 14"),
33473347
DLT_CHOICE(USER15, "Private use 15"),
3348+
DLT_CHOICE(LINUX_DSA_UNKNOWN, "Linux DSA unknown tag type, for manual debugging only"),
33483349
DLT_CHOICE_SENTINEL
33493350
};
33503351

pcap/dlt.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,24 @@
16641664
*/
16651665
#define DLT_DECT_NR 301
16661666

1667+
/*
1668+
* Linux DSA unknown tag type, for manual debugging only. In other words, this
1669+
* DLT is suitable for expert interpretation of hex dumps, and that's it. For
1670+
* any automated (identification, saving, loading, filtering, decoding) purpose
1671+
* please document, assign and implement a different, proper DLT that is
1672+
* specific to the required DSA tag type.
1673+
*
1674+
* In this DLT packets supposedly are Linux DSA packets, which should not be
1675+
* confused with standard IEEE 802.3 Ethernet frames. The DSA tag type is
1676+
* unknown and can be different from one packet to another or malformed or
1677+
* incorrect or invalid or nonexistent in the first place. Hence in this DLT
1678+
* do not assume any version, any header, any payload, any specification, any
1679+
* byte order, any structure, any format, any software/firmware/hardware
1680+
* particulars, any implementation, any source, any destination, any direction,
1681+
* any protocol or any data integrity.
1682+
*/
1683+
#define DLT_LINUX_DSA_UNKNOWN 302
1684+
16671685
/*
16681686
* In case the code that includes this file (directly or indirectly)
16691687
* has also included OS files that happen to define DLT_HIGH_MATCHING_MAX,
@@ -1675,6 +1693,6 @@
16751693
#undef DLT_HIGH_MATCHING_MAX
16761694
#endif
16771695

1678-
#define DLT_HIGH_MATCHING_MAX 301 /* highest value in the "matching" range */
1696+
#define DLT_HIGH_MATCHING_MAX 302 /* highest value in the "matching" range */
16791697

16801698
#endif /* !defined(lib_pcap_dlt_h) */

0 commit comments

Comments
 (0)