Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-reload.c
blob02127b80af06fcd447ce247a8002e9de05ca105a
1 /* packet-reload.c
2 * Routines for REsource LOcation And Discovery (RELOAD) Base Protocol
3 * Author: Stephane Bryant <sbryant@glycon.org>
4 * Copyright 2010 Stonyfish Inc.
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
12 * Please refer to the following specs for protocol detail:
13 * - RFC 6940
14 * - RFC 7904
15 * - RFC 7374
16 * - RFC 7363
17 * - RFC 7851
18 * - RFC 7263
21 #include "config.h"
23 #include <epan/packet.h>
24 #include <epan/conversation.h>
25 #include <epan/reassemble.h>
26 #include <epan/asn1.h>
27 #include <epan/uat.h>
28 #include <epan/to_str.h>
29 #include <epan/tfs.h>
30 #include <wsutil/array.h>
31 #include "packet-x509af.h"
32 #include "packet-tls-utils.h"
33 #include "packet-reload.h"
35 void proto_register_reload(void);
36 void proto_reg_handoff_reload(void);
38 /* Initialize the protocol and registered fields */
39 static int proto_reload;
42 static int hf_reload_response_in;
43 static int hf_reload_response_to;
44 static int hf_reload_time;
45 static int hf_reload_duplicate;
46 static int hf_reload_token;
47 static int hf_reload_forwarding;
48 static int hf_reload_overlay;
49 static int hf_reload_configuration_sequence;
50 static int hf_reload_version;
51 static int hf_reload_ttl;
52 static int hf_reload_fragment_flag;
53 static int hf_reload_fragment_fragmented;
54 static int hf_reload_fragment_last_fragment;
55 static int hf_reload_fragment_reserved;
56 static int hf_reload_fragment_offset;
57 static int hf_reload_trans_id;
58 static int hf_reload_max_response_length;
59 static int hf_reload_via_list_length;
60 static int hf_reload_destination_list_length;
61 static int hf_reload_options_length;
62 static int hf_reload_via_list;
63 static int hf_reload_destination;
64 static int hf_reload_destination_compressed_id;
65 static int hf_reload_destination_type;
66 static int hf_reload_nodeid;
67 static int hf_reload_resourceid;
68 static int hf_reload_value;
69 static int hf_reload_destination_data_node_id;
70 static int hf_reload_destination_data_resource_id;
71 static int hf_reload_destination_data_compressed_id;
72 static int hf_reload_destination_list;
73 static int hf_reload_forwarding_options;
74 static int hf_reload_forwarding_option;
75 static int hf_reload_forwarding_option_type;
76 static int hf_reload_forwarding_option_flags;
77 static int hf_reload_forwarding_option_flag_response_copy;
78 static int hf_reload_forwarding_option_flag_destination_critical;
79 static int hf_reload_forwarding_option_flag_forward_critical;
80 static int hf_reload_forwarding_option_flag_ignore_state_keeping;
81 static int hf_reload_attachreqans;
82 static int hf_reload_ufrag;
83 static int hf_reload_password;
84 static int hf_reload_role;
85 static int hf_reload_sendupdate;
86 static int hf_reload_icecandidates;
87 static int hf_reload_icecandidate;
88 static int hf_reload_icecandidate_addr_port;
89 static int hf_reload_icecandidate_relay_addr;
90 static int hf_reload_icecandidate_foundation;
91 static int hf_reload_icecandidate_priority;
92 static int hf_reload_icecandidate_type;
93 static int hf_reload_overlaylink_type;
94 static int hf_reload_iceextension;
95 static int hf_reload_iceextensions;
96 static int hf_reload_iceextension_name;
97 static int hf_reload_iceextension_value;
98 static int hf_reload_ipaddressport;
99 static int hf_reload_ipaddressport_type;
100 static int hf_reload_ipv4addrport;
101 static int hf_reload_ipv4addr;
102 static int hf_reload_port;
103 static int hf_reload_ipv6addrport;
104 static int hf_reload_ipv6addr;
105 static int hf_reload_message_contents;
106 static int hf_reload_message_code;
107 static int hf_reload_message_body;
108 static int hf_reload_message_extensions;
109 static int hf_reload_message_extension;
110 static int hf_reload_message_extension_type;
111 static int hf_reload_message_extension_critical;
112 static int hf_reload_message_extension_content;
113 static int hf_reload_error_response;
114 static int hf_reload_error_response_code;
115 static int hf_reload_error_response_info;
116 static int hf_reload_security_block;
117 static int hf_reload_certificates;
118 static int hf_reload_genericcertificate;
119 static int hf_reload_certificate_type;
120 static int hf_reload_certificate;
121 static int hf_reload_signature;
122 static int hf_reload_signatureandhashalgorithm;
123 static int hf_reload_hash_algorithm;
124 static int hf_reload_signature_algorithm;
125 static int hf_reload_signeridentity;
126 static int hf_reload_signeridentity_type;
127 static int hf_reload_signeridentity_identity;
128 static int hf_reload_signeridentity_value;
129 static int hf_reload_signeridentity_value_hash_alg;
130 static int hf_reload_signeridentity_value_certificate_hash;
131 static int hf_reload_signeridentity_value_certificate_node_id_hash;
132 static int hf_reload_signature_value;
133 static int hf_reload_length_uint8;
134 static int hf_reload_length_uint16;
135 static int hf_reload_length_uint24;
136 static int hf_reload_length_uint32;
137 static int hf_reload_opaque;
138 static int hf_reload_opaque_data;
139 static int hf_reload_opaque_string;
140 static int hf_reload_routequeryreq;
141 static int hf_reload_routequeryreq_destination;
142 static int hf_reload_overlay_specific;
143 static int hf_reload_probereq;
144 static int hf_reload_probereq_requested_info;
145 static int hf_reload_probe_information_type;
146 static int hf_reload_probe_information;
147 static int hf_reload_probe_information_data;
148 static int hf_reload_responsible_set;
149 static int hf_reload_num_resources;
150 static int hf_reload_uptime;
151 static int hf_reload_probeans;
152 static int hf_reload_probeans_probe_info;
153 static int hf_reload_appattachreq;
154 static int hf_reload_appattachans;
155 static int hf_reload_application;
156 static int hf_reload_pingreq;
157 static int hf_reload_pingans;
158 static int hf_reload_ping_response_id;
159 static int hf_reload_ping_time;
160 static int hf_reload_storeddata;
161 static int hf_reload_storedmetadata;
162 static int hf_reload_storeddata_storage_time;
163 static int hf_reload_storeddata_lifetime;
164 static int hf_reload_datavalue;
165 static int hf_reload_metadata;
166 static int hf_reload_datavalue_exists;
167 static int hf_reload_datavalue_value;
168 static int hf_reload_metadata_value_length;
169 static int hf_reload_metadata_hash_value;
170 static int hf_reload_arrayentry;
171 static int hf_reload_arrayentry_value;
172 static int hf_reload_arrayentry_index;
173 static int hf_reload_dictionaryentry;
174 static int hf_reload_dictionarykey;
175 static int hf_reload_dictionary_value;
176 static int hf_reload_kinddata;
177 static int hf_reload_findkinddata_closest;
178 static int hf_reload_kinddata_kind;
179 static int hf_reload_statkindresponse;
180 static int hf_reload_kindid;
181 static int hf_reload_kindid_list;
182 static int hf_reload_generation_counter;
183 static int hf_reload_values;
184 static int hf_reload_storereq;
185 static int hf_reload_resource;
186 static int hf_reload_store_replica_num;
187 static int hf_reload_store_kind_data;
188 static int hf_reload_storeans;
189 static int hf_reload_storeans_kind_responses;
190 static int hf_reload_storekindresponse;
191 static int hf_reload_replicas;
192 static int hf_reload_statreq;
193 static int hf_reload_fetchreq;
194 static int hf_reload_fetchreq_specifiers;
195 static int hf_reload_storeddataspecifier;
196 static int hf_reload_storeddataspecifier_indices;
197 static int hf_reload_storeddataspecifier_keys;
198 static int hf_reload_arrayrange;
199 static int hf_reload_fetchans;
200 static int hf_reload_statans;
201 static int hf_reload_findreq;
202 static int hf_reload_findans;
203 static int hf_reload_findkinddata;
204 static int hf_reload_fragments;
205 static int hf_reload_fragment;
206 static int hf_reload_fragment_overlap;
207 static int hf_reload_fragment_overlap_conflict;
208 static int hf_reload_fragment_multiple_tails;
209 static int hf_reload_fragment_too_long_fragment;
210 static int hf_reload_fragment_error;
211 static int hf_reload_fragment_count;
212 static int hf_reload_reassembled_in;
213 static int hf_reload_reassembled_length;
214 static int hf_reload_configupdatereq;
215 static int hf_reload_configupdatereq_type;
216 static int hf_reload_configupdatereq_configdata;
217 static int hf_reload_configupdatereq_kinds;
218 static int hf_reload_kinddescription;
219 static int hf_reload_chordupdate;
220 static int hf_reload_chordupdate_type;
221 static int hf_reload_chordupdate_predecessors;
222 static int hf_reload_chordupdate_successors;
223 static int hf_reload_chordupdate_fingers;
224 static int hf_reload_chordroutequeryans;
225 static int hf_reload_chordroutequeryans_next_peer;
226 static int hf_reload_chordleave;
227 static int hf_reload_chordleave_type;
228 static int hf_reload_chordleave_predecessors;
229 static int hf_reload_chordleave_successors;
230 static int hf_reload_turnserver;
231 static int hf_reload_turnserver_iteration;
232 static int hf_reload_turnserver_server_address;
233 static int hf_reload_sipregistration;
234 static int hf_reload_sipregistration_type;
235 static int hf_reload_sipregistration_data;
236 static int hf_reload_sipregistration_data_uri;
237 static int hf_reload_sipregistration_data_contact_prefs;
238 static int hf_reload_sipregistration_data_destination_list;
239 static int hf_reload_padding;
240 static int hf_reload_redirserviceproviderdata;
241 static int hf_reload_redirserviceproviderdata_serviceprovider;
242 static int hf_reload_redirserviceproviderdata_namespace;
243 static int hf_reload_redirserviceproviderdata_level;
244 static int hf_reload_redirserviceproviderdata_node;
245 static int hf_reload_redirserviceprovider;
246 static int hf_reload_self_tuning_data;
247 static int hf_reload_self_tuning_data_join_rate;
248 static int hf_reload_self_tuning_data_leave_rate;
249 static int hf_reload_self_tuning_data_network_size;
250 static int hf_reload_dmflags;
251 static int hf_reload_dmflag_status_info;
252 static int hf_reload_dmflag_routing_table_size;
253 static int hf_reload_dmflag_process_power;
254 static int hf_reload_dmflag_bandwidth;
255 static int hf_reload_dmflag_software_version;
256 static int hf_reload_dmflag_machine_uptime;
257 static int hf_reload_dmflag_app_uptime;
258 static int hf_reload_dmflag_memory_footprint;
259 static int hf_reload_dmflag_datasize_stored;
260 static int hf_reload_dmflag_instances_stored;
261 static int hf_reload_dmflag_messages_sent_rcvd;
262 static int hf_reload_dmflag_ewma_bytes_sent;
263 static int hf_reload_dmflag_ewma_bytes_rcvd;
264 static int hf_reload_dmflag_underlay_hop;
265 static int hf_reload_dmflag_battery_status;
266 static int hf_reload_diagnosticrequest;
267 static int hf_reload_diagnosticresponse;
268 static int hf_reload_diagnosticextension;
269 static int hf_reload_diagnosticextension_type;
270 static int hf_reload_diagnosticextension_contents;
271 static int hf_reload_diagnostic_expiration;
272 static int hf_reload_diagnosticrequest_timestampinitiated;
273 static int hf_reload_diagnosticrequest_extensions;
274 static int hf_reload_pathtrackreq;
275 static int hf_reload_pathtrackreq_destination;
276 static int hf_reload_pathtrackreq_request;
277 static int hf_reload_diagnosticinfo;
278 static int hf_reload_diagnosticinfo_kind;
279 static int hf_reload_diagnosticinfo_congestion_status;
280 static int hf_reload_diagnosticinfo_number_peers;
281 static int hf_reload_diagnosticinfo_processing_power;
282 static int hf_reload_diagnosticinfo_bandwidth;
283 static int hf_reload_diagnosticinfo_software_version;
284 static int hf_reload_diagnosticinfo_machine_uptime;
285 static int hf_reload_diagnosticinfo_app_uptime;
286 static int hf_reload_diagnosticinfo_memory_footprint;
287 static int hf_reload_diagnosticinfo_datasize_stored;
288 static int hf_reload_diagnosticinfo_instances_stored;
289 static int hf_reload_diagnosticinfo_instancesstored_info;
290 static int hf_reload_diagnosticinfo_instancesstored_instances;
291 static int hf_reload_diagnosticinfo_messages_sent_rcvd;
292 static int hf_reload_diagnosticinfo_messages_sent_rcvd_info;
293 static int hf_reload_diagnosticinfo_message_code;
294 static int hf_reload_diagnosticinfo_messages_sent;
295 static int hf_reload_diagnosticinfo_messages_rcvd;
296 static int hf_reload_diagnosticinfo_ewma_bytes_sent;
297 static int hf_reload_diagnosticinfo_ewma_bytes_rcvd;
298 static int hf_reload_diagnosticinfo_underlay_hops;
299 static int hf_reload_diagnosticinfo_battery_status;
300 static int hf_reload_diagnosticresponse_timestampreceived;
301 static int hf_reload_diagnosticresponse_hopcounter;
302 static int hf_reload_diagnosticresponse_diagnostic_info_list;
303 static int hf_reload_pathtrackans;
304 static int hf_reload_pathtrackans_next_hop;
305 static int hf_reload_pathtrackans_response;
306 static int hf_reload_extensiveroutingmodeoption;
307 static int hf_reload_routemode;
308 static int hf_reload_extensiveroutingmode_transport;
309 static int hf_reload_extensiveroutingmode_ipaddressport;
310 static int hf_reload_extensiveroutingmode_destination;
311 static int hf_reload_joinreq;
312 static int hf_reload_joinreq_joining_peer_id;
313 static int hf_reload_joinans;
314 static int hf_reload_leavereq;
315 static int hf_reload_leavereq_leaving_peer_id;
317 static dissector_handle_t xml_handle;
320 /* Structure containing transaction specific information */
321 typedef struct _reload_transaction_t {
322 uint32_t req_frame;
323 uint32_t rep_frame;
324 nstime_t req_time;
325 } reload_transaction_t;
327 /* Structure containing conversation specific information */
328 typedef struct _reload_conv_info_t {
329 wmem_tree_t *transaction_pdus;
330 } reload_conv_info_t;
333 /* RELOAD Message classes = (message_code & 0x1) (response = request +1) */
334 #define RELOAD_REQUEST 0x0001
335 #define RELOAD_RESPONSE 0x0000
337 #define RELOAD_ERROR 0xffff
339 #define VERSION_DRAFT 0x01
341 /* RELOAD Message Methods = (message_code +1) & 0xfffe*/
342 #define METHOD_INVALID 0
343 #define METHOD_PROBE 2
344 #define METHOD_ATTACH 4
345 #define METHOD_STORE 8
346 #define METHOD_FETCH 10
347 #define METHOD_UNUSED_REMOVE 12
348 #define METHOD_FIND 14
349 #define METHOD_JOIN 16
350 #define METHOD_LEAVE 18
351 #define METHOD_UPDATE 20
352 #define METHOD_ROUTEQUERY 22
353 #define METHOD_PING 24
354 #define METHOD_STAT 26
355 #define METHOD_UNUSED_ATTACHLIGHT 28
356 #define METHOD_APPATTACH 30
357 #define METHOD_UNUSED_APP_ATTACHLIGHT 32
358 #define METHOD_CONFIGUPDATE 34
359 #define METHOD_EXP_A 36
360 #define METHOD_EXP_B 38
361 #define METHOD_PATH_TRACK 102
362 #define METHOD_ERROR 0xfffe
365 /* RELOAD Destinationtype */
366 #define DESTINATIONTYPE_RESERVED 0
367 #define DESTINATIONTYPE_NODE 1
368 #define DESTINATIONTYPE_RESOURCE 2
369 #define DESTINATIONTYPE_COMPRESSED 3
371 /* RELOAD forwarding option type */
372 #define OPTIONTYPE_RESERVED 0
373 #define OPTIONTYPE_EXTENSIVE_ROUTING_MODE 2
375 /* RELOAD CandTypes */
376 #define CANDTYPE_RESERVED 0
377 #define CANDTYPE_HOST 1
378 #define CANDTYPE_SRFLX 2
379 #define CANDTYPE_PRFLX 3
380 #define CANDTYPE_RELAY 4
382 /* IpAddressPort types */
383 #define IPADDRESSPORTTYPE_RESERVED 0
384 #define IPADDRESSPORTTYPE_IPV4 1
385 #define IPADDRESSPORTTYPE_IPV6 2
387 /* OverlayLink types */
388 #define OVERLAYLINKTYPE_RESERVED 0
389 #define OVERLAYLINKTYPE_DTLS_UDP_SR 1
390 #define OVERLAYLINKTYPE_DTLS_UDP_SR_NO_ICE 3
391 #define OVERLAYLINKTYPE_TLS_TCP_FH_NO_ICE 4
392 #define OVERLAYLINKTYPE_EXP_LINK 5
394 #define ERRORCODE_INVALID 0
395 #define ERRORCODE_UNUSED 1
396 #define ERRORCODE_FORBIDDEN 2
397 #define ERRORCODE_NOTFOUND 3
398 #define ERRORCODE_REQUESTTIMEOUT 4
399 #define ERRORCODE_GENERATIONCOUNTERTOOLOW 5
400 #define ERRORCODE_INCOMPATIBLEWITHOVERLAY 6
401 #define ERRORCODE_UNSUPPORTEDFORWARDINGOPTION 7
402 #define ERRORCODE_DATATOOLARGE 8
403 #define ERRORCODE_DATATOOOLD 9
404 #define ERRORCODE_TTLEXCEEDED 10
405 #define ERRORCODE_MESSAGETOOLARGE 11
406 #define ERRORCODE_UNKNOWNKIND 12
407 #define ERRORCODE_UNKNOWNEXTENSION 13
408 #define ERRORCODE_RESPONSETOOLARGE 14
409 #define ERRORCODE_CONFIGTOOOLD 15
410 #define ERRORCODE_CONFIGTOONEW 16
411 #define ERRORCODE_INPROGRESS 17
412 #define ERRORCODE_EXP_A 18
413 #define ERRORCODE_EXP_B 19
414 #define ERRORCODE_UNDERLAY_DESTINATION_UNREACHABLE 101
415 #define ERRORCODE_UNDERLAY_TIME_EXCEEDED 102
416 #define ERRORCODE_MESSAGE_EXPIRED 103
417 #define ERRORCODE_MISROUTING 104
418 #define ERRORCODE_LOOP_DETECTED 105
419 #define ERRORCODE_TTL_HOPS_EXCEEDED 106
422 /* Signer identity types */
423 #define SIGNERIDENTITYTYPE_RESERVED 0
424 #define SIGNERIDENTITYTYPE_CERTHASH 1
425 #define SIGNERIDENTITYTYPE_CERTHASHNODEID 2
426 #define SIGNERIDENTITYTYPE_NONE 3
428 /* Probe information type */
429 #define PROBEINFORMATIONTYPE_RESERVED 0
430 #define PROBEINFORMATIONTYPE_RESPONSIBLESET 1
431 #define PROBEINFORMATIONTYPE_NUMRESOURCES 2
432 #define PROBEINFORMATIONTYPE_UPTIME 3
433 #define PROBEINFORMATIONTYPE_EXP_PROBE 4
435 /* Data Kind ID */
436 #define DATAKINDID_INVALID 0
437 #define DATAKINDID_SIP_REGISTRATION 1
438 #define DATAKINDID_TURNSERVICE 2
439 #define DATAKINDID_CERTIFICATE_BY_NODE 3
440 #define DATAKINDID_RESERVED_ROUTING_TABLE_SIZE 4
441 #define DATAKINDID_RESERVED_SOFTWARE_VERSION 5
442 #define DATAKINDID_RESERVED_MACHINE_UPTIME 6
443 #define DATAKINDID_RESERVED_APP_UPTIME 7
444 #define DATAKINDID_RESERVED_MEMORY_FOOTPRINT 8
445 #define DATAKINDID_RESERVED_DATASIZE_STORED 9
446 #define DATAKINDID_RESERVED_INSTANCES_STORED 10
447 #define DATAKINDID_RESERVED_MESSAGES_SENT_RCVD 11
448 #define DATAKINDID_RESERVED_EWMA_BYTES_SENT 12
449 #define DATAKINDID_RESERVED_EWMA_BYTES_RCVD 13
450 #define DATAKINDID_RESERVED_LAST_CONTACT 14
451 #define DATAKINDID_RESERVED_RTT 15
452 #define DATAKINDID_CERTIFICATE_BY_USER 16
453 #define DATAKINDID_REDIR 104
455 /* Data model */
456 #define DATAMODEL_SINGLE 1
457 #define DATAMODEL_ARRAY 2
458 #define DATAMODEL_DICTIONARY 3
460 /* Message Extension Type */
461 #define MESSAGEEXTENSIONTYPE_RESERVED 0
462 #define MESSAGEEXTENSIONTYPE_EXP_EXT 1
463 #define MESSAGEEXTENSIONTYPE_SELF_TUNING_DATA 2 /* is 1 */
464 #define MESSAGEEXTENSIONTYPE_DIAGNOSTIC_PING 3 /* is 1 */
466 /* Config Update Type */
467 #define CONFIGUPDATETYPE_RESERVED 0
468 #define CONFIGUPDATETYPE_CONFIG 1
469 #define CONFIGUPDATETYPE_KIND 2
471 /* Chord Update Type */
472 #define CHORDUPDATETYPE_RESERVED 0
473 #define CHORDUPDATETYPE_PEER_READY 1
474 #define CHORDUPDATETYPE_NEIGHBORS 2
475 #define CHORDUPDATETYPE_FULL 3
477 /* Chord Leave Type */
478 #define CHORDLEAVETYPE_RESERVED 0
479 #define CHORDLEAVETYPE_FROM_SUCC 1
480 #define CHORDLEAVETYPE_FROM_PRED 2
482 /* Chord Leave Type */
483 #define SIPREGISTRATIONTYPE_URI 1
484 #define SIPREGISTRATIONTYPE_ROUTE 2
486 /* Diagnostic Kind Id Type */
487 #define DIAGNOSTICKINDID_RESERVED 0x0000
488 #define DIAGNOSTICKINDID_STATUS_INFO 0x0001
489 #define DIAGNOSTICKINDID_ROUTING_TABLE_SIZE 0x0002
490 #define DIAGNOSTICKINDID_PROCESS_POWER 0x0003
491 #define DIAGNOSTICKINDID_BANDWIDTH 0x0004
492 #define DIAGNOSTICKINDID_SOFTWARE_VERSION 0x0005
493 #define DIAGNOSTICKINDID_MACHINE_UPTIME 0x0006
494 #define DIAGNOSTICKINDID_APP_UPTIME 0x0007
495 #define DIAGNOSTICKINDID_MEMORY_FOOTPRINT 0x0008
496 #define DIAGNOSTICKINDID_DATASIZE_STORED 0x0009
497 #define DIAGNOSTICKINDID_INSTANCES_STORED 0x000A
498 #define DIAGNOSTICKINDID_MESSAGES_SENT_RCVD 0x000B
499 #define DIAGNOSTICKINDID_EWMA_BYTES_SENT 0x000C
500 #define DIAGNOSTICKINDID_EWMA_BYTES_RCVD 0x000D
501 #define DIAGNOSTICKINDID_UNDERLAY_HOP 0x000E
502 #define DIAGNOSTICKINDID_BATTERY_STATUS 0x000F
504 /* route modes */
505 #define ROUTEMODE_RESERVED 0
506 #define ROUTEMODE_DDR 1
507 #define ROUTEMODE_RPR 2
509 /* Application IDs */
510 #define APPLICATIONID_INVALID 0
511 #define APPLICATIONID_SIP_5060 5060
512 #define APPLICATIONID_SIP_5061 5061
513 #define APPLICATIONID_RESERVED 0xFFFF
516 #define TOPOLOGY_PLUGIN_CHORD_RELOAD "CHORD-RELOAD"
518 /* reload user configuration variables */
519 static bool reload_defragment = true;
520 static unsigned reload_nodeid_length = 16;
521 static const char *reload_topology_plugin = TOPOLOGY_PLUGIN_CHORD_RELOAD;
524 /* Initialize the subtree pointers */
525 static int ett_reload;
526 static int ett_reload_forwarding;
527 static int ett_reload_message;
528 static int ett_reload_security;
529 static int ett_reload_fragment_flag;
530 static int ett_reload_destination;
531 static int ett_reload_via_list;
532 static int ett_reload_destination_list;
533 static int ett_reload_resourceid;
534 static int ett_reload_forwarding_options;
535 static int ett_reload_forwarding_option;
536 static int ett_reload_forwarding_option_flags;
537 static int ett_reload_forwarding_option_directresponseforwarding;
538 static int ett_reload_attachreqans;
539 static int ett_reload_icecandidates;
540 static int ett_reload_icecandidate;
541 static int ett_reload_icecandidate_computed_address;
542 static int ett_reload_iceextension;
543 static int ett_reload_iceextensions;
544 static int ett_reload_ipaddressport;
545 static int ett_reload_ipv4addrport;
546 static int ett_reload_ipv6addrport;
547 static int ett_reload_message_contents;
548 static int ett_reload_message_extensions;
549 static int ett_reload_message_extension;
550 static int ett_reload_error_response;
551 static int ett_reload_security_block;
552 static int ett_reload_genericcertificate;
553 static int ett_reload_certificates;
554 static int ett_reload_signature;
555 static int ett_reload_signatureandhashalgorithm;
556 static int ett_reload_signeridentity;
557 static int ett_reload_signeridentity_identity;
558 static int ett_reload_signeridentity_value;
559 static int ett_reload_opaque;
560 static int ett_reload_message_body;
561 static int ett_reload_routequeryreq;
562 static int ett_reload_probereq;
563 static int ett_reload_probereq_requested_info;
564 static int ett_reload_probe_information;
565 static int ett_reload_probe_information_data;
566 static int ett_reload_probeans;
567 static int ett_reload_probeans_probe_info;
568 static int ett_reload_appattach;
569 static int ett_reload_pingreq;
570 static int ett_reload_pingans;
571 static int ett_reload_storeddata;
572 static int ett_reload_kinddata;
573 static int ett_reload_values;
574 static int ett_reload_datavalue;
575 static int ett_reload_arrayentry;
576 static int ett_reload_dictionaryentry;
577 static int ett_reload_storereq;
578 static int ett_reload_store_kind_data;
579 static int ett_reload_storeans;
580 static int ett_reload_storekindresponse;
581 static int ett_reload_storeans_kind_responses;
582 static int ett_reload_fetchreq;
583 static int ett_reload_fetchreq_specifiers;
584 static int ett_reload_storeddataspecifier;
585 static int ett_reload_storeddataspecifier_indices;
586 static int ett_reload_storeddataspecifier_keys;
587 static int ett_reload_fetchans;
588 static int ett_reload_statans;
589 static int ett_reload_findkinddata;
590 static int ett_reload_fragments;
591 static int ett_reload_fragment;
592 static int ett_reload_configupdatereq;
593 static int ett_reload_configupdatereq_config_data;
594 static int ett_reload_kinddescription;
595 static int ett_reload_configupdatereq_kinds;
596 static int ett_reload_storekindresponse_replicas;
597 static int ett_reload_nodeid_list;
598 static int ett_reload_chordupdate;
599 static int ett_reload_chordroutequeryans;
600 static int ett_reload_chordleave;
601 static int ett_reload_turnserver;
602 static int ett_reload_sipregistration;
603 static int ett_reload_sipregistration_data;
604 static int ett_reload_sipregistration_destination_list;
605 static int ett_reload_dictionaryentry_key;
606 static int ett_reload_overlay_specific;
607 static int ett_reload_kindid_list;
608 static int ett_reload_redirserviceproviderdata;
609 static int ett_reload_redirserviceprovider;
610 static int ett_reload_self_tuning_data;
611 static int ett_reload_findreq;
612 static int ett_reload_findans;
613 static int ett_reload_dmflags;
614 static int ett_reload_diagnosticextension;
615 static int ett_reload_diagnosticrequest;
616 static int ett_reload_diagnosticrequest_extensions;
617 static int ett_reload_pathtrackreq;
618 static int ett_reload_diagnosticinfo;
619 static int ett_reload_diagnosticinfo_instances_stored;
620 static int ett_reload_diagnosticinfo_instancesstored_info;
621 static int ett_reload_diagnosticinfo_messages_sent_rcvd;
622 static int ett_reload_diagnosticinfo_messages_sent_rcvd_info;
623 static int ett_reload_diagnosticresponse;
624 static int ett_reload_diagnosticresponse_diagnostic_info_list;
625 static int ett_reload_pathtrackans;
626 static int ett_reload_extensiveroutingmodeoption;
627 static int ett_reload_extensiveroutingmode_destination;
628 static int ett_reload_joinreq;
629 static int ett_reload_joinans;
630 static int ett_reload_leavereq;
632 static expert_field ei_reload_truncated_field;
633 static expert_field ei_reload_truncated_packet;
634 static expert_field ei_reload_computed_len_too_big;
635 static expert_field ei_reload_identity_type_unknown;
636 static expert_field ei_reload_unknown_data_model;
637 static expert_field ei_reload_no_xml_dissector;
639 static const fragment_items reload_frag_items = {
640 &ett_reload_fragment,
641 &ett_reload_fragments,
642 &hf_reload_fragments,
643 &hf_reload_fragment,
644 &hf_reload_fragment_overlap,
645 &hf_reload_fragment_overlap_conflict,
646 &hf_reload_fragment_multiple_tails,
647 &hf_reload_fragment_too_long_fragment,
648 &hf_reload_fragment_error,
649 &hf_reload_fragment_count,
650 &hf_reload_reassembled_in,
651 &hf_reload_reassembled_length,
652 /* Reassembled data field */
653 NULL,
654 "RELOAD fragments"
657 static const int *reload_dmflag_items[] = {
658 &hf_reload_dmflag_status_info,
659 &hf_reload_dmflag_routing_table_size,
660 &hf_reload_dmflag_process_power,
661 &hf_reload_dmflag_bandwidth,
662 &hf_reload_dmflag_software_version,
663 &hf_reload_dmflag_machine_uptime,
664 &hf_reload_dmflag_app_uptime,
665 &hf_reload_dmflag_memory_footprint,
666 &hf_reload_dmflag_datasize_stored,
667 &hf_reload_dmflag_instances_stored,
668 &hf_reload_dmflag_messages_sent_rcvd,
669 &hf_reload_dmflag_ewma_bytes_sent,
670 &hf_reload_dmflag_ewma_bytes_rcvd,
671 &hf_reload_dmflag_underlay_hop,
672 &hf_reload_dmflag_battery_status,
675 static uat_t *reloadkindids_uat;
677 typedef struct _Kind {
678 char *name;
679 uint32_t id;
680 unsigned data_model;
682 } kind_t;
684 static kind_t predefined_kinds[] = {
685 {"INVALID" ,DATAKINDID_INVALID, -1},
686 {"SIP-REGISTRATION" ,DATAKINDID_SIP_REGISTRATION, DATAMODEL_DICTIONARY},
687 {"TURN-SERVICE" ,DATAKINDID_TURNSERVICE, DATAMODEL_SINGLE},
688 {"CERTIFICATE_BY_NODE" ,DATAKINDID_CERTIFICATE_BY_NODE, DATAMODEL_ARRAY},
689 {"RESERVED_ROUTING_TABLE_SIZE" ,DATAKINDID_RESERVED_ROUTING_TABLE_SIZE, -1},
690 {"RESERVED_SOFTWARE_VERSION" ,DATAKINDID_RESERVED_SOFTWARE_VERSION, -1},
691 {"RESERVED_MACHINE_UPTIME" ,DATAKINDID_RESERVED_MACHINE_UPTIME, -1},
692 {"DATAKINDID_RESERVED_APP_UPTIME" ,DATAKINDID_RESERVED_APP_UPTIME, -1},
693 {"RESERVED_MEMORY_FOOTPRINT" ,DATAKINDID_RESERVED_MEMORY_FOOTPRINT, -1},
694 {"RESERVED_DATASIZE_STORED" ,DATAKINDID_RESERVED_DATASIZE_STORED, -1},
695 {"RESERVED_INSTANCES_STORED" ,DATAKINDID_RESERVED_INSTANCES_STORED, -1},
696 {"RESERVED_MESSAGES_SENT_RCVD" ,DATAKINDID_RESERVED_MESSAGES_SENT_RCVD, -1},
697 {"RESERVED_EWMA_BYTES_SENT" ,DATAKINDID_RESERVED_EWMA_BYTES_SENT, -1},
698 {"RESERVED_EWMA_BYTES_RCVD" ,DATAKINDID_RESERVED_EWMA_BYTES_RCVD, -1},
699 {"RESERVED_LAST_CONTACT" ,DATAKINDID_RESERVED_LAST_CONTACT, -1},
700 {"RESERVED_RTT" ,DATAKINDID_RESERVED_RTT, -1},
701 {"CERTIFICATE_BY_USER" ,DATAKINDID_CERTIFICATE_BY_USER, DATAMODEL_ARRAY},
702 {"REDIR" ,DATAKINDID_REDIR, DATAMODEL_DICTIONARY},
706 static kind_t * kindidlist_uats;
708 static unsigned nreloadkinds;
710 static kind_t * getKindFromId(uint32_t id) {
711 unsigned i;
712 /* user defined kinds have precedence */
713 for (i = 0; i < nreloadkinds; i++) {
714 if (id == kindidlist_uats[i].id) {
715 return (kindidlist_uats+i);
719 /* then pre-defined kinds */
721 for (i = 0; i < array_length(predefined_kinds); i++) {
722 if (id == predefined_kinds[i].id) {
723 return (predefined_kinds+i);
727 return NULL;
730 /*-------------------------------------
731 * UAT for Kind-IDs
732 *-------------------------------------
736 static void* uat_kindid_copy_cb(void* n, const void* o, size_t siz _U_) {
737 kind_t * new_record = (kind_t *)n;
738 const kind_t* old_record = (const kind_t *)o;
740 new_record->name = g_strdup(old_record->name);
742 return new_record;
745 static void uat_kindid_record_free_cb(void*r) {
746 kind_t* rec = (kind_t *)r;
747 g_free(rec->name);
750 UAT_DEC_CB_DEF(kindidlist_uats,id,kind_t)
751 UAT_CSTRING_CB_DEF(kindidlist_uats,name,kind_t)
752 UAT_VS_DEF(kindidlist_uats,data_model,kind_t,unsigned,0,"string")
755 #define MSG_LENGH_OFFSET 16
756 #define MIN_HDR_LENGTH 38 /* Forwarding header till options_length member (included) */
758 #define RELOAD_TOKEN 0xd2454c4f
760 #define IS_REQUEST(code) (code & 0x0001)
761 #define MSGCODE_TO_METHOD(code) ((code + 1) & 0xfffe)
762 #define MSGCODE_TO_CLASS(code) (code & 0x0001)
765 static const value_string versions[] = {
766 {VERSION_DRAFT, "0.1 DRAFT"},
767 {0x00, NULL}
770 static const value_string classes[] = {
771 {RELOAD_REQUEST, "Request"},
772 {RELOAD_RESPONSE, "Response"},
773 {0x00, NULL}
776 static const value_string methods[] = {
777 {METHOD_INVALID, "invalid"},
778 {METHOD_PROBE, "Probe"},
779 {METHOD_ATTACH, "Attach"},
780 {METHOD_STORE, "Store"},
781 {METHOD_FETCH, "Fetch"},
782 {METHOD_UNUSED_REMOVE, "Remove (Unused)"},
783 {METHOD_FIND, "Find"},
784 {METHOD_JOIN, "Join"},
785 {METHOD_LEAVE, "Leave"},
786 {METHOD_UPDATE, "Update"},
787 {METHOD_ROUTEQUERY, "RouteQuery"},
788 {METHOD_PING, "Ping"},
789 {METHOD_STAT, "Stat"},
790 {METHOD_UNUSED_ATTACHLIGHT, "AttachLight (Unused)"},
791 {METHOD_APPATTACH, "AppAttach"},
792 {METHOD_UNUSED_APP_ATTACHLIGHT, "AppAttachLight (Unused)"},
793 {METHOD_CONFIGUPDATE, "ConfigUpdate"},
794 {METHOD_EXP_A, "Exp_B"},
795 {METHOD_EXP_B, "Exp_A"},
796 {METHOD_PATH_TRACK, "Path_Track"},
797 {METHOD_ERROR, "Error"},
798 {0x00, NULL}
801 static const value_string classes_short[] = {
802 {RELOAD_REQUEST, "req"},
803 {RELOAD_RESPONSE, "ans"},
804 {0x00, NULL}
807 static const value_string classes_Short[] = {
808 {RELOAD_REQUEST, "Req"},
809 {RELOAD_RESPONSE, "Ans"},
810 {0x00, NULL}
813 static const value_string methods_short[] = {
814 {METHOD_INVALID, "invalid"},
815 {METHOD_PROBE, "probe"},
816 {METHOD_ATTACH, "attach"},
817 {METHOD_STORE, "store"},
818 {METHOD_FETCH, "fetch"},
819 {METHOD_UNUSED_REMOVE, "unused_remove"},
820 {METHOD_FIND, "find"},
821 {METHOD_JOIN, "join"},
822 {METHOD_LEAVE, "leave"},
823 {METHOD_UPDATE, "update"},
824 {METHOD_ROUTEQUERY, "route_query"},
825 {METHOD_PING, "ping"},
826 {METHOD_STAT, "stat"},
827 {METHOD_UNUSED_ATTACHLIGHT, "unused_attachlight"},
828 {METHOD_APPATTACH, "app_attach"},
829 {METHOD_UNUSED_APP_ATTACHLIGHT, "unused_app_attachlight"},
830 {METHOD_CONFIGUPDATE, "config_update"},
831 {METHOD_EXP_A, "exp_a"},
832 {METHOD_EXP_B, "exp_b"},
833 {METHOD_PATH_TRACK, "path_track"},
834 {METHOD_ERROR, "error"},
835 {0x00, NULL}
840 static const value_string destinationtypes[] = {
841 {DESTINATIONTYPE_RESERVED, "reserved"},
842 {DESTINATIONTYPE_NODE, "node"},
843 {DESTINATIONTYPE_RESOURCE, "resource"},
844 {DESTINATIONTYPE_COMPRESSED, "compressed"},
845 {0x00, NULL}
848 static const value_string forwardingoptiontypes[] = {
849 {OPTIONTYPE_RESERVED, "reserved"},
850 {OPTIONTYPE_EXTENSIVE_ROUTING_MODE, "extensive_routing_mode"},
851 {0x00, NULL}
854 static const value_string candtypes[] = {
855 {CANDTYPE_RESERVED, "reserved"},
856 {CANDTYPE_HOST, "host"},
857 {CANDTYPE_SRFLX, "srflx"},
858 {CANDTYPE_PRFLX, "prflx"},
859 {CANDTYPE_RELAY, "relay"},
860 {0x00, NULL}
863 static const value_string ipaddressporttypes [] = {
864 {IPADDRESSPORTTYPE_RESERVED, "reserved"},
865 {IPADDRESSPORTTYPE_IPV4, "IPV4"},
866 {IPADDRESSPORTTYPE_IPV6, "IPV6"},
867 {0x00, NULL}
870 static const value_string overlaylinktypes [] = {
871 {OVERLAYLINKTYPE_RESERVED, "reserved"},
872 {OVERLAYLINKTYPE_DTLS_UDP_SR, "DTLS-UDP-SR"},
873 {OVERLAYLINKTYPE_DTLS_UDP_SR_NO_ICE, "DTLS-UDP-SR-NO-ICE"},
874 {OVERLAYLINKTYPE_TLS_TCP_FH_NO_ICE, "TLS-TCP-FH-NO-ICE"},
875 {OVERLAYLINKTYPE_EXP_LINK, "EXP_LINK"},
876 {0x00, NULL}
879 static const value_string errorcodes [] = {
880 {ERRORCODE_INVALID, "invalid"},
881 {ERRORCODE_UNUSED, "Unused"},
882 {ERRORCODE_FORBIDDEN, "Error_Forbidden"},
883 {ERRORCODE_NOTFOUND, "Error_Not_Found"},
884 {ERRORCODE_REQUESTTIMEOUT, "Error_Request_Timeout"},
885 {ERRORCODE_GENERATIONCOUNTERTOOLOW, "Error_Generation_Counter_Too_Low"},
886 {ERRORCODE_INCOMPATIBLEWITHOVERLAY, "Error_Incompatible_with_Overlay"},
887 {ERRORCODE_UNSUPPORTEDFORWARDINGOPTION, "Error_Unsupported_Forwarding_Option"},
888 {ERRORCODE_DATATOOLARGE, "Error_Data_Too_Large"},
889 {ERRORCODE_DATATOOOLD, "Error_Data_Too_Old"},
890 {ERRORCODE_TTLEXCEEDED, "Error_TTL_Exceeded"},
891 {ERRORCODE_MESSAGETOOLARGE, "Error_Message_Too_Large"},
892 {ERRORCODE_UNKNOWNKIND, "Error_Unknown_Kind"},
893 {ERRORCODE_UNKNOWNEXTENSION, "Error_Unknown_Extension"},
894 {ERRORCODE_RESPONSETOOLARGE, "Error_Response_Too_Large"},
895 {ERRORCODE_CONFIGTOOOLD, "Error_Config_Too_Old"},
896 {ERRORCODE_CONFIGTOONEW, "Error_Config_Too_New"},
897 {ERRORCODE_INPROGRESS, "Error_In_Progress"},
898 {ERRORCODE_EXP_A, "Error_Exp_A"},
899 {ERRORCODE_EXP_B, "Error_Exp_B"},
900 {ERRORCODE_UNDERLAY_DESTINATION_UNREACHABLE, "Error_Underlay_Destination_Unreachable"},
901 {ERRORCODE_UNDERLAY_TIME_EXCEEDED, "Error_Underlay_Time_Exceeded"},
902 {ERRORCODE_MESSAGE_EXPIRED, "Error_Message_Expired"},
903 {ERRORCODE_MISROUTING, "Error_Upstream_Misrouting"},
904 {ERRORCODE_LOOP_DETECTED, "Error_Loop_Detected"},
905 {ERRORCODE_TTL_HOPS_EXCEEDED, "Error_TTL_Hops_Exceeded"},
906 {0x00, NULL}
909 static const value_string signeridentitytypes[] = {
910 {SIGNERIDENTITYTYPE_RESERVED, "reserved"},
911 {SIGNERIDENTITYTYPE_CERTHASH, "cert_hash"},
912 {SIGNERIDENTITYTYPE_CERTHASHNODEID, "cert_hash_node_id"},
913 {SIGNERIDENTITYTYPE_NONE, "none"},
914 {0x00, NULL}
917 static const value_string probeinformationtypes[] = {
918 {PROBEINFORMATIONTYPE_RESERVED, "reserved"},
919 {PROBEINFORMATIONTYPE_RESPONSIBLESET, "responsible_set"},
920 {PROBEINFORMATIONTYPE_NUMRESOURCES, "num_resources"},
921 {PROBEINFORMATIONTYPE_UPTIME, "uptime"},
922 {PROBEINFORMATIONTYPE_EXP_PROBE, "exp-probe"},
923 {0x00, NULL}
927 static const value_string datamodels[] = {
928 {DATAMODEL_SINGLE, "SINGLE"},
929 {DATAMODEL_ARRAY, "ARRAY"},
930 {DATAMODEL_DICTIONARY, "DICTIONARY"},
931 {0x00, NULL}
934 static const value_string messageextensiontypes[] = {
935 {MESSAGEEXTENSIONTYPE_RESERVED, "reserved"},
936 {MESSAGEEXTENSIONTYPE_EXP_EXT, "exp-ext"},
937 {MESSAGEEXTENSIONTYPE_SELF_TUNING_DATA, "sip_tuning_data"},
938 {MESSAGEEXTENSIONTYPE_DIAGNOSTIC_PING, "Diagnostic_Ping"},
939 {0x00, NULL}
943 static const value_string configupdatetypes[] = {
944 {CONFIGUPDATETYPE_RESERVED, "reserved"},
945 {CONFIGUPDATETYPE_CONFIG, "config"},
946 {CONFIGUPDATETYPE_KIND, "kind"},
947 {0x00, NULL}
950 static const value_string chordupdatetypes[] = {
951 {CHORDUPDATETYPE_RESERVED, "reserved"},
952 {CHORDUPDATETYPE_PEER_READY, "peer_ready"},
953 {CHORDUPDATETYPE_NEIGHBORS, "neighbors"},
954 {CHORDUPDATETYPE_FULL, "full"},
955 {0x00, NULL}
958 static const value_string chordleavetypes[] = {
959 {CHORDLEAVETYPE_RESERVED, "reserved"},
960 {CHORDLEAVETYPE_FROM_SUCC, "from_succ"},
961 {CHORDLEAVETYPE_FROM_PRED, "from_pred"},
962 {0x00, NULL}
965 static const value_string sipregistrationtypes[] = {
966 {SIPREGISTRATIONTYPE_URI, "sip_registration_uri"},
967 {SIPREGISTRATIONTYPE_ROUTE, "sip_registration_route"},
968 {0x00, NULL}
971 static const value_string diagnostickindids[] = {
972 {DIAGNOSTICKINDID_RESERVED, "reserved"},
973 {DIAGNOSTICKINDID_STATUS_INFO, "STATUS_INFO"},
974 {DIAGNOSTICKINDID_ROUTING_TABLE_SIZE, "ROUTING_TABLE_SIZ"},
975 {DIAGNOSTICKINDID_PROCESS_POWER, "PROCESS_POWER"},
976 {DIAGNOSTICKINDID_BANDWIDTH, "BANDWIDTH"},
977 {DIAGNOSTICKINDID_SOFTWARE_VERSION, "SOFTWARE_VERSION"},
978 {DIAGNOSTICKINDID_MACHINE_UPTIME, "MACHINE_UPTIME"},
979 {DIAGNOSTICKINDID_APP_UPTIME, "APP_UPTIME"},
980 {DIAGNOSTICKINDID_MEMORY_FOOTPRINT, "MEMORY_FOOTPRINT"},
981 {DIAGNOSTICKINDID_DATASIZE_STORED, "DATASIZE_STORED"},
982 {DIAGNOSTICKINDID_INSTANCES_STORED, "INSTANCES_STORED"},
983 {DIAGNOSTICKINDID_MESSAGES_SENT_RCVD, "MESSAGES_SENT_RCVD"},
984 {DIAGNOSTICKINDID_EWMA_BYTES_SENT, "EWMA_BYTES_SENT"},
985 {DIAGNOSTICKINDID_EWMA_BYTES_RCVD, "EWMA_BYTES_RCVD"},
986 {DIAGNOSTICKINDID_UNDERLAY_HOP, "UNDERLAY_HOP"},
987 {DIAGNOSTICKINDID_BATTERY_STATUS, "BATTERY_STATUS"},
988 {0x00, NULL}
991 static const value_string routemodes[] = {
992 {ROUTEMODE_RESERVED, "reserved"},
993 {ROUTEMODE_DDR, "DDR"},
994 {ROUTEMODE_RPR, "RPR"},
995 {0x00, NULL}
998 static const value_string applicationids[] = {
999 /* Application IDs */
1000 {APPLICATIONID_INVALID, "INVALID"},
1001 {APPLICATIONID_SIP_5060, "SIP"},
1002 {APPLICATIONID_SIP_5061, "SIP"},
1003 {APPLICATIONID_RESERVED, "Reserved"},
1004 {0x00, NULL}
1009 * defragmentation
1011 static reassembly_table reload_reassembly_table;
1014 static unsigned
1015 get_reload_message_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
1017 uint32_t length = tvb_get_ntohl(tvb, offset + MSG_LENGH_OFFSET);
1018 return length;
1021 static int
1022 dissect_opaque_string_or_data(tvbuff_t *tvb, packet_info *pinfo,proto_tree *tree, int anchor_index, uint16_t offset, uint16_t length_size, int32_t max_field_length, bool is_string)
1024 proto_tree *opaque_tree;
1025 proto_item *ti_anchor;
1026 int length_index = -1;
1027 int32_t length = -1;
1028 int hf = hf_reload_opaque;
1029 int hf_data = hf_reload_opaque_data;
1030 unsigned hf_data_encoding = ENC_NA;
1032 if (anchor_index >= 0) {
1033 hf = anchor_index;
1036 if (is_string) {
1037 hf_data = hf_reload_opaque_string;
1038 hf_data_encoding = ENC_ASCII|ENC_NA;
1041 switch (length_size) {
1042 case 1:
1043 length_index = hf_reload_length_uint8;
1044 length = (int32_t)tvb_get_uint8(tvb,offset);
1045 break;
1046 case 2:
1047 length_index = hf_reload_length_uint16;
1048 length = (int32_t)tvb_get_ntohs(tvb, offset);
1049 break;
1050 case 3:
1051 length_index = hf_reload_length_uint24;
1052 length = ((int32_t) (tvb_get_ntohs(tvb, offset) <<8) + (tvb_get_uint8(tvb, offset+2)));
1053 break;
1054 case 4:
1055 length_index = hf_reload_length_uint32;
1056 length = (int32_t)tvb_get_ntohl(tvb, offset);
1057 break;
1059 default:
1060 break;
1063 if (length_index < 0) return 0;
1065 ti_anchor = proto_tree_add_item(tree, hf, tvb, offset, length_size + length, ENC_NA);
1067 if (max_field_length > 0) {
1068 if ((length + length_size) > max_field_length) {
1069 expert_add_info(pinfo, ti_anchor, &ei_reload_computed_len_too_big);
1070 length = max_field_length - length_size;
1074 opaque_tree = proto_item_add_subtree(ti_anchor, ett_reload_opaque);
1075 proto_tree_add_uint(opaque_tree, length_index, tvb, offset, length_size, (unsigned)length);
1076 if (length) {
1077 proto_tree_add_item(opaque_tree, hf_data, tvb, offset + length_size, length, hf_data_encoding);
1079 if (hf != hf_reload_opaque) {
1080 proto_item_append_text(ti_anchor, " (opaque<%d>)", length);
1082 else {
1083 proto_item_append_text(ti_anchor, "<%d>", length);
1086 return (length_size + length);
1089 static int
1090 dissect_opaque(tvbuff_t *tvb, packet_info *pinfo,proto_tree *tree, int anchor_index, uint16_t offset, uint16_t length_size, int32_t max_field_length) {
1091 return dissect_opaque_string_or_data(tvb, pinfo, tree, anchor_index, offset, length_size, max_field_length, false);
1094 static int
1095 dissect_opaque_string(tvbuff_t *tvb, packet_info *pinfo,proto_tree *tree, int anchor_index, uint16_t offset, uint16_t length_size, int32_t max_field_length) {
1096 return dissect_opaque_string_or_data(tvb, pinfo, tree, anchor_index, offset, length_size, max_field_length, true);
1099 static int dissect_length(tvbuff_t *tvb, proto_tree *tree, uint16_t offset, uint16_t length_size) {
1100 switch (length_size) {
1101 case 1:
1102 proto_tree_add_item(tree, hf_reload_length_uint8, tvb, offset, 1, ENC_BIG_ENDIAN);
1103 return 1;
1105 case 2:
1106 proto_tree_add_item(tree, hf_reload_length_uint16, tvb, offset, 2, ENC_BIG_ENDIAN);
1107 return 2;
1109 case 3:
1110 proto_tree_add_item(tree, hf_reload_length_uint24, tvb, offset, 3, ENC_BIG_ENDIAN);
1111 return 3;
1113 case 4:
1114 proto_tree_add_item(tree, hf_reload_length_uint32, tvb, offset, 4, ENC_BIG_ENDIAN);
1115 return 4;
1117 default:
1118 break;
1120 return 0;
1123 static int dissect_resourceid(int anchor, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1125 proto_item *ti_local;
1126 proto_tree *local_tree;
1127 int hf = hf_reload_resourceid;
1128 uint8_t local_length;
1130 if (anchor >= 0) {
1131 hf = anchor;
1134 local_length = tvb_get_uint8(tvb, offset);
1136 /* We don't know the node ID. Just assume that all the data is part of it */
1137 if (length < local_length+1) {
1138 ti_local = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1139 expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated ResourceId");
1140 return length;
1143 ti_local = proto_tree_add_item(tree, hf, tvb, offset, 1+local_length, ENC_NA);
1144 local_tree = proto_item_add_subtree(ti_local, ett_reload_resourceid);
1145 proto_tree_add_item(local_tree, hf_reload_length_uint8, tvb, offset, 1, ENC_BIG_ENDIAN);
1146 proto_tree_add_item(local_tree, hf_reload_opaque_data, tvb, offset+1, local_length, ENC_NA);
1148 if (hf != hf_reload_resourceid) {
1149 proto_item_append_text(ti_local, " (ResourceId<%d>)", local_length);
1151 else {
1152 proto_item_append_text(ti_local, "<%d>", local_length);
1155 return 1+local_length;
1158 static int dissect_nodeid(int anchor, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1160 proto_item *ti_nodeid;
1161 int hf = hf_reload_nodeid;
1163 if (anchor >= 0) {
1164 hf = anchor;
1167 /* We don't know the node ID. Just assume that all the data is part of it */
1168 if (length < reload_nodeid_length) {
1169 ti_nodeid = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1170 expert_add_info_format(pinfo, ti_nodeid, &ei_reload_truncated_field, "Truncated NodeId");
1171 return length;
1174 ti_nodeid = proto_tree_add_item(tree, hf, tvb, offset, reload_nodeid_length, ENC_NA);
1176 bool allZeros = true;
1177 bool allOnes = true;
1178 unsigned i;
1180 for (i=0; i<reload_nodeid_length; i++) {
1181 uint8_t byte = tvb_get_uint8(tvb,offset+i);
1182 if (byte != 0) {
1183 allZeros = false;
1184 if (allOnes == false) break;
1186 if (byte != 0xFF) {
1187 allOnes = false;
1188 if (allZeros == false) break;
1192 if (allZeros) {
1193 proto_item_append_text(ti_nodeid, "\n [Invalid]");
1195 if (allOnes) {
1196 proto_item_append_text(ti_nodeid, "\n [Wildcard]");
1202 return reload_nodeid_length;
1205 static int
1206 dissect_destination(int anchor, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1208 uint8_t destination_type;
1209 proto_tree *destination_tree;
1210 proto_item *ti_destination;
1211 uint8_t destination_length = 0;
1212 int hf = hf_reload_destination;
1214 if (anchor >= 0) {
1215 hf = anchor;
1218 destination_type = tvb_get_uint8(tvb,offset);
1220 if (destination_type & 0x80) {
1221 /* simple compressed case */
1222 ti_destination = proto_tree_add_item(tree, hf, tvb, offset, 2, ENC_NA);
1223 if (hf == anchor) {
1224 proto_item_append_text(ti_destination, " (Destination)");
1226 proto_item_append_text(ti_destination, ": uint16");
1227 destination_tree = proto_item_add_subtree(ti_destination, ett_reload_destination);
1228 proto_tree_add_item(destination_tree,hf_reload_destination_compressed_id , tvb, offset, 2, ENC_BIG_ENDIAN);
1229 return 2;
1231 else {
1232 /* normal case */
1234 destination_length = tvb_get_uint8(tvb,offset+1);
1235 ti_destination = proto_tree_add_item(tree, hf, tvb, offset, 2+destination_length, ENC_NA);
1236 if (hf == anchor) {
1237 proto_item_append_text(ti_destination, " (Destination)");
1239 destination_tree = proto_item_add_subtree(ti_destination, ett_reload_destination);
1240 proto_item_append_text(ti_destination, ": %s", val_to_str_const(destination_type, destinationtypes, "Unknown"));
1242 proto_tree_add_item(destination_tree, hf_reload_destination_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1243 proto_tree_add_uint(destination_tree, hf_reload_length_uint8, tvb, offset+1, 1, destination_length);
1244 if (2 + destination_length > length) {
1245 expert_add_info_format(pinfo, ti_destination, &ei_reload_truncated_field, "Truncated Destination");
1246 return length;
1248 switch(destination_type) {
1249 case DESTINATIONTYPE_NODE:
1250 dissect_nodeid(hf_reload_destination_data_node_id, tvb, pinfo, destination_tree, offset+2, destination_length);
1251 break;
1253 case DESTINATIONTYPE_RESOURCE:
1254 dissect_resourceid(hf_reload_destination_data_resource_id, tvb, pinfo, destination_tree, offset+2, destination_length);
1255 break;
1257 case DESTINATIONTYPE_COMPRESSED:
1258 dissect_opaque(tvb, pinfo, destination_tree, hf_reload_destination_data_compressed_id, offset+2, 1, destination_length);
1259 break;
1260 default:
1261 break;
1265 return (2+destination_length);
1269 static int
1270 dissect_destination_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *list_tree, uint16_t offset, uint16_t length, int *numDestinations)
1272 int local_offset = 0;
1273 int local_increment;
1275 *numDestinations = 0;
1276 while (local_offset +2 <= length) {
1277 local_increment = dissect_destination(-1,tvb, pinfo, list_tree, offset + local_offset, length-local_offset);
1278 if (local_increment <= 0) break;
1279 local_offset += local_increment;
1280 (*numDestinations)++;
1282 return local_offset;
1285 static int
1286 dissect_probe_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1288 proto_item *ti_probe_information;
1289 proto_tree *probe_information_tree;
1290 uint8_t type;
1291 uint8_t probe_length;
1293 type = tvb_get_uint8(tvb, offset);
1294 probe_length = tvb_get_uint8(tvb, offset + 1);
1296 if (probe_length + 2 > length) {
1297 ti_probe_information = proto_tree_add_item(tree, hf_reload_probe_information, tvb, offset, length, ENC_NA);
1298 expert_add_info_format(pinfo, ti_probe_information, &ei_reload_truncated_field, "Truncated probe information");
1299 return length;
1301 ti_probe_information = proto_tree_add_item(tree, hf_reload_probe_information, tvb, offset, 2 + probe_length, ENC_NA);
1302 probe_information_tree = proto_item_add_subtree(ti_probe_information, ett_reload_probe_information);
1304 proto_tree_add_item(probe_information_tree, hf_reload_probe_information_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1305 proto_tree_add_uint(probe_information_tree, hf_reload_length_uint8, tvb, offset + 1, 1, probe_length);
1308 proto_item *ti_probe_information_data;
1309 proto_tree *probe_information_data_tree;
1311 ti_probe_information_data = proto_tree_add_item(probe_information_tree, hf_reload_probe_information_data, tvb, offset+2, probe_length, ENC_NA);
1312 probe_information_data_tree = proto_item_add_subtree(ti_probe_information_data, ett_reload_probe_information_data);
1314 switch(type) {
1315 case PROBEINFORMATIONTYPE_RESPONSIBLESET:
1316 if (probe_length < 4) {
1317 expert_add_info_format(pinfo, ti_probe_information_data, &ei_reload_truncated_field, "Truncated responsible set");
1318 return 2 + probe_length;
1320 proto_tree_add_item(probe_information_data_tree, hf_reload_responsible_set, tvb, offset + 2, 4, ENC_BIG_ENDIAN);
1321 break;
1322 case PROBEINFORMATIONTYPE_NUMRESOURCES:
1323 if (probe_length < 4) {
1324 expert_add_info_format(pinfo, ti_probe_information_data, &ei_reload_truncated_field, "Truncated num resource info");
1325 return 2 + probe_length;
1327 proto_tree_add_item(probe_information_data_tree, hf_reload_num_resources, tvb, offset + 2, 4, ENC_BIG_ENDIAN);
1328 break;
1329 case PROBEINFORMATIONTYPE_UPTIME:
1330 if (probe_length < 4) {
1331 expert_add_info_format(pinfo, ti_probe_information_data, &ei_reload_truncated_field, "Truncated uptime info");
1332 return 2 + probe_length;
1334 proto_tree_add_item(probe_information_data_tree, hf_reload_uptime, tvb, offset + 2, 4, ENC_BIG_ENDIAN);
1335 break;
1336 default:
1337 break;
1340 return probe_length + 2;
1345 static int
1346 dissect_ipaddressport(int anchor, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset)
1348 proto_item *ti_ipaddressport;
1349 proto_tree *ipaddressport_tree;
1350 uint8_t ipaddressport_type;
1351 uint8_t ipaddressport_length;
1352 int hf = hf_reload_ipaddressport;
1354 if (anchor >= 0) {
1355 hf = anchor;
1358 ipaddressport_length = tvb_get_uint8(tvb, offset+1);
1359 ti_ipaddressport = proto_tree_add_item(tree, hf, tvb, offset, ipaddressport_length+2, ENC_NA);
1360 if (hf == anchor) proto_item_append_text(ti_ipaddressport, " (IpAddressPort)");
1361 ipaddressport_type = tvb_get_uint8(tvb, offset);
1362 proto_item_append_text(ti_ipaddressport, ": %s", val_to_str_const(ipaddressport_type, ipaddressporttypes,"Unknown Type"));
1363 if (ipaddressport_type == IPADDRESSPORTTYPE_IPV4) {
1364 proto_item_append_text(ti_ipaddressport, " (%s:%d)", tvb_ip_to_str(pinfo->pool, tvb, offset+2),tvb_get_ntohs(tvb,offset+2+4));
1366 else if (ipaddressport_type == IPADDRESSPORTTYPE_IPV6) {
1367 proto_item_append_text(ti_ipaddressport, " (%s:%d)", tvb_ip6_to_str(pinfo->pool, tvb, offset+2),tvb_get_ntohs(tvb,offset+2+16));
1369 ipaddressport_tree = proto_item_add_subtree(ti_ipaddressport, ett_reload_ipaddressport);
1370 proto_tree_add_item(ipaddressport_tree, hf_reload_ipaddressport_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1371 offset += 1;
1372 proto_tree_add_uint(ipaddressport_tree, hf_reload_length_uint8, tvb, offset, 1, ipaddressport_length);
1373 offset += 1;
1374 switch (ipaddressport_type) {
1375 case IPADDRESSPORTTYPE_IPV4:
1377 proto_item *ti_ipv4;
1378 proto_tree *ipv4_tree;
1379 ti_ipv4 = proto_tree_add_item(ipaddressport_tree, hf_reload_ipv4addrport, tvb, offset, 6, ENC_NA);
1380 proto_item_append_text(ti_ipv4, ": %s:%d", tvb_ip_to_str(pinfo->pool, tvb, offset),tvb_get_ntohs(tvb,offset+4));
1381 ipv4_tree = proto_item_add_subtree(ti_ipv4, ett_reload_ipv4addrport);
1382 proto_tree_add_item(ipv4_tree, hf_reload_ipv4addr, tvb, offset, 4, ENC_BIG_ENDIAN);
1383 proto_tree_add_item(ipv4_tree, hf_reload_port, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
1385 break;
1387 case IPADDRESSPORTTYPE_IPV6:
1389 proto_item *ti_ipv6;
1390 proto_tree *ipv6_tree;
1391 ti_ipv6 = proto_tree_add_item(ipaddressport_tree, hf_reload_ipv6addrport, tvb, offset, 6, ENC_NA);
1392 proto_item_append_text(ti_ipv6, ": %s:%d", tvb_ip6_to_str(pinfo->pool, tvb, offset),tvb_get_ntohs(tvb,offset+16));
1393 ipv6_tree = proto_item_add_subtree(ti_ipv6, ett_reload_ipv6addrport);
1394 proto_tree_add_item(ipv6_tree, hf_reload_ipv6addr, tvb, offset, 16, ENC_NA);
1395 proto_tree_add_item(ipv6_tree, hf_reload_port, tvb, offset + 16, 2, ENC_BIG_ENDIAN);
1397 break;
1399 default:
1400 break;
1404 return (int) (2 + ipaddressport_length);
1407 static int
1408 dissect_icecandidates(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1410 proto_item *ti_icecandidates;
1411 proto_tree *icecandidates_tree;
1412 uint32_t icecandidates_offset = 0;
1413 uint32_t icecandidates_length;
1414 uint32_t local_offset = 0;
1415 int nCandidates = 0;
1417 icecandidates_length = tvb_get_ntohs(tvb, offset);
1418 /* Precalculate the length of the icecandidate list */
1419 if (2+icecandidates_length > length) {
1420 ti_icecandidates = proto_tree_add_item(tree, hf_reload_icecandidates, tvb, offset, length, ENC_NA);
1421 expert_add_info_format(pinfo, ti_icecandidates, &ei_reload_truncated_field, "Truncated ice candidates");
1422 return length;
1425 ti_icecandidates = proto_tree_add_item(tree, hf_reload_icecandidates, tvb, offset, 2+icecandidates_length, ENC_NA);
1426 proto_item_append_text(ti_icecandidates, " (IceCandidate<%d>)", icecandidates_length);
1427 icecandidates_tree = proto_item_add_subtree(ti_icecandidates, ett_reload_icecandidates);
1428 proto_tree_add_uint(icecandidates_tree, hf_reload_length_uint16, tvb, offset+local_offset, 2, icecandidates_length);
1429 local_offset += 2;
1430 while (icecandidates_offset < icecandidates_length) {
1431 proto_item *ti_icecandidate;
1432 proto_tree *icecandidate_tree;
1433 uint8_t ipaddressport_length;
1434 uint8_t computed_ipaddressport_length;
1435 uint16_t iceextensions_length;
1436 uint8_t foundation_length;
1437 uint8_t candtype;
1438 uint16_t icecandidate_offset = 0;
1439 /* compute the length */
1440 ipaddressport_length = tvb_get_uint8(tvb, offset+local_offset+icecandidates_offset+icecandidate_offset+1);
1441 icecandidate_offset += 2 + ipaddressport_length;
1442 icecandidate_offset += 1;/* OverlayLink */
1443 foundation_length = tvb_get_uint8(tvb, offset+local_offset+icecandidates_offset+icecandidate_offset);
1444 icecandidate_offset += 1 + foundation_length;
1445 icecandidate_offset += 4;/* priority */
1446 candtype = tvb_get_uint8(tvb, offset+local_offset+icecandidates_offset+icecandidate_offset);
1447 icecandidate_offset += 1;/* candType */
1448 computed_ipaddressport_length = 0;
1449 switch (candtype) {
1450 case CANDTYPE_HOST:
1451 break;
1452 case CANDTYPE_SRFLX:
1453 case CANDTYPE_PRFLX:
1454 case CANDTYPE_RELAY:
1455 /* IpAddressPort */
1456 computed_ipaddressport_length = tvb_get_uint8(tvb, offset+local_offset+icecandidates_offset+icecandidate_offset+1);
1457 icecandidate_offset += computed_ipaddressport_length+2;
1458 break;
1459 default:
1460 break;
1463 iceextensions_length = tvb_get_ntohs(tvb, offset+local_offset+icecandidates_offset+icecandidate_offset);
1464 icecandidate_offset += iceextensions_length + 2;
1466 /* icecandidate_offset is now equal to the length of this icecandidate */
1467 if (icecandidates_offset + icecandidate_offset > icecandidates_length) {
1468 expert_add_info_format(pinfo, ti_icecandidates, &ei_reload_truncated_field, "Truncated IceCandidate");
1469 break;
1471 ti_icecandidate = proto_tree_add_item(icecandidates_tree, hf_reload_icecandidate, tvb, offset+local_offset+ icecandidates_offset, icecandidate_offset, ENC_NA);
1472 icecandidate_tree = proto_item_add_subtree(ti_icecandidate, ett_reload_icecandidate);
1473 /* parse from start */
1474 icecandidate_offset = 0;
1475 dissect_ipaddressport(hf_reload_icecandidate_addr_port, tvb, pinfo, icecandidate_tree, offset+local_offset+icecandidates_offset+icecandidate_offset);
1476 icecandidate_offset += 2 + ipaddressport_length;
1478 proto_tree_add_item(icecandidate_tree, hf_reload_overlaylink_type, tvb,
1479 offset+local_offset+icecandidates_offset+icecandidate_offset, 1, ENC_BIG_ENDIAN);
1481 icecandidate_offset += 1;
1482 icecandidate_offset += dissect_opaque_string(tvb, pinfo,icecandidate_tree, hf_reload_icecandidate_foundation,offset+local_offset+icecandidates_offset + icecandidate_offset, 1, -1);
1485 uint32_t priority;
1487 priority = tvb_get_ntohl(tvb, offset+local_offset + icecandidates_offset);
1488 proto_tree_add_item(icecandidate_tree, hf_reload_icecandidate_priority, tvb, offset+local_offset + icecandidates_offset, 4, ENC_BIG_ENDIAN);
1489 icecandidate_offset += 4;
1490 proto_tree_add_item(icecandidate_tree, hf_reload_icecandidate_type, tvb,
1491 offset+local_offset+icecandidates_offset+icecandidate_offset, 1, ENC_BIG_ENDIAN);
1492 proto_item_append_text(ti_icecandidate, ": %s, priority=%d", val_to_str_const(candtype, candtypes, "Unknown"), priority);
1494 icecandidate_offset += 1;
1496 int item_index = -1;
1497 switch (candtype) {
1498 case CANDTYPE_HOST:
1499 break;
1500 case CANDTYPE_SRFLX:
1501 case CANDTYPE_PRFLX:
1502 case CANDTYPE_RELAY:
1503 item_index = hf_reload_icecandidate_relay_addr;
1504 break;
1506 default:
1507 break;
1509 if (item_index != -1) {
1510 dissect_ipaddressport(item_index, tvb, pinfo, icecandidate_tree,
1511 offset+local_offset+icecandidates_offset+icecandidate_offset);
1512 icecandidate_offset += computed_ipaddressport_length + 2;
1515 /* Ice extensions */
1517 uint32_t iceextensions_offset = 0;
1518 proto_item *ti_iceextension, *ti_extensions;
1519 proto_tree *iceextension_tree,*extensions_tree;
1520 uint16_t iceextension_name_length;
1521 uint16_t iceextension_value_length;
1522 int nExtensions = 0;
1523 ti_extensions =
1524 proto_tree_add_item(icecandidate_tree, hf_reload_iceextensions, tvb,
1525 offset+local_offset+icecandidates_offset+icecandidate_offset, 2+iceextensions_length,
1526 ENC_NA);
1527 proto_item_append_text(ti_extensions, " (IceExtensions<%d>)", iceextensions_length);
1528 extensions_tree = proto_item_add_subtree(ti_extensions, ett_reload_iceextensions);
1530 proto_tree_add_item(extensions_tree, hf_reload_length_uint16, tvb,
1531 offset+local_offset+icecandidates_offset+icecandidate_offset, 2, ENC_BIG_ENDIAN);
1532 icecandidate_offset += 2;
1533 while (iceextensions_offset < iceextensions_length) {
1534 int local_increment;
1535 iceextension_name_length =
1536 tvb_get_ntohs(tvb, offset+local_offset+icecandidates_offset+icecandidate_offset+iceextensions_offset);
1537 iceextension_value_length =
1538 tvb_get_ntohs(tvb, offset+local_offset+icecandidates_offset+icecandidate_offset+iceextensions_offset+iceextension_name_length + 2);
1539 if ((iceextensions_offset + 4 + iceextension_name_length + iceextension_value_length) > iceextensions_length) {
1540 expert_add_info_format(pinfo, ti_extensions, &ei_reload_truncated_field, "Truncated extensions");
1541 break;
1543 ti_iceextension =
1544 proto_tree_add_item(extensions_tree, hf_reload_iceextension, tvb,
1545 offset+local_offset + icecandidates_offset + icecandidate_offset + iceextensions_offset, 4 + iceextension_name_length + iceextension_value_length, ENC_NA);
1546 iceextension_tree = proto_item_add_subtree(ti_iceextension, ett_reload_iceextension);
1547 dissect_opaque(tvb, pinfo, iceextension_tree, hf_reload_iceextension_name,offset+local_offset+ icecandidates_offset + icecandidate_offset + iceextensions_offset, 2, iceextension_name_length+2);
1548 dissect_opaque(tvb, pinfo, iceextension_tree, hf_reload_iceextension_value,offset+local_offset + icecandidates_offset + icecandidate_offset + iceextensions_offset +2 + iceextension_name_length, 2, iceextension_value_length+2);
1549 local_increment = 4 + iceextension_name_length + iceextension_value_length;
1550 if (local_increment <= 0) break;
1551 iceextensions_offset += local_increment;
1552 nExtensions++;
1554 proto_item_append_text(ti_extensions, ": %d elements", nExtensions);
1556 icecandidate_offset += iceextensions_length;
1557 if (icecandidate_offset <= 0) break;
1558 icecandidates_offset += icecandidate_offset;
1559 nCandidates++;
1561 proto_item_append_text(ti_icecandidates, ": %d elements", nCandidates);
1563 return (2 + icecandidates_length);
1566 static int
1567 dissect_attachreqans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1569 proto_item *ti_attachreqans;
1570 proto_tree *attachreqans_tree;
1571 uint8_t ufrag_length;
1572 uint8_t password_length;
1573 uint8_t role_length;
1574 uint16_t icecandidates_length;
1575 uint16_t local_offset = 0;
1577 /* variable length structures: must 1st compute the length ... */
1578 ufrag_length = tvb_get_uint8(tvb,offset+local_offset);
1579 local_offset += 1;
1580 if (local_offset + ufrag_length > length) {
1581 ti_attachreqans = proto_tree_add_item(tree, hf_reload_attachreqans, tvb, offset, length, ENC_NA);
1582 expert_add_info_format(pinfo, ti_attachreqans, &ei_reload_truncated_field, "Truncated attach_reqans");
1583 return length;
1585 local_offset += ufrag_length;
1586 password_length = tvb_get_uint8(tvb,offset+local_offset);
1587 local_offset += 1;
1588 if (local_offset + password_length > length) {
1589 ti_attachreqans = proto_tree_add_item(tree, hf_reload_attachreqans, tvb, offset, length, ENC_NA);
1590 expert_add_info_format(pinfo, ti_attachreqans, &ei_reload_truncated_field, "Truncated attach_reqans");
1591 return length;
1593 local_offset += password_length;
1594 role_length = tvb_get_uint8(tvb,offset+local_offset);
1595 local_offset += 1;
1596 if (local_offset + role_length > length) {
1597 ti_attachreqans = proto_tree_add_item(tree, hf_reload_attachreqans, tvb, offset, length, ENC_NA);
1598 expert_add_info_format(pinfo, ti_attachreqans, &ei_reload_truncated_field, "Truncated attach_reqans");
1599 return length;
1601 local_offset += role_length;
1602 icecandidates_length = tvb_get_ntohs(tvb, offset+local_offset);
1603 local_offset += 2;
1604 if (local_offset +icecandidates_length > length) {
1605 ti_attachreqans = proto_tree_add_item(tree, hf_reload_attachreqans, tvb, offset, length, ENC_NA);
1606 expert_add_info_format(pinfo, ti_attachreqans, &ei_reload_truncated_field, "Truncated attach_reqans");
1607 return length;
1609 local_offset += icecandidates_length;
1611 ti_attachreqans = proto_tree_add_item(tree, hf_reload_attachreqans, tvb, offset, local_offset, ENC_NA);
1612 attachreqans_tree = proto_item_add_subtree(ti_attachreqans, ett_reload_attachreqans);
1614 /* restart parsing, field by field */
1615 local_offset = 0;
1616 local_offset += dissect_opaque_string(tvb, pinfo,attachreqans_tree, hf_reload_ufrag,offset+local_offset, 1, -1);
1617 local_offset += dissect_opaque_string(tvb, pinfo,attachreqans_tree, hf_reload_password,offset+local_offset, 1, -1);
1618 local_offset += dissect_opaque_string(tvb, pinfo,attachreqans_tree, hf_reload_role,offset+local_offset, 1, -1);
1619 local_offset += dissect_icecandidates(tvb, pinfo, attachreqans_tree, offset + local_offset, 2+icecandidates_length);
1621 proto_tree_add_item(attachreqans_tree, hf_reload_sendupdate, tvb, offset+local_offset, 1, ENC_BIG_ENDIAN);
1622 local_offset += 1;
1624 return local_offset;
1628 static int
1629 dissect_sipregistration(tvbuff_t *tvb, packet_info *pinfo,proto_tree *tree, uint16_t offset, uint16_t length)
1631 proto_item *ti_local, *ti_sipregistrationdata;
1632 proto_tree *local_tree, *sipregistrationdata_tree;
1633 int local_offset = 0;
1634 uint16_t length_field;
1635 uint8_t type;
1637 ti_local = proto_tree_add_item(tree, hf_reload_sipregistration, tvb, offset, length, ENC_NA);
1638 local_tree = proto_item_add_subtree(ti_local, ett_reload_sipregistration);
1640 type = tvb_get_uint8(tvb, offset + local_offset);
1641 proto_tree_add_item(local_tree, hf_reload_sipregistration_type, tvb,offset+local_offset,1, ENC_BIG_ENDIAN);
1642 local_offset += 1;
1643 length_field = tvb_get_ntohs(tvb, offset+local_offset);
1644 proto_tree_add_item(local_tree, hf_reload_length_uint16, tvb,offset+local_offset,2, ENC_BIG_ENDIAN);
1645 local_offset += 2;
1646 if (length_field>0) {
1647 ti_sipregistrationdata = proto_tree_add_item(local_tree, hf_reload_sipregistration_data, tvb, offset, length_field, ENC_NA);
1648 sipregistrationdata_tree = proto_item_add_subtree(ti_sipregistrationdata, ett_reload_sipregistration_data);
1650 switch(type) {
1651 case SIPREGISTRATIONTYPE_URI:
1652 dissect_opaque_string(tvb,pinfo, sipregistrationdata_tree, hf_reload_sipregistration_data_uri, offset+local_offset, 2, length_field);
1653 break;
1655 case SIPREGISTRATIONTYPE_ROUTE:
1657 uint16_t route_offset = 0;
1658 uint16_t destinations_length;
1659 int numDestinations = 0;
1660 proto_item *ti_destination_list;
1661 proto_tree *destination_list_tree;
1662 route_offset += dissect_opaque_string(tvb,pinfo, sipregistrationdata_tree, hf_reload_sipregistration_data_contact_prefs, offset+local_offset, 2, length_field);
1663 destinations_length = tvb_get_ntohs(tvb, offset+local_offset+route_offset);
1664 ti_destination_list = proto_tree_add_item(sipregistrationdata_tree, hf_reload_sipregistration_data_destination_list, tvb,offset+local_offset+route_offset, length_field-route_offset, ENC_NA);
1665 destination_list_tree = proto_item_add_subtree(ti_destination_list, ett_reload_sipregistration_destination_list);
1666 proto_tree_add_item(destination_list_tree, hf_reload_length_uint16, tvb,offset+local_offset+route_offset, 2, ENC_BIG_ENDIAN);
1667 route_offset += 2;
1668 if (destinations_length>0) {
1669 dissect_destination_list(tvb, pinfo, destination_list_tree, offset+local_offset+route_offset,destinations_length, &numDestinations);
1671 proto_item_append_text(ti_destination_list, " (Destination<%d>): %d elements", destinations_length,numDestinations);
1673 break;
1676 local_offset += length_field;
1678 return local_offset;
1681 static int
1682 dissect_turnserver(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1684 proto_item *ti_local;
1685 proto_tree *local_tree;
1686 int local_offset = 0;
1688 ti_local = proto_tree_add_item(tree, hf_reload_turnserver, tvb, offset, length, ENC_NA);
1689 local_tree = proto_item_add_subtree(ti_local, ett_reload_turnserver);
1691 proto_tree_add_item(local_tree, hf_reload_turnserver_iteration, tvb,offset,1, ENC_BIG_ENDIAN);
1692 local_offset += 1;
1693 local_offset += dissect_ipaddressport(hf_reload_turnserver_server_address, tvb, pinfo, local_tree, offset+local_offset);
1695 return local_offset;
1698 static int dissect_redirserviceproviderdata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1700 proto_item *ti_local;
1701 proto_tree *local_tree;
1702 int local_offset = 0;
1704 ti_local = proto_tree_add_item(tree, hf_reload_redirserviceproviderdata, tvb, offset, length, ENC_NA);
1705 local_tree = proto_item_add_subtree(ti_local, ett_reload_redirserviceproviderdata);
1707 local_offset += dissect_nodeid(hf_reload_redirserviceproviderdata_serviceprovider, tvb, pinfo, local_tree, offset+local_offset, length);
1708 local_offset += dissect_opaque_string(tvb, pinfo, local_tree, hf_reload_redirserviceproviderdata_namespace, offset+local_offset, 2, length-local_offset);
1709 proto_tree_add_item(local_tree, hf_reload_redirserviceproviderdata_level, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
1710 local_offset += 2;
1711 proto_tree_add_item(local_tree, hf_reload_redirserviceproviderdata_node, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
1713 return length;
1716 static int dissect_redirserviceprovider(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1718 proto_item *ti_local;
1719 proto_tree *local_tree;
1720 int local_offset = 0;
1721 uint16_t length_field;
1723 length_field = tvb_get_ntohs(tvb, offset);
1725 if (2+length_field>length) {
1726 ti_local = proto_tree_add_item(tree, hf_reload_redirserviceprovider, tvb, offset, length, ENC_NA);
1727 expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated RedirServiceProvider");
1728 return length;
1731 ti_local = proto_tree_add_item(tree, hf_reload_redirserviceprovider, tvb, offset, length_field+2, ENC_NA);
1732 local_tree = proto_item_add_subtree(ti_local, ett_reload_redirserviceprovider);
1734 proto_tree_add_item(local_tree, hf_reload_length_uint16, tvb, offset,2, ENC_BIG_ENDIAN);
1735 local_offset += 2;
1737 dissect_redirserviceproviderdata(tvb, pinfo, local_tree, offset+local_offset, length_field);
1739 return (2+length_field);
1742 static int dissect_datavalue(int anchor, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length, bool meta, kind_t *kind) {
1743 proto_item *ti_datavalue;
1744 proto_tree *datavalue_tree;
1746 if (meta != true) {
1747 unsigned value_length = tvb_get_ntohl(tvb,offset+1);
1748 int hf = hf_reload_datavalue;
1750 if (anchor >= 0) {
1751 hf = anchor;
1754 if (1+4+value_length > length) {
1755 ti_datavalue = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1756 expert_add_info_format(pinfo, ti_datavalue, &ei_reload_truncated_field, "Truncated DataValue");
1757 return length;
1760 ti_datavalue = proto_tree_add_item(tree, hf, tvb, offset,1+4+value_length, ENC_NA);
1761 datavalue_tree = proto_item_add_subtree(ti_datavalue,ett_reload_datavalue);
1762 proto_tree_add_item(datavalue_tree, hf_reload_datavalue_exists, tvb, offset, 1, ENC_BIG_ENDIAN);
1763 if (kind != NULL) {
1764 switch(kind->id) {
1766 case DATAKINDID_TURNSERVICE:
1768 uint32_t length_field = tvb_get_ntohl(tvb, offset+1);
1769 proto_tree_add_item(datavalue_tree, hf_reload_length_uint32, tvb, offset+1,4, ENC_BIG_ENDIAN);
1770 if (length_field>0) {
1771 dissect_turnserver(tvb, pinfo, datavalue_tree, offset+1+4, length_field);
1774 break;
1776 case DATAKINDID_SIP_REGISTRATION:
1778 uint32_t length_field = tvb_get_ntohl(tvb, offset+1);
1779 proto_tree_add_item(datavalue_tree, hf_reload_length_uint32, tvb, offset+1,4, ENC_BIG_ENDIAN);
1780 if (length_field>0) {
1781 dissect_sipregistration(tvb, pinfo, datavalue_tree, offset+1+4, length_field);
1784 break;
1786 case DATAKINDID_CERTIFICATE_BY_NODE:
1787 case DATAKINDID_CERTIFICATE_BY_USER:
1789 uint32_t length_field = tvb_get_ntohl(tvb, offset+1);
1790 proto_tree_add_item(datavalue_tree, hf_reload_length_uint32, tvb, offset+1,4, ENC_BIG_ENDIAN);
1791 if (length_field>0) {
1792 asn1_ctx_t asn1_ctx;
1794 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1795 dissect_x509af_Certificate(false, tvb, offset + 1 + 4, &asn1_ctx,
1796 datavalue_tree, hf_reload_certificate);
1799 break;
1801 case DATAKINDID_REDIR:
1803 uint32_t length_field = tvb_get_ntohl(tvb, offset+1);
1804 proto_tree_add_item(datavalue_tree, hf_reload_length_uint32, tvb, offset+1,4, ENC_BIG_ENDIAN);
1805 if (length_field>0) {
1806 dissect_redirserviceprovider(tvb, pinfo, datavalue_tree, offset+1+4, length_field);
1809 break;
1811 default:
1812 dissect_opaque(tvb, pinfo, datavalue_tree, hf_reload_datavalue_value, offset +1, 4, length-1);
1813 break;
1816 else {
1817 dissect_opaque(tvb, pinfo, datavalue_tree, hf_reload_datavalue_value, offset +1, 4, length-1);
1819 if (hf == anchor) {
1820 proto_item_append_text(ti_datavalue, " (DataValue)");
1822 return (1+4+value_length);
1824 else {
1825 /* meta data */
1826 unsigned hash_length = tvb_get_uint8(tvb, offset +1+4+1);
1827 int hf = hf_reload_metadata;
1829 if (anchor >= 0) {
1830 hf = anchor;
1834 if (1+4+1+1+hash_length > length) {
1835 ti_datavalue = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1836 expert_add_info_format(pinfo, ti_datavalue, &ei_reload_truncated_field, "Truncated MetaData");
1837 return length;
1840 ti_datavalue = proto_tree_add_item(tree, hf, tvb, offset,1+4+1+1+hash_length, ENC_NA);
1841 datavalue_tree = proto_item_add_subtree(ti_datavalue,ett_reload_datavalue);
1842 proto_tree_add_item(datavalue_tree, hf_reload_datavalue_exists, tvb, offset, 1, ENC_BIG_ENDIAN);
1843 proto_tree_add_item(datavalue_tree, hf_reload_metadata_value_length, tvb, offset+1, 4, ENC_BIG_ENDIAN);
1844 proto_tree_add_item(datavalue_tree, hf_reload_hash_algorithm, tvb, offset+1+4, 1, ENC_BIG_ENDIAN);
1845 dissect_opaque(tvb, pinfo, datavalue_tree, hf_reload_metadata_hash_value, offset +1+4+1, 1, length-1-4-1);
1847 if (hf == anchor) {
1848 proto_item_append_text(ti_datavalue, " (MetaData)");
1851 return (1+4+1+hash_length);
1853 return 0;
1856 static unsigned getDataValueLength(tvbuff_t *tvb, uint16_t offset, bool meta) {
1857 if (meta != true) {
1858 unsigned value_length = tvb_get_ntohl(tvb,offset+1);
1859 return (1+4+value_length);
1861 else {
1862 unsigned hash_length = tvb_get_uint8(tvb, offset +1+4+1);
1863 return (1+4+1+1+hash_length);
1865 return 0;
1868 static int dissect_arrayentry(int anchor, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length, bool meta, kind_t *kind) {
1869 proto_item *ti_arrayentry, *ti_index;
1870 proto_tree *arrayentry_tree;
1871 int data_length = getDataValueLength(tvb, offset+4, meta);
1872 int hf = hf_reload_arrayentry;
1874 if (anchor >= 0) {
1875 hf = anchor;
1878 if (4+data_length > length) {
1879 ti_arrayentry = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1880 expert_add_info_format(pinfo, ti_arrayentry, &ei_reload_truncated_field, "Truncated ArrayEntry");
1881 return length;
1884 ti_arrayentry = proto_tree_add_item(tree, hf, tvb, offset,4+data_length, ENC_NA);
1885 arrayentry_tree = proto_item_add_subtree(ti_arrayentry,ett_reload_arrayentry);
1886 ti_index = proto_tree_add_item(arrayentry_tree, hf_reload_arrayentry_index, tvb, offset, 4, ENC_BIG_ENDIAN);
1887 if (0xffffffff == (uint32_t) tvb_get_ntohl(tvb, offset)) {
1888 proto_item_append_text(ti_index, "(append)");
1890 dissect_datavalue(hf_reload_arrayentry_value,tvb, pinfo, arrayentry_tree, offset+4, length-4, meta, kind);
1892 if (hf == anchor) {
1893 proto_item_append_text(ti_arrayentry, " (ArrayEntry)");
1896 return (4+data_length);
1899 static int dissect_dictionaryentry(int anchor, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length, bool meta, kind_t *kind) {
1900 proto_item *ti_dictionaryentry;
1901 proto_tree *dictionaryentry_tree;
1902 int local_offset = 0;
1903 uint16_t key_length = 0;
1904 int hf = hf_reload_dictionaryentry;
1906 if (anchor >= 0) {
1907 hf = anchor;
1910 if (length < 2) {
1911 ti_dictionaryentry = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1912 expert_add_info_format(pinfo, ti_dictionaryentry, &ei_reload_truncated_field, "Truncated ArrayEntry");
1913 return length;
1915 key_length = tvb_get_ntohs(tvb,offset);
1918 if (length < (key_length +2)) {
1919 ti_dictionaryentry = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1920 expert_add_info_format(pinfo, ti_dictionaryentry, &ei_reload_truncated_field, "Truncated ArrayEntry");
1921 return length;
1925 int data_length = getDataValueLength(tvb, offset+2+key_length, meta);
1926 if (length < (key_length+2+data_length)) {
1927 ti_dictionaryentry = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1929 else {
1930 ti_dictionaryentry = proto_tree_add_item(tree, hf, tvb, offset, 2+key_length+1+4+data_length, ENC_NA);
1935 dictionaryentry_tree = proto_item_add_subtree(ti_dictionaryentry,ett_reload_dictionaryentry);
1937 if (hf == anchor) {
1938 proto_item_append_text(ti_dictionaryentry, " (DictionaryEntry)");
1941 if (kind != NULL) {
1942 switch(kind->id) {
1943 case DATAKINDID_SIP_REGISTRATION:
1944 case DATAKINDID_REDIR:
1946 proto_item *ti_key;
1947 proto_tree *key_tree;
1948 ti_key = proto_tree_add_item(dictionaryentry_tree, hf_reload_dictionarykey, tvb, offset, 2+key_length, ENC_NA);
1949 key_tree = proto_item_add_subtree(ti_key,ett_reload_dictionaryentry_key);
1950 proto_tree_add_item(key_tree, hf_reload_length_uint16, tvb, offset, 2, ENC_BIG_ENDIAN);
1951 local_offset += 2;
1952 local_offset+= dissect_nodeid(-1, tvb, pinfo, key_tree, offset+2, key_length);
1954 break;
1956 default:
1957 local_offset += dissect_opaque(tvb, pinfo, dictionaryentry_tree, hf_reload_dictionarykey, offset, 2, length);
1958 break;
1961 else {
1962 local_offset +=
1963 dissect_opaque(tvb, pinfo, dictionaryentry_tree, hf_reload_dictionarykey, offset, 2, length);
1966 local_offset += dissect_datavalue(hf_reload_dictionary_value,tvb, pinfo, dictionaryentry_tree, offset+local_offset, length-local_offset, meta, kind);
1968 return (local_offset);
1971 static int
1972 dissect_signature(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset)
1974 int local_offset = 0;
1975 proto_item *ti_signature;
1976 proto_tree *signature_tree;
1977 uint16_t signeridentityvalue_length;
1978 uint16_t signaturevalue_length;
1981 signeridentityvalue_length = tvb_get_ntohs(tvb, offset +2+1);
1982 signaturevalue_length = tvb_get_ntohs(tvb, offset + 2 + 1 + 2+ signeridentityvalue_length);
1983 ti_signature = proto_tree_add_item(tree,
1984 hf_reload_signature, tvb, offset,
1985 2 +/* SignatureAndHashAlgorithm */
1986 1 + 2 + signeridentityvalue_length +/* SignatureIdentity length */
1987 2 + signaturevalue_length,
1988 ENC_NA);
1990 signature_tree = proto_item_add_subtree(ti_signature, ett_reload_signature);
1993 proto_item *ti_signatureandhashalgorithm;
1994 proto_tree *signatureandhashalgorithm_tree;
1995 ti_signatureandhashalgorithm = proto_tree_add_item(signature_tree, hf_reload_signatureandhashalgorithm, tvb, offset, 2, ENC_NA);
1996 signatureandhashalgorithm_tree = proto_item_add_subtree( ti_signatureandhashalgorithm, ett_reload_signatureandhashalgorithm);
1997 proto_tree_add_item(signatureandhashalgorithm_tree, hf_reload_hash_algorithm, tvb, offset, 1, ENC_BIG_ENDIAN);
1998 local_offset += 1;
1999 proto_tree_add_item(signatureandhashalgorithm_tree, hf_reload_signature_algorithm, tvb, offset + local_offset, 1, ENC_BIG_ENDIAN);
2000 local_offset += 1;
2002 /* Signeridentity */
2004 proto_item *ti_signeridentity;
2005 proto_tree *signeridentity_tree;
2006 uint8_t identity_type;
2007 ti_signeridentity = proto_tree_add_item(signature_tree,
2008 hf_reload_signeridentity,
2009 tvb, offset+local_offset,
2010 1 + 2 + signeridentityvalue_length,
2011 ENC_NA);
2012 signeridentity_tree = proto_item_add_subtree(ti_signeridentity, ett_reload_signeridentity);
2013 identity_type = tvb_get_uint8(tvb, offset + local_offset);
2014 proto_tree_add_item(signeridentity_tree, hf_reload_signeridentity_type, tvb,
2015 offset + local_offset, 1, ENC_BIG_ENDIAN);
2016 local_offset += 1;
2017 proto_tree_add_uint(signeridentity_tree, hf_reload_length_uint16, tvb,
2018 offset + local_offset, 2, signeridentityvalue_length);
2019 local_offset += 2;
2021 proto_item *ti_signeridentity_identity;
2022 proto_tree * signeridentity_identity_tree;
2023 ti_signeridentity_identity = proto_tree_add_item(signeridentity_tree,
2024 hf_reload_signeridentity_identity,
2025 tvb, offset+local_offset,
2026 signeridentityvalue_length,
2027 ENC_NA);
2028 signeridentity_identity_tree = proto_item_add_subtree(ti_signeridentity_identity, ett_reload_signeridentity_identity);
2029 proto_item_append_text(ti_signeridentity_identity, " (SignerIdentityValue[%d])",signeridentityvalue_length);
2031 proto_item *ti_signeridentityvalue;
2032 proto_tree *signeridentityvalue_tree;
2033 if (identity_type == SIGNERIDENTITYTYPE_CERTHASH || identity_type == SIGNERIDENTITYTYPE_CERTHASHNODEID) {
2034 uint8_t certificate_hash_length;
2036 certificate_hash_length = tvb_get_uint8(tvb, offset + local_offset + 1);
2037 if (1 + 1 + certificate_hash_length > signeridentityvalue_length) {
2038 expert_add_info_format(pinfo, ti_signeridentity, &ei_reload_truncated_field, "Truncated signature identity value");
2040 else {
2041 ti_signeridentityvalue= proto_tree_add_item(signeridentity_identity_tree,
2042 hf_reload_signeridentity_value,
2043 tvb, offset + local_offset,
2044 1 + 1 + certificate_hash_length,
2045 ENC_NA);
2046 signeridentityvalue_tree = proto_item_add_subtree(ti_signeridentityvalue, ett_reload_signeridentity_value);
2047 proto_tree_add_item(signeridentityvalue_tree, hf_reload_signeridentity_value_hash_alg, tvb,
2048 offset + local_offset, 1, ENC_BIG_ENDIAN);
2049 dissect_opaque(tvb, pinfo, signeridentityvalue_tree,
2050 (identity_type == SIGNERIDENTITYTYPE_CERTHASH) ?
2051 hf_reload_signeridentity_value_certificate_hash:
2052 hf_reload_signeridentity_value_certificate_node_id_hash,
2053 offset + local_offset +1, 1, -1);
2056 else {
2057 expert_add_info(pinfo, signeridentity_identity_tree, &ei_reload_identity_type_unknown);
2061 local_offset += signeridentityvalue_length;
2063 local_offset += dissect_opaque(tvb, pinfo, signature_tree, hf_reload_signature_value, offset + local_offset, 2, -1);
2065 return local_offset;
2070 static int
2071 dissect_storeddata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length, kind_t *kind, bool meta)
2073 proto_item *ti_storeddata;
2074 proto_tree *storeddata_tree;
2075 uint32_t storeddata_length;
2076 uint32_t local_offset;
2078 int hf = hf_reload_storeddata;
2080 if (meta == true) {
2081 hf = hf_reload_storedmetadata;
2084 storeddata_length = tvb_get_ntohl(tvb, offset);
2086 if (storeddata_length + 4 > length) {
2087 ti_storeddata = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
2088 expert_add_info_format(pinfo, ti_storeddata, &ei_reload_truncated_field, "Truncated StoredData");
2089 return length;
2092 local_offset = 0;
2093 ti_storeddata = proto_tree_add_item(tree, hf, tvb, offset, 4 + storeddata_length, ENC_NA);
2094 storeddata_tree = proto_item_add_subtree(ti_storeddata, ett_reload_storeddata);
2096 proto_tree_add_uint(storeddata_tree, hf_reload_length_uint32, tvb, offset, 4, storeddata_length);
2097 local_offset += 4;
2099 uint64_t storage_time;
2100 uint32_t remaining_ms;
2101 time_t storage_time_sec;
2102 nstime_t l_nsTime;
2104 storage_time = tvb_get_ntoh64(tvb, offset+local_offset);
2105 storage_time_sec = (time_t)(storage_time/1000);
2106 remaining_ms = (uint32_t) (storage_time % 1000);
2108 l_nsTime.secs = storage_time_sec;
2109 l_nsTime.nsecs = remaining_ms*1000*1000;
2111 proto_tree_add_time(storeddata_tree, hf_reload_storeddata_storage_time, tvb, offset + local_offset, 8, &l_nsTime);
2113 local_offset += 8;
2114 proto_tree_add_item(storeddata_tree, hf_reload_storeddata_lifetime, tvb, offset + local_offset, 4, ENC_BIG_ENDIAN);
2115 local_offset += 4;
2116 if ((NULL != kind) && (kind->id != DATAKINDID_INVALID)) {
2117 switch(kind->data_model) {
2118 case DATAMODEL_SINGLE:
2119 local_offset += dissect_datavalue(hf_reload_value,tvb, pinfo, storeddata_tree, offset+local_offset, (storeddata_length-local_offset+4), meta, kind);
2120 break;
2121 case DATAMODEL_ARRAY:
2122 local_offset += dissect_arrayentry(hf_reload_value,tvb, pinfo, storeddata_tree, offset+local_offset, (storeddata_length-local_offset+4), meta, kind);
2123 break;
2124 case DATAMODEL_DICTIONARY:
2125 local_offset += dissect_dictionaryentry(hf_reload_value,tvb, pinfo, storeddata_tree, offset+local_offset, (storeddata_length-local_offset+4), meta, kind);
2126 break;
2127 default:
2128 expert_add_info(pinfo, ti_storeddata, &ei_reload_unknown_data_model);
2129 return (storeddata_length + 4);
2131 if (true != meta) {
2132 dissect_signature(tvb, pinfo, storeddata_tree, offset +local_offset);
2135 return (storeddata_length + 4);
2140 static int
2141 dissect_kindid(int anchor, tvbuff_t *tvb, proto_tree *tree, uint16_t offset, kind_t **kind)
2143 proto_item *ti_kindid;
2144 uint32_t kindid = 0;
2145 int hf = hf_reload_kindid;
2147 if (anchor >= 0) {
2148 hf = anchor;
2151 *kind = NULL;
2153 kindid = tvb_get_ntohl(tvb, offset);
2154 *kind = getKindFromId(kindid);
2155 ti_kindid = proto_tree_add_item(tree, hf, tvb, offset, 4, ENC_BIG_ENDIAN);
2156 if ((NULL != (*kind)) && ((*kind)->name != NULL)) {
2157 proto_item_append_text(ti_kindid, " (%s)", (*kind)->name);
2160 return 4;
2163 static int
2164 dissect_kinddata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length, bool meta)
2166 proto_item *ti_kinddata;
2167 proto_item *kinddata_tree;
2168 uint32_t values_length;
2169 uint32_t local_offset = 0;
2170 kind_t *kind;
2171 int hf = hf_reload_kinddata;
2172 int nValues = 0;
2174 if (meta) {
2175 hf = hf_reload_statkindresponse;
2178 values_length = tvb_get_ntohl(tvb, offset + 4 + 8);
2179 if (12 + values_length > length) {
2180 ti_kinddata = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
2181 expert_add_info_format(pinfo, ti_kinddata, &ei_reload_truncated_field, "Truncated kind data");
2182 return length;
2184 ti_kinddata = proto_tree_add_item(tree, hf, tvb, offset, 16+values_length, ENC_NA);
2185 kinddata_tree = proto_item_add_subtree(ti_kinddata, ett_reload_kinddata);
2187 local_offset += dissect_kindid(hf_reload_kinddata_kind,tvb, kinddata_tree, offset+local_offset, &kind);
2189 proto_tree_add_item(kinddata_tree, hf_reload_generation_counter, tvb, offset+local_offset, 8, ENC_BIG_ENDIAN);
2190 local_offset += 8;
2192 int32_t values_offset = 0;
2193 uint32_t values_increment;
2194 proto_item *ti_values;
2195 proto_tree *values_tree;
2197 ti_values = proto_tree_add_item(kinddata_tree, hf_reload_values, tvb, offset+local_offset, 4+values_length, ENC_NA);
2198 values_tree = proto_item_add_subtree(ti_values, ett_reload_values);
2199 if (meta) {
2200 proto_item_append_text(ti_values, " (StoredMetaData<%d>)", values_length);
2201 } else {
2202 proto_item_append_text(ti_values, " (StoredData<%d>)", values_length);
2205 proto_tree_add_uint(values_tree, hf_reload_length_uint32, tvb, offset +local_offset, 4, values_length);
2206 local_offset += 4;
2208 while (values_offset >= 0 && (uint32_t)values_offset < values_length) {
2209 values_increment = dissect_storeddata(tvb, pinfo, values_tree, offset+local_offset+values_offset, values_length - values_offset, kind, meta);
2210 if (values_increment == 0) {
2211 break;
2213 nValues++;
2214 values_offset += values_increment;
2216 proto_item_append_text(ti_values, ": %d elements", nValues);
2219 local_offset += values_length;
2220 return local_offset;
2223 static int dissect_nodeid_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length, int hf)
2225 uint16_t list_length;
2226 uint16_t local_offset = 0;
2227 int32_t list_offset = 0;
2228 uint16_t list_increment = 0;
2229 int nNodeIds = 0;
2230 proto_item *ti_local;
2231 proto_tree *local_tree;
2233 list_length= (uint16_t) tvb_get_ntohs(tvb, offset);
2235 if (list_length+2>length) {
2236 ti_local = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
2237 expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated NodeId list");
2239 ti_local = proto_tree_add_item(tree, hf, tvb, offset, list_length+2, ENC_NA);
2240 proto_item_append_text(ti_local, " (NodeId<%d>)", list_length);
2242 local_tree = proto_item_add_subtree(ti_local, ett_reload_nodeid_list);
2244 local_offset += dissect_length(tvb, local_tree, offset, 2);
2245 while (list_offset >= 0 && list_offset < list_length) {
2246 dissect_nodeid(-1, tvb, pinfo, local_tree, offset+local_offset+list_offset,list_length-list_offset);
2247 list_increment = reload_nodeid_length;
2248 if (list_increment <= 0) break;
2249 list_offset += list_increment;
2250 nNodeIds++;
2252 proto_item_append_text(ti_local, ":%d elements", nNodeIds);
2254 return (list_length+2);
2258 static int
2259 dissect_storekindresponse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2261 proto_item *ti_local;
2262 proto_tree *local_tree;
2263 uint16_t local_offset = 0;
2264 uint16_t local_length = 0;
2265 uint16_t replicas_length;
2266 kind_t *kind;
2268 replicas_length = tvb_get_ntohs(tvb, offset+4+8);
2269 local_length = 4+8+2+replicas_length;
2271 if (length < local_length) {
2272 ti_local = proto_tree_add_item(tree, hf_reload_storekindresponse, tvb, offset, length, ENC_NA);
2273 expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated StoreKindResponse");
2274 return length;
2276 ti_local = proto_tree_add_item(tree, hf_reload_storekindresponse, tvb, offset, 4+8+2+replicas_length, ENC_NA);
2277 local_tree = proto_item_add_subtree(ti_local, ett_reload_storekindresponse);
2279 local_offset += dissect_kindid(hf_reload_kinddata_kind,tvb, local_tree, offset+local_offset, &kind);
2280 proto_tree_add_item(local_tree, hf_reload_generation_counter, tvb, offset+local_offset, 8, ENC_BIG_ENDIAN);
2281 local_offset += 8;
2282 local_offset += dissect_nodeid_list(tvb, pinfo, local_tree, offset+local_offset, local_length-local_offset, hf_reload_replicas);
2284 return local_offset;
2287 static int
2288 dissect_storeans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2290 proto_item *ti_local, *ti_kind_responses;
2291 proto_tree *local_tree, *kind_responses_tree;
2292 uint16_t local_offset = 0;
2293 uint16_t kind_responses_length;
2294 int32_t kind_responses_offset = 0;
2295 int nKindResponses = 0;
2297 ti_local = proto_tree_add_item(tree, hf_reload_storeans, tvb, offset, length, ENC_NA);
2298 local_tree = proto_item_add_subtree(ti_local, ett_reload_storeans);
2299 kind_responses_length = tvb_get_ntohs(tvb, offset);
2300 ti_kind_responses = proto_tree_add_item(local_tree, hf_reload_storeans_kind_responses, tvb, offset, 2+kind_responses_length, ENC_NA);
2301 kind_responses_tree = proto_item_add_subtree(ti_kind_responses, ett_reload_storeans_kind_responses);
2302 proto_item_append_text(ti_kind_responses, " (StoreKindResponse<%d>)", kind_responses_length);
2304 proto_tree_add_item(kind_responses_tree, hf_reload_length_uint16, tvb, offset, 2, ENC_BIG_ENDIAN);
2305 local_offset += 2;
2306 while (kind_responses_offset >=0 && kind_responses_offset < kind_responses_length) {
2307 int local_increment = dissect_storekindresponse(tvb, pinfo, kind_responses_tree, offset+local_offset+kind_responses_offset, kind_responses_length-kind_responses_offset);
2308 if (local_increment <= 0) break;
2309 kind_responses_offset += local_increment;
2310 nKindResponses++;
2312 local_offset += kind_responses_length;
2313 proto_item_append_text(ti_kind_responses, ": %d elements", nKindResponses);
2315 return local_offset;
2318 static int
2319 dissect_storereq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2321 proto_item *ti_storereq;
2322 proto_tree *storereq_tree;
2323 uint32_t local_offset = 0;
2324 uint32_t kind_data_length;
2327 local_offset += tvb_get_uint8(tvb, offset) + 1; /* resource id length */
2328 if (local_offset > length) {
2329 ti_storereq = proto_tree_add_item(tree, hf_reload_storereq, tvb, offset, length, ENC_NA);
2330 expert_add_info_format(pinfo, ti_storereq, &ei_reload_truncated_field, "Truncated StoreReq: resource too long");
2331 return length;
2334 local_offset += 1; /* replica_num */
2335 if (local_offset > length) {
2336 ti_storereq = proto_tree_add_item(tree, hf_reload_storereq, tvb, offset, length, ENC_NA);
2337 expert_add_info_format(pinfo, ti_storereq, &ei_reload_truncated_field, "Truncated StoreReq: no room for replica_number");
2338 return length;
2341 kind_data_length = tvb_get_ntohl(tvb, offset + local_offset);
2342 local_offset += 4;
2343 if (local_offset + kind_data_length > length) {
2344 ti_storereq = proto_tree_add_item(tree, hf_reload_storereq, tvb, offset, length, ENC_NA);
2345 expert_add_info_format(pinfo, ti_storereq, &ei_reload_truncated_field, "Truncated StoreReq: kind_data too long");
2346 return length;
2348 local_offset += kind_data_length;
2350 ti_storereq = proto_tree_add_item(tree, hf_reload_storereq, tvb, offset, local_offset, ENC_NA);
2351 storereq_tree = proto_item_add_subtree(ti_storereq, ett_reload_storereq);
2353 /* Parse from start */
2354 local_offset = 0;
2355 local_offset += dissect_resourceid(hf_reload_resource, tvb, pinfo, storereq_tree, offset+local_offset, length);
2357 proto_tree_add_item(storereq_tree, hf_reload_store_replica_num, tvb, offset + local_offset, 1, ENC_BIG_ENDIAN);
2358 local_offset += 1;
2362 int32_t kind_data_offset = 0;
2363 uint32_t kind_data_increment;
2364 proto_item *ti_kind_data;
2365 proto_tree *kind_data_tree;
2366 int nKindDatas = 0;
2368 ti_kind_data = proto_tree_add_item(storereq_tree, hf_reload_store_kind_data, tvb, offset+local_offset,4+kind_data_length, ENC_NA);
2369 proto_item_append_text(ti_kind_data, " (StoreKindData<%d>)", kind_data_length);
2370 kind_data_tree = proto_item_add_subtree(ti_kind_data, ett_reload_store_kind_data);
2371 proto_tree_add_item(kind_data_tree, hf_reload_length_uint32, tvb, offset + local_offset, 4, ENC_BIG_ENDIAN);
2372 local_offset += 4;
2374 while (kind_data_offset >= 0 && (uint32_t)kind_data_offset < kind_data_length) {
2375 kind_data_increment = dissect_kinddata(tvb, pinfo, kind_data_tree, offset+local_offset+kind_data_offset, kind_data_length - kind_data_offset, false);
2376 if (kind_data_increment == 0) {
2377 break;
2379 nKindDatas++;
2380 kind_data_offset += kind_data_increment;
2383 proto_item_append_text(ti_kind_data, ": %d elements", nKindDatas);
2385 local_offset += kind_data_length;
2387 return local_offset;
2390 static int dissect_arrayrange(tvbuff_t *tvb, proto_tree *tree, uint16_t offset) {
2391 proto_item *ti;
2392 int32_t first;
2393 int32_t last;
2395 ti = proto_tree_add_item(tree, hf_reload_arrayrange, tvb, offset, (16), ENC_NA);
2396 first = tvb_get_ntohl(tvb, offset);
2397 last = tvb_get_ntohl(tvb, offset+4);
2399 proto_item_append_text(ti, " [%d-", first);
2400 if ((uint32_t)last != 0xFFFFFFFF) {
2401 proto_item_append_text(ti, "%d]", last);
2403 else {
2404 proto_item_append_text(ti, "end]");
2406 return 8;
2409 static int
2410 dissect_storeddataspecifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2412 uint16_t length_field, local_offset = 0;
2413 proto_item *ti_storeddataspecifier;
2414 proto_tree *storeddataspecifier_tree;
2415 kind_t *kind = NULL;
2417 length_field = tvb_get_ntohs(tvb, offset+4+8);
2418 if ((length_field + 4 + 8 + 2) > length) {
2419 ti_storeddataspecifier = proto_tree_add_item(tree, hf_reload_storeddataspecifier, tvb, offset, length, ENC_NA);
2420 expert_add_info_format(pinfo, ti_storeddataspecifier, &ei_reload_truncated_field, "Truncated StoredDataSpecifier");
2421 return length;
2424 ti_storeddataspecifier = proto_tree_add_item(tree, hf_reload_storeddataspecifier, tvb, offset, (length_field + 4 + 8 +2), ENC_NA);
2425 storeddataspecifier_tree = proto_item_add_subtree(ti_storeddataspecifier, ett_reload_storeddataspecifier);
2427 local_offset += dissect_kindid(hf_reload_kinddata_kind,tvb,storeddataspecifier_tree, offset, &kind);
2428 proto_tree_add_item(storeddataspecifier_tree, hf_reload_generation_counter, tvb, offset+local_offset, 8, ENC_BIG_ENDIAN);
2429 local_offset += 8;
2430 proto_tree_add_item(storeddataspecifier_tree, hf_reload_length_uint16, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
2431 local_offset += 2;
2433 if ((kind != NULL) && (kind->id != DATAKINDID_INVALID)) {
2434 switch(kind->data_model) {
2435 case DATAMODEL_ARRAY:
2437 proto_item *ti_indices;
2438 proto_tree *indices_tree;
2439 int32_t indices_offset = 0;
2440 uint16_t indices_length = tvb_get_ntohs(tvb, offset+local_offset);
2441 int nIndices = 0;
2442 ti_indices = proto_tree_add_item(storeddataspecifier_tree, hf_reload_storeddataspecifier_indices,
2443 tvb, offset+local_offset, 2+indices_length, ENC_NA);
2444 proto_item_append_text(ti_indices, " (ArrayRange<%d>)", indices_length);
2445 indices_tree = proto_item_add_subtree(ti_indices, ett_reload_storeddataspecifier_indices);
2446 proto_tree_add_item(indices_tree, hf_reload_length_uint16, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
2447 local_offset += 2;
2448 while (indices_offset >= 0 && indices_offset < indices_length) {
2449 indices_offset += dissect_arrayrange(tvb, indices_tree, offset + local_offset + indices_offset);
2450 nIndices++;
2452 proto_item_append_text(ti_indices, ": %d elements", nIndices);
2454 break;
2456 case DATAMODEL_DICTIONARY:
2458 proto_item *ti_keys;
2459 proto_tree *keys_tree;
2460 int32_t keys_offset = 0;
2461 uint16_t keys_length = tvb_get_ntohs(tvb, offset+local_offset);
2462 int nKeys = 0;
2463 ti_keys = proto_tree_add_item(tree, hf_reload_storeddataspecifier_keys, tvb, offset+local_offset, 2+keys_length, ENC_NA);
2464 keys_tree = proto_item_add_subtree(ti_keys, ett_reload_storeddataspecifier_keys);
2465 while (keys_offset >= 0 && keys_offset < keys_length) {
2466 uint32_t local_increment;
2467 local_increment = dissect_opaque(tvb, pinfo, keys_tree, hf_reload_dictionarykey, offset, 2, keys_length-keys_offset);
2468 if (local_increment == 0) break;
2469 keys_offset += local_increment;
2470 nKeys++;
2472 proto_item_append_text(ti_keys, "(%d keys)", nKeys);
2475 break;
2477 default:
2478 break;
2481 return (length_field + 4 + 8 +2);
2485 static int
2486 dissect_fetchreq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length, bool meta)
2488 proto_item *ti_fetchreq;
2489 proto_item *ti_specifiers;
2490 proto_tree *fetchreq_tree;
2491 proto_tree *specifiers_tree;
2492 uint16_t resourceid_length;
2493 uint16_t specifiers_length;
2494 int32_t specifiers_offset = 0;
2495 int nSpecifiers = 0;
2496 uint16_t local_offset = 0;
2497 uint16_t local_length = 0;
2498 int hf = hf_reload_fetchreq;
2500 if (meta == true) {
2501 hf = hf_reload_statreq;
2504 resourceid_length = tvb_get_uint8(tvb,offset);
2505 specifiers_length = tvb_get_ntohs(tvb, offset+1+resourceid_length);
2507 if (1+ resourceid_length+ 2 + specifiers_length > length) {
2508 ti_fetchreq = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
2509 expert_add_info_format(pinfo, ti_fetchreq, &ei_reload_truncated_field, "Truncated FetchReq");
2510 return length;
2512 local_length = 1+ resourceid_length+ 2 + specifiers_length;
2513 ti_fetchreq = proto_tree_add_item(tree, hf, tvb, offset, local_length, ENC_NA);
2514 fetchreq_tree = proto_item_add_subtree(ti_fetchreq, ett_reload_fetchreq);
2516 local_offset +=
2517 dissect_resourceid(hf_reload_resource, tvb, pinfo, fetchreq_tree, offset, local_length);
2519 ti_specifiers = proto_tree_add_item(fetchreq_tree, hf_reload_fetchreq_specifiers, tvb, offset+local_offset, 2+specifiers_length, ENC_NA);
2520 specifiers_tree = proto_item_add_subtree(ti_specifiers, ett_reload_fetchreq_specifiers);
2521 proto_item_append_text(ti_specifiers, "(StoredDataSpecifier<%d>)", specifiers_length);
2522 proto_tree_add_item(specifiers_tree, hf_reload_length_uint16, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
2523 local_offset += 2;
2525 while (specifiers_offset >= 0 && specifiers_offset < specifiers_length) {
2526 uint32_t specifiers_increment;
2527 specifiers_increment = dissect_storeddataspecifier(tvb, pinfo, specifiers_tree, offset+local_offset+specifiers_offset, specifiers_length-specifiers_offset);
2528 if (specifiers_increment == 0) {
2529 break;
2531 nSpecifiers++;
2532 specifiers_offset += specifiers_increment;
2534 proto_item_append_text(ti_specifiers, ": %d elements", nSpecifiers);
2536 return (1+ resourceid_length+ 2 + specifiers_length);
2540 static int
2541 dissect_fetchans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2543 proto_item *ti_fetchans;
2544 proto_tree *fetchans_tree;
2545 uint32_t kind_responses_length;
2546 uint32_t kind_responses_offset = 0;
2548 kind_responses_length = tvb_get_ntohl(tvb, offset);
2549 if (4 + kind_responses_length > length) {
2550 ti_fetchans = proto_tree_add_item(tree, hf_reload_fetchans, tvb, offset, length, ENC_NA);
2551 expert_add_info_format(pinfo, ti_fetchans, &ei_reload_truncated_field, "Truncated FetchAns");
2552 return length;
2554 ti_fetchans = proto_tree_add_item(tree, hf_reload_fetchans, tvb, offset, 4 + kind_responses_length, ENC_NA);
2555 fetchans_tree = proto_item_add_subtree(ti_fetchans, ett_reload_fetchans);
2557 proto_tree_add_uint(fetchans_tree, hf_reload_length_uint32, tvb, offset, 4, kind_responses_length);
2559 while (kind_responses_offset < kind_responses_length) {
2560 uint32_t kind_responses_increment;
2561 kind_responses_increment = dissect_kinddata(tvb, pinfo, fetchans_tree, offset + 4 + kind_responses_offset, kind_responses_length - kind_responses_offset, false);
2562 if (kind_responses_increment == 0) {
2563 break;
2565 kind_responses_offset += kind_responses_increment;
2568 return 4 + kind_responses_length;
2572 static int
2573 dissect_statans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2575 proto_item *ti_statans;
2576 proto_tree *statans_tree;
2577 uint32_t kind_responses_length;
2578 uint32_t kind_responses_offset = 0;
2579 int nResponses = 0;
2581 kind_responses_length = tvb_get_ntohl(tvb, offset);
2583 if (kind_responses_length > UINT16_MAX || 4 + kind_responses_length > length) {
2584 ti_statans = proto_tree_add_item(tree, hf_reload_statans, tvb, offset, length, ENC_NA);
2585 expert_add_info_format(pinfo, ti_statans, &ei_reload_truncated_field, "Truncated StatAns");
2586 return length;
2588 ti_statans = proto_tree_add_item(tree, hf_reload_statans, tvb, offset, 4 + kind_responses_length, ENC_NA);
2589 proto_item_append_text(ti_statans, " (StatKindResponse<%d>)", kind_responses_length);
2590 statans_tree = proto_item_add_subtree(ti_statans, ett_reload_statans);
2592 proto_tree_add_uint(statans_tree, hf_reload_length_uint32, tvb, offset, 4, kind_responses_length);
2595 while (kind_responses_offset < kind_responses_length) {
2596 uint32_t kind_responses_increment;
2597 kind_responses_increment = dissect_kinddata(tvb, pinfo, statans_tree, offset + 4 + kind_responses_offset, kind_responses_length - kind_responses_offset, true);
2598 if (kind_responses_increment == 0) {
2599 break;
2601 nResponses++;
2602 kind_responses_offset += kind_responses_increment;
2605 proto_item_append_text(ti_statans, ": %d elements", nResponses);
2607 return 4 + kind_responses_length;
2611 static int
2612 dissect_chordupdate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2614 proto_item *ti_chordupdate;
2615 proto_tree *chordupdate_tree;
2616 uint16_t local_offset = 0;
2617 uint8_t type;
2619 ti_chordupdate = proto_tree_add_item(tree, hf_reload_chordupdate, tvb, offset, length, ENC_NA);
2620 chordupdate_tree = proto_item_add_subtree(ti_chordupdate, ett_reload_chordupdate);
2622 proto_tree_add_item(chordupdate_tree, hf_reload_uptime, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
2623 local_offset += 4;
2624 type = tvb_get_uint8(tvb, offset + local_offset);
2625 proto_tree_add_uint(chordupdate_tree, hf_reload_chordupdate_type, tvb, offset+local_offset, 1, type);
2626 local_offset += 1;
2628 switch(type) {
2629 case CHORDUPDATETYPE_NEIGHBORS:
2630 local_offset += dissect_nodeid_list(tvb, pinfo, chordupdate_tree, offset+local_offset, length-local_offset, hf_reload_chordupdate_predecessors);
2631 local_offset += dissect_nodeid_list(tvb, pinfo, chordupdate_tree, offset+local_offset, length-local_offset, hf_reload_chordupdate_successors);
2632 break;
2634 case CHORDUPDATETYPE_FULL:
2635 local_offset += dissect_nodeid_list(tvb, pinfo, chordupdate_tree, offset+local_offset, length-local_offset, hf_reload_chordupdate_predecessors);
2636 local_offset += dissect_nodeid_list(tvb, pinfo, chordupdate_tree, offset+local_offset, length-local_offset, hf_reload_chordupdate_successors);
2637 local_offset += dissect_nodeid_list(tvb, pinfo, chordupdate_tree, offset+local_offset, length-local_offset, hf_reload_chordupdate_fingers);
2638 break;
2640 default:
2641 break;
2643 return local_offset;
2647 static int
2648 dissect_chordroutequeryans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2650 proto_item *ti_chordroutequeryans;
2651 proto_tree *chordroutequeryans_tree;
2653 ti_chordroutequeryans = proto_tree_add_item(tree, hf_reload_chordroutequeryans, tvb, offset, length, ENC_NA);
2654 chordroutequeryans_tree = proto_item_add_subtree(ti_chordroutequeryans, ett_reload_chordroutequeryans);
2655 dissect_nodeid(hf_reload_chordroutequeryans_next_peer, tvb, pinfo, chordroutequeryans_tree, offset, length);
2657 return length;
2660 static int
2661 dissect_chordleavedata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2663 proto_item *ti_local;
2664 proto_tree *local_tree;
2665 uint16_t local_offset = 0;
2666 uint8_t type;
2668 ti_local = proto_tree_add_item(tree, hf_reload_chordleave, tvb, offset, length, ENC_NA);
2669 local_tree = proto_item_add_subtree(ti_local, ett_reload_chordleave);
2671 type = tvb_get_uint8(tvb, offset + local_offset);
2672 proto_tree_add_uint(local_tree, hf_reload_chordleave_type, tvb, offset+local_offset, 1, type);
2673 local_offset += 1;
2675 switch(type) {
2676 case CHORDLEAVETYPE_FROM_SUCC:
2677 local_offset += dissect_nodeid_list(tvb, pinfo, local_tree, offset+local_offset, length-local_offset, hf_reload_chordleave_successors);
2678 break;
2680 case CHORDLEAVETYPE_FROM_PRED:
2681 local_offset += dissect_nodeid_list(tvb, pinfo, local_tree, offset+local_offset, length-local_offset, hf_reload_chordleave_predecessors);
2682 break;
2684 default:
2685 break;
2687 return local_offset;
2690 static int dissect_kindid_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2692 proto_item *ti_local;
2693 proto_tree *local_tree;
2694 int kinds_length = 0;
2695 int kinds_offset = 0;
2696 int nKinds = 0;
2698 kinds_length = tvb_get_uint8(tvb, offset);
2700 if ((uint16_t)length<kinds_length+1) {
2701 ti_local = proto_tree_add_item(tree, hf_reload_kindid_list, tvb, offset, length, ENC_NA);
2702 expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated kinds list");
2704 ti_local = proto_tree_add_item(tree, hf_reload_kindid_list, tvb, offset, length, ENC_NA);
2705 local_tree = proto_item_add_subtree(ti_local, ett_reload_kindid_list);
2706 proto_item_append_text(ti_local, "(KindId<%d>)", kinds_length);
2708 dissect_length(tvb, local_tree, offset, 1);
2710 while (kinds_offset < kinds_length) {
2711 kind_t *kind;
2712 int local_increment = dissect_kindid(-1,tvb, local_tree,offset+1+kinds_offset, &kind);
2713 if (local_increment <= 0) break;
2714 kinds_offset += local_increment;
2715 nKinds++;
2717 proto_item_append_text(ti_local, ": %d elements", nKinds);
2719 return (1+kinds_length);
2722 static int dissect_findreq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length) {
2723 proto_item *ti_local;
2724 proto_tree *local_tree;
2725 uint16_t local_offset = 0;
2727 ti_local = proto_tree_add_item(tree, hf_reload_findreq, tvb, offset, length, ENC_NA);
2728 local_tree = proto_item_add_subtree(ti_local, ett_reload_findreq);
2730 local_offset += dissect_resourceid(hf_reload_resource, tvb, pinfo, local_tree, offset, length);
2731 dissect_kindid_list(tvb, pinfo, local_tree, offset+local_offset, length-local_offset);
2733 return length;
2736 static int dissect_findans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length) {
2737 proto_item *ti_local;
2738 proto_tree *local_tree;
2739 uint16_t results_length;
2741 ti_local = proto_tree_add_item(tree, hf_reload_findans, tvb, offset, length, ENC_NA);
2742 local_tree = proto_item_add_subtree(ti_local, ett_reload_findans);
2743 results_length = tvb_get_ntohs(tvb, offset);
2744 proto_item_append_text(ti_local, " (FindKindData<%d>)", results_length);
2745 if (results_length + 2 > length) {
2746 expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated FindAns");
2748 proto_tree_add_uint(local_tree, hf_reload_length_uint16, tvb, offset, 2, results_length);
2751 int32_t results_offset = 0;
2752 int nResults = 0;
2753 while (results_offset >= 0 && results_offset < results_length) {
2754 proto_item *ti_findkinddata;
2755 proto_tree *findkinddata_tree;
2756 uint16_t findkinddata_length;
2757 kind_t *kind;
2758 findkinddata_length = 4/*kind id */ + 1 + tvb_get_uint8(tvb,offset + 2 + results_offset + 4)/* resourceId */;
2759 if (results_offset + findkinddata_length > results_length) {
2760 ti_findkinddata = proto_tree_add_item(local_tree, hf_reload_findkinddata, tvb, offset + results_offset, results_length - results_offset, ENC_NA);
2761 expert_add_info_format(pinfo, ti_findkinddata, &ei_reload_truncated_field, "Truncated FindKindData");
2762 break;
2765 ti_findkinddata = proto_tree_add_item(local_tree, hf_reload_findkinddata, tvb, offset + 2 + results_offset, findkinddata_length, ENC_NA);
2766 findkinddata_tree = proto_item_add_subtree(ti_findkinddata, ett_reload_findkinddata);
2767 dissect_kindid(hf_reload_kinddata_kind,tvb, findkinddata_tree, offset+2+results_offset,&kind);
2768 dissect_resourceid(hf_reload_findkinddata_closest, tvb, pinfo, findkinddata_tree, offset+2+results_offset+4, results_length - 4 - results_offset);
2769 if (findkinddata_length <= 0) break;
2770 results_offset += findkinddata_length;
2771 nResults++;
2773 proto_item_append_text(ti_local, ": %d elements", nResults);
2776 return length;
2779 static int dissect_selftuningdata(tvbuff_t *tvb, proto_tree *tree, uint16_t offset)
2781 proto_item *ti_local;
2782 proto_tree *local_tree;
2784 ti_local = proto_tree_add_item(tree, hf_reload_self_tuning_data, tvb, offset, 12, ENC_NA);
2785 local_tree = proto_item_add_subtree(ti_local, ett_reload_self_tuning_data);
2787 proto_tree_add_item(local_tree, hf_reload_self_tuning_data_network_size, tvb, offset, 4, ENC_BIG_ENDIAN);
2788 proto_tree_add_item(local_tree, hf_reload_self_tuning_data_join_rate, tvb, offset+4, 4, ENC_BIG_ENDIAN);
2789 proto_tree_add_item(local_tree, hf_reload_self_tuning_data_leave_rate, tvb, offset+8, 4, ENC_BIG_ENDIAN);
2791 return 12;
2794 static int dissect_extensiveroutingmodeoption(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2796 proto_item *ti_local;
2797 proto_tree *local_tree;
2798 uint16_t local_offset = 0;
2800 ti_local = proto_tree_add_item(tree, hf_reload_extensiveroutingmodeoption, tvb, offset, length, ENC_NA);
2801 local_tree = proto_item_add_subtree(ti_local, ett_reload_extensiveroutingmodeoption);
2803 proto_tree_add_item(local_tree, hf_reload_routemode, tvb, offset, 1, ENC_BIG_ENDIAN);
2804 local_offset += 1;
2805 proto_tree_add_item(local_tree, hf_reload_extensiveroutingmode_transport, tvb,
2806 offset+local_offset, 1, ENC_BIG_ENDIAN);
2807 local_offset += 1;
2808 local_offset += dissect_ipaddressport(hf_reload_extensiveroutingmode_ipaddressport, tvb, pinfo, local_tree, offset+local_offset);
2810 proto_item *ti_destination;
2811 proto_tree *destination_tree;
2812 uint16_t destination_length;
2813 int nDestinations = 0;
2814 destination_length = tvb_get_uint8(tvb, offset+local_offset);
2815 if (destination_length+1+local_offset>length) {
2816 expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated ExtensiveRoutingModeOption");
2817 destination_length = length -1-local_offset;
2819 ti_destination = proto_tree_add_item(local_tree, hf_reload_extensiveroutingmode_destination, tvb,offset+local_offset, 1+destination_length, ENC_NA);
2820 proto_item_append_text(ti_destination, " (Destination<%d>)", destination_length);
2821 destination_tree = proto_item_add_subtree(ti_destination, ett_reload_extensiveroutingmode_destination);
2822 proto_tree_add_item(destination_tree, hf_reload_length_uint8, tvb,offset+local_offset, 1, ENC_BIG_ENDIAN);
2823 local_offset += 1;
2824 dissect_destination_list(tvb, pinfo, destination_tree, offset+local_offset, destination_length, &nDestinations);
2825 proto_item_append_text(ti_destination, ": %d elements", nDestinations);
2826 local_offset += destination_length;
2828 return local_offset;
2831 static int dissect_forwardingoption(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2833 proto_item *ti_option;
2834 uint16_t local_offset = 0;
2835 uint8_t option_type = tvb_get_uint8(tvb,offset);
2836 uint8_t option_flags = tvb_get_uint8(tvb, offset+ 1);
2837 uint16_t option_length = tvb_get_ntohs(tvb, offset+ 2);
2838 proto_tree *option_tree;
2840 ti_option = proto_tree_add_item(tree, hf_reload_forwarding_option, tvb, offset+local_offset, option_length + 4, ENC_NA);
2841 proto_item_append_text(ti_option, " type=%s, flags=%02x, length=%d", val_to_str_const(option_type, forwardingoptiontypes, "Unknown"), option_flags, option_length);
2843 option_tree = proto_item_add_subtree(ti_option, ett_reload_forwarding_option);
2844 proto_tree_add_item(option_tree, hf_reload_forwarding_option_type, tvb, offset+local_offset, 1, ENC_BIG_ENDIAN);
2846 proto_item *ti_flags;
2847 proto_tree *flags_tree;
2848 uint32_t bit_offset;
2849 ti_flags = proto_tree_add_uint(option_tree, hf_reload_forwarding_option_flags, tvb, offset+local_offset+1, 1, option_flags);
2850 flags_tree = proto_item_add_subtree(ti_flags, ett_reload_forwarding_option_flags);
2851 bit_offset = 8*(offset+local_offset+1);
2852 proto_tree_add_bits_item(flags_tree, hf_reload_forwarding_option_flag_ignore_state_keeping, tvb, bit_offset+4, 1, ENC_BIG_ENDIAN);
2853 proto_tree_add_bits_item(flags_tree, hf_reload_forwarding_option_flag_response_copy, tvb, bit_offset+5, 1, ENC_BIG_ENDIAN);
2854 proto_tree_add_bits_item(flags_tree, hf_reload_forwarding_option_flag_destination_critical, tvb, bit_offset+6, 1, ENC_BIG_ENDIAN);
2855 proto_tree_add_bits_item(flags_tree, hf_reload_forwarding_option_flag_forward_critical, tvb, bit_offset+7, 1, ENC_BIG_ENDIAN);
2857 proto_tree_add_uint(option_tree, hf_reload_length_uint16, tvb, offset+local_offset+2, 2, option_length);
2858 local_offset += 4;
2859 if (local_offset + option_length > length) {
2860 expert_add_info_format(pinfo, ti_option, &ei_reload_truncated_field, "Truncated ForwardingOption");
2861 return length;
2864 switch (option_type) {
2865 case OPTIONTYPE_EXTENSIVE_ROUTING_MODE:
2866 dissect_extensiveroutingmodeoption(tvb, pinfo, option_tree, offset+local_offset, option_length);
2867 break;
2869 default:
2870 proto_tree_add_item(option_tree, hf_reload_opaque_data, tvb, offset+local_offset, option_length, ENC_NA);
2871 break;
2873 local_offset += option_length;
2875 return local_offset;
2878 static int dissect_dmflag(tvbuff_t *tvb, proto_tree *tree, uint16_t offset) {
2879 proto_item *ti_local;
2880 proto_tree *local_tree;
2881 unsigned i;
2882 uint32_t bit_offset = offset<<3;
2884 ti_local = proto_tree_add_item(tree, hf_reload_dmflags, tvb, offset, 8, ENC_BIG_ENDIAN);
2885 local_tree = proto_item_add_subtree(ti_local, ett_reload_dmflags);
2887 for (i = 0; i < array_length(reload_dmflag_items); i++) {
2888 if (reload_dmflag_items[i] != NULL) {
2889 proto_tree_add_bits_item(local_tree, *(reload_dmflag_items[i]), tvb, bit_offset+63-i, 1, ENC_BIG_ENDIAN);
2892 return 8;
2895 static int dissect_diagnosticextension(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2897 proto_item *ti_local;
2898 proto_tree *local_tree;
2899 uint16_t local_offset = 0;
2900 uint16_t local_length = 0;
2902 local_length = 2 + 4 + tvb_get_ntohl(tvb, offset+2);
2903 ti_local = proto_tree_add_item(tree, hf_reload_diagnosticextension, tvb, offset, local_length, ENC_NA);
2904 local_tree = proto_item_add_subtree(ti_local, ett_reload_diagnosticextension);
2906 proto_tree_add_item(local_tree, hf_reload_diagnosticextension_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2907 local_offset += 2;
2908 local_offset += dissect_opaque(tvb, pinfo, local_tree, hf_reload_diagnosticextension_contents, offset + local_offset, 4, length-2);
2910 return local_offset;
2913 static int dissect_diagnosticrequest(int anchor, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length) {
2914 proto_item *ti_local;
2915 proto_tree *local_tree;
2916 uint16_t local_offset = 0;
2917 uint32_t local_length = 0;
2918 int hf = hf_reload_diagnosticrequest;
2920 if (anchor >= 0) {
2921 hf = anchor;
2924 ti_local = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
2925 local_tree = proto_item_add_subtree(ti_local, ett_reload_diagnosticrequest);
2927 proto_tree_add_item(local_tree, hf_reload_diagnostic_expiration, tvb, offset, 8, ENC_TIME_MSECS|ENC_BIG_ENDIAN);
2928 local_offset += 8;
2929 proto_tree_add_item(local_tree, hf_reload_diagnosticrequest_timestampinitiated, tvb,
2930 offset+local_offset, 8, ENC_TIME_MSECS|ENC_BIG_ENDIAN);
2931 local_offset += 8;
2932 local_offset += dissect_dmflag(tvb, local_tree, offset+local_offset);
2933 local_length = tvb_get_ntohl(tvb, offset+local_offset);
2934 proto_tree_add_item(local_tree, hf_reload_length_uint32, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
2935 local_offset += 4;
2937 if (local_offset+local_length > length) {
2938 expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated DiagnosticRequest");
2939 local_length = length-local_offset;
2941 if (local_length>0) {
2942 proto_item *ti_extensions;
2943 proto_tree *extensions_tree;
2944 uint32_t extensions_offset = 0;
2945 uint32_t extensions_length = 0;
2946 int nExtensions = 0;
2948 ti_extensions = proto_tree_add_item(local_tree, hf_reload_diagnosticrequest_extensions, tvb, offset+local_offset, local_length, ENC_NA);
2949 extensions_tree = proto_item_add_subtree(ti_extensions, ett_reload_diagnosticrequest_extensions);
2950 extensions_length = tvb_get_ntohl(tvb, offset+local_offset);
2951 if (extensions_length+4 > local_length) {
2952 expert_add_info_format(pinfo, ti_extensions, &ei_reload_truncated_field, "Truncated Diagnostic extensions");
2953 extensions_length = local_length-4;
2955 proto_item_append_text(ti_extensions, " (DiagnosticExtension<%d>)",extensions_length);
2956 proto_tree_add_item(extensions_tree, hf_reload_length_uint32, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
2957 while (extensions_offset<extensions_length) {
2958 int local_increment = dissect_diagnosticextension(tvb, pinfo, extensions_tree, offset+4+local_offset+extensions_offset, extensions_length-extensions_offset);
2959 if (local_increment <= 0) break;
2960 extensions_offset += local_increment;
2961 nExtensions++;
2963 proto_item_append_text(ti_extensions, " : %d elements", nExtensions);
2965 local_offset += local_length;
2966 return local_offset;
2969 static int dissect_pathtrackreq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2971 proto_item *ti_local;
2972 proto_tree *local_tree;
2973 uint16_t local_offset = 0;
2975 ti_local = proto_tree_add_item(tree, hf_reload_pathtrackreq, tvb, offset, length, ENC_NA);
2976 local_tree = proto_item_add_subtree(ti_local, ett_reload_pathtrackreq);
2977 local_offset += dissect_destination(hf_reload_pathtrackreq_destination, tvb, pinfo, local_tree, offset+local_offset,length);
2978 local_offset += dissect_diagnosticrequest(hf_reload_pathtrackreq_request, tvb, pinfo, local_tree, offset+local_offset, length-local_offset);
2980 return local_offset;
2983 static int dissect_diagnosticinfo(tvbuff_t *tvb, proto_tree *tree, uint16_t offset, uint16_t length)
2985 proto_item *ti_local;
2986 proto_tree *local_tree;
2987 uint16_t local_offset = 0;
2988 uint16_t local_length = 0;
2989 uint16_t kindid;
2991 local_length = 2 + tvb_get_ntohs(tvb, offset+2);
2992 ti_local = proto_tree_add_item(tree, hf_reload_diagnosticinfo, tvb, offset, local_length+4, ENC_NA);
2993 local_tree = proto_item_add_subtree(ti_local, ett_reload_diagnosticinfo);
2995 proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_kind, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
2996 local_offset += 2;
2997 proto_tree_add_item(local_tree, hf_reload_length_uint16, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
2998 local_offset += 2;
3000 kindid = tvb_get_ntohs(tvb, offset);
3001 switch(kindid) {
3002 case DIAGNOSTICKINDID_STATUS_INFO:
3003 proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_congestion_status, tvb, offset+local_offset, 1, ENC_BIG_ENDIAN);
3004 break;
3006 case DIAGNOSTICKINDID_ROUTING_TABLE_SIZE:
3007 proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_number_peers, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
3008 break;
3010 case DIAGNOSTICKINDID_PROCESS_POWER:
3011 proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_processing_power, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
3012 break;
3014 case DIAGNOSTICKINDID_BANDWIDTH:
3015 proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_bandwidth, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
3016 break;
3018 case DIAGNOSTICKINDID_SOFTWARE_VERSION:
3019 proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_software_version, tvb, offset+local_offset, length, ENC_ASCII);
3020 break;
3022 case DIAGNOSTICKINDID_MACHINE_UPTIME:
3023 proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_machine_uptime, tvb, offset+local_offset, 8, ENC_BIG_ENDIAN);
3024 break;
3026 case DIAGNOSTICKINDID_APP_UPTIME:
3027 proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_app_uptime, tvb, offset+local_offset, 8, ENC_BIG_ENDIAN);
3028 break;
3030 case DIAGNOSTICKINDID_MEMORY_FOOTPRINT:
3031 proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_memory_footprint, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
3032 break;
3034 case DIAGNOSTICKINDID_DATASIZE_STORED:
3035 proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_datasize_stored, tvb, offset+local_offset, 8, ENC_BIG_ENDIAN);
3036 break;
3038 case DIAGNOSTICKINDID_INSTANCES_STORED:
3040 proto_item *ti_instances;
3041 proto_tree *instances_tree;
3042 int32_t instances_offset = 0;
3043 int nElements = 0;
3045 ti_instances = proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_instances_stored,\
3046 tvb, offset+local_offset, length, ENC_NA);
3047 instances_tree = proto_item_add_subtree(ti_instances, ett_reload_diagnosticinfo_instances_stored);
3048 proto_item_append_text(ti_instances, "[%d]", length);
3049 while (instances_offset >= 0 && instances_offset < length) {
3050 proto_item *ti_instances_per_kindid;
3051 proto_tree *instances_per_kindid_tree;
3052 kind_t *kind;
3053 uint64_t instances;
3054 ti_instances_per_kindid = proto_tree_add_item(instances_tree, hf_reload_diagnosticinfo_instancesstored_info,
3055 tvb, offset+local_offset+instances_offset, 12, ENC_NA);
3056 instances_per_kindid_tree = proto_item_add_subtree(ti_instances_per_kindid,
3057 ett_reload_diagnosticinfo_instancesstored_info);
3058 dissect_kindid(hf_reload_kinddata_kind, tvb, instances_per_kindid_tree, offset+local_offset+instances_offset, &kind);
3059 proto_tree_add_item(instances_per_kindid_tree, hf_reload_diagnosticinfo_instancesstored_instances,
3060 tvb, offset+local_offset+instances_offset+4, 8, ENC_BIG_ENDIAN);
3061 instances = tvb_get_ntoh64(tvb, offset+local_offset+instances_offset+4);
3062 proto_item_append_text(ti_instances_per_kindid, ": %s/%" PRId64,
3063 ((kind != NULL) && (kind->name != NULL)) ? kind->name : "UNKNOWN KIND", instances);
3064 instances_offset += 12;
3065 nElements++;
3067 if (nElements>0) {
3068 proto_item_append_text(ti_instances, ": %d", nElements);
3071 break;
3074 case DIAGNOSTICKINDID_MESSAGES_SENT_RCVD:
3076 proto_item *ti_messages;
3077 proto_tree *messages_tree;
3078 int32_t messages_offset = 0;
3079 int nElements = 0;
3081 ti_messages = proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_messages_sent_rcvd,
3082 tvb, offset+local_offset, length, ENC_NA);
3083 messages_tree = proto_item_add_subtree(ti_messages, ett_reload_diagnosticinfo_messages_sent_rcvd);
3084 proto_item_append_text(ti_messages, "[%d]", length);
3086 while (messages_offset >= 0 && messages_offset < length) {
3087 proto_item *ti_sent_rcvd;
3088 proto_tree *sent_rcvd_tree;
3089 uint16_t message_code;
3091 ti_sent_rcvd = proto_tree_add_item(messages_tree, hf_reload_diagnosticinfo_messages_sent_rcvd_info, tvb, offset+local_offset+messages_offset, 20, ENC_NA);
3093 sent_rcvd_tree = proto_item_add_subtree(ti_sent_rcvd, ett_reload_diagnosticinfo_messages_sent_rcvd_info);
3094 message_code = tvb_get_ntohs(tvb, offset+local_offset+messages_offset);
3095 if (message_code == RELOAD_ERROR) {
3096 proto_tree_add_uint_format_value(sent_rcvd_tree, hf_reload_diagnosticinfo_message_code, tvb,
3097 offset+local_offset+messages_offset, 2,
3098 message_code,
3099 "error");
3102 else {
3103 proto_tree_add_uint_format_value(sent_rcvd_tree, hf_reload_diagnosticinfo_message_code, tvb,
3104 offset+local_offset+messages_offset, 2,
3105 message_code,
3106 "%s_%s",
3107 val_to_str_const(MSGCODE_TO_METHOD(message_code), methods_short, "Unknown"),
3108 val_to_str_const(MSGCODE_TO_CLASS(message_code), classes_short, "Unknown"));
3110 proto_tree_add_item(sent_rcvd_tree, hf_reload_diagnosticinfo_messages_sent,
3111 tvb, offset+local_offset+messages_offset+2, 8, ENC_BIG_ENDIAN);
3112 proto_tree_add_item(sent_rcvd_tree, hf_reload_diagnosticinfo_messages_rcvd,
3113 tvb, offset+local_offset+messages_offset+2+8, 8, ENC_BIG_ENDIAN);
3114 messages_offset += 18;
3115 nElements++;
3117 if (nElements>0) {
3118 proto_item_append_text(ti_messages, ": %d", nElements);
3121 break;
3123 case DIAGNOSTICKINDID_EWMA_BYTES_SENT:
3124 proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_ewma_bytes_sent, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
3125 break;
3127 case DIAGNOSTICKINDID_EWMA_BYTES_RCVD:
3128 proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_ewma_bytes_rcvd, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
3129 break;
3131 case DIAGNOSTICKINDID_UNDERLAY_HOP:
3132 proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_underlay_hops, tvb, offset+local_offset, 1, ENC_BIG_ENDIAN);
3133 break;
3135 case DIAGNOSTICKINDID_BATTERY_STATUS:
3136 proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_battery_status, tvb, offset+local_offset, 1, ENC_BIG_ENDIAN);
3137 break;
3139 default:
3140 proto_tree_add_item(local_tree, hf_reload_opaque_data, tvb, offset+local_offset, length, ENC_NA);
3141 break;
3145 return local_length;
3149 static int dissect_diagnosticresponse(int anchor, tvbuff_t *tvb, packet_info *pinfo,proto_tree *tree, uint16_t offset, uint16_t length) {
3150 proto_item *ti_local;
3151 proto_tree *local_tree;
3152 uint16_t local_offset = 0;
3153 int hf = hf_reload_diagnosticresponse;
3155 if (anchor >= 0) {
3156 hf = anchor;
3159 ti_local = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
3160 local_tree = proto_item_add_subtree(ti_local, ett_reload_diagnosticresponse);
3162 proto_tree_add_item(local_tree, hf_reload_diagnostic_expiration, tvb, offset, 8, ENC_TIME_MSECS|ENC_BIG_ENDIAN);
3163 local_offset += 8;
3164 proto_tree_add_item(local_tree, hf_reload_diagnosticresponse_timestampreceived,
3165 tvb, offset+local_offset, 8, ENC_TIME_MSECS|ENC_BIG_ENDIAN);
3166 local_offset += 8;
3167 proto_tree_add_item(local_tree, hf_reload_diagnosticresponse_hopcounter, tvb, offset+local_offset, 1, ENC_BIG_ENDIAN);
3171 proto_item *ti_diagnostics;
3172 proto_tree *diagnostics_tree;
3173 int32_t diagnostics_offset = 0;
3174 uint32_t diagnostics_length = 0;
3175 int nDiagnostics = 0;
3177 diagnostics_length = tvb_get_ntohl(tvb, offset+local_offset);
3178 if (diagnostics_length+local_offset+4>length) {
3179 expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated Diagnostic Response");
3180 diagnostics_length = length -4 -local_offset;
3182 ti_diagnostics = proto_tree_add_item(local_tree, hf_reload_diagnosticresponse_diagnostic_info_list, tvb, offset+local_offset, diagnostics_length, ENC_NA);
3183 diagnostics_tree = proto_item_add_subtree(ti_local, ett_reload_diagnosticresponse_diagnostic_info_list);
3184 proto_item_append_text(ti_diagnostics, " (DiagnosticInfo<%d>)",diagnostics_length);
3185 proto_tree_add_item(diagnostics_tree, hf_reload_length_uint32, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
3186 local_offset += 4;
3187 while (diagnostics_offset >= 0 && (uint32_t)diagnostics_offset<diagnostics_length) {
3188 int local_increment = dissect_diagnosticinfo(tvb, diagnostics_tree, offset+local_offset+diagnostics_offset, diagnostics_length-diagnostics_offset);
3189 if (local_increment <= 0) break;
3190 diagnostics_offset += local_increment;
3191 nDiagnostics++;
3193 proto_item_append_text(ti_diagnostics, " : %d elements", nDiagnostics);
3194 local_offset += diagnostics_length;
3197 return local_offset;
3200 static int dissect_pathtrackans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
3202 proto_item *ti_local;
3203 proto_tree *local_tree;
3204 uint16_t local_offset = 0;
3206 ti_local = proto_tree_add_item(tree, hf_reload_pathtrackans, tvb, offset, length, ENC_NA);
3207 local_tree = proto_item_add_subtree(ti_local, ett_reload_pathtrackans);
3208 local_offset += dissect_destination(hf_reload_pathtrackans_next_hop, tvb, pinfo, local_tree, offset+local_offset,length);
3209 local_offset += dissect_diagnosticresponse(hf_reload_pathtrackans_response, tvb, pinfo, local_tree, offset+local_offset, length-local_offset);
3211 return local_offset;
3214 static int dissect_joinreq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
3216 proto_item *ti_local;
3217 proto_tree *local_tree;
3218 uint16_t local_offset = 0;
3220 ti_local = proto_tree_add_item(tree, hf_reload_joinreq, tvb, offset, length, ENC_NA);
3221 local_tree = proto_item_add_subtree(ti_local, ett_reload_joinreq);
3223 local_offset += dissect_nodeid(hf_reload_joinreq_joining_peer_id, tvb, pinfo, local_tree, offset, length);
3224 local_offset += dissect_opaque(tvb, pinfo, local_tree, hf_reload_overlay_specific, offset + local_offset, 2,
3225 length - local_offset);
3226 return local_offset;
3229 static int dissect_joinans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
3231 proto_item *ti_local;
3232 proto_tree *local_tree;
3233 uint16_t local_offset = 0;
3235 ti_local = proto_tree_add_item(tree, hf_reload_joinans, tvb, offset, length, ENC_NA);
3236 local_tree = proto_item_add_subtree(ti_local, ett_reload_joinans);
3238 local_offset = dissect_opaque(tvb, pinfo, local_tree, hf_reload_overlay_specific,
3239 offset + local_offset, 2, length );
3240 return local_offset;
3243 static int dissect_leavereq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
3245 proto_item *ti_local;
3246 proto_tree *local_tree;
3247 uint16_t local_offset = 0;
3249 ti_local = proto_tree_add_item(tree, hf_reload_leavereq, tvb, offset, length, ENC_NA);
3250 local_tree = proto_item_add_subtree(ti_local, ett_reload_leavereq);
3252 local_offset += dissect_nodeid(hf_reload_leavereq_leaving_peer_id, tvb, pinfo, local_tree, offset, length);
3253 if (0 == strcmp(TOPOLOGY_PLUGIN_CHORD_RELOAD, reload_topology_plugin)) {
3254 proto_item *ti_overlay_specific;
3255 proto_tree *overlay_specific_tree;
3256 uint16_t overlay_length;
3258 ti_overlay_specific = proto_tree_add_item(local_tree, hf_reload_overlay_specific,
3259 tvb, offset+local_offset, length - local_offset, ENC_NA);
3260 overlay_specific_tree = proto_item_add_subtree(ti_overlay_specific, ett_reload_overlay_specific);
3261 proto_tree_add_item(overlay_specific_tree, hf_reload_length_uint16, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
3263 overlay_length = tvb_get_ntohs(tvb, offset+local_offset);
3264 local_offset+= 2;
3265 dissect_chordleavedata(tvb, pinfo, overlay_specific_tree, offset+local_offset, overlay_length);
3266 local_offset += overlay_length;
3268 else {
3269 local_offset += dissect_opaque(tvb, pinfo, local_tree, hf_reload_overlay_specific,
3270 offset + reload_nodeid_length, 2, length - local_offset);
3273 return local_offset;
3276 static int dissect_probereq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
3278 proto_item *ti_local, *ti_requested_info;
3279 proto_tree *local_tree, *requested_info_tree;
3280 uint8_t info_list_length = 0;
3282 ti_local = proto_tree_add_item(tree, hf_reload_probereq, tvb, offset, length, ENC_NA);
3283 local_tree = proto_item_add_subtree(ti_local, ett_reload_probereq);
3284 ti_requested_info = proto_tree_add_item(local_tree, hf_reload_probereq_requested_info, tvb, offset, length, ENC_NA);
3285 requested_info_tree = proto_item_add_subtree(ti_requested_info, ett_reload_probereq_requested_info);
3286 info_list_length = tvb_get_uint8(tvb, offset);
3288 proto_item_append_text(ti_requested_info, " (ProbeInformationType<%d>)", info_list_length);
3289 proto_tree_add_uint(requested_info_tree, hf_reload_length_uint8, tvb, offset, 1, info_list_length);
3291 if ((info_list_length+1) > length) {
3292 expert_add_info_format(pinfo, ti_requested_info, &ei_reload_truncated_field, "Truncated requested_info");
3293 info_list_length = length - 1;
3296 int probe_offset = 0;
3297 int nInfos = 0;
3298 while (probe_offset >= 0 && probe_offset < info_list_length) {
3299 proto_tree_add_item(requested_info_tree, hf_reload_probe_information_type,
3300 tvb, offset + 1 + probe_offset, 1, ENC_BIG_ENDIAN);
3301 probe_offset += 1;
3302 nInfos++;
3304 proto_item_append_text(ti_requested_info, ": %d elements", nInfos);
3307 return info_list_length;
3310 static int dissect_probeans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
3312 proto_item *ti_local, *ti_infos;
3313 proto_tree *local_tree, *infos_tree;
3314 uint16_t info_list_length = 0;
3316 ti_local = proto_tree_add_item(tree, hf_reload_probeans, tvb, offset, length, ENC_NA);
3317 local_tree = proto_item_add_subtree(ti_local, ett_reload_probeans);
3319 info_list_length = tvb_get_ntohs(tvb, offset);
3320 if (info_list_length+2 >length) {
3321 expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated ProbeAns");
3322 info_list_length = length - 2;
3324 ti_infos = proto_tree_add_item(local_tree, hf_reload_probeans_probe_info, tvb, offset, info_list_length, ENC_NA);
3325 proto_item_append_text(ti_infos, " (ProbeInformation<%d>)", info_list_length);
3326 infos_tree = proto_item_add_subtree(ti_infos, ett_reload_probeans_probe_info);
3328 int probe_offset = 0;
3329 int probe_increment;
3330 int nInfos = 0;
3331 while (probe_offset >= 0 && probe_offset < info_list_length) {
3332 probe_increment = dissect_probe_information(tvb, pinfo, infos_tree, offset + 2 + probe_offset, info_list_length - probe_offset);
3333 if (probe_increment <= 0) {
3334 break;
3336 probe_offset += probe_increment;
3337 nInfos++;
3339 proto_item_append_text(ti_infos, ": %d elements", nInfos);
3341 return length;
3344 extern int dissect_reload_messagecontents(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
3346 uint32_t message_body_length;
3347 uint32_t extensions_length;
3348 proto_item *ti_message_contents;
3349 proto_tree *message_contents_tree;
3350 uint16_t message_code;
3352 message_body_length = tvb_get_ntohl(tvb, offset + 2);
3353 extensions_length = tvb_get_ntohl(tvb, offset + 2 + 4 + message_body_length);
3355 if (2 + 4 + message_body_length + 4 + extensions_length > length) {
3356 ti_message_contents = proto_tree_add_item(tree, hf_reload_message_contents, tvb, offset, length, ENC_NA);
3357 expert_add_info_format(pinfo, ti_message_contents, &ei_reload_truncated_field, "Truncated MessageContents");
3358 return length;
3361 ti_message_contents = proto_tree_add_item(tree, hf_reload_message_contents, tvb, offset, 2 + 4 + message_body_length + 4 + extensions_length, ENC_NA);
3362 message_contents_tree = proto_item_add_subtree(ti_message_contents, ett_reload_message_contents);
3364 message_code = tvb_get_ntohs(tvb, offset);
3366 if (message_code != RELOAD_ERROR) {
3367 proto_item *ti_message_body;
3368 proto_tree *message_body_tree;
3369 const char *message_type_str = NULL;
3371 /* message_code was already parsed */
3373 proto_item *ti_message_code;
3374 ti_message_code = proto_tree_add_item(message_contents_tree, hf_reload_message_code, tvb,
3375 offset, 2, ENC_BIG_ENDIAN);
3376 proto_item_append_text(ti_message_code, " (%s_%s)",
3377 val_to_str(MSGCODE_TO_METHOD(message_code), methods_short, "Unknown %d"),
3378 val_to_str(MSGCODE_TO_CLASS(message_code), classes_short, "Unknown %d"));
3380 offset += 2;
3381 /* Message body */
3382 ti_message_body = proto_tree_add_item(message_contents_tree, hf_reload_message_body, tvb, offset, 4 + message_body_length, ENC_NA);
3383 message_body_tree = proto_item_add_subtree(ti_message_body, ett_reload_message_body);
3384 proto_tree_add_uint(message_body_tree, hf_reload_length_uint32, tvb, offset, 4, message_body_length);
3385 offset += 4;
3387 if (message_body_length > 0) {
3388 switch(MSGCODE_TO_METHOD(message_code)) {
3389 case METHOD_ROUTEQUERY:
3391 if (IS_REQUEST(message_code)) {
3393 proto_item * ti_routequeryreq;
3394 proto_tree * routequeryreq_tree;
3395 int destination_length;
3396 message_type_str = "RouteQueryReq";
3397 ti_routequeryreq = proto_tree_add_item(message_body_tree, hf_reload_routequeryreq,
3398 tvb, offset, message_body_length, ENC_NA);
3399 routequeryreq_tree = proto_item_add_subtree(ti_routequeryreq, ett_reload_routequeryreq);
3400 proto_tree_add_item(routequeryreq_tree, hf_reload_sendupdate, tvb, offset, 1, ENC_BIG_ENDIAN);
3401 destination_length = dissect_destination(hf_reload_routequeryreq_destination,
3402 tvb, pinfo, routequeryreq_tree, offset + 1, message_body_length - 1 - 2);
3403 dissect_opaque(tvb, pinfo, routequeryreq_tree, hf_reload_overlay_specific, offset + 1 + destination_length, 2, (message_body_length - 1 - destination_length));
3406 else {
3407 message_type_str = "ChordRouteQueryAns";
3408 /* Answer is entirely Overlay-specific */
3409 if (0 == strcmp(TOPOLOGY_PLUGIN_CHORD_RELOAD, reload_topology_plugin)) {
3410 dissect_chordroutequeryans(tvb, pinfo, message_body_tree, offset, message_body_length);
3414 break;
3416 case METHOD_PROBE:
3418 if (IS_REQUEST(message_code)) {
3419 message_type_str = "ProbeReq";
3420 dissect_probereq(tvb, pinfo, message_body_tree, offset, message_body_length);
3422 else {
3423 message_type_str = "ProbeAns";
3424 dissect_probeans(tvb, pinfo, message_body_tree, offset, message_body_length);
3427 break;
3429 case METHOD_ATTACH:
3431 message_type_str = "AttachReqAns";
3432 dissect_attachreqans(tvb, pinfo, message_body_tree, offset, message_body_length);
3434 break;
3436 case METHOD_APPATTACH:
3438 /* Parse AppAttachReq/Ans */
3440 uint16_t local_offset = 0;
3441 proto_item *ti_appattach;
3442 proto_tree *appattach_tree;
3443 int hf = hf_reload_appattachans;
3444 message_type_str = "AttachAppAns";
3445 if (IS_REQUEST(message_code)) {
3446 hf = hf_reload_appattachreq;
3447 message_type_str = "AttachAppReq";
3449 ti_appattach = proto_tree_add_item(message_body_tree, hf, tvb, offset+local_offset, message_body_length, ENC_NA);
3450 appattach_tree = proto_item_add_subtree(ti_appattach, ett_reload_appattach);
3451 local_offset += dissect_opaque_string(tvb, pinfo,appattach_tree, hf_reload_ufrag,offset+local_offset, 1, message_body_length-local_offset);
3452 local_offset += dissect_opaque_string(tvb, pinfo,appattach_tree, hf_reload_password,offset+local_offset, 1, message_body_length-local_offset);
3453 proto_tree_add_item(appattach_tree, hf_reload_application, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
3454 local_offset += 2;
3455 local_offset += dissect_opaque_string(tvb, pinfo,appattach_tree, hf_reload_role,offset+local_offset, 1, message_body_length-local_offset);
3456 dissect_icecandidates(tvb, pinfo, appattach_tree, offset+local_offset, message_body_length-local_offset);
3459 break;
3461 case METHOD_PING:
3463 if (IS_REQUEST(message_code)) {
3464 proto_item *ti_local;
3465 proto_tree *local_tree;
3466 message_type_str = "PingReq";
3467 ti_local = proto_tree_add_item(message_body_tree, hf_reload_pingreq, tvb, offset, message_body_length, ENC_NA);
3468 local_tree = proto_item_add_subtree(ti_local, ett_reload_pingreq);
3470 dissect_opaque(tvb, pinfo, local_tree, hf_reload_padding, offset, 2, message_body_length);
3472 else {
3473 message_type_str = "PingAns";
3474 if (message_body_length < 16) {
3475 expert_add_info_format(pinfo, ti_message_contents, &ei_reload_truncated_field, "Truncated ping answer");
3477 else {
3478 proto_item *ti_local;
3479 proto_tree *local_tree;
3481 ti_local = proto_tree_add_item(message_body_tree, hf_reload_pingans, tvb, offset, message_body_length, ENC_NA);
3482 local_tree = proto_item_add_subtree(ti_local, ett_reload_pingans);
3483 proto_tree_add_item(local_tree, hf_reload_ping_response_id, tvb, offset, 8, ENC_BIG_ENDIAN);
3485 uint64_t timev;
3486 uint32_t remaining_ms;
3487 time_t time_sec;
3488 nstime_t l_nsTime;
3490 timev = tvb_get_ntoh64(tvb, offset+8);
3491 time_sec = (time_t)timev/1000;
3492 remaining_ms = (uint32_t)(timev % 1000);
3494 l_nsTime.secs = time_sec;
3495 l_nsTime.nsecs = remaining_ms*1000*1000;
3497 proto_tree_add_time(local_tree, hf_reload_ping_time, tvb, offset + 8, 8, &l_nsTime);
3502 break;
3504 case METHOD_CONFIGUPDATE:
3506 if (IS_REQUEST(message_code)) {
3507 uint16_t local_offset = 0;
3508 proto_item *ti_configupdate;
3509 proto_tree *configupdate_tree;
3510 uint8_t configupdate_type;
3511 uint32_t configupdate_length;
3513 message_type_str = "ConfigUpdateReq";
3514 ti_configupdate = proto_tree_add_item(message_body_tree, hf_reload_configupdatereq, tvb, offset+local_offset, message_body_length, ENC_NA);
3515 configupdate_tree = proto_item_add_subtree(ti_configupdate, ett_reload_configupdatereq);
3516 configupdate_type = tvb_get_uint8(tvb, offset + local_offset);
3517 proto_tree_add_uint(configupdate_tree, hf_reload_configupdatereq_type, tvb, offset+local_offset, 1, configupdate_type);
3518 local_offset += 1;
3519 configupdate_length = tvb_get_ntohl(tvb, offset + local_offset);
3520 proto_tree_add_uint(configupdate_tree, hf_reload_length_uint32, tvb, offset + local_offset, 4, configupdate_length);
3521 if (5 + configupdate_length > message_body_length) {
3522 expert_add_info_format(pinfo, ti_configupdate, &ei_reload_truncated_field, "Truncated ConfigUpdateReq");
3523 break;
3525 local_offset += 4;
3526 switch(configupdate_type) {
3527 case CONFIGUPDATETYPE_CONFIG:
3530 if (xml_handle == NULL) {
3531 expert_add_info(pinfo, ti_configupdate, &ei_reload_no_xml_dissector);
3532 dissect_opaque_string(tvb, pinfo, configupdate_tree, hf_reload_configupdatereq_configdata, offset+local_offset, 3, configupdate_length);
3534 else {
3535 proto_item *ti_config_data;
3536 proto_tree *config_data_tree;
3537 uint32_t config_length;
3538 config_length = tvb_get_ntoh24(tvb,offset+local_offset);
3539 ti_config_data = proto_tree_add_item(configupdate_tree, hf_reload_configupdatereq_configdata, tvb, offset+local_offset, configupdate_length, ENC_NA);
3540 config_data_tree = proto_item_add_subtree(ti_config_data, ett_reload_configupdatereq_config_data);
3541 proto_tree_add_item(config_data_tree, hf_reload_length_uint24, tvb, offset+local_offset, 3, ENC_BIG_ENDIAN);
3542 call_dissector_only(xml_handle,
3543 tvb_new_subset_length_caplen(tvb, offset+local_offset+3, config_length, length-offset-local_offset-3),
3544 pinfo, config_data_tree, NULL);
3548 break;
3550 case CONFIGUPDATETYPE_KIND:
3552 proto_item *ti_kinds;
3553 proto_tree *kinds_tree;
3554 uint32_t kinds_length;
3555 uint32_t kinds_offset = 0;
3556 int nKinds = 0;
3558 ti_kinds = proto_tree_add_item(configupdate_tree, hf_reload_configupdatereq_kinds,
3559 tvb, offset+local_offset, configupdate_length, ENC_NA);
3560 kinds_tree = proto_item_add_subtree(ti_kinds, ett_reload_configupdatereq_kinds);
3561 kinds_length = tvb_get_ntoh24(tvb, offset+local_offset);
3562 proto_item_append_text(ti_kinds, " (KindDescription<%d>)", kinds_length);
3563 local_offset += dissect_length(tvb, kinds_tree, offset+local_offset, 3);
3564 while (kinds_offset < kinds_length) {
3565 uint16_t local_increment = tvb_get_ntohs(tvb,offset+local_offset+kinds_offset);
3566 if (xml_handle == NULL) {
3567 expert_add_info(pinfo, ti_configupdate, &ei_reload_no_xml_dissector);
3568 dissect_opaque_string(tvb, pinfo, configupdate_tree, hf_reload_kinddescription,
3569 offset+local_offset+kinds_offset, 2, configupdate_length);
3571 else {
3572 proto_item *ti_kinddescription;
3573 proto_tree *kinddescription_tree;
3574 ti_kinddescription = proto_tree_add_item(kinds_tree, hf_reload_kinddescription,
3575 tvb, offset+local_offset+kinds_offset, 2+local_increment, ENC_NA);
3576 kinddescription_tree = proto_item_add_subtree(ti_kinddescription, ett_reload_kinddescription);
3577 proto_tree_add_item(kinddescription_tree, hf_reload_length_uint16,
3578 tvb, offset+local_offset+kinds_offset, 2, ENC_BIG_ENDIAN);
3579 call_dissector(xml_handle,
3580 tvb_new_subset_length_caplen(tvb, offset+local_offset+kinds_offset+2,
3581 local_increment,
3582 length-(offset+local_offset+kinds_offset+2)),
3583 pinfo, kinddescription_tree);
3585 local_increment += 2;
3586 if (local_increment <= 0) break;
3587 kinds_offset += local_increment;
3588 nKinds++;
3590 proto_item_append_text(ti_kinds, ": %d elements", nKinds);
3592 break;
3596 else {
3597 message_type_str = "ConfigUpdateAns";
3599 break;
3602 case METHOD_STORE:
3604 if (IS_REQUEST(message_code)) {
3605 message_type_str = "StoreReq";
3606 dissect_storereq(tvb, pinfo, message_body_tree, offset, message_body_length);
3608 else {
3609 message_type_str = "StoreAns";
3610 dissect_storeans(tvb, pinfo, message_body_tree, offset, message_body_length);
3613 break;
3615 case METHOD_FETCH:
3617 if (IS_REQUEST(message_code)) {
3618 message_type_str = "FetchReq";
3619 dissect_fetchreq(tvb, pinfo, message_body_tree, offset, message_body_length, false);
3621 else {
3622 /* response */
3623 message_type_str = "FetchAns";
3624 dissect_fetchans(tvb, pinfo, message_body_tree, offset, message_body_length);
3627 break;
3629 case METHOD_STAT:
3631 if (IS_REQUEST(message_code)) {
3632 message_type_str = "StatReq";
3633 dissect_fetchreq(tvb, pinfo, message_body_tree, offset, message_body_length, true);
3635 else {
3636 message_type_str = "StatAns";
3637 dissect_statans(tvb, pinfo, message_body_tree, offset, message_body_length);
3640 break;
3642 case METHOD_FIND:
3644 if (IS_REQUEST(message_code)) {
3645 message_type_str = "FindReq";
3646 dissect_findreq(tvb,pinfo, message_body_tree,offset,message_body_length);
3648 else {
3649 message_type_str = "FindAns";
3650 dissect_findans(tvb, pinfo, message_body_tree, offset, message_body_length);
3653 break;
3655 case METHOD_LEAVE:
3657 if (IS_REQUEST(message_code)) {
3658 message_type_str = "LeaveReq";
3659 dissect_leavereq(tvb,pinfo, message_body_tree,offset,message_body_length);
3661 else {
3662 message_type_str = "LeaveAns";
3663 dissect_opaque(tvb, pinfo, message_body_tree, hf_reload_overlay_specific, offset, 2, message_body_length);
3666 break;
3668 case METHOD_JOIN:
3670 if (IS_REQUEST(message_code)) {
3671 message_type_str = "JoinReq";
3672 dissect_joinreq(tvb, pinfo, message_body_tree, offset, message_body_length);
3674 else {
3675 message_type_str = "JoinAns";
3676 dissect_joinans(tvb, pinfo, message_body_tree, offset, message_body_length);
3679 break;
3681 case METHOD_UPDATE:
3682 if (0 == strcmp(TOPOLOGY_PLUGIN_CHORD_RELOAD, reload_topology_plugin)) {
3683 if (IS_REQUEST(message_code)) {
3684 message_type_str = "ChordUpdate";
3685 dissect_chordupdate(tvb, pinfo, message_body_tree, offset, message_body_length);
3688 break;
3690 case METHOD_PATH_TRACK:
3691 if (IS_REQUEST(message_code)) {
3692 message_type_str = "PathTrackReck";
3693 dissect_pathtrackreq(tvb, pinfo, message_body_tree, offset, message_body_length);
3695 else {
3696 message_type_str = "PathTrackAns";
3697 dissect_pathtrackans(tvb, pinfo, message_body_tree, offset, message_body_length);
3699 break;
3701 default:
3702 break;
3705 if (message_type_str!= NULL) {
3706 proto_item_append_text(ti_message_body, " (%s<%d>)", message_type_str, message_body_length);
3708 else {
3709 proto_item_append_text(ti_message_body,
3710 " (%s%s<%d>)",
3711 val_to_str_const(MSGCODE_TO_METHOD(message_code),methods,"opaque"),
3712 val_to_str_const(MSGCODE_TO_CLASS(message_code), classes_Short, ""),
3713 message_body_length);
3717 else {
3718 /* Error Response */
3719 uint16_t error_length, error_code;
3720 proto_item *ti_message_body;
3721 proto_tree *message_body_tree;
3722 proto_item *ti_error;
3723 proto_tree *error_tree;
3725 /* message_code was already parsed */
3726 proto_tree_add_uint_format_value(message_contents_tree, hf_reload_message_code,
3727 tvb, offset, 2, message_code, "Error");
3728 offset += 2;
3730 /* Message body */
3731 ti_message_body = proto_tree_add_item(message_contents_tree, hf_reload_message_body,
3732 tvb, offset, 4 + message_body_length, ENC_NA);
3733 message_body_tree = proto_item_add_subtree(ti_message_body, ett_reload_message_body);
3734 error_length = tvb_get_ntohs(tvb, offset);
3735 proto_tree_add_uint(message_body_tree, hf_reload_length_uint32, tvb, offset, 4, message_body_length);
3736 offset += 4;
3738 error_code = tvb_get_ntohs(tvb, offset);
3739 if (2 + 2 + error_length >length) {
3740 expert_add_info_format(pinfo, ti_message_body, &ei_reload_truncated_field, "Truncated error message");
3741 return length;
3744 ti_error = proto_tree_add_item(message_body_tree, hf_reload_error_response,
3745 tvb, offset, 2 + 2 + error_length, ENC_NA);
3746 error_tree = proto_item_add_subtree(ti_error, ett_reload_error_response);
3747 proto_tree_add_item(error_tree, hf_reload_error_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3748 proto_item_append_text(ti_error, ": %s", val_to_str_const(error_code, errorcodes, "Unknown"));
3749 switch(error_code) {
3750 case ERRORCODE_GENERATIONCOUNTERTOOLOW:
3752 uint16_t local_length = tvb_get_ntohs(tvb, offset+2);
3753 proto_tree_add_item(error_tree, hf_reload_length_uint16, tvb, offset+2, 2, ENC_BIG_ENDIAN);
3754 dissect_storeans(tvb, pinfo, error_tree, offset+4, local_length);
3756 break;
3758 case ERRORCODE_UNKNOWNKIND:
3760 uint16_t local_length = tvb_get_ntohs(tvb, offset+2);
3761 proto_tree_add_item(error_tree, hf_reload_length_uint16, tvb, offset+2, 2, ENC_BIG_ENDIAN);
3762 dissect_kindid_list(tvb, pinfo, error_tree, offset+4, local_length);
3764 break;
3766 case ERRORCODE_UNDERLAY_DESTINATION_UNREACHABLE:
3768 proto_tree_add_item(error_tree, hf_reload_opaque_string, tvb, offset+2, 32, ENC_ASCII);
3770 break;
3772 default:
3773 dissect_opaque_string(tvb, pinfo, error_tree, hf_reload_error_response_info, offset+2, 2, -1);
3774 if (error_code <= 19) {
3775 uint16_t info_length = tvb_get_ntohs(tvb,offset+2);
3776 if (info_length>0) {
3777 proto_item_append_text(ti_error, " (%s)", tvb_get_string_enc(pinfo->pool, tvb, offset+4, info_length, ENC_ASCII));
3780 break;
3783 offset += message_body_length;
3786 proto_tree *extensions_tree;
3787 proto_item *ti_extensions;
3788 proto_tree *extension_tree;
3789 int32_t extension_offset = 0;
3790 int nExtensions = 0;
3792 ti_extensions =
3793 proto_tree_add_item(message_contents_tree, hf_reload_message_extensions, tvb, offset, 4+extensions_length, ENC_NA);
3794 extensions_tree = proto_item_add_subtree(ti_extensions, ett_reload_message_extensions);
3795 proto_tree_add_item(extensions_tree, hf_reload_length_uint32, tvb, offset, 4, ENC_BIG_ENDIAN);
3796 offset += 4;
3797 while (extension_offset >= 0 && (uint32_t)extension_offset < extensions_length) {
3798 uint16_t type;
3799 proto_item *ti_extension;
3800 uint32_t extension_content_length = tvb_get_ntohl(tvb, offset + extension_offset + 3);
3801 if ((extension_offset + 3 + 4 + extension_content_length) > extensions_length) {
3802 expert_add_info_format(pinfo, ti_extensions, &ei_reload_truncated_field, "Truncated message extensions");
3803 break;
3805 ti_extension = proto_tree_add_item(extensions_tree, hf_reload_message_extension, tvb, offset+ extension_offset, 3 + 4 + extension_content_length, ENC_NA);
3806 extension_tree = proto_item_add_subtree(ti_extension, ett_reload_message_extension);
3807 type = tvb_get_ntohs(tvb, offset+ extension_offset);
3808 proto_tree_add_item(extension_tree, hf_reload_message_extension_type, tvb, offset+ extension_offset, 2, ENC_BIG_ENDIAN);
3809 proto_tree_add_item(extension_tree, hf_reload_message_extension_critical, tvb, offset+ extension_offset + 2, 1, ENC_BIG_ENDIAN);
3810 switch(type) {
3812 case MESSAGEEXTENSIONTYPE_SELF_TUNING_DATA:
3814 uint32_t extension_length;
3815 proto_tree_add_item(extension_tree, hf_reload_length_uint32, tvb, offset+extension_offset+3, 4, ENC_BIG_ENDIAN);
3816 extension_length = tvb_get_ntohl(tvb, offset+extension_offset+3);
3817 if (extension_length > 0) {
3818 dissect_selftuningdata(tvb, extension_tree, offset+extension_offset+3+4);
3821 break;
3823 case MESSAGEEXTENSIONTYPE_DIAGNOSTIC_PING:
3825 uint32_t extension_length;
3826 proto_tree_add_item(extension_tree, hf_reload_length_uint32, tvb, offset+extension_offset+3, 4, ENC_BIG_ENDIAN);
3827 extension_length = tvb_get_ntohl(tvb, offset+extension_offset+3);
3828 if ((extension_length > 0) && (MSGCODE_TO_METHOD(message_code) == METHOD_PING)) {
3829 if (IS_REQUEST(message_code)) {
3830 dissect_diagnosticrequest(-1, tvb, pinfo, extension_tree, offset+extension_offset+3+4, extension_length);
3832 else {
3833 dissect_diagnosticresponse(-1, tvb, pinfo, extension_tree, offset+extension_offset+3+4, extension_length);
3837 break;
3839 default:
3840 dissect_opaque(tvb, pinfo, extension_tree, hf_reload_message_extension_content, offset + extension_offset + 3, 4, -1);
3841 break;
3843 extension_offset += 3 + 4 + extension_content_length;
3844 nExtensions ++;
3846 proto_item_append_text(ti_extensions, " (%d elements)", nExtensions);
3849 return ( 2 + 4 + message_body_length + 4 + extensions_length);
3852 static int
3853 dissect_reload_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3855 proto_item *ti;
3856 proto_tree *reload_tree;
3857 uint32_t relo_token;
3858 unsigned effective_length;
3859 unsigned msg_length, dgram_msg_length;
3860 uint16_t offset;
3861 conversation_t *conversation;
3862 reload_conv_info_t *reload_info;
3863 reload_transaction_t *reload_trans;
3864 wmem_tree_key_t transaction_id_key[2];
3865 uint32_t transaction_id[2];
3866 uint16_t options_length;
3867 uint16_t via_list_length;
3868 uint16_t destination_list_length;
3869 uint16_t message_code;
3870 uint16_t error_code = 0;
3871 uint32_t forwarding_length;
3872 proto_tree *reload_forwarding_tree;
3873 const char *msg_class_str;
3874 const char *msg_method_str = NULL;
3875 bool fragmented = false;
3876 bool last_fragment = false;
3877 fragment_head *reload_fd_head = NULL;
3878 uint32_t fragment = 0;
3879 bool save_fragmented = false;
3880 bool update_col_info = true;
3882 offset = 0;
3883 effective_length = tvb_captured_length(tvb);
3885 /* First, make sure we have enough data to do the check. */
3886 if (effective_length < MIN_HDR_LENGTH)
3887 return 0;
3890 * First check if the frame is really meant for us.
3892 relo_token = tvb_get_ntohl(tvb,0);
3894 if (relo_token != RELOAD_TOKEN) {
3895 return 0;
3898 msg_length = get_reload_message_length(pinfo, tvb, offset);
3899 dgram_msg_length = msg_length;
3901 /* The message seems to be a valid reLOAD message! */
3903 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RELOAD");
3904 col_clear(pinfo->cinfo, COL_INFO);
3906 /* Create the transaction key which may be used to track the conversation */
3907 transaction_id[0] = tvb_get_ntohl(tvb, 20);
3908 transaction_id[1] = tvb_get_ntohl(tvb, 24);
3910 transaction_id_key[0].length = 2;
3911 transaction_id_key[0].key = transaction_id;
3912 transaction_id_key[1].length = 0;
3913 transaction_id_key[1].key = NULL;
3915 via_list_length = tvb_get_ntohs(tvb, 32);
3916 destination_list_length = tvb_get_ntohs(tvb, 34);
3917 options_length = tvb_get_ntohs(tvb, 36);
3919 forwarding_length = MIN_HDR_LENGTH + (via_list_length + destination_list_length + options_length);
3922 /* Do we already have a conversation ? */
3923 conversation = find_or_create_conversation(pinfo);
3926 * Do we already have a state structure for this conv
3928 reload_info = (reload_conv_info_t *)conversation_get_proto_data(conversation, proto_reload);
3929 if (!reload_info) {
3930 /* No. Attach that information to the conversation, and add
3931 * it to the list of information structures.
3933 reload_info = wmem_new(wmem_file_scope(), reload_conv_info_t);
3934 reload_info->transaction_pdus = wmem_tree_new(wmem_file_scope());
3935 conversation_add_proto_data(conversation, proto_reload, reload_info);
3938 ti = proto_tree_add_item(tree, proto_reload, tvb, 0, -1, ENC_NA);
3940 reload_tree = proto_item_add_subtree(ti, ett_reload);
3943 * Message dissection
3947 * Forwarding Header
3949 ti = proto_tree_add_item(reload_tree, hf_reload_forwarding, tvb, 0, forwarding_length, ENC_NA);
3950 reload_forwarding_tree = proto_item_add_subtree(ti, ett_reload_forwarding);
3952 proto_tree_add_uint(reload_forwarding_tree, hf_reload_token, tvb, 0, 4, relo_token);
3953 proto_tree_add_item(reload_forwarding_tree, hf_reload_overlay, tvb, 4, 4, ENC_BIG_ENDIAN);
3955 proto_item *ti_tmp;
3956 uint16_t tmp;
3957 tmp = tvb_get_ntohs(tvb,8);
3958 ti_tmp = proto_tree_add_item(reload_forwarding_tree, hf_reload_configuration_sequence, tvb, 8, 2, ENC_BIG_ENDIAN);
3959 if (tmp == 0) {
3960 proto_item_append_text(ti_tmp, "\n [sequence value not verified]");
3963 proto_tree_add_item(reload_forwarding_tree, hf_reload_version, tvb, 10, 1, ENC_BIG_ENDIAN);
3965 proto_tree_add_item(reload_forwarding_tree, hf_reload_ttl, tvb, 11, 1, ENC_BIG_ENDIAN);
3967 proto_item *ti_fragment;
3968 proto_tree *fragment_tree;
3969 uint32_t bit_offset;
3971 fragment = tvb_get_ntohl(tvb,12);
3973 ti_fragment = proto_tree_add_uint(reload_forwarding_tree, hf_reload_fragment_flag, tvb, 12, 4, fragment);
3974 fragment_tree = proto_item_add_subtree(ti_fragment, ett_reload_fragment_flag);
3975 bit_offset = (12) * 8;
3977 if (fragment & 0x80000000) {
3978 proto_item_append_text(ti_fragment, " (Fragment)");
3979 fragmented = true;
3981 if (fragment & 0x40000000) {
3982 proto_item_append_text(ti_fragment, " (Last)");
3983 last_fragment = true;
3985 proto_tree_add_bits_item(fragment_tree, hf_reload_fragment_fragmented, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3986 proto_tree_add_bits_item(fragment_tree, hf_reload_fragment_last_fragment, tvb, bit_offset+1, 1, ENC_BIG_ENDIAN);
3987 proto_tree_add_bits_item(fragment_tree, hf_reload_fragment_reserved, tvb, bit_offset+2, 6, ENC_BIG_ENDIAN);
3988 fragment = fragment & 0x00ffffff;
3989 proto_tree_add_uint(fragment_tree, hf_reload_fragment_offset, tvb, 13, 3, fragment);
3992 /* msg_length is already parsed */
3993 proto_tree_add_uint(reload_forwarding_tree, hf_reload_length_uint32, tvb, 16, 4, msg_length);
3994 proto_tree_add_item(reload_forwarding_tree, hf_reload_trans_id, tvb, 20, 8, ENC_BIG_ENDIAN);
3996 proto_item *ti_tmp;
3997 uint32_t tmp;
3998 tmp = tvb_get_ntohl(tvb,28);
3999 ti_tmp = proto_tree_add_item(reload_forwarding_tree, hf_reload_max_response_length, tvb, 28, 4, ENC_BIG_ENDIAN);
4000 if (0 == tmp) {
4001 proto_item_append_text(ti_tmp, "\n [Response length not restricted]");
4004 /* variable lengths fields lengths are already parsed */
4005 proto_tree_add_uint(reload_forwarding_tree, hf_reload_via_list_length, tvb, 32, 2, via_list_length);
4006 proto_tree_add_uint(reload_forwarding_tree, hf_reload_destination_list_length, tvb, 34, 2, destination_list_length);
4007 proto_tree_add_uint(reload_forwarding_tree, hf_reload_options_length, tvb, 36, 2, options_length);
4009 offset += MIN_HDR_LENGTH;
4011 if (((unsigned)offset + via_list_length) > msg_length) {
4012 expert_add_info(pinfo, ti, &ei_reload_truncated_packet);
4013 return MIN_HDR_LENGTH;
4016 if (via_list_length > 0) {
4017 proto_item *ti_vialist;
4018 proto_tree *vialist_tree;
4019 int numDestinations = 0;
4020 ti_vialist = proto_tree_add_item(reload_forwarding_tree, hf_reload_via_list, tvb, offset, via_list_length, ENC_NA);
4021 vialist_tree = proto_item_add_subtree(ti_vialist, ett_reload_via_list);
4023 dissect_destination_list(tvb, pinfo, vialist_tree, offset, via_list_length, &numDestinations);
4024 proto_item_append_text(ti_vialist, " (Destination<%d>): %d elements",via_list_length,numDestinations);
4026 offset += via_list_length;
4028 if (((unsigned)offset + destination_list_length) > msg_length) {
4029 expert_add_info(pinfo, ti, &ei_reload_truncated_packet);
4030 return offset;
4033 if (destination_list_length > 0) {
4034 proto_item *ti_destination_list;
4035 proto_tree *destination_list_tree;
4036 int numDestinations;
4037 ti_destination_list = proto_tree_add_item(reload_forwarding_tree, hf_reload_destination_list,
4038 tvb, offset, destination_list_length, ENC_NA);
4039 destination_list_tree = proto_item_add_subtree(ti_destination_list, ett_reload_destination_list);
4041 dissect_destination_list(tvb, pinfo, destination_list_tree, offset, destination_list_length, &numDestinations);
4042 proto_item_append_text(ti_destination_list, " (Destination<%d>): %d elements",
4043 destination_list_length,numDestinations);
4045 offset += destination_list_length;
4047 if (((unsigned)offset + options_length) > msg_length) {
4048 expert_add_info(pinfo, ti, &ei_reload_truncated_packet);
4049 return offset;
4052 if (options_length > 0) {
4053 int32_t local_offset = 0;
4054 proto_item *ti_options;
4055 proto_tree *options_tree;
4056 int nOptions = 0;
4058 ti_options = proto_tree_add_item(reload_forwarding_tree, hf_reload_forwarding_options, tvb, offset+local_offset, options_length, ENC_NA);
4059 options_tree = proto_item_add_subtree(ti_options, ett_reload_forwarding_options);
4060 while (local_offset >=0 && local_offset < options_length) {
4061 int local_increment;
4062 local_increment = dissect_forwardingoption(tvb, pinfo, options_tree, offset+local_offset, options_length-local_offset);
4063 if (0 >= local_increment) break;
4064 local_offset += local_increment;
4065 nOptions++;
4067 proto_item_append_text(ti_options, " (ForwardingOption<%d>): %d elements",options_length,nOptions);
4069 offset += options_length;
4071 if ((reload_defragment) && ((fragmented != false) && !((fragment == 0) && (last_fragment)))) {
4072 tvbuff_t *next_tvb = NULL;
4073 reload_fd_head = NULL;
4075 if (tvb_bytes_exist(tvb, offset, msg_length - offset)) {
4076 reload_fd_head = fragment_add_check(&reload_reassembly_table, tvb, offset,
4077 pinfo,
4078 transaction_id[0]^transaction_id[1],
4079 NULL,
4080 fragment,
4081 msg_length - offset,
4082 !last_fragment);
4084 next_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled RELOAD",
4085 reload_fd_head, &reload_frag_items, &update_col_info, reload_tree);
4087 if (next_tvb == NULL) {
4088 /* Just show this as a fragment. */
4089 col_add_fstr(pinfo->cinfo, COL_INFO, "Fragmented RELOAD protocol (trans id=%x%x off=%u",
4090 transaction_id[0],transaction_id[1], fragment);
4091 if (reload_fd_head && reload_fd_head->reassembled_in != pinfo->num) {
4092 col_append_frame_number(pinfo, COL_INFO, " [Reassembled in #%u]",
4093 reload_fd_head->reassembled_in);
4095 save_fragmented = pinfo->fragmented;
4096 pinfo->fragmented = true;
4097 call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
4098 pinfo->fragmented = save_fragmented;
4099 return effective_length;
4101 tvb = next_tvb;
4102 msg_length -= offset; /* need to adjust the length, as the new tvb starts after the forwarding header */
4103 offset = 0;
4106 effective_length = tvb_captured_length(tvb);
4107 if (effective_length < msg_length) {
4108 /* The effective length is too small for the packet */
4109 expert_add_info(pinfo, NULL, &ei_reload_truncated_packet);
4110 return 0;
4113 /*Handle retransmission after reassembly since we use message_contents for it */
4115 message_code = tvb_get_ntohs(tvb, offset);
4117 if (!pinfo->fd->visited) {
4119 if ((reload_trans = (reload_transaction_t *)
4120 wmem_tree_lookup32_array(reload_info->transaction_pdus, transaction_id_key)) == NULL) {
4121 reload_trans = wmem_new(wmem_file_scope(), reload_transaction_t);
4122 reload_trans->req_frame = 0;
4123 reload_trans->rep_frame = 0;
4124 reload_trans->req_time = pinfo->abs_ts;
4125 wmem_tree_insert32_array(reload_info->transaction_pdus, transaction_id_key, (void *)reload_trans);
4128 /* check whether the message is a request or a response */
4130 if (IS_REQUEST(message_code) && (message_code != RELOAD_ERROR)) {
4131 /* This is a request */
4132 if (reload_trans->req_frame == 0) {
4133 reload_trans->req_frame = pinfo->num;
4136 else {
4137 /* This is a catch-all for all non-request messages */
4138 if (reload_trans->rep_frame == 0) {
4139 reload_trans->rep_frame = pinfo->num;
4143 else {
4144 reload_trans = (reload_transaction_t *)wmem_tree_lookup32_array(reload_info->transaction_pdus, transaction_id_key);
4147 if (!reload_trans) {
4148 /* create a "fake" pana_trans structure */
4149 reload_trans = wmem_new(pinfo->pool, reload_transaction_t);
4150 reload_trans->req_frame = 0;
4151 reload_trans->rep_frame = 0;
4152 reload_trans->req_time = pinfo->abs_ts;
4155 /* Retransmission control */
4156 if (IS_REQUEST(message_code) && (message_code != RELOAD_ERROR)) {
4157 if (reload_trans->req_frame != pinfo->num) {
4158 proto_item *it;
4159 it = proto_tree_add_uint(reload_tree, hf_reload_duplicate, tvb, 0, 0, reload_trans->req_frame);
4160 proto_item_set_generated(it);
4162 if (reload_trans->rep_frame) {
4163 proto_item *it;
4164 it = proto_tree_add_uint(reload_tree, hf_reload_response_in, tvb, 0, 0, reload_trans->rep_frame);
4165 proto_item_set_generated(it);
4168 else {
4169 /* This is a response */
4170 if (reload_trans->rep_frame != pinfo->num) {
4171 proto_item *it;
4172 it = proto_tree_add_uint(reload_tree, hf_reload_duplicate, tvb, 0, 0, reload_trans->rep_frame);
4173 proto_item_set_generated(it);
4176 if (reload_trans->req_frame) {
4177 proto_item *it;
4178 nstime_t ns;
4180 it = proto_tree_add_uint(reload_tree, hf_reload_response_to, tvb, 0, 0, reload_trans->req_frame);
4181 proto_item_set_generated(it);
4183 nstime_delta(&ns, &pinfo->abs_ts, &reload_trans->req_time);
4184 it = proto_tree_add_time(reload_tree, hf_reload_time, tvb, 0, 0, &ns);
4185 proto_item_set_generated(it);
4189 if (message_code == RELOAD_ERROR) {
4190 error_code = tvb_get_ntohs(tvb, forwarding_length + 2+4);
4191 msg_class_str = "Error Response";
4192 col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", msg_class_str, val_to_str_const(error_code, errorcodes, "Unknown"));
4193 proto_item_append_text(ti, ": %s %s", msg_class_str, val_to_str_const(error_code, errorcodes, "Unknown"));
4195 else {
4196 msg_class_str = val_to_str(MSGCODE_TO_CLASS(message_code), classes, "Unknown %d");
4197 msg_method_str = val_to_str(MSGCODE_TO_METHOD(message_code), methods, "Unknown %d");
4199 col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
4200 msg_method_str, msg_class_str);
4201 proto_item_append_text(ti, ": %s %s", msg_method_str, msg_class_str);
4205 offset += dissect_reload_messagecontents(tvb, pinfo, reload_tree, offset, (effective_length - offset));
4207 /* Security Block */
4209 proto_item *ti_security_block;
4210 proto_tree *security_block_tree;
4211 proto_item *ti_certificates;
4212 proto_tree *certificates_tree;
4213 uint16_t certificates_length;
4214 uint16_t signeridentityvalue_length;
4215 uint16_t signaturevalue_length;
4216 uint16_t security_block_offset = 0;
4218 certificates_length = tvb_get_ntohs(tvb, offset);
4219 security_block_offset += 2 + certificates_length;
4220 security_block_offset += 2; /* SignatureAndHashAlgorithm algorithm; */
4221 security_block_offset += 1; /* SignerIdentityType identity_type; */
4222 signeridentityvalue_length = tvb_get_ntohs(tvb, offset +security_block_offset);
4223 security_block_offset += 2;
4224 security_block_offset += signeridentityvalue_length;
4225 signaturevalue_length = tvb_get_ntohs(tvb, offset +security_block_offset);
4226 security_block_offset += 2;
4227 security_block_offset += signaturevalue_length;
4229 ti_security_block = proto_tree_add_item(reload_tree, hf_reload_security_block, tvb, offset,
4230 security_block_offset, ENC_NA);
4231 security_block_tree = proto_item_add_subtree(ti_security_block, ett_reload_security_block);
4232 /* start parsing from the beginning */
4233 security_block_offset = 0;
4234 ti_certificates = proto_tree_add_item(security_block_tree,
4235 hf_reload_certificates, tvb, offset,
4236 2 + certificates_length,
4237 ENC_NA);
4238 proto_item_append_text(ti_certificates, " (GenericCertificate<%d>)", certificates_length);
4239 certificates_tree = proto_item_add_subtree(ti_certificates, ett_reload_certificates);
4240 proto_tree_add_uint(certificates_tree, hf_reload_length_uint16, tvb, offset, 2, certificates_length);
4241 security_block_offset += 2;
4242 /* certificates */
4245 int32_t certificate_offset = 0;
4246 int nCertificates = 0;
4247 while (certificate_offset >= 0 && certificate_offset < certificates_length) {
4248 proto_item *ti_genericcertificate;
4249 proto_tree *genericcertificate_tree;
4250 uint16_t certificate_length;
4252 certificate_length = tvb_get_ntohs(tvb, offset + security_block_offset + certificate_offset + 1);
4253 if (certificate_offset + 1 + 2 + certificate_length > certificates_length) {
4254 expert_add_info_format(pinfo, ti_security_block, &ei_reload_truncated_field, "Truncated certificate");
4255 break;
4257 ti_genericcertificate =
4258 proto_tree_add_item(certificates_tree,
4259 hf_reload_genericcertificate, tvb, offset + security_block_offset + certificate_offset,
4260 1 + 2 + certificate_length,
4261 ENC_NA);
4262 genericcertificate_tree = proto_item_add_subtree(ti_genericcertificate, ett_reload_genericcertificate);
4264 proto_tree_add_item(genericcertificate_tree, hf_reload_certificate_type, tvb,
4265 offset + security_block_offset + certificate_offset, 1, ENC_BIG_ENDIAN);
4267 proto_tree_add_item(genericcertificate_tree, hf_reload_length_uint16, tvb,
4268 offset + security_block_offset + certificate_offset+1, 2, ENC_BIG_ENDIAN);
4270 switch (tvb_get_uint8(tvb, offset + security_block_offset + certificate_offset)) {
4271 case 0: {
4272 asn1_ctx_t asn1_ctx;
4274 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
4275 dissect_x509af_Certificate(false, tvb, offset + security_block_offset + certificate_offset + 1 + 2, &asn1_ctx,
4276 genericcertificate_tree, hf_reload_certificate);
4278 break;
4280 default:
4281 dissect_opaque(tvb, pinfo, genericcertificate_tree, hf_reload_certificate, offset + security_block_offset + certificate_offset + 1, 2, -1);
4283 certificate_offset += 1 + 2 + certificate_length;
4284 nCertificates++;
4286 proto_item_append_text(ti_certificates, ": %d elements", nCertificates);
4289 security_block_offset += certificates_length;
4291 dissect_signature(tvb, pinfo, security_block_tree, offset + security_block_offset);
4292 /* Signature */
4296 return dgram_msg_length;
4299 static bool
4300 dissect_reload_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
4302 if (dissect_reload_message(tvb, pinfo, tree, data) == 0) {
4304 * It wasn't a valid RELOAD message, and wasn't
4305 * dissected as such.
4307 return false;
4309 return true;
4312 void
4313 proto_register_reload(void)
4315 module_t *reload_module;
4316 expert_module_t* expert_reload;
4317 static hf_register_info hf[] = {
4318 { &hf_reload_response_in,
4319 { "Response in", "reload.response-in", FT_FRAMENUM,
4320 BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0, "The response to this RELOAD Request is in this frame", HFILL
4323 { &hf_reload_response_to,
4324 { "Request in", "reload.response-to", FT_FRAMENUM,
4325 BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0, "This is a response to the RELOAD Request in this frame", HFILL
4328 { &hf_reload_time,
4329 { "Time", "reload.time", FT_RELATIVE_TIME,
4330 BASE_NONE, NULL, 0x0, "The time between the Request and the Response", HFILL
4333 { &hf_reload_duplicate,
4334 { "Duplicated original message in", "reload.duplicate", FT_FRAMENUM,
4335 BASE_NONE, NULL, 0x0, "This is a duplicate of RELOAD message in this frame", HFILL
4338 { &hf_reload_forwarding,
4339 { "ForwardingHeader", "reload.forwarding", FT_NONE,
4340 BASE_NONE, NULL, 0x0, NULL, HFILL
4343 { &hf_reload_token,
4344 { "relo_token (uint32)", "reload.forwarding.token", FT_UINT32,
4345 BASE_HEX, NULL, 0x0, NULL, HFILL
4348 { &hf_reload_overlay,
4349 { "overlay (uint32)", "reload.forwarding.overlay", FT_UINT32,
4350 BASE_HEX, NULL, 0x0, NULL, HFILL
4353 { &hf_reload_configuration_sequence,
4354 { "configuration_sequence (uint16)", "reload.forwarding.configuration_sequence", FT_UINT16,
4355 BASE_DEC, NULL, 0x0, NULL, HFILL
4358 { &hf_reload_version,
4359 { "version (uint8)", "reload.forwarding.version", FT_UINT8,
4360 BASE_HEX, VALS(versions), 0x0, NULL, HFILL
4363 { &hf_reload_ttl,
4364 { "ttl (uint8)", "reload.forwarding.ttl", FT_UINT8,
4365 BASE_DEC, NULL, 0x0, NULL, HFILL
4368 { &hf_reload_fragment_flag,
4369 { "fragment (uint32)", "reload.forwarding.fragment", FT_UINT32,
4370 BASE_HEX, NULL, 0x0, NULL, HFILL
4373 { &hf_reload_fragment_fragmented,
4374 { "Fragmented (always set)", "reload.forwarding.fragment.fragmented", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
4375 NULL, HFILL
4378 { &hf_reload_fragment_last_fragment,
4379 { "Last Fragment", "reload.forwarding.fragment.last", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
4380 NULL, HFILL
4383 { &hf_reload_fragment_reserved,
4384 { "Reserved (always 0)", "reload.forwarding.fragment.reserved", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4385 NULL, HFILL
4388 { &hf_reload_fragment_offset,
4389 { "Fragment Offset","reload.forwarding.fragment.offset", FT_UINT32,
4390 BASE_DEC, NULL, 0x0, NULL, HFILL
4393 { &hf_reload_trans_id,
4394 { "transaction_id (uint32)", "reload.forwarding.trans_id", FT_UINT64,
4395 BASE_HEX, NULL, 0x0, NULL, HFILL
4398 { &hf_reload_max_response_length,
4399 { "max_response_length (uint32)", "reload.forwarding.max_response_length", FT_UINT32,
4400 BASE_DEC, NULL, 0x0, NULL, HFILL
4403 { &hf_reload_via_list_length,
4404 { "via_list_length (uint16)", "reload.forwarding.via_list.length", FT_UINT16,
4405 BASE_DEC, NULL, 0x0, NULL, HFILL
4408 { &hf_reload_destination_list_length,
4409 { "destination_list_length (uint16)", "reload.forwarding.destination_list.length", FT_UINT16,
4410 BASE_DEC, NULL, 0x0, NULL, HFILL
4413 { &hf_reload_options_length,
4414 { "options_length (uint16)", "reload.forwarding.options.length", FT_UINT16,
4415 BASE_DEC, NULL, 0x0, NULL, HFILL
4418 { &hf_reload_via_list,
4419 { "via_list", "reload.forwarding.via_list", FT_NONE,
4420 BASE_NONE, NULL, 0x0, NULL, HFILL
4423 { &hf_reload_destination,
4424 { "Destination", "reload.destination", FT_NONE,
4425 BASE_NONE, NULL, 0x0, NULL, HFILL
4428 { &hf_reload_destination_compressed_id,
4429 { "compressed_id (uint16)", "reload.forwarding.destination.compressed_id", FT_UINT16,
4430 BASE_HEX, NULL, 0x0, NULL, HFILL
4433 { &hf_reload_destination_type,
4434 { "type (DestinationType)", "reload.forwarding.destination.type", FT_UINT8,
4435 BASE_HEX, VALS(destinationtypes), 0x0, NULL, HFILL
4438 { &hf_reload_destination_data_node_id,
4439 { "node_id (NodeId)", "reload.destination.data.nodeid", FT_BYTES,
4440 BASE_NONE, NULL, 0x0, NULL, HFILL
4443 { &hf_reload_destination_data_resource_id,
4444 { "resource_id", "reload.destination.data.resourceid", FT_NONE,
4445 BASE_NONE, NULL, 0x0, NULL, HFILL
4448 { &hf_reload_nodeid,
4449 { "NodeId", "reload.nodeid", FT_BYTES,
4450 BASE_NONE, NULL, 0x0, NULL, HFILL
4453 { &hf_reload_resourceid,
4454 { "ResourceId", "reload.resource_id", FT_NONE,
4455 BASE_NONE, NULL, 0x0, NULL, HFILL
4458 { &hf_reload_destination_data_compressed_id,
4459 { "compressed_id", "reload.destination.data.compressed_id", FT_NONE,
4460 BASE_NONE, NULL, 0x0, NULL, HFILL
4463 { &hf_reload_destination_list,
4464 { "destination_list", "reload.forwarding.destination_list", FT_NONE,
4465 BASE_NONE, NULL, 0x0, NULL, HFILL
4468 { &hf_reload_forwarding_options,
4469 { "options", "reload.forwarding.options", FT_NONE,
4470 BASE_NONE, NULL, 0x0, NULL, HFILL
4473 { &hf_reload_forwarding_option,
4474 { "ForwardingOption", "reload.forwarding.option", FT_NONE,
4475 BASE_NONE, NULL, 0x0, NULL, HFILL
4478 { &hf_reload_forwarding_option_type,
4479 { "type (ForwardingOptionType)", "reload.forwarding.option.type", FT_UINT8,
4480 BASE_DEC, VALS(forwardingoptiontypes), 0x0, NULL, HFILL
4483 { &hf_reload_forwarding_option_flags,
4484 { "flags (uint8)", "reload.forwarding.option.flags", FT_UINT8,
4485 BASE_HEX, NULL, 0x0, NULL, HFILL
4488 { &hf_reload_forwarding_option_flag_ignore_state_keeping,
4489 { "IGNORE_STATE_KEEPING", "reload.forwarding.option.flag.ignore_state_keeping", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
4490 NULL, HFILL
4493 { &hf_reload_forwarding_option_flag_response_copy,
4494 { "RESPONSE_COPY", "reload.forwarding.option.flag.response_copy", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
4495 NULL, HFILL
4498 { &hf_reload_forwarding_option_flag_destination_critical,
4499 { "DESTINATION_CRITICAL", "reload.forwarding.option.flags.destination_critical", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
4500 NULL, HFILL
4503 { &hf_reload_forwarding_option_flag_forward_critical,
4504 { "FORWARD_CRITICAL", "reload.forwarding.option.flags.forward_critical", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
4505 NULL, HFILL
4508 { &hf_reload_attachreqans,
4509 { "AttachReqAns", "reload.attachreqans", FT_NONE,
4510 BASE_NONE, NULL, 0x0, NULL, HFILL
4513 { &hf_reload_ufrag,
4514 { "ufrag", "reload.ufrag", FT_NONE,
4515 BASE_NONE, NULL, 0x0, NULL, HFILL
4518 { &hf_reload_password,
4519 { "password", "reload.password", FT_NONE,
4520 BASE_NONE, NULL, 0x0, NULL, HFILL
4523 { &hf_reload_role,
4524 { "role", "reload.role", FT_NONE,
4525 BASE_NONE, NULL, 0x0, NULL, HFILL
4528 { &hf_reload_icecandidates,
4529 { "candidates", "reload.icecandidates", FT_NONE,
4530 BASE_NONE, NULL, 0x0, NULL, HFILL
4533 { &hf_reload_icecandidate,
4534 { "IceCandidate", "reload.icecandidate", FT_NONE,
4535 BASE_NONE, NULL, 0x0, NULL, HFILL
4538 { &hf_reload_icecandidate_addr_port,
4539 { "addr_port", "reload.icecandidate.addr_port", FT_NONE,
4540 BASE_NONE, NULL, 0x0, NULL, HFILL
4543 { &hf_reload_icecandidate_relay_addr,
4544 { "rel_addr_port", "reload.icecandidate.relay_addr", FT_NONE,
4545 BASE_NONE, NULL, 0x0, NULL, HFILL
4548 { &hf_reload_ipaddressport,
4549 { "IpAddressPort", "reload.ipaddressport", FT_NONE,
4550 BASE_NONE, NULL, 0x0, NULL, HFILL
4553 { &hf_reload_ipaddressport_type,
4554 { "type (AddressType)", "reload.ipaddressport.type", FT_UINT8,
4555 BASE_HEX, VALS(ipaddressporttypes), 0x0, NULL, HFILL
4558 { &hf_reload_ipv4addrport,
4559 { "IPv4AddrPort", "reload.ipv4addrport", FT_NONE,
4560 BASE_NONE, NULL, 0x0, NULL, HFILL
4563 { &hf_reload_ipv4addr,
4564 { "addr (uint32)", "reload.ipv4addr", FT_IPv4,
4565 BASE_NONE, NULL, 0x0, NULL, HFILL
4568 { &hf_reload_ipv6addrport,
4569 { "IPv6AddrPort", "reload.ipv6addrport", FT_NONE,
4570 BASE_NONE, NULL, 0x0, NULL, HFILL
4573 { &hf_reload_ipv6addr,
4574 { "addr (uint128)", "reload.ipv6addr", FT_IPv6,
4575 BASE_NONE, NULL, 0x0, NULL, HFILL
4578 { &hf_reload_port,
4579 { "port (uint16)", "reload.port", FT_UINT16,
4580 BASE_DEC, NULL, 0x0, NULL, HFILL
4583 { &hf_reload_overlaylink_type,
4584 { "overlay_link (OverlayLinkType)", "reload.overlaylink.type", FT_UINT8,
4585 BASE_DEC, VALS(overlaylinktypes), 0x0, NULL, HFILL
4588 { &hf_reload_icecandidate_foundation,
4589 { "foundation", "reload.icecandidate.foundation", FT_NONE,
4590 BASE_NONE, NULL, 0x0, NULL, HFILL
4593 { &hf_reload_icecandidate_priority,
4594 { "priority (uint32)", "reload.icecandidate.priority", FT_UINT32,
4595 BASE_DEC, NULL, 0x0, NULL, HFILL
4598 { &hf_reload_icecandidate_type,
4599 { "Ice candidate type", "reload.icecandidate.type", FT_UINT8,
4600 BASE_DEC, VALS(candtypes), 0x0, NULL, HFILL
4603 { &hf_reload_iceextensions,
4604 { "extensions", "reload.iceextensions", FT_NONE,
4605 BASE_NONE, NULL, 0x0, NULL, HFILL
4608 { &hf_reload_iceextension,
4609 { "IceExtension", "reload.iceextension", FT_NONE,
4610 BASE_NONE, NULL, 0x0, NULL, HFILL
4613 { &hf_reload_iceextension_name,
4614 { "name", "reload.iceextension.name", FT_NONE,
4615 BASE_NONE, NULL, 0x0, NULL, HFILL
4618 { &hf_reload_iceextension_value,
4619 { "value", "reload.iceextension.value", FT_NONE,
4620 BASE_NONE, NULL, 0x0, NULL, HFILL
4623 { &hf_reload_sendupdate,
4624 { "send_update (Boolean)", "reload.sendupdate", FT_BOOLEAN,
4625 BASE_NONE, NULL, 0x0, NULL, HFILL
4628 { &hf_reload_message_contents,
4629 { "MessageContents", "reload.message.contents", FT_NONE,
4630 BASE_NONE, NULL, 0x0, NULL, HFILL
4633 { &hf_reload_message_code,
4634 { "message_code (uint16)", "reload.message.code", FT_UINT16,
4635 BASE_DEC, NULL, 0x0, NULL, HFILL
4638 { &hf_reload_message_body,
4639 { "message_body", "reload.message.body", FT_NONE,
4640 BASE_NONE, NULL, 0x0, NULL, HFILL
4643 { &hf_reload_message_extensions,
4644 { "extensions", "reload.message.extensions", FT_NONE,
4645 BASE_NONE, NULL, 0x0, NULL, HFILL
4648 { &hf_reload_message_extension,
4649 { "MessageExtension", "reload.message_extension", FT_NONE,
4650 BASE_NONE, NULL, 0x0, NULL, HFILL
4653 { &hf_reload_message_extension_type,
4654 { "type (MessageExtensionType)", "reload.message_extension.type", FT_UINT16,
4655 BASE_DEC, VALS(messageextensiontypes), 0x0, NULL, HFILL
4658 { &hf_reload_message_extension_critical,
4659 { "critical (Boolean)", "reload.message_extension.critical", FT_BOOLEAN,
4660 BASE_NONE, NULL, 0x0, NULL, HFILL
4663 { &hf_reload_message_extension_content,
4664 { "extension_content", "reload.message_extension.content", FT_BYTES,
4665 BASE_NONE, NULL, 0x0, NULL, HFILL
4668 { &hf_reload_error_response,
4669 { "ErrorResponse", "reload.error_response", FT_NONE,
4670 BASE_NONE, NULL, 0x0, NULL, HFILL
4673 { &hf_reload_error_response_code,
4674 { "error_code (uint16)", "reload.error_response.code", FT_UINT16,
4675 BASE_DEC, VALS(errorcodes), 0x0, NULL, HFILL
4678 { &hf_reload_error_response_info,
4679 { "error_info", "reload.error_response_info", FT_NONE,
4680 BASE_NONE, NULL, 0x0, NULL, HFILL
4683 { &hf_reload_security_block,
4684 { "SecurityBlock", "reload.security_block", FT_NONE,
4685 BASE_NONE, NULL, 0x0, NULL, HFILL
4688 { &hf_reload_certificates,
4689 { "certificates", "reload.certificates", FT_NONE,
4690 BASE_NONE, NULL, 0x0, NULL, HFILL
4693 { &hf_reload_certificate_type,
4694 { "type (CertificateType)", "reload.certificate.type", FT_UINT8,
4695 BASE_DEC, VALS(tls_certificate_type), 0x0, NULL, HFILL
4698 { &hf_reload_genericcertificate,
4699 { "GenericCertificate", "reload.genericcertificate", FT_NONE,
4700 BASE_NONE, NULL, 0x0, NULL, HFILL
4703 { &hf_reload_certificate,
4704 { "certificate", "reload.certificate", FT_NONE,
4705 BASE_NONE, NULL, 0x0, NULL, HFILL
4708 { &hf_reload_signature,
4709 { "signature (Signature)", "reload.signature", FT_NONE,
4710 BASE_NONE, NULL, 0x0, NULL, HFILL
4713 { &hf_reload_signatureandhashalgorithm,
4714 { "algorithm (SignatureAndHashAlgorithm)", "reload.signatureandhashalgorithm", FT_NONE,
4715 BASE_NONE, NULL, 0x0, NULL, HFILL
4718 { &hf_reload_hash_algorithm,
4719 { "hash (HashAlgorithm)", "reload.hash_algorithm", FT_UINT8,
4720 BASE_DEC, VALS(tls_hash_algorithm), 0x0, NULL, HFILL
4723 { &hf_reload_signeridentity_value_hash_alg,
4724 { "hash_alg (HashAlgorithm)", "reload.signeridentityvalue.hash_alg", FT_UINT8,
4725 BASE_DEC, VALS(tls_hash_algorithm), 0x0, NULL, HFILL
4728 { &hf_reload_signature_algorithm,
4729 { "signature (SignatureAlgorithm)", "reload.signature_algorithm", FT_UINT8,
4730 BASE_DEC, VALS(tls_signature_algorithm), 0x0, NULL, HFILL
4733 { &hf_reload_signeridentity,
4734 { "identity (SignerIdentity)", "reload.signature.identity", FT_NONE,
4735 BASE_NONE, NULL, 0x0, NULL, HFILL
4738 { &hf_reload_signeridentity_identity,
4739 { "identity", "reload.signature.identity.identity", FT_NONE,
4740 BASE_NONE, NULL, 0x0, NULL, HFILL
4743 { &hf_reload_signeridentity_type,
4744 { "identity_type (SignerIdentityType)", "reload.signature.identity.type", FT_UINT8,
4745 BASE_DEC, VALS(signeridentitytypes), 0x0, NULL, HFILL
4748 { &hf_reload_signeridentity_value,
4749 { "SignatureIdentityValue", "reload.signature.identity.value", FT_NONE,
4750 BASE_NONE, NULL, 0x0, NULL, HFILL
4753 { &hf_reload_signeridentity_value_certificate_hash,
4754 { "certificate_hash", "reload.signature.identity.value.certificate_hash", FT_NONE,
4755 BASE_NONE, NULL, 0x0, NULL, HFILL
4758 { &hf_reload_signeridentity_value_certificate_node_id_hash,
4759 { "certificate_node_id_hash", "reload.signature.identity.value.certificate_node_id_hash", FT_NONE,
4760 BASE_NONE, NULL, 0x0, NULL, HFILL
4763 { &hf_reload_signature_value,
4764 { "signature_value", "reload.signature.value", FT_NONE,
4765 BASE_NONE, NULL, 0x0, NULL, HFILL
4768 { &hf_reload_length_uint8,
4769 { "length (uint8)", "reload.length.8", FT_UINT8,
4770 BASE_DEC, NULL, 0x0, NULL, HFILL
4773 { &hf_reload_length_uint16,
4774 { "length (uint16)", "reload.length.16", FT_UINT16,
4775 BASE_DEC, NULL, 0x0, NULL, HFILL
4778 { &hf_reload_length_uint24,
4779 { "length (uint24)", "reload.length.24", FT_UINT32,
4780 BASE_DEC, NULL, 0x0, NULL, HFILL
4783 { &hf_reload_length_uint32,
4784 { "length (uint32)", "reload.length.32", FT_UINT32,
4785 BASE_DEC, NULL, 0x0, NULL, HFILL
4788 { &hf_reload_opaque,
4789 { "opaque", "reload.opaque", FT_NONE,
4790 BASE_NONE, NULL, 0x0, NULL, HFILL
4793 { &hf_reload_opaque_data,
4794 { "data (bytes)", "reload.opaque.data", FT_BYTES,
4795 BASE_NONE, NULL, 0x0, NULL, HFILL
4798 { &hf_reload_opaque_string,
4799 { "data (string)", "reload.opaque.string", FT_STRING,
4800 BASE_NONE, NULL, 0x0, NULL, HFILL
4803 { &hf_reload_routequeryreq,
4804 { "RouteQueryReq", "reload.routequeryreq", FT_NONE,
4805 BASE_NONE, NULL, 0x0, NULL, HFILL
4808 { &hf_reload_routequeryreq_destination,
4809 { "destination", "reload.routequeryreq.destination", FT_NONE,
4810 BASE_NONE, NULL, 0x0, NULL, HFILL
4813 { &hf_reload_overlay_specific,
4814 { "overlay_specific_data", "reload.overlay_specific_data", FT_NONE,
4815 BASE_NONE, NULL, 0x0, NULL, HFILL
4818 { &hf_reload_probereq,
4819 { "ProbeReq", "reload.probereq", FT_NONE,
4820 BASE_NONE, NULL, 0x0, NULL, HFILL
4823 { &hf_reload_probereq_requested_info,
4824 { "requested_info", "reload.probereq.requested_info", FT_NONE,
4825 BASE_NONE, NULL, 0x0, NULL, HFILL
4828 { &hf_reload_probe_information,
4829 { "ProbeInformation", "reload.probe_information", FT_NONE,
4830 BASE_NONE, NULL, 0x0, NULL, HFILL
4833 { &hf_reload_probe_information_data,
4834 { "value (ProbeInformationData)", "reload.probe_information_data", FT_NONE,
4835 BASE_NONE, NULL, 0x0, NULL, HFILL
4838 { &hf_reload_probe_information_type,
4839 { "type (ProbeInformationType)", "reload.probe_information.type", FT_UINT8,
4840 BASE_HEX, VALS(probeinformationtypes), 0x0, NULL, HFILL
4843 { &hf_reload_responsible_set,
4844 { "responsible_ppb (uint32)", "reload.responsible_set", FT_UINT32,
4845 BASE_HEX, NULL, 0x0, NULL, HFILL
4848 { &hf_reload_num_resources,
4849 { "num_resources (uint32)", "reload.num_resources", FT_UINT32,
4850 BASE_DEC, NULL, 0x0, NULL, HFILL
4853 { &hf_reload_uptime,
4854 { "uptime (uint32)", "reload.uptime", FT_UINT32,
4855 BASE_DEC, NULL, 0x0, NULL, HFILL
4858 { &hf_reload_probeans,
4859 { "ProbeAns", "reload.probeans", FT_NONE,
4860 BASE_NONE, NULL, 0x0, NULL, HFILL
4863 { &hf_reload_probeans_probe_info,
4864 { "probe_info", "reload.probe_info", FT_NONE,
4865 BASE_NONE, NULL, 0x0, NULL, HFILL
4868 { &hf_reload_appattachreq,
4869 { "AppAttachReq", "reload.appattachreq", FT_NONE,
4870 BASE_NONE, NULL, 0x0, NULL, HFILL
4873 { &hf_reload_appattachans,
4874 { "AppAttachAns", "reload.appattachans", FT_NONE,
4875 BASE_NONE, NULL, 0x0, NULL, HFILL
4878 { &hf_reload_application,
4879 { "application (uint16)", "reload.application", FT_UINT16,
4880 BASE_DEC, VALS(applicationids), 0x0, NULL, HFILL
4883 { &hf_reload_ping_response_id,
4884 { "response_id (uint64)", "reload.ping.response_id", FT_UINT64,
4885 BASE_DEC, NULL, 0x0, NULL, HFILL
4888 { &hf_reload_ping_time,
4889 { "time (uint64)", "reload.ping.time", FT_ABSOLUTE_TIME,
4890 ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL
4893 { &hf_reload_storeddata,
4894 { "StoredData", "reload.storeddata", FT_NONE,
4895 BASE_NONE, NULL, 0x0, NULL, HFILL
4898 { &hf_reload_storedmetadata,
4899 { "StoredMetaData", "reload.storedmetadata", FT_NONE,
4900 BASE_NONE, NULL, 0x0, NULL, HFILL
4903 { &hf_reload_storeddata_storage_time,
4904 { "storage_time (uint64)", "reload.storeddata.storage_time", FT_ABSOLUTE_TIME,
4905 ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL
4908 { &hf_reload_storeddata_lifetime,
4909 { "lifetime (uint32)", "reload.storeddata.lifetime", FT_UINT32,
4910 BASE_DEC, NULL, 0x0, NULL, HFILL
4913 { &hf_reload_datavalue,
4914 { "DataValue", "reload.datavalue", FT_NONE,
4915 BASE_NONE, NULL, 0x0, NULL, HFILL
4918 { &hf_reload_value,
4919 { "value", "reload.value", FT_NONE,
4920 BASE_NONE, NULL, 0x0, NULL, HFILL
4923 { &hf_reload_metadata,
4924 { "MetaData", "reload.metadata", FT_NONE,
4925 BASE_NONE, NULL, 0x0, NULL, HFILL
4928 { &hf_reload_datavalue_exists,
4929 { "exists (Boolean)", "reload.datavalue.exists", FT_BOOLEAN,
4930 BASE_NONE, NULL, 0x0, NULL, HFILL
4933 { &hf_reload_datavalue_value,
4934 { "value", "reload.datavaluevalue", FT_NONE,
4935 BASE_NONE, NULL, 0x0, NULL, HFILL
4938 { &hf_reload_metadata_value_length,
4939 { "value_length (uint32)", "reload.metadata.value_length", FT_UINT32,
4940 BASE_DEC, NULL, 0x0, NULL, HFILL
4943 { & hf_reload_metadata_hash_value,
4944 { "hash_value", "reload.metadata.hash_value", FT_NONE,
4945 BASE_NONE, NULL, 0x0, NULL, HFILL
4948 { &hf_reload_arrayentry,
4949 { "ArrayEntry", "reload.arrayentry", FT_NONE,
4950 BASE_NONE, NULL, 0x0, NULL, HFILL
4953 { &hf_reload_arrayentry_index,
4954 { "index (uint32)", "reload.arrayentry.index", FT_UINT32,
4955 BASE_DEC, NULL, 0x0, NULL, HFILL
4958 { &hf_reload_arrayentry_value,
4959 { "value", "reload.arrayentry.value", FT_NONE,
4960 BASE_NONE, NULL, 0x0, NULL, HFILL
4963 { &hf_reload_dictionaryentry,
4964 { "DictionaryEntry", "reload.dictionaryentry", FT_NONE,
4965 BASE_NONE, NULL, 0x0, NULL, HFILL
4968 { &hf_reload_dictionarykey,
4969 { "key (DictionaryKey)", "reload.dictionarykey", FT_NONE,
4970 BASE_NONE, NULL, 0x0, NULL, HFILL
4973 { &hf_reload_dictionary_value,
4974 { "value (DataValue)", "reload.dictionary.value", FT_NONE,
4975 BASE_NONE, NULL, 0x0, NULL, HFILL
4978 { &hf_reload_kinddata,
4979 { "StoreKindData", "reload.kinddata", FT_NONE,
4980 BASE_NONE, NULL, 0x0, NULL, HFILL
4983 { &hf_reload_kinddata_kind,
4984 { "kind (KindId)", "reload.kinddata.kind", FT_UINT32,
4985 BASE_DEC, NULL, 0x0, NULL, HFILL
4988 { &hf_reload_statkindresponse,
4989 { "StatKindResponse", "reload.statkindresponse", FT_NONE,
4990 BASE_NONE, NULL, 0x0, NULL, HFILL
4993 { &hf_reload_kindid,
4994 { "KindId", "reload.kindid", FT_UINT32,
4995 BASE_DEC, NULL, 0x0, NULL, HFILL
4998 { &hf_reload_kindid_list,
4999 { "kinds", "reload.kindid_list", FT_NONE,
5000 BASE_NONE, NULL, 0x0, NULL, HFILL
5003 { &hf_reload_generation_counter,
5004 { "generation_counter (uint64)", "reload.generation_counter", FT_UINT64,
5005 BASE_DEC, NULL, 0x0, NULL, HFILL
5008 { &hf_reload_values,
5009 { "values", "reload.kinddata.values_length", FT_NONE,
5010 BASE_NONE, NULL, 0x0, NULL, HFILL
5013 { &hf_reload_storereq,
5014 { "StoreReq", "reload.storereq", FT_NONE,
5015 BASE_NONE, NULL, 0x0, NULL, HFILL
5018 { &hf_reload_resource,
5019 { "resource", "reload.resource", FT_NONE,
5020 BASE_NONE, NULL, 0x0, NULL, HFILL
5023 { &hf_reload_store_replica_num,
5024 { "replica_number (uint8)", "reload.store.replica_number", FT_UINT8,
5025 BASE_DEC, NULL, 0x0, NULL, HFILL
5028 { &hf_reload_store_kind_data,
5029 { "kind_data", "reload.store.kind_data", FT_NONE,
5030 BASE_NONE, NULL, 0x0, NULL, HFILL
5033 { &hf_reload_storeans,
5034 { "StoreAns", "reload.storeans", FT_NONE,
5035 BASE_NONE, NULL, 0x0, NULL, HFILL
5038 { &hf_reload_storeans_kind_responses,
5039 { "kind_responses", "reload.storeans.kind_responses", FT_NONE,
5040 BASE_NONE, NULL, 0x0, NULL, HFILL
5043 { &hf_reload_storekindresponse,
5044 { "StoreKindResponse", "reload.storekindresponse", FT_NONE,
5045 BASE_NONE, NULL, 0x0, NULL, HFILL
5048 { &hf_reload_replicas,
5049 { "replicas", "reload.storekindresponse.replicas", FT_NONE,
5050 BASE_NONE, NULL, 0x0, NULL, HFILL
5053 { &hf_reload_statreq,
5054 { "StatReq", "reload.statreq", FT_NONE,
5055 BASE_NONE, NULL, 0x0, NULL, HFILL
5058 { &hf_reload_fetchans,
5059 { "FetchAns", "reload.fetchans", FT_NONE,
5060 BASE_NONE, NULL, 0x0, NULL, HFILL
5063 { &hf_reload_fetchreq,
5064 { "FetchReq", "reload.fetchreq", FT_NONE,
5065 BASE_NONE, NULL, 0x0, NULL, HFILL
5068 { &hf_reload_fetchreq_specifiers,
5069 { "specifiers", "reload.fetchreq.specifiers", FT_NONE,
5070 BASE_NONE, NULL, 0x0, NULL, HFILL
5073 { &hf_reload_arrayrange,
5074 { "ArrayRange", "reload.arrayrange", FT_NONE,
5075 BASE_NONE, NULL, 0x0, NULL, HFILL
5078 { &hf_reload_storeddataspecifier,
5079 { "StoredDataSpecifier", "reload.storeddataspecifier", FT_NONE,
5080 BASE_NONE, NULL, 0x0, NULL, HFILL
5083 { &hf_reload_storeddataspecifier_indices,
5084 { "indices", "reload.storeddataspecifier.indices", FT_NONE,
5085 BASE_NONE, NULL, 0x0, NULL, HFILL
5088 { &hf_reload_storeddataspecifier_keys,
5089 { "indices", "reload.storeddataspecifier.keys", FT_NONE,
5090 BASE_NONE, NULL, 0x0, NULL, HFILL
5093 { &hf_reload_statans,
5094 { "StatAns", "reload.statans", FT_NONE,
5095 BASE_NONE, NULL, 0x0, NULL, HFILL
5098 { &hf_reload_findans,
5099 { "FindAns", "reload.findans", FT_NONE,
5100 BASE_NONE, NULL, 0x0, NULL, HFILL
5103 { &hf_reload_findkinddata_closest,
5104 { "closest", "reload.findkindata.closest", FT_NONE,
5105 BASE_NONE, NULL, 0x0, NULL, HFILL
5108 { &hf_reload_findkinddata,
5109 { "FindKindData", "reload.findkinddata", FT_NONE,
5110 BASE_NONE, NULL, 0x0, NULL, HFILL
5113 { &hf_reload_fragment_overlap,
5114 { "Fragment overlap", "reload.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
5115 "Fragment overlaps with other fragments", HFILL
5119 { &hf_reload_fragment_overlap_conflict,
5120 { "Conflicting data in fragment overlap", "reload.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
5121 "Overlapping fragments contained conflicting data", HFILL
5125 { &hf_reload_fragment_multiple_tails,
5126 { "Multiple tail fragments found", "reload.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
5127 "Several tails were found when defragmenting the packet", HFILL
5131 { &hf_reload_fragment_too_long_fragment,
5132 { "Fragment too long", "reload.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
5133 "Fragment contained data past end of packet", HFILL
5137 { &hf_reload_fragment_error,
5138 { "Defragmentation error", "reload.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
5139 "Defragmentation error due to illegal fragments", HFILL
5143 { &hf_reload_fragment_count,
5144 { "Fragment count", "reload.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0,
5145 NULL, HFILL
5149 { &hf_reload_fragment,
5150 { "RELOAD fragment", "reload.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
5151 NULL, HFILL
5155 { &hf_reload_fragments,
5156 { "RELOAD fragments", "reload.fragments", FT_NONE, BASE_NONE, NULL, 0x0,
5157 NULL, HFILL
5161 { &hf_reload_reassembled_in,
5162 { "Reassembled RELOAD in frame", "reload.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
5163 "This RELOAD packet is reassembled in this frame", HFILL
5167 { &hf_reload_reassembled_length,
5168 { "Reassembled RELOAD length", "reload.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0,
5169 "The total length of the reassembled payload", HFILL
5173 { &hf_reload_configupdatereq,
5174 { "ConfigUpdateReq", "reload.configupdatereq", FT_NONE,
5175 BASE_NONE, NULL, 0x0, NULL, HFILL
5179 { &hf_reload_configupdatereq_type,
5180 { "type (ConfigUpdateType)", "reload.configupdatereq.type", FT_UINT8,
5181 BASE_DEC, VALS(configupdatetypes), 0x0, NULL, HFILL
5185 { &hf_reload_configupdatereq_configdata,
5186 { "config_data", "reload.configupdatereq.config_data", FT_NONE,
5187 BASE_NONE, NULL, 0x0, NULL, HFILL
5191 { &hf_reload_configupdatereq_kinds,
5192 { "kinds", "reload.configupdatereq.kinds", FT_NONE,
5193 BASE_NONE, NULL, 0x0, NULL, HFILL
5196 { &hf_reload_kinddescription,
5197 { "KindDescription", "reload.configupdatereq.kinddescription", FT_NONE,
5198 BASE_NONE, NULL, 0x0, NULL, HFILL
5201 { &hf_reload_pingreq,
5202 { "PingReq", "reload.pingreq", FT_NONE,
5203 BASE_NONE, NULL, 0x0, NULL, HFILL
5206 { &hf_reload_pingans,
5207 { "PingAns", "reload.pingans", FT_NONE,
5208 BASE_NONE, NULL, 0x0, NULL, HFILL
5211 { &hf_reload_padding,
5212 { "padding", "reload.padding", FT_NONE,
5213 BASE_NONE, NULL, 0x0, NULL, HFILL
5217 { &hf_reload_chordupdate,
5218 { "ChordUpdate", "reload.chordupdate", FT_NONE,
5219 BASE_NONE, NULL, 0x0, NULL, HFILL
5222 { &hf_reload_chordupdate_type,
5223 { "type (ChordUpdateType)", "reload.chordupdate.type", FT_UINT8,
5224 BASE_DEC, VALS(chordupdatetypes), 0x0, NULL, HFILL
5227 { &hf_reload_chordupdate_predecessors,
5228 { "predecessors", "reload.chordupdate.predecessors", FT_NONE,
5229 BASE_NONE, NULL, 0x0, NULL, HFILL
5232 { &hf_reload_chordupdate_successors,
5233 { "successors", "reload.chordupdate.successors", FT_NONE,
5234 BASE_NONE, NULL, 0x0, NULL, HFILL
5237 { &hf_reload_chordupdate_fingers,
5238 { "fingers", "reload.chordupdate.fingers", FT_NONE,
5239 BASE_NONE, NULL, 0x0, NULL, HFILL
5242 { &hf_reload_chordroutequeryans,
5243 { "ChordRouteQueryAns", "reload.chordroutequeryans", FT_NONE,
5244 BASE_NONE, NULL, 0x0, NULL, HFILL
5247 { &hf_reload_chordroutequeryans_next_peer,
5248 { "next_peer (NodeId)", "reload.chordroutequeryans.nodeid", FT_BYTES,
5249 BASE_NONE, NULL, 0x0, NULL, HFILL
5252 { &hf_reload_chordleave,
5253 { "ChordLeaveData", "reload.chordleavedata", FT_NONE,
5254 BASE_NONE, NULL, 0x0, NULL, HFILL
5257 { &hf_reload_chordleave_type,
5258 { "type (ChordLeaveType)", "reload.chordleavedata.type", FT_UINT8,
5259 BASE_DEC, VALS(chordleavetypes), 0x0, NULL, HFILL
5262 { &hf_reload_chordleave_predecessors,
5263 { "predecessors", "reload.chordleavedata.predecessors", FT_NONE,
5264 BASE_NONE, NULL, 0x0, NULL, HFILL
5267 { &hf_reload_chordleave_successors,
5268 { "successors", "reload.chordleavedata.successors", FT_NONE,
5269 BASE_NONE, NULL, 0x0, NULL, HFILL
5272 { &hf_reload_turnserver,
5273 { "TurnServer", "reload.turnserver", FT_NONE,
5274 BASE_NONE, NULL, 0x0, NULL, HFILL
5277 { &hf_reload_turnserver_iteration,
5278 { "iteration (uint8)", "reload.turnserver.iteration", FT_UINT8,
5279 BASE_DEC, NULL, 0x0, NULL, HFILL
5282 { &hf_reload_turnserver_server_address,
5283 { "server_address", "reload.turnserver.server_address", FT_NONE,
5284 BASE_NONE, NULL, 0x0, NULL, HFILL
5287 { &hf_reload_sipregistration,
5288 { "SipRegistration", "reload.sipregistration", FT_NONE,
5289 BASE_NONE, NULL, 0x0, NULL, HFILL
5292 { &hf_reload_sipregistration_type,
5293 { "type (SipRegistrationType)", "reload.sipregistration.type", FT_UINT8,
5294 BASE_DEC, VALS(sipregistrationtypes), 0x0, NULL, HFILL
5297 { &hf_reload_sipregistration_data,
5298 { "data (SipRegistrationData)", "reload.sipregistration.data", FT_NONE,
5299 BASE_NONE, NULL, 0x0, NULL, HFILL
5302 { &hf_reload_sipregistration_data_uri,
5303 { "uri", "reload.sipregistration.data.uri", FT_NONE,
5304 BASE_NONE, NULL, 0x0, NULL, HFILL
5307 { &hf_reload_sipregistration_data_contact_prefs,
5308 { "contact_prefs", "reload.sipregistration.data.contact_prefs", FT_NONE,
5309 BASE_NONE, NULL, 0x0, NULL, HFILL
5312 { &hf_reload_sipregistration_data_destination_list,
5313 { "destination_list", "reload.sipregistration.data.destination_list", FT_NONE,
5314 BASE_NONE, NULL, 0x0, NULL, HFILL
5317 { &hf_reload_redirserviceprovider,
5318 { "RedirServiceProvider", "reload.redirserviceprovider", FT_NONE,
5319 BASE_NONE, NULL, 0x0, NULL, HFILL
5322 { &hf_reload_redirserviceproviderdata,
5323 { "data (RedirServiceProviderData)", "reload.redirserviceprovider.data", FT_NONE,
5324 BASE_NONE, NULL, 0x0, NULL, HFILL
5327 { &hf_reload_redirserviceproviderdata_serviceprovider,
5328 { "serviceProvider (NodeId)", "reload.redirserviceprovider.data.serviceprovider", FT_BYTES,
5329 BASE_NONE, NULL, 0x0, NULL, HFILL
5332 { &hf_reload_redirserviceproviderdata_namespace,
5333 { "namespace", "reload.redirserviceprovider.data.namespace", FT_NONE,
5334 BASE_NONE, NULL, 0x0, NULL, HFILL
5337 { &hf_reload_redirserviceproviderdata_level,
5338 { "level (uint16)", "reload.redirserviceprovider.data.level", FT_UINT16,
5339 BASE_DEC, NULL, 0x0, NULL, HFILL
5342 { &hf_reload_redirserviceproviderdata_node,
5343 { "node (uint16)", "reload.redirserviceprovider.data.node", FT_UINT16,
5344 BASE_DEC, NULL, 0x0, NULL, HFILL
5347 { &hf_reload_self_tuning_data,
5348 { "SelfTuningData", "reload.selftuning_data", FT_NONE,
5349 BASE_NONE, NULL, 0x0, NULL, HFILL
5352 { &hf_reload_self_tuning_data_network_size,
5353 { "network_size (uint32)", "reload.selftuning_data.network_size", FT_UINT32,
5354 BASE_DEC, NULL, 0x0, NULL, HFILL
5357 { &hf_reload_self_tuning_data_join_rate,
5358 { "join_rate (uint32)", "reload.selftuning_data.join_rate", FT_UINT32,
5359 BASE_DEC, NULL, 0x0, NULL, HFILL
5362 { &hf_reload_self_tuning_data_leave_rate,
5363 { "leave_rate (uint32)", "reload.selftuning_data.leave_rate", FT_UINT32,
5364 BASE_DEC, NULL, 0x0, NULL, HFILL
5367 { &hf_reload_findreq,
5368 { "FindReq", "reload.findreq", FT_NONE,
5369 BASE_NONE, NULL, 0x0, NULL, HFILL
5372 { &hf_reload_dmflags,
5373 { "dMFlags (uint64)", "reload.dmflags", FT_UINT64,
5374 BASE_HEX, NULL, 0x0, NULL, HFILL
5377 { &hf_reload_dmflag_status_info,
5378 { "STATUS_INFO", "reload.dmflags.status_info", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5379 NULL, HFILL
5382 { &hf_reload_dmflag_routing_table_size,
5383 { "ROUTING_TABLE_SIZE", "reload.dmflags.routing_table_size", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5384 NULL, HFILL
5387 { &hf_reload_dmflag_process_power,
5388 { "PROCESS_POWER", "reload.dmflags.process_power", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5389 NULL, HFILL
5392 { &hf_reload_dmflag_bandwidth,
5393 { "BANDWIDTH", "reload.dmflags.bandwidth", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5394 NULL, HFILL
5397 { &hf_reload_dmflag_software_version,
5398 { "SOFTWARE_VERSION", "reload.dmflags.software_version", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5399 NULL, HFILL
5402 { &hf_reload_dmflag_machine_uptime,
5403 { "MACHINE_UPTIME", "reload.dmflags.machine_uptime", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5404 NULL, HFILL
5407 { &hf_reload_dmflag_app_uptime,
5408 { "APP_UPTIME", "reload.dmflags.app_uptime", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5409 NULL, HFILL
5412 { &hf_reload_dmflag_memory_footprint,
5413 { "MEMORY_FOOTPRINT", "reload.dmflags.memory_footprint", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5414 NULL, HFILL
5417 { &hf_reload_dmflag_datasize_stored,
5418 { "DATASIZE_STORED", "reload.dmflags.datasize_stored", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5419 NULL, HFILL
5422 { &hf_reload_dmflag_instances_stored,
5423 { "INSTANCES_STORED", "reload.dmflags.instances_stored", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5424 NULL, HFILL
5427 { &hf_reload_dmflag_messages_sent_rcvd,
5428 { "MESSAGES_SENT_RCVD", "reload.dmflags.messages_sent_rcvd", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5429 NULL, HFILL
5432 { &hf_reload_dmflag_ewma_bytes_sent,
5433 { "EWMA_BYTES_SENT", "reload.dmflags.ewma_bytes_sent", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5434 NULL, HFILL
5437 { &hf_reload_dmflag_ewma_bytes_rcvd,
5438 { "EWMA_BYTES_RCVD", "reload.dmflags.ewma_bytes_rcvd", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5439 NULL, HFILL
5442 { &hf_reload_dmflag_underlay_hop,
5443 { "UNDERLAY_HOP", "reload.dmflags.underlay_hop", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5444 NULL, HFILL
5447 { &hf_reload_dmflag_battery_status,
5448 { "BATTERY_STATUS", "reload.dmflags.battery_status", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5449 NULL, HFILL
5452 { &hf_reload_diagnosticrequest,
5453 { "DiagnosticRequest", "reload.diagnosticrequest", FT_NONE,
5454 BASE_NONE, NULL, 0x0, NULL, HFILL
5457 { &hf_reload_diagnosticresponse,
5458 { "DiagnosticResponse", "reload.diagnosticresponse", FT_NONE,
5459 BASE_NONE, NULL, 0x0, NULL, HFILL
5462 { &hf_reload_diagnosticextension,
5463 { "DiagnosticExtension", "reload.diagnosticextension", FT_NONE,
5464 BASE_NONE, NULL, 0x0, NULL, HFILL
5467 { &hf_reload_diagnosticextension_type,
5468 { "type (DiagnosticExtensionRequestType)", "reload.diagnosticextension.type", FT_UINT16,
5469 BASE_DEC, NULL, 0x0, NULL, HFILL
5472 { &hf_reload_diagnosticextension_contents,
5473 { "diagnostic_extension_contents", "reload.diagnosticextension.contents", FT_NONE,
5474 BASE_NONE, NULL, 0x0, NULL, HFILL
5477 { &hf_reload_diagnostic_expiration, {
5478 "expiration (uint64)", "reload.diagnostic.expiration", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
5479 NULL, 0x0, NULL, HFILL
5482 { &hf_reload_diagnosticrequest_timestampinitiated, {
5483 "timestampInitiated (uint64)", "reload.diagnosticrequest.timestampinitiated",FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
5484 NULL, 0x0, NULL, HFILL
5487 { &hf_reload_diagnosticrequest_extensions,
5488 { "diagnostic_extensions", "reload.diagnosticrequest.extensions", FT_NONE,
5489 BASE_NONE, NULL, 0x0, NULL, HFILL
5492 { &hf_reload_pathtrackreq,
5493 { "PathTrackReq", "reload.pathtrackreq", FT_NONE,
5494 BASE_NONE, NULL, 0x0, NULL, HFILL
5497 { &hf_reload_pathtrackreq_destination,
5498 { "destination (Destination)", "reload.pathtrackreq.destination", FT_NONE,
5499 BASE_NONE, NULL, 0x0, NULL, HFILL
5502 { &hf_reload_pathtrackreq_request,
5503 { "request (DiagnosticRequest)", "reload.pathtrackreq.request", FT_NONE,
5504 BASE_NONE, NULL, 0x0, NULL, HFILL
5507 { &hf_reload_diagnosticinfo,
5508 { "DiagnosticInfo", "reload.diagnostic.info", FT_NONE,
5509 BASE_NONE, NULL, 0x0, NULL, HFILL
5512 { &hf_reload_diagnosticinfo_kind,
5513 { "kind (DiagnosticKindId)", "reload.diagnostic.kindid", FT_UINT16,
5514 BASE_DEC, VALS(diagnostickindids), 0x0, NULL, HFILL
5517 { &hf_reload_diagnosticinfo_congestion_status,
5518 { "congestion_status (uint8)", "reload.diagnostic.info.congestion_status", FT_UINT8,
5519 BASE_DEC, NULL, 0x0, NULL, HFILL
5522 { &hf_reload_diagnosticinfo_number_peers,
5523 { "number_peers (uint32)", "reload.diagnostic.info.number_peers", FT_UINT32,
5524 BASE_DEC, NULL, 0x0, NULL, HFILL
5527 { &hf_reload_diagnosticinfo_processing_power,
5528 { "processing_power (uint32)", "reload.diagnostic.info.processing_power", FT_UINT32,
5529 BASE_DEC, NULL, 0x0, NULL, HFILL
5532 { &hf_reload_diagnosticinfo_bandwidth,
5533 { "bandwidth (uint32)", "reload.diagnostic.info.bandwidth", FT_UINT32,
5534 BASE_DEC, NULL, 0x0, NULL, HFILL
5537 { &hf_reload_diagnosticinfo_software_version,
5538 { "software_version (opaque string)", "reload.diagnostic.info.software_version", FT_STRING,
5539 BASE_NONE, NULL, 0x0, NULL, HFILL
5542 { &hf_reload_diagnosticinfo_machine_uptime,
5543 { "machine_uptime (uint64)", "reload.diagnostic.info.machine_uptime", FT_UINT64,
5544 BASE_DEC, NULL, 0x0, NULL, HFILL
5547 { &hf_reload_diagnosticinfo_app_uptime,
5548 { "app_uptime (uint64)", "reload.diagnostic.info.app_uptime", FT_UINT64,
5549 BASE_DEC, NULL, 0x0, NULL, HFILL
5552 { &hf_reload_diagnosticinfo_memory_footprint,
5553 { "memory_footprint(uint32)", "reload.diagnostic.info.memory_footprint", FT_UINT32,
5554 BASE_DEC, NULL, 0x0, NULL, HFILL
5557 { &hf_reload_diagnosticinfo_datasize_stored,
5558 { "datasize_stored (uint64)", "reload.diagnostic.info.datasize_stored", FT_UINT64,
5559 BASE_DEC, NULL, 0x0, NULL, HFILL
5562 { &hf_reload_diagnosticinfo_instances_stored,
5563 { "instances_stored", "reload.diagnostic.info.instances_stored", FT_NONE,
5564 BASE_NONE, NULL, 0x0, NULL, HFILL
5567 { &hf_reload_diagnosticinfo_instancesstored_info,
5568 { "InstancesStoredInfo", "reload.diagnostic.info.instancesstored_info", FT_NONE,
5569 BASE_NONE, NULL, 0x0, NULL, HFILL
5572 { &hf_reload_diagnosticinfo_instancesstored_instances,
5573 { "instances (uint64)", "reload.diagnostic.info.instancesstored_instances", FT_UINT64,
5574 BASE_DEC, NULL, 0x0, NULL, HFILL
5577 { &hf_reload_diagnosticinfo_messages_sent_rcvd,
5578 { "messages_sent_rcvd", "reload.diagnostic.info.messages_sent_rcvd", FT_NONE,
5579 BASE_NONE, NULL, 0x0, NULL, HFILL
5582 { &hf_reload_diagnosticinfo_messages_sent_rcvd_info,
5583 { "MessagesSentRcvdInfo", "reload.diagnostic.info.messages_sent_rcvd.info", FT_NONE,
5584 BASE_NONE, NULL, 0x0, NULL, HFILL
5587 { &hf_reload_diagnosticinfo_message_code,
5588 { "messages_code (uint16)", "reload.diagnostic.info.message_code", FT_UINT16,
5589 BASE_HEX, NULL, 0x0, NULL, HFILL
5592 { &hf_reload_diagnosticinfo_messages_sent,
5593 { "sent (uint64)", "reload.diagnostic.info.messages_sent", FT_UINT64,
5594 BASE_DEC, NULL, 0x0, NULL, HFILL
5597 { &hf_reload_diagnosticinfo_messages_rcvd,
5598 { "rcvd (uint64)", "reload.diagnostic.info.messages_rcvd", FT_UINT64,
5599 BASE_DEC, NULL, 0x0, NULL, HFILL
5602 { &hf_reload_diagnosticinfo_ewma_bytes_sent,
5603 { "ewma_bytes_sent (uint32)", "reload.diagnostic.info.ewma_bytes_sent", FT_UINT32,
5604 BASE_DEC, NULL, 0x0, NULL, HFILL
5607 { &hf_reload_diagnosticinfo_ewma_bytes_rcvd,
5608 { "ewma_bytes_rcvd (uint32)", "reload.diagnostic.info.ewma_bytes_rcvd", FT_UINT32,
5609 BASE_DEC, NULL, 0x0, NULL, HFILL
5612 { &hf_reload_diagnosticinfo_underlay_hops,
5613 { "underlay_hops (uint8)", "reload.diagnostic.info.underlay_hops", FT_UINT8,
5614 BASE_DEC, NULL, 0x0, NULL, HFILL
5617 { &hf_reload_diagnosticinfo_battery_status,
5618 { "battery_status (uint8)", "reload.diagnostic.info.battery_status", FT_UINT8,
5619 BASE_DEC, NULL, 0x0, NULL, HFILL
5622 { &hf_reload_diagnosticresponse_timestampreceived, {
5623 "timestampReceived (uint64)", "reload.diagnosticresponse.timestampreceived",FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
5624 NULL, 0x0, NULL, HFILL
5627 { &hf_reload_diagnosticresponse_hopcounter,
5628 { "hopCounter (uint8)", "reload.diagnosticresponse.hopcounter", FT_UINT8,
5629 BASE_DEC, NULL, 0x0, NULL, HFILL
5632 { &hf_reload_diagnosticresponse_diagnostic_info_list,
5633 { "diagnostic_info_list", "reload.diagnosticresponse.diagnostic_info_list", FT_NONE,
5634 BASE_NONE, NULL, 0x0, NULL, HFILL
5637 { &hf_reload_pathtrackans,
5638 { "PathTrackAns", "reload.pathtrackans", FT_NONE,
5639 BASE_NONE, NULL, 0x0, NULL, HFILL
5642 { &hf_reload_pathtrackans_next_hop,
5643 { "next_hop", "reload.pathtrackans.next_hop", FT_NONE,
5644 BASE_NONE, NULL, 0x0, NULL, HFILL
5647 { &hf_reload_pathtrackans_response,
5648 { "response (DiagnosticResponse)", "reload.pathtrackand.response", FT_NONE,
5649 BASE_NONE, NULL, 0x0, NULL, HFILL
5652 { &hf_reload_extensiveroutingmodeoption,
5653 { "ExtensiveRoutingModeOption", "reload.extensiveroutingmodeoption", FT_NONE,
5654 BASE_NONE, NULL, 0x0, NULL, HFILL
5657 { &hf_reload_routemode,
5658 { "routemode (RouteMode)", "reload.routemode", FT_UINT8,
5659 BASE_DEC, VALS(routemodes), 0x0, NULL, HFILL
5662 { &hf_reload_extensiveroutingmode_transport,
5663 { "transport (OverlayLinkType)", "reload.extensiveroutingmode.transport", FT_UINT8,
5664 BASE_DEC, VALS(overlaylinktypes), 0x0, NULL, HFILL
5667 { &hf_reload_extensiveroutingmode_ipaddressport,
5668 { "ipaddressport (IpAddressPort)", "reload.extensiveroutingmode.ipaddressport", FT_NONE,
5669 BASE_NONE, NULL, 0x0, NULL, HFILL
5672 { &hf_reload_extensiveroutingmode_destination,
5673 { "destination", "reload.extensiveroutingmode.destination", FT_NONE,
5674 BASE_NONE, NULL, 0x0, NULL, HFILL
5677 { &hf_reload_joinreq,
5678 { "JoinReq", "reload.joinreq", FT_NONE,
5679 BASE_NONE, NULL, 0x0, NULL, HFILL
5682 { &hf_reload_joinans,
5683 { "JoinAns", "reload.joinans", FT_NONE,
5684 BASE_NONE, NULL, 0x0, NULL, HFILL
5687 { &hf_reload_joinreq_joining_peer_id,
5688 { "joining_peer_id (NodeId)", "reload.joinreq.joining_peer_id", FT_BYTES,
5689 BASE_NONE, NULL, 0x0, NULL, HFILL
5692 { &hf_reload_leavereq,
5693 { "LeaveReq", "reload.leavereq", FT_NONE,
5694 BASE_NONE, NULL, 0x0, NULL, HFILL
5697 { &hf_reload_leavereq_leaving_peer_id,
5698 { "leaving_peer_id (NodeId)", "reload.leavereq.leaving_peer_id", FT_BYTES,
5699 BASE_NONE, NULL, 0x0, NULL, HFILL
5705 /* Setup protocol subtree array */
5706 static int *ett[] = {
5707 &ett_reload,
5708 &ett_reload_forwarding,
5709 &ett_reload_message,
5710 &ett_reload_security,
5711 &ett_reload_fragment_flag,
5712 &ett_reload_destination,
5713 &ett_reload_via_list,
5714 &ett_reload_destination_list,
5715 &ett_reload_resourceid,
5716 &ett_reload_forwarding_options,
5717 &ett_reload_forwarding_option,
5718 &ett_reload_forwarding_option_flags,
5719 &ett_reload_forwarding_option_directresponseforwarding,
5720 &ett_reload_attachreqans,
5721 &ett_reload_icecandidates,
5722 &ett_reload_icecandidate,
5723 &ett_reload_icecandidate_computed_address,
5724 &ett_reload_iceextensions,
5725 &ett_reload_iceextension,
5726 &ett_reload_ipaddressport,
5727 &ett_reload_ipv4addrport,
5728 &ett_reload_ipv6addrport,
5729 &ett_reload_message_contents,
5730 &ett_reload_message_extensions,
5731 &ett_reload_message_extension,
5732 &ett_reload_error_response,
5733 &ett_reload_security_block,
5734 &ett_reload_certificates,
5735 &ett_reload_genericcertificate,
5736 &ett_reload_signature,
5737 &ett_reload_signatureandhashalgorithm,
5738 &ett_reload_signeridentity,
5739 &ett_reload_signeridentity_identity,
5740 &ett_reload_signeridentity_value,
5741 &ett_reload_opaque,
5742 &ett_reload_message_body,
5743 &ett_reload_routequeryreq,
5744 &ett_reload_probereq,
5745 &ett_reload_probereq_requested_info,
5746 &ett_reload_probe_information,
5747 &ett_reload_probe_information_data,
5748 &ett_reload_probeans,
5749 &ett_reload_probeans_probe_info,
5750 &ett_reload_appattach,
5751 &ett_reload_pingreq,
5752 &ett_reload_pingans,
5753 &ett_reload_storeddata,
5754 &ett_reload_kinddata,
5755 &ett_reload_values,
5756 &ett_reload_datavalue,
5757 &ett_reload_arrayentry,
5758 &ett_reload_dictionaryentry,
5759 &ett_reload_storereq,
5760 &ett_reload_store_kind_data,
5761 &ett_reload_storeans,
5762 &ett_reload_storeans_kind_responses,
5763 &ett_reload_storekindresponse,
5764 &ett_reload_fetchans,
5765 &ett_reload_fetchreq,
5766 &ett_reload_fetchreq_specifiers,
5767 &ett_reload_storeddataspecifier,
5768 &ett_reload_storeddataspecifier_indices,
5769 &ett_reload_storeddataspecifier_keys,
5770 &ett_reload_statans,
5771 &ett_reload_findans,
5772 &ett_reload_findkinddata,
5773 &ett_reload_fragments,
5774 &ett_reload_fragment,
5775 &ett_reload_configupdatereq,
5776 &ett_reload_configupdatereq_config_data,
5777 &ett_reload_kinddescription,
5778 &ett_reload_configupdatereq_kinds,
5779 &ett_reload_storekindresponse_replicas,
5780 &ett_reload_nodeid_list,
5781 &ett_reload_chordupdate,
5782 &ett_reload_chordroutequeryans,
5783 &ett_reload_chordleave,
5784 &ett_reload_turnserver,
5785 &ett_reload_sipregistration,
5786 &ett_reload_sipregistration_data,
5787 &ett_reload_sipregistration_destination_list,
5788 &ett_reload_dictionaryentry_key,
5789 &ett_reload_overlay_specific,
5790 &ett_reload_kindid_list,
5791 &ett_reload_redirserviceproviderdata,
5792 &ett_reload_redirserviceprovider,
5793 &ett_reload_self_tuning_data,
5794 &ett_reload_findreq,
5795 &ett_reload_dmflags,
5796 &ett_reload_diagnosticextension,
5797 &ett_reload_diagnosticrequest,
5798 &ett_reload_diagnosticrequest_extensions,
5799 &ett_reload_pathtrackreq,
5800 &ett_reload_diagnosticinfo,
5801 &ett_reload_diagnosticinfo_instances_stored,
5802 &ett_reload_diagnosticinfo_instancesstored_info,
5803 &ett_reload_diagnosticinfo_messages_sent_rcvd,
5804 &ett_reload_diagnosticinfo_messages_sent_rcvd_info,
5805 &ett_reload_diagnosticresponse,
5806 &ett_reload_diagnosticresponse_diagnostic_info_list,
5807 &ett_reload_pathtrackans,
5808 &ett_reload_extensiveroutingmodeoption,
5809 &ett_reload_extensiveroutingmode_destination,
5810 &ett_reload_joinreq,
5811 &ett_reload_joinans,
5812 &ett_reload_leavereq,
5815 static ei_register_info ei[] = {
5816 { &ei_reload_truncated_field, { "reload.truncated_field", PI_PROTOCOL, PI_ERROR, "Truncated field", EXPFILL }},
5817 { &ei_reload_truncated_packet, { "reload.truncated_packet", PI_PROTOCOL, PI_ERROR, "Truncated RELOAD packet", EXPFILL }},
5818 { &ei_reload_computed_len_too_big, { "reload.computed_len_too_big", PI_PROTOCOL, PI_ERROR, "Computed length > max_field length", EXPFILL }},
5819 { &ei_reload_identity_type_unknown, { "reload.signature.identity.type.unknown", PI_PROTOCOL, PI_ERROR, "Unknown identity type", EXPFILL }},
5820 { &ei_reload_unknown_data_model, { "reload.unknown_data_model", PI_PROTOCOL, PI_ERROR, "Unknown Data Model", EXPFILL }},
5821 { &ei_reload_no_xml_dissector, { "reload.no_xml_dissector", PI_PROTOCOL, PI_ERROR, "Can not find xml dissector", EXPFILL }},
5824 static uat_field_t reloadkindidlist_uats_flds[] = {
5825 UAT_FLD_DEC(kindidlist_uats,id,"Kind-ID Number","Custom Kind-ID Number"),
5826 UAT_FLD_CSTRING(kindidlist_uats,name,"Kind-ID Name","Custom Kind-ID Name"),
5827 UAT_FLD_VS(kindidlist_uats,data_model,"Kind-ID data model",datamodels,"Kind ID data model"),
5828 UAT_END_FIELDS
5832 /* Register the protocol name and description */
5833 proto_reload = proto_register_protocol("REsource LOcation And Discovery", "RELOAD", "reload");
5834 register_dissector("reload", dissect_reload_message, proto_reload);
5835 /* Required function calls to register the header fields and subtrees used */
5836 proto_register_field_array(proto_reload, hf, array_length(hf));
5837 proto_register_subtree_array(ett, array_length(ett));
5838 expert_reload = expert_register_protocol(proto_reload);
5839 expert_register_field_array(expert_reload, ei, array_length(ei));
5841 reload_module = prefs_register_protocol(proto_reload, NULL);
5843 reloadkindids_uat =
5844 uat_new("Kind-ID Table",
5845 sizeof(kind_t),
5846 "reload_kindids", /* filename */
5847 true, /* from_profile */
5848 &kindidlist_uats, /* data_ptr */
5849 &nreloadkinds, /* numitems_ptr */
5850 UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
5851 NULL, /* Help section (currently a wiki page) */
5852 uat_kindid_copy_cb,
5853 NULL,
5854 uat_kindid_record_free_cb,
5855 NULL,
5856 NULL,
5857 reloadkindidlist_uats_flds);
5860 prefs_register_uat_preference(reload_module, "kindid.table",
5861 "Kind ID list",
5862 "A table of Kind ID definitions",
5863 reloadkindids_uat);
5865 prefs_register_bool_preference(reload_module, "defragment",
5866 "Reassemble fragmented reload datagrams",
5867 "Whether fragmented RELOAD datagrams should be reassembled",
5868 &reload_defragment);
5869 prefs_register_uint_preference(reload_module, "nodeid_length",
5870 "NodeId Length",
5871 "Length of the NodeId as defined in the overlay.",
5873 &reload_nodeid_length);
5874 prefs_register_string_preference(reload_module, "topology_plugin",
5875 "topology plugin", "topology plugin defined in the overlay", &reload_topology_plugin);
5877 reassembly_table_register(&reload_reassembly_table,
5878 &addresses_reassembly_table_functions);
5881 void
5882 proto_reg_handoff_reload(void)
5884 xml_handle = find_dissector_add_dependency("xml", proto_reload);
5886 heur_dissector_add("udp", dissect_reload_heur, "RELOAD over UDP", "reload_udp", proto_reload, HEURISTIC_ENABLE);
5887 heur_dissector_add("tcp", dissect_reload_heur, "RELOAD over TCP", "reload_tcp", proto_reload, HEURISTIC_ENABLE);
5891 * Editor modelines - https://www.wireshark.org/tools/modelines.html
5893 * Local variables:
5894 * c-basic-offset: 2
5895 * tab-width: 8
5896 * indent-tabs-mode: nil
5897 * End:
5899 * vi: set shiftwidth=2 tabstop=8 expandtab:
5900 * :indentSize=2:tabSize=8:noTabs=true: