aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-coap.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2020-07-01 13:15:08 +0200
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2020-07-01 18:40:02 +0000
commitf0f2480f3ce3c46a738204942d00230be0c16f37 (patch)
treedfef90f9760fc3570a96fe7c1931caf6057ac616 /epan/dissectors/packet-coap.c
parent65a70ffd8279c07a2e8cda05620b5e5f61dfa723 (diff)
coap: Add Hop-Limit Option
Add Hop-Limit Option from RFC 8768. Change-Id: I029cd1528f6cfdb87e8c259d2169633a72f1f418 Reviewed-on: https://code.wireshark.org/review/37640 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-coap.c')
-rw-r--r--epan/dissectors/packet-coap.c8
1 files changed, 8 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);