Coverage Report

Created: 2025-02-15 06:25

/src/wireshark/epan/dissectors/packet-reload.c
Line
Count
Source (jump to first uncovered line)
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.
5
 *
6
 * Wireshark - Network traffic analyzer
7
 * By Gerald Combs <gerald@wireshark.org>
8
 * Copyright 1998 Gerald Combs
9
 *
10
 * SPDX-License-Identifier: GPL-2.0-or-later
11
 *
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
19
 */
20
21
#include "config.h"
22
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"
34
35
void proto_register_reload(void);
36
void proto_reg_handoff_reload(void);
37
38
/* Initialize the protocol and registered fields */
39
static int proto_reload;
40
41
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;
316
317
static dissector_handle_t xml_handle;
318
319
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;
326
327
/* Structure containing conversation specific information */
328
typedef struct _reload_conv_info_t {
329
  wmem_tree_t *transaction_pdus;
330
} reload_conv_info_t;
331
332
333
/* RELOAD Message classes = (message_code & 0x1) (response = request +1) */
334
#define RELOAD_REQUEST         0x0001
335
#define RELOAD_RESPONSE        0x0000
336
337
238
#define RELOAD_ERROR           0xffff
338
339
#define VERSION_DRAFT          0x01
340
341
/* RELOAD Message Methods = (message_code +1) & 0xfffe*/
342
#define METHOD_INVALID                     0
343
0
#define METHOD_PROBE                       2
344
0
#define METHOD_ATTACH                      4
345
35
#define METHOD_STORE                       8
346
0
#define METHOD_FETCH                      10
347
#define METHOD_UNUSED_REMOVE              12
348
16
#define METHOD_FIND                       14
349
0
#define METHOD_JOIN                       16
350
0
#define METHOD_LEAVE                      18
351
0
#define METHOD_UPDATE                     20
352
0
#define METHOD_ROUTEQUERY                 22
353
0
#define METHOD_PING                       24
354
0
#define METHOD_STAT                       26
355
#define METHOD_UNUSED_ATTACHLIGHT         28
356
5
#define METHOD_APPATTACH                  30
357
#define METHOD_UNUSED_APP_ATTACHLIGHT     32
358
0
#define METHOD_CONFIGUPDATE               34
359
#define METHOD_EXP_A                      36
360
#define METHOD_EXP_B                      38
361
0
#define METHOD_PATH_TRACK                102
362
#define METHOD_ERROR                  0xfffe
363
364
365
/* RELOAD Destinationtype */
366
#define DESTINATIONTYPE_RESERVED            0
367
105
#define DESTINATIONTYPE_NODE                1
368
54
#define DESTINATIONTYPE_RESOURCE            2
369
81
#define DESTINATIONTYPE_COMPRESSED          3
370
371
/* RELOAD forwarding option type */
372
#define OPTIONTYPE_RESERVED                 0
373
7
#define OPTIONTYPE_EXTENSIVE_ROUTING_MODE   2
374
375
/* RELOAD CandTypes */
376
#define CANDTYPE_RESERVED        0
377
0
#define CANDTYPE_HOST            1
378
0
#define CANDTYPE_SRFLX           2
379
2
#define CANDTYPE_PRFLX           3
380
2
#define CANDTYPE_RELAY           4
381
382
/* IpAddressPort types */
383
#define IPADDRESSPORTTYPE_RESERVED 0
384
9
#define IPADDRESSPORTTYPE_IPV4     1
385
9
#define IPADDRESSPORTTYPE_IPV6     2
386
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
393
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
0
#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
0
#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
0
#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
420
421
422
/* Signer identity types */
423
#define SIGNERIDENTITYTYPE_RESERVED                  0
424
6
#define SIGNERIDENTITYTYPE_CERTHASH                  1
425
3
#define SIGNERIDENTITYTYPE_CERTHASHNODEID            2
426
#define SIGNERIDENTITYTYPE_NONE                      3
427
428
/* Probe information type */
429
#define PROBEINFORMATIONTYPE_RESERVED                0
430
0
#define PROBEINFORMATIONTYPE_RESPONSIBLESET          1
431
0
#define PROBEINFORMATIONTYPE_NUMRESOURCES            2
432
0
#define PROBEINFORMATIONTYPE_UPTIME                  3
433
#define PROBEINFORMATIONTYPE_EXP_PROBE               4
434
435
/* Data Kind ID */
436
0
#define DATAKINDID_INVALID                           0
437
0
#define DATAKINDID_SIP_REGISTRATION                  1
438
0
#define DATAKINDID_TURNSERVICE                       2
439
0
#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
0
#define DATAKINDID_CERTIFICATE_BY_USER              16
453
0
#define DATAKINDID_REDIR                           104
454
455
/* Data model */
456
0
#define DATAMODEL_SINGLE                             1
457
0
#define DATAMODEL_ARRAY                              2
458
0
#define DATAMODEL_DICTIONARY                         3
459
460
/* Message Extension Type */
461
#define MESSAGEEXTENSIONTYPE_RESERVED                0
462
#define MESSAGEEXTENSIONTYPE_EXP_EXT                 1
463
0
#define MESSAGEEXTENSIONTYPE_SELF_TUNING_DATA        2 /* is 1 */
464
0
#define MESSAGEEXTENSIONTYPE_DIAGNOSTIC_PING         3 /* is 1 */
465
466
/* Config Update Type */
467
#define CONFIGUPDATETYPE_RESERVED                    0
468
0
#define CONFIGUPDATETYPE_CONFIG                      1
469
0
#define CONFIGUPDATETYPE_KIND                        2
470
471
/* Chord Update Type */
472
#define CHORDUPDATETYPE_RESERVED                     0
473
#define CHORDUPDATETYPE_PEER_READY                   1
474
0
#define CHORDUPDATETYPE_NEIGHBORS                    2
475
0
#define CHORDUPDATETYPE_FULL                         3
476
477
/* Chord Leave Type */
478
#define CHORDLEAVETYPE_RESERVED                      0
479
0
#define CHORDLEAVETYPE_FROM_SUCC                     1
480
0
#define CHORDLEAVETYPE_FROM_PRED                     2
481
482
/* Chord Leave Type */
483
0
#define SIPREGISTRATIONTYPE_URI                      1
484
0
#define SIPREGISTRATIONTYPE_ROUTE                    2
485
486
/* Diagnostic Kind Id Type */
487
#define DIAGNOSTICKINDID_RESERVED               0x0000
488
0
#define DIAGNOSTICKINDID_STATUS_INFO            0x0001
489
0
#define DIAGNOSTICKINDID_ROUTING_TABLE_SIZE     0x0002
490
0
#define DIAGNOSTICKINDID_PROCESS_POWER          0x0003
491
0
#define DIAGNOSTICKINDID_BANDWIDTH              0x0004
492
0
#define DIAGNOSTICKINDID_SOFTWARE_VERSION       0x0005
493
0
#define DIAGNOSTICKINDID_MACHINE_UPTIME         0x0006
494
0
#define DIAGNOSTICKINDID_APP_UPTIME             0x0007
495
0
#define DIAGNOSTICKINDID_MEMORY_FOOTPRINT       0x0008
496
0
#define DIAGNOSTICKINDID_DATASIZE_STORED        0x0009
497
0
#define DIAGNOSTICKINDID_INSTANCES_STORED       0x000A
498
0
#define DIAGNOSTICKINDID_MESSAGES_SENT_RCVD     0x000B
499
0
#define DIAGNOSTICKINDID_EWMA_BYTES_SENT        0x000C
500
0
#define DIAGNOSTICKINDID_EWMA_BYTES_RCVD        0x000D
501
0
#define DIAGNOSTICKINDID_UNDERLAY_HOP           0x000E
502
0
#define DIAGNOSTICKINDID_BATTERY_STATUS         0x000F
503
504
/* route modes */
505
#define ROUTEMODE_RESERVED                           0
506
#define ROUTEMODE_DDR                                1
507
#define ROUTEMODE_RPR                                2
508
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
514
515
516
0
#define TOPOLOGY_PLUGIN_CHORD_RELOAD "CHORD-RELOAD"
517
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;
522
523
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;
631
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;
638
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"
655
};
656
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,
673
};
674
675
static uat_t *reloadkindids_uat;
676
677
typedef struct _Kind {
678
  char *name;
679
  uint32_t id;
680
  unsigned data_model;
681
682
} kind_t;
683
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},
703
};
704
705
706
static kind_t * kindidlist_uats;
707
708
static unsigned nreloadkinds;
709
710
349
static kind_t * getKindFromId(uint32_t id) {
711
349
  unsigned i;
712
  /* user defined kinds have precedence */
713
349
  for (i = 0; i < nreloadkinds; i++) {
714
0
    if (id == kindidlist_uats[i].id) {
715
0
      return (kindidlist_uats+i);
716
0
    }
717
0
  }
718
719
  /* then pre-defined kinds */
720
349
  {
721
4.48k
    for (i = 0; i < array_length(predefined_kinds); i++) {
722
4.25k
      if (id == predefined_kinds[i].id) {
723
124
        return (predefined_kinds+i);
724
124
      }
725
4.25k
    }
726
349
  }
727
225
  return NULL;
728
349
}
729
730
/*-------------------------------------
731
 * UAT for Kind-IDs
732
 *-------------------------------------
733
 */
734
735
736
0
static void* uat_kindid_copy_cb(void* n, const void* o, size_t siz _U_) {
737
0
  kind_t * new_record = (kind_t *)n;
738
0
  const kind_t* old_record = (const kind_t *)o;
739
740
0
  new_record->name = g_strdup(old_record->name);
741
742
0
  return new_record;
743
0
}
744
745
0
static void uat_kindid_record_free_cb(void*r) {
746
0
  kind_t* rec = (kind_t *)r;
747
0
  g_free(rec->name);
748
0
}
749
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")
753
754
755
163
#define MSG_LENGH_OFFSET                16
756
3.66k
#define MIN_HDR_LENGTH                  38      /* Forwarding header till options_length member (included) */
757
758
1.88k
#define RELOAD_TOKEN                    0xd2454c4f
759
760
484
#define IS_REQUEST(code)                (code & 0x0001)
761
265
#define MSGCODE_TO_METHOD(code)         ((code + 1) & 0xfffe)
762
207
#define MSGCODE_TO_CLASS(code)          (code & 0x0001)
763
764
765
static const value_string versions[] = {
766
  {VERSION_DRAFT,                               "0.1 DRAFT"},
767
  {0x00, NULL}
768
};
769
770
static const value_string classes[] = {
771
  {RELOAD_REQUEST,                              "Request"},
772
  {RELOAD_RESPONSE,                             "Response"},
773
  {0x00, NULL}
774
};
775
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}
799
};
800
801
static const value_string classes_short[] = {
802
  {RELOAD_REQUEST,                              "req"},
803
  {RELOAD_RESPONSE,                             "ans"},
804
  {0x00, NULL}
805
};
806
807
static const value_string classes_Short[] = {
808
  {RELOAD_REQUEST,                              "Req"},
809
  {RELOAD_RESPONSE,                             "Ans"},
810
  {0x00, NULL}
811
};
812
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}
836
};
837
838
839
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}
846
};
847
848
static const value_string forwardingoptiontypes[] = {
849
  {OPTIONTYPE_RESERVED,                         "reserved"},
850
  {OPTIONTYPE_EXTENSIVE_ROUTING_MODE,           "extensive_routing_mode"},
851
  {0x00, NULL}
852
};
853
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}
861
};
862
863
static const value_string ipaddressporttypes [] = {
864
  {IPADDRESSPORTTYPE_RESERVED,                  "reserved"},
865
  {IPADDRESSPORTTYPE_IPV4,                      "IPV4"},
866
  {IPADDRESSPORTTYPE_IPV6,                      "IPV6"},
867
  {0x00, NULL}
868
};
869
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}
877
};
878
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}
907
};
908
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}
915
};
916
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}
924
};
925
926
927
static const value_string datamodels[] = {
928
  {DATAMODEL_SINGLE, "SINGLE"},
929
  {DATAMODEL_ARRAY, "ARRAY"},
930
  {DATAMODEL_DICTIONARY, "DICTIONARY"},
931
  {0x00, NULL}
932
};
933
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}
940
};
941
942
943
static const value_string configupdatetypes[] = {
944
  {CONFIGUPDATETYPE_RESERVED,                   "reserved"},
945
  {CONFIGUPDATETYPE_CONFIG,                     "config"},
946
  {CONFIGUPDATETYPE_KIND,                       "kind"},
947
  {0x00, NULL}
948
};
949
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}
956
};
957
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}
963
};
964
965
static const value_string sipregistrationtypes[] = {
966
  {SIPREGISTRATIONTYPE_URI,                     "sip_registration_uri"},
967
  {SIPREGISTRATIONTYPE_ROUTE,                   "sip_registration_route"},
968
  {0x00, NULL}
969
};
970
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}
989
};
990
991
static const value_string routemodes[] = {
992
  {ROUTEMODE_RESERVED,                          "reserved"},
993
  {ROUTEMODE_DDR,                               "DDR"},
994
  {ROUTEMODE_RPR,                               "RPR"},
995
  {0x00, NULL}
996
};
997
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}
1005
};
1006
1007
1008
/*
1009
 * defragmentation
1010
 */
1011
static reassembly_table reload_reassembly_table;
1012
1013
1014
static unsigned
1015
get_reload_message_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
1016
163
{
1017
163
  uint32_t length = tvb_get_ntohl(tvb, offset + MSG_LENGH_OFFSET);
1018
163
  return length;
1019
163
}
1020
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)
1023
103
{
1024
103
  proto_tree *opaque_tree;
1025
103
  proto_item *ti_anchor;
1026
103
  int         length_index     = -1;
1027
103
  int32_t     length           = -1;
1028
103
  int         hf               = hf_reload_opaque;
1029
103
  int         hf_data          = hf_reload_opaque_data;
1030
103
  unsigned    hf_data_encoding = ENC_NA;
1031
1032
103
  if (anchor_index >= 0) {
1033
103
    hf = anchor_index;
1034
103
  }
1035
1036
103
  if (is_string) {
1037
14
    hf_data = hf_reload_opaque_string;
1038
14
    hf_data_encoding = ENC_ASCII|ENC_NA;
1039
14
  }
1040
1041
103
  switch (length_size) {
1042
95
  case 1:
1043
95
    length_index = hf_reload_length_uint8;
1044
95
    length = (int32_t)tvb_get_uint8(tvb,offset);
1045
95
    break;
1046
3
  case 2:
1047
3
    length_index = hf_reload_length_uint16;
1048
3
    length = (int32_t)tvb_get_ntohs(tvb, offset);
1049
3
    break;
1050
0
  case 3:
1051
0
    length_index = hf_reload_length_uint24;
1052
0
    length = ((int32_t) (tvb_get_ntohs(tvb, offset) <<8) + (tvb_get_uint8(tvb, offset+2)));
1053
0
    break;
1054
5
  case 4:
1055
5
    length_index = hf_reload_length_uint32;
1056
5
    length = (int32_t)tvb_get_ntohl(tvb, offset);
1057
5
    break;
1058
1059
0
  default:
1060
0
    break;
1061
103
  }
1062
1063
103
  if (length_index < 0) return 0;
1064
1065
103
  ti_anchor = proto_tree_add_item(tree, hf, tvb, offset, length_size + length, ENC_NA);
1066
1067
103
  if (max_field_length > 0) {
1068
76
    if ((length + length_size) > max_field_length) {
1069
61
      expert_add_info(pinfo, ti_anchor, &ei_reload_computed_len_too_big);
1070
61
      length = max_field_length - length_size;
1071
61
    }
1072
76
  }
1073
1074
103
  opaque_tree = proto_item_add_subtree(ti_anchor, ett_reload_opaque);
1075
103
  proto_tree_add_uint(opaque_tree, length_index, tvb, offset, length_size, (unsigned)length);
1076
103
  if (length) {
1077
87
    proto_tree_add_item(opaque_tree, hf_data, tvb, offset + length_size, length, hf_data_encoding);
1078
87
  }
1079
103
  if (hf != hf_reload_opaque) {
1080
96
    proto_item_append_text(ti_anchor, " (opaque<%d>)", length);
1081
96
  }
1082
7
  else {
1083
7
    proto_item_append_text(ti_anchor, "<%d>", length);
1084
7
  }
1085
1086
103
  return (length_size + length);
1087
103
}
1088
1089
static int
1090
89
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
89
  return dissect_opaque_string_or_data(tvb, pinfo, tree, anchor_index, offset, length_size, max_field_length, false);
1092
89
}
1093
1094
static int
1095
14
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
14
  return dissect_opaque_string_or_data(tvb, pinfo, tree, anchor_index, offset, length_size, max_field_length, true);
1097
14
}
1098
1099
138
static int dissect_length(tvbuff_t *tvb, proto_tree *tree, uint16_t offset,  uint16_t length_size) {
1100
138
  switch (length_size) {
1101
8
  case 1:
1102
8
    proto_tree_add_item(tree, hf_reload_length_uint8, tvb, offset, 1, ENC_BIG_ENDIAN);
1103
8
    return 1;
1104
1105
130
  case 2:
1106
130
    proto_tree_add_item(tree, hf_reload_length_uint16, tvb, offset, 2, ENC_BIG_ENDIAN);
1107
130
    return 2;
1108
1109
0
  case 3:
1110
0
    proto_tree_add_item(tree, hf_reload_length_uint24, tvb, offset, 3, ENC_BIG_ENDIAN);
1111
0
    return 3;
1112
1113
0
  case 4:
1114
0
    proto_tree_add_item(tree, hf_reload_length_uint32, tvb, offset, 4, ENC_BIG_ENDIAN);
1115
0
    return 4;
1116
1117
0
  default:
1118
0
    break;
1119
138
  }
1120
0
  return 0;
1121
138
}
1122
1123
static int dissect_resourceid(int anchor, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1124
161
{
1125
161
  proto_item *ti_local;
1126
161
  proto_tree *local_tree;
1127
161
  int         hf = hf_reload_resourceid;
1128
161
  uint8_t     local_length;
1129
1130
161
  if (anchor >= 0) {
1131
161
    hf = anchor;
1132
161
  }
1133
1134
161
  local_length = tvb_get_uint8(tvb, offset);
1135
1136
  /* We don't know the node ID. Just assume that all the data is part of it */
1137
161
  if (length < local_length+1) {
1138
41
    ti_local = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1139
41
    expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated ResourceId");
1140
41
    return length;
1141
41
  }
1142
1143
120
  ti_local = proto_tree_add_item(tree, hf, tvb, offset, 1+local_length, ENC_NA);
1144
120
  local_tree = proto_item_add_subtree(ti_local, ett_reload_resourceid);
1145
120
  proto_tree_add_item(local_tree, hf_reload_length_uint8, tvb, offset, 1, ENC_BIG_ENDIAN);
1146
120
  proto_tree_add_item(local_tree, hf_reload_opaque_data, tvb, offset+1, local_length, ENC_NA);
1147
1148
120
  if (hf != hf_reload_resourceid) {
1149
112
    proto_item_append_text(ti_local, " (ResourceId<%d>)", local_length);
1150
112
  }
1151
8
  else {
1152
8
    proto_item_append_text(ti_local, "<%d>", local_length);
1153
8
  }
1154
1155
120
  return 1+local_length;
1156
161
}
1157
1158
static int dissect_nodeid(int anchor, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1159
834
{
1160
834
  proto_item *ti_nodeid;
1161
834
  int         hf = hf_reload_nodeid;
1162
1163
834
  if (anchor >= 0) {
1164
105
    hf = anchor;
1165
105
  }
1166
1167
  /* We don't know the node ID. Just assume that all the data is part of it */
1168
834
  if (length < reload_nodeid_length) {
1169
116
    ti_nodeid = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1170
116
    expert_add_info_format(pinfo, ti_nodeid, &ei_reload_truncated_field, "Truncated NodeId");
1171
116
    return length;
1172
116
  }
1173
1174
718
  ti_nodeid = proto_tree_add_item(tree, hf, tvb, offset, reload_nodeid_length, ENC_NA);
1175
718
  {
1176
718
    bool allZeros = true;
1177
718
    bool allOnes  = true;
1178
718
    unsigned i;
1179
1180
3.81k
    for (i=0; i<reload_nodeid_length; i++) {
1181
3.62k
      uint8_t byte = tvb_get_uint8(tvb,offset+i);
1182
3.62k
      if (byte != 0) {
1183
2.66k
        allZeros = false;
1184
2.66k
        if (allOnes == false) break;
1185
2.66k
      }
1186
3.53k
      if (byte != 0xFF) {
1187
1.38k
        allOnes = false;
1188
1.38k
        if (allZeros == false) break;
1189
1.38k
      }
1190
3.53k
    }
1191
1192
718
    if (allZeros) {
1193
40
      proto_item_append_text(ti_nodeid, "\n  [Invalid]");
1194
40
    }
1195
718
    if (allOnes) {
1196
109
      proto_item_append_text(ti_nodeid, "\n  [Wildcard]");
1197
109
    }
1198
1199
718
  }
1200
1201
1202
718
  return reload_nodeid_length;
1203
834
}
1204
1205
static int
1206
dissect_destination(int anchor, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1207
1.81k
{
1208
1.81k
  uint8_t     destination_type;
1209
1.81k
  proto_tree *destination_tree;
1210
1.81k
  proto_item *ti_destination;
1211
1.81k
  uint8_t     destination_length = 0;
1212
1.81k
  int         hf                 = hf_reload_destination;
1213
1214
1.81k
  if (anchor >= 0) {
1215
0
    hf = anchor;
1216
0
  }
1217
1218
1.81k
  destination_type = tvb_get_uint8(tvb,offset);
1219
1220
1.81k
  if (destination_type & 0x80) {
1221
    /* simple compressed case */
1222
704
    ti_destination = proto_tree_add_item(tree, hf, tvb, offset, 2, ENC_NA);
1223
704
    if (hf == anchor) {
1224
0
      proto_item_append_text(ti_destination, " (Destination)");
1225
0
    }
1226
704
    proto_item_append_text(ti_destination, ": uint16");
1227
704
    destination_tree = proto_item_add_subtree(ti_destination, ett_reload_destination);
1228
704
    proto_tree_add_item(destination_tree,hf_reload_destination_compressed_id , tvb, offset, 2, ENC_BIG_ENDIAN);
1229
704
    return 2;
1230
704
  }
1231
1.11k
  else {
1232
    /* normal case */
1233
1234
1.11k
    destination_length = tvb_get_uint8(tvb,offset+1);
1235
1.11k
    ti_destination = proto_tree_add_item(tree, hf, tvb, offset, 2+destination_length, ENC_NA);
1236
1.11k
    if (hf == anchor) {
1237
0
      proto_item_append_text(ti_destination, " (Destination)");
1238
0
    }
1239
1.11k
    destination_tree = proto_item_add_subtree(ti_destination, ett_reload_destination);
1240
1.11k
    proto_item_append_text(ti_destination, ": %s", val_to_str_const(destination_type, destinationtypes, "Unknown"));
1241
1242
1.11k
    proto_tree_add_item(destination_tree, hf_reload_destination_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1243
1.11k
    proto_tree_add_uint(destination_tree, hf_reload_length_uint8, tvb, offset+1, 1, destination_length);
1244
1.11k
    if (2 + destination_length > length) {
1245
22
      expert_add_info_format(pinfo, ti_destination, &ei_reload_truncated_field, "Truncated Destination");
1246
22
      return length;
1247
22
    }
1248
1.09k
    switch(destination_type) {
1249
105
    case DESTINATIONTYPE_NODE:
1250
105
      dissect_nodeid(hf_reload_destination_data_node_id, tvb, pinfo, destination_tree, offset+2, destination_length);
1251
105
      break;
1252
1253
54
    case DESTINATIONTYPE_RESOURCE:
1254
54
      dissect_resourceid(hf_reload_destination_data_resource_id, tvb, pinfo, destination_tree, offset+2, destination_length);
1255
54
      break;
1256
1257
81
    case DESTINATIONTYPE_COMPRESSED:
1258
81
      dissect_opaque(tvb, pinfo, destination_tree, hf_reload_destination_data_compressed_id, offset+2, 1, destination_length);
1259
81
      break;
1260
793
    default:
1261
793
      break;
1262
1.09k
    }
1263
1264
1.09k
  }
1265
1.02k
  return (2+destination_length);
1266
1.81k
}
1267
1268
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)
1271
95
{
1272
95
  int local_offset = 0;
1273
95
  int local_increment;
1274
1275
95
  *numDestinations  = 0;
1276
1.91k
  while (local_offset +2 <= length) {
1277
1.81k
    local_increment = dissect_destination(-1,tvb, pinfo, list_tree, offset + local_offset, length-local_offset);
1278
1.81k
    if (local_increment <= 0) break;
1279
1.81k
    local_offset += local_increment;
1280
1.81k
    (*numDestinations)++;
1281
1.81k
  }
1282
95
  return local_offset;
1283
95
}
1284
1285
static int
1286
dissect_probe_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1287
0
{
1288
0
  proto_item *ti_probe_information;
1289
0
  proto_tree *probe_information_tree;
1290
0
  uint8_t     type;
1291
0
  uint8_t     probe_length;
1292
1293
0
  type = tvb_get_uint8(tvb, offset);
1294
0
  probe_length = tvb_get_uint8(tvb, offset + 1);
1295
1296
0
  if (probe_length + 2 > length) {
1297
0
    ti_probe_information = proto_tree_add_item(tree, hf_reload_probe_information, tvb, offset, length, ENC_NA);
1298
0
    expert_add_info_format(pinfo, ti_probe_information, &ei_reload_truncated_field, "Truncated probe information");
1299
0
    return length;
1300
0
  }
1301
0
  ti_probe_information = proto_tree_add_item(tree, hf_reload_probe_information, tvb, offset, 2 + probe_length, ENC_NA);
1302
0
  probe_information_tree = proto_item_add_subtree(ti_probe_information, ett_reload_probe_information);
1303
1304
0
  proto_tree_add_item(probe_information_tree, hf_reload_probe_information_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1305
0
  proto_tree_add_uint(probe_information_tree, hf_reload_length_uint8, tvb, offset + 1, 1, probe_length);
1306
1307
0
  {
1308
0
    proto_item *ti_probe_information_data;
1309
0
    proto_tree *probe_information_data_tree;
1310
1311
0
    ti_probe_information_data = proto_tree_add_item(probe_information_tree, hf_reload_probe_information_data, tvb, offset+2, probe_length, ENC_NA);
1312
0
    probe_information_data_tree = proto_item_add_subtree(ti_probe_information_data, ett_reload_probe_information_data);
1313
1314
0
    switch(type) {
1315
0
    case PROBEINFORMATIONTYPE_RESPONSIBLESET:
1316
0
      if (probe_length < 4) {
1317
0
        expert_add_info_format(pinfo, ti_probe_information_data, &ei_reload_truncated_field, "Truncated responsible set");
1318
0
        return 2 + probe_length;
1319
0
      }
1320
0
      proto_tree_add_item(probe_information_data_tree, hf_reload_responsible_set, tvb, offset + 2, 4, ENC_BIG_ENDIAN);
1321
0
      break;
1322
0
    case PROBEINFORMATIONTYPE_NUMRESOURCES:
1323
0
      if (probe_length < 4) {
1324
0
        expert_add_info_format(pinfo, ti_probe_information_data, &ei_reload_truncated_field, "Truncated num resource info");
1325
0
        return 2 + probe_length;
1326
0
      }
1327
0
      proto_tree_add_item(probe_information_data_tree, hf_reload_num_resources, tvb, offset + 2, 4, ENC_BIG_ENDIAN);
1328
0
      break;
1329
0
    case PROBEINFORMATIONTYPE_UPTIME:
1330
0
      if (probe_length < 4) {
1331
0
        expert_add_info_format(pinfo, ti_probe_information_data, &ei_reload_truncated_field, "Truncated uptime info");
1332
0
        return 2 + probe_length;
1333
0
      }
1334
0
      proto_tree_add_item(probe_information_data_tree, hf_reload_uptime, tvb, offset + 2, 4, ENC_BIG_ENDIAN);
1335
0
      break;
1336
0
    default:
1337
0
      break;
1338
0
    }
1339
0
  }
1340
0
  return probe_length + 2;
1341
0
}
1342
1343
1344
1345
static int
1346
dissect_ipaddressport(int anchor, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset)
1347
9
{
1348
9
  proto_item *ti_ipaddressport;
1349
9
  proto_tree *ipaddressport_tree;
1350
9
  uint8_t     ipaddressport_type;
1351
9
  uint8_t     ipaddressport_length;
1352
9
  int         hf = hf_reload_ipaddressport;
1353
1354
9
  if (anchor >= 0) {
1355
9
    hf = anchor;
1356
9
  }
1357
1358
9
  ipaddressport_length = tvb_get_uint8(tvb, offset+1);
1359
9
  ti_ipaddressport = proto_tree_add_item(tree, hf, tvb, offset, ipaddressport_length+2, ENC_NA);
1360
9
  if (hf == anchor) proto_item_append_text(ti_ipaddressport, " (IpAddressPort)");
1361
9
  ipaddressport_type = tvb_get_uint8(tvb, offset);
1362
9
  proto_item_append_text(ti_ipaddressport, ": %s", val_to_str_const(ipaddressport_type, ipaddressporttypes,"Unknown Type"));
1363
9
  if (ipaddressport_type == IPADDRESSPORTTYPE_IPV4) {
1364
0
    proto_item_append_text(ti_ipaddressport, " (%s:%d)", tvb_ip_to_str(pinfo->pool, tvb, offset+2),tvb_get_ntohs(tvb,offset+2+4));
1365
0
  }
1366
9
  else if (ipaddressport_type == IPADDRESSPORTTYPE_IPV6) {
1367
0
    proto_item_append_text(ti_ipaddressport, " (%s:%d)", tvb_ip6_to_str(pinfo->pool, tvb, offset+2),tvb_get_ntohs(tvb,offset+2+16));
1368
0
  }
1369
9
  ipaddressport_tree = proto_item_add_subtree(ti_ipaddressport, ett_reload_ipaddressport);
1370
9
  proto_tree_add_item(ipaddressport_tree, hf_reload_ipaddressport_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1371
9
  offset += 1;
1372
9
  proto_tree_add_uint(ipaddressport_tree, hf_reload_length_uint8, tvb, offset, 1, ipaddressport_length);
1373
9
  offset += 1;
1374
9
  switch (ipaddressport_type) {
1375
0
  case IPADDRESSPORTTYPE_IPV4:
1376
0
  {
1377
0
    proto_item *ti_ipv4;
1378
0
    proto_tree *ipv4_tree;
1379
0
    ti_ipv4 = proto_tree_add_item(ipaddressport_tree, hf_reload_ipv4addrport, tvb, offset, 6, ENC_NA);
1380
0
    proto_item_append_text(ti_ipv4, ": %s:%d", tvb_ip_to_str(pinfo->pool, tvb, offset),tvb_get_ntohs(tvb,offset+4));
1381
0
    ipv4_tree = proto_item_add_subtree(ti_ipv4, ett_reload_ipv4addrport);
1382
0
    proto_tree_add_item(ipv4_tree, hf_reload_ipv4addr, tvb, offset, 4, ENC_BIG_ENDIAN);
1383
0
    proto_tree_add_item(ipv4_tree, hf_reload_port, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
1384
0
  }
1385
0
  break;
1386
1387
0
  case IPADDRESSPORTTYPE_IPV6:
1388
0
  {
1389
0
    proto_item *ti_ipv6;
1390
0
    proto_tree *ipv6_tree;
1391
0
    ti_ipv6 = proto_tree_add_item(ipaddressport_tree, hf_reload_ipv6addrport, tvb, offset, 6, ENC_NA);
1392
0
    proto_item_append_text(ti_ipv6, ": %s:%d", tvb_ip6_to_str(pinfo->pool, tvb, offset),tvb_get_ntohs(tvb,offset+16));
1393
0
    ipv6_tree = proto_item_add_subtree(ti_ipv6, ett_reload_ipv6addrport);
1394
0
    proto_tree_add_item(ipv6_tree, hf_reload_ipv6addr, tvb, offset, 16, ENC_NA);
1395
0
    proto_tree_add_item(ipv6_tree, hf_reload_port, tvb, offset + 16, 2, ENC_BIG_ENDIAN);
1396
0
  }
1397
0
  break;
1398
1399
9
  default:
1400
9
    break;
1401
9
  }
1402
1403
1404
9
  return (int) (2 + ipaddressport_length);
1405
9
}
1406
1407
static int
1408
dissect_icecandidates(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1409
4
{
1410
4
  proto_item *ti_icecandidates;
1411
4
  proto_tree *icecandidates_tree;
1412
4
  uint32_t    icecandidates_offset = 0;
1413
4
  uint32_t    icecandidates_length;
1414
4
  uint32_t    local_offset         = 0;
1415
4
  int         nCandidates          = 0;
1416
1417
4
  icecandidates_length = tvb_get_ntohs(tvb, offset);
1418
  /* Precalculate the length of the icecandidate list */
1419
4
  if (2+icecandidates_length > length) {
1420
1
    ti_icecandidates = proto_tree_add_item(tree, hf_reload_icecandidates, tvb, offset, length, ENC_NA);
1421
1
    expert_add_info_format(pinfo, ti_icecandidates, &ei_reload_truncated_field, "Truncated ice candidates");
1422
1
    return length;
1423
1
  }
1424
1425
3
  ti_icecandidates = proto_tree_add_item(tree, hf_reload_icecandidates, tvb, offset, 2+icecandidates_length, ENC_NA);
1426
3
  proto_item_append_text(ti_icecandidates, " (IceCandidate<%d>)", icecandidates_length);
1427
3
  icecandidates_tree = proto_item_add_subtree(ti_icecandidates, ett_reload_icecandidates);
1428
3
  proto_tree_add_uint(icecandidates_tree, hf_reload_length_uint16, tvb, offset+local_offset, 2, icecandidates_length);
1429
3
  local_offset += 2;
1430
4
  while (icecandidates_offset < icecandidates_length) {
1431
3
    proto_item *ti_icecandidate;
1432
3
    proto_tree *icecandidate_tree;
1433
3
    uint8_t ipaddressport_length;
1434
3
    uint8_t computed_ipaddressport_length;
1435
3
    uint16_t iceextensions_length;
1436
3
    uint8_t foundation_length;
1437
3
    uint8_t candtype;
1438
3
    uint16_t icecandidate_offset = 0;
1439
    /* compute the length */
1440
3
    ipaddressport_length = tvb_get_uint8(tvb, offset+local_offset+icecandidates_offset+icecandidate_offset+1);
1441
3
    icecandidate_offset += 2 + ipaddressport_length;
1442
3
    icecandidate_offset += 1;/* OverlayLink */
1443
3
    foundation_length = tvb_get_uint8(tvb, offset+local_offset+icecandidates_offset+icecandidate_offset);
1444
3
    icecandidate_offset += 1 + foundation_length;
1445
3
    icecandidate_offset += 4;/* priority */
1446
3
    candtype = tvb_get_uint8(tvb, offset+local_offset+icecandidates_offset+icecandidate_offset);
1447
3
    icecandidate_offset += 1;/* candType */
1448
3
    computed_ipaddressport_length = 0;
1449
3
    switch (candtype) {
1450
0
    case CANDTYPE_HOST:
1451
0
      break;
1452
0
    case CANDTYPE_SRFLX:
1453
1
    case CANDTYPE_PRFLX:
1454
1
    case CANDTYPE_RELAY:
1455
      /* IpAddressPort */
1456
1
      computed_ipaddressport_length = tvb_get_uint8(tvb, offset+local_offset+icecandidates_offset+icecandidate_offset+1);
1457
1
      icecandidate_offset += computed_ipaddressport_length+2;
1458
1
      break;
1459
2
    default:
1460
2
      break;
1461
3
    }
1462
1463
3
    iceextensions_length = tvb_get_ntohs(tvb, offset+local_offset+icecandidates_offset+icecandidate_offset);
1464
3
    icecandidate_offset += iceextensions_length + 2;
1465
1466
    /* icecandidate_offset is now equal to the length of this icecandidate */
1467
3
    if (icecandidates_offset + icecandidate_offset > icecandidates_length) {
1468
2
      expert_add_info_format(pinfo, ti_icecandidates, &ei_reload_truncated_field, "Truncated IceCandidate");
1469
2
      break;
1470
2
    }
1471
1
    ti_icecandidate = proto_tree_add_item(icecandidates_tree, hf_reload_icecandidate, tvb, offset+local_offset+ icecandidates_offset, icecandidate_offset, ENC_NA);
1472
1
    icecandidate_tree = proto_item_add_subtree(ti_icecandidate, ett_reload_icecandidate);
1473
    /* parse from start */
1474
1
    icecandidate_offset = 0;
1475
1
    dissect_ipaddressport(hf_reload_icecandidate_addr_port, tvb, pinfo, icecandidate_tree, offset+local_offset+icecandidates_offset+icecandidate_offset);
1476
1
    icecandidate_offset += 2 + ipaddressport_length;
1477
1478
1
    proto_tree_add_item(icecandidate_tree, hf_reload_overlaylink_type, tvb,
1479
1
                        offset+local_offset+icecandidates_offset+icecandidate_offset, 1, ENC_BIG_ENDIAN);
1480
1481
1
    icecandidate_offset += 1;
1482
1
    icecandidate_offset += dissect_opaque_string(tvb, pinfo,icecandidate_tree,  hf_reload_icecandidate_foundation,offset+local_offset+icecandidates_offset + icecandidate_offset, 1, -1);
1483
1484
1
    {
1485
1
      uint32_t priority;
1486
1487
1
      priority = tvb_get_ntohl(tvb, offset+local_offset + icecandidates_offset);
1488
1
      proto_tree_add_item(icecandidate_tree, hf_reload_icecandidate_priority, tvb, offset+local_offset + icecandidates_offset, 4, ENC_BIG_ENDIAN);
1489
1
      icecandidate_offset += 4;
1490
1
      proto_tree_add_item(icecandidate_tree, hf_reload_icecandidate_type, tvb,
1491
1
                          offset+local_offset+icecandidates_offset+icecandidate_offset, 1, ENC_BIG_ENDIAN);
1492
1
      proto_item_append_text(ti_icecandidate, ": %s, priority=%d", val_to_str_const(candtype, candtypes, "Unknown"), priority);
1493
1
    }
1494
1
    icecandidate_offset += 1;
1495
1
    {
1496
1
      int item_index = -1;
1497
1
      switch (candtype) {
1498
0
      case CANDTYPE_HOST:
1499
0
        break;
1500
0
      case CANDTYPE_SRFLX:
1501
1
      case CANDTYPE_PRFLX:
1502
1
      case CANDTYPE_RELAY:
1503
1
        item_index = hf_reload_icecandidate_relay_addr;
1504
1
        break;
1505
1506
0
      default:
1507
0
        break;
1508
1
      }
1509
1
      if (item_index != -1) {
1510
1
        dissect_ipaddressport(item_index, tvb, pinfo, icecandidate_tree,
1511
1
                              offset+local_offset+icecandidates_offset+icecandidate_offset);
1512
1
        icecandidate_offset += computed_ipaddressport_length + 2;
1513
1
      }
1514
1
    }
1515
    /* Ice extensions */
1516
0
    {
1517
1
      uint32_t iceextensions_offset = 0;
1518
1
      proto_item *ti_iceextension, *ti_extensions;
1519
1
      proto_tree *iceextension_tree,*extensions_tree;
1520
1
      uint16_t iceextension_name_length;
1521
1
      uint16_t iceextension_value_length;
1522
1
      int nExtensions = 0;
1523
1
      ti_extensions =
1524
1
        proto_tree_add_item(icecandidate_tree, hf_reload_iceextensions, tvb,
1525
1
                            offset+local_offset+icecandidates_offset+icecandidate_offset, 2+iceextensions_length,
1526
1
                            ENC_NA);
1527
1
      proto_item_append_text(ti_extensions, " (IceExtensions<%d>)", iceextensions_length);
1528
1
      extensions_tree = proto_item_add_subtree(ti_extensions, ett_reload_iceextensions);
1529
1530
1
      proto_tree_add_item(extensions_tree, hf_reload_length_uint16, tvb,
1531
1
                          offset+local_offset+icecandidates_offset+icecandidate_offset, 2, ENC_BIG_ENDIAN);
1532
1
      icecandidate_offset += 2;
1533
2
      while (iceextensions_offset < iceextensions_length) {
1534
1
        int local_increment;
1535
1
        iceextension_name_length =
1536
1
          tvb_get_ntohs(tvb, offset+local_offset+icecandidates_offset+icecandidate_offset+iceextensions_offset);
1537
1
        iceextension_value_length =
1538
1
          tvb_get_ntohs(tvb, offset+local_offset+icecandidates_offset+icecandidate_offset+iceextensions_offset+iceextension_name_length + 2);
1539
1
        if ((iceextensions_offset + 4 + iceextension_name_length + iceextension_value_length) > iceextensions_length) {
1540
0
          expert_add_info_format(pinfo, ti_extensions, &ei_reload_truncated_field, "Truncated extensions");
1541
0
          break;
1542
0
        }
1543
1
        ti_iceextension =
1544
1
          proto_tree_add_item(extensions_tree, hf_reload_iceextension, tvb,
1545
1
                              offset+local_offset + icecandidates_offset + icecandidate_offset + iceextensions_offset, 4 + iceextension_name_length + iceextension_value_length, ENC_NA);
1546
1
        iceextension_tree = proto_item_add_subtree(ti_iceextension, ett_reload_iceextension);
1547
1
        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
1
        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
1
        local_increment = 4 + iceextension_name_length + iceextension_value_length;
1550
1
        if (local_increment <= 0) break;
1551
1
        iceextensions_offset += local_increment;
1552
1
        nExtensions++;
1553
1
      }
1554
1
      proto_item_append_text(ti_extensions, ": %d elements", nExtensions);
1555
1
    }
1556
1
    icecandidate_offset += iceextensions_length;
1557
1
    if (icecandidate_offset <= 0) break;
1558
1
    icecandidates_offset += icecandidate_offset;
1559
1
    nCandidates++;
1560
1
  }
1561
3
  proto_item_append_text(ti_icecandidates, ": %d elements", nCandidates);
1562
1563
3
  return (2 + icecandidates_length);
1564
3
}
1565
1566
static int
1567
dissect_attachreqans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1568
0
{
1569
0
  proto_item *ti_attachreqans;
1570
0
  proto_tree *attachreqans_tree;
1571
0
  uint8_t     ufrag_length;
1572
0
  uint8_t     password_length;
1573
0
  uint8_t     role_length;
1574
0
  uint16_t    icecandidates_length;
1575
0
  uint16_t    local_offset = 0;
1576
1577
  /* variable length structures: must 1st compute the length ... */
1578
0
  ufrag_length = tvb_get_uint8(tvb,offset+local_offset);
1579
0
  local_offset += 1;
1580
0
  if (local_offset + ufrag_length > length) {
1581
0
    ti_attachreqans = proto_tree_add_item(tree, hf_reload_attachreqans, tvb, offset, length, ENC_NA);
1582
0
    expert_add_info_format(pinfo, ti_attachreqans, &ei_reload_truncated_field, "Truncated attach_reqans");
1583
0
    return length;
1584
0
  }
1585
0
  local_offset += ufrag_length;
1586
0
  password_length = tvb_get_uint8(tvb,offset+local_offset);
1587
0
  local_offset += 1;
1588
0
  if (local_offset + password_length > length) {
1589
0
    ti_attachreqans = proto_tree_add_item(tree, hf_reload_attachreqans, tvb, offset, length, ENC_NA);
1590
0
    expert_add_info_format(pinfo, ti_attachreqans, &ei_reload_truncated_field, "Truncated attach_reqans");
1591
0
    return length;
1592
0
  }
1593
0
  local_offset += password_length;
1594
0
  role_length = tvb_get_uint8(tvb,offset+local_offset);
1595
0
  local_offset += 1;
1596
0
  if (local_offset + role_length > length) {
1597
0
    ti_attachreqans = proto_tree_add_item(tree, hf_reload_attachreqans, tvb, offset, length, ENC_NA);
1598
0
    expert_add_info_format(pinfo, ti_attachreqans, &ei_reload_truncated_field, "Truncated attach_reqans");
1599
0
    return length;
1600
0
  }
1601
0
  local_offset += role_length;
1602
0
  icecandidates_length = tvb_get_ntohs(tvb, offset+local_offset);
1603
0
  local_offset += 2;
1604
0
  if (local_offset +icecandidates_length > length) {
1605
0
    ti_attachreqans = proto_tree_add_item(tree, hf_reload_attachreqans, tvb, offset, length, ENC_NA);
1606
0
    expert_add_info_format(pinfo, ti_attachreqans, &ei_reload_truncated_field, "Truncated attach_reqans");
1607
0
    return length;
1608
0
  }
1609
0
  local_offset += icecandidates_length;
1610
1611
0
  ti_attachreqans = proto_tree_add_item(tree, hf_reload_attachreqans, tvb, offset, local_offset, ENC_NA);
1612
0
  attachreqans_tree  = proto_item_add_subtree(ti_attachreqans, ett_reload_attachreqans);
1613
1614
  /* restart parsing, field by field */
1615
0
  local_offset = 0;
1616
0
  local_offset += dissect_opaque_string(tvb, pinfo,attachreqans_tree, hf_reload_ufrag,offset+local_offset, 1, -1);
1617
0
  local_offset += dissect_opaque_string(tvb, pinfo,attachreqans_tree, hf_reload_password,offset+local_offset, 1, -1);
1618
0
  local_offset += dissect_opaque_string(tvb, pinfo,attachreqans_tree, hf_reload_role,offset+local_offset, 1, -1);
1619
0
  local_offset += dissect_icecandidates(tvb, pinfo, attachreqans_tree, offset + local_offset, 2+icecandidates_length);
1620
1621
0
  proto_tree_add_item(attachreqans_tree, hf_reload_sendupdate, tvb, offset+local_offset, 1, ENC_BIG_ENDIAN);
1622
0
  local_offset += 1;
1623
1624
0
  return local_offset;
1625
0
}
1626
1627
1628
static int
1629
dissect_sipregistration(tvbuff_t *tvb, packet_info *pinfo,proto_tree *tree, uint16_t offset, uint16_t length)
1630
0
{
1631
0
  proto_item *ti_local, *ti_sipregistrationdata;
1632
0
  proto_tree *local_tree, *sipregistrationdata_tree;
1633
0
  int         local_offset = 0;
1634
0
  uint16_t    length_field;
1635
0
  uint8_t     type;
1636
1637
0
  ti_local = proto_tree_add_item(tree, hf_reload_sipregistration, tvb, offset, length, ENC_NA);
1638
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_sipregistration);
1639
1640
0
  type = tvb_get_uint8(tvb, offset + local_offset);
1641
0
  proto_tree_add_item(local_tree, hf_reload_sipregistration_type, tvb,offset+local_offset,1, ENC_BIG_ENDIAN);
1642
0
  local_offset += 1;
1643
0
  length_field = tvb_get_ntohs(tvb, offset+local_offset);
1644
0
  proto_tree_add_item(local_tree, hf_reload_length_uint16, tvb,offset+local_offset,2, ENC_BIG_ENDIAN);
1645
0
  local_offset += 2;
1646
0
  if (length_field>0) {
1647
0
    ti_sipregistrationdata = proto_tree_add_item(local_tree, hf_reload_sipregistration_data, tvb, offset, length_field, ENC_NA);
1648
0
    sipregistrationdata_tree = proto_item_add_subtree(ti_sipregistrationdata, ett_reload_sipregistration_data);
1649
1650
0
    switch(type) {
1651
0
    case SIPREGISTRATIONTYPE_URI:
1652
0
      dissect_opaque_string(tvb,pinfo, sipregistrationdata_tree, hf_reload_sipregistration_data_uri, offset+local_offset, 2, length_field);
1653
0
      break;
1654
1655
0
    case SIPREGISTRATIONTYPE_ROUTE:
1656
0
    {
1657
0
      uint16_t    route_offset    = 0;
1658
0
      uint16_t    destinations_length;
1659
0
      int         numDestinations = 0;
1660
0
      proto_item *ti_destination_list;
1661
0
      proto_tree *destination_list_tree;
1662
0
      route_offset += dissect_opaque_string(tvb,pinfo, sipregistrationdata_tree, hf_reload_sipregistration_data_contact_prefs, offset+local_offset, 2, length_field);
1663
0
      destinations_length = tvb_get_ntohs(tvb, offset+local_offset+route_offset);
1664
0
      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
0
      destination_list_tree = proto_item_add_subtree(ti_destination_list, ett_reload_sipregistration_destination_list);
1666
0
      proto_tree_add_item(destination_list_tree, hf_reload_length_uint16, tvb,offset+local_offset+route_offset, 2, ENC_BIG_ENDIAN);
1667
0
      route_offset += 2;
1668
0
      if (destinations_length>0) {
1669
0
        dissect_destination_list(tvb, pinfo, destination_list_tree, offset+local_offset+route_offset,destinations_length, &numDestinations);
1670
0
      }
1671
0
      proto_item_append_text(ti_destination_list, " (Destination<%d>): %d elements", destinations_length,numDestinations);
1672
0
    }
1673
0
    break;
1674
0
    }
1675
0
  }
1676
0
  local_offset += length_field;
1677
1678
0
  return local_offset;
1679
0
}
1680
1681
static int
1682
dissect_turnserver(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1683
0
{
1684
0
  proto_item *ti_local;
1685
0
  proto_tree *local_tree;
1686
0
  int         local_offset = 0;
1687
1688
0
  ti_local = proto_tree_add_item(tree, hf_reload_turnserver, tvb, offset, length, ENC_NA);
1689
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_turnserver);
1690
1691
0
  proto_tree_add_item(local_tree, hf_reload_turnserver_iteration, tvb,offset,1, ENC_BIG_ENDIAN);
1692
0
  local_offset += 1;
1693
0
  local_offset += dissect_ipaddressport(hf_reload_turnserver_server_address, tvb, pinfo, local_tree, offset+local_offset);
1694
1695
0
  return local_offset;
1696
0
}
1697
1698
static int dissect_redirserviceproviderdata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1699
0
{
1700
0
  proto_item *ti_local;
1701
0
  proto_tree *local_tree;
1702
0
  int         local_offset = 0;
1703
1704
0
  ti_local = proto_tree_add_item(tree, hf_reload_redirserviceproviderdata, tvb, offset, length, ENC_NA);
1705
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_redirserviceproviderdata);
1706
1707
0
  local_offset += dissect_nodeid(hf_reload_redirserviceproviderdata_serviceprovider, tvb, pinfo, local_tree, offset+local_offset, length);
1708
0
  local_offset += dissect_opaque_string(tvb, pinfo, local_tree, hf_reload_redirserviceproviderdata_namespace, offset+local_offset, 2, length-local_offset);
1709
0
  proto_tree_add_item(local_tree, hf_reload_redirserviceproviderdata_level, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
1710
0
  local_offset += 2;
1711
0
  proto_tree_add_item(local_tree, hf_reload_redirserviceproviderdata_node, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
1712
1713
0
  return length;
1714
0
}
1715
1716
static int dissect_redirserviceprovider(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
1717
0
{
1718
0
  proto_item *ti_local;
1719
0
  proto_tree *local_tree;
1720
0
  int         local_offset = 0;
1721
0
  uint16_t    length_field;
1722
1723
0
  length_field = tvb_get_ntohs(tvb, offset);
1724
1725
0
  if (2+length_field>length) {
1726
0
    ti_local = proto_tree_add_item(tree, hf_reload_redirserviceprovider, tvb, offset, length, ENC_NA);
1727
0
    expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated RedirServiceProvider");
1728
0
    return length;
1729
0
  }
1730
1731
0
  ti_local = proto_tree_add_item(tree, hf_reload_redirserviceprovider, tvb, offset, length_field+2, ENC_NA);
1732
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_redirserviceprovider);
1733
1734
0
  proto_tree_add_item(local_tree,  hf_reload_length_uint16, tvb, offset,2, ENC_BIG_ENDIAN);
1735
0
  local_offset += 2;
1736
1737
0
  dissect_redirserviceproviderdata(tvb, pinfo, local_tree, offset+local_offset, length_field);
1738
1739
0
  return (2+length_field);
1740
0
}
1741
1742
0
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
0
  proto_item *ti_datavalue;
1744
0
  proto_tree *datavalue_tree;
1745
1746
0
  if (meta != true) {
1747
0
    unsigned value_length = tvb_get_ntohl(tvb,offset+1);
1748
0
    int hf             = hf_reload_datavalue;
1749
1750
0
    if (anchor >= 0) {
1751
0
      hf = anchor;
1752
0
    }
1753
1754
0
    if (1+4+value_length > length) {
1755
0
      ti_datavalue = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1756
0
      expert_add_info_format(pinfo, ti_datavalue, &ei_reload_truncated_field, "Truncated DataValue");
1757
0
      return length;
1758
0
    }
1759
1760
0
    ti_datavalue = proto_tree_add_item(tree,  hf, tvb, offset,1+4+value_length, ENC_NA);
1761
0
    datavalue_tree = proto_item_add_subtree(ti_datavalue,ett_reload_datavalue);
1762
0
    proto_tree_add_item(datavalue_tree, hf_reload_datavalue_exists, tvb, offset, 1, ENC_BIG_ENDIAN);
1763
0
    if (kind != NULL) {
1764
0
      switch(kind->id) {
1765
1766
0
      case DATAKINDID_TURNSERVICE:
1767
0
      {
1768
0
        uint32_t length_field = tvb_get_ntohl(tvb, offset+1);
1769
0
        proto_tree_add_item(datavalue_tree,  hf_reload_length_uint32, tvb, offset+1,4, ENC_BIG_ENDIAN);
1770
0
        if (length_field>0) {
1771
0
          dissect_turnserver(tvb, pinfo, datavalue_tree, offset+1+4, length_field);
1772
0
        }
1773
0
      }
1774
0
      break;
1775
1776
0
      case DATAKINDID_SIP_REGISTRATION:
1777
0
      {
1778
0
        uint32_t length_field = tvb_get_ntohl(tvb, offset+1);
1779
0
        proto_tree_add_item(datavalue_tree,  hf_reload_length_uint32, tvb, offset+1,4, ENC_BIG_ENDIAN);
1780
0
        if (length_field>0) {
1781
0
          dissect_sipregistration(tvb, pinfo, datavalue_tree, offset+1+4, length_field);
1782
0
        }
1783
0
      }
1784
0
      break;
1785
1786
0
      case DATAKINDID_CERTIFICATE_BY_NODE:
1787
0
      case DATAKINDID_CERTIFICATE_BY_USER:
1788
0
      {
1789
0
        uint32_t length_field = tvb_get_ntohl(tvb, offset+1);
1790
0
        proto_tree_add_item(datavalue_tree,  hf_reload_length_uint32, tvb, offset+1,4, ENC_BIG_ENDIAN);
1791
0
        if (length_field>0) {
1792
0
          asn1_ctx_t asn1_ctx;
1793
1794
0
          asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
1795
0
          dissect_x509af_Certificate(false, tvb, offset + 1 + 4, &asn1_ctx,
1796
0
                                     datavalue_tree, hf_reload_certificate);
1797
0
        }
1798
0
      }
1799
0
      break;
1800
1801
0
      case DATAKINDID_REDIR:
1802
0
      {
1803
0
        uint32_t length_field = tvb_get_ntohl(tvb, offset+1);
1804
0
        proto_tree_add_item(datavalue_tree,  hf_reload_length_uint32, tvb, offset+1,4, ENC_BIG_ENDIAN);
1805
0
        if (length_field>0) {
1806
0
          dissect_redirserviceprovider(tvb, pinfo, datavalue_tree, offset+1+4, length_field);
1807
0
        }
1808
0
      }
1809
0
      break;
1810
1811
0
      default:
1812
0
        dissect_opaque(tvb, pinfo, datavalue_tree, hf_reload_datavalue_value, offset +1, 4, length-1);
1813
0
        break;
1814
0
      }
1815
0
    }
1816
0
    else {
1817
0
      dissect_opaque(tvb, pinfo, datavalue_tree, hf_reload_datavalue_value, offset +1, 4, length-1);
1818
0
    }
1819
0
    if (hf == anchor) {
1820
0
      proto_item_append_text(ti_datavalue, " (DataValue)");
1821
0
    }
1822
0
    return (1+4+value_length);
1823
0
  }
1824
0
  else {
1825
    /* meta data */
1826
0
    unsigned hash_length = tvb_get_uint8(tvb, offset +1+4+1);
1827
0
    int hf = hf_reload_metadata;
1828
1829
0
    if (anchor >= 0) {
1830
0
      hf = anchor;
1831
0
    }
1832
1833
1834
0
    if (1+4+1+1+hash_length > length) {
1835
0
      ti_datavalue = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1836
0
      expert_add_info_format(pinfo, ti_datavalue, &ei_reload_truncated_field, "Truncated MetaData");
1837
0
      return length;
1838
0
    }
1839
1840
0
    ti_datavalue = proto_tree_add_item(tree,  hf, tvb, offset,1+4+1+1+hash_length, ENC_NA);
1841
0
    datavalue_tree = proto_item_add_subtree(ti_datavalue,ett_reload_datavalue);
1842
0
    proto_tree_add_item(datavalue_tree, hf_reload_datavalue_exists, tvb, offset, 1, ENC_BIG_ENDIAN);
1843
0
    proto_tree_add_item(datavalue_tree, hf_reload_metadata_value_length, tvb, offset+1, 4, ENC_BIG_ENDIAN);
1844
0
    proto_tree_add_item(datavalue_tree, hf_reload_hash_algorithm, tvb, offset+1+4, 1, ENC_BIG_ENDIAN);
1845
0
    dissect_opaque(tvb, pinfo, datavalue_tree, hf_reload_metadata_hash_value, offset +1+4+1, 1, length-1-4-1);
1846
1847
0
    if (hf == anchor) {
1848
0
      proto_item_append_text(ti_datavalue, " (MetaData)");
1849
0
    }
1850
1851
0
    return (1+4+1+hash_length);
1852
0
  }
1853
0
  return 0;
1854
0
}
1855
1856
0
static unsigned getDataValueLength(tvbuff_t *tvb, uint16_t offset, bool meta) {
1857
0
  if (meta != true) {
1858
0
    unsigned value_length = tvb_get_ntohl(tvb,offset+1);
1859
0
    return (1+4+value_length);
1860
0
  }
1861
0
  else {
1862
0
    unsigned hash_length = tvb_get_uint8(tvb, offset +1+4+1);
1863
0
    return (1+4+1+1+hash_length);
1864
0
  }
1865
0
  return 0;
1866
0
}
1867
1868
0
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
0
  proto_item *ti_arrayentry, *ti_index;
1870
0
  proto_tree *arrayentry_tree;
1871
0
  int         data_length = getDataValueLength(tvb, offset+4, meta);
1872
0
  int         hf          = hf_reload_arrayentry;
1873
1874
0
  if (anchor >= 0) {
1875
0
    hf = anchor;
1876
0
  }
1877
1878
0
  if (4+data_length > length) {
1879
0
    ti_arrayentry = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1880
0
    expert_add_info_format(pinfo, ti_arrayentry, &ei_reload_truncated_field, "Truncated ArrayEntry");
1881
0
    return length;
1882
0
  }
1883
1884
0
  ti_arrayentry = proto_tree_add_item(tree,  hf, tvb, offset,4+data_length, ENC_NA);
1885
0
  arrayentry_tree = proto_item_add_subtree(ti_arrayentry,ett_reload_arrayentry);
1886
0
  ti_index = proto_tree_add_item(arrayentry_tree, hf_reload_arrayentry_index, tvb, offset, 4, ENC_BIG_ENDIAN);
1887
0
  if (0xffffffff == (uint32_t) tvb_get_ntohl(tvb, offset)) {
1888
0
    proto_item_append_text(ti_index, "(append)");
1889
0
  }
1890
0
  dissect_datavalue(hf_reload_arrayentry_value,tvb, pinfo, arrayentry_tree, offset+4, length-4, meta, kind);
1891
1892
0
  if (hf == anchor) {
1893
0
    proto_item_append_text(ti_arrayentry, " (ArrayEntry)");
1894
0
  }
1895
1896
0
  return (4+data_length);
1897
0
}
1898
1899
0
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
0
  proto_item *ti_dictionaryentry;
1901
0
  proto_tree *dictionaryentry_tree;
1902
0
  int         local_offset = 0;
1903
0
  uint16_t    key_length   = 0;
1904
0
  int         hf           = hf_reload_dictionaryentry;
1905
1906
0
  if (anchor >= 0) {
1907
0
    hf = anchor;
1908
0
  }
1909
1910
0
  if (length < 2) {
1911
0
    ti_dictionaryentry = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1912
0
    expert_add_info_format(pinfo, ti_dictionaryentry, &ei_reload_truncated_field, "Truncated ArrayEntry");
1913
0
    return length;
1914
0
  }
1915
0
  key_length = tvb_get_ntohs(tvb,offset);
1916
1917
1918
0
  if (length < (key_length +2)) {
1919
0
    ti_dictionaryentry = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1920
0
    expert_add_info_format(pinfo, ti_dictionaryentry, &ei_reload_truncated_field, "Truncated ArrayEntry");
1921
0
    return length;
1922
0
  }
1923
1924
0
  {
1925
0
    int data_length = getDataValueLength(tvb, offset+2+key_length, meta);
1926
0
    if (length < (key_length+2+data_length)) {
1927
0
      ti_dictionaryentry = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
1928
0
    }
1929
0
    else {
1930
0
      ti_dictionaryentry = proto_tree_add_item(tree, hf, tvb, offset, 2+key_length+1+4+data_length, ENC_NA);
1931
0
    }
1932
0
  }
1933
1934
1935
0
  dictionaryentry_tree = proto_item_add_subtree(ti_dictionaryentry,ett_reload_dictionaryentry);
1936
1937
0
  if (hf == anchor) {
1938
0
    proto_item_append_text(ti_dictionaryentry, " (DictionaryEntry)");
1939
0
  }
1940
1941
0
  if (kind != NULL) {
1942
0
    switch(kind->id) {
1943
0
    case DATAKINDID_SIP_REGISTRATION:
1944
0
    case DATAKINDID_REDIR:
1945
0
    {
1946
0
      proto_item *ti_key;
1947
0
      proto_tree *key_tree;
1948
0
      ti_key = proto_tree_add_item(dictionaryentry_tree, hf_reload_dictionarykey, tvb, offset, 2+key_length, ENC_NA);
1949
0
      key_tree = proto_item_add_subtree(ti_key,ett_reload_dictionaryentry_key);
1950
0
      proto_tree_add_item(key_tree, hf_reload_length_uint16, tvb, offset, 2, ENC_BIG_ENDIAN);
1951
0
      local_offset += 2;
1952
0
      local_offset+= dissect_nodeid(-1, tvb, pinfo, key_tree, offset+2, key_length);
1953
0
    }
1954
0
    break;
1955
1956
0
    default:
1957
0
      local_offset += dissect_opaque(tvb, pinfo, dictionaryentry_tree, hf_reload_dictionarykey, offset, 2, length);
1958
0
      break;
1959
0
    }
1960
0
  }
1961
0
  else {
1962
0
    local_offset +=
1963
0
      dissect_opaque(tvb, pinfo, dictionaryentry_tree, hf_reload_dictionarykey, offset, 2, length);
1964
0
  }
1965
1966
0
  local_offset += dissect_datavalue(hf_reload_dictionary_value,tvb, pinfo, dictionaryentry_tree, offset+local_offset, length-local_offset, meta, kind);
1967
1968
0
  return (local_offset);
1969
0
}
1970
1971
static int
1972
dissect_signature(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset)
1973
3
{
1974
3
  int         local_offset = 0;
1975
3
  proto_item *ti_signature;
1976
3
  proto_tree *signature_tree;
1977
3
  uint16_t    signeridentityvalue_length;
1978
3
  uint16_t    signaturevalue_length;
1979
1980
1981
3
  signeridentityvalue_length = tvb_get_ntohs(tvb, offset +2+1);
1982
3
  signaturevalue_length = tvb_get_ntohs(tvb, offset + 2 + 1 + 2+ signeridentityvalue_length);
1983
3
  ti_signature = proto_tree_add_item(tree,
1984
3
                                     hf_reload_signature, tvb, offset,
1985
3
                                     2 +/* SignatureAndHashAlgorithm */
1986
3
                                     1 + 2 + signeridentityvalue_length +/* SignatureIdentity length */
1987
3
                                     2 + signaturevalue_length,
1988
3
                                     ENC_NA);
1989
1990
3
  signature_tree = proto_item_add_subtree(ti_signature, ett_reload_signature);
1991
1992
3
  {
1993
3
    proto_item *ti_signatureandhashalgorithm;
1994
3
    proto_tree *signatureandhashalgorithm_tree;
1995
3
    ti_signatureandhashalgorithm = proto_tree_add_item(signature_tree, hf_reload_signatureandhashalgorithm, tvb, offset, 2, ENC_NA);
1996
3
    signatureandhashalgorithm_tree = proto_item_add_subtree( ti_signatureandhashalgorithm, ett_reload_signatureandhashalgorithm);
1997
3
    proto_tree_add_item(signatureandhashalgorithm_tree, hf_reload_hash_algorithm, tvb, offset, 1, ENC_BIG_ENDIAN);
1998
3
    local_offset += 1;
1999
3
    proto_tree_add_item(signatureandhashalgorithm_tree, hf_reload_signature_algorithm, tvb, offset + local_offset, 1, ENC_BIG_ENDIAN);
2000
3
    local_offset += 1;
2001
3
  }
2002
  /* Signeridentity */
2003
3
  {
2004
3
    proto_item *ti_signeridentity;
2005
3
    proto_tree *signeridentity_tree;
2006
3
    uint8_t identity_type;
2007
3
    ti_signeridentity = proto_tree_add_item(signature_tree,
2008
3
                                            hf_reload_signeridentity,
2009
3
                                            tvb, offset+local_offset,
2010
3
                                            1 + 2 + signeridentityvalue_length,
2011
3
                                            ENC_NA);
2012
3
    signeridentity_tree = proto_item_add_subtree(ti_signeridentity, ett_reload_signeridentity);
2013
3
    identity_type = tvb_get_uint8(tvb, offset + local_offset);
2014
3
    proto_tree_add_item(signeridentity_tree, hf_reload_signeridentity_type, tvb,
2015
3
                        offset + local_offset, 1, ENC_BIG_ENDIAN);
2016
3
    local_offset += 1;
2017
3
    proto_tree_add_uint(signeridentity_tree, hf_reload_length_uint16, tvb,
2018
3
                        offset + local_offset, 2, signeridentityvalue_length);
2019
3
    local_offset += 2;
2020
3
    {
2021
3
      proto_item *ti_signeridentity_identity;
2022
3
      proto_tree * signeridentity_identity_tree;
2023
3
      ti_signeridentity_identity = proto_tree_add_item(signeridentity_tree,
2024
3
                                   hf_reload_signeridentity_identity,
2025
3
                                   tvb, offset+local_offset,
2026
3
                                   signeridentityvalue_length,
2027
3
                                   ENC_NA);
2028
3
      signeridentity_identity_tree = proto_item_add_subtree(ti_signeridentity_identity, ett_reload_signeridentity_identity);
2029
3
      proto_item_append_text(ti_signeridentity_identity, " (SignerIdentityValue[%d])",signeridentityvalue_length);
2030
3
      {
2031
3
        proto_item *ti_signeridentityvalue;
2032
3
        proto_tree *signeridentityvalue_tree;
2033
3
        if (identity_type == SIGNERIDENTITYTYPE_CERTHASH || identity_type == SIGNERIDENTITYTYPE_CERTHASHNODEID) {
2034
0
          uint8_t certificate_hash_length;
2035
2036
0
          certificate_hash_length = tvb_get_uint8(tvb, offset + local_offset + 1);
2037
0
          if (1 + 1 + certificate_hash_length > signeridentityvalue_length) {
2038
0
            expert_add_info_format(pinfo, ti_signeridentity, &ei_reload_truncated_field, "Truncated signature identity value");
2039
0
          }
2040
0
          else {
2041
0
            ti_signeridentityvalue= proto_tree_add_item(signeridentity_identity_tree,
2042
0
                                    hf_reload_signeridentity_value,
2043
0
                                    tvb, offset + local_offset,
2044
0
                                    1 + 1 + certificate_hash_length,
2045
0
                                    ENC_NA);
2046
0
            signeridentityvalue_tree = proto_item_add_subtree(ti_signeridentityvalue, ett_reload_signeridentity_value);
2047
0
            proto_tree_add_item(signeridentityvalue_tree, hf_reload_signeridentity_value_hash_alg, tvb,
2048
0
                                offset + local_offset, 1, ENC_BIG_ENDIAN);
2049
0
            dissect_opaque(tvb, pinfo, signeridentityvalue_tree,
2050
0
                           (identity_type == SIGNERIDENTITYTYPE_CERTHASH) ?
2051
0
                           hf_reload_signeridentity_value_certificate_hash:
2052
0
                           hf_reload_signeridentity_value_certificate_node_id_hash,
2053
0
                           offset + local_offset +1, 1, -1);
2054
0
          }
2055
0
        }
2056
3
        else {
2057
3
          expert_add_info(pinfo, signeridentity_identity_tree, &ei_reload_identity_type_unknown);
2058
3
        }
2059
3
      }
2060
3
    }
2061
3
    local_offset += signeridentityvalue_length;
2062
3
  }
2063
3
  local_offset += dissect_opaque(tvb, pinfo, signature_tree, hf_reload_signature_value, offset + local_offset, 2, -1);
2064
2065
3
  return local_offset;
2066
2067
3
}
2068
2069
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)
2072
0
{
2073
0
  proto_item *ti_storeddata;
2074
0
  proto_tree *storeddata_tree;
2075
0
  uint32_t    storeddata_length;
2076
0
  uint32_t    local_offset;
2077
2078
0
  int hf =  hf_reload_storeddata;
2079
2080
0
  if (meta == true) {
2081
0
    hf = hf_reload_storedmetadata;
2082
0
  }
2083
2084
0
  storeddata_length = tvb_get_ntohl(tvb, offset);
2085
2086
0
  if (storeddata_length + 4 > length) {
2087
0
    ti_storeddata = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
2088
0
    expert_add_info_format(pinfo, ti_storeddata, &ei_reload_truncated_field, "Truncated StoredData");
2089
0
    return length;
2090
0
  }
2091
2092
0
  local_offset = 0;
2093
0
  ti_storeddata = proto_tree_add_item(tree, hf, tvb, offset, 4 + storeddata_length, ENC_NA);
2094
0
  storeddata_tree = proto_item_add_subtree(ti_storeddata, ett_reload_storeddata);
2095
2096
0
  proto_tree_add_uint(storeddata_tree, hf_reload_length_uint32, tvb, offset, 4, storeddata_length);
2097
0
  local_offset += 4;
2098
0
  {
2099
0
    uint64_t storage_time;
2100
0
    uint32_t remaining_ms;
2101
0
    time_t storage_time_sec;
2102
0
    nstime_t l_nsTime;
2103
2104
0
    storage_time = tvb_get_ntoh64(tvb, offset+local_offset);
2105
0
    storage_time_sec = (time_t)(storage_time/1000);
2106
0
    remaining_ms = (uint32_t) (storage_time % 1000);
2107
2108
0
    l_nsTime.secs = storage_time_sec;
2109
0
    l_nsTime.nsecs =  remaining_ms*1000*1000;
2110
2111
0
    proto_tree_add_time(storeddata_tree, hf_reload_storeddata_storage_time, tvb, offset + local_offset, 8, &l_nsTime);
2112
0
  }
2113
0
  local_offset += 8;
2114
0
  proto_tree_add_item(storeddata_tree, hf_reload_storeddata_lifetime, tvb, offset + local_offset, 4, ENC_BIG_ENDIAN);
2115
0
  local_offset += 4;
2116
0
  if ((NULL != kind) && (kind->id != DATAKINDID_INVALID)) {
2117
0
    switch(kind->data_model) {
2118
0
    case DATAMODEL_SINGLE:
2119
0
      local_offset += dissect_datavalue(hf_reload_value,tvb, pinfo, storeddata_tree, offset+local_offset, (storeddata_length-local_offset+4), meta, kind);
2120
0
      break;
2121
0
    case DATAMODEL_ARRAY:
2122
0
      local_offset +=  dissect_arrayentry(hf_reload_value,tvb, pinfo, storeddata_tree, offset+local_offset, (storeddata_length-local_offset+4), meta, kind);
2123
0
      break;
2124
0
    case DATAMODEL_DICTIONARY:
2125
0
      local_offset += dissect_dictionaryentry(hf_reload_value,tvb, pinfo, storeddata_tree, offset+local_offset, (storeddata_length-local_offset+4), meta, kind);
2126
0
      break;
2127
0
    default:
2128
0
      expert_add_info(pinfo, ti_storeddata, &ei_reload_unknown_data_model);
2129
0
      return  (storeddata_length + 4);
2130
0
    }
2131
0
    if (true != meta) {
2132
0
      dissect_signature(tvb, pinfo, storeddata_tree, offset +local_offset);
2133
0
    }
2134
0
  }
2135
0
  return (storeddata_length + 4);
2136
0
}
2137
2138
2139
2140
static int
2141
dissect_kindid(int anchor, tvbuff_t *tvb, proto_tree *tree, uint16_t offset, kind_t **kind)
2142
351
{
2143
351
  proto_item *ti_kindid;
2144
351
  uint32_t    kindid = 0;
2145
351
  int         hf     = hf_reload_kindid;
2146
2147
351
  if (anchor >= 0) {
2148
229
    hf = anchor;
2149
229
  }
2150
2151
351
  *kind = NULL;
2152
2153
351
  kindid = tvb_get_ntohl(tvb, offset);
2154
351
  *kind = getKindFromId(kindid);
2155
351
  ti_kindid = proto_tree_add_item(tree, hf, tvb, offset, 4, ENC_BIG_ENDIAN);
2156
351
  if ((NULL != (*kind)) && ((*kind)->name != NULL)) {
2157
124
    proto_item_append_text(ti_kindid, " (%s)", (*kind)->name);
2158
124
  }
2159
2160
351
  return 4;
2161
351
}
2162
2163
static int
2164
dissect_kinddata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length, bool meta)
2165
0
{
2166
0
  proto_item *ti_kinddata;
2167
0
  proto_item *kinddata_tree;
2168
0
  uint32_t    values_length;
2169
0
  uint32_t    local_offset = 0;
2170
0
  kind_t     *kind;
2171
0
  int         hf           = hf_reload_kinddata;
2172
0
  int         nValues      = 0;
2173
2174
0
  if (meta) {
2175
0
    hf = hf_reload_statkindresponse;
2176
0
  }
2177
2178
0
  values_length = tvb_get_ntohl(tvb, offset + 4 + 8);
2179
0
  if (12 + values_length > length) {
2180
0
    ti_kinddata = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
2181
0
    expert_add_info_format(pinfo, ti_kinddata, &ei_reload_truncated_field, "Truncated kind data");
2182
0
    return length;
2183
0
  }
2184
0
  ti_kinddata = proto_tree_add_item(tree, hf, tvb, offset, 16+values_length, ENC_NA);
2185
0
  kinddata_tree = proto_item_add_subtree(ti_kinddata, ett_reload_kinddata);
2186
2187
0
  local_offset += dissect_kindid(hf_reload_kinddata_kind,tvb, kinddata_tree, offset+local_offset, &kind);
2188
2189
0
  proto_tree_add_item(kinddata_tree, hf_reload_generation_counter, tvb, offset+local_offset, 8, ENC_BIG_ENDIAN);
2190
0
  local_offset += 8;
2191
0
  {
2192
0
    int32_t values_offset = 0;
2193
0
    uint32_t values_increment;
2194
0
    proto_item *ti_values;
2195
0
    proto_tree *values_tree;
2196
2197
0
    ti_values = proto_tree_add_item(kinddata_tree, hf_reload_values, tvb, offset+local_offset, 4+values_length, ENC_NA);
2198
0
    values_tree = proto_item_add_subtree(ti_values, ett_reload_values);
2199
0
    if (meta) {
2200
0
      proto_item_append_text(ti_values, " (StoredMetaData<%d>)", values_length);
2201
0
    } else {
2202
0
      proto_item_append_text(ti_values, " (StoredData<%d>)", values_length);
2203
0
    }
2204
2205
0
    proto_tree_add_uint(values_tree, hf_reload_length_uint32, tvb, offset +local_offset, 4, values_length);
2206
0
    local_offset += 4;
2207
2208
0
    while (values_offset >= 0 && (uint32_t)values_offset < values_length) {
2209
0
      values_increment = dissect_storeddata(tvb, pinfo, values_tree, offset+local_offset+values_offset, values_length - values_offset, kind, meta);
2210
0
      if (values_increment == 0) {
2211
0
        break;
2212
0
      }
2213
0
      nValues++;
2214
0
      values_offset += values_increment;
2215
0
    }
2216
0
    proto_item_append_text(ti_values, ": %d elements", nValues);
2217
0
  }
2218
2219
0
  local_offset += values_length;
2220
0
  return local_offset;
2221
0
}
2222
2223
static int dissect_nodeid_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length, int hf)
2224
130
{
2225
130
  uint16_t    list_length;
2226
130
  uint16_t    local_offset   = 0;
2227
130
  int32_t     list_offset    = 0;
2228
130
  uint16_t    list_increment = 0;
2229
130
  int         nNodeIds       = 0;
2230
130
  proto_item *ti_local;
2231
130
  proto_tree *local_tree;
2232
2233
130
  list_length= (uint16_t) tvb_get_ntohs(tvb, offset);
2234
2235
130
  if (list_length+2>length) {
2236
6
    ti_local = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
2237
6
    expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated NodeId list");
2238
6
  }
2239
130
  ti_local = proto_tree_add_item(tree, hf, tvb, offset,  list_length+2, ENC_NA);
2240
130
  proto_item_append_text(ti_local, " (NodeId<%d>)", list_length);
2241
2242
130
  local_tree =  proto_item_add_subtree(ti_local, ett_reload_nodeid_list);
2243
2244
130
  local_offset += dissect_length(tvb, local_tree, offset, 2);
2245
859
  while (list_offset >= 0 && list_offset < list_length) {
2246
729
    dissect_nodeid(-1, tvb, pinfo, local_tree, offset+local_offset+list_offset,list_length-list_offset);
2247
729
    list_increment = reload_nodeid_length;
2248
729
    if (list_increment <= 0) break;
2249
729
    list_offset += list_increment;
2250
729
    nNodeIds++;
2251
729
  }
2252
130
  proto_item_append_text(ti_local, ":%d elements", nNodeIds);
2253
2254
130
  return (list_length+2);
2255
130
}
2256
2257
2258
static int
2259
dissect_storekindresponse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2260
132
{
2261
132
  proto_item *ti_local;
2262
132
  proto_tree *local_tree;
2263
132
  uint16_t    local_offset = 0;
2264
132
  uint16_t    local_length = 0;
2265
132
  uint16_t    replicas_length;
2266
132
  kind_t     *kind;
2267
2268
132
  replicas_length = tvb_get_ntohs(tvb, offset+4+8);
2269
132
  local_length = 4+8+2+replicas_length;
2270
2271
132
  if (length < local_length) {
2272
1
    ti_local = proto_tree_add_item(tree, hf_reload_storekindresponse, tvb, offset, length, ENC_NA);
2273
1
    expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated StoreKindResponse");
2274
1
    return length;
2275
1
  }
2276
131
  ti_local = proto_tree_add_item(tree, hf_reload_storekindresponse, tvb, offset,  4+8+2+replicas_length, ENC_NA);
2277
131
  local_tree = proto_item_add_subtree(ti_local, ett_reload_storekindresponse);
2278
2279
131
  local_offset += dissect_kindid(hf_reload_kinddata_kind,tvb, local_tree, offset+local_offset, &kind);
2280
131
  proto_tree_add_item(local_tree, hf_reload_generation_counter, tvb, offset+local_offset, 8, ENC_BIG_ENDIAN);
2281
131
  local_offset += 8;
2282
131
  local_offset += dissect_nodeid_list(tvb, pinfo, local_tree, offset+local_offset, local_length-local_offset, hf_reload_replicas);
2283
2284
131
  return local_offset;
2285
132
}
2286
2287
static int
2288
dissect_storeans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2289
35
{
2290
35
  proto_item *ti_local, *ti_kind_responses;
2291
35
  proto_tree *local_tree, *kind_responses_tree;
2292
35
  uint16_t    local_offset          = 0;
2293
35
  uint16_t    kind_responses_length;
2294
35
  int32_t     kind_responses_offset = 0;
2295
35
  int         nKindResponses        = 0;
2296
2297
35
  ti_local = proto_tree_add_item(tree, hf_reload_storeans, tvb, offset, length, ENC_NA);
2298
35
  local_tree = proto_item_add_subtree(ti_local, ett_reload_storeans);
2299
35
  kind_responses_length = tvb_get_ntohs(tvb, offset);
2300
35
  ti_kind_responses = proto_tree_add_item(local_tree, hf_reload_storeans_kind_responses, tvb, offset, 2+kind_responses_length, ENC_NA);
2301
35
  kind_responses_tree = proto_item_add_subtree(ti_kind_responses, ett_reload_storeans_kind_responses);
2302
35
  proto_item_append_text(ti_kind_responses, " (StoreKindResponse<%d>)", kind_responses_length);
2303
2304
35
  proto_tree_add_item(kind_responses_tree, hf_reload_length_uint16, tvb, offset, 2, ENC_BIG_ENDIAN);
2305
35
  local_offset += 2;
2306
167
  while (kind_responses_offset >=0 && kind_responses_offset < kind_responses_length) {
2307
132
    int local_increment = dissect_storekindresponse(tvb, pinfo, kind_responses_tree, offset+local_offset+kind_responses_offset, kind_responses_length-kind_responses_offset);
2308
132
    if (local_increment <= 0) break;
2309
132
    kind_responses_offset += local_increment;
2310
132
    nKindResponses++;
2311
132
  }
2312
35
  local_offset += kind_responses_length;
2313
35
  proto_item_append_text(ti_kind_responses, ": %d elements", nKindResponses);
2314
2315
35
  return local_offset;
2316
35
}
2317
2318
static int
2319
dissect_storereq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2320
0
{
2321
0
  proto_item *ti_storereq;
2322
0
  proto_tree *storereq_tree;
2323
0
  uint32_t    local_offset = 0;
2324
0
  uint32_t    kind_data_length;
2325
2326
2327
0
  local_offset += tvb_get_uint8(tvb, offset) + 1; /* resource id length */
2328
0
  if (local_offset > length) {
2329
0
    ti_storereq = proto_tree_add_item(tree, hf_reload_storereq, tvb, offset, length, ENC_NA);
2330
0
    expert_add_info_format(pinfo, ti_storereq, &ei_reload_truncated_field, "Truncated StoreReq: resource too long");
2331
0
    return length;
2332
0
  }
2333
2334
0
  local_offset += 1; /* replica_num */
2335
0
  if (local_offset > length) {
2336
0
    ti_storereq = proto_tree_add_item(tree, hf_reload_storereq, tvb, offset, length, ENC_NA);
2337
0
    expert_add_info_format(pinfo, ti_storereq, &ei_reload_truncated_field, "Truncated StoreReq: no room for replica_number");
2338
0
    return length;
2339
0
  }
2340
2341
0
  kind_data_length = tvb_get_ntohl(tvb, offset + local_offset);
2342
0
  local_offset += 4;
2343
0
  if (local_offset + kind_data_length > length) {
2344
0
    ti_storereq = proto_tree_add_item(tree, hf_reload_storereq, tvb, offset, length, ENC_NA);
2345
0
    expert_add_info_format(pinfo, ti_storereq, &ei_reload_truncated_field, "Truncated StoreReq: kind_data too long");
2346
0
    return length;
2347
0
  }
2348
0
  local_offset += kind_data_length;
2349
2350
0
  ti_storereq = proto_tree_add_item(tree, hf_reload_storereq, tvb, offset, local_offset, ENC_NA);
2351
0
  storereq_tree = proto_item_add_subtree(ti_storereq, ett_reload_storereq);
2352
2353
  /* Parse from start */
2354
0
  local_offset = 0;
2355
0
  local_offset += dissect_resourceid(hf_reload_resource, tvb, pinfo, storereq_tree, offset+local_offset, length);
2356
2357
0
  proto_tree_add_item(storereq_tree, hf_reload_store_replica_num, tvb, offset + local_offset, 1, ENC_BIG_ENDIAN);
2358
0
  local_offset += 1;
2359
2360
2361
0
  {
2362
0
    int32_t     kind_data_offset = 0;
2363
0
    uint32_t    kind_data_increment;
2364
0
    proto_item *ti_kind_data;
2365
0
    proto_tree *kind_data_tree;
2366
0
    int         nKindDatas       = 0;
2367
2368
0
    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
0
    proto_item_append_text(ti_kind_data, " (StoreKindData<%d>)", kind_data_length);
2370
0
    kind_data_tree = proto_item_add_subtree(ti_kind_data, ett_reload_store_kind_data);
2371
0
    proto_tree_add_item(kind_data_tree, hf_reload_length_uint32, tvb, offset + local_offset, 4, ENC_BIG_ENDIAN);
2372
0
    local_offset += 4;
2373
2374
0
    while (kind_data_offset >= 0 && (uint32_t)kind_data_offset < kind_data_length) {
2375
0
      kind_data_increment = dissect_kinddata(tvb, pinfo, kind_data_tree, offset+local_offset+kind_data_offset, kind_data_length - kind_data_offset, false);
2376
0
      if (kind_data_increment == 0) {
2377
0
        break;
2378
0
      }
2379
0
      nKindDatas++;
2380
0
      kind_data_offset += kind_data_increment;
2381
0
    }
2382
2383
0
    proto_item_append_text(ti_kind_data, ": %d elements", nKindDatas);
2384
0
  }
2385
0
  local_offset += kind_data_length;
2386
2387
0
  return local_offset;
2388
0
}
2389
2390
0
static int dissect_arrayrange(tvbuff_t *tvb, proto_tree *tree, uint16_t offset) {
2391
0
  proto_item *ti;
2392
0
  int32_t     first;
2393
0
  int32_t     last;
2394
2395
0
  ti = proto_tree_add_item(tree, hf_reload_arrayrange, tvb, offset, (16), ENC_NA);
2396
0
  first =  tvb_get_ntohl(tvb, offset);
2397
0
  last  =  tvb_get_ntohl(tvb, offset+4);
2398
2399
0
  proto_item_append_text(ti, " [%d-", first);
2400
0
  if ((uint32_t)last != 0xFFFFFFFF) {
2401
0
    proto_item_append_text(ti, "%d]", last);
2402
0
  }
2403
0
  else {
2404
0
    proto_item_append_text(ti, "end]");
2405
0
  }
2406
0
  return 8;
2407
2408
0
}
2409
static int
2410
dissect_storeddataspecifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2411
0
{
2412
0
  uint16_t    length_field, local_offset = 0;
2413
0
  proto_item *ti_storeddataspecifier;
2414
0
  proto_tree *storeddataspecifier_tree;
2415
0
  kind_t     *kind                       = NULL;
2416
2417
0
  length_field = tvb_get_ntohs(tvb, offset+4+8);
2418
0
  if ((length_field + 4 + 8 + 2) > length) {
2419
0
    ti_storeddataspecifier = proto_tree_add_item(tree, hf_reload_storeddataspecifier, tvb, offset, length, ENC_NA);
2420
0
    expert_add_info_format(pinfo, ti_storeddataspecifier, &ei_reload_truncated_field, "Truncated StoredDataSpecifier");
2421
0
    return length;
2422
0
  }
2423
2424
0
  ti_storeddataspecifier = proto_tree_add_item(tree, hf_reload_storeddataspecifier, tvb, offset, (length_field + 4 + 8 +2), ENC_NA);
2425
0
  storeddataspecifier_tree = proto_item_add_subtree(ti_storeddataspecifier, ett_reload_storeddataspecifier);
2426
2427
0
  local_offset += dissect_kindid(hf_reload_kinddata_kind,tvb,storeddataspecifier_tree, offset, &kind);
2428
0
  proto_tree_add_item(storeddataspecifier_tree, hf_reload_generation_counter, tvb, offset+local_offset, 8, ENC_BIG_ENDIAN);
2429
0
  local_offset += 8;
2430
0
  proto_tree_add_item(storeddataspecifier_tree, hf_reload_length_uint16, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
2431
0
  local_offset += 2;
2432
2433
0
  if ((kind != NULL) && (kind->id != DATAKINDID_INVALID)) {
2434
0
    switch(kind->data_model) {
2435
0
    case DATAMODEL_ARRAY:
2436
0
    {
2437
0
      proto_item *ti_indices;
2438
0
      proto_tree *indices_tree;
2439
0
      int32_t     indices_offset = 0;
2440
0
      uint16_t    indices_length = tvb_get_ntohs(tvb, offset+local_offset);
2441
0
      int         nIndices       = 0;
2442
0
      ti_indices = proto_tree_add_item(storeddataspecifier_tree, hf_reload_storeddataspecifier_indices,
2443
0
                                       tvb, offset+local_offset, 2+indices_length, ENC_NA);
2444
0
      proto_item_append_text(ti_indices, " (ArrayRange<%d>)", indices_length);
2445
0
      indices_tree =  proto_item_add_subtree(ti_indices, ett_reload_storeddataspecifier_indices);
2446
0
      proto_tree_add_item(indices_tree, hf_reload_length_uint16, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
2447
0
      local_offset += 2;
2448
0
      while (indices_offset >= 0 && indices_offset < indices_length) {
2449
0
        indices_offset += dissect_arrayrange(tvb, indices_tree, offset + local_offset + indices_offset);
2450
0
        nIndices++;
2451
0
      }
2452
0
      proto_item_append_text(ti_indices, ": %d elements", nIndices);
2453
0
    }
2454
0
    break;
2455
2456
0
    case DATAMODEL_DICTIONARY:
2457
0
    {
2458
0
      proto_item *ti_keys;
2459
0
      proto_tree *keys_tree;
2460
0
      int32_t     keys_offset = 0;
2461
0
      uint16_t    keys_length = tvb_get_ntohs(tvb, offset+local_offset);
2462
0
      int         nKeys       = 0;
2463
0
      ti_keys = proto_tree_add_item(tree, hf_reload_storeddataspecifier_keys, tvb, offset+local_offset, 2+keys_length, ENC_NA);
2464
0
      keys_tree =  proto_item_add_subtree(ti_keys, ett_reload_storeddataspecifier_keys);
2465
0
      while (keys_offset >= 0 && keys_offset < keys_length) {
2466
0
        uint32_t local_increment;
2467
0
        local_increment = dissect_opaque(tvb, pinfo, keys_tree, hf_reload_dictionarykey, offset, 2, keys_length-keys_offset);
2468
0
        if (local_increment == 0) break;
2469
0
        keys_offset += local_increment;
2470
0
        nKeys++;
2471
0
      }
2472
0
      proto_item_append_text(ti_keys, "(%d keys)", nKeys);
2473
2474
0
    }
2475
0
    break;
2476
2477
0
    default:
2478
0
      break;
2479
0
    }
2480
0
  }
2481
0
  return (length_field + 4 + 8 +2);
2482
0
}
2483
2484
2485
static int
2486
dissect_fetchreq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length, bool meta)
2487
0
{
2488
0
  proto_item *ti_fetchreq;
2489
0
  proto_item *ti_specifiers;
2490
0
  proto_tree *fetchreq_tree;
2491
0
  proto_tree *specifiers_tree;
2492
0
  uint16_t    resourceid_length;
2493
0
  uint16_t    specifiers_length;
2494
0
  int32_t     specifiers_offset = 0;
2495
0
  int         nSpecifiers       = 0;
2496
0
  uint16_t    local_offset      = 0;
2497
0
  uint16_t    local_length      = 0;
2498
0
  int         hf                = hf_reload_fetchreq;
2499
2500
0
  if (meta == true) {
2501
0
    hf = hf_reload_statreq;
2502
0
  }
2503
2504
0
  resourceid_length = tvb_get_uint8(tvb,offset);
2505
0
  specifiers_length = tvb_get_ntohs(tvb, offset+1+resourceid_length);
2506
2507
0
  if (1+ resourceid_length+ 2 + specifiers_length > length) {
2508
0
    ti_fetchreq = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
2509
0
    expert_add_info_format(pinfo, ti_fetchreq, &ei_reload_truncated_field, "Truncated FetchReq");
2510
0
    return length;
2511
0
  }
2512
0
  local_length =  1+ resourceid_length+ 2 + specifiers_length;
2513
0
  ti_fetchreq = proto_tree_add_item(tree, hf, tvb, offset, local_length, ENC_NA);
2514
0
  fetchreq_tree = proto_item_add_subtree(ti_fetchreq, ett_reload_fetchreq);
2515
2516
0
  local_offset +=
2517
0
    dissect_resourceid(hf_reload_resource, tvb, pinfo, fetchreq_tree, offset, local_length);
2518
2519
0
  ti_specifiers = proto_tree_add_item(fetchreq_tree, hf_reload_fetchreq_specifiers, tvb, offset+local_offset, 2+specifiers_length, ENC_NA);
2520
0
  specifiers_tree = proto_item_add_subtree(ti_specifiers, ett_reload_fetchreq_specifiers);
2521
0
  proto_item_append_text(ti_specifiers, "(StoredDataSpecifier<%d>)", specifiers_length);
2522
0
  proto_tree_add_item(specifiers_tree, hf_reload_length_uint16, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
2523
0
  local_offset += 2;
2524
2525
0
  while (specifiers_offset >= 0 && specifiers_offset < specifiers_length) {
2526
0
    uint32_t specifiers_increment;
2527
0
    specifiers_increment = dissect_storeddataspecifier(tvb, pinfo, specifiers_tree, offset+local_offset+specifiers_offset, specifiers_length-specifiers_offset);
2528
0
    if (specifiers_increment == 0) {
2529
0
      break;
2530
0
    }
2531
0
    nSpecifiers++;
2532
0
    specifiers_offset += specifiers_increment;
2533
0
  }
2534
0
  proto_item_append_text(ti_specifiers, ": %d elements", nSpecifiers);
2535
2536
0
  return (1+ resourceid_length+ 2 + specifiers_length);
2537
0
}
2538
2539
2540
static int
2541
dissect_fetchans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2542
0
{
2543
0
  proto_item *ti_fetchans;
2544
0
  proto_tree *fetchans_tree;
2545
0
  uint32_t    kind_responses_length;
2546
0
  uint32_t    kind_responses_offset = 0;
2547
2548
0
  kind_responses_length = tvb_get_ntohl(tvb, offset);
2549
0
  if (4 + kind_responses_length > length) {
2550
0
    ti_fetchans = proto_tree_add_item(tree, hf_reload_fetchans, tvb, offset, length, ENC_NA);
2551
0
    expert_add_info_format(pinfo, ti_fetchans, &ei_reload_truncated_field, "Truncated FetchAns");
2552
0
    return length;
2553
0
  }
2554
0
  ti_fetchans = proto_tree_add_item(tree, hf_reload_fetchans, tvb, offset, 4 + kind_responses_length, ENC_NA);
2555
0
  fetchans_tree = proto_item_add_subtree(ti_fetchans, ett_reload_fetchans);
2556
2557
0
  proto_tree_add_uint(fetchans_tree, hf_reload_length_uint32, tvb, offset, 4, kind_responses_length);
2558
2559
0
  while (kind_responses_offset < kind_responses_length) {
2560
0
    uint32_t kind_responses_increment;
2561
0
    kind_responses_increment = dissect_kinddata(tvb, pinfo, fetchans_tree, offset + 4 + kind_responses_offset, kind_responses_length - kind_responses_offset, false);
2562
0
    if (kind_responses_increment == 0) {
2563
0
      break;
2564
0
    }
2565
0
    kind_responses_offset += kind_responses_increment;
2566
0
  }
2567
2568
0
  return 4 + kind_responses_length;
2569
0
}
2570
2571
2572
static int
2573
dissect_statans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2574
0
{
2575
0
  proto_item *ti_statans;
2576
0
  proto_tree *statans_tree;
2577
0
  uint32_t    kind_responses_length;
2578
0
  uint32_t    kind_responses_offset = 0;
2579
0
  int         nResponses            = 0;
2580
2581
0
  kind_responses_length = tvb_get_ntohl(tvb, offset);
2582
2583
0
  if (kind_responses_length > UINT16_MAX || 4 + kind_responses_length > length) {
2584
0
    ti_statans = proto_tree_add_item(tree, hf_reload_statans, tvb, offset, length, ENC_NA);
2585
0
    expert_add_info_format(pinfo, ti_statans, &ei_reload_truncated_field, "Truncated StatAns");
2586
0
    return length;
2587
0
  }
2588
0
  ti_statans = proto_tree_add_item(tree, hf_reload_statans, tvb, offset, 4 + kind_responses_length, ENC_NA);
2589
0
  proto_item_append_text(ti_statans, " (StatKindResponse<%d>)", kind_responses_length);
2590
0
  statans_tree = proto_item_add_subtree(ti_statans, ett_reload_statans);
2591
2592
0
  proto_tree_add_uint(statans_tree, hf_reload_length_uint32, tvb, offset, 4, kind_responses_length);
2593
2594
2595
0
  while (kind_responses_offset < kind_responses_length) {
2596
0
    uint32_t kind_responses_increment;
2597
0
    kind_responses_increment = dissect_kinddata(tvb, pinfo, statans_tree, offset + 4 + kind_responses_offset, kind_responses_length - kind_responses_offset, true);
2598
0
    if (kind_responses_increment == 0) {
2599
0
      break;
2600
0
    }
2601
0
    nResponses++;
2602
0
    kind_responses_offset += kind_responses_increment;
2603
0
  }
2604
2605
0
  proto_item_append_text(ti_statans, ": %d elements", nResponses);
2606
2607
0
  return 4 + kind_responses_length;
2608
0
}
2609
2610
2611
static int
2612
dissect_chordupdate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2613
0
{
2614
0
  proto_item *ti_chordupdate;
2615
0
  proto_tree *chordupdate_tree;
2616
0
  uint16_t    local_offset = 0;
2617
0
  uint8_t     type;
2618
2619
0
  ti_chordupdate = proto_tree_add_item(tree, hf_reload_chordupdate, tvb, offset, length, ENC_NA);
2620
0
  chordupdate_tree = proto_item_add_subtree(ti_chordupdate, ett_reload_chordupdate);
2621
2622
0
  proto_tree_add_item(chordupdate_tree, hf_reload_uptime, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
2623
0
  local_offset += 4;
2624
0
  type = tvb_get_uint8(tvb, offset + local_offset);
2625
0
  proto_tree_add_uint(chordupdate_tree, hf_reload_chordupdate_type, tvb, offset+local_offset, 1, type);
2626
0
  local_offset += 1;
2627
2628
0
  switch(type) {
2629
0
  case CHORDUPDATETYPE_NEIGHBORS:
2630
0
    local_offset += dissect_nodeid_list(tvb, pinfo, chordupdate_tree, offset+local_offset, length-local_offset, hf_reload_chordupdate_predecessors);
2631
0
    local_offset += dissect_nodeid_list(tvb, pinfo, chordupdate_tree, offset+local_offset, length-local_offset, hf_reload_chordupdate_successors);
2632
0
    break;
2633
2634
0
  case CHORDUPDATETYPE_FULL:
2635
0
    local_offset += dissect_nodeid_list(tvb, pinfo, chordupdate_tree, offset+local_offset, length-local_offset, hf_reload_chordupdate_predecessors);
2636
0
    local_offset += dissect_nodeid_list(tvb, pinfo, chordupdate_tree, offset+local_offset, length-local_offset, hf_reload_chordupdate_successors);
2637
0
    local_offset += dissect_nodeid_list(tvb, pinfo, chordupdate_tree, offset+local_offset, length-local_offset, hf_reload_chordupdate_fingers);
2638
0
    break;
2639
2640
0
  default:
2641
0
    break;
2642
0
  }
2643
0
  return local_offset;
2644
0
}
2645
2646
2647
static int
2648
dissect_chordroutequeryans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2649
0
{
2650
0
  proto_item *ti_chordroutequeryans;
2651
0
  proto_tree *chordroutequeryans_tree;
2652
2653
0
  ti_chordroutequeryans = proto_tree_add_item(tree, hf_reload_chordroutequeryans, tvb, offset, length, ENC_NA);
2654
0
  chordroutequeryans_tree = proto_item_add_subtree(ti_chordroutequeryans, ett_reload_chordroutequeryans);
2655
0
  dissect_nodeid(hf_reload_chordroutequeryans_next_peer, tvb, pinfo, chordroutequeryans_tree, offset, length);
2656
2657
0
  return length;
2658
0
}
2659
2660
static int
2661
dissect_chordleavedata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2662
0
{
2663
0
  proto_item *ti_local;
2664
0
  proto_tree *local_tree;
2665
0
  uint16_t    local_offset = 0;
2666
0
  uint8_t     type;
2667
2668
0
  ti_local = proto_tree_add_item(tree, hf_reload_chordleave, tvb, offset, length, ENC_NA);
2669
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_chordleave);
2670
2671
0
  type = tvb_get_uint8(tvb, offset + local_offset);
2672
0
  proto_tree_add_uint(local_tree, hf_reload_chordleave_type, tvb, offset+local_offset, 1, type);
2673
0
  local_offset += 1;
2674
2675
0
  switch(type) {
2676
0
  case CHORDLEAVETYPE_FROM_SUCC:
2677
0
    local_offset += dissect_nodeid_list(tvb, pinfo, local_tree, offset+local_offset, length-local_offset, hf_reload_chordleave_successors);
2678
0
    break;
2679
2680
0
  case CHORDLEAVETYPE_FROM_PRED:
2681
0
    local_offset += dissect_nodeid_list(tvb, pinfo, local_tree, offset+local_offset, length-local_offset, hf_reload_chordleave_predecessors);
2682
0
    break;
2683
2684
0
  default:
2685
0
    break;
2686
0
  }
2687
0
  return local_offset;
2688
0
}
2689
2690
static int dissect_kindid_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2691
8
{
2692
8
  proto_item *ti_local;
2693
8
  proto_tree *local_tree;
2694
8
  int         kinds_length = 0;
2695
8
  int         kinds_offset = 0;
2696
8
  int         nKinds       = 0;
2697
2698
8
  kinds_length = tvb_get_uint8(tvb, offset);
2699
2700
8
  if ((uint16_t)length<kinds_length+1) {
2701
0
    ti_local = proto_tree_add_item(tree, hf_reload_kindid_list, tvb, offset, length, ENC_NA);
2702
0
    expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated kinds list");
2703
0
  }
2704
8
  ti_local = proto_tree_add_item(tree, hf_reload_kindid_list, tvb, offset, length, ENC_NA);
2705
8
  local_tree = proto_item_add_subtree(ti_local, ett_reload_kindid_list);
2706
8
  proto_item_append_text(ti_local, "(KindId<%d>)", kinds_length);
2707
2708
8
  dissect_length(tvb, local_tree, offset, 1);
2709
2710
130
  while (kinds_offset < kinds_length) {
2711
122
    kind_t *kind;
2712
122
    int local_increment = dissect_kindid(-1,tvb, local_tree,offset+1+kinds_offset, &kind);
2713
122
    if (local_increment <= 0) break;
2714
122
    kinds_offset += local_increment;
2715
122
    nKinds++;
2716
122
  }
2717
8
  proto_item_append_text(ti_local, ": %d elements", nKinds);
2718
2719
8
  return (1+kinds_length);
2720
8
}
2721
2722
8
static int dissect_findreq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length) {
2723
8
  proto_item *ti_local;
2724
8
  proto_tree *local_tree;
2725
8
  uint16_t    local_offset = 0;
2726
2727
8
  ti_local = proto_tree_add_item(tree, hf_reload_findreq, tvb, offset, length, ENC_NA);
2728
8
  local_tree = proto_item_add_subtree(ti_local, ett_reload_findreq);
2729
2730
8
  local_offset += dissect_resourceid(hf_reload_resource, tvb, pinfo, local_tree, offset, length);
2731
8
  dissect_kindid_list(tvb, pinfo, local_tree, offset+local_offset, length-local_offset);
2732
2733
8
  return length;
2734
8
}
2735
2736
8
static int dissect_findans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length) {
2737
8
  proto_item *ti_local;
2738
8
  proto_tree *local_tree;
2739
8
  uint16_t    results_length;
2740
2741
8
  ti_local = proto_tree_add_item(tree, hf_reload_findans, tvb, offset, length, ENC_NA);
2742
8
  local_tree = proto_item_add_subtree(ti_local, ett_reload_findans);
2743
8
  results_length = tvb_get_ntohs(tvb, offset);
2744
8
  proto_item_append_text(ti_local, " (FindKindData<%d>)", results_length);
2745
8
  if (results_length + 2 > length) {
2746
1
    expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated FindAns");
2747
1
  }
2748
8
  proto_tree_add_uint(local_tree, hf_reload_length_uint16, tvb, offset, 2, results_length);
2749
2750
8
  {
2751
8
    int32_t results_offset = 0;
2752
8
    int nResults           = 0;
2753
108
    while (results_offset >= 0 && results_offset < results_length) {
2754
100
      proto_item *ti_findkinddata;
2755
100
      proto_tree *findkinddata_tree;
2756
100
      uint16_t    findkinddata_length;
2757
100
      kind_t     *kind;
2758
100
      findkinddata_length = 4/*kind id */ + 1 + tvb_get_uint8(tvb,offset + 2 + results_offset + 4)/* resourceId */;
2759
100
      if (results_offset + findkinddata_length > results_length) {
2760
0
        ti_findkinddata = proto_tree_add_item(local_tree, hf_reload_findkinddata, tvb, offset + results_offset, results_length - results_offset, ENC_NA);
2761
0
        expert_add_info_format(pinfo, ti_findkinddata, &ei_reload_truncated_field, "Truncated FindKindData");
2762
0
        break;
2763
0
      }
2764
2765
100
      ti_findkinddata = proto_tree_add_item(local_tree, hf_reload_findkinddata, tvb, offset + 2 + results_offset, findkinddata_length, ENC_NA);
2766
100
      findkinddata_tree = proto_item_add_subtree(ti_findkinddata, ett_reload_findkinddata);
2767
100
      dissect_kindid(hf_reload_kinddata_kind,tvb, findkinddata_tree, offset+2+results_offset,&kind);
2768
100
      dissect_resourceid(hf_reload_findkinddata_closest, tvb, pinfo, findkinddata_tree, offset+2+results_offset+4,  results_length - 4 - results_offset);
2769
100
      if (findkinddata_length <= 0) break;
2770
100
      results_offset += findkinddata_length;
2771
100
      nResults++;
2772
100
    }
2773
8
    proto_item_append_text(ti_local, ": %d elements", nResults);
2774
8
  }
2775
2776
8
  return length;
2777
8
}
2778
2779
static int dissect_selftuningdata(tvbuff_t *tvb, proto_tree *tree, uint16_t offset)
2780
0
{
2781
0
  proto_item *ti_local;
2782
0
  proto_tree *local_tree;
2783
2784
0
  ti_local = proto_tree_add_item(tree, hf_reload_self_tuning_data, tvb, offset, 12, ENC_NA);
2785
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_self_tuning_data);
2786
2787
0
  proto_tree_add_item(local_tree, hf_reload_self_tuning_data_network_size, tvb, offset, 4, ENC_BIG_ENDIAN);
2788
0
  proto_tree_add_item(local_tree, hf_reload_self_tuning_data_join_rate, tvb, offset+4, 4, ENC_BIG_ENDIAN);
2789
0
  proto_tree_add_item(local_tree, hf_reload_self_tuning_data_leave_rate, tvb, offset+8, 4, ENC_BIG_ENDIAN);
2790
2791
0
  return 12;
2792
0
}
2793
2794
static int dissect_extensiveroutingmodeoption(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2795
7
{
2796
7
  proto_item *ti_local;
2797
7
  proto_tree *local_tree;
2798
7
  uint16_t    local_offset = 0;
2799
2800
7
  ti_local = proto_tree_add_item(tree, hf_reload_extensiveroutingmodeoption, tvb, offset, length, ENC_NA);
2801
7
  local_tree = proto_item_add_subtree(ti_local, ett_reload_extensiveroutingmodeoption);
2802
2803
7
  proto_tree_add_item(local_tree, hf_reload_routemode, tvb, offset, 1, ENC_BIG_ENDIAN);
2804
7
  local_offset += 1;
2805
7
  proto_tree_add_item(local_tree, hf_reload_extensiveroutingmode_transport, tvb,
2806
7
                      offset+local_offset, 1, ENC_BIG_ENDIAN);
2807
7
  local_offset += 1;
2808
7
  local_offset += dissect_ipaddressport(hf_reload_extensiveroutingmode_ipaddressport, tvb, pinfo, local_tree, offset+local_offset);
2809
7
  {
2810
7
    proto_item *ti_destination;
2811
7
    proto_tree *destination_tree;
2812
7
    uint16_t    destination_length;
2813
7
    int         nDestinations = 0;
2814
7
    destination_length = tvb_get_uint8(tvb, offset+local_offset);
2815
7
    if (destination_length+1+local_offset>length) {
2816
0
      expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated ExtensiveRoutingModeOption");
2817
0
      destination_length = length -1-local_offset;
2818
0
    }
2819
7
    ti_destination = proto_tree_add_item(local_tree, hf_reload_extensiveroutingmode_destination, tvb,offset+local_offset, 1+destination_length, ENC_NA);
2820
7
    proto_item_append_text(ti_destination, " (Destination<%d>)", destination_length);
2821
7
    destination_tree = proto_item_add_subtree(ti_destination, ett_reload_extensiveroutingmode_destination);
2822
7
    proto_tree_add_item(destination_tree, hf_reload_length_uint8, tvb,offset+local_offset, 1, ENC_BIG_ENDIAN);
2823
7
    local_offset += 1;
2824
7
    dissect_destination_list(tvb, pinfo, destination_tree, offset+local_offset, destination_length, &nDestinations);
2825
7
    proto_item_append_text(ti_destination, ": %d elements", nDestinations);
2826
7
    local_offset += destination_length;
2827
7
  }
2828
7
  return local_offset;
2829
7
}
2830
2831
static int dissect_forwardingoption(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2832
78
{
2833
78
  proto_item *ti_option;
2834
78
  uint16_t    local_offset  = 0;
2835
78
  uint8_t     option_type   = tvb_get_uint8(tvb,offset);
2836
78
  uint8_t     option_flags  = tvb_get_uint8(tvb, offset+ 1);
2837
78
  uint16_t    option_length = tvb_get_ntohs(tvb, offset+ 2);
2838
78
  proto_tree *option_tree;
2839
2840
78
  ti_option = proto_tree_add_item(tree, hf_reload_forwarding_option, tvb, offset+local_offset, option_length + 4, ENC_NA);
2841
78
  proto_item_append_text(ti_option, " type=%s, flags=%02x, length=%d", val_to_str_const(option_type, forwardingoptiontypes, "Unknown"), option_flags, option_length);
2842
2843
78
  option_tree = proto_item_add_subtree(ti_option, ett_reload_forwarding_option);
2844
78
  proto_tree_add_item(option_tree, hf_reload_forwarding_option_type, tvb, offset+local_offset, 1, ENC_BIG_ENDIAN);
2845
78
  {
2846
78
    proto_item *ti_flags;
2847
78
    proto_tree *flags_tree;
2848
78
    uint32_t bit_offset;
2849
78
    ti_flags = proto_tree_add_uint(option_tree, hf_reload_forwarding_option_flags, tvb, offset+local_offset+1, 1, option_flags);
2850
78
    flags_tree = proto_item_add_subtree(ti_flags, ett_reload_forwarding_option_flags);
2851
78
    bit_offset = 8*(offset+local_offset+1);
2852
78
    proto_tree_add_bits_item(flags_tree, hf_reload_forwarding_option_flag_ignore_state_keeping, tvb, bit_offset+4, 1, ENC_BIG_ENDIAN);
2853
78
    proto_tree_add_bits_item(flags_tree, hf_reload_forwarding_option_flag_response_copy, tvb, bit_offset+5, 1, ENC_BIG_ENDIAN);
2854
78
    proto_tree_add_bits_item(flags_tree, hf_reload_forwarding_option_flag_destination_critical, tvb, bit_offset+6, 1, ENC_BIG_ENDIAN);
2855
78
    proto_tree_add_bits_item(flags_tree, hf_reload_forwarding_option_flag_forward_critical, tvb, bit_offset+7, 1, ENC_BIG_ENDIAN);
2856
78
  }
2857
78
  proto_tree_add_uint(option_tree, hf_reload_length_uint16, tvb, offset+local_offset+2, 2, option_length);
2858
78
  local_offset += 4;
2859
78
  if (local_offset + option_length > length) {
2860
5
    expert_add_info_format(pinfo, ti_option, &ei_reload_truncated_field, "Truncated ForwardingOption");
2861
5
    return length;
2862
5
  }
2863
2864
73
  switch (option_type) {
2865
7
  case OPTIONTYPE_EXTENSIVE_ROUTING_MODE:
2866
7
    dissect_extensiveroutingmodeoption(tvb, pinfo, option_tree, offset+local_offset, option_length);
2867
7
    break;
2868
2869
61
  default:
2870
61
    proto_tree_add_item(option_tree, hf_reload_opaque_data, tvb, offset+local_offset, option_length, ENC_NA);
2871
61
    break;
2872
73
  }
2873
58
  local_offset += option_length;
2874
2875
58
  return local_offset;
2876
73
}
2877
2878
0
static int dissect_dmflag(tvbuff_t *tvb, proto_tree *tree, uint16_t offset) {
2879
0
  proto_item *ti_local;
2880
0
  proto_tree *local_tree;
2881
0
  unsigned    i;
2882
0
  uint32_t    bit_offset = offset<<3;
2883
2884
0
  ti_local = proto_tree_add_item(tree, hf_reload_dmflags, tvb, offset, 8, ENC_BIG_ENDIAN);
2885
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_dmflags);
2886
2887
0
  for (i = 0; i < array_length(reload_dmflag_items); i++) {
2888
0
    if (reload_dmflag_items[i] != NULL) {
2889
0
      proto_tree_add_bits_item(local_tree, *(reload_dmflag_items[i]), tvb, bit_offset+63-i, 1, ENC_BIG_ENDIAN);
2890
0
    }
2891
0
  }
2892
0
  return 8;
2893
0
}
2894
2895
static int dissect_diagnosticextension(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2896
0
{
2897
0
  proto_item *ti_local;
2898
0
  proto_tree *local_tree;
2899
0
  uint16_t    local_offset = 0;
2900
0
  uint16_t    local_length = 0;
2901
2902
0
  local_length = 2 + 4 + tvb_get_ntohl(tvb, offset+2);
2903
0
  ti_local = proto_tree_add_item(tree, hf_reload_diagnosticextension, tvb, offset, local_length, ENC_NA);
2904
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_diagnosticextension);
2905
2906
0
  proto_tree_add_item(local_tree, hf_reload_diagnosticextension_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2907
0
  local_offset += 2;
2908
0
  local_offset += dissect_opaque(tvb, pinfo, local_tree, hf_reload_diagnosticextension_contents, offset + local_offset, 4, length-2);
2909
2910
0
  return local_offset;
2911
0
}
2912
2913
0
static int dissect_diagnosticrequest(int anchor, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length) {
2914
0
  proto_item *ti_local;
2915
0
  proto_tree *local_tree;
2916
0
  uint16_t    local_offset = 0;
2917
0
  uint32_t    local_length = 0;
2918
0
  int         hf           = hf_reload_diagnosticrequest;
2919
2920
0
  if (anchor >= 0) {
2921
0
    hf = anchor;
2922
0
  }
2923
2924
0
  ti_local = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
2925
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_diagnosticrequest);
2926
2927
0
  proto_tree_add_item(local_tree, hf_reload_diagnostic_expiration, tvb, offset, 8, ENC_TIME_MSECS|ENC_BIG_ENDIAN);
2928
0
  local_offset += 8;
2929
0
  proto_tree_add_item(local_tree, hf_reload_diagnosticrequest_timestampinitiated, tvb,
2930
0
                      offset+local_offset, 8, ENC_TIME_MSECS|ENC_BIG_ENDIAN);
2931
0
  local_offset += 8;
2932
0
  local_offset += dissect_dmflag(tvb, local_tree, offset+local_offset);
2933
0
  local_length = tvb_get_ntohl(tvb, offset+local_offset);
2934
0
  proto_tree_add_item(local_tree, hf_reload_length_uint32, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
2935
0
  local_offset += 4;
2936
2937
0
  if (local_offset+local_length > length) {
2938
0
    expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated DiagnosticRequest");
2939
0
    local_length = length-local_offset;
2940
0
  }
2941
0
  if (local_length>0) {
2942
0
    proto_item *ti_extensions;
2943
0
    proto_tree *extensions_tree;
2944
0
    uint32_t    extensions_offset = 0;
2945
0
    uint32_t    extensions_length = 0;
2946
0
    int         nExtensions       = 0;
2947
2948
0
    ti_extensions = proto_tree_add_item(local_tree, hf_reload_diagnosticrequest_extensions, tvb, offset+local_offset, local_length, ENC_NA);
2949
0
    extensions_tree = proto_item_add_subtree(ti_extensions, ett_reload_diagnosticrequest_extensions);
2950
0
    extensions_length = tvb_get_ntohl(tvb, offset+local_offset);
2951
0
    if (extensions_length+4 > local_length) {
2952
0
      expert_add_info_format(pinfo, ti_extensions, &ei_reload_truncated_field, "Truncated Diagnostic extensions");
2953
0
      extensions_length = local_length-4;
2954
0
    }
2955
0
    proto_item_append_text(ti_extensions, " (DiagnosticExtension<%d>)",extensions_length);
2956
0
    proto_tree_add_item(extensions_tree, hf_reload_length_uint32, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
2957
0
    while (extensions_offset<extensions_length) {
2958
0
      int local_increment = dissect_diagnosticextension(tvb, pinfo, extensions_tree, offset+4+local_offset+extensions_offset, extensions_length-extensions_offset);
2959
0
      if (local_increment <= 0) break;
2960
0
      extensions_offset += local_increment;
2961
0
      nExtensions++;
2962
0
    }
2963
0
    proto_item_append_text(ti_extensions, " : %d elements", nExtensions);
2964
0
  }
2965
0
  local_offset += local_length;
2966
0
  return local_offset;
2967
0
}
2968
2969
static int dissect_pathtrackreq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
2970
0
{
2971
0
  proto_item *ti_local;
2972
0
  proto_tree *local_tree;
2973
0
  uint16_t    local_offset = 0;
2974
2975
0
  ti_local = proto_tree_add_item(tree, hf_reload_pathtrackreq, tvb, offset, length, ENC_NA);
2976
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_pathtrackreq);
2977
0
  local_offset += dissect_destination(hf_reload_pathtrackreq_destination, tvb, pinfo, local_tree, offset+local_offset,length);
2978
0
  local_offset += dissect_diagnosticrequest(hf_reload_pathtrackreq_request, tvb, pinfo, local_tree, offset+local_offset, length-local_offset);
2979
2980
0
  return local_offset;
2981
0
}
2982
2983
static int dissect_diagnosticinfo(tvbuff_t *tvb, proto_tree *tree, uint16_t offset, uint16_t length)
2984
0
{
2985
0
  proto_item *ti_local;
2986
0
  proto_tree *local_tree;
2987
0
  uint16_t    local_offset = 0;
2988
0
  uint16_t    local_length = 0;
2989
0
  uint16_t    kindid;
2990
2991
0
  local_length = 2 + tvb_get_ntohs(tvb, offset+2);
2992
0
  ti_local = proto_tree_add_item(tree, hf_reload_diagnosticinfo, tvb, offset, local_length+4, ENC_NA);
2993
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_diagnosticinfo);
2994
2995
0
  proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_kind, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
2996
0
  local_offset += 2;
2997
0
  proto_tree_add_item(local_tree, hf_reload_length_uint16, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
2998
0
  local_offset += 2;
2999
3000
0
  kindid = tvb_get_ntohs(tvb, offset);
3001
0
  switch(kindid) {
3002
0
  case DIAGNOSTICKINDID_STATUS_INFO:
3003
0
    proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_congestion_status, tvb, offset+local_offset, 1, ENC_BIG_ENDIAN);
3004
0
    break;
3005
3006
0
  case DIAGNOSTICKINDID_ROUTING_TABLE_SIZE:
3007
0
    proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_number_peers, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
3008
0
    break;
3009
3010
0
  case DIAGNOSTICKINDID_PROCESS_POWER:
3011
0
    proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_processing_power, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
3012
0
    break;
3013
3014
0
  case DIAGNOSTICKINDID_BANDWIDTH:
3015
0
    proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_bandwidth, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
3016
0
    break;
3017
3018
0
  case DIAGNOSTICKINDID_SOFTWARE_VERSION:
3019
0
    proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_software_version, tvb, offset+local_offset, length, ENC_ASCII);
3020
0
    break;
3021
3022
0
  case DIAGNOSTICKINDID_MACHINE_UPTIME:
3023
0
    proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_machine_uptime, tvb, offset+local_offset, 8, ENC_BIG_ENDIAN);
3024
0
    break;
3025
3026
0
  case DIAGNOSTICKINDID_APP_UPTIME:
3027
0
    proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_app_uptime, tvb, offset+local_offset, 8, ENC_BIG_ENDIAN);
3028
0
    break;
3029
3030
0
  case DIAGNOSTICKINDID_MEMORY_FOOTPRINT:
3031
0
    proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_memory_footprint, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
3032
0
    break;
3033
3034
0
  case DIAGNOSTICKINDID_DATASIZE_STORED:
3035
0
    proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_datasize_stored, tvb, offset+local_offset, 8, ENC_BIG_ENDIAN);
3036
0
    break;
3037
3038
0
  case DIAGNOSTICKINDID_INSTANCES_STORED:
3039
0
  {
3040
0
    proto_item *ti_instances;
3041
0
    proto_tree *instances_tree;
3042
0
    int32_t     instances_offset = 0;
3043
0
    int         nElements        = 0;
3044
3045
0
    ti_instances = proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_instances_stored,\
3046
0
                                       tvb, offset+local_offset, length, ENC_NA);
3047
0
    instances_tree = proto_item_add_subtree(ti_instances, ett_reload_diagnosticinfo_instances_stored);
3048
0
    proto_item_append_text(ti_instances, "[%d]", length);
3049
0
    while (instances_offset >= 0 && instances_offset < length) {
3050
0
      proto_item *ti_instances_per_kindid;
3051
0
      proto_tree *instances_per_kindid_tree;
3052
0
      kind_t     *kind;
3053
0
      uint64_t    instances;
3054
0
      ti_instances_per_kindid = proto_tree_add_item(instances_tree, hf_reload_diagnosticinfo_instancesstored_info,
3055
0
                                                    tvb, offset+local_offset+instances_offset, 12, ENC_NA);
3056
0
      instances_per_kindid_tree = proto_item_add_subtree(ti_instances_per_kindid,
3057
0
                                                         ett_reload_diagnosticinfo_instancesstored_info);
3058
0
      dissect_kindid(hf_reload_kinddata_kind, tvb, instances_per_kindid_tree, offset+local_offset+instances_offset, &kind);
3059
0
      proto_tree_add_item(instances_per_kindid_tree, hf_reload_diagnosticinfo_instancesstored_instances,
3060
0
                          tvb, offset+local_offset+instances_offset+4, 8, ENC_BIG_ENDIAN);
3061
0
      instances = tvb_get_ntoh64(tvb, offset+local_offset+instances_offset+4);
3062
0
      proto_item_append_text(ti_instances_per_kindid, ": %s/%" PRId64,
3063
0
          ((kind != NULL) && (kind->name != NULL)) ? kind->name : "UNKNOWN KIND", instances);
3064
0
      instances_offset += 12;
3065
0
      nElements++;
3066
0
    }
3067
0
    if (nElements>0) {
3068
0
      proto_item_append_text(ti_instances, ": %d", nElements);
3069
0
    }
3070
0
  }
3071
0
  break;
3072
3073
3074
0
  case DIAGNOSTICKINDID_MESSAGES_SENT_RCVD:
3075
0
  {
3076
0
    proto_item *ti_messages;
3077
0
    proto_tree *messages_tree;
3078
0
    int32_t     messages_offset = 0;
3079
0
    int         nElements       = 0;
3080
3081
0
    ti_messages = proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_messages_sent_rcvd,
3082
0
                                      tvb, offset+local_offset, length, ENC_NA);
3083
0
    messages_tree = proto_item_add_subtree(ti_messages, ett_reload_diagnosticinfo_messages_sent_rcvd);
3084
0
    proto_item_append_text(ti_messages, "[%d]", length);
3085
3086
0
    while (messages_offset >= 0 && messages_offset < length) {
3087
0
      proto_item *ti_sent_rcvd;
3088
0
      proto_tree *sent_rcvd_tree;
3089
0
      uint16_t    message_code;
3090
3091
0
      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);
3092
3093
0
      sent_rcvd_tree = proto_item_add_subtree(ti_sent_rcvd, ett_reload_diagnosticinfo_messages_sent_rcvd_info);
3094
0
      message_code = tvb_get_ntohs(tvb, offset+local_offset+messages_offset);
3095
0
      if (message_code == RELOAD_ERROR) {
3096
0
        proto_tree_add_uint_format_value(sent_rcvd_tree, hf_reload_diagnosticinfo_message_code, tvb,
3097
0
                                         offset+local_offset+messages_offset, 2,
3098
0
                                         message_code,
3099
0
                                         "error");
3100
3101
0
      }
3102
0
      else {
3103
0
        proto_tree_add_uint_format_value(sent_rcvd_tree, hf_reload_diagnosticinfo_message_code, tvb,
3104
0
                                         offset+local_offset+messages_offset, 2,
3105
0
                                         message_code,
3106
0
                                         "%s_%s",
3107
0
                                         val_to_str_const(MSGCODE_TO_METHOD(message_code), methods_short, "Unknown"),
3108
0
                                         val_to_str_const(MSGCODE_TO_CLASS(message_code), classes_short, "Unknown"));
3109
0
      }
3110
0
      proto_tree_add_item(sent_rcvd_tree, hf_reload_diagnosticinfo_messages_sent,
3111
0
                          tvb, offset+local_offset+messages_offset+2, 8, ENC_BIG_ENDIAN);
3112
0
      proto_tree_add_item(sent_rcvd_tree, hf_reload_diagnosticinfo_messages_rcvd,
3113
0
                          tvb, offset+local_offset+messages_offset+2+8, 8, ENC_BIG_ENDIAN);
3114
0
      messages_offset += 18;
3115
0
      nElements++;
3116
0
    }
3117
0
    if (nElements>0) {
3118
0
      proto_item_append_text(ti_messages, ": %d", nElements);
3119
0
    }
3120
0
  }
3121
0
  break;
3122
3123
0
  case DIAGNOSTICKINDID_EWMA_BYTES_SENT:
3124
0
    proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_ewma_bytes_sent, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
3125
0
    break;
3126
3127
0
  case DIAGNOSTICKINDID_EWMA_BYTES_RCVD:
3128
0
    proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_ewma_bytes_rcvd, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
3129
0
    break;
3130
3131
0
  case DIAGNOSTICKINDID_UNDERLAY_HOP:
3132
0
    proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_underlay_hops, tvb, offset+local_offset, 1, ENC_BIG_ENDIAN);
3133
0
    break;
3134
3135
0
  case DIAGNOSTICKINDID_BATTERY_STATUS:
3136
0
    proto_tree_add_item(local_tree, hf_reload_diagnosticinfo_battery_status, tvb, offset+local_offset, 1, ENC_BIG_ENDIAN);
3137
0
    break;
3138
3139
0
  default:
3140
0
    proto_tree_add_item(local_tree, hf_reload_opaque_data, tvb, offset+local_offset, length, ENC_NA);
3141
0
    break;
3142
3143
0
  }
3144
3145
0
  return local_length;
3146
0
}
3147
3148
3149
0
static int dissect_diagnosticresponse(int anchor, tvbuff_t *tvb, packet_info *pinfo,proto_tree *tree, uint16_t offset, uint16_t length) {
3150
0
  proto_item *ti_local;
3151
0
  proto_tree *local_tree;
3152
0
  uint16_t    local_offset = 0;
3153
0
  int         hf           = hf_reload_diagnosticresponse;
3154
3155
0
  if (anchor >= 0) {
3156
0
    hf = anchor;
3157
0
  }
3158
3159
0
  ti_local = proto_tree_add_item(tree, hf, tvb, offset, length, ENC_NA);
3160
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_diagnosticresponse);
3161
3162
0
  proto_tree_add_item(local_tree, hf_reload_diagnostic_expiration, tvb, offset, 8, ENC_TIME_MSECS|ENC_BIG_ENDIAN);
3163
0
  local_offset += 8;
3164
0
  proto_tree_add_item(local_tree, hf_reload_diagnosticresponse_timestampreceived,
3165
0
                      tvb, offset+local_offset, 8, ENC_TIME_MSECS|ENC_BIG_ENDIAN);
3166
0
  local_offset += 8;
3167
0
  proto_tree_add_item(local_tree, hf_reload_diagnosticresponse_hopcounter, tvb, offset+local_offset, 1, ENC_BIG_ENDIAN);
3168
3169
3170
0
  {
3171
0
    proto_item *ti_diagnostics;
3172
0
    proto_tree *diagnostics_tree;
3173
0
    int32_t     diagnostics_offset = 0;
3174
0
    uint32_t    diagnostics_length = 0;
3175
0
    int         nDiagnostics       = 0;
3176
3177
0
    diagnostics_length = tvb_get_ntohl(tvb, offset+local_offset);
3178
0
    if (diagnostics_length+local_offset+4>length) {
3179
0
      expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated Diagnostic Response");
3180
0
      diagnostics_length = length -4 -local_offset;
3181
0
    }
3182
0
    ti_diagnostics = proto_tree_add_item(local_tree, hf_reload_diagnosticresponse_diagnostic_info_list, tvb, offset+local_offset, diagnostics_length, ENC_NA);
3183
0
    diagnostics_tree = proto_item_add_subtree(ti_local, ett_reload_diagnosticresponse_diagnostic_info_list);
3184
0
    proto_item_append_text(ti_diagnostics, " (DiagnosticInfo<%d>)",diagnostics_length);
3185
0
    proto_tree_add_item(diagnostics_tree, hf_reload_length_uint32, tvb, offset+local_offset, 4, ENC_BIG_ENDIAN);
3186
0
    local_offset += 4;
3187
0
    while (diagnostics_offset >= 0 && (uint32_t)diagnostics_offset<diagnostics_length) {
3188
0
      int local_increment = dissect_diagnosticinfo(tvb, diagnostics_tree, offset+local_offset+diagnostics_offset, diagnostics_length-diagnostics_offset);
3189
0
      if (local_increment <= 0) break;
3190
0
      diagnostics_offset += local_increment;
3191
0
      nDiagnostics++;
3192
0
    }
3193
0
    proto_item_append_text(ti_diagnostics, " : %d elements", nDiagnostics);
3194
0
    local_offset += diagnostics_length;
3195
0
  }
3196
3197
0
  return local_offset;
3198
0
}
3199
3200
static int dissect_pathtrackans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
3201
0
{
3202
0
  proto_item *ti_local;
3203
0
  proto_tree *local_tree;
3204
0
  uint16_t    local_offset = 0;
3205
3206
0
  ti_local = proto_tree_add_item(tree, hf_reload_pathtrackans, tvb, offset, length, ENC_NA);
3207
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_pathtrackans);
3208
0
  local_offset += dissect_destination(hf_reload_pathtrackans_next_hop, tvb, pinfo, local_tree, offset+local_offset,length);
3209
0
  local_offset += dissect_diagnosticresponse(hf_reload_pathtrackans_response, tvb, pinfo, local_tree, offset+local_offset, length-local_offset);
3210
3211
0
  return local_offset;
3212
0
}
3213
3214
static int dissect_joinreq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
3215
0
{
3216
0
  proto_item *ti_local;
3217
0
  proto_tree *local_tree;
3218
0
  uint16_t    local_offset = 0;
3219
3220
0
  ti_local = proto_tree_add_item(tree, hf_reload_joinreq, tvb, offset, length, ENC_NA);
3221
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_joinreq);
3222
3223
0
  local_offset += dissect_nodeid(hf_reload_joinreq_joining_peer_id, tvb, pinfo, local_tree, offset, length);
3224
0
  local_offset += dissect_opaque(tvb, pinfo, local_tree, hf_reload_overlay_specific, offset + local_offset, 2,
3225
0
                                 length - local_offset);
3226
0
  return local_offset;
3227
0
}
3228
3229
static int dissect_joinans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
3230
0
{
3231
0
  proto_item *ti_local;
3232
0
  proto_tree *local_tree;
3233
0
  uint16_t    local_offset = 0;
3234
3235
0
  ti_local = proto_tree_add_item(tree, hf_reload_joinans, tvb, offset, length, ENC_NA);
3236
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_joinans);
3237
3238
0
  local_offset = dissect_opaque(tvb, pinfo, local_tree, hf_reload_overlay_specific,
3239
0
                                offset + local_offset, 2, length );
3240
0
  return local_offset;
3241
0
}
3242
3243
static int dissect_leavereq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
3244
0
{
3245
0
  proto_item *ti_local;
3246
0
  proto_tree *local_tree;
3247
0
  uint16_t    local_offset = 0;
3248
3249
0
  ti_local = proto_tree_add_item(tree, hf_reload_leavereq, tvb, offset, length, ENC_NA);
3250
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_leavereq);
3251
3252
0
  local_offset += dissect_nodeid(hf_reload_leavereq_leaving_peer_id, tvb, pinfo, local_tree, offset, length);
3253
0
  if (0 == strcmp(TOPOLOGY_PLUGIN_CHORD_RELOAD, reload_topology_plugin)) {
3254
0
    proto_item *ti_overlay_specific;
3255
0
    proto_tree *overlay_specific_tree;
3256
0
    uint16_t    overlay_length;
3257
3258
0
    ti_overlay_specific   = proto_tree_add_item(local_tree, hf_reload_overlay_specific,
3259
0
                                              tvb,  offset+local_offset,  length - local_offset, ENC_NA);
3260
0
    overlay_specific_tree = proto_item_add_subtree(ti_overlay_specific, ett_reload_overlay_specific);
3261
0
    proto_tree_add_item(overlay_specific_tree, hf_reload_length_uint16, tvb,  offset+local_offset,  2, ENC_BIG_ENDIAN);
3262
3263
0
    overlay_length = tvb_get_ntohs(tvb, offset+local_offset);
3264
0
    local_offset+= 2;
3265
0
    dissect_chordleavedata(tvb, pinfo, overlay_specific_tree, offset+local_offset, overlay_length);
3266
0
    local_offset += overlay_length;
3267
0
  }
3268
0
  else {
3269
0
    local_offset += dissect_opaque(tvb, pinfo, local_tree, hf_reload_overlay_specific,
3270
0
                                   offset + reload_nodeid_length, 2, length - local_offset);
3271
0
  }
3272
3273
0
  return local_offset;
3274
0
}
3275
3276
static int dissect_probereq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
3277
0
{
3278
0
  proto_item *ti_local,   *ti_requested_info;
3279
0
  proto_tree *local_tree, *requested_info_tree;
3280
0
  uint8_t     info_list_length = 0;
3281
3282
0
  ti_local            = proto_tree_add_item(tree, hf_reload_probereq, tvb, offset, length, ENC_NA);
3283
0
  local_tree          = proto_item_add_subtree(ti_local, ett_reload_probereq);
3284
0
  ti_requested_info   = proto_tree_add_item(local_tree, hf_reload_probereq_requested_info, tvb, offset, length, ENC_NA);
3285
0
  requested_info_tree = proto_item_add_subtree(ti_requested_info, ett_reload_probereq_requested_info);
3286
0
  info_list_length    = tvb_get_uint8(tvb, offset);
3287
3288
0
  proto_item_append_text(ti_requested_info, " (ProbeInformationType<%d>)", info_list_length);
3289
0
  proto_tree_add_uint(requested_info_tree, hf_reload_length_uint8, tvb, offset, 1, info_list_length);
3290
3291
0
  if ((info_list_length+1) > length) {
3292
0
    expert_add_info_format(pinfo, ti_requested_info, &ei_reload_truncated_field, "Truncated requested_info");
3293
0
    info_list_length = length - 1;
3294
0
  }
3295
0
  {
3296
0
    int probe_offset = 0;
3297
0
    int nInfos       = 0;
3298
0
    while (probe_offset >= 0 && probe_offset < info_list_length) {
3299
0
      proto_tree_add_item(requested_info_tree, hf_reload_probe_information_type,
3300
0
                          tvb, offset + 1 + probe_offset, 1, ENC_BIG_ENDIAN);
3301
0
      probe_offset += 1;
3302
0
      nInfos++;
3303
0
    }
3304
0
    proto_item_append_text(ti_requested_info, ": %d elements", nInfos);
3305
0
  }
3306
3307
0
  return info_list_length;
3308
0
}
3309
3310
static int dissect_probeans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
3311
0
{
3312
0
  proto_item *ti_local,   *ti_infos;
3313
0
  proto_tree *local_tree, *infos_tree;
3314
0
  uint16_t    info_list_length = 0;
3315
3316
0
  ti_local   = proto_tree_add_item(tree, hf_reload_probeans, tvb, offset, length, ENC_NA);
3317
0
  local_tree = proto_item_add_subtree(ti_local, ett_reload_probeans);
3318
3319
0
  info_list_length = tvb_get_ntohs(tvb, offset);
3320
0
  if (info_list_length+2 >length) {
3321
0
    expert_add_info_format(pinfo, ti_local, &ei_reload_truncated_field, "Truncated ProbeAns");
3322
0
    info_list_length = length - 2;
3323
0
  }
3324
0
  ti_infos = proto_tree_add_item(local_tree, hf_reload_probeans_probe_info, tvb, offset, info_list_length, ENC_NA);
3325
0
  proto_item_append_text(ti_infos, " (ProbeInformation<%d>)", info_list_length);
3326
0
  infos_tree = proto_item_add_subtree(ti_infos, ett_reload_probeans_probe_info);
3327
0
  {
3328
0
    int probe_offset = 0;
3329
0
    int probe_increment;
3330
0
    int nInfos       = 0;
3331
0
    while (probe_offset >= 0 && probe_offset < info_list_length) {
3332
0
      probe_increment = dissect_probe_information(tvb, pinfo, infos_tree, offset + 2 + probe_offset, info_list_length - probe_offset);
3333
0
      if (probe_increment <= 0) {
3334
0
        break;
3335
0
      }
3336
0
      probe_offset += probe_increment;
3337
0
      nInfos++;
3338
0
    }
3339
0
    proto_item_append_text(ti_infos, ": %d elements", nInfos);
3340
0
  }
3341
0
  return length;
3342
0
}
3343
3344
extern int dissect_reload_messagecontents(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint16_t offset, uint16_t length)
3345
67
{
3346
67
  uint32_t    message_body_length;
3347
67
  uint32_t    extensions_length;
3348
67
  proto_item *ti_message_contents;
3349
67
  proto_tree *message_contents_tree;
3350
67
  uint16_t    message_code;
3351
3352
67
  message_body_length = tvb_get_ntohl(tvb, offset + 2);
3353
67
  extensions_length   = tvb_get_ntohl(tvb, offset + 2 + 4 + message_body_length);
3354
3355
67
  if (2 + 4 + message_body_length + 4 + extensions_length > length) {
3356
2
    ti_message_contents = proto_tree_add_item(tree, hf_reload_message_contents, tvb, offset, length, ENC_NA);
3357
2
    expert_add_info_format(pinfo, ti_message_contents, &ei_reload_truncated_field, "Truncated MessageContents");
3358
2
    return length;
3359
2
  }
3360
3361
65
  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
65
  message_contents_tree = proto_item_add_subtree(ti_message_contents, ett_reload_message_contents);
3363
3364
65
  message_code = tvb_get_ntohs(tvb, offset);
3365
3366
65
  if (message_code != RELOAD_ERROR) {
3367
59
    proto_item *ti_message_body;
3368
59
    proto_tree *message_body_tree;
3369
59
    const char *message_type_str = NULL;
3370
3371
    /* message_code was already parsed */
3372
59
    {
3373
59
      proto_item *ti_message_code;
3374
59
      ti_message_code = proto_tree_add_item(message_contents_tree, hf_reload_message_code, tvb,
3375
59
                                            offset, 2, ENC_BIG_ENDIAN);
3376
59
      proto_item_append_text(ti_message_code, " (%s_%s)",
3377
59
                             val_to_str(MSGCODE_TO_METHOD(message_code), methods_short, "Unknown %d"),
3378
59
                             val_to_str(MSGCODE_TO_CLASS(message_code), classes_short, "Unknown %d"));
3379
59
    }
3380
59
    offset += 2;
3381
    /* Message body */
3382
59
    ti_message_body = proto_tree_add_item(message_contents_tree, hf_reload_message_body, tvb, offset, 4 + message_body_length, ENC_NA);
3383
59
    message_body_tree = proto_item_add_subtree(ti_message_body, ett_reload_message_body);
3384
59
    proto_tree_add_uint(message_body_tree, hf_reload_length_uint32, tvb, offset, 4, message_body_length);
3385
59
    offset += 4;
3386
3387
59
    if (message_body_length > 0) {
3388
58
      switch(MSGCODE_TO_METHOD(message_code)) {
3389
0
      case METHOD_ROUTEQUERY:
3390
0
      {
3391
0
        if (IS_REQUEST(message_code)) {
3392
0
          {
3393
0
            proto_item * ti_routequeryreq;
3394
0
            proto_tree * routequeryreq_tree;
3395
0
            int destination_length;
3396
0
            message_type_str = "RouteQueryReq";
3397
0
            ti_routequeryreq = proto_tree_add_item(message_body_tree, hf_reload_routequeryreq,
3398
0
                                                   tvb, offset, message_body_length, ENC_NA);
3399
0
            routequeryreq_tree = proto_item_add_subtree(ti_routequeryreq, ett_reload_routequeryreq);
3400
0
            proto_tree_add_item(routequeryreq_tree, hf_reload_sendupdate, tvb, offset, 1, ENC_BIG_ENDIAN);
3401
0
            destination_length = dissect_destination(hf_reload_routequeryreq_destination,
3402
0
                                                     tvb, pinfo, routequeryreq_tree, offset + 1, message_body_length - 1 - 2);
3403
0
            dissect_opaque(tvb, pinfo, routequeryreq_tree, hf_reload_overlay_specific, offset + 1 + destination_length, 2, (message_body_length - 1 - destination_length));
3404
0
          }
3405
0
        }
3406
0
        else {
3407
0
          message_type_str = "ChordRouteQueryAns";
3408
          /* Answer is entirely Overlay-specific */
3409
0
          if (0 == strcmp(TOPOLOGY_PLUGIN_CHORD_RELOAD, reload_topology_plugin)) {
3410
0
            dissect_chordroutequeryans(tvb, pinfo, message_body_tree, offset, message_body_length);
3411
0
          }
3412
0
        }
3413
0
      }
3414
0
      break;
3415
3416
0
      case METHOD_PROBE:
3417
0
      {
3418
0
        if (IS_REQUEST(message_code)) {
3419
0
          message_type_str = "ProbeReq";
3420
0
          dissect_probereq(tvb, pinfo, message_body_tree, offset, message_body_length);
3421
0
        }
3422
0
        else {
3423
0
          message_type_str = "ProbeAns";
3424
0
          dissect_probeans(tvb, pinfo, message_body_tree, offset, message_body_length);
3425
0
        }
3426
0
      }
3427
0
      break;
3428
3429
0
      case METHOD_ATTACH:
3430
0
      {
3431
0
        message_type_str = "AttachReqAns";
3432
0
        dissect_attachreqans(tvb, pinfo, message_body_tree, offset, message_body_length);
3433
0
      }
3434
0
      break;
3435
3436
5
      case METHOD_APPATTACH:
3437
5
      {
3438
        /* Parse AppAttachReq/Ans */
3439
5
        {
3440
5
          uint16_t local_offset = 0;
3441
5
          proto_item *ti_appattach;
3442
5
          proto_tree *appattach_tree;
3443
5
          int hf =  hf_reload_appattachans;
3444
5
          message_type_str = "AttachAppAns";
3445
5
          if (IS_REQUEST(message_code)) {
3446
0
            hf =  hf_reload_appattachreq;
3447
0
            message_type_str = "AttachAppReq";
3448
0
          }
3449
5
          ti_appattach = proto_tree_add_item(message_body_tree, hf, tvb, offset+local_offset, message_body_length, ENC_NA);
3450
5
          appattach_tree  = proto_item_add_subtree(ti_appattach, ett_reload_appattach);
3451
5
          local_offset += dissect_opaque_string(tvb, pinfo,appattach_tree, hf_reload_ufrag,offset+local_offset, 1, message_body_length-local_offset);
3452
5
          local_offset += dissect_opaque_string(tvb, pinfo,appattach_tree, hf_reload_password,offset+local_offset, 1, message_body_length-local_offset);
3453
5
          proto_tree_add_item(appattach_tree, hf_reload_application, tvb, offset+local_offset, 2, ENC_BIG_ENDIAN);
3454
5
          local_offset += 2;
3455
5
          local_offset += dissect_opaque_string(tvb, pinfo,appattach_tree, hf_reload_role,offset+local_offset, 1, message_body_length-local_offset);
3456
5
          dissect_icecandidates(tvb, pinfo, appattach_tree, offset+local_offset, message_body_length-local_offset);
3457
5
        }
3458
5
      }
3459
5
      break;
3460
3461
0
      case METHOD_PING:
3462
0
      {
3463
0
        if (IS_REQUEST(message_code)) {
3464
0
          proto_item *ti_local;
3465
0
          proto_tree *local_tree;
3466
0
          message_type_str = "PingReq";
3467
0
          ti_local = proto_tree_add_item(message_body_tree, hf_reload_pingreq, tvb, offset, message_body_length, ENC_NA);
3468
0
          local_tree = proto_item_add_subtree(ti_local, ett_reload_pingreq);
3469
3470
0
          dissect_opaque(tvb, pinfo, local_tree, hf_reload_padding, offset, 2, message_body_length);
3471
0
        }
3472
0
        else {
3473
0
          message_type_str = "PingAns";
3474
0
          if (message_body_length < 16) {
3475
0
            expert_add_info_format(pinfo, ti_message_contents, &ei_reload_truncated_field, "Truncated ping answer");
3476
0
          }
3477
0
          else {
3478
0
            proto_item *ti_local;
3479
0
            proto_tree *local_tree;
3480
3481
0
            ti_local = proto_tree_add_item(message_body_tree, hf_reload_pingans, tvb, offset, message_body_length, ENC_NA);
3482
0
            local_tree = proto_item_add_subtree(ti_local, ett_reload_pingans);
3483
0
            proto_tree_add_item(local_tree, hf_reload_ping_response_id, tvb, offset, 8, ENC_BIG_ENDIAN);
3484
0
            {
3485
0
              uint64_t timev;
3486
0
              uint32_t remaining_ms;
3487
0
              time_t time_sec;
3488
0
              nstime_t l_nsTime;
3489
3490
0
              timev = tvb_get_ntoh64(tvb, offset+8);
3491
0
              time_sec = (time_t)timev/1000;
3492
0
              remaining_ms = (uint32_t)(timev % 1000);
3493
3494
0
              l_nsTime.secs = time_sec;
3495
0
              l_nsTime.nsecs =  remaining_ms*1000*1000;
3496
3497
0
              proto_tree_add_time(local_tree, hf_reload_ping_time, tvb, offset + 8, 8, &l_nsTime);
3498
0
            }
3499
0
          }
3500
0
        }
3501
0
      }
3502
0
      break;
3503
3504
0
      case METHOD_CONFIGUPDATE:
3505
0
      {
3506
0
        if (IS_REQUEST(message_code)) {
3507
0
          uint16_t local_offset = 0;
3508
0
          proto_item *ti_configupdate;
3509
0
          proto_tree *configupdate_tree;
3510
0
          uint8_t configupdate_type;
3511
0
          uint32_t configupdate_length;
3512
3513
0
          message_type_str = "ConfigUpdateReq";
3514
0
          ti_configupdate = proto_tree_add_item(message_body_tree, hf_reload_configupdatereq, tvb, offset+local_offset, message_body_length, ENC_NA);
3515
0
          configupdate_tree  = proto_item_add_subtree(ti_configupdate, ett_reload_configupdatereq);
3516
0
          configupdate_type = tvb_get_uint8(tvb, offset + local_offset);
3517
0
          proto_tree_add_uint(configupdate_tree, hf_reload_configupdatereq_type, tvb, offset+local_offset, 1, configupdate_type);
3518
0
          local_offset += 1;
3519
0
          configupdate_length = tvb_get_ntohl(tvb, offset + local_offset);
3520
0
          proto_tree_add_uint(configupdate_tree, hf_reload_length_uint32, tvb,  offset + local_offset, 4, configupdate_length);
3521
0
          if (5 + configupdate_length > message_body_length) {
3522
0
            expert_add_info_format(pinfo, ti_configupdate, &ei_reload_truncated_field, "Truncated ConfigUpdateReq");
3523
0
            break;
3524
0
          }
3525
0
          local_offset += 4;
3526
0
          switch(configupdate_type) {
3527
0
          case CONFIGUPDATETYPE_CONFIG:
3528
0
          {
3529
3530
0
            if (xml_handle == NULL) {
3531
0
              expert_add_info(pinfo, ti_configupdate, &ei_reload_no_xml_dissector);
3532
0
              dissect_opaque_string(tvb, pinfo, configupdate_tree, hf_reload_configupdatereq_configdata, offset+local_offset, 3, configupdate_length);
3533
0
            }
3534
0
            else {
3535
0
              proto_item *ti_config_data;
3536
0
              proto_tree *config_data_tree;
3537
0
              uint32_t config_length;
3538
0
              config_length = tvb_get_ntoh24(tvb,offset+local_offset);
3539
0
              ti_config_data = proto_tree_add_item(configupdate_tree, hf_reload_configupdatereq_configdata, tvb, offset+local_offset, configupdate_length, ENC_NA);
3540
0
              config_data_tree = proto_item_add_subtree(ti_config_data, ett_reload_configupdatereq_config_data);
3541
0
              proto_tree_add_item(config_data_tree, hf_reload_length_uint24, tvb, offset+local_offset, 3, ENC_BIG_ENDIAN);
3542
0
              call_dissector_only(xml_handle,
3543
0
                                  tvb_new_subset_length_caplen(tvb, offset+local_offset+3, config_length, length-offset-local_offset-3),
3544
0
                                  pinfo, config_data_tree, NULL);
3545
0
            }
3546
0
          }
3547
3548
0
          break;
3549
3550
0
          case CONFIGUPDATETYPE_KIND:
3551
0
          {
3552
0
            proto_item *ti_kinds;
3553
0
            proto_tree *kinds_tree;
3554
0
            uint32_t    kinds_length;
3555
0
            uint32_t    kinds_offset = 0;
3556
0
            int         nKinds       = 0;
3557
3558
0
            ti_kinds     = proto_tree_add_item(configupdate_tree, hf_reload_configupdatereq_kinds,
3559
0
                                               tvb, offset+local_offset, configupdate_length, ENC_NA);
3560
0
            kinds_tree   = proto_item_add_subtree(ti_kinds, ett_reload_configupdatereq_kinds);
3561
0
            kinds_length = tvb_get_ntoh24(tvb, offset+local_offset);
3562
0
            proto_item_append_text(ti_kinds, " (KindDescription<%d>)", kinds_length);
3563
0
            local_offset += dissect_length(tvb, kinds_tree, offset+local_offset,  3);
3564
0
            while (kinds_offset < kinds_length) {
3565
0
              uint16_t local_increment = tvb_get_ntohs(tvb,offset+local_offset+kinds_offset);
3566
0
              if (xml_handle == NULL) {
3567
0
                expert_add_info(pinfo, ti_configupdate, &ei_reload_no_xml_dissector);
3568
0
                dissect_opaque_string(tvb, pinfo, configupdate_tree, hf_reload_kinddescription,
3569
0
                                      offset+local_offset+kinds_offset, 2, configupdate_length);
3570
0
              }
3571
0
              else {
3572
0
                proto_item *ti_kinddescription;
3573
0
                proto_tree *kinddescription_tree;
3574
0
                ti_kinddescription = proto_tree_add_item(kinds_tree, hf_reload_kinddescription,
3575
0
                                                         tvb, offset+local_offset+kinds_offset, 2+local_increment, ENC_NA);
3576
0
                kinddescription_tree = proto_item_add_subtree(ti_kinddescription, ett_reload_kinddescription);
3577
0
                proto_tree_add_item(kinddescription_tree, hf_reload_length_uint16,
3578
0
                                    tvb, offset+local_offset+kinds_offset, 2, ENC_BIG_ENDIAN);
3579
0
                call_dissector(xml_handle,
3580
0
                               tvb_new_subset_length_caplen(tvb, offset+local_offset+kinds_offset+2,
3581
0
                                              local_increment,
3582
0
                                              length-(offset+local_offset+kinds_offset+2)),
3583
0
                               pinfo, kinddescription_tree);
3584
0
              }
3585
0
              local_increment += 2;
3586
0
              if (local_increment <= 0) break;
3587
0
              kinds_offset    += local_increment;
3588
0
              nKinds++;
3589
0
            }
3590
0
            proto_item_append_text(ti_kinds, ": %d elements", nKinds);
3591
0
          }
3592
0
          break;
3593
0
          }
3594
3595
0
        }
3596
0
        else {
3597
0
          message_type_str = "ConfigUpdateAns";
3598
0
        }
3599
0
        break;
3600
0
      }
3601
3602
35
      case METHOD_STORE:
3603
35
      {
3604
35
        if (IS_REQUEST(message_code)) {
3605
0
          message_type_str = "StoreReq";
3606
0
          dissect_storereq(tvb, pinfo, message_body_tree, offset, message_body_length);
3607
0
        }
3608
35
        else {
3609
35
          message_type_str = "StoreAns";
3610
35
          dissect_storeans(tvb, pinfo, message_body_tree, offset, message_body_length);
3611
35
        }
3612
35
      }
3613
35
      break;
3614
3615
0
      case METHOD_FETCH:
3616
0
      {
3617
0
        if (IS_REQUEST(message_code)) {
3618
0
          message_type_str = "FetchReq";
3619
0
          dissect_fetchreq(tvb, pinfo, message_body_tree, offset, message_body_length, false);
3620
0
        }
3621
0
        else {
3622
          /* response */
3623
0
          message_type_str = "FetchAns";
3624
0
          dissect_fetchans(tvb, pinfo, message_body_tree, offset, message_body_length);
3625
0
        }
3626
0
      }
3627
0
      break;
3628
3629
0
      case METHOD_STAT:
3630
0
      {
3631
0
        if (IS_REQUEST(message_code)) {
3632
0
          message_type_str = "StatReq";
3633
0
          dissect_fetchreq(tvb, pinfo, message_body_tree, offset, message_body_length, true);
3634
0
        }
3635
0
        else {
3636
0
          message_type_str = "StatAns";
3637
0
          dissect_statans(tvb, pinfo, message_body_tree, offset, message_body_length);
3638
0
        }
3639
0
      }
3640
0
      break;
3641
3642
16
      case METHOD_FIND:
3643
16
      {
3644
16
        if (IS_REQUEST(message_code)) {
3645
8
          message_type_str = "FindReq";
3646
8
          dissect_findreq(tvb,pinfo, message_body_tree,offset,message_body_length);
3647
8
        }
3648
8
        else {
3649
8
          message_type_str = "FindAns";
3650
8
          dissect_findans(tvb, pinfo, message_body_tree, offset, message_body_length);
3651
8
        }
3652
16
      }
3653
16
      break;
3654
3655
0
      case METHOD_LEAVE:
3656
0
      {
3657
0
        if (IS_REQUEST(message_code)) {
3658
0
          message_type_str = "LeaveReq";
3659
0
          dissect_leavereq(tvb,pinfo, message_body_tree,offset,message_body_length);
3660
0
        }
3661
0
        else {
3662
0
          message_type_str = "LeaveAns";
3663
0
          dissect_opaque(tvb, pinfo, message_body_tree, hf_reload_overlay_specific, offset, 2, message_body_length);
3664
0
        }
3665
0
      }
3666
0
      break;
3667
3668
0
      case METHOD_JOIN:
3669
0
      {
3670
0
        if (IS_REQUEST(message_code)) {
3671
0
          message_type_str = "JoinReq";
3672
0
          dissect_joinreq(tvb, pinfo, message_body_tree, offset, message_body_length);
3673
0
        }
3674
0
        else {
3675
0
          message_type_str = "JoinAns";
3676
0
          dissect_joinans(tvb, pinfo, message_body_tree, offset, message_body_length);
3677
0
        }
3678
0
      }
3679
0
      break;
3680
3681
0
      case METHOD_UPDATE:
3682
0
        if (0 == strcmp(TOPOLOGY_PLUGIN_CHORD_RELOAD, reload_topology_plugin)) {
3683
0
          if (IS_REQUEST(message_code)) {
3684
0
            message_type_str = "ChordUpdate";
3685
0
            dissect_chordupdate(tvb, pinfo, message_body_tree, offset, message_body_length);
3686
0
          }
3687
0
        }
3688
0
        break;
3689
3690
0
      case METHOD_PATH_TRACK:
3691
0
        if (IS_REQUEST(message_code)) {
3692
0
          message_type_str = "PathTrackReck";
3693
0
          dissect_pathtrackreq(tvb, pinfo, message_body_tree, offset, message_body_length);
3694
0
        }
3695
0
        else {
3696
0
          message_type_str = "PathTrackAns";
3697
0
          dissect_pathtrackans(tvb, pinfo, message_body_tree, offset, message_body_length);
3698
0
        }
3699
0
        break;
3700
3701
2
      default:
3702
2
        break;
3703
58
      }
3704
58
    }
3705
13
    if (message_type_str!= NULL) {
3706
10
      proto_item_append_text(ti_message_body, " (%s<%d>)", message_type_str, message_body_length);
3707
10
    }
3708
3
    else {
3709
3
      proto_item_append_text(ti_message_body,
3710
3
                             " (%s%s<%d>)",
3711
3
                             val_to_str_const(MSGCODE_TO_METHOD(message_code),methods,"opaque"),
3712
3
                             val_to_str_const(MSGCODE_TO_CLASS(message_code), classes_Short, ""),
3713
3
                             message_body_length);
3714
3715
3
    }
3716
13
  }
3717
6
  else {
3718
    /* Error Response */
3719
6
    uint16_t error_length, error_code;
3720
6
    proto_item *ti_message_body;
3721
6
    proto_tree *message_body_tree;
3722
6
    proto_item *ti_error;
3723
6
    proto_tree *error_tree;
3724
3725
    /* message_code was already parsed */
3726
6
    proto_tree_add_uint_format_value(message_contents_tree, hf_reload_message_code,
3727
6
                                     tvb, offset, 2, message_code, "Error");
3728
6
    offset += 2;
3729
3730
    /* Message body */
3731
6
    ti_message_body = proto_tree_add_item(message_contents_tree, hf_reload_message_body,
3732
6
                                          tvb, offset, 4 + message_body_length, ENC_NA);
3733
6
    message_body_tree = proto_item_add_subtree(ti_message_body, ett_reload_message_body);
3734
6
    error_length = tvb_get_ntohs(tvb, offset);
3735
6
    proto_tree_add_uint(message_body_tree, hf_reload_length_uint32, tvb, offset, 4, message_body_length);
3736
6
    offset += 4;
3737
3738
6
    error_code = tvb_get_ntohs(tvb, offset);
3739
6
    if (2 + 2 + error_length >length) {
3740
1
      expert_add_info_format(pinfo, ti_message_body, &ei_reload_truncated_field, "Truncated error message");
3741
1
      return length;
3742
1
    }
3743
3744
5
    ti_error = proto_tree_add_item(message_body_tree, hf_reload_error_response,
3745
5
                                   tvb, offset, 2 + 2 + error_length, ENC_NA);
3746
5
    error_tree = proto_item_add_subtree(ti_error, ett_reload_error_response);
3747
5
    proto_tree_add_item(error_tree, hf_reload_error_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3748
5
    proto_item_append_text(ti_error, ": %s", val_to_str_const(error_code, errorcodes, "Unknown"));
3749
5
    switch(error_code) {
3750
0
    case ERRORCODE_GENERATIONCOUNTERTOOLOW:
3751
0
    {
3752
0
      uint16_t local_length = tvb_get_ntohs(tvb, offset+2);
3753
0
      proto_tree_add_item(error_tree, hf_reload_length_uint16, tvb, offset+2, 2, ENC_BIG_ENDIAN);
3754
0
      dissect_storeans(tvb, pinfo, error_tree, offset+4, local_length);
3755
0
    }
3756
0
    break;
3757
3758
0
    case ERRORCODE_UNKNOWNKIND:
3759
0
    {
3760
0
      uint16_t local_length = tvb_get_ntohs(tvb, offset+2);
3761
0
      proto_tree_add_item(error_tree, hf_reload_length_uint16, tvb, offset+2, 2, ENC_BIG_ENDIAN);
3762
0
      dissect_kindid_list(tvb, pinfo, error_tree, offset+4, local_length);
3763
0
    }
3764
0
    break;
3765
3766
0
    case ERRORCODE_UNDERLAY_DESTINATION_UNREACHABLE:
3767
0
    {
3768
0
      proto_tree_add_item(error_tree, hf_reload_opaque_string, tvb, offset+2, 32, ENC_ASCII);
3769
0
    }
3770
0
    break;
3771
3772
0
    default:
3773
0
      dissect_opaque_string(tvb, pinfo, error_tree, hf_reload_error_response_info, offset+2, 2, -1);
3774
0
      if (error_code <= 19) {
3775
0
        uint16_t info_length = tvb_get_ntohs(tvb,offset+2);
3776
0
        if (info_length>0) {
3777
0
          proto_item_append_text(ti_error, " (%s)", tvb_get_string_enc(pinfo->pool, tvb, offset+4, info_length, ENC_ASCII));
3778
0
        }
3779
0
      }
3780
0
      break;
3781
5
    }
3782
5
  }
3783
13
  offset += message_body_length;
3784
3785
13
  {
3786
13
    proto_tree *extensions_tree;
3787
13
    proto_item *ti_extensions;
3788
13
    proto_tree *extension_tree;
3789
13
    int32_t extension_offset = 0;
3790
13
    int nExtensions = 0;
3791
3792
13
    ti_extensions =
3793
13
      proto_tree_add_item(message_contents_tree, hf_reload_message_extensions, tvb, offset, 4+extensions_length, ENC_NA);
3794
13
    extensions_tree = proto_item_add_subtree(ti_extensions, ett_reload_message_extensions);
3795
13
    proto_tree_add_item(extensions_tree, hf_reload_length_uint32, tvb, offset, 4, ENC_BIG_ENDIAN);
3796
13
    offset += 4;
3797
16
    while (extension_offset >= 0 && (uint32_t)extension_offset < extensions_length) {
3798
15
      uint16_t type;
3799
15
      proto_item *ti_extension;
3800
15
      uint32_t extension_content_length = tvb_get_ntohl(tvb, offset + extension_offset + 3);
3801
15
      if ((extension_offset + 3 + 4 + extension_content_length) > extensions_length) {
3802
10
        expert_add_info_format(pinfo, ti_extensions, &ei_reload_truncated_field, "Truncated message extensions");
3803
10
        break;
3804
10
      }
3805
5
      ti_extension = proto_tree_add_item(extensions_tree, hf_reload_message_extension, tvb, offset+ extension_offset, 3 + 4 + extension_content_length, ENC_NA);
3806
5
      extension_tree = proto_item_add_subtree(ti_extension, ett_reload_message_extension);
3807
5
      type = tvb_get_ntohs(tvb, offset+ extension_offset);
3808
5
      proto_tree_add_item(extension_tree, hf_reload_message_extension_type, tvb, offset+ extension_offset, 2, ENC_BIG_ENDIAN);
3809
5
      proto_tree_add_item(extension_tree, hf_reload_message_extension_critical, tvb, offset+ extension_offset + 2, 1, ENC_BIG_ENDIAN);
3810
5
      switch(type) {
3811
3812
0
      case MESSAGEEXTENSIONTYPE_SELF_TUNING_DATA:
3813
0
      {
3814
0
        uint32_t extension_length;
3815
0
        proto_tree_add_item(extension_tree, hf_reload_length_uint32, tvb, offset+extension_offset+3, 4, ENC_BIG_ENDIAN);
3816
0
        extension_length = tvb_get_ntohl(tvb, offset+extension_offset+3);
3817
0
        if (extension_length > 0) {
3818
0
          dissect_selftuningdata(tvb, extension_tree, offset+extension_offset+3+4);
3819
0
        }
3820
0
      }
3821
0
      break;
3822
3823
0
      case MESSAGEEXTENSIONTYPE_DIAGNOSTIC_PING:
3824
0
      {
3825
0
        uint32_t extension_length;
3826
0
        proto_tree_add_item(extension_tree, hf_reload_length_uint32, tvb, offset+extension_offset+3, 4, ENC_BIG_ENDIAN);
3827
0
        extension_length = tvb_get_ntohl(tvb, offset+extension_offset+3);
3828
0
        if ((extension_length > 0) && (MSGCODE_TO_METHOD(message_code) == METHOD_PING)) {
3829
0
          if (IS_REQUEST(message_code)) {
3830
0
            dissect_diagnosticrequest(-1, tvb, pinfo, extension_tree, offset+extension_offset+3+4, extension_length);
3831
0
          }
3832
0
          else {
3833
0
            dissect_diagnosticresponse(-1, tvb, pinfo, extension_tree, offset+extension_offset+3+4, extension_length);
3834
0
          }
3835
0
        }
3836
0
      }
3837
0
      break;
3838
3839
5
      default:
3840
5
        dissect_opaque(tvb, pinfo, extension_tree, hf_reload_message_extension_content, offset + extension_offset + 3, 4, -1);
3841
5
        break;
3842
5
      }
3843
3
      extension_offset += 3 + 4 + extension_content_length;
3844
3
      nExtensions ++;
3845
3
    }
3846
11
    proto_item_append_text(ti_extensions, " (%d elements)", nExtensions);
3847
11
  }
3848
3849
0
  return ( 2 + 4 + message_body_length + 4 + extensions_length);
3850
13
}
3851
3852
static int
3853
dissect_reload_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3854
3.33k
{
3855
3.33k
  proto_item           *ti;
3856
3.33k
  proto_tree           *reload_tree;
3857
3.33k
  uint32_t              relo_token;
3858
3.33k
  unsigned              effective_length;
3859
3.33k
  unsigned              msg_length, dgram_msg_length;
3860
3.33k
  uint16_t              offset;
3861
3.33k
  conversation_t       *conversation;
3862
3.33k
  reload_conv_info_t   *reload_info;
3863
3.33k
  reload_transaction_t *reload_trans;
3864
3.33k
  wmem_tree_key_t       transaction_id_key[2];
3865
3.33k
  uint32_t              transaction_id[2];
3866
3.33k
  uint16_t              options_length;
3867
3.33k
  uint16_t              via_list_length;
3868
3.33k
  uint16_t              destination_list_length;
3869
3.33k
  uint16_t              message_code;
3870
3.33k
  uint16_t              error_code      = 0;
3871
3.33k
  uint32_t              forwarding_length;
3872
3.33k
  proto_tree           *reload_forwarding_tree;
3873
3.33k
  const char           *msg_class_str;
3874
3.33k
  const char           *msg_method_str  = NULL;
3875
3.33k
  bool                  fragmented      = false;
3876
3.33k
  bool                  last_fragment   = false;
3877
3.33k
  fragment_head        *reload_fd_head  = NULL;
3878
3.33k
  uint32_t              fragment        = 0;
3879
3.33k
  bool                  save_fragmented = false;
3880
3.33k
  bool                  update_col_info = true;
3881
3882
3.33k
  offset = 0;
3883
3.33k
  effective_length = tvb_captured_length(tvb);
3884
3885
  /* First, make sure we have enough data to do the check. */
3886
3.33k
  if (effective_length < MIN_HDR_LENGTH)
3887
1.45k
    return 0;
3888
3889
  /*
3890
   * First check if the frame is really meant for us.
3891
   */
3892
1.88k
  relo_token = tvb_get_ntohl(tvb,0);
3893
3894
1.88k
  if (relo_token != RELOAD_TOKEN) {
3895
1.72k
    return 0;
3896
1.72k
  }
3897
3898
163
  msg_length = get_reload_message_length(pinfo, tvb, offset);
3899
163
  dgram_msg_length = msg_length;
3900
3901
  /* The message seems to be a valid reLOAD message! */
3902
3903
163
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "RELOAD");
3904
163
  col_clear(pinfo->cinfo, COL_INFO);
3905
3906
  /* Create the transaction key which may be used to track the conversation */
3907
163
  transaction_id[0] = tvb_get_ntohl(tvb, 20);
3908
163
  transaction_id[1] = tvb_get_ntohl(tvb, 24);
3909
3910
163
  transaction_id_key[0].length = 2;
3911
163
  transaction_id_key[0].key =  transaction_id;
3912
163
  transaction_id_key[1].length = 0;
3913
163
  transaction_id_key[1].key = NULL;
3914
3915
163
  via_list_length = tvb_get_ntohs(tvb, 32);
3916
163
  destination_list_length = tvb_get_ntohs(tvb, 34);
3917
163
  options_length = tvb_get_ntohs(tvb, 36);
3918
3919
163
  forwarding_length = MIN_HDR_LENGTH + (via_list_length + destination_list_length + options_length);
3920
3921
3922
  /* Do we already have a conversation ? */
3923
163
  conversation = find_or_create_conversation(pinfo);
3924
3925
  /*
3926
   * Do we already have a state structure for this conv
3927
   */
3928
163
  reload_info = (reload_conv_info_t *)conversation_get_proto_data(conversation, proto_reload);
3929
163
  if (!reload_info) {
3930
    /* No.  Attach that information to the conversation, and add
3931
     * it to the list of information structures.
3932
     */
3933
62
    reload_info = wmem_new(wmem_file_scope(), reload_conv_info_t);
3934
62
    reload_info->transaction_pdus = wmem_tree_new(wmem_file_scope());
3935
62
    conversation_add_proto_data(conversation, proto_reload, reload_info);
3936
62
  }
3937
3938
163
  ti = proto_tree_add_item(tree, proto_reload, tvb, 0, -1, ENC_NA);
3939
3940
163
  reload_tree = proto_item_add_subtree(ti, ett_reload);
3941
3942
  /*
3943
   * Message dissection
3944
   */
3945
3946
  /*
3947
   * Forwarding Header
3948
   */
3949
163
  ti = proto_tree_add_item(reload_tree, hf_reload_forwarding, tvb, 0, forwarding_length, ENC_NA);
3950
163
  reload_forwarding_tree = proto_item_add_subtree(ti, ett_reload_forwarding);
3951
3952
163
  proto_tree_add_uint(reload_forwarding_tree, hf_reload_token, tvb, 0, 4, relo_token);
3953
163
  proto_tree_add_item(reload_forwarding_tree, hf_reload_overlay, tvb, 4, 4, ENC_BIG_ENDIAN);
3954
163
  {
3955
163
    proto_item *ti_tmp;
3956
163
    uint16_t    tmp;
3957
163
    tmp = tvb_get_ntohs(tvb,8);
3958
163
    ti_tmp = proto_tree_add_item(reload_forwarding_tree, hf_reload_configuration_sequence, tvb, 8, 2, ENC_BIG_ENDIAN);
3959
163
    if (tmp == 0) {
3960
35
      proto_item_append_text(ti_tmp, "\n  [sequence value not verified]");
3961
35
    }
3962
163
  }
3963
163
  proto_tree_add_item(reload_forwarding_tree, hf_reload_version, tvb, 10, 1, ENC_BIG_ENDIAN);
3964
3965
163
  proto_tree_add_item(reload_forwarding_tree, hf_reload_ttl, tvb, 11, 1, ENC_BIG_ENDIAN);
3966
163
  {
3967
163
    proto_item *ti_fragment;
3968
163
    proto_tree *fragment_tree;
3969
163
    uint32_t    bit_offset;
3970
3971
163
    fragment = tvb_get_ntohl(tvb,12);
3972
3973
163
    ti_fragment = proto_tree_add_uint(reload_forwarding_tree, hf_reload_fragment_flag, tvb, 12, 4, fragment);
3974
163
    fragment_tree = proto_item_add_subtree(ti_fragment, ett_reload_fragment_flag);
3975
163
    bit_offset = (12) * 8;
3976
3977
163
    if (fragment & 0x80000000) {
3978
34
      proto_item_append_text(ti_fragment, " (Fragment)");
3979
34
      fragmented = true;
3980
34
    }
3981
163
    if (fragment & 0x40000000) {
3982
79
      proto_item_append_text(ti_fragment, " (Last)");
3983
79
      last_fragment = true;
3984
79
    }
3985
163
    proto_tree_add_bits_item(fragment_tree, hf_reload_fragment_fragmented, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
3986
163
    proto_tree_add_bits_item(fragment_tree, hf_reload_fragment_last_fragment, tvb, bit_offset+1, 1, ENC_BIG_ENDIAN);
3987
163
    proto_tree_add_bits_item(fragment_tree, hf_reload_fragment_reserved, tvb, bit_offset+2, 6, ENC_BIG_ENDIAN);
3988
163
    fragment = fragment & 0x00ffffff;
3989
163
    proto_tree_add_uint(fragment_tree, hf_reload_fragment_offset, tvb, 13, 3, fragment);
3990
163
  }
3991
3992
  /* msg_length is already parsed */
3993
163
  proto_tree_add_uint(reload_forwarding_tree, hf_reload_length_uint32, tvb, 16, 4, msg_length);
3994
163
  proto_tree_add_item(reload_forwarding_tree, hf_reload_trans_id, tvb, 20, 8, ENC_BIG_ENDIAN);
3995
163
  {
3996
163
    proto_item *ti_tmp;
3997
163
    uint32_t tmp;
3998
163
    tmp = tvb_get_ntohl(tvb,28);
3999
163
    ti_tmp = proto_tree_add_item(reload_forwarding_tree, hf_reload_max_response_length, tvb, 28, 4, ENC_BIG_ENDIAN);
4000
163
    if (0 == tmp) {
4001
12
      proto_item_append_text(ti_tmp, "\n  [Response length not restricted]");
4002
12
    }
4003
163
  }
4004
  /* variable lengths fields lengths are already parsed */
4005
163
  proto_tree_add_uint(reload_forwarding_tree, hf_reload_via_list_length, tvb, 32, 2, via_list_length);
4006
163
  proto_tree_add_uint(reload_forwarding_tree, hf_reload_destination_list_length, tvb, 34, 2, destination_list_length);
4007
163
  proto_tree_add_uint(reload_forwarding_tree, hf_reload_options_length, tvb, 36, 2, options_length);
4008
4009
163
  offset += MIN_HDR_LENGTH;
4010
4011
163
  if (((unsigned)offset + via_list_length) > msg_length) {
4012
4
    expert_add_info(pinfo, ti, &ei_reload_truncated_packet);
4013
4
    return MIN_HDR_LENGTH;
4014
4
  }
4015
4016
159
  if (via_list_length > 0) {
4017
62
    proto_item *ti_vialist;
4018
62
    proto_tree *vialist_tree;
4019
62
    int         numDestinations = 0;
4020
62
    ti_vialist = proto_tree_add_item(reload_forwarding_tree, hf_reload_via_list, tvb, offset, via_list_length, ENC_NA);
4021
62
    vialist_tree = proto_item_add_subtree(ti_vialist, ett_reload_via_list);
4022
4023
62
    dissect_destination_list(tvb, pinfo, vialist_tree, offset, via_list_length, &numDestinations);
4024
62
    proto_item_append_text(ti_vialist, " (Destination<%d>): %d elements",via_list_length,numDestinations);
4025
62
  }
4026
159
  offset += via_list_length;
4027
4028
159
  if (((unsigned)offset + destination_list_length) > msg_length) {
4029
0
    expert_add_info(pinfo, ti, &ei_reload_truncated_packet);
4030
0
    return offset;
4031
0
  }
4032
4033
159
  if (destination_list_length > 0) {
4034
28
    proto_item *ti_destination_list;
4035
28
    proto_tree *destination_list_tree;
4036
28
    int numDestinations;
4037
28
    ti_destination_list = proto_tree_add_item(reload_forwarding_tree, hf_reload_destination_list,
4038
28
                                              tvb, offset, destination_list_length, ENC_NA);
4039
28
    destination_list_tree = proto_item_add_subtree(ti_destination_list, ett_reload_destination_list);
4040
4041
28
    dissect_destination_list(tvb, pinfo, destination_list_tree, offset, destination_list_length, &numDestinations);
4042
28
    proto_item_append_text(ti_destination_list, " (Destination<%d>): %d elements",
4043
28
                           destination_list_length,numDestinations);
4044
28
  }
4045
159
  offset += destination_list_length;
4046
4047
159
  if (((unsigned)offset + options_length) > msg_length) {
4048
1
    expert_add_info(pinfo, ti, &ei_reload_truncated_packet);
4049
1
    return offset;
4050
1
  }
4051
4052
158
  if (options_length > 0) {
4053
20
    int32_t     local_offset = 0;
4054
20
    proto_item *ti_options;
4055
20
    proto_tree *options_tree;
4056
20
    int         nOptions     = 0;
4057
4058
20
    ti_options = proto_tree_add_item(reload_forwarding_tree, hf_reload_forwarding_options, tvb, offset+local_offset, options_length, ENC_NA);
4059
20
    options_tree = proto_item_add_subtree(ti_options, ett_reload_forwarding_options);
4060
98
    while (local_offset >=0 && local_offset < options_length) {
4061
78
      int local_increment;
4062
78
      local_increment = dissect_forwardingoption(tvb, pinfo, options_tree, offset+local_offset, options_length-local_offset);
4063
78
      if (0 >= local_increment) break;
4064
78
      local_offset += local_increment;
4065
78
      nOptions++;
4066
78
    }
4067
20
    proto_item_append_text(ti_options, " (ForwardingOption<%d>): %d elements",options_length,nOptions);
4068
20
  }
4069
158
  offset += options_length;
4070
4071
158
  if ((reload_defragment) && ((fragmented != false) && !((fragment == 0) && (last_fragment)))) {
4072
7
    tvbuff_t   *next_tvb = NULL;
4073
7
    reload_fd_head = NULL;
4074
4075
7
    if (tvb_bytes_exist(tvb, offset, msg_length - offset)) {
4076
0
      reload_fd_head = fragment_add_check(&reload_reassembly_table, tvb, offset,
4077
0
                         pinfo,
4078
0
                         transaction_id[0]^transaction_id[1],
4079
0
                         NULL,
4080
0
                         fragment,
4081
0
                         msg_length - offset,
4082
0
                         !last_fragment);
4083
4084
0
      next_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled RELOAD",
4085
0
                                          reload_fd_head, &reload_frag_items, &update_col_info, reload_tree);
4086
0
    }
4087
7
    if (next_tvb == NULL) {
4088
      /* Just show this as a fragment. */
4089
7
      col_add_fstr(pinfo->cinfo, COL_INFO, "Fragmented RELOAD protocol (trans id=%x%x off=%u",
4090
7
                   transaction_id[0],transaction_id[1], fragment);
4091
7
      if (reload_fd_head && reload_fd_head->reassembled_in != pinfo->num) {
4092
0
        col_append_frame_number(pinfo, COL_INFO, " [Reassembled in #%u]",
4093
0
                        reload_fd_head->reassembled_in);
4094
0
      }
4095
7
      save_fragmented = pinfo->fragmented;
4096
7
      pinfo->fragmented = true;
4097
7
      call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
4098
7
      pinfo->fragmented = save_fragmented;
4099
7
      return effective_length;
4100
7
    }
4101
0
    tvb = next_tvb;
4102
0
    msg_length -= offset; /* need to adjust the length, as the new tvb starts after the forwarding header */
4103
0
    offset = 0;
4104
0
  }
4105
4106
151
  effective_length = tvb_captured_length(tvb);
4107
151
  if (effective_length < msg_length) {
4108
    /* The effective length is too small for the packet */
4109
4
    expert_add_info(pinfo, NULL, &ei_reload_truncated_packet);
4110
4
    return 0;
4111
4
  }
4112
4113
  /*Handle retransmission after reassembly since we use message_contents for it */
4114
4115
147
  message_code = tvb_get_ntohs(tvb, offset);
4116
4117
147
  if (!pinfo->fd->visited) {
4118
4119
67
    if ((reload_trans = (reload_transaction_t *)
4120
67
           wmem_tree_lookup32_array(reload_info->transaction_pdus, transaction_id_key)) == NULL) {
4121
41
      reload_trans = wmem_new(wmem_file_scope(), reload_transaction_t);
4122
41
      reload_trans->req_frame = 0;
4123
41
      reload_trans->rep_frame = 0;
4124
41
      reload_trans->req_time = pinfo->abs_ts;
4125
41
      wmem_tree_insert32_array(reload_info->transaction_pdus, transaction_id_key, (void *)reload_trans);
4126
41
    }
4127
4128
    /* check whether the message is a request or a response */
4129
4130
67
    if (IS_REQUEST(message_code) && (message_code != RELOAD_ERROR)) {
4131
      /* This is a request */
4132
11
      if (reload_trans->req_frame == 0) {
4133
8
        reload_trans->req_frame = pinfo->num;
4134
8
      }
4135
11
    }
4136
56
    else {
4137
      /* This is a catch-all for all non-request messages */
4138
56
      if (reload_trans->rep_frame == 0) {
4139
35
        reload_trans->rep_frame = pinfo->num;
4140
35
      }
4141
56
    }
4142
67
  }
4143
80
  else {
4144
80
    reload_trans = (reload_transaction_t *)wmem_tree_lookup32_array(reload_info->transaction_pdus, transaction_id_key);
4145
80
  }
4146
4147
147
  if (!reload_trans) {
4148
    /* create a "fake" pana_trans structure */
4149
0
    reload_trans = wmem_new(pinfo->pool, reload_transaction_t);
4150
0
    reload_trans->req_frame = 0;
4151
0
    reload_trans->rep_frame = 0;
4152
0
    reload_trans->req_time = pinfo->abs_ts;
4153
0
  }
4154
4155
  /* Retransmission control */
4156
147
  if (IS_REQUEST(message_code) && (message_code != RELOAD_ERROR)) {
4157
11
    if (reload_trans->req_frame != pinfo->num) {
4158
3
      proto_item *it;
4159
3
      it = proto_tree_add_uint(reload_tree, hf_reload_duplicate, tvb, 0, 0, reload_trans->req_frame);
4160
3
      proto_item_set_generated(it);
4161
3
    }
4162
11
    if (reload_trans->rep_frame) {
4163
1
      proto_item *it;
4164
1
      it = proto_tree_add_uint(reload_tree, hf_reload_response_in, tvb, 0, 0, reload_trans->rep_frame);
4165
1
      proto_item_set_generated(it);
4166
1
    }
4167
11
  }
4168
136
  else {
4169
    /* This is a response */
4170
136
    if (reload_trans->rep_frame != pinfo->num) {
4171
21
      proto_item *it;
4172
21
      it = proto_tree_add_uint(reload_tree, hf_reload_duplicate, tvb, 0, 0, reload_trans->rep_frame);
4173
21
      proto_item_set_generated(it);
4174
21
    }
4175
4176
136
    if (reload_trans->req_frame) {
4177
7
      proto_item *it;
4178
7
      nstime_t ns;
4179
4180
7
      it = proto_tree_add_uint(reload_tree, hf_reload_response_to, tvb, 0, 0, reload_trans->req_frame);
4181
7
      proto_item_set_generated(it);
4182
4183
7
      nstime_delta(&ns, &pinfo->abs_ts, &reload_trans->req_time);
4184
7
      it = proto_tree_add_time(reload_tree, hf_reload_time, tvb, 0, 0, &ns);
4185
7
      proto_item_set_generated(it);
4186
7
    }
4187
136
  }
4188
4189
147
  if (message_code == RELOAD_ERROR) {
4190
2
    error_code = tvb_get_ntohs(tvb, forwarding_length + 2+4);
4191
2
    msg_class_str = "Error Response";
4192
2
    col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", msg_class_str, val_to_str_const(error_code, errorcodes, "Unknown"));
4193
2
    proto_item_append_text(ti, ": %s %s", msg_class_str, val_to_str_const(error_code, errorcodes, "Unknown"));
4194
2
  }
4195
145
  else {
4196
145
    msg_class_str = val_to_str(MSGCODE_TO_CLASS(message_code), classes, "Unknown %d");
4197
145
    msg_method_str = val_to_str(MSGCODE_TO_METHOD(message_code), methods, "Unknown %d");
4198
4199
145
    col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
4200
145
                 msg_method_str, msg_class_str);
4201
145
    proto_item_append_text(ti, ": %s %s", msg_method_str, msg_class_str);
4202
145
  }
