10 #ifndef __PACKET_COAP_H__ 11 #define __PACKET_COAP_H__ 13 #include "packet-oscore.h" 16 #define COAP_VERSION_MASK 0xC0 17 #define COAP_TYPE_MASK 0x30 18 #define COAP_TOKEN_LEN_MASK 0x0F 19 #define COAP_BLOCK_MFLAG_MASK 0x08 20 #define COAP_BLOCK_SIZE_MASK 0x07 21 #define COAP_OBJECT_SECURITY_NON_COMPRESSED_MASK 0x80 22 #define COAP_OBJECT_SECURITY_EXPAND_MASK 0x40 23 #define COAP_OBJECT_SECURITY_SIGNATURE_MASK 0x20 24 #define COAP_OBJECT_SECURITY_KID_CONTEXT_MASK 0x10 25 #define COAP_OBJECT_SECURITY_KID_MASK 0x08 26 #define COAP_OBJECT_SECURITY_PIVLEN_MASK 0x07 30 const gchar *ctype_str;
36 gboolean object_security;
50 const gchar *req_ctype_str;
51 guint req_ctype_value;
81 int opt_location_path;
83 int opt_location_query;
85 int opt_uri_path_recon;
94 int opt_object_security_non_compressed;
95 int opt_object_security_expand;
96 int opt_object_security_signature;
97 int opt_object_security_kid_context_present;
98 int opt_object_security_kid_present;
99 int opt_object_security_piv_len;
100 int opt_object_security_piv;
101 int opt_object_security_kid_context_len;
102 int opt_object_security_kid_context;
103 int opt_object_security_kid;
134 #define COAP_COMMON_LIST_T(name) \ 135 coap_common_dissect_t name = { \ 137 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \ 138 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \ 139 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \ 140 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \ 147 EI_INIT, EI_INIT, EI_INIT, EI_INIT, \ 153 #define COAP_COMMON_HF_LIST(name, prefix) \ 155 { "Code", prefix ".code", \ 156 FT_UINT8, BASE_DEC | BASE_EXT_STRING, &coap_vals_code_ext, 0x0, \ 159 { & name .hf.payload, \ 160 { "Payload", prefix ".payload", \ 161 FT_STRING, BASE_NONE, NULL, 0x0, \ 164 { & name .hf.payload_desc, \ 165 { "Payload Desc", prefix ".payload_desc", \ 166 FT_STRING, BASE_NONE, NULL, 0x0, \ 169 { & name .hf.payload_length, \ 170 { "Payload Length", prefix ".payload_length", \ 171 FT_UINT32, BASE_DEC, NULL, 0x0, \ 174 { & name .hf.opt_name, \ 175 { "Opt Name", prefix ".opt.name", \ 176 FT_STRING, BASE_NONE, NULL, 0x0, \ 179 { & name .hf.opt_desc, \ 180 { "Opt Desc", prefix ".opt.desc", \ 181 FT_STRING, BASE_NONE, NULL, 0x0, \ 184 { & name .hf.opt_delta, \ 185 { "Opt Delta", prefix ".opt.delta", \ 186 FT_UINT8, BASE_DEC, NULL, 0xf0, \ 189 { & name .hf.opt_delta_ext, \ 190 { "Opt Delta extended", prefix ".opt.delta_ext", \ 191 FT_UINT16, BASE_DEC, NULL, 0x0, \ 194 { & name .hf.opt_length, \ 195 { "Opt Length", prefix ".opt.length", \ 196 FT_UINT8, BASE_DEC, NULL, 0x0f, \ 197 "Option Length", HFILL } \ 199 { & name .hf.opt_length_ext, \ 200 { "Opt Length extended", prefix ".opt.length_ext", \ 201 FT_UINT16, BASE_DEC, NULL, 0x0, \ 204 { & name .hf.opt_end_marker, \ 205 { "End of options marker", prefix ".opt.end_marker", \ 206 FT_UINT8, BASE_DEC, NULL, 0x00, \ 209 { & name .hf.opt_ctype, \ 210 { "Content-type", prefix ".opt.ctype", \ 211 FT_STRING, BASE_NONE, NULL, 0x0, \ 214 { & name .hf.opt_max_age, \ 215 { "Max-age", prefix ".opt.max_age", \ 216 FT_UINT32, BASE_DEC, NULL, 0x0, \ 219 { & name .hf.opt_proxy_uri, \ 220 { "Proxy-Uri", prefix ".opt.proxy_uri", \ 221 FT_STRING, BASE_NONE, NULL, 0x0, \ 224 { & name .hf.opt_proxy_scheme, \ 225 { "Proxy-Scheme", prefix ".opt.proxy_scheme", \ 226 FT_STRING, BASE_NONE, NULL, 0x0, \ 229 { & name .hf.opt_size1, \ 230 { "Size1", prefix ".opt.size1", \ 231 FT_UINT32, BASE_DEC, NULL, 0x0, \ 234 { & name .hf.opt_etag, \ 235 { "Etag", prefix ".opt.etag", \ 236 FT_BYTES, BASE_NONE, NULL, 0x0, \ 237 "Option Etag", HFILL } \ 239 { & name .hf.opt_uri_host, \ 240 { "Uri-Host", prefix ".opt.uri_host", \ 241 FT_STRING, BASE_NONE, NULL, 0x0, \ 244 { & name .hf.opt_location_path, \ 245 { "Location-Path", prefix ".opt.location_path", \ 246 FT_STRING, BASE_NONE, NULL, 0x0, \ 249 { & name .hf.opt_uri_port, \ 250 { "Uri-Port", prefix ".opt.uri_port", \ 251 FT_UINT16, BASE_DEC, NULL, 0x0, \ 254 { & name .hf.opt_location_query, \ 255 { "Location-Query", prefix ".opt.location_query", \ 256 FT_STRING, BASE_NONE, NULL, 0x0, \ 259 { & name .hf.opt_object_security_non_compressed, \ 260 { "Non-compressed COSE message", prefix ".opt.object_security_non_compressed",\ 261 FT_BOOLEAN, 8, NULL, COAP_OBJECT_SECURITY_NON_COMPRESSED_MASK, \ 264 { & name .hf.opt_object_security_expand, \ 265 { "Expanded Flag Byte", prefix ".opt.object_security_expand", \ 266 FT_BOOLEAN, 8, NULL, COAP_OBJECT_SECURITY_EXPAND_MASK, \ 269 { & name .hf.opt_object_security_signature, \ 270 { "Signature Present", prefix ".opt.object_security_signature", \ 271 FT_BOOLEAN, 8, NULL, COAP_OBJECT_SECURITY_SIGNATURE_MASK, \ 274 { & name .hf.opt_object_security_kid_context_present, \ 275 { "Key ID Context Present", prefix ".opt.object_security_kid_context_present",\ 276 FT_BOOLEAN, 8, NULL, COAP_OBJECT_SECURITY_KID_CONTEXT_MASK, \ 279 { & name .hf.opt_object_security_kid_present, \ 280 { "Key ID Present", prefix ".opt.object_security_kid", \ 281 FT_BOOLEAN, 8, NULL, COAP_OBJECT_SECURITY_KID_MASK, \ 284 { & name .hf.opt_object_security_piv_len, \ 285 { "Partial IV Length", prefix ".opt.object_security_piv_len", \ 286 FT_UINT8, BASE_DEC, NULL, COAP_OBJECT_SECURITY_PIVLEN_MASK, \ 289 { & name .hf.opt_object_security_piv, \ 290 { "Partial IV", prefix ".opt.object_security_piv", \ 291 FT_BYTES, BASE_NONE, NULL, 0x00, \ 294 { & name .hf.opt_object_security_kid_context_len, \ 295 { "Key ID Context Length", prefix ".opt.object_security_kid_context_len",\ 296 FT_UINT8, BASE_DEC, NULL, 0x00, \ 299 { & name .hf.opt_object_security_kid_context, \ 300 { "Partial IV", prefix ".opt.object_security_kid_context", \ 301 FT_BYTES, BASE_NONE, NULL, 0x00, \ 304 { & name .hf.opt_object_security_kid, \ 305 { "Key ID", prefix ".opt.object_security_kid", \ 306 FT_BYTES, BASE_NONE, NULL, 0x00, \ 309 { & name .hf.opt_uri_path, \ 310 { "Uri-Path", prefix ".opt.uri_path", \ 311 FT_STRING, BASE_NONE, NULL, 0x0, \ 314 { & name .hf.opt_uri_path_recon, \ 315 { "Uri-Path", prefix ".opt.uri_path_recon", \ 316 FT_STRING, BASE_NONE, NULL, 0x0, \ 319 { & name .hf.opt_observe, \ 320 { "Observe", prefix ".opt.observe", \ 321 FT_UINT32, BASE_DEC, VALS(coap_vals_observe_options), 0x0, \ 324 { & name .hf.opt_accept, \ 325 { "Accept", prefix ".opt.accept", \ 326 FT_STRING, BASE_NONE, NULL, 0x0, \ 329 { & name .hf.opt_if_match, \ 330 { "If-Match", prefix ".opt.if_match", \ 331 FT_BYTES, BASE_NONE, NULL, 0x0, \ 334 { & name .hf.opt_block_number, \ 335 { "Block Number", prefix ".opt.block_number", \ 336 FT_UINT32, BASE_DEC, NULL, 0x0, \ 339 { & name .hf.opt_block_mflag, \ 340 { "More Flag", prefix ".opt.block_mflag", \ 341 FT_UINT8, BASE_DEC, NULL, COAP_BLOCK_MFLAG_MASK, \ 344 { & name .hf.opt_block_size, \ 345 { "Encoded Block Size", prefix ".opt.block_size", \ 346 FT_UINT8, BASE_DEC, NULL, COAP_BLOCK_SIZE_MASK, \ 349 { & name .hf.opt_uri_query, \ 350 { "Uri-Query", prefix ".opt.uri_query", \ 351 FT_STRING, BASE_NONE, NULL, 0x0, \ 354 { & name .hf.opt_unknown, \ 355 { "Unknown", prefix ".opt.unknown", \ 356 FT_BYTES, BASE_NONE, NULL, 0x0, \ 362 #define COAP_COMMON_ETT_LIST(name) \ 363 & name .ett.payload, \ 364 & name .ett.option, \ 369 #define COAP_COMMON_EI_LIST(name, prefix) \ 370 { & name .ei.opt_invalid_number, \ 371 { prefix ".invalid_option_number", PI_MALFORMED, PI_WARN, \ 372 "Invalid Option Number", EXPFILL } \ 374 { & name .ei.opt_invalid_range, \ 375 { prefix ".invalid_option_range", PI_MALFORMED, PI_WARN, \ 376 "Invalid Option Range", EXPFILL } \ 378 { & name .ei.opt_length_bad, \ 379 { prefix ".option_length_bad", PI_MALFORMED, PI_WARN, \ 380 "Option length bad", EXPFILL } \ 382 { & name .ei.opt_object_security_bad, \ 383 { prefix ".option_object_security_bad", PI_MALFORMED, PI_WARN, \ 384 "Invalid Object-Security Option Format", EXPFILL } \ Definition: wmem_map.c:44
Definition: packet_info.h:44
Definition: packet-coap.h:57
Definition: tvbuff-int.h:35
Definition: packet-coap.h:41
Definition: wmem_strbuf.c:36
Definition: packet-coap.h:29
Definition: packet-oscore.h:49
Definition: value_string.h:24
Definition: value_string.h:164
Definition: packet-coap.h:46