coap: add support for coaps (DTLS-secured CoAP)

coaps port is defined in RFC 7252, section 12.7.

CoAP (RFC 7252) is defined only for UDP, not TCP. For TCP, the frame
format is slightly different (draft-ietf-core-coap-tcp-tls-05) and
needs more dissector changes, so remove registration for now.

Change-Id: I1fc7163086f8fe66986565aa24b579ef24f72550
Ping-Bug: 13370
Reviewed-on: https://code.wireshark.org/review/19870
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Peter Wu 2017-01-30 19:41:29 +01:00
parent 977d0769bd
commit 4d506a0a0d
1 changed files with 3 additions and 1 deletions

View File

@ -35,6 +35,7 @@
#include <epan/packet.h>
#include <epan/expert.h>
#include <epan/wmem/wmem.h>
#include "packet-dtls.h"
void proto_register_coap(void);
@ -93,6 +94,7 @@ static dissector_handle_t coap_handle;
/* CoAP's IANA-assigned port (UDP only) number */
#define DEFAULT_COAP_PORT 5683
#define DEFAULT_COAPS_PORT 5684
/* indicators whether those are to be showed or not */
#define DEFAULT_COAP_CTYPE_VALUE ~0U
@ -1258,8 +1260,8 @@ void
proto_reg_handoff_coap(void)
{
media_type_dissector_table = find_dissector_table("media_type");
dissector_add_uint_with_preference("tcp.port", DEFAULT_COAP_PORT, coap_handle);
dissector_add_uint_with_preference("udp.port", DEFAULT_COAP_PORT, coap_handle);
dtls_dissector_add(DEFAULT_COAPS_PORT, coap_handle);
}
/*