4203
4204
4205
147
  offset += dissect_reload_messagecontents(tvb, pinfo, reload_tree, offset, (effective_length - offset));
4206
4207
  /* Security Block */
4208
147
  {
4209
147
    proto_item *ti_security_block;
4210
147
    proto_tree *security_block_tree;
4211
147
    proto_item *ti_certificates;
4212
147
    proto_tree *certificates_tree;
4213
147
    uint16_t certificates_length;
4214
147
    uint16_t signeridentityvalue_length;
4215
147
    uint16_t signaturevalue_length;
4216
147
    uint16_t security_block_offset = 0;
4217
4218
147
    certificates_length = tvb_get_ntohs(tvb, offset);
4219
147
    security_block_offset += 2 + certificates_length;
4220
147
    security_block_offset += 2; /* SignatureAndHashAlgorithm     algorithm; */
4221
147
    security_block_offset += 1; /* SignerIdentityType     identity_type; */
4222
147
    signeridentityvalue_length = tvb_get_ntohs(tvb, offset +security_block_offset);
4223
147
    security_block_offset += 2;
4224
147
    security_block_offset += signeridentityvalue_length;
4225
147
    signaturevalue_length = tvb_get_ntohs(tvb, offset +security_block_offset);
4226
147
    security_block_offset += 2;
4227
147
    security_block_offset += signaturevalue_length;
4228
4229
147
    ti_security_block = proto_tree_add_item(reload_tree, hf_reload_security_block, tvb, offset,
4230
147
                                            security_block_offset, ENC_NA);
4231
147
    security_block_tree = proto_item_add_subtree(ti_security_block, ett_reload_security_block);
4232
    /* start parsing from the beginning */
4233
147
    security_block_offset = 0;
4234
147
    ti_certificates = proto_tree_add_item(security_block_tree,
4235
147
                                          hf_reload_certificates, tvb, offset,
4236
147
                                          2 + certificates_length,
4237
147
                                          ENC_NA);
4238
147
    proto_item_append_text(ti_certificates, " (GenericCertificate<%d>)", certificates_length);
4239
147
    certificates_tree = proto_item_add_subtree(ti_certificates, ett_reload_certificates);
4240
147
    proto_tree_add_uint(certificates_tree, hf_reload_length_uint16, tvb, offset, 2, certificates_length);
4241
147
    security_block_offset += 2;
4242
    /* certificates */
4243
4244
147
    {
4245
147
      int32_t certificate_offset = 0;
4246
147
      int nCertificates = 0;
4247
154
      while (certificate_offset >= 0 && certificate_offset < certificates_length) {
4248
9
        proto_item *ti_genericcertificate;
4249
9
        proto_tree *genericcertificate_tree;
4250
9
        uint16_t certificate_length;
4251
4252
9
        certificate_length = tvb_get_ntohs(tvb, offset + security_block_offset + certificate_offset + 1);
4253
9
        if (certificate_offset + 1 + 2 + certificate_length > certificates_length) {
4254
2
          expert_add_info_format(pinfo, ti_security_block, &ei_reload_truncated_field, "Truncated certificate");
4255
2
          break;
4256
2
        }
4257
7
        ti_genericcertificate =
4258
7
          proto_tree_add_item(certificates_tree,
4259
7
                              hf_reload_genericcertificate, tvb, offset + security_block_offset + certificate_offset,
4260
7
                              1 + 2 + certificate_length,
4261
7
                              ENC_NA);
4262
7
        genericcertificate_tree = proto_item_add_subtree(ti_genericcertificate, ett_reload_genericcertificate);
4263
4264
7
        proto_tree_add_item(genericcertificate_tree, hf_reload_certificate_type, tvb,
4265
7
                            offset + security_block_offset + certificate_offset, 1, ENC_BIG_ENDIAN);
4266
4267
7
        proto_tree_add_item(genericcertificate_tree, hf_reload_length_uint16, tvb,
4268
7
                            offset + security_block_offset + certificate_offset+1, 2, ENC_BIG_ENDIAN);
4269
4270
7
        switch (tvb_get_uint8(tvb, offset + security_block_offset + certificate_offset)) {
4271
7
        case 0: {
4272
7
          asn1_ctx_t asn1_ctx;
4273
4274
7
          asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
4275
7
          dissect_x509af_Certificate(false, tvb, offset + security_block_offset + certificate_offset + 1 + 2, &asn1_ctx,
4276
7
                                     genericcertificate_tree, hf_reload_certificate);
4277
7
        }
4278
7
        break;
4279
4280
0
        default:
4281
0
          dissect_opaque(tvb, pinfo, genericcertificate_tree, hf_reload_certificate, offset + security_block_offset + certificate_offset + 1, 2, -1);
4282
7
        }
4283
7
        certificate_offset += 1 + 2 + certificate_length;
4284
7
        nCertificates++;
4285
7
      }
4286
147
      proto_item_append_text(ti_certificates, ": %d elements", nCertificates);
4287
147
    }
4288
4289
0
    security_block_offset += certificates_length;
4290
4291
147
    dissect_signature(tvb, pinfo, security_block_tree, offset + security_block_offset);
4292
    /* Signature */
4293
147
  }
4294
4295
4296
0
  return dgram_msg_length;
