2 * Routines for UFTP 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>
17 #define UFTP_VER_NUM 0x31
18 #define UFTP_3_0_VER 0x30
41 #define MAXFILENAME 100
42 #define MAXDIRNAME 200
43 #define MAXPATHNAME 300
44 #define MAXPROXYDEST 1000
46 #define DESTNAME_LEN 100
49 #define MAX_INTERFACES 20
58 #define KEY_DES_EDE3 0x02
59 #define KEY_AES128 0x03
60 #define KEY_AES256 0x04
62 #define HASH_NONE 0x00
64 #define HASH_SHA1 0x02
65 #define HASH_SHA256 0x03
71 #define FLAG_RESTART 0x01
72 #define FLAG_SYNC_MODE 0x02
73 #define FLAG_SYNC_PREVIEW 0x04
74 #define FLAG_ANNOUNCE_RESERVED 0xF8
76 #define FLAG_PARTIAL 0x01
77 #define FLAG_INFOACK_RESERVED 0xFE
79 #define FLAG_CURRENT_FILE 0x01
80 #define FLAG_ABORT_RESERVED 0xFE
82 #define COMP_STAT_NORMAL 0
83 #define COMP_STAT_SKIPPED 1
84 #define COMP_STAT_OVERWRITE 2
85 #define COMP_STAT_REJECTED 3
87 #define HB_AUTH_FAILED 0
89 #define HB_AUTH_CHALLENGE 2
91 #define PUBKEY_LEN 256 /* big enough for RSA-2048 */
92 #define RAND_LEN 32 /* rfc 5246 */
93 #define HMAC_LEN 32 /* big enough for SHA-256 */
94 #define VERIFY_LEN 12 /* rfc 5246 */
95 #define MASTER_LEN 48 /* rfc 5246 */
96 #define MAXIV 16 /* big enough for AES256 */
97 #define MAXKEY 32 /* big enough for AES256 */
98 #define KEYBLSIZE 16 /* Maximum symetric key blocksize */
99 #define DEF_RSA_LEN 512 /* Default length of generated RSA keys */
100 #define RSA_EXP 65537 /* Public key exponent of generated RSA keys */
103 #define ANNOUNCE_LEN 64
104 #define REGISTER_LEN 40
105 #define CLIENT_KEY_LEN 12
106 #define REG_CONF_LEN 4
107 #define FILEINFO_LEN 324
108 #define FILEINFO_30_LEN 320
109 #define KEYINFO_LEN 12
110 #define DESTKEY_LEN 52
111 #define INFO_ACK_LEN 20
112 #define FILESEG_LEN 12
114 #define STATUS_LEN 12
115 #define PRSTATUS_LEN 12
116 #define COMPLETE_LEN 8
117 #define DONE_CONF_LEN 8
118 #define HB_REQ_LEN 16
119 #define HB_RESP_LEN 8
120 #define KEY_REQ_LEN 4
121 #define PROXY_KEY_LEN 16
122 #define ENCRYPTED_LEN 12
123 #define ABORT_LEN 308
125 void proto_register_uftp(void);
126 void proto_reg_handoff_uftp(void);
128 static dissector_handle_t uftp_handle
;
130 static int proto_uftp
;
131 #define UFTP_PORT 1044 /* Not IANA registered */
133 /* main header and common fields */
134 static int hf_uftp_version
;
135 static int hf_uftp_func
;
136 static int hf_uftp_blsize
;
137 static int hf_uftp_group_id
;
138 static int hf_uftp_srcaddr
;
139 static int hf_uftp_destaddr
;
141 static int hf_uftp_destlist
;
142 static int hf_uftp_dest
;
144 /* ANNOUNCE fields */
145 static int hf_uftp_announce
;
146 static int hf_uftp_announce_func
;
147 static int hf_uftp_announce_flags
;
148 static int hf_uftp_announce_flags_restart
;
149 static int hf_uftp_announce_flags_sync
;
150 static int hf_uftp_announce_flags_syncpreview
;
151 static int hf_uftp_announce_flags_reserved
;
152 static int hf_uftp_announce_destcount
;
153 static int hf_uftp_announce_announce_int
;
154 static int hf_uftp_announce_status_int
;
155 static int hf_uftp_announce_register_int
;
156 static int hf_uftp_announce_done_int
;
157 static int hf_uftp_announce_announce_time
;
158 static int hf_uftp_announce_status_time
;
159 static int hf_uftp_announce_mtu
;
160 static int hf_uftp_announce_privatemcast
;
161 static int hf_uftp_announce_client_auth
;
162 static int hf_uftp_announce_sigtype
;
163 static int hf_uftp_announce_hashtype
;
164 static int hf_uftp_announce_keytype
;
165 static int hf_uftp_announce_keylen
;
166 static int hf_uftp_announce_reserved
;
167 static int hf_uftp_announce_keyexp
;
168 static int hf_uftp_announce_rand1
;
169 static int hf_uftp_announce_keymod
;
171 /* REGISTER fields */
172 static int hf_uftp_register
;
173 static int hf_uftp_register_func
;
174 static int hf_uftp_register_reserved
;
175 static int hf_uftp_register_destcount
;
176 static int hf_uftp_register_premaster_len
;
177 static int hf_uftp_register_rand2
;
178 static int hf_uftp_register_premaster
;
180 /* CLIENT_KEY fields */
181 static int hf_uftp_clientkey
;
182 static int hf_uftp_clientkey_func
;
183 static int hf_uftp_clientkey_reserved
;
184 static int hf_uftp_clientkey_keylen
;
185 static int hf_uftp_clientkey_verifylen
;
186 static int hf_uftp_clientkey_keyexp
;
187 static int hf_uftp_clientkey_keymod
;
188 static int hf_uftp_clientkey_verify
;
190 /* REG_CONF fields */
191 static int hf_uftp_regconf
;
192 static int hf_uftp_regconf_func
;
193 static int hf_uftp_regconf_reserved
;
194 static int hf_uftp_regconf_destcount
;
196 /* FILEINFO fields */
197 static int hf_uftp_fileinfo
;
198 static int hf_uftp_fileinfo_func
;
199 static int hf_uftp_fileinfo_ftype
;
200 static int hf_uftp_fileinfo_file_id
;
201 static int hf_uftp_fileinfo_block_total
;
202 static int hf_uftp_fileinfo_section_total
;
203 static int hf_uftp_fileinfo_destcount
;
204 static int hf_uftp_fileinfo_fsize
;
205 static int hf_uftp_fileinfo_ftstamp
;
206 static int hf_uftp_fileinfo_name
;
209 static int hf_uftp_keyinfo
;
210 static int hf_uftp_keyinfo_func
;
211 static int hf_uftp_keyinfo_reserved
;
212 static int hf_uftp_keyinfo_destcount
;
213 static int hf_uftp_keyinfo_groupmaster_len
;
214 static int hf_uftp_keyinfo_tstamp
;
215 static int hf_uftp_keyinfo_destkey
;
216 static int hf_uftp_keyinfo_destaddr
;
217 static int hf_uftp_keyinfo_groupmaster
;
219 /* INFO_ACK fields */
220 static int hf_uftp_infoack
;
221 static int hf_uftp_infoack_func
;
222 static int hf_uftp_infoack_flags
;
223 static int hf_uftp_infoack_flags_partial
;
224 static int hf_uftp_infoack_flags_reserved
;
225 static int hf_uftp_infoack_file_id
;
226 static int hf_uftp_infoack_destcount
;
227 static int hf_uftp_infoack_reserved
;
228 static int hf_uftp_infoack_verify_data
;
231 static int hf_uftp_fileseg
;
232 static int hf_uftp_fileseg_func
;
233 static int hf_uftp_fileseg_reserved1
;
234 static int hf_uftp_fileseg_file_id
;
235 static int hf_uftp_fileseg_pass
;
236 static int hf_uftp_fileseg_reserved2
;
237 static int hf_uftp_fileseg_section
;
238 static int hf_uftp_fileseg_seq_num
;
239 static int hf_uftp_fileseg_data
;
242 static int hf_uftp_done
;
243 static int hf_uftp_done_func
;
244 static int hf_uftp_done_pass
;
245 static int hf_uftp_done_section
;
246 static int hf_uftp_done_file_id
;
247 static int hf_uftp_done_destcount
;
250 static int hf_uftp_status
;
251 static int hf_uftp_status_func
;
252 static int hf_uftp_status_reserved
;
253 static int hf_uftp_status_file_id
;
254 static int hf_uftp_status_pass
;
255 static int hf_uftp_status_seq
;
256 static int hf_uftp_status_section
;
257 static int hf_uftp_status_nak_count
;
258 static int hf_uftp_status_naks
;
260 /* PRSTATUS fields */
261 static int hf_uftp_prstatus
;
262 static int hf_uftp_prstatus_func
;
263 static int hf_uftp_prstatus_reserved1
;
264 static int hf_uftp_prstatus_file_id
;
265 static int hf_uftp_prstatus_pass
;
266 static int hf_uftp_prstatus_seq
;
267 static int hf_uftp_prstatus_section
;
268 static int hf_uftp_prstatus_destcount
;
269 static int hf_uftp_prstatus_reserved2
;
271 /* COMPLETE fields */
272 static int hf_uftp_complete
;
273 static int hf_uftp_complete_func
;
274 static int hf_uftp_complete_status
;
275 static int hf_uftp_complete_file_id
;
276 static int hf_uftp_complete_destcount
;
277 static int hf_uftp_complete_reserved2
;
279 /* DONE_CONF fields */
280 static int hf_uftp_doneconf
;
281 static int hf_uftp_doneconf_func
;
282 static int hf_uftp_doneconf_reserved1
;
283 static int hf_uftp_doneconf_file_id
;
284 static int hf_uftp_doneconf_destcount
;
285 static int hf_uftp_doneconf_reserved2
;
288 static int hf_uftp_hbreq
;
289 static int hf_uftp_hbreq_func
;
290 static int hf_uftp_hbreq_reserved
;
291 static int hf_uftp_hbreq_nonce
;
292 static int hf_uftp_hbreq_keylen
;
293 static int hf_uftp_hbreq_siglen
;
294 static int hf_uftp_hbreq_keyexp
;
295 static int hf_uftp_hbreq_keymod
;
296 static int hf_uftp_hbreq_verify
;
299 static int hf_uftp_hbresp
;
300 static int hf_uftp_hbresp_func
;
301 static int hf_uftp_hbresp_authenticated
;
302 static int hf_uftp_hbresp_reserved
;
303 static int hf_uftp_hbresp_nonce
;
306 static int hf_uftp_keyreq
;
307 static int hf_uftp_keyreq_func
;
308 static int hf_uftp_keyreq_reserved
;
310 /* PROXY_KEY fields */
311 static int hf_uftp_proxykey
;
312 static int hf_uftp_proxykey_func
;
313 static int hf_uftp_proxykey_reserved
;
314 static int hf_uftp_proxykey_nonce
;
315 static int hf_uftp_proxykey_keylen
;
316 static int hf_uftp_proxykey_siglen
;
317 static int hf_uftp_proxykey_keyexp
;
318 static int hf_uftp_proxykey_keymod
;
319 static int hf_uftp_proxykey_verify
;
321 /* ENCRYPTED fields */
322 static int hf_uftp_encrypted
;
323 static int hf_uftp_encrypted_tstamp
;
324 static int hf_uftp_encrypted_sig_len
;
325 static int hf_uftp_encrypted_payload_len
;
326 static int hf_uftp_encrypted_signature
;
327 static int hf_uftp_encrypted_payload
;
330 static int hf_uftp_abort
;
331 static int hf_uftp_abort_func
;
332 static int hf_uftp_abort_flags
;
333 static int hf_uftp_abort_flags_curfile
;
334 static int hf_uftp_abort_flags_reserved
;
335 static int hf_uftp_abort_reserved
;
336 static int hf_uftp_abort_host
;
337 static int hf_uftp_abort_message
;
340 static int ett_uftp_announce
;
341 static int ett_uftp_register
;
342 static int ett_uftp_clientkey
;
343 static int ett_uftp_regconf
;
344 static int ett_uftp_fileinfo
;
345 static int ett_uftp_keyinfo
;
346 static int ett_uftp_infoack
;
347 static int ett_uftp_fileseg
;
348 static int ett_uftp_done
;
349 static int ett_uftp_status
;
350 static int ett_uftp_prstatus
;
351 static int ett_uftp_complete
;
352 static int ett_uftp_doneconf
;
353 static int ett_uftp_hbreq
;
354 static int ett_uftp_hbresp
;
355 static int ett_uftp_keyreq
;
356 static int ett_uftp_proxykey
;
357 static int ett_uftp_encrypted
;
358 static int ett_uftp_abort
;
360 static int ett_uftp_announce_flags
;
361 static int ett_uftp_keyinfo_destkey
;
362 static int ett_uftp_infoack_flags
;
363 static int ett_uftp_abort_flags
;
365 static int ett_uftp_destlist
;
367 static expert_field ei_uftp_length_invalid
;
368 static expert_field ei_uftp_func_unknown
;
370 static dissector_handle_t uftp4_handle
;
371 static dissector_handle_t uftp5_handle
;
373 static const value_string messages
[] = {
374 { ANNOUNCE
, "ANNOUNCE" },
375 { REGISTER
, "REGISTER" },
376 { CLIENT_KEY
, "CLIENT_KEY" },
377 { REG_CONF
, "REG_CONF" },
378 { FILEINFO
, "FILEINFO" },
379 { KEYINFO
, "KEYINFO" },
380 { INFO_ACK
, "INFO_ACK" },
381 { FILESEG
, "FILESEG" },
383 { STATUS
, "STATUS" },
384 { PRSTATUS
, "PRSTATUS" },
385 { COMPLETE
, "COMPLETE" },
386 { DONE_CONF
, "DONE_CONF" },
387 { HB_REQ
, "HB_REQ" },
388 { HB_RESP
, "HB_RESP" },
389 { KEY_REQ
, "KEY_REQ" },
390 { PROXY_KEY
, "PROXY_KEY" },
391 { ENCRYPTED
, "ENCRYPTED" },
396 static const value_string signature_types
[] = {
397 { SIG_NONE
, "NONE" },
398 { SIG_HMAC
, "HMAC" },
403 static const value_string hash_types
[] = {
404 { HASH_NONE
, "NONE" },
406 { HASH_SHA1
, "SHA-1" },
407 { HASH_SHA256
, "SHA-256" },
411 static const value_string key_types
[] = {
412 { KEY_NONE
, "NONE" },
414 { KEY_DES_EDE3
, "3 Key Triple DES" },
415 { KEY_AES128
, "AES-128" },
416 { KEY_AES256
, "AES-256" },
420 static const value_string hb_auth_types
[] = {
421 { HB_AUTH_FAILED
, "Authorization Failed" },
422 { HB_AUTH_OK
, "Authorization Succeeded" },
423 { HB_AUTH_CHALLENGE
, "Authorization Required" },
427 static const value_string file_types
[] = {
428 { FTYPE_REG
, "Regular file" },
429 { FTYPE_DIR
, "Directory" },
430 { FTYPE_LINK
, "Symbolic link" },
434 static int * const announce_flags
[] = {
435 &hf_uftp_announce_flags_restart
,
436 &hf_uftp_announce_flags_sync
,
437 &hf_uftp_announce_flags_syncpreview
,
438 &hf_uftp_announce_flags_reserved
,
442 static int * const infoack_flags
[] = {
443 &hf_uftp_infoack_flags_partial
,
444 &hf_uftp_infoack_flags_reserved
,
448 static int * const abort_flags
[] = {
449 &hf_uftp_abort_flags_curfile
,
450 &hf_uftp_abort_flags_reserved
,
454 static const value_string comp_status
[] = {
455 { COMP_STAT_NORMAL
, "Normal" },
456 { COMP_STAT_SKIPPED
, "Skipped" },
457 { COMP_STAT_OVERWRITE
, "Overwrite" },
458 { COMP_STAT_REJECTED
, "Rejected" },
462 static void dissect_uftp_announce(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
464 proto_item
*ti
= NULL
;
465 proto_item
*destlist
= NULL
;
466 proto_tree
*announce_tree
= NULL
;
467 proto_tree
*destlist_tree
= NULL
;
469 uint16_t destcount
, keylen
, idx
;
471 if (tvb_reported_length(tvb
) < ANNOUNCE_LEN
) {
472 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
473 "Invalid length: %d", tvb_reported_length(tvb
));
477 destcount
= tvb_get_ntohs(tvb
, 2);
478 keylen
= tvb_get_ntohs(tvb
, 24);
479 if ((int)tvb_reported_length(tvb
) < ANNOUNCE_LEN
+ keylen
+ (destcount
* 4)) {
480 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
481 "Invalid length, len = %d, keylen = %d, count=%d",
482 tvb_reported_length(tvb
), keylen
, destcount
);
486 ti
= proto_tree_add_item(tree
, hf_uftp_announce
, tvb
, offset
, -1, ENC_NA
);
487 announce_tree
= proto_item_add_subtree(ti
, ett_uftp_announce
);
488 proto_tree_add_item(announce_tree
, hf_uftp_announce_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
490 proto_tree_add_bitmask(announce_tree
, tvb
, offset
, hf_uftp_announce_flags
, ett_uftp_announce_flags
, announce_flags
, ENC_BIG_ENDIAN
);
492 proto_tree_add_item(announce_tree
, hf_uftp_announce_destcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
494 proto_tree_add_item(announce_tree
, hf_uftp_announce_announce_int
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
496 proto_tree_add_item(announce_tree
, hf_uftp_announce_status_int
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
498 proto_tree_add_item(announce_tree
, hf_uftp_announce_register_int
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
500 proto_tree_add_item(announce_tree
, hf_uftp_announce_done_int
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
502 proto_tree_add_item(announce_tree
, hf_uftp_announce_announce_time
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
504 proto_tree_add_item(announce_tree
, hf_uftp_announce_status_time
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
506 proto_tree_add_item(announce_tree
, hf_uftp_announce_mtu
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
508 proto_tree_add_item(announce_tree
, hf_uftp_announce_privatemcast
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
510 proto_tree_add_item(announce_tree
, hf_uftp_announce_client_auth
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
512 proto_tree_add_item(announce_tree
, hf_uftp_announce_sigtype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
514 proto_tree_add_item(announce_tree
, hf_uftp_announce_hashtype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
516 proto_tree_add_item(announce_tree
, hf_uftp_announce_keytype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
518 proto_tree_add_item(announce_tree
, hf_uftp_announce_keylen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
520 proto_tree_add_item(announce_tree
, hf_uftp_announce_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
522 proto_tree_add_item(announce_tree
, hf_uftp_announce_keyexp
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
524 proto_tree_add_item(announce_tree
, hf_uftp_announce_rand1
, tvb
, offset
, RAND_LEN
, ENC_NA
);
527 proto_tree_add_item(announce_tree
, hf_uftp_announce_keymod
, tvb
, offset
, keylen
, ENC_NA
);
531 destlist
= proto_tree_add_item(announce_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
532 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
534 for (idx
= 0; idx
< destcount
; idx
++) {
535 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
540 static void dissect_uftp_register(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
542 proto_item
*ti
= NULL
;
543 proto_item
*destlist
= NULL
;
544 proto_tree
*register_tree
= NULL
;
545 proto_tree
*destlist_tree
= NULL
;
547 uint16_t destcount
, keylen
, idx
;
549 if (tvb_reported_length(tvb
) < REGISTER_LEN
) {
550 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
551 "Invalid length: %d", tvb_reported_length(tvb
));
555 destcount
= tvb_get_ntohs(tvb
, 4);
556 keylen
= tvb_get_ntohs(tvb
, 6);
557 if ((int)tvb_reported_length(tvb
) < REGISTER_LEN
+ keylen
+ (destcount
* 4)) {
558 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
559 "Invalid length, len = %d, keylen = %d, count=%d",
560 tvb_reported_length(tvb
), keylen
, destcount
);
564 ti
= proto_tree_add_item(tree
, hf_uftp_register
, tvb
, offset
, -1, ENC_NA
);
565 register_tree
= proto_item_add_subtree(ti
, ett_uftp_register
);
566 proto_tree_add_item(register_tree
, hf_uftp_register_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
568 proto_tree_add_item(register_tree
, hf_uftp_register_reserved
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
570 proto_tree_add_item(register_tree
, hf_uftp_register_destcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
572 proto_tree_add_item(register_tree
, hf_uftp_register_premaster_len
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
574 proto_tree_add_item(register_tree
, hf_uftp_register_rand2
, tvb
, offset
, RAND_LEN
, ENC_NA
);
577 proto_tree_add_item(register_tree
, hf_uftp_register_premaster
, tvb
, offset
, keylen
, ENC_NA
);
581 destlist
= proto_tree_add_item(register_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
582 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
584 for (idx
= 0; idx
< destcount
; idx
++) {
585 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
590 static void dissect_uftp_clientkey(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
592 proto_item
*ti
= NULL
;
593 proto_tree
*clientkey_tree
= NULL
;
595 uint16_t keylen
, verifylen
;
597 if (tvb_reported_length(tvb
) < CLIENT_KEY_LEN
) {
598 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
599 "Invalid length: %d", tvb_reported_length(tvb
));
603 keylen
= tvb_get_ntohs(tvb
, 4);
604 verifylen
= tvb_get_ntohs(tvb
, 6);
605 if ((int)tvb_reported_length(tvb
) < CLIENT_KEY_LEN
+ keylen
+ verifylen
) {
606 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
607 "Invalid length, len = %d, keylen=%d verifylen=%d",
608 tvb_reported_length(tvb
), keylen
, verifylen
);
612 ti
= proto_tree_add_item(tree
, hf_uftp_clientkey
, tvb
, offset
, -1, ENC_NA
);
613 clientkey_tree
= proto_item_add_subtree(ti
, ett_uftp_clientkey
);
614 proto_tree_add_item(clientkey_tree
, hf_uftp_clientkey_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
616 proto_tree_add_item(clientkey_tree
, hf_uftp_clientkey_reserved
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
618 proto_tree_add_item(clientkey_tree
, hf_uftp_clientkey_keylen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
620 proto_tree_add_item(clientkey_tree
, hf_uftp_clientkey_verifylen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
622 proto_tree_add_item(clientkey_tree
, hf_uftp_clientkey_keyexp
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
625 proto_tree_add_item(clientkey_tree
, hf_uftp_clientkey_keymod
, tvb
, offset
, keylen
, ENC_NA
);
629 proto_tree_add_item(clientkey_tree
, hf_uftp_clientkey_verify
, tvb
, offset
, verifylen
, ENC_NA
);
633 static void dissect_uftp_regconf(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
635 proto_item
*ti
= NULL
;
636 proto_item
*destlist
= NULL
;
637 proto_tree
*regconf_tree
= NULL
;
638 proto_tree
*destlist_tree
= NULL
;
640 uint16_t destcount
, idx
;
642 if (tvb_reported_length(tvb
) < REG_CONF_LEN
) {
643 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
644 "Invalid length: %d", tvb_reported_length(tvb
));
648 destcount
= tvb_get_ntohs(tvb
, 2);
649 if ((int)tvb_reported_length(tvb
) < REG_CONF_LEN
+ (destcount
* 4)) {
650 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
651 "Invalid length, len = %d, count=%d",
652 tvb_reported_length(tvb
), destcount
);
656 ti
= proto_tree_add_item(tree
, hf_uftp_regconf
, tvb
, offset
, -1, ENC_NA
);
657 regconf_tree
= proto_item_add_subtree(ti
, ett_uftp_regconf
);
658 proto_tree_add_item(regconf_tree
, hf_uftp_regconf_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
660 proto_tree_add_item(regconf_tree
, hf_uftp_regconf_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
662 proto_tree_add_item(regconf_tree
, hf_uftp_regconf_destcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
665 destlist
= proto_tree_add_item(regconf_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
666 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
668 for (idx
= 0; idx
< destcount
; idx
++) {
669 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
674 static void dissect_uftp_fileinfo_30(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
676 proto_item
*ti
= NULL
;
677 proto_item
*destlist
= NULL
;
678 proto_tree
*fileinfo_tree
= NULL
;
679 proto_tree
*destlist_tree
= NULL
;
681 uint16_t file_id
, destcount
, idx
;
683 if (tvb_reported_length(tvb
) < FILEINFO_30_LEN
) {
684 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
685 "Invalid length: %d", tvb_reported_length(tvb
));
689 destcount
= tvb_get_ntohs(tvb
, 10);
690 if ((int)tvb_reported_length(tvb
) < FILEINFO_30_LEN
+ (destcount
* 4)) {
691 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
692 "Invalid length, len = %d, count=%d",
693 tvb_reported_length(tvb
), destcount
);
697 file_id
= tvb_get_ntohs(tvb
, 2);
698 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X", file_id
);
700 ti
= proto_tree_add_item(tree
, hf_uftp_fileinfo
, tvb
, offset
, -1, ENC_NA
);
701 fileinfo_tree
= proto_item_add_subtree(ti
, ett_uftp_fileinfo
);
702 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
704 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_ftype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
706 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
708 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_block_total
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
710 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_section_total
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
712 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_destcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
714 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_fsize
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
716 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_name
, tvb
, offset
, MAXPATHNAME
, ENC_ASCII
);
717 offset
+= MAXPATHNAME
;
719 destlist
= proto_tree_add_item(fileinfo_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
720 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
722 for (idx
= 0; idx
< destcount
; idx
++) {
723 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
728 static void dissect_uftp_fileinfo(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
730 proto_item
*ti
= NULL
;
731 proto_item
*destlist
= NULL
;
732 proto_tree
*fileinfo_tree
= NULL
;
733 proto_tree
*destlist_tree
= NULL
;
735 uint16_t file_id
, destcount
, idx
;
737 if (tvb_reported_length(tvb
) < FILEINFO_LEN
) {
738 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
739 "Invalid length: %d", tvb_reported_length(tvb
));
743 destcount
= tvb_get_ntohs(tvb
, 10);
744 if ((int)tvb_reported_length(tvb
) < FILEINFO_LEN
+ (destcount
* 4)) {
745 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
746 "Invalid length, len = %d, count=%d",
747 tvb_reported_length(tvb
), destcount
);
751 file_id
= tvb_get_ntohs(tvb
, 2);
752 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X", file_id
);
754 ti
= proto_tree_add_item(tree
, hf_uftp_fileinfo
, tvb
, offset
, -1, ENC_NA
);
755 fileinfo_tree
= proto_item_add_subtree(ti
, ett_uftp_fileinfo
);
756 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
758 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_ftype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
760 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
762 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_block_total
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
764 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_section_total
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
766 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_destcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
768 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_fsize
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
770 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_ftstamp
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
772 proto_tree_add_item(fileinfo_tree
, hf_uftp_fileinfo_name
, tvb
, offset
, MAXPATHNAME
, ENC_ASCII
);
773 offset
+= MAXPATHNAME
;
775 destlist
= proto_tree_add_item(fileinfo_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
776 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
778 for (idx
= 0; idx
< destcount
; idx
++) {
779 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
784 static void dissect_uftp_keyinfo(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
786 proto_item
*ti
= NULL
;
787 proto_item
*destlist
= NULL
;
788 proto_item
*destkey
= NULL
;
789 proto_tree
*keyinfo_tree
= NULL
;
790 proto_tree
*destlist_tree
= NULL
;
791 proto_tree
*destkey_tree
= NULL
;
793 uint8_t destcount
, idx
;
795 if (tvb_reported_length(tvb
) < KEYINFO_LEN
) {
796 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
797 "Invalid length: %d", tvb_reported_length(tvb
));
801 destcount
= tvb_get_uint8(tvb
, 2);
802 if ((int)tvb_reported_length(tvb
) < KEYINFO_LEN
+ (destcount
* DESTKEY_LEN
)) {
803 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
804 "Invalid length, len = %d, count=%d",
805 tvb_reported_length(tvb
), destcount
);
809 ti
= proto_tree_add_item(tree
, hf_uftp_keyinfo
, tvb
, offset
, -1, ENC_NA
);
810 keyinfo_tree
= proto_item_add_subtree(ti
, ett_uftp_keyinfo
);
811 proto_tree_add_item(keyinfo_tree
, hf_uftp_keyinfo_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
813 proto_tree_add_item(keyinfo_tree
, hf_uftp_keyinfo_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
815 proto_tree_add_item(keyinfo_tree
, hf_uftp_keyinfo_destcount
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
817 proto_tree_add_item(keyinfo_tree
, hf_uftp_keyinfo_groupmaster_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
819 proto_tree_add_item(keyinfo_tree
, hf_uftp_keyinfo_tstamp
, tvb
, offset
, 8, ENC_NA
);
822 destlist
= proto_tree_add_item(keyinfo_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* DESTKEY_LEN
, ENC_NA
);
823 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
825 for (idx
= 0; idx
< destcount
; idx
++) {
826 destkey
= proto_tree_add_item(destlist_tree
, hf_uftp_keyinfo_destkey
, tvb
, offset
, DESTKEY_LEN
, ENC_NA
);
827 destkey_tree
= proto_item_add_subtree(destkey
, ett_uftp_keyinfo_destkey
);
828 proto_tree_add_item(destkey_tree
, hf_uftp_keyinfo_destaddr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
830 proto_tree_add_item(destkey_tree
, hf_uftp_keyinfo_groupmaster
, tvb
, offset
, 48, ENC_NA
);
835 static void dissect_uftp_infoack(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
837 proto_item
*ti
= NULL
;
838 proto_item
*destlist
= NULL
;
839 proto_tree
*infoack_tree
= NULL
;
840 proto_tree
*destlist_tree
= NULL
;
842 uint16_t file_id
, destcount
, idx
;
844 if (tvb_reported_length(tvb
) < INFO_ACK_LEN
) {
845 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
846 "Invalid length: %d", tvb_reported_length(tvb
));
850 destcount
= tvb_get_ntohs(tvb
, 4);
851 if ((int)tvb_reported_length(tvb
) < INFO_ACK_LEN
+ (destcount
* 4)) {
852 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
853 "Invalid length, len = %d, count=%d",
854 tvb_reported_length(tvb
), destcount
);
858 file_id
= tvb_get_ntohs(tvb
, 2);
860 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X", file_id
);
863 ti
= proto_tree_add_item(tree
, hf_uftp_infoack
, tvb
, offset
, -1, ENC_NA
);
864 infoack_tree
= proto_item_add_subtree(ti
, ett_uftp_infoack
);
865 proto_tree_add_item(infoack_tree
, hf_uftp_infoack_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
867 proto_tree_add_bitmask(infoack_tree
, tvb
, offset
, hf_uftp_infoack_flags
, ett_uftp_infoack_flags
, infoack_flags
, ENC_BIG_ENDIAN
);
869 proto_tree_add_item(infoack_tree
, hf_uftp_infoack_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
871 proto_tree_add_item(infoack_tree
, hf_uftp_infoack_destcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
873 proto_tree_add_item(infoack_tree
, hf_uftp_infoack_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
875 proto_tree_add_item(infoack_tree
, hf_uftp_infoack_verify_data
, tvb
, offset
, VERIFY_LEN
, ENC_NA
);
876 offset
+= VERIFY_LEN
;
878 destlist
= proto_tree_add_item(infoack_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
879 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
881 for (idx
= 0; idx
< destcount
; idx
++) {
882 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
887 static void dissect_uftp_fileseg(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
889 proto_item
*ti
= NULL
;
890 proto_tree
*fileseg_tree
= NULL
;
896 if (tvb_reported_length(tvb
) < FILESEG_LEN
) {
897 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
898 "Invalid length: %d", tvb_reported_length(tvb
));
902 file_id
= tvb_get_ntohs(tvb
, 2);
903 pass
= tvb_get_uint8(tvb
, 4);
904 seq_num
= tvb_get_ntohl(tvb
, 8);
905 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X Pass=%d Seq=%d",
906 file_id
, pass
, seq_num
);
908 ti
= proto_tree_add_item(tree
, hf_uftp_fileseg
, tvb
, offset
, -1, ENC_NA
);
909 fileseg_tree
= proto_item_add_subtree(ti
, ett_uftp_fileseg
);
910 proto_tree_add_item(fileseg_tree
, hf_uftp_fileseg_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
912 proto_tree_add_item(fileseg_tree
, hf_uftp_fileseg_reserved1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
914 proto_tree_add_item(fileseg_tree
, hf_uftp_fileseg_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
916 proto_tree_add_item(fileseg_tree
, hf_uftp_fileseg_pass
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
918 proto_tree_add_item(fileseg_tree
, hf_uftp_fileseg_reserved2
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
920 proto_tree_add_item(fileseg_tree
, hf_uftp_fileseg_section
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
922 proto_tree_add_item(fileseg_tree
, hf_uftp_fileseg_seq_num
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
924 proto_tree_add_item(fileseg_tree
, hf_uftp_fileseg_data
, tvb
, offset
, -1, ENC_NA
);
927 static void dissect_uftp_done(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
929 proto_item
*ti
= NULL
;
930 proto_item
*destlist
= NULL
;
931 proto_tree
*done_tree
= NULL
;
932 proto_tree
*destlist_tree
= NULL
;
935 uint16_t file_id
, section
, destcount
, idx
;
937 if (tvb_reported_length(tvb
) < DONE_LEN
) {
938 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
939 "Invalid length: %d", tvb_reported_length(tvb
));
943 destcount
= tvb_get_ntohs(tvb
, 6);
944 if ((int)tvb_reported_length(tvb
) < DONE_LEN
+ (destcount
* 4)) {
945 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
946 "Invalid length, len = %d, count=%d",
947 tvb_reported_length(tvb
), destcount
);
951 pass
= tvb_get_uint8(tvb
, 1);
952 section
= tvb_get_ntohs(tvb
, 2);
953 file_id
= tvb_get_ntohs(tvb
, 4);
955 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X Pass=%d Section=%d",
956 file_id
, pass
, section
);
959 ti
= proto_tree_add_item(tree
, hf_uftp_done
, tvb
, offset
, -1, ENC_NA
);
960 done_tree
= proto_item_add_subtree(ti
, ett_uftp_done
);
961 proto_tree_add_item(done_tree
, hf_uftp_done_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
963 proto_tree_add_item(done_tree
, hf_uftp_done_pass
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
965 proto_tree_add_item(done_tree
, hf_uftp_done_section
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
967 proto_tree_add_item(done_tree
, hf_uftp_done_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
969 proto_tree_add_item(done_tree
, hf_uftp_done_destcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
972 destlist
= proto_tree_add_item(done_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
973 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
975 for (idx
= 0; idx
< destcount
; idx
++) {
976 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
981 static void dissect_uftp_status(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
983 proto_item
*ti
= NULL
;
984 proto_tree
*status_tree
= NULL
;
987 uint16_t file_id
, section
;
990 if (tvb_reported_length(tvb
) < STATUS_LEN
) {
991 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
992 "Invalid length: %d", tvb_reported_length(tvb
));
996 file_id
= tvb_get_ntohs(tvb
, 2);
997 section
= tvb_get_ntohs(tvb
, 2);
998 pass
= tvb_get_uint8(tvb
, 4);
999 seq
= tvb_get_uint8(tvb
, 5);
1000 nak_count
= tvb_get_ntohl(tvb
, 8);
1001 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X Pass=%d Section=%d Seq=%d",
1002 file_id
, pass
, section
, seq
);
1004 ti
= proto_tree_add_item(tree
, hf_uftp_status
, tvb
, offset
, -1, ENC_NA
);
1005 status_tree
= proto_item_add_subtree(ti
, ett_uftp_status
);
1006 proto_tree_add_item(status_tree
, hf_uftp_status_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1008 proto_tree_add_item(status_tree
, hf_uftp_status_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1010 proto_tree_add_item(status_tree
, hf_uftp_status_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1012 proto_tree_add_item(status_tree
, hf_uftp_status_pass
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1014 proto_tree_add_item(status_tree
, hf_uftp_status_seq
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1016 proto_tree_add_item(status_tree
, hf_uftp_status_section
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1018 proto_tree_add_item(status_tree
, hf_uftp_status_nak_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1020 if (nak_count
> 0) {
1021 proto_tree_add_item(status_tree
, hf_uftp_status_naks
, tvb
, offset
, -1, ENC_NA
);
1025 static void dissect_uftp_prstatus(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
1027 proto_item
*ti
= NULL
;
1028 proto_item
*destlist
= NULL
;
1029 proto_tree
*prstatus_tree
= NULL
;
1030 proto_tree
*destlist_tree
= NULL
;
1033 uint16_t file_id
, destcount
, idx
, section
;
1036 if (tvb_reported_length(tvb
) < PRSTATUS_LEN
) {
1037 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1038 "Invalid length: %d", tvb_reported_length(tvb
));
1042 destcount
= tvb_get_ntohs(tvb
, 8);
1043 if ((int)tvb_reported_length(tvb
) < PRSTATUS_LEN
+ (destcount
* 4)) {
1044 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1045 "Invalid length, len = %d, count=%d",
1046 tvb_reported_length(tvb
), destcount
);
1050 file_id
= tvb_get_ntohs(tvb
, 2);
1051 section
= tvb_get_ntohs(tvb
, 2);
1052 pass
= tvb_get_uint8(tvb
, 4);
1053 seq
= tvb_get_uint8(tvb
, 5);
1054 nak_count
= tvb_get_ntohl(tvb
, 8);
1055 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X Pass=%d Section=%d Seq=%d "
1056 "NAKs=%d", file_id
, pass
, section
, seq
, nak_count
);
1058 ti
= proto_tree_add_item(tree
, hf_uftp_prstatus
, tvb
, offset
, -1, ENC_NA
);
1059 prstatus_tree
= proto_item_add_subtree(ti
, ett_uftp_prstatus
);
1060 proto_tree_add_item(prstatus_tree
, hf_uftp_prstatus_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1062 proto_tree_add_item(prstatus_tree
, hf_uftp_prstatus_reserved1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1064 proto_tree_add_item(prstatus_tree
, hf_uftp_prstatus_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1066 proto_tree_add_item(prstatus_tree
, hf_uftp_prstatus_pass
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1068 proto_tree_add_item(prstatus_tree
, hf_uftp_prstatus_seq
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1070 proto_tree_add_item(prstatus_tree
, hf_uftp_prstatus_section
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1072 proto_tree_add_item(prstatus_tree
, hf_uftp_prstatus_destcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1074 proto_tree_add_item(prstatus_tree
, hf_uftp_prstatus_reserved2
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1076 if (destcount
> 0) {
1077 destlist
= proto_tree_add_item(prstatus_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
1078 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
1080 for (idx
= 0; idx
< destcount
; idx
++) {
1081 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1086 static void dissect_uftp_complete(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
1088 proto_item
*ti
= NULL
;
1089 proto_item
*destlist
= NULL
;
1090 proto_tree
*complete_tree
= NULL
;
1091 proto_tree
*destlist_tree
= NULL
;
1093 uint16_t file_id
, destcount
, idx
;
1095 if (tvb_reported_length(tvb
) < COMPLETE_LEN
) {
1096 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1097 "Invalid length: %d", tvb_reported_length(tvb
));
1101 destcount
= tvb_get_ntohs(tvb
, 4);
1102 if ((int)tvb_reported_length(tvb
) < COMPLETE_LEN
+ (destcount
* 4)) {
1103 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1104 "Invalid length, len = %d, count=%d",
1105 tvb_reported_length(tvb
), destcount
);
1109 file_id
= tvb_get_ntohs(tvb
, 2);
1111 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X", file_id
);
1114 ti
= proto_tree_add_item(tree
, hf_uftp_complete
, tvb
, offset
, -1, ENC_NA
);
1115 complete_tree
= proto_item_add_subtree(ti
, ett_uftp_complete
);
1116 proto_tree_add_item(complete_tree
, hf_uftp_complete_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1118 proto_tree_add_item(complete_tree
, hf_uftp_complete_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1120 proto_tree_add_item(complete_tree
, hf_uftp_complete_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1122 proto_tree_add_item(complete_tree
, hf_uftp_complete_destcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1124 proto_tree_add_item(complete_tree
, hf_uftp_complete_reserved2
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1126 if (destcount
> 0) {
1127 destlist
= proto_tree_add_item(complete_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
1128 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
1130 for (idx
= 0; idx
< destcount
; idx
++) {
1131 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1136 static void dissect_uftp_doneconf(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
1138 proto_item
*ti
= NULL
;
1139 proto_item
*destlist
= NULL
;
1140 proto_tree
*doneconf_tree
= NULL
;
1141 proto_tree
*destlist_tree
= NULL
;
1143 uint16_t file_id
, destcount
, idx
;
1145 if (tvb_reported_length(tvb
) < DONE_CONF_LEN
) {
1146 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1147 "Invalid length: %d", tvb_reported_length(tvb
));
1151 destcount
= tvb_get_ntohs(tvb
, 4);
1152 if ((int)tvb_reported_length(tvb
) < DONE_CONF_LEN
+ (destcount
* 4)) {
1153 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1154 "Invalid length, len = %d, count=%d",
1155 tvb_reported_length(tvb
), destcount
);
1159 file_id
= tvb_get_ntohs(tvb
, 2);
1161 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ":%04X", file_id
);
1164 ti
= proto_tree_add_item(tree
, hf_uftp_doneconf
, tvb
, offset
, -1, ENC_NA
);
1165 doneconf_tree
= proto_item_add_subtree(ti
, ett_uftp_doneconf
);
1166 proto_tree_add_item(doneconf_tree
, hf_uftp_doneconf_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1168 proto_tree_add_item(doneconf_tree
, hf_uftp_doneconf_reserved1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1170 proto_tree_add_item(doneconf_tree
, hf_uftp_doneconf_file_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1172 proto_tree_add_item(doneconf_tree
, hf_uftp_doneconf_destcount
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1174 proto_tree_add_item(doneconf_tree
, hf_uftp_doneconf_reserved2
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1176 if (destcount
> 0) {
1177 destlist
= proto_tree_add_item(doneconf_tree
, hf_uftp_destlist
, tvb
, offset
, destcount
* 4, ENC_NA
);
1178 destlist_tree
= proto_item_add_subtree(destlist
, ett_uftp_destlist
);
1180 for (idx
= 0; idx
< destcount
; idx
++) {
1181 proto_tree_add_item(destlist_tree
, hf_uftp_dest
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1186 static void dissect_uftp_hbreq(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1188 proto_item
*ti
= NULL
;
1189 proto_tree
*hbreq_tree
= NULL
;
1191 uint16_t keylen
, siglen
;
1193 if (tvb_reported_length(tvb
) < HB_REQ_LEN
) {
1194 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1195 "Invalid length: %d", tvb_reported_length(tvb
));
1199 keylen
= tvb_get_ntohs(tvb
, 8);
1200 siglen
= tvb_get_ntohs(tvb
, 10);
1201 if ((int)tvb_reported_length(tvb
) < HB_REQ_LEN
+ keylen
+ siglen
) {
1202 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1203 "Invalid length, len = %d, keylen=%d siglen=%d",
1204 tvb_reported_length(tvb
), keylen
, siglen
);
1208 ti
= proto_tree_add_item(tree
, hf_uftp_hbreq
, tvb
, offset
, -1, ENC_NA
);
1209 hbreq_tree
= proto_item_add_subtree(ti
, ett_uftp_hbreq
);
1210 proto_tree_add_item(hbreq_tree
, hf_uftp_hbreq_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1212 proto_tree_add_item(hbreq_tree
, hf_uftp_hbreq_reserved
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
1214 proto_tree_add_item(hbreq_tree
, hf_uftp_hbreq_nonce
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1216 proto_tree_add_item(hbreq_tree
, hf_uftp_hbreq_keylen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1218 proto_tree_add_item(hbreq_tree
, hf_uftp_hbreq_siglen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1220 proto_tree_add_item(hbreq_tree
, hf_uftp_hbreq_keyexp
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1223 proto_tree_add_item(hbreq_tree
, hf_uftp_hbreq_keymod
, tvb
, offset
, keylen
, ENC_NA
);
1227 proto_tree_add_item(hbreq_tree
, hf_uftp_hbreq_verify
, tvb
, offset
, siglen
, ENC_NA
);
1231 static void dissect_uftp_hbresp(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1233 proto_item
*ti
= NULL
;
1234 proto_tree
*hbresp_tree
= NULL
;
1237 if (tvb_reported_length(tvb
) < HB_RESP_LEN
) {
1238 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1239 "Invalid length: %d", tvb_reported_length(tvb
));
1243 ti
= proto_tree_add_item(tree
, hf_uftp_hbresp
, tvb
, offset
, -1, ENC_NA
);
1244 hbresp_tree
= proto_item_add_subtree(ti
, ett_uftp_hbresp
);
1245 proto_tree_add_item(hbresp_tree
, hf_uftp_hbresp_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1247 proto_tree_add_item(hbresp_tree
, hf_uftp_hbresp_authenticated
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1249 proto_tree_add_item(hbresp_tree
, hf_uftp_hbresp_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1251 proto_tree_add_item(hbresp_tree
, hf_uftp_hbresp_nonce
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1254 static void dissect_uftp_keyreq(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1256 proto_item
*ti
= NULL
;
1257 proto_tree
*keyreq_tree
= NULL
;
1260 if (tvb_reported_length(tvb
) < KEY_REQ_LEN
) {
1261 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1262 "Invalid length: %d", tvb_reported_length(tvb
));
1266 ti
= proto_tree_add_item(tree
, hf_uftp_keyreq
, tvb
, offset
, -1, ENC_NA
);
1267 keyreq_tree
= proto_item_add_subtree(ti
, ett_uftp_keyreq
);
1268 proto_tree_add_item(keyreq_tree
, hf_uftp_keyreq_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1270 proto_tree_add_item(keyreq_tree
, hf_uftp_keyreq_reserved
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
1273 static void dissect_uftp_proxykey(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1275 proto_item
*ti
= NULL
;
1276 proto_tree
*proxykey_tree
= NULL
;
1278 uint16_t keylen
, siglen
;
1280 if (tvb_reported_length(tvb
) < PROXY_KEY_LEN
) {
1281 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1282 "Invalid length: %d", tvb_reported_length(tvb
));
1286 keylen
= tvb_get_ntohs(tvb
, 8);
1287 siglen
= tvb_get_ntohs(tvb
, 10);
1288 if ((int)tvb_reported_length(tvb
) < PROXY_KEY_LEN
+ keylen
+ siglen
) {
1289 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1290 "Invalid length, len = %d, keylen=%d siglen=%d",
1291 tvb_reported_length(tvb
), keylen
, siglen
);
1295 ti
= proto_tree_add_item(tree
, hf_uftp_proxykey
, tvb
, offset
, -1, ENC_NA
);
1296 proxykey_tree
= proto_item_add_subtree(ti
, ett_uftp_proxykey
);
1297 proto_tree_add_item(proxykey_tree
, hf_uftp_proxykey_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1299 proto_tree_add_item(proxykey_tree
, hf_uftp_proxykey_reserved
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
1301 proto_tree_add_item(proxykey_tree
, hf_uftp_proxykey_nonce
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1303 proto_tree_add_item(proxykey_tree
, hf_uftp_proxykey_keylen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1305 proto_tree_add_item(proxykey_tree
, hf_uftp_proxykey_siglen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1307 proto_tree_add_item(proxykey_tree
, hf_uftp_proxykey_keyexp
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1310 proto_tree_add_item(proxykey_tree
, hf_uftp_proxykey_keymod
, tvb
, offset
, keylen
, ENC_NA
);
1314 proto_tree_add_item(proxykey_tree
, hf_uftp_proxykey_verify
, tvb
, offset
, siglen
, ENC_NA
);
1318 static void dissect_uftp_encrypted(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1320 proto_item
*ti
= NULL
;
1321 proto_tree
*encrypted_tree
= NULL
;
1323 uint16_t sig_len
, payload_len
;
1325 if (tvb_reported_length(tvb
) < ENCRYPTED_LEN
) {
1326 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1327 "Invalid length: %d", tvb_reported_length(tvb
));
1331 sig_len
= tvb_get_ntohs(tvb
, 8);
1332 payload_len
= tvb_get_ntohs(tvb
, 10);
1333 if ((int)tvb_reported_length(tvb
) < ENCRYPTED_LEN
+ sig_len
+ payload_len
) {
1334 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1335 "Invalid length, len = %d, sig=%d, payload=%d",
1336 tvb_reported_length(tvb
), sig_len
, payload_len
);
1340 ti
= proto_tree_add_item(tree
, hf_uftp_encrypted
, tvb
, offset
, -1, ENC_NA
);
1341 encrypted_tree
= proto_item_add_subtree(ti
, ett_uftp_encrypted
);
1342 proto_tree_add_item(encrypted_tree
, hf_uftp_encrypted_tstamp
, tvb
, offset
, 8, ENC_NA
);
1344 proto_tree_add_item(encrypted_tree
, hf_uftp_encrypted_sig_len
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1346 proto_tree_add_item(encrypted_tree
, hf_uftp_encrypted_payload_len
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1348 proto_tree_add_item(encrypted_tree
, hf_uftp_encrypted_signature
, tvb
, offset
, sig_len
, ENC_NA
);
1350 proto_tree_add_item(encrypted_tree
, hf_uftp_encrypted_payload
, tvb
, offset
, payload_len
, ENC_NA
);
1353 static void dissect_uftp_abort(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1355 proto_item
*ti
= NULL
;
1356 proto_tree
*abort_tree
= NULL
;
1359 if (tvb_reported_length(tvb
) < ABORT_LEN
) {
1360 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_length_invalid
, tvb
, offset
, -1,
1361 "Invalid length: %d", tvb_reported_length(tvb
));
1365 ti
= proto_tree_add_item(tree
, hf_uftp_abort
, tvb
, offset
, -1, ENC_NA
);
1366 abort_tree
= proto_item_add_subtree(ti
, ett_uftp_abort
);
1367 proto_tree_add_item(abort_tree
, hf_uftp_abort_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1369 proto_tree_add_bitmask(abort_tree
, tvb
, offset
, hf_uftp_abort_flags
, ett_uftp_abort_flags
, abort_flags
, ENC_BIG_ENDIAN
);
1371 proto_tree_add_item(abort_tree
, hf_uftp_abort_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1373 proto_tree_add_item(abort_tree
, hf_uftp_abort_host
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1375 proto_tree_add_item(abort_tree
, hf_uftp_abort_message
, tvb
, offset
, -1, ENC_ASCII
);
1378 static int dissect_uftp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
1385 proto_item
*ti
= NULL
;
1386 proto_tree
*uftp_tree
= NULL
;
1389 version
= tvb_get_uint8(tvb
, 0);
1390 if (version
== 0x50) {
1391 return call_dissector(uftp5_handle
, tvb
, pinfo
, tree
);
1392 } else if (version
== 0x40) {
1393 return call_dissector(uftp4_handle
, tvb
, pinfo
, tree
);
1394 } else if (version
!= UFTP_VER_NUM
&& version
!= UFTP_3_0_VER
) {
1398 if (tvb_reported_length(tvb
) < UFTP_LEN
) {
1402 mes_type
= tvb_get_uint8(tvb
, 1);
1403 blsize
= tvb_get_ntohs(tvb
, 2);
1404 group_id
= tvb_get_ntohl(tvb
, 4);
1406 if (tvb_reported_length(tvb
) != (unsigned)UFTP_LEN
+ blsize
) {
1410 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "UFTP");
1411 /* Clear out stuff in the info column */
1412 col_clear(pinfo
->cinfo
,COL_INFO
);
1413 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "%-10s",
1414 val_to_str(mes_type
, messages
, "Unknown (%d)"));
1415 if ((mes_type
!= HB_REQ
) && (mes_type
!= HB_RESP
)) {
1416 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " ID=%08X", group_id
);
1419 ti
= proto_tree_add_item(tree
, proto_uftp
, tvb
, 0, -1, ENC_NA
);
1420 uftp_tree
= proto_item_add_subtree(ti
, ett_uftp
);
1421 proto_tree_add_item(uftp_tree
, hf_uftp_version
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1423 proto_tree_add_item(uftp_tree
, hf_uftp_func
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1425 proto_tree_add_item(uftp_tree
, hf_uftp_blsize
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1427 proto_tree_add_item(uftp_tree
, hf_uftp_group_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1429 proto_tree_add_item(uftp_tree
, hf_uftp_srcaddr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1431 proto_tree_add_item(uftp_tree
, hf_uftp_destaddr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1434 next_tvb
= tvb_new_subset_length(tvb
, offset
, blsize
);
1438 dissect_uftp_announce(next_tvb
, pinfo
, uftp_tree
);
1441 dissect_uftp_register(next_tvb
, pinfo
, uftp_tree
);
1444 dissect_uftp_clientkey(next_tvb
, pinfo
, uftp_tree
);
1447 dissect_uftp_regconf(next_tvb
, pinfo
, uftp_tree
);
1450 if (version
== UFTP_3_0_VER
) {
1451 dissect_uftp_fileinfo_30(next_tvb
, pinfo
, uftp_tree
);
1453 dissect_uftp_fileinfo(next_tvb
, pinfo
, uftp_tree
);
1457 dissect_uftp_keyinfo(next_tvb
, pinfo
, uftp_tree
);
1460 dissect_uftp_infoack(next_tvb
, pinfo
, uftp_tree
);
1463 dissect_uftp_fileseg(next_tvb
, pinfo
, uftp_tree
);
1466 dissect_uftp_done(next_tvb
, pinfo
, uftp_tree
);
1469 dissect_uftp_status(next_tvb
, pinfo
, uftp_tree
);
1472 dissect_uftp_prstatus(next_tvb
, pinfo
, uftp_tree
);
1475 dissect_uftp_complete(next_tvb
, pinfo
, uftp_tree
);
1478 dissect_uftp_doneconf(next_tvb
, pinfo
, uftp_tree
);
1481 dissect_uftp_hbreq(next_tvb
, pinfo
, uftp_tree
);
1484 dissect_uftp_hbresp(next_tvb
, pinfo
, uftp_tree
);
1487 dissect_uftp_keyreq(next_tvb
, pinfo
, uftp_tree
);
1490 dissect_uftp_proxykey(next_tvb
, pinfo
, uftp_tree
);
1493 dissect_uftp_encrypted(next_tvb
, pinfo
, uftp_tree
);
1496 dissect_uftp_abort(next_tvb
, pinfo
, uftp_tree
);
1499 proto_tree_add_expert_format(tree
, pinfo
, &ei_uftp_func_unknown
, tvb
, offset
, -1,
1500 "Function unknown: %d", mes_type
);
1504 return tvb_reported_length(tvb
);
1507 void proto_register_uftp(void)
1509 static hf_register_info hf
[] = {
1511 { "Protocol Version", "uftp.version",
1512 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1515 { "Type", "uftp.func",
1516 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
1519 { "Block Size", "uftp.blsize",
1520 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1522 { &hf_uftp_group_id
,
1523 { "Group ID", "uftp.group_id",
1524 FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1527 { "Source Address", "uftp.srcaddr",
1528 FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1530 { &hf_uftp_destaddr
,
1531 { "Destination Address", "uftp.destaddr",
1532 FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1534 { &hf_uftp_destlist
,
1535 { "Destination List", "uftp.destlist",
1536 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1539 { "Destination", "uftp.dest",
1540 FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1542 { &hf_uftp_announce
,
1543 { "ANNOUNCE", "uftp.announce",
1544 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1546 { &hf_uftp_announce_func
,
1547 { "Type", "uftp.announce.func",
1548 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
1550 { &hf_uftp_announce_flags
,
1551 { "Flags", "uftp.announce.flags",
1552 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1554 { &hf_uftp_announce_flags_restart
,
1555 { "Restart", "uftp.announce.flags.restart",
1556 FT_BOOLEAN
, 8, NULL
, FLAG_RESTART
, NULL
, HFILL
}
1558 { &hf_uftp_announce_flags_sync
,
1559 { "Sync mode", "uftp.announce.flags.sync",
1560 FT_BOOLEAN
, 8, NULL
, FLAG_SYNC_MODE
, NULL
, HFILL
}
1562 { &hf_uftp_announce_flags_syncpreview
,
1563 { "Sync preview mode", "uftp.announce.flags.syncpreview",
1564 FT_BOOLEAN
, 8, NULL
, FLAG_SYNC_PREVIEW
, NULL
, HFILL
}
1566 { &hf_uftp_announce_flags_reserved
,
1567 { "Reserved", "uftp.announce.flags.reserved",
1568 FT_BOOLEAN
, 8, NULL
, FLAG_ANNOUNCE_RESERVED
, NULL
, HFILL
}
1570 { &hf_uftp_announce_destcount
,
1571 { "Destination Count", "uftp.announce.destcount",
1572 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1574 { &hf_uftp_announce_announce_int
,
1575 { "Announce Interval", "uftp.announce.announce_int",
1576 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1578 { &hf_uftp_announce_status_int
,
1579 { "Status Interval", "uftp.announce.status_int",
1580 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1582 { &hf_uftp_announce_register_int
,
1583 { "Register Interval", "uftp.announce.register_int",
1584 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1586 { &hf_uftp_announce_done_int
,
1587 { "Done Interval", "uftp.announce.done_int",
1588 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1590 { &hf_uftp_announce_announce_time
,
1591 { "Announce Time", "uftp.announce.announce_time",
1592 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1594 { &hf_uftp_announce_status_time
,
1595 { "Status Time", "uftp.announce.status_time",
1596 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1598 { &hf_uftp_announce_mtu
,
1599 { "MTU", "uftp.announce.mtu",
1600 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1602 { &hf_uftp_announce_privatemcast
,
1603 { "Private Multicast Address", "uftp.announce.privatemcast",
1604 FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1606 { &hf_uftp_announce_client_auth
,
1607 { "Client Auth", "uftp.announce.client_auth",
1608 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1610 { &hf_uftp_announce_sigtype
,
1611 { "Signature Type", "uftp.announce.sigtype",
1612 FT_UINT8
, BASE_DEC
, VALS(signature_types
), 0x0, NULL
, HFILL
}
1614 { &hf_uftp_announce_hashtype
,
1615 { "Hash Type", "uftp.announce.hashtype",
1616 FT_UINT8
, BASE_DEC
, VALS(hash_types
), 0x0, NULL
, HFILL
}
1618 { &hf_uftp_announce_keytype
,
1619 { "Key Type", "uftp.announce.keytype",
1620 FT_UINT8
, BASE_DEC
, VALS(key_types
), 0x0, NULL
, HFILL
}
1622 { &hf_uftp_announce_keylen
,
1623 { "Public Key Length", "uftp.announce.keylen",
1624 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1626 { &hf_uftp_announce_reserved
,
1627 { "Reserved", "uftp.announce.reserved",
1628 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1630 { &hf_uftp_announce_keyexp
,
1631 { "Public Key Exponent", "uftp.announce.keyexp",
1632 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1634 { &hf_uftp_announce_rand1
,
1635 { "Server Random Number", "uftp.announce.rand1",
1636 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1638 { &hf_uftp_announce_keymod
,
1639 { "Public Key Modulus", "uftp.announce.keymod",
1640 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1642 { &hf_uftp_register
,
1643 { "REGISTER", "uftp.register",
1644 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1646 { &hf_uftp_register_func
,
1647 { "Type", "uftp.register.func",
1648 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
1650 { &hf_uftp_register_reserved
,
1651 { "Reserved", "uftp.register.reserved",
1652 FT_UINT24
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1654 { &hf_uftp_register_destcount
,
1655 { "Destination Count", "uftp.register.destcount",
1656 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1658 { &hf_uftp_register_premaster_len
,
1659 { "Premaster Secret Length", "uftp.register.premaster_len",
1660 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1662 { &hf_uftp_register_rand2
,
1663 { "Client Random Number", "uftp.register.rand2",
1664 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1666 { &hf_uftp_register_premaster
,
1667 { "Encrypted Premaster Secret", "uftp.register.premaster",
1668 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1670 { &hf_uftp_clientkey
,
1671 { "CLIENT_KEY", "uftp.clientkey",
1672 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1674 { &hf_uftp_clientkey_func
,
1675 { "Type", "uftp.clientkey.func",
1676 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
1678 { &hf_uftp_clientkey_reserved
,
1679 { "Reserved", "uftp.clientkey.reserved",
1680 FT_UINT24
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1682 { &hf_uftp_clientkey_keylen
,
1683 { "Key Length", "uftp.clientkey.keylen",
1684 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1686 { &hf_uftp_clientkey_verifylen
,
1687 { "Signature Length", "uftp.clientkey.verifylen",
1688 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1690 { &hf_uftp_clientkey_keyexp
,
1691 { "Public Key Exponent", "uftp.clientkey.keyexp",
1692 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1694 { &hf_uftp_clientkey_keymod
,
1695 { "Public Key Modulus", "uftp.clientkey.keymod",
1696 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1698 { &hf_uftp_clientkey_verify
,
1699 { "Signature", "uftp.clientkey.verify",
1700 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1703 { "REG_CONF", "uftp.regconf",
1704 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1706 { &hf_uftp_regconf_func
,
1707 { "Type", "uftp.regconf.func",
1708 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
1710 { &hf_uftp_regconf_reserved
,
1711 { "Reserved", "uftp.regconf.reserved",
1712 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1714 { &hf_uftp_regconf_destcount
,
1715 { "Destination Count", "uftp.regconf.destcount",
1716 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1718 { &hf_uftp_fileinfo
,
1719 { "FILEINFO", "uftp.fileinfo",
1720 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1722 { &hf_uftp_fileinfo_func
,
1723 { "Type", "uftp.fileinfo.func",
1724 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
1726 { &hf_uftp_fileinfo_ftype
,
1727 { "File Type", "uftp.fileinfo.ftype",
1728 FT_UINT8
, BASE_DEC
, VALS(file_types
), 0x0, NULL
, HFILL
}
1730 { &hf_uftp_fileinfo_file_id
,
1731 { "File ID", "uftp.fileinfo.file_id",
1732 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1734 { &hf_uftp_fileinfo_block_total
,
1735 { "Total Blocks", "uftp.fileinfo.block_total",
1736 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1738 { &hf_uftp_fileinfo_section_total
,
1739 { "Total Sections", "uftp.fileinfo.section_total",
1740 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1742 { &hf_uftp_fileinfo_destcount
,
1743 { "Destination Count", "uftp.fileinfo.destcount",
1744 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1746 { &hf_uftp_fileinfo_fsize
,
1747 { "File Size", "uftp.fileinfo.fsize",
1748 FT_UINT64
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1750 { &hf_uftp_fileinfo_ftstamp
,
1751 { "File Timestamp", "uftp.fileinfo.tstamp",
1752 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1754 { &hf_uftp_fileinfo_name
,
1755 { "File Name", "uftp.fileinfo.name",
1756 FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1759 { "KEYINFO", "uftp.keyinfo",
1760 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1762 { &hf_uftp_keyinfo_func
,
1763 { "Type", "uftp.keyinfo.func",
1764 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
1766 { &hf_uftp_keyinfo_reserved
,
1767 { "Reserved", "uftp.keyinfo.reserved",
1768 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1770 { &hf_uftp_keyinfo_destcount
,
1771 { "Destination Count", "uftp.keyinfo.destcount",
1772 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1774 { &hf_uftp_keyinfo_groupmaster_len
,
1775 { "Group Master Length", "uftp.keyinfo.groupmaster_len",
1776 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1778 { &hf_uftp_keyinfo_tstamp
,
1779 { "Timestamp", "uftp.keyinfo.tstamp",
1780 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_UTC
, NULL
, 0x0, NULL
, HFILL
}
1782 { &hf_uftp_keyinfo_destkey
,
1783 { "Destination Key", "uftp.keyinfo.destkey",
1784 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1786 { &hf_uftp_keyinfo_destaddr
,
1787 { "Destination Address", "uftp.keyinfo.destaddr",
1788 FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1790 { &hf_uftp_keyinfo_groupmaster
,
1791 { "Encrypted Group Master", "uftp.keyinfo.groupmaster",
1792 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1795 { "INFO_ACK", "uftp.infoack",
1796 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1798 { &hf_uftp_infoack_func
,
1799 { "Type", "uftp.infoack.func",
1800 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
1802 { &hf_uftp_infoack_flags
,
1803 { "Flags", "uftp.infoack.flags",
1804 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1806 { &hf_uftp_infoack_flags_partial
,
1807 { "Partial", "uftp.infoack.flags.partial",
1808 FT_BOOLEAN
, 8, NULL
, FLAG_PARTIAL
, NULL
, HFILL
}
1810 { &hf_uftp_infoack_flags_reserved
,
1811 { "Reserved", "uftp.infoack.flags.reserved",
1812 FT_BOOLEAN
, 8, NULL
, FLAG_INFOACK_RESERVED
, NULL
, HFILL
}
1814 { &hf_uftp_infoack_file_id
,
1815 { "File ID", "uftp.infoack.file_id",
1816 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1818 { &hf_uftp_infoack_destcount
,
1819 { "Destination Count", "uftp.infoack.destcount",
1820 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1822 { &hf_uftp_infoack_reserved
,
1823 { "Reserved", "uftp.infoack.reserved",
1824 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1826 { &hf_uftp_infoack_verify_data
,
1827 { "Verify Data", "uftp.infoack.verify_data",
1828 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1831 { "FILESEG", "uftp.fileseg",
1832 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1834 { &hf_uftp_fileseg_func
,
1835 { "Type", "uftp.fileseg.func",
1836 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
1838 { &hf_uftp_fileseg_reserved1
,
1839 { "Reserved", "uftp.fileseg.reserved1",
1840 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1842 { &hf_uftp_fileseg_file_id
,
1843 { "File ID", "uftp.fileseg.file_id",
1844 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1846 { &hf_uftp_fileseg_pass
,
1847 { "Pass", "uftp.fileseg.pass",
1848 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1850 { &hf_uftp_fileseg_reserved2
,
1851 { "Reserved", "uftp.fileseg.reserved2",
1852 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1854 { &hf_uftp_fileseg_section
,
1855 { "Section", "uftp.fileseg.section",
1856 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1858 { &hf_uftp_fileseg_seq_num
,
1859 { "Sequence Number", "uftp.fileseg.seq_num",
1860 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1862 { &hf_uftp_fileseg_data
,
1863 { "Data", "uftp.fileseg.data",
1864 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1867 { "DONE", "uftp.done",
1868 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1870 { &hf_uftp_done_func
,
1871 { "Type", "uftp.done.func",
1872 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
1874 { &hf_uftp_done_pass
,
1875 { "Pass", "uftp.done.pass",
1876 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1878 { &hf_uftp_done_section
,
1879 { "Section", "uftp.done.section",
1880 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1882 { &hf_uftp_done_file_id
,
1883 { "File ID", "uftp.done.file_id",
1884 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1886 { &hf_uftp_done_destcount
,
1887 { "Destination Count", "uftp.done.destcount",
1888 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1891 { "STATUS", "uftp.status",
1892 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1894 { &hf_uftp_status_func
,
1895 { "Type", "uftp.status.func",
1896 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
1898 { &hf_uftp_status_reserved
,
1899 { "Reserved", "uftp.status.reserved",
1900 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1902 { &hf_uftp_status_file_id
,
1903 { "File ID", "uftp.status.file_id",
1904 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1906 { &hf_uftp_status_pass
,
1907 { "Pass", "uftp.status.pass",
1908 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1910 { &hf_uftp_status_seq
,
1911 { "Sequence", "uftp.status.seq",
1912 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1914 { &hf_uftp_status_section
,
1915 { "Section", "uftp.status.section",
1916 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1918 { &hf_uftp_status_nak_count
,
1919 { "NAK Count", "uftp.status.nak_count",
1920 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1922 { &hf_uftp_status_naks
,
1923 { "NAKs", "uftp.status.naks",
1924 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1926 { &hf_uftp_prstatus
,
1927 { "PRSTATUS", "uftp.prstatus",
1928 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1930 { &hf_uftp_prstatus_func
,
1931 { "Type", "uftp.prstatus.func",
1932 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
1934 { &hf_uftp_prstatus_reserved1
,
1935 { "Reserved", "uftp.prstatus.reserved1",
1936 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1938 { &hf_uftp_prstatus_file_id
,
1939 { "File ID", "uftp.prstatus.file_id",
1940 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1942 { &hf_uftp_prstatus_pass
,
1943 { "Pass", "uftp.prstatus.pass",
1944 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1946 { &hf_uftp_prstatus_seq
,
1947 { "Sequence", "uftp.prstatus.seq",
1948 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1950 { &hf_uftp_prstatus_section
,
1951 { "Section", "uftp.prstatus.section",
1952 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1954 { &hf_uftp_prstatus_destcount
,
1955 { "Destination Count", "uftp.prstatus.destcount",
1956 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1958 { &hf_uftp_prstatus_reserved2
,
1959 { "Reserved", "uftp.prstatus.reserved2",
1960 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1962 { &hf_uftp_complete
,
1963 { "COMPLETE", "uftp.complete",
1964 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1966 { &hf_uftp_complete_func
,
1967 { "Type", "uftp.complete.func",
1968 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
1970 { &hf_uftp_complete_status
,
1971 { "Completion status", "uftp.complete.status",
1972 FT_UINT8
, BASE_DEC
, VALS(comp_status
), 0x0, NULL
, HFILL
}
1974 { &hf_uftp_complete_file_id
,
1975 { "File ID", "uftp.complete.file_id",
1976 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1978 { &hf_uftp_complete_destcount
,
1979 { "Destination Count", "uftp.complete.destcount",
1980 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
1982 { &hf_uftp_complete_reserved2
,
1983 { "Reserved", "uftp.complete.reserved2",
1984 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1986 { &hf_uftp_doneconf
,
1987 { "DONE_CONF", "uftp.doneconf",
1988 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
1990 { &hf_uftp_doneconf_func
,
1991 { "Type", "uftp.doneconf.func",
1992 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
1994 { &hf_uftp_doneconf_reserved1
,
1995 { "Reserved", "uftp.doneconf.reserved1",
1996 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
1998 { &hf_uftp_doneconf_file_id
,
1999 { "File ID", "uftp.doneconf.file_id",
2000 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2002 { &hf_uftp_doneconf_destcount
,
2003 { "Destination Count", "uftp.doneconf.destcount",
2004 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2006 { &hf_uftp_doneconf_reserved2
,
2007 { "Reserved", "uftp.doneconf.reserved2",
2008 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2011 { "HB_REQ", "uftp.hbreq",
2012 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2014 { &hf_uftp_hbreq_func
,
2015 { "Type", "uftp.hbreq.func",
2016 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2018 { &hf_uftp_hbreq_reserved
,
2019 { "Reserved", "uftp.hbreq.reserved",
2020 FT_UINT24
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2022 { &hf_uftp_hbreq_nonce
,
2023 { "Nonce", "uftp.hbreq.nonce",
2024 FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2026 { &hf_uftp_hbreq_keylen
,
2027 { "Key Length", "uftp.hbreq.keylen",
2028 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2030 { &hf_uftp_hbreq_siglen
,
2031 { "Signature Length", "uftp.hbreq.siglen",
2032 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2034 { &hf_uftp_hbreq_keyexp
,
2035 { "Public Key Exponent", "uftp.hbreq.keyexp",
2036 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2038 { &hf_uftp_hbreq_keymod
,
2039 { "Public Key Modulus", "uftp.hbreq.keymod",
2040 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2042 { &hf_uftp_hbreq_verify
,
2043 { "Signature", "uftp.hbreq.verify",
2044 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2047 { "HB_RESP", "uftp.hbresp",
2048 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2050 { &hf_uftp_hbresp_func
,
2051 { "Type", "uftp.hbresp.func",
2052 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2054 { &hf_uftp_hbresp_authenticated
,
2055 { "Authenticated", "uftp.hbresp.authenticated",
2056 FT_UINT8
, BASE_DEC
, VALS(hb_auth_types
), 0x0, NULL
, HFILL
}
2058 { &hf_uftp_hbresp_reserved
,
2059 { "Reserved", "uftp.hbresp.reserved",
2060 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2062 { &hf_uftp_hbresp_nonce
,
2063 { "Nonce", "uftp.hbresp.nonce",
2064 FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2067 { "KEY_REQ", "uftp.keyreq",
2068 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2070 { &hf_uftp_keyreq_func
,
2071 { "Type", "uftp.keyreq.func",
2072 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2074 { &hf_uftp_keyreq_reserved
,
2075 { "Reserved", "uftp.keyreq.reserved",
2076 FT_UINT24
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2078 { &hf_uftp_proxykey
,
2079 { "PROXY_KEY", "uftp.proxykey",
2080 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2082 { &hf_uftp_proxykey_func
,
2083 { "Type", "uftp.proxykey.func",
2084 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2086 { &hf_uftp_proxykey_reserved
,
2087 { "Reserved", "uftp.proxykey.reserved",
2088 FT_UINT24
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2090 { &hf_uftp_proxykey_nonce
,
2091 { "Nonce", "uftp.proxykey.nonce",
2092 FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2094 { &hf_uftp_proxykey_keylen
,
2095 { "Key Length", "uftp.proxykey.keylen",
2096 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2098 { &hf_uftp_proxykey_siglen
,
2099 { "Signature Length", "uftp.proxykey.siglen",
2100 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2102 { &hf_uftp_proxykey_keyexp
,
2103 { "Public Key Exponent", "uftp.proxykey.keyexp",
2104 FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2106 { &hf_uftp_proxykey_keymod
,
2107 { "Public Key Modulus", "uftp.proxykey.keymod",
2108 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2110 { &hf_uftp_proxykey_verify
,
2111 { "Signature", "uftp.proxykey.verify",
2112 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2114 { &hf_uftp_encrypted
,
2115 { "ENCRYPTED", "uftp.encrypted",
2116 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2118 { &hf_uftp_encrypted_tstamp
,
2119 { "Timestamp", "uftp.encrypted.tstamp",
2120 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_UTC
, NULL
, 0x0, NULL
, HFILL
}
2122 { &hf_uftp_encrypted_sig_len
,
2123 { "Signature Length", "uftp.encrypted.sig_len",
2124 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2126 { &hf_uftp_encrypted_payload_len
,
2127 { "Payload Length", "uftp.encrypted.payload_len",
2128 FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
2130 { &hf_uftp_encrypted_signature
,
2131 { "Signature", "uftp.encrypted.signature",
2132 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2134 { &hf_uftp_encrypted_payload
,
2135 { "Encrypted Payload", "uftp.encrypted.payload",
2136 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2139 { "ABORT", "uftp.abort",
2140 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2142 { &hf_uftp_abort_func
,
2143 { "Type", "uftp.abort.func",
2144 FT_UINT8
, BASE_DEC
, VALS(messages
), 0x0, NULL
, HFILL
}
2146 { &hf_uftp_abort_flags
,
2147 { "Flags", "uftp.abort.flags",
2148 FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2150 { &hf_uftp_abort_flags_curfile
,
2151 { "Current file", "uftp.abort.flags.curfile",
2152 FT_BOOLEAN
, 8, NULL
, FLAG_CURRENT_FILE
, NULL
, HFILL
}
2154 { &hf_uftp_abort_flags_reserved
,
2155 { "Reserved", "uftp.abort.flags.reserved",
2156 FT_BOOLEAN
, 8, NULL
, FLAG_ABORT_RESERVED
, NULL
, HFILL
}
2158 { &hf_uftp_abort_reserved
,
2159 { "Reserved", "uftp.abort.reserved",
2160 FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
2162 { &hf_uftp_abort_host
,
2163 { "Host", "uftp.abort.host",
2164 FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2166 { &hf_uftp_abort_message
,
2167 { "Message", "uftp.abort.message",
2168 FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
2172 /* Setup protocol subtree array */
2173 static int *ett
[] = {
2177 &ett_uftp_clientkey
,
2181 &ett_uftp_keyinfo_destkey
,
2193 &ett_uftp_encrypted
,
2195 &ett_uftp_announce_flags
,
2196 &ett_uftp_infoack_flags
,
2197 &ett_uftp_abort_flags
,
2201 static ei_register_info ei
[] = {
2202 { &ei_uftp_length_invalid
, { "uftp.length.invalid", PI_MALFORMED
, PI_ERROR
, "Length is invalid", EXPFILL
}},
2203 { &ei_uftp_func_unknown
, { "uftp.func.invalid", PI_MALFORMED
, PI_ERROR
, "Unknown function", EXPFILL
}}
2206 expert_module_t
* expert_uftp
;
2208 proto_uftp
= proto_register_protocol("UDP based FTP w/ multicast", "UFTP", "uftp");
2210 proto_register_field_array(proto_uftp
, hf
, array_length(hf
));
2211 proto_register_subtree_array(ett
, array_length(ett
));
2212 expert_uftp
= expert_register_protocol(proto_uftp
);
2213 expert_register_field_array(expert_uftp
, ei
, array_length(ei
));
2214 uftp_handle
= register_dissector("uftp", dissect_uftp
, proto_uftp
);
2217 void proto_reg_handoff_uftp(void)
2219 uftp4_handle
= find_dissector("uftp4");
2220 uftp5_handle
= find_dissector("uftp5");
2221 dissector_add_uint_with_preference("udp.port", UFTP_PORT
, uftp_handle
);
2225 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2230 * indent-tabs-mode: nil
2233 * vi: set shiftwidth=4 tabstop=8 expandtab:
2234 * :indentSize=4:tabSize=8:noTabs=true: