From 55ba1f463242db56c4c9af770ff96e8a4dd0d845 Mon Sep 17 00:00:00 2001 From: corubba Date: Tue, 23 Sep 2025 17:12:31 +0200 Subject: [PATCH 1/2] slow: Add OSSP support Add basic printing of "Organization Specific Slow Protocol" (OSSP), which is standardized in IEEE 802.3 Annex 57B. Since this is used for non-standardized protocols and thus carries mostly unknown-structured data, most of the packet is still printed verbatim. --- print-slow.c | 29 ++++++++++++++++++++++++++++- tests/TESTLIST | 1 + tests/slow-ossp.out | 5 +++++ tests/slow-ossp.pcap | Bin 0 -> 106 bytes 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 tests/slow-ossp.out create mode 100644 tests/slow-ossp.pcap diff --git a/print-slow.c b/print-slow.c index 649e2a0fc..7414f232f 100644 --- a/print-slow.c +++ b/print-slow.c @@ -34,6 +34,7 @@ #define SLOW_PROTO_LACP 1 #define SLOW_PROTO_MARKER 2 #define SLOW_PROTO_OAM 3 +#define SLOW_PROTO_OSSP 10 #define LACP_VERSION 1 #define MARKER_VERSION 1 @@ -42,6 +43,7 @@ static const struct tok slow_proto_values[] = { { SLOW_PROTO_LACP, "LACP" }, { SLOW_PROTO_MARKER, "MARKER" }, { SLOW_PROTO_OAM, "OAM" }, + { SLOW_PROTO_OSSP, "OSSP" }, { 0, NULL} }; @@ -239,6 +241,7 @@ struct lacp_marker_tlv_terminator_t { static void slow_marker_lacp_print(netdissect_options *, const u_char *, u_int, u_int); static void slow_oam_print(netdissect_options *, const u_char *, u_int); +static void slow_ossp_print(netdissect_options *, const u_char *, u_int); void slow_print(netdissect_options *ndo, @@ -278,7 +281,8 @@ slow_print(netdissect_options *ndo, print_version = 1; break; - case SLOW_PROTO_OAM: /* fall through */ + case SLOW_PROTO_OAM: + case SLOW_PROTO_OSSP: print_version = 0; break; @@ -313,6 +317,13 @@ slow_print(netdissect_options *ndo, default: /* should not happen */ break; + case SLOW_PROTO_OSSP: + /* skip subtype */ + len -= 1; + pptr += 1; + slow_ossp_print(ndo, pptr, len); + break; + case SLOW_PROTO_OAM: /* skip subtype */ len -= 1; @@ -733,3 +744,19 @@ slow_oam_print(netdissect_options *ndo, tooshort: ND_PRINT("\n\t\t packet is too short"); } + +static void +slow_ossp_print(netdissect_options *ndo, + const u_char *tptr, u_int tlen) +{ + uint32_t oui; + + oui = GET_BE_U_3(tptr); + ND_PRINT("\n\tOUI: %s (0x%06x)", + tok2str(oui_values, "Unknown", oui), + oui); + tlen -= 3; + tptr += 3; + + print_unknown_data(ndo, tptr, "\n\t", tlen); +} diff --git a/tests/TESTLIST b/tests/TESTLIST index 9769f8275..d3d0bca9f 100644 --- a/tests/TESTLIST +++ b/tests/TESTLIST @@ -503,6 +503,7 @@ lldp_mud-v lldp_mudurl.pcap lldp_mudurl-v.out -e -v lldp_mud-vv lldp_mudurl.pcap lldp_mudurl-vv.out -e -vv lldp_8021_linkagg-v lldp_8021_linkagg.pcap lldp_8021_linkagg-v.out -v lldp_8021_linkagg-vv lldp_8021_linkagg.pcap lldp_8021_linkagg-vv.out -vv +slow-ossp slow-ossp.pcap slow-ossp.out -v # fuzzed pcap udld-inf-loop-1-v udld-inf-loop-1.pcapng udld-inf-loop-1-v.out -v diff --git a/tests/slow-ossp.out b/tests/slow-ossp.out new file mode 100644 index 000000000..5115628bf --- /dev/null +++ b/tests/slow-ossp.out @@ -0,0 +1,5 @@ + 1 2025-09-23 15:00:00.000000 OSSP, length 52 + OUI: Unknown (0x0019a7) + 0x0000: 0001 1000 0000 0100 0404 0000 0000 0000 + 0x0010: 0000 0000 0000 0000 0000 0000 0000 0000 + 0x0020: 0000 0000 0000 0000 0000 0000 0000 0000 diff --git a/tests/slow-ossp.pcap b/tests/slow-ossp.pcap new file mode 100644 index 0000000000000000000000000000000000000000..7e052503d49470fa86a4c388ef567bc83cf66c1a GIT binary patch literal 106 zcmZ3u>F^Z>CI%J;7=W-CGcIlY02Oiq(oT#GhZunB1eJ_kLOVFQ7$lc7FbV)A7#Ua) JdSPZ@r2!I#3K9SS literal 0 HcmV?d00001 From 3d4edc81863f16d872d56f8b92f9d2d928cec0d9 Mon Sep 17 00:00:00 2001 From: corubba Date: Tue, 23 Sep 2025 17:12:31 +0200 Subject: [PATCH 2/2] oui: Add ITU-T --- oui.c | 1 + oui.h | 1 + tests/slow-ossp.out | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/oui.c b/oui.c index 9b9c71caf..bb5e3fe7e 100644 --- a/oui.c +++ b/oui.c @@ -27,6 +27,7 @@ const struct tok oui_values[] = { { OUI_IANA, "IANA" }, { OUI_NORTEL, "Nortel Networks SONMP" }, { OUI_CISCO_90, "Cisco bridged" }, + { OUI_ITU_T, "ITU-T" }, { OUI_RFC2684, "Ethernet bridged" }, { OUI_ATM_FORUM, "ATM Forum" }, { OUI_CABLE_BPDU, "DOCSIS Spanning Tree" }, diff --git a/oui.h b/oui.h index 3c824756b..8c8c44994 100644 --- a/oui.h +++ b/oui.h @@ -21,6 +21,7 @@ extern const struct tok smi_values[]; #define OUI_IANA 0x00005E /* IANA */ #define OUI_NORTEL 0x000081 /* Nortel SONMP */ #define OUI_CISCO_90 0x0000f8 /* Cisco bridging */ +#define OUI_ITU_T 0x0019a7 /* International Telecommunication Union - Telecommunication Standardization Sector */ #define OUI_RFC2684 0x0080c2 /* RFC 2427/2684 bridged Ethernet */ #define OUI_ATM_FORUM 0x00A03E /* ATM Forum */ #define OUI_CABLE_BPDU 0x00E02F /* DOCSIS spanning tree BPDU */ diff --git a/tests/slow-ossp.out b/tests/slow-ossp.out index 5115628bf..06f9dca90 100644 --- a/tests/slow-ossp.out +++ b/tests/slow-ossp.out @@ -1,5 +1,5 @@ 1 2025-09-23 15:00:00.000000 OSSP, length 52 - OUI: Unknown (0x0019a7) + OUI: ITU-T (0x0019a7) 0x0000: 0001 1000 0000 0100 0404 0000 0000 0000 0x0010: 0000 0000 0000 0000 0000 0000 0000 0000 0x0020: 0000 0000 0000 0000 0000 0000 0000 0000