4297
147
}
4298
4299
static bool
4300
dissect_reload_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
4301
3.33k
{
4302
3.33k
  if (dissect_reload_message(tvb, pinfo, tree, data) == 0) {
4303
    /*
4304
     * It wasn't a valid RELOAD message, and wasn't
4305
     * dissected as such.
4306
     */
4307
3.17k
    return false;
4308
3.17k
  }
4309
159
  return true;
4310
3.33k
}
4311
4312
void
4313
proto_register_reload(void)
4314
14
{
4315
14
  module_t *reload_module;
4316
14
  expert_module_t* expert_reload;
4317
14
  static hf_register_info hf[] = {
4318
14
    { &hf_reload_response_in,
4319
14
      { "Response in",  "reload.response-in", FT_FRAMENUM,
4320
14
        BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0, "The response to this RELOAD Request is in this frame", HFILL
4321
14
      }
4322
14
    },
4323
14
    { &hf_reload_response_to,
4324
14
      { "Request in", "reload.response-to", FT_FRAMENUM,
4325
14
        BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0, "This is a response to the RELOAD Request in this frame", HFILL
4326
14
      }
4327
14
    },
4328
14
    { &hf_reload_time,
4329
14
      { "Time", "reload.time", FT_RELATIVE_TIME,
4330
14
        BASE_NONE, NULL, 0x0, "The time between the Request and the Response", HFILL
4331
14
      }
4332
14
    },
4333
14
    { &hf_reload_duplicate,
4334
14
      { "Duplicated original message in", "reload.duplicate", FT_FRAMENUM,
4335
14
        BASE_NONE, NULL, 0x0, "This is a duplicate of RELOAD message in this frame", HFILL
4336
14
      }
4337
14
    },
4338
14
    { &hf_reload_forwarding,
4339
14
      { "ForwardingHeader",    "reload.forwarding",  FT_NONE,
4340
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4341
14
      }
4342
14
    },
4343
14
    { &hf_reload_token,
4344
14
      { "relo_token (uint32)", "reload.forwarding.token",  FT_UINT32,
4345
14
        BASE_HEX, NULL, 0x0,  NULL, HFILL
4346
14
      }
4347
14
    },
4348
14
    { &hf_reload_overlay,
4349
14
      { "overlay (uint32)",  "reload.forwarding.overlay",  FT_UINT32,
4350
14
        BASE_HEX, NULL, 0x0,  NULL, HFILL
4351
14
      }
4352
14
    },
4353
14
    { &hf_reload_configuration_sequence,
4354
14
      { "configuration_sequence (uint16)", "reload.forwarding.configuration_sequence", FT_UINT16,
4355
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4356
14
      }
4357
14
    },
4358
14
    { &hf_reload_version,
4359
14
      { "version (uint8)",  "reload.forwarding.version",  FT_UINT8,
4360
14
        BASE_HEX, VALS(versions), 0x0,  NULL, HFILL
4361
14
      }
4362
14
    },
4363
14
    { &hf_reload_ttl,
4364
14
      { "ttl (uint8)",  "reload.forwarding.ttl",  FT_UINT8,
4365
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4366
14
      }
4367
14
    },
4368
14
    { &hf_reload_fragment_flag,
4369
14
      { "fragment (uint32)", "reload.forwarding.fragment", FT_UINT32,
4370
14
        BASE_HEX, NULL, 0x0,  NULL, HFILL
4371
14
      }
4372
14
    },
4373
14
    { &hf_reload_fragment_fragmented,
4374
14
      { "Fragmented (always set)", "reload.forwarding.fragment.fragmented", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
4375
14
        NULL, HFILL
4376
14
      }
4377
14
    },
4378
14
    { &hf_reload_fragment_last_fragment,
4379
14
      { "Last Fragment", "reload.forwarding.fragment.last", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
4380
14
        NULL, HFILL
4381
14
      }
4382
14
    },
4383
14
    { &hf_reload_fragment_reserved,
4384
14
      { "Reserved (always 0)", "reload.forwarding.fragment.reserved", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4385
14
        NULL, HFILL
4386
14
      }
4387
14
    },
4388
14
    { &hf_reload_fragment_offset,
4389
14
      { "Fragment Offset","reload.forwarding.fragment.offset",  FT_UINT32,
4390
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4391
14
      }
4392
14
    },
4393
14
    { &hf_reload_trans_id,
4394
14
      { "transaction_id (uint32)", "reload.forwarding.trans_id", FT_UINT64,
4395
14
        BASE_HEX, NULL, 0x0,  NULL, HFILL
4396
14
      }
4397
14
    },
4398
14
    { &hf_reload_max_response_length,
4399
14
      { "max_response_length (uint32)",  "reload.forwarding.max_response_length",  FT_UINT32,
4400
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4401
14
      }
4402
14
    },
4403
14
    { &hf_reload_via_list_length,
4404
14
      { "via_list_length (uint16)",  "reload.forwarding.via_list.length",  FT_UINT16,
4405
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4406
14
      }
4407
14
    },
4408
14
    { &hf_reload_destination_list_length,
4409
14
      { "destination_list_length (uint16)",  "reload.forwarding.destination_list.length",  FT_UINT16,
4410
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4411
14
      }
4412
14
    },
4413
14
    { &hf_reload_options_length,
4414
14
      { "options_length (uint16)", "reload.forwarding.options.length", FT_UINT16,
4415
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4416
14
      }
4417
14
    },
4418
14
    { &hf_reload_via_list,
4419
14
      { "via_list",   "reload.forwarding.via_list", FT_NONE,
4420
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4421
14
      }
4422
14
    },
4423
14
    { &hf_reload_destination,
4424
14
      { "Destination",    "reload.destination",  FT_NONE,
4425
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4426
14
      }
4427
14
    },
4428
14
    { &hf_reload_destination_compressed_id,
4429
14
      { "compressed_id (uint16)", "reload.forwarding.destination.compressed_id",  FT_UINT16,
4430
14
        BASE_HEX, NULL,   0x0,  NULL, HFILL
4431
14
      }
4432
14
    },
4433
14
    { &hf_reload_destination_type,
4434
14
      { "type (DestinationType)",    "reload.forwarding.destination.type",  FT_UINT8,
4435
14
        BASE_HEX, VALS(destinationtypes), 0x0,  NULL, HFILL
4436
14
      }
4437
14
    },
4438
14
    { &hf_reload_destination_data_node_id,
4439
14
      { "node_id (NodeId)",    "reload.destination.data.nodeid", FT_BYTES,
4440
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4441
14
      }
4442
14
    },
4443
14
    { &hf_reload_destination_data_resource_id,
4444
14
      { "resource_id",    "reload.destination.data.resourceid", FT_NONE,
4445
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4446
14
      }
4447
14
    },
4448
14
    { &hf_reload_nodeid,
4449
14
      { "NodeId",    "reload.nodeid", FT_BYTES,
4450
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4451
14
      }
4452
14
    },
4453
14
    { &hf_reload_resourceid,
4454
14
      { "ResourceId",    "reload.resource_id", FT_NONE,
4455
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4456
14
      }
4457
14
    },
4458
14
    { &hf_reload_destination_data_compressed_id,
4459
14
      { "compressed_id",    "reload.destination.data.compressed_id",  FT_NONE,
4460
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4461
14
      }
4462
14
    },
4463
14
    { &hf_reload_destination_list,
4464
14
      { "destination_list",   "reload.forwarding.destination_list", FT_NONE,
4465
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4466
14
      }
4467
14
    },
4468
14
    { &hf_reload_forwarding_options,
4469
14
      { "options",    "reload.forwarding.options", FT_NONE,
4470
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4471
14
      }
4472
14
    },
4473
14
    { &hf_reload_forwarding_option,
4474
14
      { "ForwardingOption",    "reload.forwarding.option", FT_NONE,
4475
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4476
14
      }
4477
14
    },
4478
14
    { &hf_reload_forwarding_option_type,
4479
14
      { "type (ForwardingOptionType)", "reload.forwarding.option.type",  FT_UINT8,
4480
14
        BASE_DEC, VALS(forwardingoptiontypes),  0x0,  NULL, HFILL
4481
14
      }
4482
14
    },
4483
14
    { &hf_reload_forwarding_option_flags,
4484
14
      { "flags (uint8)",  "reload.forwarding.option.flags", FT_UINT8,
4485
14
        BASE_HEX, NULL, 0x0,  NULL, HFILL
4486
14
      }
4487
14
    },
4488
14
    { &hf_reload_forwarding_option_flag_ignore_state_keeping,
4489
14
      { "IGNORE_STATE_KEEPING", "reload.forwarding.option.flag.ignore_state_keeping", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
4490
14
        NULL, HFILL
4491
14
      }
4492
14
    },
4493
14
    { &hf_reload_forwarding_option_flag_response_copy,
4494
14
      { "RESPONSE_COPY", "reload.forwarding.option.flag.response_copy", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
4495
14
        NULL, HFILL
4496
14
      }
4497
14
    },
4498
14
    { &hf_reload_forwarding_option_flag_destination_critical,
4499
14
      { "DESTINATION_CRITICAL", "reload.forwarding.option.flags.destination_critical", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
4500
14
        NULL, HFILL
4501
14
      }
4502
14
    },
4503
14
    { &hf_reload_forwarding_option_flag_forward_critical,
4504
14
      { "FORWARD_CRITICAL", "reload.forwarding.option.flags.forward_critical", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
4505
14
        NULL, HFILL
4506
14
      }
4507
14
    },
4508
14
    { &hf_reload_attachreqans,
4509
14
      { "AttachReqAns", "reload.attachreqans",  FT_NONE,
4510
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4511
14
      }
4512
14
    },
4513
14
    { &hf_reload_ufrag,
4514
14
      { "ufrag",  "reload.ufrag", FT_NONE,
4515
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4516
14
      }
4517
14
    },
4518
14
    { &hf_reload_password,
4519
14
      { "password", "reload.password",  FT_NONE,
4520
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4521
14
      }
4522
14
    },
4523
14
    { &hf_reload_role,
4524
14
      { "role", "reload.role",  FT_NONE,
4525
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4526
14
      }
4527
14
    },
4528
14
    { &hf_reload_icecandidates,
4529
14
      { "candidates",   "reload.icecandidates", FT_NONE,
4530
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4531
14
      }
4532
14
    },
4533
14
    { &hf_reload_icecandidate,
4534
14
      { "IceCandidate",    "reload.icecandidate",  FT_NONE,
4535
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4536
14
      }
4537
14
    },
4538
14
    { &hf_reload_icecandidate_addr_port,
4539
14
      { "addr_port",    "reload.icecandidate.addr_port",  FT_NONE,
4540
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4541
14
      }
4542
14
    },
4543
14
    { &hf_reload_icecandidate_relay_addr,
4544
14
      { "rel_addr_port",    "reload.icecandidate.relay_addr", FT_NONE,
4545
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4546
14
      }
4547
14
    },
4548
14
    { &hf_reload_ipaddressport,
4549
14
      { "IpAddressPort",    "reload.ipaddressport", FT_NONE,
4550
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4551
14
      }
4552
14
    },
4553
14
    { &hf_reload_ipaddressport_type,
4554
14
      { "type (AddressType)", "reload.ipaddressport.type",  FT_UINT8,
4555
14
        BASE_HEX, VALS(ipaddressporttypes), 0x0,  NULL, HFILL
4556
14
      }
4557
14
    },
4558
14
    { &hf_reload_ipv4addrport,
4559
14
      { "IPv4AddrPort",    "reload.ipv4addrport", FT_NONE,
4560
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4561
14
      }
4562
14
    },
4563
14
    { &hf_reload_ipv4addr,
4564
14
      { "addr (uint32)", "reload.ipv4addr",  FT_IPv4,
4565
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4566
14
      }
4567
14
    },
4568
14
    { &hf_reload_ipv6addrport,
4569
14
      { "IPv6AddrPort",    "reload.ipv6addrport", FT_NONE,
4570
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4571
14
      }
4572
14
    },
4573
14
    { &hf_reload_ipv6addr,
4574
14
      { "addr (uint128)", "reload.ipv6addr",  FT_IPv6,
4575
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4576
14
      }
4577
14
    },
4578
14
    { &hf_reload_port,
4579
14
      { "port (uint16)", "reload.port",  FT_UINT16,
4580
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4581
14
      }
4582
14
    },
4583
14
    { &hf_reload_overlaylink_type,
4584
14
      { "overlay_link (OverlayLinkType)",  "reload.overlaylink.type",  FT_UINT8,
4585
14
        BASE_DEC, VALS(overlaylinktypes), 0x0,  NULL, HFILL
4586
14
      }
4587
14
    },
4588
14
    { &hf_reload_icecandidate_foundation,
4589
14
      { "foundation", "reload.icecandidate.foundation", FT_NONE,
4590
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4591
14
      }
4592
14
    },
4593
14
    { &hf_reload_icecandidate_priority,
4594
14
      { "priority (uint32)", "reload.icecandidate.priority", FT_UINT32,
4595
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4596
14
      }
4597
14
    },
4598
14
    { &hf_reload_icecandidate_type,
4599
14
      { "Ice candidate type", "reload.icecandidate.type", FT_UINT8,
4600
14
        BASE_DEC, VALS(candtypes),  0x0,  NULL, HFILL
4601
14
      }
4602
14
    },
4603
14
    { &hf_reload_iceextensions,
4604
14
      { "extensions",    "reload.iceextensions",  FT_NONE,
4605
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4606
14
      }
4607
14
    },
4608
14
    { &hf_reload_iceextension,
4609
14
      { "IceExtension",    "reload.iceextension",  FT_NONE,
4610
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4611
14
      }
4612
14
    },
4613
14
    { &hf_reload_iceextension_name,
4614
14
      { "name", "reload.iceextension.name", FT_NONE,
4615
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4616
14
      }
4617
14
    },
4618
14
    { &hf_reload_iceextension_value,
4619
14
      { "value",  "reload.iceextension.value",  FT_NONE,
4620
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4621
14
      }
4622
14
    },
4623
14
    { &hf_reload_sendupdate,
4624
14
      { "send_update (Boolean)", "reload.sendupdate",  FT_BOOLEAN,
4625
14
        BASE_NONE, NULL, 0x0,  NULL, HFILL
4626
14
      }
4627
14
    },
4628
14
    { &hf_reload_message_contents,
4629
14
      { "MessageContents",   "reload.message.contents",  FT_NONE,
4630
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4631
14
      }
4632
14
    },
4633
14
    { &hf_reload_message_code,
4634
14
      { "message_code (uint16)", "reload.message.code",  FT_UINT16,
4635
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4636
14
      }
4637
14
    },
4638
14
    { &hf_reload_message_body,
4639
14
      { "message_body", "reload.message.body",  FT_NONE,
4640
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4641
14
      }
4642
14
    },
4643
14
    { &hf_reload_message_extensions,
4644
14
      { "extensions",  "reload.message.extensions", FT_NONE,
4645
14
        BASE_NONE, NULL, 0x0,  NULL, HFILL
4646
14
      }
4647
14
    },
4648
14
    { &hf_reload_message_extension,
4649
14
      { "MessageExtension",    "reload.message_extension", FT_NONE,
4650
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4651
14
      }
4652
14
    },
4653
14
    { &hf_reload_message_extension_type,
4654
14
      { "type (MessageExtensionType)", "reload.message_extension.type",  FT_UINT16,
4655
14
        BASE_DEC, VALS(messageextensiontypes), 0x0,  NULL, HFILL
4656
14
      }
4657
14
    },
4658
14
    { &hf_reload_message_extension_critical,
4659
14
      { "critical (Boolean)", "reload.message_extension.critical",  FT_BOOLEAN,
4660
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4661
14
      }
4662
14
    },
4663
14
    { &hf_reload_message_extension_content,
4664
14
      { "extension_content",  "reload.message_extension.content", FT_BYTES,
4665
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4666
14
      }
4667
14
    },
4668
14
    { &hf_reload_error_response,
4669
14
      { "ErrorResponse", "reload.error_response",  FT_NONE,
4670
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4671
14
      }
4672
14
    },
4673
14
    { &hf_reload_error_response_code,
4674
14
      { "error_code (uint16)", "reload.error_response.code", FT_UINT16,
4675
14
        BASE_DEC, VALS(errorcodes), 0x0,  NULL, HFILL
4676
14
      }
4677
14
    },
4678
14
    { &hf_reload_error_response_info,
4679
14
      { "error_info", "reload.error_response_info", FT_NONE,
4680
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4681
14
      }
4682
14
    },
4683
14
    { &hf_reload_security_block,
4684
14
      { "SecurityBlock", "reload.security_block",  FT_NONE,
4685
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4686
14
      }
4687
14
    },
4688
14
    { &hf_reload_certificates,
4689
14
      { "certificates",  "reload.certificates", FT_NONE,
4690
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4691
14
      }
4692
14
    },
4693
14
    { &hf_reload_certificate_type,
4694
14
      { "type (CertificateType)", "reload.certificate.type",  FT_UINT8,
4695
14
        BASE_DEC, VALS(tls_certificate_type), 0x0,  NULL, HFILL
4696
14
      }
4697
14
    },
4698
14
    { &hf_reload_genericcertificate,
4699
14
      { "GenericCertificate", "reload.genericcertificate",  FT_NONE,
4700
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4701
14
      }
4702
14
    },
4703
14
    { &hf_reload_certificate,
4704
14
      { "certificate", "reload.certificate",  FT_NONE,
4705
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4706
14
      }
4707
14
    },
4708
14
    { &hf_reload_signature,
4709
14
      { "signature (Signature)",  "reload.signature", FT_NONE,
4710
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4711
14
      }
4712
14
    },
4713
14
    { &hf_reload_signatureandhashalgorithm,
4714
14
      { "algorithm (SignatureAndHashAlgorithm)",  "reload.signatureandhashalgorithm", FT_NONE,
4715
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4716
14
      }
4717
14
    },
4718
14
    { &hf_reload_hash_algorithm,
4719
14
      { "hash (HashAlgorithm)", "reload.hash_algorithm",  FT_UINT8,
4720
14
        BASE_DEC, VALS(tls_hash_algorithm), 0x0,  NULL, HFILL
4721
14
      }
4722
14
    },
4723
14
    { &hf_reload_signeridentity_value_hash_alg,
4724
14
      { "hash_alg (HashAlgorithm)", "reload.signeridentityvalue.hash_alg",  FT_UINT8,
4725
14
        BASE_DEC, VALS(tls_hash_algorithm), 0x0,  NULL, HFILL
4726
14
      }
4727
14
    },
4728
14
    { &hf_reload_signature_algorithm,
4729
14
      { "signature (SignatureAlgorithm)",  "reload.signature_algorithm", FT_UINT8,
4730
14
        BASE_DEC, VALS(tls_signature_algorithm),  0x0,  NULL, HFILL
4731
14
      }
4732
14
    },
4733
14
    { &hf_reload_signeridentity,
4734
14
      { "identity (SignerIdentity)", "reload.signature.identity",  FT_NONE,
4735
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4736
14
      }
4737
14
    },
4738
14
    { &hf_reload_signeridentity_identity,
4739
14
      { "identity", "reload.signature.identity.identity",  FT_NONE,
4740
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4741
14
      }
4742
14
    },
4743
14
    { &hf_reload_signeridentity_type,
4744
14
      { "identity_type (SignerIdentityType)",  "reload.signature.identity.type", FT_UINT8,
4745
14
        BASE_DEC, VALS(signeridentitytypes), 0x0,  NULL, HFILL
4746
14
      }
4747
14
    },
4748
14
    { &hf_reload_signeridentity_value,
4749
14
      { "SignatureIdentityValue", "reload.signature.identity.value",  FT_NONE,
4750
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4751
14
      }
4752
14
    },
4753
14
    { &hf_reload_signeridentity_value_certificate_hash,
4754
14
      { "certificate_hash",  "reload.signature.identity.value.certificate_hash", FT_NONE,
4755
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4756
14
      }
4757
14
    },
4758
14
    { &hf_reload_signeridentity_value_certificate_node_id_hash,
4759
14
      { "certificate_node_id_hash",  "reload.signature.identity.value.certificate_node_id_hash", FT_NONE,
4760
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4761
14
      }
4762
14
    },
4763
14
    { &hf_reload_signature_value,
4764
14
      { "signature_value",  "reload.signature.value",  FT_NONE,
4765
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4766
14
      }
4767
14
    },
4768
14
    { &hf_reload_length_uint8,
4769
14
      { "length (uint8)", "reload.length.8", FT_UINT8,
4770
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4771
14
      }
4772
14
    },
4773
14
    { &hf_reload_length_uint16,
4774
14
      { "length (uint16)", "reload.length.16", FT_UINT16,
4775
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4776
14
      }
4777
14
    },
4778
14
    { &hf_reload_length_uint24,
4779
14
      { "length (uint24)", "reload.length.24", FT_UINT32,
4780
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4781
14
      }
4782
14
    },
4783
14
    { &hf_reload_length_uint32,
4784
14
      { "length (uint32)", "reload.length.32",  FT_UINT32,
4785
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4786
14
      }
4787
14
    },
4788
14
    { &hf_reload_opaque,
4789
14
      { "opaque",  "reload.opaque", FT_NONE,
4790
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4791
14
      }
4792
14
    },
4793
14
    { &hf_reload_opaque_data,
4794
14
      { "data (bytes)", "reload.opaque.data", FT_BYTES,
4795
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4796
14
      }
4797
14
    },
4798
14
    { &hf_reload_opaque_string,
4799
14
      { "data (string)", "reload.opaque.string", FT_STRING,
4800
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4801
14
      }
4802
14
    },
4803
14
    { &hf_reload_routequeryreq,
4804
14
      { "RouteQueryReq",  "reload.routequeryreq", FT_NONE,
4805
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4806
14
      }
4807
14
    },
4808
14
    { &hf_reload_routequeryreq_destination,
4809
14
      { "destination",  "reload.routequeryreq.destination", FT_NONE,
4810
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4811
14
      }
4812
14
    },
4813
14
    { &hf_reload_overlay_specific,
4814
14
      { "overlay_specific_data",  "reload.overlay_specific_data", FT_NONE,
4815
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4816
14
      }
4817
14
    },
4818
14
    { &hf_reload_probereq,
4819
14
      { "ProbeReq", "reload.probereq",  FT_NONE,
4820
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4821
14
      }
4822
14
    },
4823
14
    { &hf_reload_probereq_requested_info,
4824
14
      { "requested_info", "reload.probereq.requested_info",  FT_NONE,
4825
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4826
14
      }
4827
14
    },
4828
14
    { &hf_reload_probe_information,
4829
14
      { "ProbeInformation",  "reload.probe_information", FT_NONE,
4830
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4831
14
      }
4832
14
    },
4833
14
    { &hf_reload_probe_information_data,
4834
14
      { "value (ProbeInformationData)",  "reload.probe_information_data", FT_NONE,
4835
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4836
14
      }
4837
14
    },
4838
14
    { &hf_reload_probe_information_type,
4839
14
      { "type (ProbeInformationType)", "reload.probe_information.type", FT_UINT8,
4840
14
        BASE_HEX, VALS(probeinformationtypes),  0x0,  NULL, HFILL
4841
14
      }
4842
14
    },
4843
14
    { &hf_reload_responsible_set,
4844
14
      { "responsible_ppb (uint32)",  "reload.responsible_set", FT_UINT32,
4845
14
        BASE_HEX, NULL, 0x0,  NULL, HFILL
4846
14
      }
4847
14
    },
4848
14
    { &hf_reload_num_resources,
4849
14
      { "num_resources (uint32)",  "reload.num_resources", FT_UINT32,
4850
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4851
14
      }
4852
14
    },
4853
14
    { &hf_reload_uptime,
4854
14
      { "uptime (uint32)", "reload.uptime", FT_UINT32,
4855
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4856
14
      }
4857
14
    },
4858
14
    { &hf_reload_probeans,
4859
14
      { "ProbeAns",  "reload.probeans", FT_NONE,
4860
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4861
14
      }
4862
14
    },
4863
14
    { &hf_reload_probeans_probe_info,
4864
14
      { "probe_info",  "reload.probe_info", FT_NONE,
4865
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4866
14
      }
4867
14
    },
4868
14
    { &hf_reload_appattachreq,
4869
14
      { "AppAttachReq", "reload.appattachreq", FT_NONE,
4870
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4871
14
      }
4872
14
    },
4873
14
    { &hf_reload_appattachans,
4874
14
      { "AppAttachAns", "reload.appattachans", FT_NONE,
4875
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4876
14
      }
4877
14
    },
4878
14
    { &hf_reload_application,
4879
14
      { "application (uint16)", "reload.application", FT_UINT16,
4880
14
        BASE_DEC, VALS(applicationids), 0x0,  NULL, HFILL
4881
14
      }
4882
14
    },
4883
14
    { &hf_reload_ping_response_id,
4884
14
      { "response_id (uint64)", "reload.ping.response_id",  FT_UINT64,
4885
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4886
14
      }
4887
14
    },
4888
14
    { &hf_reload_ping_time,
4889
14
      { "time (uint64)", "reload.ping.time", FT_ABSOLUTE_TIME,
4890
14
        ABSOLUTE_TIME_UTC, NULL, 0x0,  NULL, HFILL
4891
14
      }
4892
14
    },
4893
14
    { &hf_reload_storeddata,
4894
14
      { "StoredData",  "reload.storeddata", FT_NONE,
4895
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4896
14
      }
4897
14
    },
4898
14
    { &hf_reload_storedmetadata,
4899
14
      { "StoredMetaData",  "reload.storedmetadata", FT_NONE,
4900
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4901
14
      }
4902
14
    },
4903
14
    { &hf_reload_storeddata_storage_time,
4904
14
      { "storage_time (uint64)", "reload.storeddata.storage_time", FT_ABSOLUTE_TIME,
4905
14
        ABSOLUTE_TIME_UTC, NULL, 0x0,  NULL, HFILL
4906
14
      }
4907
14
    },
4908
14
    { &hf_reload_storeddata_lifetime,
4909
14
      { "lifetime (uint32)",  "reload.storeddata.lifetime", FT_UINT32,
4910
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4911
14
      }
4912
14
    },
4913
14
    { &hf_reload_datavalue,
4914
14
      { "DataValue",  "reload.datavalue", FT_NONE,
4915
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4916
14
      }
4917
14
    },
4918
14
    { &hf_reload_value,
4919
14
      { "value",  "reload.value", FT_NONE,
4920
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4921
14
      }
4922
14
    },
4923
14
    { &hf_reload_metadata,
4924
14
      { "MetaData",  "reload.metadata", FT_NONE,
4925
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4926
14
      }
4927
14
    },
4928
14
    { &hf_reload_datavalue_exists,
4929
14
      { "exists (Boolean)", "reload.datavalue.exists",  FT_BOOLEAN,
4930
14
        BASE_NONE, NULL, 0x0,  NULL, HFILL
4931
14
      }
4932
14
    },
4933
14
    { &hf_reload_datavalue_value,
4934
14
      { "value",    "reload.datavaluevalue", FT_NONE,
4935
14
        BASE_NONE,  NULL,   0x0,  NULL, HFILL
4936
14
      }
4937
14
    },
4938
14
    { &hf_reload_metadata_value_length,
4939
14
      { "value_length (uint32)",  "reload.metadata.value_length", FT_UINT32,
4940
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4941
14
      }
4942
14
    },
4943
14
    { & hf_reload_metadata_hash_value,
4944
14
      { "hash_value",  "reload.metadata.hash_value", FT_NONE,
4945
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4946
14
      }
4947
14
    },
4948
14
    { &hf_reload_arrayentry,
4949
14
      { "ArrayEntry",  "reload.arrayentry", FT_NONE,
4950
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4951
14
      }
4952
14
    },
4953
14
    { &hf_reload_arrayentry_index,
4954
14
      { "index (uint32)",  "reload.arrayentry.index", FT_UINT32,
4955
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
4956
14
      }
4957
14
    },
4958
14
    { &hf_reload_arrayentry_value,
4959
14
      { "value",  "reload.arrayentry.value", FT_NONE,
4960
14
        BASE_NONE, NULL, 0x0,  NULL, HFILL
4961
14
      }
4962
14
    },
4963
14
    { &hf_reload_dictionaryentry,
4964
14
      { "DictionaryEntry",  "reload.dictionaryentry", FT_NONE,
4965
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4966
14
      }
4967
14
    },
4968
14
    { &hf_reload_dictionarykey,
4969
14
      { "key (DictionaryKey)",  "reload.dictionarykey", FT_NONE,
4970
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4971
14
      }
4972
14
    },
4973
14
    { &hf_reload_dictionary_value,
4974
14
      { "value (DataValue)",  "reload.dictionary.value", FT_NONE,
4975
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4976
14
      }
4977
14
    },
4978
14
    { &hf_reload_kinddata,
4979
14
      { "StoreKindData",  "reload.kinddata", FT_NONE,
4980
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4981
14
      }
4982
14
    },
4983
14
    { &hf_reload_kinddata_kind,
4984
14
      { "kind (KindId)",  "reload.kinddata.kind", FT_UINT32,
4985
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
4986
14
      }
4987
14
    },
4988
14
    { &hf_reload_statkindresponse,
4989
14
      { "StatKindResponse",  "reload.statkindresponse", FT_NONE,
4990
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
4991
14
      }
4992
14
    },
4993
14
    { &hf_reload_kindid,
4994
14
      { "KindId",  "reload.kindid",  FT_UINT32,
4995
14
        BASE_DEC, NULL,  0x0,  NULL, HFILL
4996
14
      }
4997
14
    },
4998
14
    { &hf_reload_kindid_list,
4999
14
      { "kinds",  "reload.kindid_list", FT_NONE,
5000
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5001
14
      }
5002
14
    },
5003
14
    { &hf_reload_generation_counter,
5004
14
      { "generation_counter (uint64)", "reload.generation_counter", FT_UINT64,
5005
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
5006
14
      }
5007
14
    },
5008
14
    { &hf_reload_values,
5009
14
      { "values",  "reload.kinddata.values_length",  FT_NONE,
5010
14
        BASE_NONE, NULL, 0x0,  NULL, HFILL
5011
14
      }
5012
14
    },
5013
14
    { &hf_reload_storereq,
5014
14
      { "StoreReq", "reload.storereq", FT_NONE,
5015
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5016
14
      }
5017
14
    },
5018
14
    { &hf_reload_resource,
5019
14
      { "resource", "reload.resource", FT_NONE,
5020
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5021
14
      }
5022
14
    },
5023
14
    { &hf_reload_store_replica_num,
5024
14
      { "replica_number (uint8)",  "reload.store.replica_number", FT_UINT8,
5025
14
        BASE_DEC, NULL, 0x0,  NULL, HFILL
5026
14
      }
5027
14
    },
5028
14
    { &hf_reload_store_kind_data,
5029
14
      { "kind_data",  "reload.store.kind_data",  FT_NONE,
5030
14
        BASE_NONE, NULL, 0x0,  NULL, HFILL
5031
14
      }
5032
14
    },
5033
14
    { &hf_reload_storeans,
5034
14
      { "StoreAns", "reload.storeans", FT_NONE,
5035
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5036
14
      }
5037
14
    },
5038
14
    { &hf_reload_storeans_kind_responses,
5039
14
      { "kind_responses", "reload.storeans.kind_responses", FT_NONE,
5040
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5041
14
      }
5042
14
    },
5043
14
    { &hf_reload_storekindresponse,
5044
14
      { "StoreKindResponse", "reload.storekindresponse", FT_NONE,
5045
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5046
14
      }
5047
14
    },
5048
14
    { &hf_reload_replicas,
5049
14
      { "replicas", "reload.storekindresponse.replicas", FT_NONE,
5050
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5051
14
      }
5052
14
    },
5053
14
    { &hf_reload_statreq,
5054
14
      { "StatReq", "reload.statreq", FT_NONE,
5055
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5056
14
      }
5057
14
    },
5058
14
    { &hf_reload_fetchans,
5059
14
      { "FetchAns", "reload.fetchans", FT_NONE,
5060
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5061
14
      }
5062
14
    },
5063
14
    { &hf_reload_fetchreq,
5064
14
      { "FetchReq", "reload.fetchreq", FT_NONE,
5065
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5066
14
      }
5067
14
    },
5068
14
    { &hf_reload_fetchreq_specifiers,
5069
14
      { "specifiers", "reload.fetchreq.specifiers", FT_NONE,
5070
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5071
14
      }
5072
14
    },
5073
14
    { &hf_reload_arrayrange,
5074
14
      { "ArrayRange", "reload.arrayrange", FT_NONE,
5075
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5076
14
      }
5077
14
    },
5078
14
    { &hf_reload_storeddataspecifier,
5079
14
      { "StoredDataSpecifier", "reload.storeddataspecifier", FT_NONE,
5080
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5081
14
      }
5082
14
    },
5083
14
    { &hf_reload_storeddataspecifier_indices,
5084
14
      { "indices", "reload.storeddataspecifier.indices", FT_NONE,
5085
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5086
14
      }
5087
14
    },
5088
14
    { &hf_reload_storeddataspecifier_keys,
5089
14
      { "indices", "reload.storeddataspecifier.keys", FT_NONE,
5090
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5091
14
      }
5092
14
    },
5093
14
    { &hf_reload_statans,
5094
14
      { "StatAns",  "reload.statans", FT_NONE,
5095
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5096
14
      }
5097
14
    },
5098
14
    { &hf_reload_findans,
5099
14
      { "FindAns",  "reload.findans", FT_NONE,
5100
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5101
14
      }
5102
14
    },
5103
14
    { &hf_reload_findkinddata_closest,
5104
14
      { "closest",  "reload.findkindata.closest", FT_NONE,
5105
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5106
14
      }
5107
14
    },
5108
14
    { &hf_reload_findkinddata,
5109
14
      { "FindKindData", "reload.findkinddata", FT_NONE,
5110
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5111
14
      }
5112
14
    },
5113
14
    { &hf_reload_fragment_overlap,
5114
14
      { "Fragment overlap", "reload.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
5115
14
        "Fragment overlaps with other fragments", HFILL
5116
14
      }
5117
14
    },
5118
5119
14
    { &hf_reload_fragment_overlap_conflict,
5120
14
      { "Conflicting data in fragment overlap", "reload.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
5121
14
        "Overlapping fragments contained conflicting data", HFILL
5122
14
      }
5123
14
    },
5124
5125
14
    { &hf_reload_fragment_multiple_tails,
5126
14
      { "Multiple tail fragments found",  "reload.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
5127
14
        "Several tails were found when defragmenting the packet", HFILL
5128
14
      }
5129
14
    },
5130
5131
14
    { &hf_reload_fragment_too_long_fragment,
5132
14
      { "Fragment too long",  "reload.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
5133
14
        "Fragment contained data past end of packet", HFILL
5134
14
      }
5135
14
    },
5136
5137
14
    { &hf_reload_fragment_error,
5138
14
      { "Defragmentation error", "reload.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
5139
14
        "Defragmentation error due to illegal fragments", HFILL
5140
14
      }
5141
14
    },
5142
5143
14
    { &hf_reload_fragment_count,
5144
14
      { "Fragment count", "reload.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0,
5145
14
        NULL, HFILL
5146
14
      }
5147
14
    },
5148
5149
14
    { &hf_reload_fragment,
5150
14
      { "RELOAD fragment", "reload.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
5151
14
        NULL, HFILL
5152
14
      }
5153
14
    },
5154
5155
14
    { &hf_reload_fragments,
5156
14
      { "RELOAD fragments", "reload.fragments", FT_NONE, BASE_NONE, NULL, 0x0,
5157
14
        NULL, HFILL
5158
14
      }
5159
14
    },
5160
5161
14
    { &hf_reload_reassembled_in,
5162
14
      { "Reassembled RELOAD in frame", "reload.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
5163
14
        "This RELOAD packet is reassembled in this frame", HFILL
5164
14
      }
5165
14
    },
5166
5167
14
    { &hf_reload_reassembled_length,
5168
14
      { "Reassembled RELOAD length", "reload.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0,
5169
14
        "The total length of the reassembled payload", HFILL
5170
14
      }
5171
14
    },
5172
5173
14
    { &hf_reload_configupdatereq,
5174
14
      { "ConfigUpdateReq",  "reload.configupdatereq",  FT_NONE,
5175
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5176
14
      }
5177
14
    },
5178
5179
14
    { &hf_reload_configupdatereq_type,
5180
14
      { "type (ConfigUpdateType)", "reload.configupdatereq.type", FT_UINT8,
5181
14
        BASE_DEC, VALS(configupdatetypes),  0x0,  NULL, HFILL
5182
14
      }
5183
14
    },
5184
5185
14
    { &hf_reload_configupdatereq_configdata,
5186
14
      { "config_data",  "reload.configupdatereq.config_data",  FT_NONE,
5187
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5188
14
      }
5189
14
    },
5190
5191
14
    { &hf_reload_configupdatereq_kinds,
5192
14
      { "kinds",  "reload.configupdatereq.kinds",  FT_NONE,
5193
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5194
14
      }
5195
14
    },
5196
14
    { &hf_reload_kinddescription,
5197
14
      { "KindDescription",  "reload.configupdatereq.kinddescription",  FT_NONE,
5198
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5199
14
      }
5200
14
    },
5201
14
    { &hf_reload_pingreq,
5202
14
      { "PingReq",  "reload.pingreq",  FT_NONE,
5203
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5204
14
      }
5205
14
    },
5206
14
    { &hf_reload_pingans,
5207
14
      { "PingAns",  "reload.pingans",  FT_NONE,
5208
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5209
14
      }
5210
14
    },
5211
14
    { &hf_reload_padding,
5212
14
      { "padding",  "reload.padding",  FT_NONE,
5213
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5214
14
      }
5215
14
    },
5216
5217
14
    { &hf_reload_chordupdate,
5218
14
      { "ChordUpdate",  "reload.chordupdate",  FT_NONE,
5219
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5220
14
      }
5221
14
    },
5222
14
    { &hf_reload_chordupdate_type,
5223
14
      { "type (ChordUpdateType)", "reload.chordupdate.type", FT_UINT8,
5224
14
        BASE_DEC, VALS(chordupdatetypes),  0x0,  NULL, HFILL
5225
14
      }
5226
14
    },
5227
14
    { &hf_reload_chordupdate_predecessors,
5228
14
      { "predecessors",  "reload.chordupdate.predecessors",  FT_NONE,
5229
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5230
14
      }
5231
14
    },
5232
14
    { &hf_reload_chordupdate_successors,
5233
14
      { "successors",  "reload.chordupdate.successors",  FT_NONE,
5234
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5235
14
      }
5236
14
    },
5237
14
    { &hf_reload_chordupdate_fingers,
5238
14
      { "fingers",  "reload.chordupdate.fingers",  FT_NONE,
5239
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5240
14
      }
5241
14
    },
5242
14
    { &hf_reload_chordroutequeryans,
5243
14
      { "ChordRouteQueryAns",  "reload.chordroutequeryans",  FT_NONE,
5244
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5245
14
      }
5246
14
    },
5247
14
    { &hf_reload_chordroutequeryans_next_peer,
5248
14
      { "next_peer (NodeId)",  "reload.chordroutequeryans.nodeid",  FT_BYTES,
5249
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5250
14
      }
5251
14
    },
5252
14
    { &hf_reload_chordleave,
5253
14
      { "ChordLeaveData",  "reload.chordleavedata",  FT_NONE,
5254
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5255
14
      }
5256
14
    },
5257
14
    { &hf_reload_chordleave_type,
5258
14
      { "type (ChordLeaveType)", "reload.chordleavedata.type", FT_UINT8,
5259
14
        BASE_DEC, VALS(chordleavetypes),  0x0,  NULL, HFILL
5260
14
      }
5261
14
    },
5262
14
    { &hf_reload_chordleave_predecessors,
5263
14
      { "predecessors",  "reload.chordleavedata.predecessors",  FT_NONE,
5264
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5265
14
      }
5266
14
    },
5267
14
    { &hf_reload_chordleave_successors,
5268
14
      { "successors",  "reload.chordleavedata.successors",  FT_NONE,
5269
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5270
14
      }
5271
14
    },
5272
14
    { &hf_reload_turnserver,
5273
14
      { "TurnServer",  "reload.turnserver",  FT_NONE,
5274
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5275
14
      }
5276
14
    },
5277
14
    { &hf_reload_turnserver_iteration,
5278
14
      { "iteration (uint8)",  "reload.turnserver.iteration",  FT_UINT8,
5279
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5280
14
      }
5281
14
    },
5282
14
    { &hf_reload_turnserver_server_address,
5283
14
      { "server_address",  "reload.turnserver.server_address",  FT_NONE,
5284
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5285
14
      }
5286
14
    },
5287
14
    { &hf_reload_sipregistration,
5288
14
      { "SipRegistration",  "reload.sipregistration",  FT_NONE,
5289
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5290
14
      }
5291
14
    },
5292
14
    { &hf_reload_sipregistration_type,
5293
14
      { "type (SipRegistrationType)",  "reload.sipregistration.type",  FT_UINT8,
5294
14
        BASE_DEC,  VALS(sipregistrationtypes), 0x0,  NULL, HFILL
5295
14
      }
5296
14
    },
5297
14
    { &hf_reload_sipregistration_data,
5298
14
      { "data (SipRegistrationData)",  "reload.sipregistration.data",  FT_NONE,
5299
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5300
14
      }
5301
14
    },
5302
14
    { &hf_reload_sipregistration_data_uri,
5303
14
      { "uri",  "reload.sipregistration.data.uri",  FT_NONE,
5304
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5305
14
      }
5306
14
    },
5307
14
    { &hf_reload_sipregistration_data_contact_prefs,
5308
14
      { "contact_prefs",  "reload.sipregistration.data.contact_prefs",  FT_NONE,
5309
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5310
14
      }
5311
14
    },
5312
14
    { &hf_reload_sipregistration_data_destination_list,
5313
14
      { "destination_list",  "reload.sipregistration.data.destination_list",  FT_NONE,
5314
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5315
14
      }
5316
14
    },
5317
14
    { &hf_reload_redirserviceprovider,
5318
14
      { "RedirServiceProvider",  "reload.redirserviceprovider",  FT_NONE,
5319
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5320
14
      }
5321
14
    },
5322
14
    { &hf_reload_redirserviceproviderdata,
5323
14
      { "data (RedirServiceProviderData)",  "reload.redirserviceprovider.data",  FT_NONE,
5324
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5325
14
      }
5326
14
    },
5327
14
    { &hf_reload_redirserviceproviderdata_serviceprovider,
5328
14
      { "serviceProvider (NodeId)",  "reload.redirserviceprovider.data.serviceprovider",  FT_BYTES,
5329
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5330
14
      }
5331
14
    },
5332
14
    { &hf_reload_redirserviceproviderdata_namespace,
5333
14
      { "namespace",  "reload.redirserviceprovider.data.namespace",  FT_NONE,
5334
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5335
14
      }
5336
14
    },
5337
14
    { &hf_reload_redirserviceproviderdata_level,
5338
14
      { "level (uint16)",  "reload.redirserviceprovider.data.level",  FT_UINT16,
5339
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5340
14
      }
5341
14
    },
5342
14
    { &hf_reload_redirserviceproviderdata_node,
5343
14
      { "node (uint16)",  "reload.redirserviceprovider.data.node",  FT_UINT16,
5344
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5345
14
      }
5346
14
    },
5347
14
    { &hf_reload_self_tuning_data,
5348
14
      { "SelfTuningData",  "reload.selftuning_data",  FT_NONE,
5349
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5350
14
      }
5351
14
    },
5352
14
    { &hf_reload_self_tuning_data_network_size,
5353
14
      { "network_size (uint32)",  "reload.selftuning_data.network_size",  FT_UINT32,
5354
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5355
14
      }
5356
14
    },
5357
14
    { &hf_reload_self_tuning_data_join_rate,
5358
14
      { "join_rate (uint32)",  "reload.selftuning_data.join_rate",  FT_UINT32,
5359
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5360
14
      }
5361
14
    },
5362
14
    { &hf_reload_self_tuning_data_leave_rate,
5363
14
      { "leave_rate (uint32)",  "reload.selftuning_data.leave_rate",  FT_UINT32,
5364
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5365
14
      }
5366
14
    },
5367
14
    { &hf_reload_findreq,
5368
14
      { "FindReq",  "reload.findreq",  FT_NONE,
5369
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5370
14
      }
5371
14
    },
5372
14
    { &hf_reload_dmflags,
5373
14
      { "dMFlags (uint64)",  "reload.dmflags",  FT_UINT64,
5374
14
        BASE_HEX,  NULL, 0x0,  NULL, HFILL
5375
14
      }
5376
14
    },
5377
14
    { &hf_reload_dmflag_status_info,
5378
14
      { "STATUS_INFO", "reload.dmflags.status_info", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5379
14
        NULL, HFILL
5380
14
      }
5381
14
    },
5382
14
    { &hf_reload_dmflag_routing_table_size,
5383
14
      { "ROUTING_TABLE_SIZE", "reload.dmflags.routing_table_size", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5384
14
        NULL, HFILL
5385
14
      }
5386
14
    },
5387
14
    { &hf_reload_dmflag_process_power,
5388
14
      { "PROCESS_POWER", "reload.dmflags.process_power", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5389
14
        NULL, HFILL
5390
14
      }
5391
14
    },
5392
14
    { &hf_reload_dmflag_bandwidth,
5393
14
      { "BANDWIDTH", "reload.dmflags.bandwidth", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5394
14
        NULL, HFILL
5395
14
      }
5396
14
    },
5397
14
    { &hf_reload_dmflag_software_version,
5398
14
      { "SOFTWARE_VERSION", "reload.dmflags.software_version", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5399
14
        NULL, HFILL
5400
14
      }
5401
14
    },
5402
14
    { &hf_reload_dmflag_machine_uptime,
5403
14
      { "MACHINE_UPTIME", "reload.dmflags.machine_uptime", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5404
14
        NULL, HFILL
5405
14
      }
5406
14
    },
5407
14
    { &hf_reload_dmflag_app_uptime,
5408
14
      { "APP_UPTIME", "reload.dmflags.app_uptime", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5409
14
        NULL, HFILL
5410
14
      }
5411
14
    },
5412
14
    { &hf_reload_dmflag_memory_footprint,
5413
14
      { "MEMORY_FOOTPRINT", "reload.dmflags.memory_footprint", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5414
14
        NULL, HFILL
5415
14
      }
5416
14
    },
5417
14
    { &hf_reload_dmflag_datasize_stored,
5418
14
      { "DATASIZE_STORED", "reload.dmflags.datasize_stored", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5419
14
        NULL, HFILL
5420
14
      }
5421
14
    },
5422
14
    { &hf_reload_dmflag_instances_stored,
5423
14
      { "INSTANCES_STORED", "reload.dmflags.instances_stored", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5424
14
        NULL, HFILL
5425
14
      }
5426
14
    },
5427
14
    { &hf_reload_dmflag_messages_sent_rcvd,
5428
14
      { "MESSAGES_SENT_RCVD", "reload.dmflags.messages_sent_rcvd", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5429
14
        NULL, HFILL
5430
14
      }
5431
14
    },
5432
14
    { &hf_reload_dmflag_ewma_bytes_sent,
5433
14
      { "EWMA_BYTES_SENT", "reload.dmflags.ewma_bytes_sent", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5434
14
        NULL, HFILL
5435
14
      }
5436
14
    },
5437
14
    { &hf_reload_dmflag_ewma_bytes_rcvd,
5438
14
      { "EWMA_BYTES_RCVD", "reload.dmflags.ewma_bytes_rcvd", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5439
14
        NULL, HFILL
5440
14
      }
5441
14
    },
5442
14
    { &hf_reload_dmflag_underlay_hop,
5443
14
      { "UNDERLAY_HOP", "reload.dmflags.underlay_hop", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5444
14
        NULL, HFILL
5445
14
      }
5446
14
    },
5447
14
    { &hf_reload_dmflag_battery_status,
5448
14
      { "BATTERY_STATUS", "reload.dmflags.battery_status", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
5449
14
        NULL, HFILL
5450
14
      }
5451
14
    },
5452
14
    { &hf_reload_diagnosticrequest,
5453
14
      { "DiagnosticRequest",  "reload.diagnosticrequest",  FT_NONE,
5454
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5455
14
      }
5456
14
    },
5457
14
    { &hf_reload_diagnosticresponse,
5458
14
      { "DiagnosticResponse",  "reload.diagnosticresponse",  FT_NONE,
5459
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5460
14
      }
5461
14
    },
5462
14
    { &hf_reload_diagnosticextension,
5463
14
      { "DiagnosticExtension",  "reload.diagnosticextension",  FT_NONE,
5464
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5465
14
      }
5466
14
    },
5467
14
    { &hf_reload_diagnosticextension_type,
5468
14
      { "type (DiagnosticExtensionRequestType)",  "reload.diagnosticextension.type",  FT_UINT16,
5469
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5470
14
      }
5471
14
    },
5472
14
    { &hf_reload_diagnosticextension_contents,
5473
14
      { "diagnostic_extension_contents",  "reload.diagnosticextension.contents",  FT_NONE,
5474
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5475
14
      }
5476
14
    },
5477
14
    { &hf_reload_diagnostic_expiration, {
5478
14
        "expiration (uint64)", "reload.diagnostic.expiration", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
5479
14
        NULL, 0x0, NULL, HFILL
5480
14
      }
5481
14
    },
5482
14
    { &hf_reload_diagnosticrequest_timestampinitiated, {
5483
14
        "timestampInitiated (uint64)", "reload.diagnosticrequest.timestampinitiated",FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
5484
14
        NULL, 0x0, NULL, HFILL
5485
14
      }
5486
14
    },
5487
14
    { &hf_reload_diagnosticrequest_extensions,
5488
14
      { "diagnostic_extensions",  "reload.diagnosticrequest.extensions",  FT_NONE,
5489
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5490
14
      }
5491
14
    },
5492
14
    { &hf_reload_pathtrackreq,
5493
14
      { "PathTrackReq",  "reload.pathtrackreq",  FT_NONE,
5494
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5495
14
      }
5496
14
    },
5497
14
    { &hf_reload_pathtrackreq_destination,
5498
14
      { "destination (Destination)",  "reload.pathtrackreq.destination",  FT_NONE,
5499
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5500
14
      }
5501
14
    },
5502
14
    { &hf_reload_pathtrackreq_request,
5503
14
      { "request (DiagnosticRequest)",  "reload.pathtrackreq.request",  FT_NONE,
5504
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5505
14
      }
5506
14
    },
5507
14
    { &hf_reload_diagnosticinfo,
5508
14
      { "DiagnosticInfo",  "reload.diagnostic.info",  FT_NONE,
5509
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5510
14
      }
5511
14
    },
5512
14
    { &hf_reload_diagnosticinfo_kind,
5513
14
      { "kind (DiagnosticKindId)",  "reload.diagnostic.kindid",  FT_UINT16,
5514
14
        BASE_DEC,  VALS(diagnostickindids), 0x0,  NULL, HFILL
5515
14
      }
5516
14
    },
5517
14
    { &hf_reload_diagnosticinfo_congestion_status,
5518
14
      { "congestion_status (uint8)",  "reload.diagnostic.info.congestion_status",  FT_UINT8,
5519
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5520
14
      }
5521
14
    },
5522
14
    { &hf_reload_diagnosticinfo_number_peers,
5523
14
      { "number_peers (uint32)",  "reload.diagnostic.info.number_peers",  FT_UINT32,
5524
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5525
14
      }
5526
14
    },
5527
14
    { &hf_reload_diagnosticinfo_processing_power,
5528
14
      { "processing_power (uint32)",  "reload.diagnostic.info.processing_power",  FT_UINT32,
5529
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5530
14
      }
5531
14
    },
5532
14
    { &hf_reload_diagnosticinfo_bandwidth,
5533
14
      { "bandwidth (uint32)",  "reload.diagnostic.info.bandwidth",  FT_UINT32,
5534
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5535
14
      }
5536
14
    },
5537
14
    { &hf_reload_diagnosticinfo_software_version,
5538
14
      { "software_version (opaque string)",  "reload.diagnostic.info.software_version",  FT_STRING,
5539
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5540
14
      }
5541
14
    },
5542
14
    { &hf_reload_diagnosticinfo_machine_uptime,
5543
14
      { "machine_uptime (uint64)",  "reload.diagnostic.info.machine_uptime",  FT_UINT64,
5544
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5545
14
      }
5546
14
    },
5547
14
    { &hf_reload_diagnosticinfo_app_uptime,
5548
14
      { "app_uptime (uint64)",  "reload.diagnostic.info.app_uptime",  FT_UINT64,
5549
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5550
14
      }
5551
14
    },
5552
14
    { &hf_reload_diagnosticinfo_memory_footprint,
5553
14
      { "memory_footprint(uint32)",  "reload.diagnostic.info.memory_footprint",  FT_UINT32,
5554
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5555
14
      }
5556
14
    },
5557
14
    { &hf_reload_diagnosticinfo_datasize_stored,
5558
14
      { "datasize_stored (uint64)",  "reload.diagnostic.info.datasize_stored",  FT_UINT64,
5559
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5560
14
      }
5561
14
    },
5562
14
    { &hf_reload_diagnosticinfo_instances_stored,
5563
14
      { "instances_stored",  "reload.diagnostic.info.instances_stored",  FT_NONE,
5564
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5565
14
      }
5566
14
    },
5567
14
    { &hf_reload_diagnosticinfo_instancesstored_info,
5568
14
      { "InstancesStoredInfo",  "reload.diagnostic.info.instancesstored_info",  FT_NONE,
5569
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5570
14
      }
5571
14
    },
5572
14
    { &hf_reload_diagnosticinfo_instancesstored_instances,
5573
14
      { "instances (uint64)",  "reload.diagnostic.info.instancesstored_instances",  FT_UINT64,
5574
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5575
14
      }
5576
14
    },
5577
14
    { &hf_reload_diagnosticinfo_messages_sent_rcvd,
5578
14
      { "messages_sent_rcvd",  "reload.diagnostic.info.messages_sent_rcvd",  FT_NONE,
5579
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5580
14
      }
5581
14
    },
5582
14
    { &hf_reload_diagnosticinfo_messages_sent_rcvd_info,
5583
14
      { "MessagesSentRcvdInfo",  "reload.diagnostic.info.messages_sent_rcvd.info",  FT_NONE,
5584
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5585
14
      }
5586
14
    },
5587
14
    { &hf_reload_diagnosticinfo_message_code,
5588
14
      { "messages_code (uint16)",  "reload.diagnostic.info.message_code",  FT_UINT16,
5589
14
        BASE_HEX,  NULL, 0x0,  NULL, HFILL
5590
14
      }
5591
14
    },
5592
14
    { &hf_reload_diagnosticinfo_messages_sent,
5593
14
      { "sent (uint64)",  "reload.diagnostic.info.messages_sent",  FT_UINT64,
5594
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5595
14
      }
5596
14
    },
5597
14
    { &hf_reload_diagnosticinfo_messages_rcvd,
5598
14
      { "rcvd (uint64)",  "reload.diagnostic.info.messages_rcvd",  FT_UINT64,
5599
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5600
14
      }
5601
14
    },
5602
14
    { &hf_reload_diagnosticinfo_ewma_bytes_sent,
5603
14
      { "ewma_bytes_sent (uint32)",  "reload.diagnostic.info.ewma_bytes_sent",  FT_UINT32,
5604
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5605
14
      }
5606
14
    },
5607
14
    { &hf_reload_diagnosticinfo_ewma_bytes_rcvd,
5608
14
      { "ewma_bytes_rcvd (uint32)",  "reload.diagnostic.info.ewma_bytes_rcvd",  FT_UINT32,
5609
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5610
14
      }
5611
14
    },
5612
14
    { &hf_reload_diagnosticinfo_underlay_hops,
5613
14
      { "underlay_hops (uint8)",  "reload.diagnostic.info.underlay_hops",  FT_UINT8,
5614
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5615
14
      }
5616
14
    },
5617
14
    { &hf_reload_diagnosticinfo_battery_status,
5618
14
      { "battery_status (uint8)",  "reload.diagnostic.info.battery_status",  FT_UINT8,
5619
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5620
14
      }
5621
14
    },
5622
14
    { &hf_reload_diagnosticresponse_timestampreceived, {
5623
14
        "timestampReceived (uint64)", "reload.diagnosticresponse.timestampreceived",FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
5624
14
        NULL, 0x0, NULL, HFILL
5625
14
      }
5626
14
    },
5627
14
    { &hf_reload_diagnosticresponse_hopcounter,
5628
14
      { "hopCounter (uint8)",  "reload.diagnosticresponse.hopcounter",  FT_UINT8,
5629
14
        BASE_DEC,  NULL, 0x0,  NULL, HFILL
5630
14
      }
5631
14
    },
5632
14
    { &hf_reload_diagnosticresponse_diagnostic_info_list,
5633
14
      { "diagnostic_info_list",  "reload.diagnosticresponse.diagnostic_info_list",  FT_NONE,
5634
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5635
14
      }
5636
14
    },
5637
14
    { &hf_reload_pathtrackans,
5638
14
      { "PathTrackAns",  "reload.pathtrackans",  FT_NONE,
5639
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5640
14
      }
5641
14
    },
5642
14
    { &hf_reload_pathtrackans_next_hop,
5643
14
      { "next_hop",  "reload.pathtrackans.next_hop",  FT_NONE,
5644
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5645
14
      }
5646
14
    },
5647
14
    { &hf_reload_pathtrackans_response,
5648
14
      { "response (DiagnosticResponse)",  "reload.pathtrackand.response",  FT_NONE,
5649
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5650
14
      }
5651
14
    },
5652
14
    { &hf_reload_extensiveroutingmodeoption,
5653
14
      { "ExtensiveRoutingModeOption",  "reload.extensiveroutingmodeoption",  FT_NONE,
5654
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5655
14
      }
5656
14
    },
5657
14
    { &hf_reload_routemode,
5658
14
      { "routemode (RouteMode)", "reload.routemode", FT_UINT8,
5659
14
        BASE_DEC, VALS(routemodes),  0x0,  NULL, HFILL
5660
14
      }
5661
14
    },
5662
14
    { &hf_reload_extensiveroutingmode_transport,
5663
14
      { "transport (OverlayLinkType)",  "reload.extensiveroutingmode.transport",  FT_UINT8,
5664
14
        BASE_DEC, VALS(overlaylinktypes), 0x0,  NULL, HFILL
5665
14
      }
5666
14
    },
5667
14
    { &hf_reload_extensiveroutingmode_ipaddressport,
5668
14
      { "ipaddressport (IpAddressPort)",  "reload.extensiveroutingmode.ipaddressport",  FT_NONE,
5669
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5670
14
      }
5671
14
    },
5672
14
    { &hf_reload_extensiveroutingmode_destination,
5673
14
      { "destination",  "reload.extensiveroutingmode.destination",  FT_NONE,
5674
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5675
14
      }
5676
14
    },
5677
14
    { &hf_reload_joinreq,
5678
14
      { "JoinReq",  "reload.joinreq",  FT_NONE,
5679
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5680
14
      }
5681
14
    },
5682
14
    { &hf_reload_joinans,
5683
14
      { "JoinAns",  "reload.joinans",  FT_NONE,
5684
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5685
14
      }
5686
14
    },
5687
14
    { &hf_reload_joinreq_joining_peer_id,
5688
14
      { "joining_peer_id (NodeId)",  "reload.joinreq.joining_peer_id",  FT_BYTES,
5689
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5690
14
      }
5691
14
    },
5692
14
    { &hf_reload_leavereq,
5693
14
      { "LeaveReq",  "reload.leavereq",  FT_NONE,
5694
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5695
14
      }
5696
14
    },
5697
14
    { &hf_reload_leavereq_leaving_peer_id,
5698
14
      { "leaving_peer_id (NodeId)",  "reload.leavereq.leaving_peer_id",  FT_BYTES,
5699
14
        BASE_NONE,  NULL, 0x0,  NULL, HFILL
5700
14
      }
5701
14
    },
5702
5703
14
  };
5704
5705
  /* Setup protocol subtree array */
5706
14
  static int *ett[] = {
5707
14
    &ett_reload,
5708
14
    &ett_reload_forwarding,
5709
14
    &ett_reload_message,
5710
14
    &ett_reload_security,
5711
14
    &ett_reload_fragment_flag,
5712
14
    &ett_reload_destination,
5713
14
    &ett_reload_via_list,
5714
14
    &ett_reload_destination_list,
5715
14
    &ett_reload_resourceid,
5716
14
    &ett_reload_forwarding_options,
5717
14
    &ett_reload_forwarding_option,
5718
14
    &ett_reload_forwarding_option_flags,
5719
14
    &ett_reload_forwarding_option_directresponseforwarding,
5720
14
    &ett_reload_attachreqans,
5721
14
    &ett_reload_icecandidates,
5722
14
    &ett_reload_icecandidate,
5723
14
    &ett_reload_icecandidate_computed_address,
5724
14
    &ett_reload_iceextensions,
5725
14
    &ett_reload_iceextension,
5726
14
    &ett_reload_ipaddressport,
5727
14
    &ett_reload_ipv4addrport,
5728
14
    &ett_reload_ipv6addrport,
5729
14
    &ett_reload_message_contents,
5730
14
    &ett_reload_message_extensions,
5731
14
    &ett_reload_message_extension,
5732
14
    &ett_reload_error_response,
5733
14
    &ett_reload_security_block,
5734
14
    &ett_reload_certificates,
5735
14
    &ett_reload_genericcertificate,
5736
14
    &ett_reload_signature,
5737
14
    &ett_reload_signatureandhashalgorithm,
5738
14
    &ett_reload_signeridentity,
5739
14
    &ett_reload_signeridentity_identity,
5740
14
    &ett_reload_signeridentity_value,
5741
14
    &ett_reload_opaque,
5742
14
    &ett_reload_message_body,
5743
14
    &ett_reload_routequeryreq,
5744
14
    &ett_reload_probereq,
5745
14
    &ett_reload_probereq_requested_info,
5746
14
    &ett_reload_probe_information,
5747
14
    &ett_reload_probe_information_data,
5748
14
    &ett_reload_probeans,
5749
14
    &ett_reload_probeans_probe_info,
5750
14
    &ett_reload_appattach,
5751
14
    &ett_reload_pingreq,
5752
14
    &ett_reload_pingans,
5753
14
    &ett_reload_storeddata,
5754
14
    &ett_reload_kinddata,
5755
14
    &ett_reload_values,
5756
14
    &ett_reload_datavalue,
5757
14
    &ett_reload_arrayentry,
5758
14
    &ett_reload_dictionaryentry,
5759
14
    &ett_reload_storereq,
5760
14
    &ett_reload_store_kind_data,
5761
14
    &ett_reload_storeans,
5762
14
    &ett_reload_storeans_kind_responses,
5763
14
    &ett_reload_storekindresponse,
5764
14
    &ett_reload_fetchans,
5765
14
    &ett_reload_fetchreq,
5766
14
    &ett_reload_fetchreq_specifiers,
5767
14
    &ett_reload_storeddataspecifier,
5768
14
    &ett_reload_storeddataspecifier_indices,
5769
14
    &ett_reload_storeddataspecifier_keys,
5770
14
    &ett_reload_statans,
5771
14
    &ett_reload_findans,
5772
14
    &ett_reload_findkinddata,
5773
14
    &ett_reload_fragments,
5774
14
    &ett_reload_fragment,
5775
14
    &ett_reload_configupdatereq,
5776
14
    &ett_reload_configupdatereq_config_data,
5777
14
    &ett_reload_kinddescription,
5778
14
    &ett_reload_configupdatereq_kinds,
5779
14
    &ett_reload_storekindresponse_replicas,
5780
14
    &ett_reload_nodeid_list,
5781
14
    &ett_reload_chordupdate,
5782
14
    &ett_reload_chordroutequeryans,
5783
14
    &ett_reload_chordleave,
5784
14
    &ett_reload_turnserver,
5785
14
    &ett_reload_sipregistration,
5786
14
    &ett_reload_sipregistration_data,
5787
14
    &ett_reload_sipregistration_destination_list,
5788
14
    &ett_reload_dictionaryentry_key,
5789
14
    &ett_reload_overlay_specific,
5790
14
    &ett_reload_kindid_list,
5791
14
    &ett_reload_redirserviceproviderdata,
5792
14
    &ett_reload_redirserviceprovider,
5793
14
    &ett_reload_self_tuning_data,
5794
14
    &ett_reload_findreq,
5795
14
    &ett_reload_dmflags,
5796
14
    &ett_reload_diagnosticextension,
5797
14
    &ett_reload_diagnosticrequest,
5798
14
    &ett_reload_diagnosticrequest_extensions,
5799
14
    &ett_reload_pathtrackreq,
5800
14
    &ett_reload_diagnosticinfo,
5801
14
    &ett_reload_diagnosticinfo_instances_stored,
5802
14
    &ett_reload_diagnosticinfo_instancesstored_info,
5803
14
    &ett_reload_diagnosticinfo_messages_sent_rcvd,
5804
14
    &ett_reload_diagnosticinfo_messages_sent_rcvd_info,
5805
14
    &ett_reload_diagnosticresponse,
5806
14
    &ett_reload_diagnosticresponse_diagnostic_info_list,
5807
14
    &ett_reload_pathtrackans,
5808
14
    &ett_reload_extensiveroutingmodeoption,
5809
14
    &ett_reload_extensiveroutingmode_destination,
5810
14
    &ett_reload_joinreq,
5811
14
    &ett_reload_joinans,
5812
14
    &ett_reload_leavereq,
5813
14
  };
5814
5815
14
  static ei_register_info ei[] = {
5816
14
     { &ei_reload_truncated_field, { "reload.truncated_field", PI_PROTOCOL, PI_ERROR, "Truncated field", EXPFILL }},
5817
14
     { &ei_reload_truncated_packet, { "reload.truncated_packet", PI_PROTOCOL, PI_ERROR, "Truncated RELOAD packet", EXPFILL }},
5818
14
     { &ei_reload_computed_len_too_big, { "reload.computed_len_too_big", PI_PROTOCOL, PI_ERROR, "Computed length > max_field length", EXPFILL }},
5819
14
     { &ei_reload_identity_type_unknown, { "reload.signature.identity.type.unknown", PI_PROTOCOL, PI_ERROR, "Unknown identity type", EXPFILL }},
5820
14
     { &ei_reload_unknown_data_model, { "reload.unknown_data_model", PI_PROTOCOL, PI_ERROR, "Unknown Data Model", EXPFILL }},
5821
14
     { &ei_reload_no_xml_dissector, { "reload.no_xml_dissector", PI_PROTOCOL, PI_ERROR, "Can not find xml dissector", EXPFILL }},
5822
14
  };
5823
5824
14
  static uat_field_t reloadkindidlist_uats_flds[] = {
5825
14
    UAT_FLD_DEC(kindidlist_uats,id,"Kind-ID Number","Custom Kind-ID Number"),
5826
14
    UAT_FLD_CSTRING(kindidlist_uats,name,"Kind-ID Name","Custom Kind-ID Name"),
5827
14
    UAT_FLD_VS(kindidlist_uats,data_model,"Kind-ID data model",datamodels,"Kind ID data model"),
5828
14
    UAT_END_FIELDS
5829
14
  };
5830
5831
5832
  /* Register the protocol name and description */
5833
14
  proto_reload = proto_register_protocol("REsource LOcation And Discovery", "RELOAD", "reload");
5834
14
  register_dissector("reload", dissect_reload_message, proto_reload);
5835
  /* Required function calls to register the header fields and subtrees used */
5836
14
  proto_register_field_array(proto_reload, hf, array_length(hf));
5837
14
  proto_register_subtree_array(ett, array_length(ett));
5838
14
  expert_reload = expert_register_protocol(proto_reload);
5839
14
  expert_register_field_array(expert_reload, ei, array_length(ei));
5840
5841
14
  reload_module = prefs_register_protocol(proto_reload, NULL);
5842
5843
14
  reloadkindids_uat =
5844
14
    uat_new("Kind-ID Table",
5845
14
            sizeof(kind_t),
5846
14
            "reload_kindids",               /* filename */
5847
14
            true,                           /* from_profile */
5848
14
            &kindidlist_uats,               /* data_ptr */
5849
14
            &nreloadkinds,                  /* numitems_ptr */
5850
14
            UAT_AFFECTS_DISSECTION,         /* affects dissection of packets, but not set of named fields */
5851
14
            NULL,                           /* Help section (currently a wiki page) */
5852
14
            uat_kindid_copy_cb,
5853
14
            NULL,
5854
14
            uat_kindid_record_free_cb,
5855
14
            NULL,
5856
14
            NULL,
5857
14
            reloadkindidlist_uats_flds);
5858
5859
5860
14
  prefs_register_uat_preference(reload_module, "kindid.table",
5861
14
                                "Kind ID list",
5862
14
                                "A table of Kind ID definitions",
5863
14
                                reloadkindids_uat);
5864
5865
14
  prefs_register_bool_preference(reload_module, "defragment",
5866
14
                                 "Reassemble fragmented reload datagrams",
5867
14
                                 "Whether fragmented RELOAD datagrams should be reassembled",
5868
14
                                 &reload_defragment);
5869
14
  prefs_register_uint_preference(reload_module, "nodeid_length",
5870
14
                                 "NodeId Length",
5871
14
                                 "Length of the NodeId as defined in the overlay.",
5872
14
                                 10,
5873
14
                                 &reload_nodeid_length);
5874
14
  prefs_register_string_preference(reload_module, "topology_plugin",
5875
14
                                   "topology plugin", "topology plugin defined in the overlay", &reload_topology_plugin);
5876
5877
14
  reassembly_table_register(&reload_reassembly_table,
5878
14
                        &addresses_reassembly_table_functions);
5879
14
}
5880
5881
void
5882
proto_reg_handoff_reload(void)
5883
14
{
5884
14
  xml_handle  = find_dissector_add_dependency("xml", proto_reload);
5885
5886
14
  heur_dissector_add("udp", dissect_reload_heur, "RELOAD over UDP", "reload_udp", proto_reload, HEURISTIC_ENABLE);
5887
14
  heur_dissector_add("tcp", dissect_reload_heur, "RELOAD over TCP", "reload_tcp", proto_reload, HEURISTIC_ENABLE);
5888
14
}
5889
5890
/*
5891
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
5892
 *
5893
 * Local variables:
5894
 * c-basic-offset: 2
5895
 * tab-width: 8
5896
 * indent-tabs-mode: nil
5897
 * End:
5898
 *
5899
 * vi: set shiftwidth=2 tabstop=8 expandtab:
5900
 * :indentSize=2:tabSize=8:noTabs=true:
5901
 */