2 * Routines for UFTP version 5 packet dissection
3 * Copyright Dennis Bush <bush@tcnj.edu>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include <epan/packet.h>
15 #include <epan/expert.h>
18 #define UFTP_VER_NUM 0x50
27 #define FILEINFO_ACK 8
46 #define FTYPE_DELETE 3
47 #define FTYPE_FREESPACE 4
52 #define KEY_DES_EDE3 2
53 #define KEY_AES128_CBC 3
54 #define KEY_AES256_CBC 4
55 #define KEY_AES128_GCM 5
56 #define KEY_AES256_GCM 6
57 #define KEY_AES128_CCM 7
58 #define KEY_AES256_CCM 8
72 #define CURVE_sect163k1 1
73 #define CURVE_sect163r1 2
74 #define CURVE_sect163r2 3
75 #define CURVE_sect193r1 4
76 #define CURVE_sect193r2 5
77 #define CURVE_sect233k1 6
78 #define CURVE_sect233r1 7
79 #define CURVE_sect239k1 8
80 #define CURVE_sect283k1 9
81 #define CURVE_sect283r1 10
82 #define CURVE_sect409k1 11
83 #define CURVE_sect409r1 12
84 #define CURVE_sect571k1 13
85 #define CURVE_sect571r1 14
86 #define CURVE_secp160k1 15
87 #define CURVE_secp160r1 16
88 #define CURVE_secp160r2 17
89 #define CURVE_secp192k1 18
90 #define CURVE_secp192r1 19
91 #define CURVE_secp224k1 20
92 #define CURVE_secp224r1 21
93 #define CURVE_secp256k1 22
94 #define CURVE_secp256r1 23
95 #define CURVE_secp384r1 24
96 #define CURVE_secp521r1 25
97 #define CURVE_prime192v1 CURVE_secp192r1
98 #define CURVE_prime256v1 CURVE_secp256r1
105 #define EXT_ENC_INFO 1
106 #define EXT_TFMCC_DATA_INFO 2
107 #define EXT_TFMCC_ACK_INFO 3
109 #define EXT_PGMCC_DATA_INFO 4
110 #define EXT_PGMCC_NAK_INFO 5
111 #define EXT_PGMCC_ACK_INFO 6
113 #define EXT_FREESPACE_INFO 7
115 #define FLAG_SYNC_MODE 0x01
116 #define FLAG_SYNC_PREVIEW 0x02
117 #define FLAG_IPV6 0x04
118 #define FLAG_ANNOUNCE_RESERVED 0xF8
120 #define FLAG_CLIENT_AUTH 0x01
121 #define FLAG_ENCINFO_RESERVED 0xFE
123 #define FLAG_PARTIAL 0x01
124 #define FLAG_FILEINFOACK_RESERVED 0xFE
126 #define FLAG_CURRENT_FILE 0x01
127 #define FLAG_ABORT_RESERVED 0xFE
129 #define FLAG_CC_CLR 0x01
130 #define FLAG_CC_RTT 0x02
131 #define FLAG_CC_START 0x04
132 #define FLAG_CC_LEAVE 0x08
133 #define FLAG_CC_RESERVED 0xF0
135 #define COMP_STAT_NORMAL 0
136 #define COMP_STAT_SKIPPED 1
137 #define COMP_STAT_OVERWRITE 2
138 #define COMP_STAT_REJECTED 3
140 #define HB_AUTH_FAILED 0
142 #define HB_AUTH_CHALLENGE 2
144 #define MAXFILENAME 100
145 #define MAXDIRNAME 200
146 #define MAXPATHNAME 300
147 #define MAXBACKUPPATHNAME 600
148 #define MAXPROXYDEST 1000
150 #define MAXSECTION 65536
152 #define DESTNAME_LEN 80
153 #define IFNAME_LEN 25
154 #define MAX_INTERFACES 100
157 #define PUBKEY_LEN 392 // big enough for a keyblob with RSA-3072
158 #define RAND_LEN 32 // RFC 8446/5246
159 #define HMAC_LEN 64 // big enough for SHA-512
160 #define HASH_LEN 64 // big enough for SHA-512
161 #define VERIFY4_LEN 12 // RFC 5246
162 #define MASTER4_LEN 48 // RFC 5246
163 #define MASTER_LEN 32 // based on SHA-256 length
164 #define ENC_MASTER_LEN 48 // based on SHA-256 length + tag length
165 #define MAXIV 16 // big enough for AES256
166 #define MAXKEY 32 // big enough for AES256
167 #define KEYBLSIZE 16 // Maximum symmetric key blocksize
168 #define DEF_RSA_LEN 1024 // Default length of generated RSA keys
169 #define RSA_MIN 1024 // Minimum RSA key length
170 #define RSA_MAX 3072 // Maximum RSA key length
171 #define DEF_CURVE CURVE_prime256v1 // Default EC curve
172 #define RSA_EXP 65537 // Public key exponent of generated RSA keys
173 #define SALT_LEN 4 // Length of salt for IV
174 #define GCM_IV_LEN 12 // Length of IV for ciphers in GCM mode
175 #define CCM_IV_LEN 12 // Length of IV for ciphers in CCM mode
176 #define GCM_TAG_LEN 16 // Length of tag for ciphers in GCM mode
177 #define CCM_TAG_LEN 16 // Length of tag for ciphers in CCM mode
180 #define ANNOUNCE_LEN 16
181 #define ENC_INFO_LEN 44
182 #define REGISTER_LEN 44
183 #define CLIENT_KEY_LEN 8
184 #define REG_CONF_LEN 4
185 #define KEYINFO_LEN 12
186 #define DESTKEY_LEN 52
187 #define KEYINFO_ACK_LEN 4
188 #define FILEINFO_LEN 28
189 #define FILEINFO_ACK_LEN 16
190 #define FILESEG_LEN 8
191 #define TFMCC_DATA_LEN 8
194 #define COMPLETE_LEN 8
195 #define FREESPACE_LEN 12
196 #define DONE_CONF_LEN 4
197 #define HB_REQ_LEN 12
198 #define HB_RESP_LEN 8
199 #define PROXY_KEY_LEN 8
200 #define ENCRYPTED_LEN 12
201 #define ABORT_LEN 308
202 #define CONG_CTRL_LEN 16
203 #define CC_ITEM_LEN 8
205 #define TFMCC_ACK_LEN 20
206 #define RSA_BLOB_LEN 8
207 #define EC_BLOB_LEN 4
209 void proto_register_uftp5(void);
211 static int proto_uftp
;
213 /* main header and common fields */
214 static int hf_uftp_version
;
215 static int hf_uftp_func
;
216 static int hf_uftp_seq
;
217 static int hf_uftp_src_id
;
218 static int hf_uftp_group_id
;
219 static int hf_uftp_group_inst
;
220 static int hf_uftp_grtt
;
221 static int hf_uftp_gsize
;
222 static int hf_uftp_reserved
;
224 static int hf_uftp_destlist
;
225 static int hf_uftp_dest
;
227 /* ANNOUNCE fields */
228 static int hf_uftp_announce
;
229 static int hf_uftp_announce_func
;
230 static int hf_uftp_announce_hlen
;
231 static int hf_uftp_announce_flags
;
232 static int hf_uftp_announce_flags_sync
;
233 static int hf_uftp_announce_flags_syncpreview
;
234 static int hf_uftp_announce_flags_ipv6
;
235 static int hf_uftp_announce_flags_reserved
;
236 static int hf_uftp_announce_robust
;
237 static int hf_uftp_announce_cc_type
;
238 static int hf_uftp_announce_reserved
;
239 static int hf_uftp_announce_blocksize
;
240 static int hf_uftp_announce_tstamp
;
241 static int hf_uftp_announce_publicmcast_ipv4
;
242 static int hf_uftp_announce_publicmcast_ipv6
;
243 static int hf_uftp_announce_privatemcast_ipv4
;
244 static int hf_uftp_announce_privatemcast_ipv6
;
246 /* EXT_ENC_INFO fields */
247 static int hf_uftp_encinfo
;
248 static int hf_uftp_encinfo_exttype
;
249 static int hf_uftp_encinfo_extlen
;
250 static int hf_uftp_encinfo_flags
;
251 static int hf_uftp_encinfo_flags_client_auth
;
252 static int hf_uftp_encinfo_flags_reserved
;
253 static int hf_uftp_encinfo_reserved
;
254 static int hf_uftp_encinfo_keytype
;
255 static int hf_uftp_encinfo_hashtype
;
256 static int hf_uftp_encinfo_keylen
;
257 static int hf_uftp_encinfo_dhlen
;
258 static int hf_uftp_encinfo_siglen
;
259 static int hf_uftp_encinfo_rand1
;
260 static int hf_uftp_encinfo_keyblob
;
261 static int hf_uftp_encinfo_dhblob
;
262 static int hf_uftp_encinfo_sig
;
264 /* rsa_blob_t fields */
265 static int hf_uftp_rsablob_blobtype
;
266 static int hf_uftp_rsablob_reserved
;
267 static int hf_uftp_rsablob_modlen
;
268 static int hf_uftp_rsablob_exponent
;
269 static int hf_uftp_rsablob_modulus
;
271 /* ec_blob_t fields */
272 static int hf_uftp_ecblob_blobtype
;
273 static int hf_uftp_ecblob_curve
;
274 static int hf_uftp_ecblob_keylen
;
275 static int hf_uftp_ecblob_key
;
277 /* REGISTER fields */
278 static int hf_uftp_register
;
279 static int hf_uftp_register_func
;
280 static int hf_uftp_register_hlen
;
281 static int hf_uftp_register_dhlen
;
282 static int hf_uftp_register_tstamp
;
283 static int hf_uftp_register_rand2
;
284 static int hf_uftp_register_dhkey
;
286 /* CLIENT_KEY fields */
287 static int hf_uftp_clientkey
;
288 static int hf_uftp_clientkey_func
;
289 static int hf_uftp_clientkey_hlen
;
290 static int hf_uftp_clientkey_reserved
;
291 static int hf_uftp_clientkey_bloblen
;
292 static int hf_uftp_clientkey_siglen
;
293 static int hf_uftp_clientkey_keyblob
;
294 static int hf_uftp_clientkey_verify
;
296 /* REG_CONF fields */
297 static int hf_uftp_regconf
;
298 static int hf_uftp_regconf_func
;
299 static int hf_uftp_regconf_hlen
;
300 static int hf_uftp_regconf_reserved
;
303 static int hf_uftp_keyinfo
;
304 static int hf_uftp_keyinfo_func
;
305 static int hf_uftp_keyinfo_hlen
;
306 static int hf_uftp_keyinfo_siglen
;
307 static int hf_uftp_keyinfo_ivctr
;
308 static int hf_uftp_keyinfo_sig
;
309 static int hf_uftp_keyinfo_destkey
;
310 static int hf_uftp_keyinfo_destid
;
311 static int hf_uftp_keyinfo_groupmaster
;
313 /* KEYINFO_ACK fields */
314 static int hf_uftp_keyinfoack
;
315 static int hf_uftp_keyinfoack_func
;
316 static int hf_uftp_keyinfoack_hlen
;
317 static int hf_uftp_keyinfoack_verify_len
;
318 static int hf_uftp_keyinfoack_verify_data
;
320 /* FILEINFO fields */
321 static int hf_uftp_fileinfo
;
322 static int hf_uftp_fileinfo_func
;
323 static int hf_uftp_fileinfo_hlen
;
324 static int hf_uftp_fileinfo_file_id
;
325 static int hf_uftp_fileinfo_ftype
;
326 static int hf_uftp_fileinfo_reserved
;
327 static int hf_uftp_fileinfo_ftstamp_hi
;
328 static int hf_uftp_fileinfo_namelen
;
329 static int hf_uftp_fileinfo_linklen
;
330 static int hf_uftp_fileinfo_fsize
;
331 static int hf_uftp_fileinfo_ftstamp
;
332 static int hf_uftp_fileinfo_tstamp
;
333 static int hf_uftp_fileinfo_name
;
334 static int hf_uftp_fileinfo_link
;
336 /* FILEINFO_ACK fields */
337 static int hf_uftp_fileinfoack
;
338 static int hf_uftp_fileinfoack_func
;
339 static int hf_uftp_fileinfoack_hlen
;
340 static int hf_uftp_fileinfoack_file_id
;
341 static int hf_uftp_fileinfoack_flags
;
342 static int hf_uftp_fileinfoack_flags_partial
;
343 static int hf_uftp_fileinfoack_flags_reserved
;
344 static int hf_uftp_fileinfoack_reserved
;
345 static int hf_uftp_fileinfoack_tstamp
;
348 static int hf_uftp_fileseg
;
349 static int hf_uftp_fileseg_func
;
350 static int hf_uftp_fileseg_hlen
;
351 static int hf_uftp_fileseg_file_id
;
352 static int hf_uftp_fileseg_section
;
353 static int hf_uftp_fileseg_sec_block
;
354 static int hf_uftp_fileseg_data
;
356 /* EXT_TFMCC_DATA_INFO fields */
357 static int hf_uftp_tfmccdata
;
358 static int hf_uftp_tfmccdata_exttype
;
359 static int hf_uftp_tfmccdata_extlen
;
360 static int hf_uftp_tfmccdata_send_rate
;
361 static int hf_uftp_tfmccdata_cc_seq
;
362 static int hf_uftp_tfmccdata_cc_rate
;
365 static int hf_uftp_done
;
366 static int hf_uftp_done_func
;
367 static int hf_uftp_done_hlen
;
368 static int hf_uftp_done_file_id
;
369 static int hf_uftp_done_section
;
370 static int hf_uftp_done_reserved
;
373 static int hf_uftp_status
;
374 static int hf_uftp_status_func
;
375 static int hf_uftp_status_hlen
;
376 static int hf_uftp_status_file_id
;
377 static int hf_uftp_status_section
;
378 static int hf_uftp_status_reserved
;
379 static int hf_uftp_status_naks
;
381 /* COMPLETE fields */
382 static int hf_uftp_complete
;
383 static int hf_uftp_complete_func
;
384 static int hf_uftp_complete_hlen
;
385 static int hf_uftp_complete_file_id
;
386 static int hf_uftp_complete_status
;
387 static int hf_uftp_complete_reserved
;
389 /* EXT_FREESPACE_INFO fields */
390 static int hf_uftp_freespace
;
391 static int hf_uftp_freespace_exttype
;
392 static int hf_uftp_freespace_extlen
;
393 static int hf_uftp_freespace_reserved
;
394 static int hf_uftp_freespace_freespace
;
396 /* DONE_CONF fields */
397 static int hf_uftp_doneconf
;
398 static int hf_uftp_doneconf_func
;
399 static int hf_uftp_doneconf_hlen
;
400 static int hf_uftp_doneconf_reserved
;
403 static int hf_uftp_hbreq
;
404 static int hf_uftp_hbreq_func
;
405 static int hf_uftp_hbreq_hlen
;
406 static int hf_uftp_hbreq_reserved
;
407 static int hf_uftp_hbreq_bloblen
;
408 static int hf_uftp_hbreq_siglen
;
409 static int hf_uftp_hbreq_nonce
;
410 static int hf_uftp_hbreq_keyblob
;
411 static int hf_uftp_hbreq_verify
;
414 static int hf_uftp_hbresp
;
415 static int hf_uftp_hbresp_func
;
416 static int hf_uftp_hbresp_hlen
;
417 static int hf_uftp_hbresp_authenticated
;
418 static int hf_uftp_hbresp_reserved
;
419 static int hf_uftp_hbresp_nonce
;
421 /* PROXY_KEY fields */
422 static int hf_uftp_proxykey
;
423 static int hf_uftp_proxykey_func
;
424 static int hf_uftp_proxykey_hlen
;
425 static int hf_uftp_proxykey_bloblen
;
426 static int hf_uftp_proxykey_dhlen
;
427 static int hf_uftp_proxykey_siglen
;
428 static int hf_uftp_proxykey_keyblob
;
429 static int hf_uftp_proxykey_dhblob
;
430 static int hf_uftp_proxykey_sig
;
432 /* CONG_CTRL fields */
433 static int hf_uftp_congctrl
;
434 static int hf_uftp_congctrl_func
;
435 static int hf_uftp_congctrl_hlen
;
436 static int hf_uftp_congctrl_reserved
;
437 static int hf_uftp_congctrl_cc_seq
;
438 static int hf_uftp_congctrl_cc_rate
;
439 static int hf_uftp_congctrl_tstamp
;
440 static int hf_uftp_congctrl_cclist
;
441 static int hf_uftp_congctrl_item
;
442 static int hf_uftp_congctrl_item_destid
;
443 static int hf_uftp_congctrl_item_flags
;
444 static int hf_uftp_congctrl_item_flags_clr
;
445 static int hf_uftp_congctrl_item_flags_rtt
;
446 static int hf_uftp_congctrl_item_flags_start
;
447 static int hf_uftp_congctrl_item_flags_leave
;
448 static int hf_uftp_congctrl_item_flags_reserved
;
449 static int hf_uftp_congctrl_item_rtt
;
450 static int hf_uftp_congctrl_item_rate
;
453 static int hf_uftp_ccack
;
454 static int hf_uftp_ccack_func
;
455 static int hf_uftp_ccack_hlen
;
456 static int hf_uftp_ccack_reserved
;
458 /* EXT_TFMCC_ACK_INFO fields */
459 static int hf_uftp_tfmccack
;
460 static int hf_uftp_tfmccack_exttype
;
461 static int hf_uftp_tfmccack_extlen
;
462 static int hf_uftp_tfmccack_flags
;
463 static int hf_uftp_tfmccack_flags_clr
;
464 static int hf_uftp_tfmccack_flags_rtt
;
465 static int hf_uftp_tfmccack_flags_start
;
466 static int hf_uftp_tfmccack_flags_leave
;
467 static int hf_uftp_tfmccack_flags_reserved
;
468 static int hf_uftp_tfmccack_reserved
;
469 static int hf_uftp_tfmccack_cc_seq
;
470 static int hf_uftp_tfmccack_cc_rate
;
471 static int hf_uftp_tfmccack_client_id
;
472 static int hf_uftp_tfmccack_tstamp
;
474 /* ENCRYPTED fields */
475 static int hf_uftp_encrypted
;
476 static int hf_uftp_encrypted_ivctr
;
477 static int hf_uftp_encrypted_reserved
;
478 static int hf_uftp_encrypted_payload_len
;
479 static int hf_uftp_encrypted_payload
;
482 static int hf_uftp_abort
;
483 static int hf_uftp_abort_func
;
484 static int hf_uftp_abort_hlen
;
485 static int hf_uftp_abort_flags
;
486 static int hf_uftp_abort_flags_curfile
;
487 static int hf_uftp_abort_flags_reserved
;
488 static int hf_uftp_abort_reserved
;
489 static int hf_uftp_abort_clientid
;
490 static int hf_uftp_abort_message
;
493 static int ett_uftp_announce
;
494 static int ett_uftp_register
;
495 static int ett_uftp_clientkey
;
496 static int ett_uftp_regconf
;
497 static int ett_uftp_keyinfo
;
498 static int ett_uftp_keyinfoack
;
499 static int ett_uftp_fileinfo
;
500 static int ett_uftp_fileinfoack
;
501 static int ett_uftp_fileseg
;
502 static int ett_uftp_done
;
503 static int ett_uftp_status
;
504 static int ett_uftp_complete
;
505 static int ett_uftp_doneconf
;
506 static int ett_uftp_hbreq
;
507 static int ett_uftp_hbresp
;
508 static int ett_uftp_proxykey
;
509 static int ett_uftp_congctrl
;
510 static int ett_uftp_ccack
;
511 static int ett_uftp_encrypted
;
512 static int ett_uftp_abort
;
514 static int ett_uftp_announce_flags
;
515 static int ett_uftp_encinfo
;
516 static int ett_uftp_encinfo_flags
;
517 static int ett_uftp_keyinfo_destkey
;
518 static int ett_uftp_fileinfoack_flags
;
519 static int ett_uftp_congctrl_cclist
;
520 static int ett_uftp_congctrl_item
;
521 static int ett_uftp_congctrl_item_flags
;
522 static int ett_uftp_tfmccdata
;
523 static int ett_uftp_tfmccack
;
524 static int ett_uftp_tfmccack_flags
;
525 static int ett_uftp_freespace
;
526 static int ett_uftp_abort_flags
;
528 static int ett_uftp_destlist
;
529 static int ett_uftp_rsablob
;
530 static int ett_uftp_ecblob
;
532 static expert_field ei_uftp_length_invalid
;
533 static expert_field ei_uftp_func_unknown
;
535 static const value_string messages
[] = {
536 { ANNOUNCE
, "ANNOUNCE" },
537 { REGISTER
, "REGISTER" },
538 { CLIENT_KEY
, "CLIENT_KEY" },
539 { REG_CONF
, "REG_CONF" },
540 { KEYINFO
, "KEYINFO" },
541 { KEYINFO_ACK
, "KEYINFO_ACK" },
542 { FILEINFO
, "FILEINFO" },
543 { FILEINFO_ACK
, "FILEINFO_ACK" },
544 { FILESEG
, "FILESEG" },
546 { STATUS
, "STATUS" },
547 { COMPLETE
, "COMPLETE" },
548 { DONE_CONF
, "DONE_CONF" },
549 { HB_REQ
, "HB_REQ" },
550 { HB_RESP
, "HB_RESP" },
551 { KEY_REQ
, "KEY_REQ (obsolete)" },
552 { PROXY_KEY
, "PROXY_KEY" },
553 { ENCRYPTED
, "ENCRYPTED" },
555 { CONG_CTRL
, "CONG_CTRL" },
556 { CC_ACK
, "CC_ACK" },
560 static const value_string extensions
[] = {
561 { EXT_ENC_INFO
, "EXT_ENC_INFO" },
562 { EXT_TFMCC_DATA_INFO
, "EXT_TFMCC_DATA_INFO" },
563 { EXT_TFMCC_ACK_INFO
, "EXT_TFMCC_ACK_INFO" },
564 { EXT_PGMCC_DATA_INFO
, "EXT_PGMCC_DATA_INFO" },
565 { EXT_PGMCC_NAK_INFO
, "EXT_PGMCC_NAK_INFO" },
566 { EXT_PGMCC_ACK_INFO
, "EXT_PGMCC_ACK_INFO" },
567 { EXT_FREESPACE_INFO
, "EXT_FREESPACE_INFO" },
571 static const value_string cc_types
[] = {
573 { CC_UFTP3
, "UFTP3 (obsolete)" },
574 { CC_TFMCC
, "TFMCC" },
575 { CC_PGMCC
, "PGMCC" },
579 static const value_string keyblob_types
[] = {
580 { KEYBLOB_RSA
, "RSA" },
581 { KEYBLOB_EC
, "EC" },
585 static const value_string curves
[] = {
586 { CURVE_sect163k1
, "sect163k1 (obsolete)" },
587 { CURVE_sect163r1
, "sect163r1 (obsolete)" },
588 { CURVE_sect163r2
, "sect163r2 (obsolete)" },
589 { CURVE_sect193r1
, "sect193r1 (obsolete)" },
590 { CURVE_sect193r2
, "sect193r2 (obsolete)" },
591 { CURVE_sect233k1
, "sect233k1 (obsolete)" },
592 { CURVE_sect233r1
, "sect233r1 (obsolete)" },
593 { CURVE_sect239k1
, "sect239k1 (obsolete)" },
594 { CURVE_sect283k1
, "sect283k1 (obsolete)" },
595 { CURVE_sect283r1
, "sect283r1 (obsolete)" },
596 { CURVE_sect409k1
, "sect409k1 (obsolete)" },
597 { CURVE_sect409r1
, "sect409r1 (obsolete)" },
598 { CURVE_sect571k1
, "sect571k1 (obsolete)" },
599 { CURVE_sect571r1
, "sect571r1 (obsolete)" },
600 { CURVE_secp160k1
, "secp160k1 (obsolete)" },
601 { CURVE_secp160r1
, "secp160r1 (obsolete)" },
602 { CURVE_secp160r2
, "secp160r2 (obsolete)" },
603 { CURVE_secp192k1
, "secp192k1 (obsolete)" },
604 { CURVE_secp192r1
, "prime192v1 (obsolete)" },
605 { CURVE_secp224k1
, "secp224k1 (obsolete)" },
606 { CURVE_secp224r1
, "secp224r1 (obsolete)" },
607 { CURVE_secp256k1
, "secp256k1 (obsolete)" },
608 { CURVE_secp256r1
, "prime256v1" },
609 { CURVE_secp384r1
, "secp384r1" },
610 { CURVE_secp521r1
, "secp521r1" },
614 static const value_string hash_types
[] = {
615 { HASH_NONE
, "NONE" },
616 { HASH_MD5
, "MD5 (obsolete)" },
617 { HASH_SHA1
, "SHA-1 (obsolete)" },
618 { HASH_SHA256
, "SHA-256" },
619 { HASH_SHA384
, "SHA-384" },
620 { HASH_SHA512
, "SHA-512" },
624 static const value_string key_types
[] = {
625 { KEY_NONE
, "NONE" },
626 { KEY_DES
, "DES (obsolete)" },
627 { KEY_DES_EDE3
, "3 Key Triple DES (obsolete)" },
628 { KEY_AES128_CBC
, "AES-128-CBC (obsolete)" },
629 { KEY_AES256_CBC
, "AES-256-CBC (obsolete)" },
630 { KEY_AES128_GCM
, "AES-128-GCM" },
631 { KEY_AES256_GCM
, "AES-256-GCM" },
632 { KEY_AES128_CCM
, "AES-128-CCM" },
633 { KEY_AES256_CCM
, "AES-256-CCM" },
637 static const value_string hb_auth_types
[] = {
638 { HB_AUTH_FAILED
, "Authorization Failed" },
639 { HB_AUTH_OK
, "Authorization Succeeded" },
640 { HB_AUTH_CHALLENGE
, "Authorization Required" },
644 static const value_string file_types
[] = {
645 { FTYPE_REG
, "Regular file" },
646 { FTYPE_DIR
, "Directory" },
647 { FTYPE_LINK
, "Symbolic link" },
648 { FTYPE_DELETE
, "Delete request" },
649 { FTYPE_FREESPACE
, "Free space request" },
653 static int * const announce_flags
[] = {
654 &hf_uftp_announce_flags_sync
,
655 &hf_uftp_announce_flags_syncpreview
,
656 &hf_uftp_announce_flags_ipv6
,
657 &hf_uftp_announce_flags_reserved
,
661 static int * const encinfo_flags
[] = {
662 &hf_uftp_encinfo_flags_client_auth
,
663 &hf_uftp_encinfo_flags_reserved
,
667 static int * const fileinfoack_flags
[] = {
668 &hf_uftp_fileinfoack_flags_partial
,
669 &hf_uftp_fileinfoack_flags_reserved
,
673 static int * const abort_flags
[] = {
674 &hf_uftp_abort_flags_curfile
,
675 &hf_uftp_abort_flags_reserved
,
679 static int * const cc_item_flags
[] = {
680 &hf_uftp_congctrl_item_flags_clr
,
681 &hf_uftp_congctrl_item_flags_rtt
,
682 &hf_uftp_congctrl_item_flags_start
,
683 &hf_uftp_congctrl_item_flags_leave
,
684 &hf_uftp_congctrl_item_flags_reserved
,
688 static int * const tfmcc_ack_flags
[] = {
689 &hf_uftp_tfmccack_flags_clr
,
690 &hf_uftp_tfmccack_flags_rtt
,
691 &hf_uftp_tfmccack_flags_start
,
692 &hf_uftp_tfmccack_flags_leave
,
693 &hf_uftp_tfmccack_flags_reserved
,
697 static const value_string comp_status
[] = {
698 { COMP_STAT_NORMAL
, "Normal" },
699 { COMP_STAT_SKIPPED
, "Skipped" },
700 { COMP_STAT_OVERWRITE
, "Overwrite" },
701 { COMP_STAT_REJECTED
, "Rejected" },
705 #define RTT_MIN 1.0e-6
706 #define RTT_MAX 1000.0
708 static double unquantize_grtt(uint8_t rtt
)
710 return ((rtt
<= 31) ?
711 (((double)(rtt
+ 1)) * (double)RTT_MIN
) :
712 (RTT_MAX
/ exp(((double)(255 - rtt
)) / (double)13.0)));
715 static unsigned unquantize_gsize(uint8_t size
)
721 rval
= (size
>> 3) * (10.0 / 32.0);
722 for (i
= 0; i
< E
; i
++) {
726 return (unsigned)(rval
+ 0.5);
729 static unsigned unquantize_rate(uint16_t rate
)
735 rval
= (rate
>> 4) * (10.0 / 4096.0);
736 for (i
= 0; i
< E
; i
++) {
740 return (unsigned)rval
;
743 static nstime_t
usec_to_nstime(uint64_t t
)
746 result
.secs
= t
/ 1000000;
747 result
.nsecs
= (t
% 1000000) * 1000;
751 static int dissect_uftp_rsablob(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int tree_hf
)
753 proto_item
*ti
= NULL
;
754 proto_tree
*rsablob_tree
= NULL
;
755 int offset
= 0, modlen
;
757 if (tvb_reported_length(tvb
) < RSA_BLOB_LEN
) {
758 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
759 "Invalid length: %d", tvb_reported_length(tvb
));
763 modlen
= (int)tvb_get_ntohs(tvb
, 2);
764 if ((int)tvb_reported_length(tvb
) < modlen
+ RSA_BLOB_LEN
) {
765 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
766 "Invalid length, len = %d", tvb_reported_length(tvb
));
770 ti
= proto_tree_add_item(tree
, tree_hf
, tvb
, offset
, RSA_BLOB_LEN
+ modlen
, ENC_NA
);
771 rsablob_tree
= proto_item_add_subtree(ti
, ett_uftp_rsablob
);
772 proto_tree_add_item(rsablob_tree
, hf_uftp_rsablob_blobtype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
774 proto_tree_add_item(rsablob_tree
, hf_uftp_rsablob_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
776 proto_tree_add_item(rsablob_tree
, hf_uftp_rsablob_modlen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
778 proto_tree_add_item(rsablob_tree
, hf_uftp_rsablob_exponent
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
780 proto_tree_add_item(rsablob_tree
, hf_uftp_rsablob_modulus
, tvb
, offset
, modlen
, ENC_NA
);
782 return RSA_BLOB_LEN
+ modlen
;
785 static int dissect_uftp_ecblob(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int tree_hf
)
787 proto_item
*ti
= NULL
;
788 proto_tree
*ecblob_tree
= NULL
;
789 int offset
= 0, keylen
;
791 if (tvb_reported_length(tvb
) < EC_BLOB_LEN
) {
792 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
793 "Invalid length: %d", tvb_reported_length(tvb
));
797 keylen
= (int)tvb_get_ntohs(tvb
, 2);
798 if ((int)tvb_reported_length(tvb
) < keylen
+ EC_BLOB_LEN
) {
799 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
800 "Invalid length, len = %d", tvb_reported_length(tvb
));
804 ti
= proto_tree_add_item(tree
, tree_hf
, tvb
, offset
, EC_BLOB_LEN
+ keylen
, ENC_NA
);
805 ecblob_tree
= proto_item_add_subtree(ti
, ett_uftp_ecblob
);
806 proto_tree_add_item(ecblob_tree
, hf_uftp_ecblob_blobtype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
808 proto_tree_add_item(ecblob_tree
, hf_uftp_ecblob_curve
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
810 proto_tree_add_item(ecblob_tree
, hf_uftp_ecblob_keylen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
812 proto_tree_add_item(ecblob_tree
, hf_uftp_ecblob_key
, tvb
, offset
, keylen
, ENC_NA
);
814 return EC_BLOB_LEN
+ keylen
;
817 static int dissect_uftp_encinfo(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
819 proto_item
*ti
= NULL
;
820 proto_tree
*encinfo_tree
= NULL
;
821 int offset
= 0, hlen
, keylen
, dhlen
, siglen
;
825 if (tvb_reported_length(tvb
) < ENC_INFO_LEN
) {
826 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
827 "Invalid length: %d", tvb_reported_length(tvb
));
831 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
832 keylen
= (int)tvb_get_ntohs(tvb
, 6);
833 dhlen
= (int)tvb_get_ntohs(tvb
, 8);
834 siglen
= (int)tvb_get_ntohs(tvb
, 10);
835 if (((int)tvb_reported_length(tvb
) < hlen
) ||
836 (hlen
< ENC_INFO_LEN
+ keylen
+ dhlen
+ siglen
)) {
837 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
838 "Invalid length, len = %d, hlen = %d, "
839 "keylen = %d, dhlen = %d, siglen = %d",
840 tvb_reported_length(tvb
), hlen
, keylen
, dhlen
, siglen
);
844 ti
= proto_tree_add_item(tree
, hf_uftp_encinfo
, tvb
, offset
, ENC_INFO_LEN
+ keylen
+ dhlen
+ siglen
, ENC_NA
);
845 encinfo_tree
= proto_item_add_subtree(ti
, ett_uftp_encinfo
);
846 proto_tree_add_item(encinfo_tree
, hf_uftp_encinfo_exttype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
848 proto_tree_add_uint_format_value(encinfo_tree
, hf_uftp_encinfo_extlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
850 proto_tree_add_bitmask(encinfo_tree
, tvb
, offset
, hf_uftp_encinfo_flags
, ett_uftp_encinfo_flags
, encinfo_flags
, ENC_BIG_ENDIAN
);
852 proto_tree_add_item(encinfo_tree
, hf_uftp_encinfo_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
854 proto_tree_add_item(encinfo_tree
, hf_uftp_encinfo_keytype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
856 proto_tree_add_item(encinfo_tree
, hf_uftp_encinfo_hashtype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
858 proto_tree_add_item(encinfo_tree
, hf_uftp_encinfo_keylen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
860 proto_tree_add_item(encinfo_tree
, hf_uftp_encinfo_dhlen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
862 proto_tree_add_item(encinfo_tree
, hf_uftp_encinfo_siglen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
864 proto_tree_add_item(encinfo_tree
, hf_uftp_encinfo_rand1
, tvb
, offset
, RAND_LEN
, ENC_NA
);
869 next_tvb
= tvb_new_subset_length(tvb
, offset
, keylen
);
870 blobtype
= tvb_get_uint8(tvb
, offset
);
873 parsed
= dissect_uftp_rsablob(next_tvb
, pinfo
, encinfo_tree
, hf_uftp_encinfo_keyblob
);
876 parsed
= dissect_uftp_ecblob(next_tvb
, pinfo
, encinfo_tree
, hf_uftp_encinfo_keyblob
);
884 next_tvb
= tvb_new_subset_length(tvb
, offset
, dhlen
);
885 blobtype
= tvb_get_uint8(tvb
, offset
);
888 parsed
= dissect_uftp_rsablob(next_tvb
, pinfo
, encinfo_tree
, hf_uftp_encinfo_dhblob
);
891 parsed
= dissect_uftp_ecblob(next_tvb
, pinfo
, encinfo_tree
, hf_uftp_encinfo_dhblob
);
897 proto_tree_add_item(encinfo_tree
, hf_uftp_encinfo_sig
, tvb
, offset
, siglen
, ENC_NA
);
900 return ENC_INFO_LEN
+ keylen
+ dhlen
+ siglen
;
903 static void dissect_uftp_announce(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
905 proto_item
*ti
= NULL
;
906 proto_item
*destlist
= NULL
;
907 proto_tree
*announce_tree
= NULL
;
908 proto_tree
*destlist_tree
= NULL
;
910 int hlen
, iplen
, destcount
, idx
, extlen_total
;
911 uint8_t flags
, ext_type
;
915 if (tvb_reported_length(tvb
) < ANNOUNCE_LEN
) {
916 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
917 "Invalid length: %d", tvb_reported_length(tvb
));
921 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
922 if ((int)tvb_reported_length(tvb
) < hlen
) {
923 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
924 "Invalid length, len = %d, hlen = %d",
925 tvb_reported_length(tvb
), hlen
);
929 flags
= tvb_get_uint8(tvb
, 2);
931 ti
= proto_tree_add_item(tree
, hf_uftp_announce
, tvb
, offset
, -1, ENC_NA
);
932 announce_tree
= proto_item_add_subtree(ti
, ett_uftp_announce
);
933 proto_tree_add_item(announce_tree
, hf_uftp_announce_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
935 proto_tree_add_uint_format_value(announce_tree
, hf_uftp_announce_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
937 proto_tree_add_bitmask(announce_tree
, tvb
, offset
, hf_uftp_announce_flags
, ett_uftp_announce_flags
, announce_flags
, ENC_BIG_ENDIAN
);
939 proto_tree_add_item(announce_tree
, hf_uftp_announce_robust
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
941 proto_tree_add_item(announce_tree
, hf_uftp_announce_cc_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
943 proto_tree_add_item(announce_tree
, hf_uftp_announce_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
945 proto_tree_add_item(announce_tree
, hf_uftp_announce_blocksize
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
947 tstamp
= usec_to_nstime(tvb_get_ntoh64(tvb
, offset
));
948 proto_tree_add_time(announce_tree
, hf_uftp_announce_tstamp
, tvb
, offset
, 8, &tstamp
);
950 if (flags
& FLAG_IPV6
) {
952 proto_tree_add_item(announce_tree
, hf_uftp_announce_publicmcast_ipv6
, tvb
, offset
, iplen
, ENC_NA
);
954 proto_tree_add_item(announce_tree
, hf_uftp_announce_privatemcast_ipv6
, tvb
, offset
, iplen
, ENC_NA
);
958 proto_tree_add_item(announce_tree
, hf_uftp_announce_publicmcast_ipv4
, tvb
, offset
, iplen
, ENC_BIG_ENDIAN
);
960 proto_tree_add_item(announce_tree
, hf_uftp_announce_privatemcast_ipv4
, tvb
, offset
, iplen
, ENC_BIG_ENDIAN
);
964 extlen_total
= hlen
- (ANNOUNCE_LEN
+ ( 2 * iplen
));
965 while (extlen_total
> 0) {
968 next_tvb
= tvb_new_subset_length(tvb
, offset
, extlen_total
);
969 ext_type
= tvb_get_uint8(tvb
, offset
);
972 parsed
= dissect_uftp_encinfo(next_tvb
, pinfo
, announce_tree
);
976 extlen_total
-= parsed
;
980 destcount
= (tvb_reported_length(tvb
) - hlen
) / 4;
983 destlist
= proto_tree_add_item(announce_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
984 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
986 for (idx
= 0; idx
< destcount
; idx
++) {
987 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
992 static void dissect_uftp_register(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
994 proto_item
*ti
= NULL
;
995 proto_item
*destlist
= NULL
;
996 proto_tree
*register_tree
= NULL
;
997 proto_tree
*destlist_tree
= NULL
;
998 int offset
= 0, hlen
;
999 uint16_t destcount
, keylen
, idx
;
1002 if (tvb_reported_length(tvb
) < REGISTER_LEN
) {
1003 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1004 "Invalid length: %d", tvb_reported_length(tvb
));
1008 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1009 keylen
= tvb_get_ntohs(tvb
, 2);
1010 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< REGISTER_LEN
+ keylen
)) {
1011 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1012 "Invalid length, len = %d, hlen = %d, keylen = %d",
1013 tvb_reported_length(tvb
), hlen
, keylen
);
1017 ti
= proto_tree_add_item(tree
, hf_uftp_register
, tvb
, offset
, -1, ENC_NA
);
1018 register_tree
= proto_item_add_subtree(ti
, ett_uftp_register
);
1019 proto_tree_add_item(register_tree
, hf_uftp_register_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1021 proto_tree_add_uint_format_value(register_tree
, hf_uftp_register_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1023 proto_tree_add_item(register_tree
, hf_uftp_register_dhlen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1025 tstamp
= usec_to_nstime(tvb_get_ntoh64(tvb
, offset
));
1026 proto_tree_add_time(register_tree
, hf_uftp_register_tstamp
, tvb
, offset
, 8, &tstamp
);
1028 proto_tree_add_item(register_tree
, hf_uftp_register_rand2
, tvb
, offset
, RAND_LEN
, ENC_NA
);
1031 proto_tree_add_item(register_tree
, hf_uftp_register_dhkey
, tvb
, offset
, keylen
, ENC_NA
);
1034 destcount
= (tvb_reported_length(tvb
) - hlen
) / 4;
1036 if (destcount
> 0) {
1037 destlist
= proto_tree_add_item(register_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
1038 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
1040 for (idx
= 0; idx
< destcount
; idx
++) {
1041 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1046 static void dissect_uftp_clientkey(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1048 proto_item
*ti
= NULL
;
1049 proto_tree
*clientkey_tree
= NULL
;
1050 int offset
= 0, hlen
;
1051 uint16_t keylen
, verifylen
;
1055 if (tvb_reported_length(tvb
) < CLIENT_KEY_LEN
) {
1056 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1057 "Invalid length: %d", tvb_reported_length(tvb
));
1061 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1062 keylen
= tvb_get_ntohs(tvb
, 4);
1063 verifylen
= tvb_get_ntohs(tvb
, 6);
1064 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< CLIENT_KEY_LEN
+ keylen
+ verifylen
)) {
1065 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1066 "Invalid length, len = %d, hlen = %d, keylen = %d verifylen = %d",
1067 tvb_reported_length(tvb
), hlen
, keylen
, verifylen
);
1071 ti
= proto_tree_add_item(tree
, hf_uftp_clientkey
, tvb
, offset
, -1, ENC_NA
);
1072 clientkey_tree
= proto_item_add_subtree(ti
, ett_uftp_clientkey
);
1073 proto_tree_add_item(clientkey_tree
, hf_uftp_clientkey_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1075 proto_tree_add_uint_format_value(clientkey_tree
, hf_uftp_clientkey_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1077 proto_tree_add_item(clientkey_tree
, hf_uftp_clientkey_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1079 proto_tree_add_item(clientkey_tree
, hf_uftp_clientkey_bloblen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1081 proto_tree_add_item(clientkey_tree
, hf_uftp_clientkey_siglen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1086 next_tvb
= tvb_new_subset_length(tvb
, offset
, keylen
);
1087 blobtype
= tvb_get_uint8(tvb
, offset
);
1090 parsed
= dissect_uftp_rsablob(next_tvb
, pinfo
, clientkey_tree
, hf_uftp_clientkey_keyblob
);
1093 parsed
= dissect_uftp_ecblob(next_tvb
, pinfo
, clientkey_tree
, hf_uftp_clientkey_keyblob
);
1098 if (verifylen
> 0) {
1099 proto_tree_add_item(clientkey_tree
, hf_uftp_clientkey_verify
, tvb
, offset
, verifylen
, ENC_NA
);
1103 static void dissect_uftp_regconf(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1105 proto_item
*ti
= NULL
;
1106 proto_item
*destlist
= NULL
;
1107 proto_tree
*regconf_tree
= NULL
;
1108 proto_tree
*destlist_tree
= NULL
;
1109 int offset
= 0, hlen
;
1110 uint16_t destcount
, idx
;
1112 if (tvb_reported_length(tvb
) < REG_CONF_LEN
) {
1113 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1114 "Invalid length: %d", tvb_reported_length(tvb
));
1118 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1119 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< REG_CONF_LEN
)) {
1120 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1121 "Invalid length, len = %d, hlen = %d",
1122 tvb_reported_length(tvb
), hlen
);
1126 ti
= proto_tree_add_item(tree
, hf_uftp_regconf
, tvb
, offset
, -1, ENC_NA
);
1127 regconf_tree
= proto_item_add_subtree(ti
, ett_uftp_regconf
);
1128 proto_tree_add_item(regconf_tree
, hf_uftp_regconf_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1130 proto_tree_add_uint_format_value(regconf_tree
, hf_uftp_regconf_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1132 proto_tree_add_item(regconf_tree
, hf_uftp_regconf_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1134 destcount
= (tvb_reported_length(tvb
) - hlen
) / 4;
1136 if (destcount
> 0) {
1137 destlist
= proto_tree_add_item(regconf_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
1138 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
1140 for (idx
= 0; idx
< destcount
; idx
++) {
1141 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1146 static void dissect_uftp_keyinfo(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1148 proto_item
*ti
= NULL
;
1149 proto_item
*destlist
= NULL
;
1150 proto_item
*destkey
= NULL
;
1151 proto_tree
*keyinfo_tree
= NULL
;
1152 proto_tree
*destlist_tree
= NULL
;
1153 proto_tree
*destkey_tree
= NULL
;
1154 int offset
= 0, hlen
, siglen
;
1155 uint8_t destcount
, idx
;
1157 if (tvb_reported_length(tvb
) < KEYINFO_LEN
) {
1158 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1159 "Invalid length: %d", tvb_reported_length(tvb
));
1163 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1164 siglen
= (int)tvb_get_ntohs(tvb
, 2);
1165 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< KEYINFO_LEN
+ siglen
)) {
1166 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1167 "Invalid length, len = %d, hlen = %d, siglen = %d",
1168 tvb_reported_length(tvb
), hlen
, siglen
);
1172 ti
= proto_tree_add_item(tree
, hf_uftp_keyinfo
, tvb
, offset
, -1, ENC_NA
);
1173 keyinfo_tree
= proto_item_add_subtree(ti
, ett_uftp_keyinfo
);
1174 proto_tree_add_item(keyinfo_tree
, hf_uftp_keyinfo_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1176 proto_tree_add_uint_format_value(keyinfo_tree
, hf_uftp_keyinfo_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1178 proto_tree_add_item(keyinfo_tree
, hf_uftp_keyinfo_siglen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1180 proto_tree_add_item(keyinfo_tree
, hf_uftp_keyinfo_ivctr
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1182 proto_tree_add_item(keyinfo_tree
, hf_uftp_keyinfo_sig
, tvb
, offset
, siglen
, ENC_NA
);
1184 destcount
= (tvb_reported_length(tvb
) - hlen
) / DESTKEY_LEN
;
1186 if (destcount
> 0) {
1187 destlist
= proto_tree_add_item(keyinfo_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* DESTKEY_LEN
, ENC_NA
);
1188 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
1190 for (idx
= 0; idx
< destcount
; idx
++) {
1191 destkey
= proto_tree_add_item(destlist_tree
, hf_uftp_keyinfo_destkey
, tvb
, offset
, DESTKEY_LEN
, ENC_NA
);
1192 destkey_tree
= proto_item_add_subtree(destkey
, ett_uftp_keyinfo_destkey
);
1193 proto_tree_add_item(destkey_tree
, hf_uftp_keyinfo_destid
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1195 proto_tree_add_item(destkey_tree
, hf_uftp_keyinfo_groupmaster
, tvb
, offset
, 48, ENC_NA
);
1200 static void dissect_uftp_keyinfoack(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1202 proto_item
*ti
= NULL
;
1203 proto_tree
*keyinfoack_tree
= NULL
;
1204 int offset
= 0, hlen
, verifylen
;
1206 if (tvb_reported_length(tvb
) < KEYINFO_ACK_LEN
) {
1207 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1208 "Invalid length: %d", tvb_reported_length(tvb
));
1212 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1213 verifylen
= (int)tvb_get_uint8(tvb
, 2);
1214 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< KEYINFO_ACK_LEN
+ verifylen
)) {
1215 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1216 "Invalid length, len = %d, hlen = %d",
1217 tvb_reported_length(tvb
), hlen
);
1221 ti
= proto_tree_add_item(tree
, hf_uftp_keyinfoack
, tvb
, offset
, -1, ENC_NA
);
1222 keyinfoack_tree
= proto_item_add_subtree(ti
, ett_uftp_keyinfoack
);
1223 proto_tree_add_item(keyinfoack_tree
, hf_uftp_keyinfoack_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1225 proto_tree_add_uint_format_value(keyinfoack_tree
, hf_uftp_keyinfoack_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1227 proto_tree_add_item(keyinfoack_tree
, hf_uftp_keyinfoack_verify_len
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1229 proto_tree_add_item(keyinfoack_tree
, hf_uftp_keyinfoack_verify_data
, tvb
, offset
, verifylen
, ENC_NA
);
1232 static void dissect_uftp_fileinfo(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
1234 proto_item
*ti
= NULL
;
1235 proto_item
*destlist
= NULL
;
1236 proto_tree
*fileinfo_tree
= NULL
;
1237 proto_tree
*destlist_tree
= NULL
;
1238 int offset
= 0, hlen
;
1239 uint16_t file_id
, destcount
, idx
, namelen
, linklen
;
1240 nstime_t ftstamp
, tstamp
;
1242 if (tvb_reported_length(tvb
) < FILEINFO_LEN
) {
1243 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1244 "Invalid length: %d", tvb_reported_length(tvb
));
1248 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1249 namelen
= tvb_get_uint8(tvb
, 8) * 4;
1250 linklen
= tvb_get_uint8(tvb
, 9) * 4;
1251 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< FILEINFO_LEN
+ namelen
+ linklen
)) {
1252 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1253 "Invalid length, len = %d, hlen = %d, namelen = %d, linklen = %d",
1254 tvb_reported_length(tvb
), hlen
, namelen
, linklen
);
1258 file_id
= tvb_get_ntohs(tvb
, 2);
1259 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X", file_id
);
1261 ti
= proto_tree_add_item(tree
, hf_uftp_fileinfo
, tvb
, offset
, -1, ENC_NA
);
1262 fileinfo_tree
= proto_item_add_subtree(ti
, ett_uftp_fileinfo
);
1263 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1265 proto_tree_add_uint_format_value(fileinfo_tree
, hf_uftp_fileinfo_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1267 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1269 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_ftype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1271 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1273 // high bytes of file timestamp
1274 ftstamp
.secs
= (int64_t)tvb_get_ntohs(tvb
, offset
) << 16;
1275 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_ftstamp_hi
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1277 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_namelen
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1279 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_linklen
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1281 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_fsize
, tvb
, offset
, 6, ENC_BIG_ENDIAN
);
1283 // low bytes of file timestamp
1284 ftstamp
.secs
|= tvb_get_ntohl(tvb
, offset
);
1286 proto_tree_add_time(fileinfo_tree
, hf_uftp_fileinfo_ftstamp
, tvb
, offset
, 4, &ftstamp
);
1288 tstamp
= usec_to_nstime(tvb_get_ntoh64(tvb
, offset
));
1289 proto_tree_add_time(fileinfo_tree
, hf_uftp_fileinfo_tstamp
, tvb
, offset
, 8, &tstamp
);
1291 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_name
, tvb
, offset
, namelen
, ENC_ASCII
);
1294 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_link
, tvb
, offset
, linklen
, ENC_ASCII
);
1297 destcount
= (tvb_reported_length(tvb
) - hlen
) / 4;
1299 if (destcount
> 0) {
1300 destlist
= proto_tree_add_item(fileinfo_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
1301 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
1303 for (idx
= 0; idx
< destcount
; idx
++) {
1304 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1309 static void dissect_uftp_fileinfoack(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
1311 proto_item
*ti
= NULL
;
1312 proto_item
*destlist
= NULL
;
1313 proto_tree
*fileinfoack_tree
= NULL
;
1314 proto_tree
*destlist_tree
= NULL
;
1315 int offset
= 0, hlen
;
1316 uint16_t file_id
, destcount
, idx
;
1319 if (tvb_reported_length(tvb
) < FILEINFO_ACK_LEN
) {
1320 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1321 "Invalid length: %d", tvb_reported_length(tvb
));
1325 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1326 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< FILEINFO_ACK_LEN
)) {
1327 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1328 "Invalid length, len = %d, hlen = %d",
1329 tvb_reported_length(tvb
), hlen
);
1333 file_id
= tvb_get_ntohs(tvb
, 2);
1335 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X", file_id
);
1338 ti
= proto_tree_add_item(tree
, hf_uftp_fileinfoack
, tvb
, offset
, -1, ENC_NA
);
1339 fileinfoack_tree
= proto_item_add_subtree(ti
, ett_uftp_fileinfoack
);
1340 proto_tree_add_item(fileinfoack_tree
, hf_uftp_fileinfoack_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1342 proto_tree_add_uint_format_value(fileinfoack_tree
, hf_uftp_fileinfoack_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1344 proto_tree_add_item(fileinfoack_tree
, hf_uftp_fileinfoack_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1346 proto_tree_add_bitmask(fileinfoack_tree
, tvb
, offset
, hf_uftp_fileinfoack_flags
, ett_uftp_fileinfoack_flags
, fileinfoack_flags
, ENC_BIG_ENDIAN
);
1348 proto_tree_add_item(fileinfoack_tree
, hf_uftp_fileinfoack_reserved
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
1350 tstamp
= usec_to_nstime(tvb_get_ntoh64(tvb
, offset
));
1351 proto_tree_add_time(fileinfoack_tree
, hf_uftp_fileinfoack_tstamp
, tvb
, offset
, 8, &tstamp
);
1353 destcount
= (tvb_reported_length(tvb
) - hlen
) / 4;
1355 if (destcount
> 0) {
1356 destlist
= proto_tree_add_item(fileinfoack_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
1357 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
1359 for (idx
= 0; idx
< destcount
; idx
++) {
1360 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1365 static int dissect_uftp_tfmccdata(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1367 proto_item
*ti
= NULL
;
1368 proto_tree
*tfmccdata_tree
= NULL
;
1369 int offset
= 0, hlen
;
1370 unsigned rate
, srate
;
1372 if (tvb_reported_length(tvb
) < TFMCC_DATA_LEN
) {
1373 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1374 "Invalid length: %d", tvb_reported_length(tvb
));
1378 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1379 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< TFMCC_DATA_LEN
)) {
1380 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1381 "Invalid length, len = %d, hlen = %d",
1382 tvb_reported_length(tvb
), hlen
);
1386 rate
= unquantize_rate(tvb_get_ntohs(tvb
, 6));
1387 srate
= unquantize_rate(tvb_get_ntohs(tvb
, 2));
1389 ti
= proto_tree_add_item(tree
, hf_uftp_tfmccdata
, tvb
, offset
, TFMCC_DATA_LEN
, ENC_NA
);
1390 tfmccdata_tree
= proto_item_add_subtree(ti
, ett_uftp_tfmccdata
);
1391 proto_tree_add_item(tfmccdata_tree
, hf_uftp_tfmccdata_exttype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1393 proto_tree_add_uint_format_value(tfmccdata_tree
, hf_uftp_tfmccdata_extlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1395 proto_tree_add_uint(tfmccdata_tree
, hf_uftp_tfmccdata_send_rate
, tvb
, offset
, 2, srate
);
1397 proto_tree_add_item(tfmccdata_tree
, hf_uftp_tfmccdata_cc_seq
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1399 proto_tree_add_uint(tfmccdata_tree
, hf_uftp_tfmccdata_cc_rate
, tvb
, offset
, 2, rate
);
1401 return TFMCC_DATA_LEN
;
1404 static void dissect_uftp_fileseg(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
1406 proto_item
*ti
= NULL
;
1407 proto_tree
*fileseg_tree
= NULL
;
1408 int offset
= 0, hlen
, extlen_total
;
1409 uint16_t file_id
, section
, sec_block
;
1413 if (tvb_reported_length(tvb
) < FILESEG_LEN
) {
1414 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1415 "Invalid length: %d", tvb_reported_length(tvb
));
1419 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1420 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< FILESEG_LEN
)) {
1421 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1422 "Invalid length, len = %d, hlen = %d",
1423 tvb_reported_length(tvb
), hlen
);
1427 file_id
= tvb_get_ntohs(tvb
, 2);
1428 section
= tvb_get_ntohs(tvb
, 4);
1429 sec_block
= tvb_get_ntohs(tvb
, 6);
1430 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X Section=%d Block=%d",
1431 file_id
, section
, sec_block
);
1433 ti
= proto_tree_add_item(tree
, hf_uftp_fileseg
, tvb
, offset
, -1, ENC_NA
);
1434 fileseg_tree
= proto_item_add_subtree(ti
, ett_uftp_fileseg
);
1435 proto_tree_add_item(fileseg_tree
, hf_uftp_fileseg_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1437 proto_tree_add_uint_format_value(fileseg_tree
, hf_uftp_fileseg_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1439 proto_tree_add_item(fileseg_tree
, hf_uftp_fileseg_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1441 proto_tree_add_item(fileseg_tree
, hf_uftp_fileseg_section
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1443 proto_tree_add_item(fileseg_tree
, hf_uftp_fileseg_sec_block
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1446 extlen_total
= hlen
- FILESEG_LEN
;
1447 while (extlen_total
> 0) {
1450 next_tvb
= tvb_new_subset_length(tvb
, offset
, extlen_total
);
1451 ext_type
= tvb_get_uint8(tvb
, offset
);
1453 case EXT_TFMCC_DATA_INFO
:
1454 parsed
= dissect_uftp_tfmccdata(next_tvb
, pinfo
, fileseg_tree
);
1458 extlen_total
-= parsed
;
1463 proto_tree_add_item(fileseg_tree
, hf_uftp_fileseg_data
, tvb
, offset
, -1, ENC_NA
);
1466 static void dissect_uftp_done(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
1468 proto_item
*ti
= NULL
;
1469 proto_item
*destlist
= NULL
;
1470 proto_tree
*done_tree
= NULL
;
1471 proto_tree
*destlist_tree
= NULL
;
1472 int offset
= 0, hlen
;
1473 uint16_t file_id
, section
, destcount
, idx
;
1475 if (tvb_reported_length(tvb
) < DONE_LEN
) {
1476 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1477 "Invalid length: %d", tvb_reported_length(tvb
));
1481 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1482 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< DONE_LEN
)) {
1483 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1484 "Invalid length, len = %d, hlen = %d",
1485 tvb_reported_length(tvb
), hlen
);
1489 file_id
= tvb_get_ntohs(tvb
, 2);
1490 section
= tvb_get_ntohs(tvb
, 6);
1492 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X Section=%d",
1496 ti
= proto_tree_add_item(tree
, hf_uftp_done
, tvb
, offset
, -1, ENC_NA
);
1497 done_tree
= proto_item_add_subtree(ti
, ett_uftp_done
);
1498 proto_tree_add_item(done_tree
, hf_uftp_done_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1500 proto_tree_add_uint_format_value(done_tree
, hf_uftp_done_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1502 proto_tree_add_item(done_tree
, hf_uftp_done_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1504 proto_tree_add_item(done_tree
, hf_uftp_done_section
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1506 proto_tree_add_item(done_tree
, hf_uftp_done_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1508 destcount
= (tvb_reported_length(tvb
) - hlen
) / 4;
1510 if (destcount
> 0) {
1511 destlist
= proto_tree_add_item(done_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
1512 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
1514 for (idx
= 0; idx
< destcount
; idx
++) {
1515 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1520 static int dissect_uftp_tfmccack(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1522 proto_item
*ti
= NULL
;
1523 proto_tree
*tfmccack_tree
= NULL
;
1524 int offset
= 0, hlen
;
1528 if (tvb_reported_length(tvb
) < TFMCC_ACK_LEN
) {
1529 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1530 "Invalid length: %d", tvb_reported_length(tvb
));
1534 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1535 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< TFMCC_ACK_LEN
)) {
1536 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1537 "Invalid length, len = %d, hlen = %d",
1538 tvb_reported_length(tvb
), hlen
);
1542 rate
= unquantize_rate(tvb_get_ntohs(tvb
, 6));
1544 ti
= proto_tree_add_item(tree
, hf_uftp_tfmccack
, tvb
, offset
, TFMCC_ACK_LEN
, ENC_NA
);
1545 tfmccack_tree
= proto_item_add_subtree(ti
, ett_uftp_tfmccack
);
1546 proto_tree_add_item(tfmccack_tree
, hf_uftp_tfmccack_exttype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1548 proto_tree_add_uint_format_value(tfmccack_tree
, hf_uftp_tfmccack_extlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1550 proto_tree_add_bitmask(tfmccack_tree
, tvb
, offset
, hf_uftp_tfmccack_flags
, ett_uftp_tfmccack_flags
, tfmcc_ack_flags
, ENC_BIG_ENDIAN
);
1552 proto_tree_add_item(tfmccack_tree
, hf_uftp_tfmccack_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1554 proto_tree_add_item(tfmccack_tree
, hf_uftp_tfmccack_cc_seq
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1556 proto_tree_add_uint(tfmccack_tree
, hf_uftp_tfmccack_cc_rate
, tvb
, offset
, 2, rate
);
1558 proto_tree_add_item(tfmccack_tree
, hf_uftp_tfmccack_client_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1560 tstamp
= usec_to_nstime(tvb_get_ntoh64(tvb
, offset
));
1561 proto_tree_add_time(tfmccack_tree
, hf_uftp_tfmccack_tstamp
, tvb
, offset
, 8, &tstamp
);
1563 return TFMCC_ACK_LEN
;
1566 static void dissect_uftp_status(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
1568 proto_item
*ti
= NULL
;
1569 proto_tree
*status_tree
= NULL
;
1570 int offset
= 0, hlen
, extlen_total
;
1571 uint16_t file_id
, section
;
1575 if (tvb_reported_length(tvb
) < STATUS_LEN
) {
1576 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1577 "Invalid length: %d", tvb_reported_length(tvb
));
1581 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1582 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< STATUS_LEN
)) {
1583 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1584 "Invalid length, len = %d, hlen = %d",
1585 tvb_reported_length(tvb
), hlen
);
1589 file_id
= tvb_get_ntohs(tvb
, 2);
1590 section
= tvb_get_ntohs(tvb
, 4);
1591 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X Section=%d",
1594 ti
= proto_tree_add_item(tree
, hf_uftp_status
, tvb
, offset
, -1, ENC_NA
);
1595 status_tree
= proto_item_add_subtree(ti
, ett_uftp_status
);
1596 proto_tree_add_item(status_tree
, hf_uftp_status_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1598 proto_tree_add_uint_format_value(status_tree
, hf_uftp_status_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1600 proto_tree_add_item(status_tree
, hf_uftp_status_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1602 proto_tree_add_item(status_tree
, hf_uftp_status_section
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1604 proto_tree_add_item(status_tree
, hf_uftp_status_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1607 extlen_total
= hlen
- STATUS_LEN
;
1608 while (extlen_total
> 0) {
1611 next_tvb
= tvb_new_subset_length(tvb
, offset
, extlen_total
);
1612 ext_type
= tvb_get_uint8(tvb
, offset
);
1614 case EXT_TFMCC_ACK_INFO
:
1615 parsed
= dissect_uftp_tfmccack(next_tvb
, pinfo
, status_tree
);
1619 extlen_total
-= parsed
;
1624 proto_tree_add_item(status_tree
, hf_uftp_status_naks
, tvb
, offset
, -1, ENC_NA
);
1627 static int dissect_uftp_freespace(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1629 proto_item
*ti
= NULL
;
1630 proto_tree
*freespace_tree
= NULL
;
1631 int offset
= 0, hlen
;
1633 if (tvb_reported_length(tvb
) < FREESPACE_LEN
) {
1634 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1635 "Invalid length: %d", tvb_reported_length(tvb
));
1639 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1640 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< FREESPACE_LEN
)) {
1641 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1642 "Invalid length, len = %d, hlen = %d",
1643 tvb_reported_length(tvb
), hlen
);
1647 ti
= proto_tree_add_item(tree
, hf_uftp_freespace
, tvb
, offset
, FREESPACE_LEN
, ENC_NA
);
1648 freespace_tree
= proto_item_add_subtree(ti
, ett_uftp_freespace
);
1649 proto_tree_add_item(freespace_tree
, hf_uftp_freespace_exttype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1651 proto_tree_add_uint_format_value(freespace_tree
, hf_uftp_freespace_extlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1653 proto_tree_add_item(freespace_tree
, hf_uftp_freespace_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1655 proto_tree_add_item(freespace_tree
, hf_uftp_freespace_freespace
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1657 return FREESPACE_LEN
;
1660 static void dissect_uftp_complete(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
1662 proto_item
*ti
= NULL
;
1663 proto_item
*destlist
= NULL
;
1664 proto_tree
*complete_tree
= NULL
;
1665 proto_tree
*destlist_tree
= NULL
;
1666 int offset
= 0, hlen
, extlen_total
;
1667 uint16_t file_id
, destcount
, idx
;
1671 if (tvb_reported_length(tvb
) < COMPLETE_LEN
) {
1672 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1673 "Invalid length: %d", tvb_reported_length(tvb
));
1677 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1678 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< COMPLETE_LEN
)) {
1679 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1680 "Invalid length, len = %d, hlen = %d",
1681 tvb_reported_length(tvb
), hlen
);
1685 file_id
= tvb_get_ntohs(tvb
, 2);
1687 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X", file_id
);
1690 ti
= proto_tree_add_item(tree
, hf_uftp_complete
, tvb
, offset
, -1, ENC_NA
);
1691 complete_tree
= proto_item_add_subtree(ti
, ett_uftp_complete
);
1692 proto_tree_add_item(complete_tree
, hf_uftp_complete_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1694 proto_tree_add_uint_format_value(complete_tree
, hf_uftp_complete_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1696 proto_tree_add_item(complete_tree
, hf_uftp_complete_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1698 proto_tree_add_item(complete_tree
, hf_uftp_complete_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1700 proto_tree_add_item(complete_tree
, hf_uftp_complete_reserved
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
1703 extlen_total
= hlen
- COMPLETE_LEN
;
1704 while (extlen_total
> 0) {
1707 next_tvb
= tvb_new_subset_length(tvb
, offset
, extlen_total
);
1708 ext_type
= tvb_get_uint8(tvb
, offset
);
1710 case EXT_FREESPACE_INFO
:
1711 parsed
= dissect_uftp_freespace(next_tvb
, pinfo
, complete_tree
);
1715 extlen_total
-= parsed
;
1719 destcount
= (tvb_reported_length(tvb
) - hlen
) / 4;
1721 if (destcount
> 0) {
1722 destlist
= proto_tree_add_item(complete_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
1723 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
1725 for (idx
= 0; idx
< destcount
; idx
++) {
1726 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1731 static void dissect_uftp_doneconf(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1733 proto_item
*ti
= NULL
;
1734 proto_item
*destlist
= NULL
;
1735 proto_tree
*doneconf_tree
= NULL
;
1736 proto_tree
*destlist_tree
= NULL
;
1737 int offset
= 0, hlen
;
1738 uint16_t destcount
, idx
;
1740 if (tvb_reported_length(tvb
) < DONE_CONF_LEN
) {
1741 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1742 "Invalid length: %d", tvb_reported_length(tvb
));
1746 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1747 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< DONE_CONF_LEN
)) {
1748 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1749 "Invalid length, len = %d, hlen = %d",
1750 tvb_reported_length(tvb
), hlen
);
1754 ti
= proto_tree_add_item(tree
, hf_uftp_doneconf
, tvb
, offset
, -1, ENC_NA
);
1755 doneconf_tree
= proto_item_add_subtree(ti
, ett_uftp_doneconf
);
1756 proto_tree_add_item(doneconf_tree
, hf_uftp_doneconf_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1758 proto_tree_add_uint_format_value(doneconf_tree
, hf_uftp_doneconf_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1760 proto_tree_add_item(doneconf_tree
, hf_uftp_doneconf_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1762 destcount
= (tvb_reported_length(tvb
) - hlen
) / 4;
1764 if (destcount
> 0) {
1765 destlist
= proto_tree_add_item(doneconf_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
1766 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
1768 for (idx
= 0; idx
< destcount
; idx
++) {
1769 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1774 static void dissect_uftp_hbreq(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1776 proto_item
*ti
= NULL
;
1777 proto_tree
*hbreq_tree
= NULL
;
1778 int offset
= 0, hlen
;
1779 uint16_t keylen
, siglen
;
1783 if (tvb_reported_length(tvb
) < HB_REQ_LEN
) {
1784 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1785 "Invalid length: %d", tvb_reported_length(tvb
));
1789 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1790 keylen
= tvb_get_ntohs(tvb
, 4);
1791 siglen
= tvb_get_ntohs(tvb
, 6);
1792 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< HB_REQ_LEN
+ keylen
+ siglen
)) {
1793 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1794 "Invalid length, len = %d, hlen = %d, keylen=%d siglen=%d",
1795 tvb_reported_length(tvb
), hlen
, keylen
, siglen
);
1799 ti
= proto_tree_add_item(tree
, hf_uftp_hbreq
, tvb
, offset
, -1, ENC_NA
);
1800 hbreq_tree
= proto_item_add_subtree(ti
, ett_uftp_hbreq
);
1801 proto_tree_add_item(hbreq_tree
, hf_uftp_hbreq_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1803 proto_tree_add_uint_format_value(hbreq_tree
, hf_uftp_hbreq_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1805 proto_tree_add_item(hbreq_tree
, hf_uftp_hbreq_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1807 proto_tree_add_item(hbreq_tree
, hf_uftp_hbreq_bloblen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1809 proto_tree_add_item(hbreq_tree
, hf_uftp_hbreq_siglen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1811 proto_tree_add_item(hbreq_tree
, hf_uftp_hbreq_nonce
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1816 next_tvb
= tvb_new_subset_length(tvb
, offset
, keylen
);
1817 blobtype
= tvb_get_uint8(tvb
, offset
);
1820 parsed
= dissect_uftp_rsablob(next_tvb
, pinfo
, hbreq_tree
, hf_uftp_hbreq_keyblob
);
1823 parsed
= dissect_uftp_ecblob(next_tvb
, pinfo
, hbreq_tree
, hf_uftp_hbreq_keyblob
);
1829 proto_tree_add_item(hbreq_tree
, hf_uftp_hbreq_verify
, tvb
, offset
, siglen
, ENC_NA
);
1833 static void dissect_uftp_hbresp(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1835 proto_item
*ti
= NULL
;
1836 proto_tree
*hbresp_tree
= NULL
;
1837 int offset
= 0, hlen
;
1839 if (tvb_reported_length(tvb
) < HB_RESP_LEN
) {
1840 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1841 "Invalid length: %d", tvb_reported_length(tvb
));
1845 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1846 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< HB_RESP_LEN
)) {
1847 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1848 "Invalid length, len = %d, hlen = %d",
1849 tvb_reported_length(tvb
), hlen
);
1853 ti
= proto_tree_add_item(tree
, hf_uftp_hbresp
, tvb
, offset
, -1, ENC_NA
);
1854 hbresp_tree
= proto_item_add_subtree(ti
, ett_uftp_hbresp
);
1855 proto_tree_add_item(hbresp_tree
, hf_uftp_hbresp_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1857 proto_tree_add_uint_format_value(hbresp_tree
, hf_uftp_hbresp_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1859 proto_tree_add_item(hbresp_tree
, hf_uftp_hbresp_authenticated
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1861 proto_tree_add_item(hbresp_tree
, hf_uftp_hbresp_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1863 proto_tree_add_item(hbresp_tree
, hf_uftp_hbresp_nonce
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1866 static void dissect_uftp_proxykey(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1868 proto_item
*ti
= NULL
;
1869 proto_tree
*proxykey_tree
= NULL
;
1870 int offset
= 0, hlen
;
1871 uint16_t keylen
, dhlen
, siglen
;
1875 if (tvb_reported_length(tvb
) < PROXY_KEY_LEN
) {
1876 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1877 "Invalid length: %d", tvb_reported_length(tvb
));
1881 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1882 keylen
= tvb_get_ntohs(tvb
, 2);
1883 dhlen
= tvb_get_ntohs(tvb
, 4);
1884 siglen
= tvb_get_ntohs(tvb
, 6);
1885 if (((int)tvb_reported_length(tvb
) < hlen
) ||
1886 (hlen
< PROXY_KEY_LEN
+ keylen
+ dhlen
+ siglen
)) {
1887 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1888 "Invalid length, len = %d, hlen = %d, keylen=%d, dhlen=%d, siglen=%d",
1889 tvb_reported_length(tvb
), hlen
, keylen
, dhlen
, siglen
);
1893 ti
= proto_tree_add_item(tree
, hf_uftp_proxykey
, tvb
, offset
, -1, ENC_NA
);
1894 proxykey_tree
= proto_item_add_subtree(ti
, ett_uftp_proxykey
);
1895 proto_tree_add_item(proxykey_tree
, hf_uftp_proxykey_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1897 proto_tree_add_uint_format_value(proxykey_tree
, hf_uftp_proxykey_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1899 proto_tree_add_item(proxykey_tree
, hf_uftp_proxykey_bloblen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1901 proto_tree_add_item(proxykey_tree
, hf_uftp_proxykey_dhlen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1903 proto_tree_add_item(proxykey_tree
, hf_uftp_proxykey_siglen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1908 next_tvb
= tvb_new_subset_length(tvb
, offset
, keylen
);
1909 blobtype
= tvb_get_uint8(tvb
, offset
);
1912 parsed
= dissect_uftp_rsablob(next_tvb
, pinfo
, proxykey_tree
, hf_uftp_proxykey_keyblob
);
1915 parsed
= dissect_uftp_ecblob(next_tvb
, pinfo
, proxykey_tree
, hf_uftp_proxykey_keyblob
);
1923 next_tvb
= tvb_new_subset_length(tvb
, offset
, dhlen
);
1924 blobtype
= tvb_get_uint8(tvb
, offset
);
1927 parsed
= dissect_uftp_rsablob(next_tvb
, pinfo
, proxykey_tree
, hf_uftp_proxykey_dhblob
);
1930 parsed
= dissect_uftp_ecblob(next_tvb
, pinfo
, proxykey_tree
, hf_uftp_proxykey_dhblob
);
1936 proto_tree_add_item(proxykey_tree
, hf_uftp_proxykey_sig
, tvb
, offset
, siglen
, ENC_NA
);
1940 static void dissect_uftp_congctrl(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1942 proto_item
*ti
= NULL
;
1943 proto_item
*cclist
= NULL
;
1944 proto_item
*ccitem
= NULL
;
1945 proto_tree
*congctrl_tree
= NULL
;
1946 proto_tree
*cclist_tree
= NULL
;
1947 proto_tree
*ccitem_tree
= NULL
;
1948 int offset
= 0, hlen
;
1950 uint8_t itemcount
, idx
;
1953 if (tvb_reported_length(tvb
) < CONG_CTRL_LEN
) {
1954 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1955 "Invalid length: %d", tvb_reported_length(tvb
));
1959 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
1960 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< CONG_CTRL_LEN
)) {
1961 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1962 "Invalid length, len = %d, hlen = %d",
1963 tvb_reported_length(tvb
), hlen
);
1967 rate
= unquantize_rate(tvb_get_ntohs(tvb
, 6));
1969 ti
= proto_tree_add_item(tree
, hf_uftp_congctrl
, tvb
, offset
, -1, ENC_NA
);
1970 congctrl_tree
= proto_item_add_subtree(ti
, ett_uftp_congctrl
);
1971 proto_tree_add_item(congctrl_tree
, hf_uftp_congctrl_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1973 proto_tree_add_uint_format_value(congctrl_tree
, hf_uftp_congctrl_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
1975 proto_tree_add_item(congctrl_tree
, hf_uftp_congctrl_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1977 proto_tree_add_item(congctrl_tree
, hf_uftp_congctrl_cc_seq
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1979 proto_tree_add_uint(congctrl_tree
, hf_uftp_congctrl_cc_rate
, tvb
, offset
, 2, rate
);
1981 tstamp
= usec_to_nstime(tvb_get_ntoh64(tvb
, offset
));
1982 proto_tree_add_time(congctrl_tree
, hf_uftp_congctrl_tstamp
, tvb
, offset
, 8, &tstamp
);
1984 itemcount
= (tvb_reported_length(tvb
) - hlen
) / CC_ITEM_LEN
;
1986 if (itemcount
> 0) {
1987 cclist
= proto_tree_add_item(congctrl_tree
, hf_uftp_congctrl_cclist
, tvb
, offset
, itemcount
* CC_ITEM_LEN
, ENC_NA
);
1988 cclist_tree
= proto_item_add_subtree(cclist
, ett_uftp_congctrl_cclist
);
1990 for (idx
= 0; idx
< itemcount
; idx
++) {
1993 itemrtt
= unquantize_grtt(tvb_get_uint8(tvb
, offset
+ 5));
1994 itemrate
= unquantize_rate(tvb_get_ntohs(tvb
, offset
+ 6));
1996 ccitem
= proto_tree_add_item(cclist_tree
, hf_uftp_congctrl_item
, tvb
, offset
, CC_ITEM_LEN
, ENC_NA
);
1997 ccitem_tree
= proto_item_add_subtree(ccitem
, ett_uftp_congctrl_item
);
1998 proto_tree_add_item(ccitem_tree
, hf_uftp_congctrl_item_destid
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2000 proto_tree_add_bitmask(ccitem_tree
, tvb
, offset
, hf_uftp_congctrl_item_flags
, ett_uftp_congctrl_item_flags
, cc_item_flags
, ENC_BIG_ENDIAN
);
2002 proto_tree_add_double(ccitem_tree
, hf_uftp_congctrl_item_rtt
, tvb
, offset
, 1, itemrtt
);
2004 proto_tree_add_uint(ccitem_tree
, hf_uftp_congctrl_item_rate
, tvb
, offset
, 2, itemrate
);
2009 static void dissect_uftp_ccack(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
2011 proto_item
*ti
= NULL
;
2012 proto_tree
*ccack_tree
= NULL
;
2013 int offset
= 0, hlen
, extlen_total
;
2017 if (tvb_reported_length(tvb
) < CC_ACK_LEN
) {
2018 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
2019 "Invalid length: %d", tvb_reported_length(tvb
));
2023 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
2024 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< CC_ACK_LEN
)) {
2025 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
2026 "Invalid length, len = %d, hlen = %d",
2027 tvb_reported_length(tvb
), hlen
);
2031 ti
= proto_tree_add_item(tree
, hf_uftp_ccack
, tvb
, offset
, -1, ENC_NA
);
2032 ccack_tree
= proto_item_add_subtree(ti
, ett_uftp_ccack
);
2033 proto_tree_add_item(ccack_tree
, hf_uftp_ccack_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2035 proto_tree_add_uint_format_value(ccack_tree
, hf_uftp_ccack_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
2037 proto_tree_add_item(ccack_tree
, hf_uftp_ccack_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2040 extlen_total
= hlen
- CC_ACK_LEN
;
2041 while (extlen_total
> 0) {
2044 next_tvb
= tvb_new_subset_length(tvb
, offset
, extlen_total
);
2045 ext_type
= tvb_get_uint8(tvb
, offset
);
2047 case EXT_TFMCC_ACK_INFO
:
2048 parsed
= dissect_uftp_tfmccack(next_tvb
, pinfo
, ccack_tree
);
2052 extlen_total
-= parsed
;
2057 static void dissect_uftp_encrypted(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
2059 proto_item
*ti
= NULL
;
2060 proto_tree
*encrypted_tree
= NULL
;
2062 uint16_t payload_len
;
2064 if (tvb_reported_length(tvb
) < ENCRYPTED_LEN
) {
2065 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
2066 "Invalid length: %d", tvb_reported_length(tvb
));
2070 payload_len
= tvb_get_ntohs(tvb
, 10);
2071 if ((int)tvb_reported_length(tvb
) < ENCRYPTED_LEN
+ payload_len
) {
2072 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
2073 "Invalid length, len = %d, payload=%d",
2074 tvb_reported_length(tvb
), payload_len
);
2078 ti
= proto_tree_add_item(tree
, hf_uftp_encrypted
, tvb
, offset
, -1, ENC_NA
);
2079 encrypted_tree
= proto_item_add_subtree(ti
, ett_uftp_encrypted
);
2080 proto_tree_add_item(encrypted_tree
, hf_uftp_encrypted_ivctr
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
2082 proto_tree_add_item(encrypted_tree
, hf_uftp_encrypted_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2084 proto_tree_add_item(encrypted_tree
, hf_uftp_encrypted_payload_len
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2086 proto_tree_add_item(encrypted_tree
, hf_uftp_encrypted_payload
, tvb
, offset
, payload_len
, ENC_NA
);
2089 static void dissect_uftp_abort(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
2091 proto_item
*ti
= NULL
;
2092 proto_tree
*abort_tree
= NULL
;
2093 int offset
= 0, hlen
;
2095 if (tvb_reported_length(tvb
) < ABORT_LEN
) {
2096 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
2097 "Invalid length: %d", tvb_reported_length(tvb
));
2101 hlen
= (int)tvb_get_uint8(tvb
, 1) * 4;
2102 if (((int)tvb_reported_length(tvb
) < hlen
) || (hlen
< ABORT_LEN
)) {
2103 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
2104 "Invalid length, len = %d, hlen = %d",
2105 tvb_reported_length(tvb
), hlen
);
2109 ti
= proto_tree_add_item(tree
, hf_uftp_abort
, tvb
, offset
, -1, ENC_NA
);
2110 abort_tree
= proto_item_add_subtree(ti
, ett_uftp_abort
);
2111 proto_tree_add_item(abort_tree
, hf_uftp_abort_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2113 proto_tree_add_uint_format_value(abort_tree
, hf_uftp_abort_hlen
, tvb
, offset
, 1, hlen
, "%d bytes (%d)", hlen
, hlen
/4);
2115 proto_tree_add_bitmask(abort_tree
, tvb
, offset
, hf_uftp_abort_flags
, ett_uftp_abort_flags
, abort_flags
, ENC_BIG_ENDIAN
);
2117 proto_tree_add_item(abort_tree
, hf_uftp_abort_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2119 proto_tree_add_item(abort_tree
, hf_uftp_abort_clientid
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2121 proto_tree_add_item(abort_tree
, hf_uftp_abort_message
, tvb
, offset
, -1, ENC_ASCII
);
2124 static int dissect_uftp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
2130 proto_item
*ti
= NULL
;
2131 proto_tree
*uftp_tree
= NULL
;
2136 if (tvb_reported_length(tvb
) < UFTP_LEN
+ 4) {
2140 version
= tvb_get_uint8(tvb
, 0);
2141 mes_type
= tvb_get_uint8(tvb
, 1);
2142 group_id
= tvb_get_ntohl(tvb
, 8);
2144 if (version
!= UFTP_VER_NUM
) {
2148 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "UFTP");
2149 /* Clear out stuff in the info column */
2150 col_clear(pinfo
->cinfo
,COL_INFO
);
2151 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "%-12s",
2152 val_to_str(mes_type
, messages
, "Unknown (%d)"));
2153 if ((mes_type
!= HB_REQ
) && (mes_type
!= HB_RESP
)) {
2154 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " ID=%08X", group_id
);
2157 grtt
= unquantize_grtt(tvb_get_uint8(tvb
, 13));
2158 l_gsize
= unquantize_gsize(tvb_get_uint8(tvb
, 14));
2160 ti
= proto_tree_add_item(tree
, proto_uftp
, tvb
, 0, -1, ENC_NA
);
2161 uftp_tree
= proto_item_add_subtree(ti
, ett_uftp
);
2162 proto_tree_add_item(uftp_tree
, hf_uftp_version
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2164 proto_tree_add_item(uftp_tree
, hf_uftp_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2166 proto_tree_add_item(uftp_tree
, hf_uftp_seq
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2168 proto_tree_add_item(uftp_tree
, hf_uftp_src_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2170 proto_tree_add_item(uftp_tree
, hf_uftp_group_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2172 proto_tree_add_item(uftp_tree
, hf_uftp_group_inst
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2174 proto_tree_add_double(uftp_tree
, hf_uftp_grtt
, tvb
, offset
, 1, grtt
);
2176 proto_tree_add_uint(uftp_tree
, hf_uftp_gsize
, tvb
, offset
, 1, l_gsize
);
2178 proto_tree_add_item(uftp_tree
, hf_uftp_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2181 next_tvb
= tvb_new_subset_length(tvb
, offset
, tvb_reported_length(tvb
) - UFTP_LEN
);
2185 dissect_uftp_announce(next_tvb
, pinfo
, uftp_tree
);
2188 dissect_uftp_register(next_tvb
, pinfo
, uftp_tree
);
2191 dissect_uftp_clientkey(next_tvb
, pinfo
, uftp_tree
);
2194 dissect_uftp_regconf(next_tvb
, pinfo
, uftp_tree
);
2197 dissect_uftp_keyinfo(next_tvb
, pinfo
, uftp_tree
);
2200 dissect_uftp_keyinfoack(next_tvb
, pinfo
, uftp_tree
);
2203 dissect_uftp_fileinfo(next_tvb
, pinfo
, uftp_tree
);
2206 dissect_uftp_fileinfoack(next_tvb
, pinfo
, uftp_tree
);
2209 dissect_uftp_fileseg(next_tvb
, pinfo
, uftp_tree
);
2212 dissect_uftp_done(next_tvb
, pinfo
, uftp_tree
);
2215 dissect_uftp_status(next_tvb
, pinfo
, uftp_tree
);
2218 dissect_uftp_complete(next_tvb
, pinfo
, uftp_tree
);
2221 dissect_uftp_doneconf(next_tvb
, pinfo
, uftp_tree
);
2224 dissect_uftp_hbreq(next_tvb
, pinfo
, uftp_tree
);
2227 dissect_uftp_hbresp(next_tvb
, pinfo
, uftp_tree
);
2230 dissect_uftp_proxykey(next_tvb
, pinfo
, uftp_tree
);
2233 dissect_uftp_congctrl(next_tvb
, pinfo
, uftp_tree
);
2236 dissect_uftp_ccack(next_tvb
, pinfo
, uftp_tree
);
2239 dissect_uftp_encrypted(next_tvb
, pinfo
, uftp_tree
);
2242 dissect_uftp_abort(next_tvb
, pinfo
, uftp_tree
);
2245 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_func_unknown
, tvb
, offset
, -1,
2246 "Function unknown: %d", mes_type
);
2250 return tvb_reported_length(tvb
);
2253 void proto_register_uftp5(void)
2255 static hf_register_info hf
[] = {
2257 { "Protocol Version", "uftp5.version",
2258 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2261 { "Type", "uftp5.func",
2262 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2265 { "Sequence Number", "uftp5.seq",
2266 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2269 { "Source ID", "uftp5.src_id",
2270 FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2272 { &hf_uftp_group_id
,
2273 { "Group ID", "uftp5.group_id",
2274 FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2276 { &hf_uftp_group_inst
,
2277 { "Group Instance ID", "uftp5.group_inst",
2278 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2281 { "Group Round Trip Time", "uftp5.grtt",
2282 FT_DOUBLE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2285 { "Group Size", "uftp5.gsize",
2286 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2288 { &hf_uftp_reserved
,
2289 { "Reserved", "uftp5.reserved",
2290 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2292 { &hf_uftp_destlist
,
2293 { "Destination List", "uftp5.destlist",
2294 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2297 { "Destination", "uftp5.dest",
2298 FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2300 { &hf_uftp_announce
,
2301 { "ANNOUNCE", "uftp5.announce",
2302 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2304 { &hf_uftp_announce_func
,
2305 { "Type", "uftp5.announce.func",
2306 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2308 { &hf_uftp_announce_hlen
,
2309 { "Header Length", "uftp5.announce.hlen",
2310 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2312 { &hf_uftp_announce_flags
,
2313 { "Flags", "uftp5.announce.flags",
2314 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2316 { &hf_uftp_announce_flags_sync
,
2317 { "Sync mode", "uftp5.announce.flags.sync",
2318 FT_BOOLEAN
, 8, NULL
, FLAG_SYNC_MODE
, NULL
, HFILL
}
2320 { &hf_uftp_announce_flags_syncpreview
,
2321 { "Sync preview mode", "uftp5.announce.flags.syncpreview",
2322 FT_BOOLEAN
, 8, NULL
, FLAG_SYNC_PREVIEW
, NULL
, HFILL
}
2324 { &hf_uftp_announce_flags_ipv6
,
2325 { "IPv6", "uftp5.announce.flags.ipv6",
2326 FT_BOOLEAN
, 8, NULL
, FLAG_IPV6
, NULL
, HFILL
}
2328 { &hf_uftp_announce_flags_reserved
,
2329 { "Reserved", "uftp5.announce.flags.reserved",
2330 FT_UINT8
, BASE_HEX
, NULL
, FLAG_ANNOUNCE_RESERVED
, NULL
, HFILL
}
2332 { &hf_uftp_announce_robust
,
2333 { "Robustness Factor", "uftp5.announce.robust",
2334 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2336 { &hf_uftp_announce_cc_type
,
2337 { "Congestion Control Type", "uftp5.announce.cc_type",
2338 FT_UINT8
, BASE_DEC
, VALS(cc_types
), 0x0, NULL
, HFILL
}
2340 { &hf_uftp_announce_reserved
,
2341 { "Reserved", "uftp5.announce.reserved",
2342 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2344 { &hf_uftp_announce_blocksize
,
2345 { "Block Size", "uftp5.announce.blocksize",
2346 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2348 { &hf_uftp_announce_tstamp
,
2349 { "Timestamp", "uftp5.announce.tstamp",
2350 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_UTC
, NULL
, 0x0, NULL
, HFILL
}
2352 { &hf_uftp_announce_publicmcast_ipv4
,
2353 { "Public Multicast Address", "uftp5.announce.publicmcast.ipv4",
2354 FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2356 { &hf_uftp_announce_publicmcast_ipv6
,
2357 { "Public Multicast Address", "uftp5.announce.publicmcast.ipv6",
2358 FT_IPv6
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2360 { &hf_uftp_announce_privatemcast_ipv4
,
2361 { "Private Multicast Address", "uftp5.announce.privatemcast.ipv4",
2362 FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2364 { &hf_uftp_announce_privatemcast_ipv6
,
2365 { "Private Multicast Address", "uftp5.announce.privatemcast.ipv6",
2366 FT_IPv6
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2369 { "EXT_ENC_INFO", "uftp5.encinfo",
2370 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2372 { &hf_uftp_encinfo_exttype
,
2373 { "Extension Type", "uftp5.encinfo.exttype",
2374 FT_UINT8
, BASE_DEC
, VALS(extensions
), 0x0, NULL
, HFILL
}
2376 { &hf_uftp_encinfo_extlen
,
2377 { "Extension Length", "uftp5.encinfo.extlen",
2378 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2380 { &hf_uftp_encinfo_flags
,
2381 { "Flags", "uftp5.encinfo.flags",
2382 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2384 { &hf_uftp_encinfo_flags_client_auth
,
2385 { "Client Authorization", "uftp5.encinfo.flags.client_auth",
2386 FT_BOOLEAN
, 8, NULL
, FLAG_CLIENT_AUTH
, NULL
, HFILL
}
2388 { &hf_uftp_encinfo_flags_reserved
,
2389 { "Reserved", "uftp5.encinfo.flags.reserved",
2390 FT_UINT8
, BASE_HEX
, NULL
, FLAG_ENCINFO_RESERVED
, NULL
, HFILL
}
2392 { &hf_uftp_encinfo_reserved
,
2393 { "Reserved", "uftp5.encinfo.reserved",
2394 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2396 { &hf_uftp_encinfo_keytype
,
2397 { "Key Type", "uftp5.encinfo.keytype",
2398 FT_UINT8
, BASE_DEC
, VALS(key_types
), 0x0, NULL
, HFILL
}
2400 { &hf_uftp_encinfo_hashtype
,
2401 { "Hash Type", "uftp5.encinfo.hashtype",
2402 FT_UINT8
, BASE_DEC
, VALS(hash_types
), 0x0, NULL
, HFILL
}
2404 { &hf_uftp_encinfo_keylen
,
2405 { "Public Key Length", "uftp5.encinfo.keylen",
2406 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2408 { &hf_uftp_encinfo_dhlen
,
2409 { "Diffie-Hellman Key Length", "uftp5.encinfo.dhlen",
2410 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2412 { &hf_uftp_encinfo_siglen
,
2413 { "Signature Length", "uftp5.encinfo.siglen",
2414 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2416 { &hf_uftp_encinfo_rand1
,
2417 { "Server Random Number", "uftp5.encinfo.rand1",
2418 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2420 { &hf_uftp_encinfo_keyblob
,
2421 { "Public Key Blob", "uftp5.encinfo.keyblob",
2422 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2424 { &hf_uftp_encinfo_dhblob
,
2425 { "Diffie-Hellman Key Blob", "uftp5.encinfo.dhblob",
2426 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2428 { &hf_uftp_encinfo_sig
,
2429 { "Signature", "uftp5.encinfo.sig",
2430 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2432 { &hf_uftp_rsablob_blobtype
,
2433 { "Keyblob Type", "uftp5.rsablob.blobtype",
2434 FT_UINT8
, BASE_DEC
, VALS(keyblob_types
), 0x0, NULL
, HFILL
}
2436 { &hf_uftp_rsablob_reserved
,
2437 { "Reserved", "uftp5.rsablob.reserved",
2438 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2440 { &hf_uftp_rsablob_modlen
,
2441 { "Modulus Length", "uftp5.rsablob.modlen",
2442 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2444 { &hf_uftp_rsablob_exponent
,
2445 { "Exponent", "uftp5.rsablob.exponent",
2446 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2448 { &hf_uftp_rsablob_modulus
,
2449 { "Modulus", "uftp5.rsablob.modulus",
2450 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2452 { &hf_uftp_ecblob_blobtype
,
2453 { "Keyblob Type", "uftp5.ecblob.blobtype",
2454 FT_UINT8
, BASE_DEC
, VALS(keyblob_types
), 0x0, NULL
, HFILL
}
2456 { &hf_uftp_ecblob_curve
,
2457 { "Curve", "uftp5.ecblob.curve",
2458 FT_UINT8
, BASE_DEC
, VALS(curves
), 0x0, NULL
, HFILL
}
2460 { &hf_uftp_ecblob_keylen
,
2461 { "Key Length", "uftp5.ecblob.keylen",
2462 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2464 { &hf_uftp_ecblob_key
,
2465 { "Key", "uftp5.ecblob.key",
2466 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2468 { &hf_uftp_register
,
2469 { "REGISTER", "uftp5.register",
2470 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2472 { &hf_uftp_register_func
,
2473 { "Type", "uftp5.register.func",
2474 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2476 { &hf_uftp_register_hlen
,
2477 { "Header Length", "uftp5.register.hlen",
2478 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2480 { &hf_uftp_register_dhlen
,
2481 { "Key Info Length", "uftp5.register.dhlen",
2482 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2484 { &hf_uftp_register_tstamp
,
2485 { "Timestamp", "uftp5.register.tstamp",
2486 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_UTC
, NULL
, 0x0, NULL
, HFILL
}
2488 { &hf_uftp_register_rand2
,
2489 { "Client Random Number", "uftp5.register.rand2",
2490 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2492 { &hf_uftp_register_dhkey
,
2493 { "Key Info", "uftp5.register.dhkey",
2494 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2496 { &hf_uftp_clientkey
,
2497 { "CLIENT_KEY", "uftp5.clientkey",
2498 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2500 { &hf_uftp_clientkey_func
,
2501 { "Type", "uftp5.clientkey.func",
2502 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2504 { &hf_uftp_clientkey_hlen
,
2505 { "Header Length", "uftp5.clientkey.hlen",
2506 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2508 { &hf_uftp_clientkey_reserved
,
2509 { "Reserved", "uftp5.clientkey.reserved",
2510 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2512 { &hf_uftp_clientkey_bloblen
,
2513 { "Keyblob Length", "uftp5.clientkey.bloblen",
2514 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2516 { &hf_uftp_clientkey_siglen
,
2517 { "Signature Length", "uftp5.clientkey.siglen",
2518 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2520 { &hf_uftp_clientkey_keyblob
,
2521 { "Public Key Blob", "uftp5.clientkey.keyblob",
2522 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2524 { &hf_uftp_clientkey_verify
,
2525 { "Signature", "uftp5.clientkey.verify",
2526 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2529 { "REG_CONF", "uftp5.regconf",
2530 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2532 { &hf_uftp_regconf_func
,
2533 { "Type", "uftp5.regconf.func",
2534 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2536 { &hf_uftp_regconf_hlen
,
2537 { "Header Length", "uftp5.regconf.hlen",
2538 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2540 { &hf_uftp_regconf_reserved
,
2541 { "Reserved", "uftp5.regconf.reserved",
2542 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2545 { "KEYINFO", "uftp5.keyinfo",
2546 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2548 { &hf_uftp_keyinfo_func
,
2549 { "Type", "uftp5.keyinfo.func",
2550 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2552 { &hf_uftp_keyinfo_hlen
,
2553 { "Header Length", "uftp5.keyinfo.hlen",
2554 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2556 { &hf_uftp_keyinfo_siglen
,
2557 { "Signature Length", "uftp5.keyinfo.siglen",
2558 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2560 { &hf_uftp_keyinfo_ivctr
,
2561 { "IV Counter", "uftp5.keyinfo.ivctr",
2562 FT_UINT64
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2564 { &hf_uftp_keyinfo_sig
,
2565 { "signature", "uftp5.keyinfo.sig",
2566 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2568 { &hf_uftp_keyinfo_destkey
,
2569 { "Destination Key", "uftp5.keyinfo.destkey",
2570 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2572 { &hf_uftp_keyinfo_destid
,
2573 { "Destination ID", "uftp5.keyinfo.destid",
2574 FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2576 { &hf_uftp_keyinfo_groupmaster
,
2577 { "Encrypted Group Master", "uftp5.keyinfo.groupmaster",
2578 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2580 { &hf_uftp_keyinfoack
,
2581 { "KEYINFO_ACK", "uftp5.keyinfoack",
2582 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2584 { &hf_uftp_keyinfoack_func
,
2585 { "Type", "uftp5.keyinfoack.func",
2586 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2588 { &hf_uftp_keyinfoack_hlen
,
2589 { "Header Length", "uftp5.keyinfoack.hlen",
2590 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2592 { &hf_uftp_keyinfoack_verify_len
,
2593 { "Verify Data Length", "uftp5.keyinfoack.verify_len",
2594 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2596 { &hf_uftp_keyinfoack_verify_data
,
2597 { "Verify Data", "uftp5.keyinfoack.verify_data",
2598 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2600 { &hf_uftp_fileinfo
,
2601 { "FILEINFO", "uftp5.fileinfo",
2602 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2604 { &hf_uftp_fileinfo_func
,
2605 { "Type", "uftp5.fileinfo.func",
2606 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2608 { &hf_uftp_fileinfo_hlen
,
2609 { "Header Length", "uftp5.fileinfo.hlen",
2610 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2612 { &hf_uftp_fileinfo_file_id
,
2613 { "File ID", "uftp5.fileinfo.file_id",
2614 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2616 { &hf_uftp_fileinfo_ftype
,
2617 { "File Type", "uftp5.fileinfo.ftype",
2618 FT_UINT8
, BASE_DEC
, VALS(file_types
), 0x0, NULL
, HFILL
}
2620 { &hf_uftp_fileinfo_reserved
,
2621 { "Reserved", "uftp5.fileinfo.reserved",
2622 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2624 { &hf_uftp_fileinfo_ftstamp_hi
,
2625 { "File Timestamp (high order bytes)", "uftp5.fileinfo.ftstamp_hi",
2626 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2628 { &hf_uftp_fileinfo_namelen
,
2629 { "Name Length", "uftp5.fileinfo.namelen",
2630 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2632 { &hf_uftp_fileinfo_linklen
,
2633 { "Link Length", "uftp5.fileinfo.linklen",
2634 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2636 { &hf_uftp_fileinfo_fsize
,
2637 { "File Size", "uftp5.fileinfo.fsize",
2638 FT_UINT64
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2640 { &hf_uftp_fileinfo_ftstamp
,
2641 { "File Timestamp", "uftp5.fileinfo.ftstamp",
2642 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_UTC
, NULL
, 0x0, NULL
, HFILL
}
2644 { &hf_uftp_fileinfo_tstamp
,
2645 { "Timestamp", "uftp5.fileinfo.tstamp",
2646 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_UTC
, NULL
, 0x0, NULL
, HFILL
}
2648 { &hf_uftp_fileinfo_name
,
2649 { "File Name", "uftp5.fileinfo.name",
2650 FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2652 { &hf_uftp_fileinfo_link
,
2653 { "Link Name", "uftp5.fileinfo.link",
2654 FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2656 { &hf_uftp_fileinfoack
,
2657 { "FILEINFO_ACK", "uftp5.fileinfoack",
2658 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2660 { &hf_uftp_fileinfoack_func
,
2661 { "Type", "uftp5.fileinfoack.func",
2662 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2664 { &hf_uftp_fileinfoack_hlen
,
2665 { "Header Length", "uftp5.fileinfoack.hlen",
2666 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2668 { &hf_uftp_fileinfoack_file_id
,
2669 { "File ID", "uftp5.fileinfoack.file_id",
2670 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2672 { &hf_uftp_fileinfoack_flags
,
2673 { "Flags", "uftp5.fileinfoack.flags",
2674 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2676 { &hf_uftp_fileinfoack_flags_partial
,
2677 { "Partial", "uftp5.fileinfoack.flags.partial",
2678 FT_BOOLEAN
, 8, NULL
, FLAG_PARTIAL
, NULL
, HFILL
}
2680 { &hf_uftp_fileinfoack_flags_reserved
,
2681 { "Reserved", "uftp5.fileinfoack.flags.reserved",
2682 FT_UINT8
, BASE_HEX
, NULL
, FLAG_FILEINFOACK_RESERVED
, NULL
, HFILL
}
2684 { &hf_uftp_fileinfoack_reserved
,
2685 { "Reserved", "uftp5.fileinfoack.reserved",
2686 FT_UINT24
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2688 { &hf_uftp_fileinfoack_tstamp
,
2689 { "Timestamp", "uftp5.fileinfoack.tstamp",
2690 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_UTC
, NULL
, 0x0, NULL
, HFILL
}
2693 { "FILESEG", "uftp5.fileseg",
2694 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2696 { &hf_uftp_fileseg_func
,
2697 { "Type", "uftp5.fileseg.func",
2698 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2700 { &hf_uftp_fileseg_hlen
,
2701 { "Header Length", "uftp5.fileseg.hlen",
2702 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2704 { &hf_uftp_fileseg_file_id
,
2705 { "File ID", "uftp5.fileseg.file_id",
2706 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2708 { &hf_uftp_fileseg_section
,
2709 { "Section", "uftp5.fileseg.section",
2710 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2712 { &hf_uftp_fileseg_sec_block
,
2713 { "Block", "uftp5.fileseg.sec_block",
2714 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2716 { &hf_uftp_tfmccdata
,
2717 { "EXT_TFMCC_DATA_INFO", "uftp5.tfmccdata",
2718 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2720 { &hf_uftp_tfmccdata_exttype
,
2721 { "Extension Type", "uftp5.tfmccdata.exttype",
2722 FT_UINT8
, BASE_DEC
, VALS(extensions
), 0x0, NULL
, HFILL
}
2724 { &hf_uftp_tfmccdata_extlen
,
2725 { "Extension Length", "uftp5.tfmccdata.extlen",
2726 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2728 { &hf_uftp_tfmccdata_send_rate
,
2729 { "Send Rate", "uftp5.tfmccdata.send_rate",
2730 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2732 { &hf_uftp_tfmccdata_cc_seq
,
2733 { "CC Sequence Number", "uftp5.tfmccdata.cc_seq",
2734 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2736 { &hf_uftp_tfmccdata_cc_rate
,
2737 { "Rate", "uftp5.tfmccdata.cc_rate",
2738 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2740 { &hf_uftp_fileseg_data
,
2741 { "Data", "uftp5.fileseg.data",
2742 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2745 { "DONE", "uftp5.done",
2746 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2748 { &hf_uftp_done_func
,
2749 { "Type", "uftp5.done.func",
2750 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2752 { &hf_uftp_done_hlen
,
2753 { "Header Length", "uftp5.done.hlen",
2754 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2756 { &hf_uftp_done_file_id
,
2757 { "File ID", "uftp5.done.file_id",
2758 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2760 { &hf_uftp_done_section
,
2761 { "Section", "uftp5.done.section",
2762 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2764 { &hf_uftp_done_reserved
,
2765 { "Reserved", "uftp5.done.reserved",
2766 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2769 { "STATUS", "uftp5.status",
2770 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2772 { &hf_uftp_status_func
,
2773 { "Type", "uftp5.status.func",
2774 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2776 { &hf_uftp_status_hlen
,
2777 { "Header Length", "uftp5.status.hlen",
2778 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2780 { &hf_uftp_status_file_id
,
2781 { "File ID", "uftp5.status.file_id",
2782 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2784 { &hf_uftp_status_section
,
2785 { "Section", "uftp5.status.section",
2786 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2788 { &hf_uftp_status_reserved
,
2789 { "Reserved", "uftp5.status.reserved",
2790 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2792 { &hf_uftp_status_naks
,
2793 { "NAKs", "uftp5.status.naks",
2794 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2796 { &hf_uftp_complete
,
2797 { "COMPLETE", "uftp5.complete",
2798 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2800 { &hf_uftp_complete_func
,
2801 { "Type", "uftp5.complete.func",
2802 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2804 { &hf_uftp_complete_hlen
,
2805 { "Header Length", "uftp5.complete.hlen",
2806 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2808 { &hf_uftp_complete_file_id
,
2809 { "File ID", "uftp5.complete.file_id",
2810 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2812 { &hf_uftp_complete_status
,
2813 { "Completion Status", "uftp5.complete.status",
2814 FT_UINT8
, BASE_DEC
, VALS(comp_status
), 0x0, NULL
, HFILL
}
2816 { &hf_uftp_complete_reserved
,
2817 { "Reserved", "uftp5.complete.reserved",
2818 FT_UINT24
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2820 { &hf_uftp_freespace
,
2821 { "EXT_FREESPACE_INFO", "uftp5.freespace",
2822 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2824 { &hf_uftp_freespace_exttype
,
2825 { "Extension Type", "uftp5.freespace.exttype",
2826 FT_UINT8
, BASE_DEC
, VALS(extensions
), 0x0, NULL
, HFILL
}
2828 { &hf_uftp_freespace_extlen
,
2829 { "Extension Length", "uftp5.freespace.extlen",
2830 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2832 { &hf_uftp_freespace_reserved
,
2833 { "Reserved", "uftp5.freespace.reserved",
2834 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2836 { &hf_uftp_freespace_freespace
,
2837 { "Free Space", "uftp5.freespace.freespace",
2838 FT_UINT64
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2840 { &hf_uftp_doneconf
,
2841 { "DONE_CONF", "uftp5.doneconf",
2842 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2844 { &hf_uftp_doneconf_func
,
2845 { "Type", "uftp5.doneconf.func",
2846 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2848 { &hf_uftp_doneconf_hlen
,
2849 { "Header Length", "uftp5.doneconf.hlen",
2850 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2852 { &hf_uftp_doneconf_reserved
,
2853 { "Reserved", "uftp5.doneconf.reserved",
2854 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2857 { "HB_REQ", "uftp5.hbreq",
2858 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2860 { &hf_uftp_hbreq_func
,
2861 { "Type", "uftp5.hbreq.func",
2862 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2864 { &hf_uftp_hbreq_hlen
,
2865 { "Header Length", "uftp5.hbreq.hlen",
2866 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2868 { &hf_uftp_hbreq_reserved
,
2869 { "Reserved", "uftp5.hbreq.reserved",
2870 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2872 { &hf_uftp_hbreq_bloblen
,
2873 { "Keyblob Length", "uftp5.hbreq.bloblen",
2874 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2876 { &hf_uftp_hbreq_siglen
,
2877 { "Signature Length", "uftp5.hbreq.siglen",
2878 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2880 { &hf_uftp_hbreq_nonce
,
2881 { "Nonce", "uftp5.hbreq.nonce",
2882 FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2884 { &hf_uftp_hbreq_keyblob
,
2885 { "Public Key Blob", "uftp5.hbreq.keyblob",
2886 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2888 { &hf_uftp_hbreq_verify
,
2889 { "Signature", "uftp5.hbreq.verify",
2890 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2893 { "HB_RESP", "uftp5.hbresp",
2894 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2896 { &hf_uftp_hbresp_func
,
2897 { "Type", "uftp5.hbresp.func",
2898 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2900 { &hf_uftp_hbresp_hlen
,
2901 { "Header Length", "uftp5.hbresp.hlen",
2902 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2904 { &hf_uftp_hbresp_authenticated
,
2905 { "Authenticated", "uftp5.hbresp.authenticated",
2906 FT_UINT8
, BASE_DEC
, VALS(hb_auth_types
), 0x0, NULL
, HFILL
}
2908 { &hf_uftp_hbresp_reserved
,
2909 { "Reserved", "uftp5.hbresp.reserved",
2910 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2912 { &hf_uftp_hbresp_nonce
,
2913 { "Nonce", "uftp5.hbresp.nonce",
2914 FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2916 { &hf_uftp_proxykey
,
2917 { "PROXY_KEY", "uftp5.proxykey",
2918 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2920 { &hf_uftp_proxykey_func
,
2921 { "Type", "uftp5.proxykey.func",
2922 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2924 { &hf_uftp_proxykey_hlen
,
2925 { "Header Length", "uftp5.proxykey.hlen",
2926 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2928 { &hf_uftp_proxykey_bloblen
,
2929 { "Keyblob Length", "uftp5.proxykey.bloblen",
2930 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2932 { &hf_uftp_proxykey_dhlen
,
2933 { "Diffie-Hellman Keyblob Length", "uftp5.proxykey.dhlen",
2934 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2936 { &hf_uftp_proxykey_siglen
,
2937 { "Signature Length", "uftp5.proxykey.siglen",
2938 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2940 { &hf_uftp_proxykey_keyblob
,
2941 { "Public Key Blob", "uftp5.proxykey.keyblob",
2942 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2944 { &hf_uftp_proxykey_dhblob
,
2945 { "Diffie-Hellman Key Blob", "uftp5.proxykey.dhblob",
2946 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2948 { &hf_uftp_proxykey_sig
,
2949 { "Signature", "uftp5.proxykey.sig",
2950 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2952 { &hf_uftp_congctrl
,
2953 { "CONG_CTRL", "uftp5.congctrl",
2954 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2956 { &hf_uftp_congctrl_func
,
2957 { "Type", "uftp5.congctrl.func",
2958 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2960 { &hf_uftp_congctrl_hlen
,
2961 { "Header Length", "uftp5.congctrl.hlen",
2962 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2964 { &hf_uftp_congctrl_reserved
,
2965 { "Reserved", "uftp5.congctrl.reserved",
2966 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2968 { &hf_uftp_congctrl_cc_seq
,
2969 { "CC Sequence", "uftp5.congctrl.cc_seq",
2970 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2972 { &hf_uftp_congctrl_cc_rate
,
2973 { "Rate", "uftp5.congctrl.cc_rate",
2974 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2976 { &hf_uftp_congctrl_tstamp
,
2977 { "Timestamp", "uftp5.congctrl.tstamp",
2978 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_UTC
, NULL
, 0x0, NULL
, HFILL
}
2980 { &hf_uftp_congctrl_cclist
,
2981 { "Congestion Control List", "uftp5.congctrl.cclist",
2982 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2984 { &hf_uftp_congctrl_item
,
2985 { "Destination", "uftp5.congctrl.item",
2986 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2988 { &hf_uftp_congctrl_item_destid
,
2989 { "Destination ID", "uftp5.congctrl.item.destid",
2990 FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2992 { &hf_uftp_congctrl_item_flags
,
2993 { "Flags", "uftp5.congctrl.item.flags",
2994 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2996 { &hf_uftp_congctrl_item_flags_clr
,
2997 { "CLR", "uftp5.congctrl.item.flags.clr",
2998 FT_BOOLEAN
, 8, NULL
, FLAG_CC_CLR
, NULL
, HFILL
}
3000 { &hf_uftp_congctrl_item_flags_rtt
,
3001 { "RTT", "uftp5.congctrl.item.flags.rtt",
3002 FT_BOOLEAN
, 8, NULL
, FLAG_CC_RTT
, NULL
, HFILL
}
3004 { &hf_uftp_congctrl_item_flags_start
,
3005 { "Slowstart", "uftp5.congctrl.item.flags.start",
3006 FT_BOOLEAN
, 8, NULL
, FLAG_CC_START
, NULL
, HFILL
}
3008 { &hf_uftp_congctrl_item_flags_leave
,
3009 { "Leave", "uftp5.congctrl.item.flags.leave",
3010 FT_BOOLEAN
, 8, NULL
, FLAG_CC_LEAVE
, NULL
, HFILL
}
3012 { &hf_uftp_congctrl_item_flags_reserved
,
3013 { "Reserved", "uftp5.congctrl.item.flags.reserved",
3014 FT_UINT8
, BASE_HEX
, NULL
, FLAG_CC_RESERVED
, NULL
, HFILL
}
3016 { &hf_uftp_congctrl_item_rtt
,
3017 { "Round Trip Time", "uftp5.congctrl.item.rtt",
3018 FT_DOUBLE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
3020 { &hf_uftp_congctrl_item_rate
,
3021 { "Rate", "uftp5.congctrl.item.rate",
3022 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
3025 { "CC_ACK", "uftp5.ccack",
3026 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
3028 { &hf_uftp_ccack_func
,
3029 { "Type", "uftp5.ccack.func",
3030 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
3032 { &hf_uftp_ccack_hlen
,
3033 { "Header Length", "uftp5.ccack.hlen",
3034 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
3036 { &hf_uftp_ccack_reserved
,
3037 { "Reserved", "uftp5.ccack.reserved",
3038 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
3040 { &hf_uftp_tfmccack
,
3041 { "EXT_TFMCC_ACK_INFO", "uftp5.tfmccack",
3042 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
3044 { &hf_uftp_tfmccack_exttype
,
3045 { "Extension Type", "uftp5.tfmccack.exttype",
3046 FT_UINT8
, BASE_DEC
, VALS(extensions
), 0x0, NULL
, HFILL
}
3048 { &hf_uftp_tfmccack_extlen
,
3049 { "Extension Length", "uftp5.tfmccack.extlen",
3050 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
3052 { &hf_uftp_tfmccack_flags
,
3053 { "Flags", "uftp5.tfmccack.flags",
3054 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
3056 { &hf_uftp_tfmccack_flags_clr
,
3057 { "CLR", "uftp5.tfmccack.flags.clr",
3058 FT_BOOLEAN
, 8, NULL
, FLAG_CC_CLR
, NULL
, HFILL
}
3060 { &hf_uftp_tfmccack_flags_rtt
,
3061 { "RTT", "uftp5.tfmccack.flags.rtt",
3062 FT_BOOLEAN
, 8, NULL
, FLAG_CC_RTT
, NULL
, HFILL
}
3064 { &hf_uftp_tfmccack_flags_start
,
3065 { "Slowstart", "uftp5.tfmccack.flags.start",
3066 FT_BOOLEAN
, 8, NULL
, FLAG_CC_START
, NULL
, HFILL
}
3068 { &hf_uftp_tfmccack_flags_leave
,
3069 { "Leave", "uftp5.tfmccack.flags.leave",
3070 FT_BOOLEAN
, 8, NULL
, FLAG_CC_LEAVE
, NULL
, HFILL
}
3072 { &hf_uftp_tfmccack_flags_reserved
,
3073 { "Reserved", "uftp5.tfmccack.flags.reserved",
3074 FT_UINT8
, BASE_HEX
, NULL
, FLAG_CC_RESERVED
, NULL
, HFILL
}
3076 { &hf_uftp_tfmccack_reserved
,
3077 { "Reserved", "uftp5.tfmccack.reserved",
3078 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
3080 { &hf_uftp_tfmccack_cc_seq
,
3081 { "CC Sequence Number", "uftp5.tfmccack.cc_seq",
3082 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
3084 { &hf_uftp_tfmccack_cc_rate
,
3085 { "Rate", "uftp5.tfmccack.cc_rate",
3086 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
3088 { &hf_uftp_tfmccack_client_id
,
3089 { "Client ID", "uftp5.tfmccack.client_id",
3090 FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
3092 { &hf_uftp_tfmccack_tstamp
,
3093 { "Timestamp", "uftp5.tfmccack.tstamp",
3094 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_UTC
, NULL
, 0x0, NULL
, HFILL
}
3096 { &hf_uftp_encrypted
,
3097 { "ENCRYPTED", "uftp5.encrypted",
3098 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
3100 { &hf_uftp_encrypted_ivctr
,
3101 { "IV Counter", "uftp5.encrypted.ivctr",
3102 FT_UINT64
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
3104 { &hf_uftp_encrypted_reserved
,
3105 { "Reserved", "uftp5.encrypted.reserved",
3106 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
3108 { &hf_uftp_encrypted_payload_len
,
3109 { "Payload Length", "uftp5.encrypted.payload_len",
3110 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
3112 { &hf_uftp_encrypted_payload
,
3113 { "Encrypted Payload", "uftp5.encrypted.payload",
3114 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
3117 { "ABORT", "uftp5.abort",
3118 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
3120 { &hf_uftp_abort_func
,
3121 { "Type", "uftp5.abort.func",
3122 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
3124 { &hf_uftp_abort_hlen
,
3125 { "Header Length", "uftp5.abort.hlen",
3126 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
3128 { &hf_uftp_abort_flags
,
3129 { "Flags", "uftp5.abort.flags",
3130 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
3132 { &hf_uftp_abort_flags_curfile
,
3133 { "Current file", "uftp5.abort.flags.curfile",
3134 FT_BOOLEAN
, 8, NULL
, FLAG_CURRENT_FILE
, NULL
, HFILL
}
3136 { &hf_uftp_abort_flags_reserved
,
3137 { "Reserved", "uftp5.abort.flags.reserved",
3138 FT_UINT8
, BASE_HEX
, NULL
, FLAG_ABORT_RESERVED
, NULL
, HFILL
}
3140 { &hf_uftp_abort_reserved
,
3141 { "Reserved", "uftp5.abort.reserved",
3142 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
3144 { &hf_uftp_abort_clientid
,
3145 { "Client ID", "uftp5.abort.clientid",
3146 FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
3148 { &hf_uftp_abort_message
,
3149 { "Message", "uftp5.abort.message",
3150 FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
3154 /* Setup protocol subtree array */
3155 static int *ett
[] = {
3160 &ett_uftp_clientkey
,
3163 &ett_uftp_keyinfo_destkey
,
3164 &ett_uftp_keyinfoack
,
3166 &ett_uftp_fileinfoack
,
3168 &ett_uftp_tfmccdata
,
3172 &ett_uftp_freespace
,
3178 &ett_uftp_congctrl_cclist
,
3179 &ett_uftp_congctrl_item
,
3182 &ett_uftp_encrypted
,
3184 &ett_uftp_announce_flags
,
3185 &ett_uftp_encinfo_flags
,
3186 &ett_uftp_fileinfoack_flags
,
3187 &ett_uftp_abort_flags
,
3188 &ett_uftp_congctrl_item_flags
,
3189 &ett_uftp_tfmccack_flags
,
3195 static ei_register_info ei
[] = {
3196 { &ei_uftp_length_invalid
, { "uftp5.length.invalid", PI_MALFORMED
, PI_ERROR
, "Length is invalid", EXPFILL
}},
3197 { &ei_uftp_func_unknown
, { "uftp5.func.invalid", PI_MALFORMED
, PI_ERROR
, "Unknown function", EXPFILL
}}
3200 expert_module_t
* expert_uftp
;
3202 proto_uftp
= proto_register_protocol("UDP based FTP w/ multicast V5",
3204 proto_register_field_array(proto_uftp
, hf
, array_length(hf
));
3205 proto_register_subtree_array(ett
, array_length(ett
));
3206 register_dissector("uftp5", dissect_uftp
, proto_uftp
);
3207 expert_uftp
= expert_register_protocol(proto_uftp
);
3208 expert_register_field_array(expert_uftp
, ei
, array_length(ei
));
3212 * Editor modelines - https://www.wireshark.org/tools/modelines.html
3217 * indent-tabs-mode: nil
3220 * vi: set shiftwidth=4 tabstop=8 expandtab:
3221 * :indentSize=4:tabSize=8:noTabs=true: