aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2016-10-31 08:27:14 +0100
committerMichael Mann <mmann78@netscape.net>2016-10-31 11:38:55 +0000
commitd7e874c5d05b353cece337c72fddafde466a321e (patch)
tree7ad86df6acded25cb288a58fa5f9644fae567e67
parentb61cfd7ec17f9646ceecadddbe2b79dcfb72cb96 (diff)
PW_ACH: Use proper symbolic names
Collect all used PW Associated Channel Types and use them in the subdissector table registrations. Change-Id: I5d196bceefdb4560b1f4388ff86898e316e5e2ae Reviewed-on: https://code.wireshark.org/review/18590 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-bfd.c6
-rw-r--r--epan/dissectors/packet-ip.c3
-rw-r--r--epan/dissectors/packet-ipv6.c3
-rw-r--r--epan/dissectors/packet-mpls-echo.c2
-rw-r--r--epan/dissectors/packet-mpls-pm.c22
-rw-r--r--epan/dissectors/packet-mpls-psc.c3
-rw-r--r--epan/dissectors/packet-mpls.c2
-rw-r--r--epan/dissectors/packet-mpls.h29
-rw-r--r--epan/dissectors/packet-mplstp-oam.c3
-rw-r--r--epan/dissectors/packet-pw-oam.c3
10 files changed, 50 insertions, 26 deletions
diff --git a/epan/dissectors/packet-bfd.c b/epan/dissectors/packet-bfd.c
index 8658e4c28d..0de1c6a4ea 100644
--- a/epan/dissectors/packet-bfd.c
+++ b/epan/dissectors/packet-bfd.c
@@ -870,9 +870,9 @@ proto_reg_handoff_bfd(void)
bfd_control_handle = find_dissector("bfd");
dissector_add_uint_range_with_preference("udp.port", UDP_PORT_RANGE_BFD, bfd_control_handle);
- dissector_add_uint("pwach.channel_type", ACH_TYPE_BFD_CC, bfd_control_handle);
- dissector_add_uint("pwach.channel_type", ACH_TYPE_BFD_CV, bfd_control_handle);
- dissector_add_uint("pwach.channel_type", 0x7, bfd_control_handle); /* PWACH-encapsulated BFD, RFC 5885 */
+ dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_BFD_CC, bfd_control_handle);
+ dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_BFD_CV, bfd_control_handle);
+ dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_BFD, bfd_control_handle);
}
/*
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c
index c86fb9118a..ed04abeb11 100644
--- a/epan/dissectors/packet-ip.c
+++ b/epan/dissectors/packet-ip.c
@@ -57,6 +57,7 @@
#include "packet-gre.h"
#include "packet-l2tp.h"
#include "packet-vxlan.h"
+#include "packet-mpls.h"
#ifdef HAVE_GEOIP
#include <GeoIP.h>
@@ -3162,7 +3163,7 @@ proto_reg_handoff_ip(void)
dissector_add_uint("ax25.pid", AX25_P_IP, ip_handle);
dissector_add_uint("juniper.proto", JUNIPER_PROTO_IP, ip_handle);
dissector_add_uint("juniper.proto", JUNIPER_PROTO_MPLS_IP, ip_handle);
- dissector_add_uint("pwach.channel_type", 0x21, ip_handle); /* IPv4, RFC4385 clause 6. */
+ dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_IPV4, ip_handle);
dissector_add_uint("sflow_245.header_protocol", SFLOW_245_HEADER_IPv4, ip_handle);
dissector_add_uint("l2tp.pw_type", L2TPv3_PROTOCOL_IP, ip_handle);
dissector_add_for_decode_as_with_preference("udp.port", ip_handle);
diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c
index 78b8533f98..96bf1724c9 100644
--- a/epan/dissectors/packet-ipv6.c
+++ b/epan/dissectors/packet-ipv6.c
@@ -52,6 +52,7 @@
#include "packet-juniper.h"
#include "packet-sflow.h"
#include "packet-vxlan.h"
+#include "packet-mpls.h"
#ifdef HAVE_GEOIP_V6
#include <GeoIP.h>
@@ -3565,7 +3566,7 @@ proto_reg_handoff_ipv6(void)
dissector_add_uint("arcnet.protocol_id", ARCNET_PROTO_IPv6, ipv6_handle);
dissector_add_uint("juniper.proto", JUNIPER_PROTO_IP6, ipv6_handle);
dissector_add_uint("juniper.proto", JUNIPER_PROTO_MPLS_IP6, ipv6_handle);
- dissector_add_uint("pwach.channel_type", 0x57, ipv6_handle); /* IPv6, RFC4385 clause 6. */
+ dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_IPV6, ipv6_handle);
dissector_add_uint("sflow_245.header_protocol", SFLOW_245_HEADER_IPv6, ipv6_handle);
dissector_add_uint("wtap_encap", WTAP_ENCAP_RAW_IP6, ipv6_handle);
dissector_add_uint("enc", BSD_AF_INET6_BSD, ipv6_handle);
diff --git a/epan/dissectors/packet-mpls-echo.c b/epan/dissectors/packet-mpls-echo.c
index 8960b7fd21..1acdd0a2df 100644
--- a/epan/dissectors/packet-mpls-echo.c
+++ b/epan/dissectors/packet-mpls-echo.c
@@ -2558,7 +2558,7 @@ proto_reg_handoff_mpls_echo(void)
mpls_echo_handle = create_dissector_handle(dissect_mpls_echo, proto_mpls_echo);
dissector_add_uint_with_preference("udp.port", UDP_PORT_MPLS_ECHO, mpls_echo_handle);
- dissector_add_uint("pwach.channel_type", ACH_TYPE_ONDEMAND_CV, mpls_echo_handle);
+ dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_ONDEMAND_CV, mpls_echo_handle);
}
/*
diff --git a/epan/dissectors/packet-mpls-pm.c b/epan/dissectors/packet-mpls-pm.c
index f08d95a607..46f8bfd005 100644
--- a/epan/dissectors/packet-mpls-pm.c
+++ b/epan/dissectors/packet-mpls-pm.c
@@ -30,6 +30,7 @@
#include <epan/packet.h>
#include "packet-ip.h"
+#include "packet-mpls.h"
void proto_register_mpls_pm(void);
void proto_reg_handoff_mpls_pm(void);
@@ -1526,17 +1527,16 @@ proto_reg_handoff_mpls_pm(void)
dissector_handle_t mpls_pm_dlm_handle, mpls_pm_ilm_handle, mpls_pm_dm_handle,
mpls_pm_dlm_dm_handle, mpls_pm_ilm_dm_handle;
- mpls_pm_dlm_handle = create_dissector_handle( dissect_mpls_pm_dlm, proto_mpls_pm_dlm );
- dissector_add_uint("pwach.channel_type", 0x000A, mpls_pm_dlm_handle); /* FF: MPLS PM, RFC 6374, DLM */
- mpls_pm_ilm_handle = create_dissector_handle( dissect_mpls_pm_ilm, proto_mpls_pm_ilm );
- dissector_add_uint("pwach.channel_type", 0x000B, mpls_pm_ilm_handle); /* FF: MPLS PM, RFC 6374, ILM */
- mpls_pm_dm_handle = create_dissector_handle( dissect_mpls_pm_delay, proto_mpls_pm_dm );
- dissector_add_uint("pwach.channel_type", 0x000C, mpls_pm_dm_handle); /* FF: MPLS PM, RFC 6374, DM */
- mpls_pm_dlm_dm_handle = create_dissector_handle( dissect_mpls_pm_dlm_dm, proto_mpls_pm_dlm_dm );
- dissector_add_uint("pwach.channel_type", 0x000D, mpls_pm_dlm_dm_handle); /* FF: MPLS PM, RFC 6374, DLM+DM */
- mpls_pm_ilm_dm_handle = create_dissector_handle( dissect_mpls_pm_ilm_dm, proto_mpls_pm_ilm_dm );
- dissector_add_uint("pwach.channel_type", 0x000E, mpls_pm_ilm_dm_handle); /* FF: MPLS PM, RFC 6374, ILM+DM */
-
+ mpls_pm_dlm_handle = create_dissector_handle( dissect_mpls_pm_dlm, proto_mpls_pm_dlm );
+ dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_DLM, mpls_pm_dlm_handle);
+ mpls_pm_ilm_handle = create_dissector_handle( dissect_mpls_pm_ilm, proto_mpls_pm_ilm );
+ dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_ILM, mpls_pm_ilm_handle);
+ mpls_pm_dm_handle = create_dissector_handle( dissect_mpls_pm_delay, proto_mpls_pm_dm );
+ dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_DM, mpls_pm_dm_handle);
+ mpls_pm_dlm_dm_handle = create_dissector_handle( dissect_mpls_pm_dlm_dm, proto_mpls_pm_dlm_dm );
+ dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_DLM_DM, mpls_pm_dlm_dm_handle);
+ mpls_pm_ilm_dm_handle = create_dissector_handle( dissect_mpls_pm_ilm_dm, proto_mpls_pm_ilm_dm );
+ dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_ILM_DM, mpls_pm_ilm_dm_handle);
}
/*
diff --git a/epan/dissectors/packet-mpls-psc.c b/epan/dissectors/packet-mpls-psc.c
index ff4edb327e..557173ebcb 100644
--- a/epan/dissectors/packet-mpls-psc.c
+++ b/epan/dissectors/packet-mpls-psc.c
@@ -29,6 +29,7 @@
#include "config.h"
#include <epan/packet.h>
+#include "packet-mpls.h"
void proto_register_mpls_psc(void);
void proto_reg_handoff_mpls_psc(void);
@@ -241,7 +242,7 @@ proto_reg_handoff_mpls_psc(void)
dissector_handle_t mpls_psc_handle;
mpls_psc_handle = create_dissector_handle( dissect_mpls_psc, proto_mpls_psc );
- dissector_add_uint("pwach.channel_type", 0x0024, mpls_psc_handle); /* FF: PSC, RFC 6378 */
+ dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_PSC, mpls_psc_handle);
}
/*
diff --git a/epan/dissectors/packet-mpls.c b/epan/dissectors/packet-mpls.c
index b39dcf35b8..3ae0761d9d 100644
--- a/epan/dissectors/packet-mpls.c
+++ b/epan/dissectors/packet-mpls.c
@@ -292,7 +292,7 @@ dissect_pw_ach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _
call_data_dissector(next_tvb, pinfo, tree);
}
- if (channel_type == ACH_TYPE_BFD_CV)
+ if (channel_type == PW_ACH_TYPE_BFD_CV)
{
/* The BFD dissector has already been called, this is called in addition
XXX - Perhaps a new dissector function that combines both is preferred.*/
diff --git a/epan/dissectors/packet-mpls.h b/epan/dissectors/packet-mpls.h
index 974e784879..68a9135c61 100644
--- a/epan/dissectors/packet-mpls.h
+++ b/epan/dissectors/packet-mpls.h
@@ -42,11 +42,30 @@ enum {
MPLS_LABEL_INVALID = -1
};
-/* As per RFC 6428 http://tools.ietf.org/html/rfc6428, Section: 3.3 */
-#define ACH_TYPE_BFD_CC 0x0022
-#define ACH_TYPE_BFD_CV 0x0023
-/* As RFC 6426:http://tools.ietf.org/html/rfc6426, Section: 7.4 */
-#define ACH_TYPE_ONDEMAND_CV 0x0025
+/* As per RFC 5885 */
+#define PW_ACH_TYPE_BFD 0x0007
+/* As per RFC 6374 */
+#define PW_ACH_TYPE_DLM 0x000A
+#define PW_ACH_TYPE_ILM 0x000B
+#define PW_ACH_TYPE_DM 0x000C
+#define PW_ACH_TYPE_DLM_DM 0x000D
+#define PW_ACH_TYPE_ILM_DM 0x000E
+/* As per RFC 4385 clause 6 */
+#define PW_ACH_TYPE_IPV4 0x0021
+/* As per RFC 6428 Section 3.3 */
+#define PW_ACH_TYPE_BFD_CC 0x0022
+#define PW_ACH_TYPE_BFD_CV 0x0023
+/* As per RFC 6378 */
+#define PW_ACH_TYPE_PSC 0x0024
+/* As per RFC 6426 Section 7.4 */
+#define PW_ACH_TYPE_ONDEMAND_CV 0x0025
+/* As per RFC 6478 */
+#define PW_ACH_TYPE_PW_OAM 0x0027
+/* As per RFC 4385 clause 6 */
+#define PW_ACH_TYPE_IPV6 0x0057
+/* As per RFC 6427 */
+#define PW_ACH_TYPE_MPLSTP_FM 0x0058
+
/* MPLS over UDP http://tools.ietf.org/html/draft-ietf-mpls-in-udp-11,
* udp destination port as defined in
diff --git a/epan/dissectors/packet-mplstp-oam.c b/epan/dissectors/packet-mplstp-oam.c
index 9771f5bd2f..6b17ab7bc8 100644
--- a/epan/dissectors/packet-mplstp-oam.c
+++ b/epan/dissectors/packet-mplstp-oam.c
@@ -29,6 +29,7 @@
#include "config.h"
#include <epan/packet.h>
#include "packet-bfd.h"
+#include "packet-mpls.h"
void proto_register_mplstp_lock(void);
void proto_register_mplstp_fm(void);
@@ -344,7 +345,7 @@ proto_reg_handoff_mplstp_fm(void)
dissector_handle_t mplstp_fm_handle;
mplstp_fm_handle = create_dissector_handle( dissect_mplstp_fm, proto_mplstp_fm );
- dissector_add_uint("pwach.channel_type", 0x0058, mplstp_fm_handle); /* KM: MPLSTP FM, RFC 6427 */
+ dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_MPLSTP_FM, mplstp_fm_handle);
}
/*
diff --git a/epan/dissectors/packet-pw-oam.c b/epan/dissectors/packet-pw-oam.c
index 6622ed7c7b..b746765214 100644
--- a/epan/dissectors/packet-pw-oam.c
+++ b/epan/dissectors/packet-pw-oam.c
@@ -26,6 +26,7 @@
#include "config.h"
#include <epan/packet.h>
+#include "packet-mpls.h"
void proto_register_pw_oam(void);
void proto_reg_handoff_pw_oam(void);
@@ -207,7 +208,7 @@ proto_reg_handoff_pw_oam(void)
dissector_handle_t pw_oam_handle;
pw_oam_handle = create_dissector_handle( dissect_pw_oam, proto_pw_oam );
- dissector_add_uint("pwach.channel_type", 0x0027, pw_oam_handle); /* KM: MPLSTP PW-OAM, RFC 6478 */
+ dissector_add_uint("pwach.channel_type", PW_ACH_TYPE_PW_OAM, pw_oam_handle);
}
/*