aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Mayer <jmayer@loplof.de>2020-01-10 09:50:09 +0100
committerGuy Harris <guy@alum.mit.edu>2020-01-10 23:36:33 +0000
commita8c7beb07074168a15fc1c99972acc09701fde71 (patch)
tree66d389e0c972d97396ee97f221970938d311eb64
parent58949b7ff14ff8f052704c27718c90be4b234449 (diff)
Use symbolic values for Cisco's LLC PIDs
Change-Id: I4cc99cef1e52fcce308608dd95befa2286787b16 Reviewed-on: https://code.wireshark.org/review/35728 Petri-Dish: Jörg Mayer <jmayer@loplof.de> Tested-by: Petri Dish Buildbot Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--epan/CMakeLists.txt1
-rw-r--r--epan/cisco_pid.h42
-rw-r--r--epan/dissectors/packet-bpdu.c10
-rw-r--r--epan/dissectors/packet-cdp.c4
-rw-r--r--epan/dissectors/packet-cgmp.c3
-rw-r--r--epan/dissectors/packet-cisco-oui.c35
-rw-r--r--epan/dissectors/packet-dtp.c3
-rw-r--r--epan/dissectors/packet-pagp.c3
-rw-r--r--epan/dissectors/packet-udld.c5
-rw-r--r--epan/dissectors/packet-vtp.c3
10 files changed, 79 insertions, 30 deletions
diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt
index 354a23d4e0..53c18ad8e3 100644
--- a/epan/CMakeLists.txt
+++ b/epan/CMakeLists.txt
@@ -77,6 +77,7 @@ set(LIBWIRESHARK_PUBLIC_HEADERS
capture_dissectors.h
charsets.h
chdlctypes.h
+ cisco_pid.h
color_filters.h
column.h
column-info.h
diff --git a/epan/cisco_pid.h b/epan/cisco_pid.h
new file mode 100644
index 0000000000..6c93b3b799
--- /dev/null
+++ b/epan/cisco_pid.h
@@ -0,0 +1,42 @@
+/* packet-cisco-oui.h
+ * Register an LLC dissector table for Cisco's OUI 00:00:0c
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef __PACKET_CISCO_PID_H__
+#define __PACKET_CISCO_PID_H__
+
+#define CISCO_PID_DRIP 0x0102
+#define CISCO_PID_PAGP 0x0104
+#define CISCO_PID_MLS_HELLO 0x0105
+#define CISCO_PID_RLQ_REQ 0x0108
+#define CISCO_PID_RLQ_RESP 0x0109
+#define CISCO_PID_PVSTPP 0x010B
+#define CISCO_PID_VLAN_BRIDGE 0x010C
+#define CISCO_PID_UDLD 0x0111
+#define CISCO_PID_MCP 0x0139
+#define CISCO_PID_CDP 0x2000
+#define CISCO_PID_CGMP 0x2001
+#define CISCO_PID_VTP 0x2003
+#define CISCO_PID_DTP 0x2004
+#define CISCO_PID_STP_UL_FAST 0x200A
+
+#endif
+
+/*
+ * Editor modelines - https://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 8
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * End:
+ *
+ * vi: set shiftwidth=8 tabstop=8 noexpandtab:
+ * :indentSize=8:tabSize=8:noTabs=false:
+ */
diff --git a/epan/dissectors/packet-bpdu.c b/epan/dissectors/packet-bpdu.c
index bbe51bdafb..37d3ddc444 100644
--- a/epan/dissectors/packet-bpdu.c
+++ b/epan/dissectors/packet-bpdu.c
@@ -19,6 +19,7 @@
#include <epan/addr_resolv.h>
#include <epan/prefs.h>
#include <epan/expert.h>
+#include <epan/cisco_pid.h>
/* Offsets of fields within a BPDU */
@@ -1363,11 +1364,10 @@ proto_reg_handoff_bpdu(void)
dissector_add_uint("llc.dsap", SAP_BPDU, bpdu_handle);
dissector_add_uint("chdlc.protocol", CHDLCTYPE_BPDU, bpdu_handle);
dissector_add_uint("ethertype", ETHERTYPE_STP, bpdu_handle);
- dissector_add_uint("llc.cisco_pid", 0x0108, bpdu_handle); /* Cisco's RLQ is just plain STP */
- dissector_add_uint("llc.cisco_pid", 0x0109, bpdu_handle); /* Cisco's RLQ is just plain STP */
- dissector_add_uint("llc.cisco_pid", 0x010c, bpdu_handle); /* Cisco's VLAN-bridge STP is just plain STP */
-
- dissector_add_uint("llc.cisco_pid", 0x010b, bpdu_cisco_handle); /* Handle Cisco's (R)PVST+ TLV extensions */
+ dissector_add_uint("llc.cisco_pid", CISCO_PID_RLQ_REQ, bpdu_handle); /* Cisco's RLQ is just plain STP */
+ dissector_add_uint("llc.cisco_pid", CISCO_PID_RLQ_RESP, bpdu_handle); /* Cisco's RLQ is just plain STP */
+ dissector_add_uint("llc.cisco_pid", CISCO_PID_VLAN_BRIDGE, bpdu_handle); /* Cisco's VLAN-bridge STP is just plain STP */
+ dissector_add_uint("llc.cisco_pid", CISCO_PID_PVSTPP, bpdu_cisco_handle); /* Handle Cisco's (R)PVST+ TLV extensions */
}
/*
diff --git a/epan/dissectors/packet-cdp.c b/epan/dissectors/packet-cdp.c
index 45cdd37b8a..3e7f115221 100644
--- a/epan/dissectors/packet-cdp.c
+++ b/epan/dissectors/packet-cdp.c
@@ -17,7 +17,7 @@
#include <epan/in_cksum.h>
#include <epan/nlpid.h>
#include <epan/etypes.h>
-
+#include <epan/cisco_pid.h>
/*
* See
@@ -1503,7 +1503,7 @@ proto_reg_handoff_cdp(void)
dissector_handle_t cdp_handle;
cdp_handle = create_dissector_handle(dissect_cdp, proto_cdp);
- dissector_add_uint("llc.cisco_pid", 0x2000, cdp_handle);
+ dissector_add_uint("llc.cisco_pid", CISCO_PID_CDP, cdp_handle);
dissector_add_uint("chdlc.protocol", 0x2000, cdp_handle);
dissector_add_uint("ppp.protocol", 0x0207, cdp_handle);
dissector_add_uint("gre.proto", 0x2000, cdp_handle);
diff --git a/epan/dissectors/packet-cgmp.c b/epan/dissectors/packet-cgmp.c
index 5abe17c54f..e34c724044 100644
--- a/epan/dissectors/packet-cgmp.c
+++ b/epan/dissectors/packet-cgmp.c
@@ -11,6 +11,7 @@
#include "config.h"
#include <epan/packet.h>
+#include <epan/cisco_pid.h>
/*
* See
@@ -128,7 +129,7 @@ proto_reg_handoff_cgmp(void)
dissector_handle_t cgmp_handle;
cgmp_handle = create_dissector_handle(dissect_cgmp, proto_cgmp);
- dissector_add_uint("llc.cisco_pid", 0x2001, cgmp_handle);
+ dissector_add_uint("llc.cisco_pid", CISCO_PID_CGMP, cgmp_handle);
dissector_add_uint("ethertype", 0x2001, cgmp_handle);
}
diff --git a/epan/dissectors/packet-cisco-oui.c b/epan/dissectors/packet-cisco-oui.c
index 87e558ff6e..cc48adab8b 100644
--- a/epan/dissectors/packet-cisco-oui.c
+++ b/epan/dissectors/packet-cisco-oui.c
@@ -13,8 +13,9 @@
#include <epan/packet.h>
#include "packet-llc.h"
#include <epan/oui.h>
+#include <epan/cisco_pid.h>
-void proto_register_cisco_oui(void);
+void proto_register_cisco_pid(void);
static int hf_llc_cisco_pid = -1;
@@ -30,20 +31,22 @@ static int hf_llc_cisco_pid = -1;
* for various PID values - and for a DRIP frame format.
*/
static const value_string cisco_pid_vals[] = {
- { 0x0102, "DRIP" },
- { 0x0104, "PAgP" }, /* Port Aggregation Protocol */
- { 0x0105, "MLS Hello" }, /* from a mail message found on the Web */
- { 0x0108, "RLQ BPDUs (request)" }, /* Root Link Query, see Bug: 12772 */
- { 0x0109, "RLQ BPDUs (response)" }, /* Root Link Query, see Bug: 12772 */
- { 0x010b, "PVSTP+" }, /* Per-VLAN Spanning Tree Protocol */
- { 0x010c, "VLAN Bridge" },
- { 0x0111, "UDLD" }, /* Unidirectional Link Detection */
- { 0x2000, "CDP" },
- { 0x2001, "CGMP" },
- { 0x2003, "VTP" },
- { 0x2004, "DTP" }, /* Dynamic Trunking Protocol */
- { 0x200a, "STP Uplink Fast" },
- { 0, NULL }
+ { CISCO_PID_DRIP, "DRIP" },
+ { CISCO_PID_PAGP, "PAgP" }, /* Port Aggregation Protocol */
+ { CISCO_PID_MLS_HELLO, "MLS Hello" }, /* from a mail message found on the Web */
+ { CISCO_PID_RLQ_REQ, "RLQ BPDUs (request)" }, /* Root Link Query, see Bug: 12772 */
+ { CISCO_PID_RLQ_RESP, "RLQ BPDUs (response)" }, /* Root Link Query, see Bug: 12772 */
+ { CISCO_PID_PVSTPP, "PVSTP+" }, /* Per-VLAN Spanning Tree Protocol */
+ { CISCO_PID_VLAN_BRIDGE, "VLAN Bridge" },
+ { CISCO_PID_UDLD, "UDLD" }, /* Unidirectional Link Detection */
+ { CISCO_PID_MCP, "MCP" }, /* MisCabling Protocol */
+ { CISCO_PID_CDP, "CDP" },
+ { CISCO_PID_CGMP, "CGMP" },
+ { CISCO_PID_VTP, "VTP" },
+ { CISCO_PID_DTP, "DTP" }, /* Dynamic Trunking Protocol */
+ { CISCO_PID_STP_UL_FAST, "STP Uplink Fast" },
+
+ { 0, NULL }
};
/*
@@ -51,7 +54,7 @@ static const value_string cisco_pid_vals[] = {
* up the dissector table for the Cisco OUI.
*/
void
-proto_register_cisco_oui(void)
+proto_register_cisco_pid(void)
{
static hf_register_info hf[] = {
{ &hf_llc_cisco_pid,
diff --git a/epan/dissectors/packet-dtp.c b/epan/dissectors/packet-dtp.c
index af831ce84c..73db6cff69 100644
--- a/epan/dissectors/packet-dtp.c
+++ b/epan/dissectors/packet-dtp.c
@@ -24,6 +24,7 @@
#include <epan/packet.h>
#include <epan/to_str.h>
#include <epan/expert.h>
+#include <epan/cisco_pid.h>
/*
* It's incomplete, and it appears to be inaccurate in a number of places,
@@ -355,7 +356,7 @@ proto_reg_handoff_dtp(void)
dissector_handle_t dtp_handle;
dtp_handle = create_dissector_handle(dissect_dtp, proto_dtp);
- dissector_add_uint("llc.cisco_pid", 0x2004, dtp_handle);
+ dissector_add_uint("llc.cisco_pid", CISCO_PID_DTP, dtp_handle);
}
/*
diff --git a/epan/dissectors/packet-pagp.c b/epan/dissectors/packet-pagp.c
index 7c83035fca..62dd441343 100644
--- a/epan/dissectors/packet-pagp.c
+++ b/epan/dissectors/packet-pagp.c
@@ -17,6 +17,7 @@
#include <epan/packet.h>
#include <epan/expert.h>
#include <epan/to_str.h>
+#include <epan/cisco_pid.h>
void proto_register_pagp(void);
void proto_reg_handoff_pagp(void);
@@ -479,7 +480,7 @@ proto_reg_handoff_pagp(void)
dissector_handle_t pagp_handle;
pagp_handle = create_dissector_handle(dissect_pagp, proto_pagp);
- dissector_add_uint("llc.cisco_pid", 0x0104, pagp_handle);
+ dissector_add_uint("llc.cisco_pid", CISCO_PID_PAGP, pagp_handle);
}
/*
diff --git a/epan/dissectors/packet-udld.c b/epan/dissectors/packet-udld.c
index bd308b5499..d1fc81162b 100644
--- a/epan/dissectors/packet-udld.c
+++ b/epan/dissectors/packet-udld.c
@@ -12,8 +12,7 @@
#include <epan/packet.h>
#include <epan/expert.h>
-
-
+#include <epan/cisco_pid.h>
/*
* See
@@ -291,7 +290,7 @@ proto_reg_handoff_udld(void)
dissector_handle_t udld_handle;
udld_handle = create_dissector_handle(dissect_udld, proto_udld);
- dissector_add_uint("llc.cisco_pid", 0x0111, udld_handle);
+ dissector_add_uint("llc.cisco_pid", CISCO_PID_UDLD, udld_handle);
dissector_add_uint("chdlc.protocol", 0x0111, udld_handle);
}
diff --git a/epan/dissectors/packet-vtp.c b/epan/dissectors/packet-vtp.c
index 7f399e7bbd..5e5a6ed6d6 100644
--- a/epan/dissectors/packet-vtp.c
+++ b/epan/dissectors/packet-vtp.c
@@ -12,6 +12,7 @@
#include <epan/packet.h>
#include <epan/expert.h>
+#include <epan/cisco_pid.h>
/*
* See
@@ -675,7 +676,7 @@ proto_reg_handoff_vtp(void)
dissector_handle_t vtp_handle;
vtp_handle = create_dissector_handle(dissect_vtp, proto_vtp);
- dissector_add_uint("llc.cisco_pid", 0x2003, vtp_handle);
+ dissector_add_uint("llc.cisco_pid", CISCO_PID_VTP, vtp_handle);
}
/*