aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-11-06 14:55:19 -0500
committerMichael Mann <mmann78@netscape.net>2015-11-07 14:12:43 +0000
commitf4921c10e653389afc4ecd8e951f786f22528324 (patch)
treecc41cd4029c9d09fc2ffaaac29a68186ac614078
parent3aefd3b5b2a64f5da9670e28af4bb409fff3fcd1 (diff)
Add support for registering protocols (dissectors) over DTLS.
This is intentionally broken off of SSL to avoid confusion when UDP is involved. Change-Id: Icfd3054be6aed2ebbd850a608efbc24f1a8f3831 Reviewed-on: https://code.wireshark.org/review/11612 Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/Makefile.common1
-rw-r--r--epan/dissectors/packet-dtls.c12
-rw-r--r--epan/dissectors/packet-dtls.h32
3 files changed, 45 insertions, 0 deletions
diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common
index f862621204..491613fc58 100644
--- a/epan/dissectors/Makefile.common
+++ b/epan/dissectors/Makefile.common
@@ -1487,6 +1487,7 @@ DISSECTOR_INCLUDES = \
packet-dns.h \
packet-dop.h \
packet-dsp.h \
+ packet-dtls.h \
packet-dtn.h \
packet-dvbci.h \
packet-enip.h \
diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c
index 3f02c7b7eb..1bb3ddcc04 100644
--- a/epan/dissectors/packet-dtls.c
+++ b/epan/dissectors/packet-dtls.c
@@ -1951,6 +1951,18 @@ proto_reg_handoff_dtls(void)
initialized = TRUE;
}
+void
+dtls_dissector_add(guint port, dissector_handle_t handle)
+{
+ ssl_association_add("dtls.port", dtls_handle, handle, port, FALSE);
+}
+
+void
+dtls_dissector_delete(guint port, dissector_handle_t handle)
+{
+ ssl_association_remove("dtls.port", dtls_handle, handle, port, FALSE);
+}
+
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
diff --git a/epan/dissectors/packet-dtls.h b/epan/dissectors/packet-dtls.h
new file mode 100644
index 0000000000..49165b09ec
--- /dev/null
+++ b/epan/dissectors/packet-dtls.h
@@ -0,0 +1,32 @@
+/* packet-dtls.h
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __PACKET_DTLS_H__
+#define __PACKET_DTLS_H__
+
+#include "ws_symbol_export.h"
+#include <epan/packet.h>
+
+WS_DLL_PUBLIC void dtls_dissector_add(guint port, dissector_handle_t handle);
+WS_DLL_PUBLIC void dtls_dissector_delete(guint port, dissector_handle_t handle);
+
+#endif /* __PACKET_DTLS_H__ */