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/print-slow.c b/print-slow.c index 649e2a0fc..6ce3e806d 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,29 @@ slow_oam_print(netdissect_options *ndo, tooshort: ND_PRINT("\n\t\t packet is too short"); } + +/* + * Print Organization Specific Slow Protocol. (802.3 Annex 57B) + */ +static void +slow_ossp_print(netdissect_options *ndo, + const u_char *tptr, u_int tlen) +{ + uint32_t oui; + + ND_ICHECKMSG_U("length", tlen, <, 3); + + 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); + + return; + +invalid: + nd_print_invalid(ndo); +} diff --git a/tests/TESTLIST b/tests/TESTLIST index 25a31efb5..9717efc1e 100644 --- a/tests/TESTLIST +++ b/tests/TESTLIST @@ -505,6 +505,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..06f9dca90 --- /dev/null +++ b/tests/slow-ossp.out @@ -0,0 +1,5 @@ + 1 2025-09-23 15:00:00.000000 OSSP, length 52 + 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 diff --git a/tests/slow-ossp.pcap b/tests/slow-ossp.pcap new file mode 100644 index 000000000..7e052503d Binary files /dev/null and b/tests/slow-ossp.pcap differ