aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-coap.c8
-rw-r--r--epan/dissectors/packet-coap.h7
2 files changed, 15 insertions, 0 deletions
diff --git a/epan/dissectors/packet-coap.c b/epan/dissectors/packet-coap.c
index c14d9b258f..1b63783edc 100644
--- a/epan/dissectors/packet-coap.c
+++ b/epan/dissectors/packet-coap.c
@@ -154,6 +154,7 @@ static const value_string vals_code[] = {
{ 163, "5.03 Service Unavailable" },
{ 164, "5.04 Gateway Timeout" },
{ 165, "5.05 Proxying Not Supported" },
+ { 168, "5.08 Hop Limit Reached" }, /* RFC 8768 */
/* Signalling Codes */
{ 225, "7.01 CSM" }, /* RFC 8323 */
@@ -189,6 +190,7 @@ const value_string coap_vals_observe_options[] = {
#define COAP_OPT_CONTENT_TYPE 12
#define COAP_OPT_MAX_AGE 14
#define COAP_OPT_URI_QUERY 15
+#define COAP_OPT_HOP_LIMIT 16 /* RFC 8768 */
#define COAP_OPT_ACCEPT 17
#define COAP_OPT_LOCATION_QUERY 20
#define COAP_OPT_BLOCK2 23 /* RFC 7959 / RFC 8323 */
@@ -210,6 +212,7 @@ static const value_string vals_opt_type[] = {
{ COAP_OPT_CONTENT_TYPE, "Content-Format" },
{ COAP_OPT_MAX_AGE, "Max-age" },
{ COAP_OPT_URI_QUERY, "Uri-Query" },
+ { COAP_OPT_HOP_LIMIT, "Hop-Limit" },
{ COAP_OPT_ACCEPT, "Accept" },
{ COAP_OPT_LOCATION_QUERY, "Location-Query" },
{ COAP_OPT_PROXY_URI, "Proxy-Uri" },
@@ -238,6 +241,7 @@ struct coap_option_range_t {
{ COAP_OPT_CONTENT_TYPE, 0, 2 },
{ COAP_OPT_MAX_AGE, 0, 4 },
{ COAP_OPT_URI_QUERY, 1, 255 },
+ { COAP_OPT_HOP_LIMIT, 1, 1 },
{ COAP_OPT_ACCEPT, 0, 2 },
{ COAP_OPT_LOCATION_QUERY, 0, 255 },
{ COAP_OPT_PROXY_URI, 1,1034 },
@@ -912,6 +916,10 @@ dissect_coap_options_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *coap_tr
opt_length, dissect_hf->hf.opt_observe_rsp);
}
break;
+ case COAP_OPT_HOP_LIMIT:
+ dissect_coap_opt_uint(tvb, item, subtree, offset,
+ opt_length, dissect_hf->hf.opt_hop_limit);
+ break;
case COAP_OPT_ACCEPT:
dissect_coap_opt_ctype(tvb, item, subtree, offset,
opt_length, dissect_hf->hf.opt_accept, coinfo);
diff --git a/epan/dissectors/packet-coap.h b/epan/dissectors/packet-coap.h
index e748f7552a..2842de74aa 100644
--- a/epan/dissectors/packet-coap.h
+++ b/epan/dissectors/packet-coap.h
@@ -86,6 +86,7 @@ typedef struct coap_common_dissect {
int opt_uri_path_recon;
int opt_observe_req;
int opt_observe_rsp;
+ int opt_hop_limit;
int opt_accept;
int opt_if_match;
int opt_block_number;
@@ -139,6 +140,7 @@ coap_common_dissect_t name = { \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
+ -1, \
}, \
/* ett */ { \
-1, -1, \
@@ -316,6 +318,11 @@ coap_common_dissect_t name = { \
FT_UINT32, BASE_DEC, NULL, 0x0, \
NULL, HFILL } \
}, \
+ { & name .hf.opt_hop_limit, \
+ { "Hop Limit", prefix ".opt.hop_limit", \
+ FT_UINT8, BASE_DEC, NULL, 0x0, \
+ NULL, HFILL } \
+ }, \
{ & name .hf.opt_accept, \
{ "Accept", prefix ".opt.accept", \
FT_STRING, BASE_NONE, NULL, 0x0, \