diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2015-07-14 23:43:06 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-07-21 21:52:35 +0000 |
commit | e8f24f319ed28d9b419201f431f028c691fc396f (patch) | |
tree | 70f620d6c9fcb3243aaaeb312da2e798c0d0a764 /epan/dissectors/packet-coap.c | |
parent | bd62adb52dcc6bc41736a28cbf40580a903ffc43 (diff) |
coap: fix decoding of observe extension
The observe draft changed and now the option value does not contain the
lifetime anymore, but the value encodes if a user wants to register or
deregister.
Change-Id: I3719101c2bed87c956eb24056be40c9a79dafac8
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-on: https://code.wireshark.org/review/9638
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-coap.c')
-rw-r--r-- | epan/dissectors/packet-coap.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/epan/dissectors/packet-coap.c b/epan/dissectors/packet-coap.c index e61f6708be..70990ca2eb 100644 --- a/epan/dissectors/packet-coap.c +++ b/epan/dissectors/packet-coap.c @@ -2,7 +2,7 @@ * Routines for CoAP packet disassembly * draft-ietf-core-coap-14.txt * draft-ietf-core-block-10.txt - * draft-ietf-core-observe-07.txt + * draft-ietf-core-observe-16.txt * draft-ietf-core-link-format-06.txt * Shoichi Sakane <sakane@tanu.org> * @@ -159,6 +159,12 @@ static const value_string vals_code[] = { }; static value_string_ext vals_code_ext = VALUE_STRING_EXT_INIT(vals_code); +static const value_string vals_observe_options[] = { + { 0, "Register" }, + { 1, "Deregister" }, + { 0, NULL }, +}; + /* * Option Headers * No-Option must not be included in this structure, is handled in the function @@ -168,7 +174,7 @@ static value_string_ext vals_code_ext = VALUE_STRING_EXT_INIT(vals_code); #define COAP_OPT_URI_HOST 3 #define COAP_OPT_ETAG 4 #define COAP_OPT_IF_NONE_MATCH 5 -#define COAP_OPT_OBSERVE 6 /* core-observe-07 */ +#define COAP_OPT_OBSERVE 6 /* core-observe-16 */ #define COAP_OPT_URI_PORT 7 #define COAP_OPT_LOCATION_PATH 8 #define COAP_OPT_URI_PATH 11 @@ -227,7 +233,7 @@ struct coap_option_range_t { { COAP_OPT_PROXY_URI, 1,1034 }, { COAP_OPT_PROXY_SCHEME, 1, 255 }, { COAP_OPT_SIZE1, 0, 4 }, - { COAP_OPT_OBSERVE, 0, 2 }, + { COAP_OPT_OBSERVE, 0, 3 }, { COAP_OPT_BLOCK2, 0, 3 }, { COAP_OPT_BLOCK1, 0, 3 }, { COAP_OPT_BLOCK_SIZE, 0, 4 }, @@ -1052,8 +1058,8 @@ proto_register_coap(void) NULL, HFILL } }, { &hf_coap_opt_observe, - { "Lifetime", "coap.opt.subscr_lifetime", - FT_UINT32, BASE_DEC, NULL, 0x0, + { "Observe", "coap.opt.observe", + FT_UINT32, BASE_DEC, VALS(vals_observe_options), 0x0, NULL, HFILL } }, { &hf_coap_opt_accept, |