diff options
author | olivermd <oliver.downard@couchbase.com> | 2017-02-14 15:07:46 +0000 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-02-21 05:44:29 +0000 |
commit | ed8b549e1c9344799789a4cd0f3b64c147303ca5 (patch) | |
tree | ab98a960f4d1362f156a80c9cde1d66ca7384bc3 /epan/dissectors/packet-couchbase.c | |
parent | fdecfa6c30adc71222e710016374299f01f7e7ad (diff) |
Couchbase: Add SSL support
Change-Id: I468f92c20184a6e5f5bd1f07d94c0b605c0593dc
Reviewed-on: https://code.wireshark.org/review/20149
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-couchbase.c')
-rw-r--r-- | epan/dissectors/packet-couchbase.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/epan/dissectors/packet-couchbase.c b/epan/dissectors/packet-couchbase.c index 6efb04f3f9..f85dc21341 100644 --- a/epan/dissectors/packet-couchbase.c +++ b/epan/dissectors/packet-couchbase.c @@ -47,6 +47,7 @@ #include "packet-tcp.h" +#include "packet-ssl.h" #define PNAME "Couchbase Protocol" #define PSNAME "Couchbase" @@ -685,11 +686,13 @@ static const value_string feature_vals[] = { {0, NULL} }; -static dissector_handle_t couchbase_tcp_handle; +static dissector_handle_t couchbase_handle; static dissector_handle_t json_handle; /* desegmentation of COUCHBASE payload */ static gboolean couchbase_desegment_body = TRUE; +static guint couchbase_ssl_port = 11207; +static guint couchbase_ssl_port_pref = 11207; static guint @@ -2166,7 +2169,9 @@ proto_register_couchbase(void) expert_register_field_array(expert_couchbase, ei, array_length(ei)); /* Register our configuration options */ - couchbase_module = prefs_register_protocol(proto_couchbase, NULL); + couchbase_module = prefs_register_protocol(proto_couchbase, &proto_reg_handoff_couchbase); + + couchbase_handle = register_dissector("couchbase", dissect_couchbase_tcp, proto_couchbase); prefs_register_bool_preference(couchbase_module, "desegment_pdus", "Reassemble PDUs spanning multiple TCP segments", @@ -2175,17 +2180,29 @@ proto_register_couchbase(void) " To use this option, you must also enable \"Allow subdissectors" " to reassemble TCP streams\" in the TCP protocol settings.", &couchbase_desegment_body); + + prefs_register_uint_preference(couchbase_module, "ssl_port", "SSL/TLS Data Port", + "The port used for communicating with the data service via ssl/tls", + 10, &couchbase_ssl_port_pref); + + } /* Register the tcp couchbase dissector. */ void proto_reg_handoff_couchbase(void) { - couchbase_tcp_handle = create_dissector_handle(dissect_couchbase_tcp, proto_couchbase); + static gboolean initialized = FALSE; - dissector_add_uint_range_with_preference("tcp.port", COUCHBASE_DEFAULT_PORT, couchbase_tcp_handle); - - json_handle = find_dissector_add_dependency("json", proto_couchbase); + if (!initialized){ + json_handle = find_dissector_add_dependency("json", proto_couchbase); + dissector_add_uint_range_with_preference("tcp.port", COUCHBASE_DEFAULT_PORT, couchbase_handle); + initialized = TRUE; + } else { + ssl_dissector_delete(couchbase_ssl_port, couchbase_handle); + } + couchbase_ssl_port = couchbase_ssl_port_pref; + ssl_dissector_add(couchbase_ssl_port, couchbase_handle); } /* |