2 * HDFS data Protocol and dissectors
4 * Copyright (c) 2011 by Isilon Systems.
6 * Author: Allison Obourn <aobourn@isilon.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1999 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
18 #include <epan/packet.h>
19 #include "packet-tcp.h"
21 void proto_register_hdfsdata(void);
22 void proto_reg_handoff_hdfsdata(void);
25 #define NAMENODE_PORT 8020
26 #define DATANODE_PORT 8021
29 #define FIRST_READ_FRAGMENT_LEN 15
30 #define SECOND_READ_FRAGMENT_LEN 29
31 #define LAST_READ_FRAGMENT_LEN 4
34 #define MIN_WRITE_REQ 35
35 #define MIN_READ_REQ 36
37 #define STATUS_SUCCESS 6
38 #define PIPELINE_LEN 1
40 #define FINISH_REQ_LEN 4
41 #define END_PACKET_LEN 8
42 #define READ_RESP_HEAD_LEN 19
43 #define WRITE_RESP_HEAD_LEN 21
44 #define WRITE_REQ_HEAD_LEN 7
48 #define CHUNKSIZE_START 3
52 static const int RESPONSE_HEADER
= 1;
53 static const int RESPONSE_METADATA
= 2;
54 static const int RESPONSE_DATA
= 3;
57 static int proto_hdfsdata
;
58 static int hf_hdfsdata_version
;
59 static int hf_hdfsdata_cmd
;
60 static int hf_hdfsdata_blockid
;
61 static int hf_hdfsdata_timestamp
;
62 static int hf_hdfsdata_startoffset
;
63 static int hf_hdfsdata_blocklen
;
64 static int hf_hdfsdata_clientlen
;
65 static int hf_hdfsdata_clientid
;
66 static int hf_hdfsdata_tokenlen
;
67 static int hf_hdfsdata_tokenid
;
68 static int hf_hdfsdata_tokenpassword
;
69 static int hf_hdfsdata_tokentype
;
70 static int hf_hdfsdata_tokenservice
;
71 static int hf_hdfsdata_status
;
72 static int hf_hdfsdata_checksumtype
;
73 static int hf_hdfsdata_chunksize
;
74 static int hf_hdfsdata_chunkoffset
;
75 static int hf_hdfsdata_datalength
;
76 static int hf_hdfsdata_inblockoffset
;
77 static int hf_hdfsdata_seqnum
;
78 static int hf_hdfsdata_last
;
79 static int hf_hdfsdata_crc32
;
80 static int hf_hdfsdata_datalen
;
81 static int hf_hdfsdata_rest
;
82 static int hf_hdfsdata_end
;
83 static int hf_hdfsdata_packetsize
;
84 static int hf_hdfsdata_chunklength
;
85 static int hf_hdfsdata_crc64
;
86 static int hf_hdfsdata_pipelinestatus
;
88 static int hf_hdfsdata_pipelinenum
;
89 static int hf_hdfsdata_recovery
;
90 static int hf_hdfsdata_sourcenode
;
91 static int hf_hdfsdata_currentpipeline
;
92 static int hf_hdfsdata_node
;
94 static int ett_hdfsdata
;
96 static dissector_handle_t hdfsdata_handle
;
99 Parse the first byte of a vint/vlong to determine the number of bytes
100 value is the first byte of the vint/vlong
101 returns the total number of bytes (1 to 9) */
103 decode_vint_size (int8_t value
) {
106 } else if (value
< -120) {
113 converts a variable length number into a long and discovers how many bytes it is
114 returns the decoded number */
116 dissect_variable_length_long (tvbuff_t
*tvb
, proto_tree
*hdfsdata_tree
, int* offset
)
121 int8_t first_byte
= tvb_get_uint8(tvb
, *offset
);
124 int len
= decode_vint_size(first_byte
);
126 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_clientlen
, tvb
, *offset
, byte_count
, ENC_BIG_ENDIAN
);
127 *offset
= (*offset
) + byte_count
;
131 for (idx
= 0; idx
< len
-1; idx
++) {
132 char b
= tvb_get_uint8(tvb
, *offset
+ byte_count
);
137 size
= ((first_byte
< -120 || (first_byte
>= -112 && first_byte
< 0)) ? (i
^ 0xFFFFFFFF) : i
);
138 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_clientlen
, tvb
, *offset
, byte_count
, ENC_BIG_ENDIAN
);
139 *offset
= (*offset
) + byte_count
;
144 /* dissects a variable length int and then using its value dissects the following string */
146 dissect_variable_int_string(tvbuff_t
*tvb
, proto_tree
*hdfsdata_tree
, int *offset
)
148 /* Get the variable length int that represents the length of the next field */
149 int len
= dissect_variable_length_long (tvb
, hdfsdata_tree
, offset
);
151 /* client id = amount of bytes in previous */
152 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_clientid
, tvb
, *offset
, len
, ENC_ASCII
);
156 /* dissects the access tokens that appear at the end of requests.
157 tokens: id, password, kind, service */
159 dissect_access_tokens(tvbuff_t
*tvb
, proto_tree
*hdfsdata_tree
, int *offset
)
163 len
= tvb_get_uint8(tvb
, *offset
);
164 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_tokenlen
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
167 /* token id = amount of bytes in previous */
168 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_tokenid
, tvb
, *offset
, len
, ENC_ASCII
);
171 len
= tvb_get_uint8(tvb
, *offset
);
172 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_tokenlen
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
175 /* token password = amount of bytes in previous */
176 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_tokenpassword
, tvb
, *offset
, len
, ENC_ASCII
);
179 len
= tvb_get_uint8(tvb
, *offset
);
180 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_tokenlen
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
183 /* token type = amount of bytes in previous */
184 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_tokentype
, tvb
, *offset
, len
, ENC_ASCII
);
187 len
= tvb_get_uint8(tvb
, *offset
);
188 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_tokenlen
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
191 /* token service = amount of bytes in previous; */
192 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_tokenservice
, tvb
, *offset
, len
, ENC_ASCII
);
196 /* handles parsing read response packets */
198 dissect_read_response(tvbuff_t
*tvb
, proto_tree
*hdfsdata_tree
, int offset
)
203 /* 4 bytes = data length */
204 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_datalength
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
207 /* 8 bytes = in block offset */
208 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_inblockoffset
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
211 /* 8 bytes = sequence number */
212 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_seqnum
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
215 /* 1 byte = last packet in block */
216 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_last
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
219 /* 4 byte = length of data */
220 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_datalen
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
223 /* if there is a crc checksum it is 8* the length of the data * checksum size / chunksize */
224 chunksize
= tvb_get_ntohl(tvb
, CHUNKSIZE_START
);
225 if (chunksize
== 0) /* let's not divide by zero */
227 if (tvb_get_uint8(tvb
, 2) == CRC
) {
228 len
= (int)(CRC_SIZE
* tvb_get_ntohl(tvb
, offset
- 4) *
229 tvb_get_ntohl(tvb
, offset
- 8) / chunksize
);
232 /* the rest of bytes (usually 4) = crc32 code */
233 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_crc32
, tvb
, offset
, len
, ENC_BIG_ENDIAN
);
237 /* dissects the first packet of the read response */
239 dissect_read_response_start(tvbuff_t
*tvb
, proto_tree
*hdfsdata_tree
, int offset
) {
240 /* 2 bytes = status code */
241 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_status
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
244 /* checksum type = 1 byte. 1 = crc32, 0 = null */
245 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_checksumtype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
248 /* 4 bytes = chunksize */
249 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_chunksize
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
252 /* 8 bytes = chunk offset */
253 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_chunkoffset
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
257 /* dissects the fields specific to a read request */
259 dissect_read_request(tvbuff_t
*tvb
, proto_tree
*hdfsdata_tree
, int *offset
)
262 /* 8 bytes = start offset */
263 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_startoffset
, tvb
, *offset
, 8, ENC_BIG_ENDIAN
);
266 /* 8 bytes = block length */
267 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_blocklen
, tvb
, *offset
, 8, ENC_BIG_ENDIAN
);
272 /* dissects the fields specific to a write request */
274 dissect_write_request(tvbuff_t
*tvb
, proto_tree
*hdfsdata_tree
, int *offset
)
276 /* 4 bytes = number of nodes in pipeline */
277 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_pipelinenum
, tvb
, *offset
, 4, ENC_BIG_ENDIAN
);
280 /* 1 bytes = recovery boolean */
281 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_recovery
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
285 /* dissects the fields specific to a write request */
287 dissect_write_request_end(tvbuff_t
*tvb
, proto_tree
*hdfsdata_tree
, int *offset
)
292 /* 1 bytes = source node */
293 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_sourcenode
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
296 /* 4 bytes = number of nodes currently in the pipeline (usually just -1 of before) */
297 len
= tvb_get_ntohl(tvb
, *offset
);
298 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_currentpipeline
, tvb
, *offset
, 4, ENC_BIG_ENDIAN
);
301 /* variable length sequence of node objects */
302 for (i
= 0; i
< len
; i
++) {
303 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_node
, tvb
, *offset
, 4, ENC_BIG_ENDIAN
);
308 /* dissects the beginning of the read and write request messages */
310 dissect_header(tvbuff_t
*tvb
, proto_tree
*hdfsdata_tree
, int* offset
){
314 /* 2 bytes = protocol version */
315 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_version
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
318 /* 1 byte = command */
319 command
= tvb_get_uint8(tvb
, *offset
);
320 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_cmd
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
323 /* 8 bytes = block id */
324 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_blockid
, tvb
, *offset
, 8, ENC_BIG_ENDIAN
);
327 /* 8 bytes = timestamp */
328 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_timestamp
, tvb
, *offset
, 8, ENC_BIG_ENDIAN
);
334 /* decodes the write response messages */
336 dissect_write_response(tvbuff_t
*tvb
, proto_tree
*hdfsdata_tree
, int offset
)
338 /* 4 bytes = packetsize */
339 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_packetsize
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
342 /* 8 bytes = offset in block */
343 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_startoffset
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
346 /* 8 bytes = sequence number */
347 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_seqnum
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
350 /* 1 bytes = last packet */
351 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_last
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
354 /* 4 bytes = chunk length */
355 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_chunklength
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
358 /* 8 bytes = crc code */
359 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_crc64
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
362 /* add the rest -> RESPONSE_DATA */
363 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_rest
, tvb
, offset
, (tvb_reported_length(tvb
)) - offset
, ENC_ASCII
);
364 /* offset += (tvb_reported_length(tvb)); */
367 /* determine PDU length of protocol */
369 get_hdfsdata_message_len(packet_info
*pinfo _U_
, tvbuff_t
*tvb
, int offset
, void *data _U_
)
371 /* get data packet len, add FIRST_READ_FRAGMENT_LEN for first fragment (before len),
372 SECOND_READ_FRAGMENT_LEN for second fragment (incl len), subtract 4 for length itself. */
374 if (tvb_reported_length(tvb
) <= 4 || tvb_reported_length(tvb
) == END_PACKET_LEN
375 || tvb_get_ntohl(tvb
, 0) == tvb_reported_length(tvb
) - WRITE_RESP_HEAD_LEN
376 || (tvb_reported_length(tvb
) >= MIN_READ_REQ
&& tvb_get_uint8(tvb
, 2) == READ_OP
)
377 || (tvb_reported_length(tvb
) >= MIN_WRITE_REQ
&& tvb_get_uint8(tvb
, 2) == WRITE_OP
)) {
379 return tvb_reported_length(tvb
);
381 return tvb_get_ntohl(tvb
, offset
+ FIRST_READ_FRAGMENT_LEN
) +
382 FIRST_READ_FRAGMENT_LEN
+ SECOND_READ_FRAGMENT_LEN
- LAST_READ_FRAGMENT_LEN
;
385 /* This method dissects fully reassembled messages */
387 dissect_hdfsdata_message(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
391 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "HDFSDATA");
392 /* Clear out stuff in the info column */
393 col_set_str(pinfo
->cinfo
, COL_INFO
, "HDFS Data");
397 proto_item
*ti
= NULL
;
398 proto_tree
*hdfsdata_tree
= NULL
;
400 ti
= proto_tree_add_item(tree
, proto_hdfsdata
, tvb
, offset
, -1, ENC_NA
);
401 hdfsdata_tree
= proto_item_add_subtree(ti
, ett_hdfsdata
);
403 /* if only 1 bytes packet must just contain just the pipeline status */
404 if ((tvb_reported_length(tvb
)) == PIPELINE_LEN
) {
406 /* 1 bytes = pipeline status */
407 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_pipelinestatus
, tvb
, offset
, PIPELINE_LEN
, ENC_BIG_ENDIAN
);
409 /* if only 2 bytes packet must just contain just a status code */
410 } else if ((tvb_reported_length(tvb
)) == STATUS_LEN
) {
411 /* 2 bytes = status code */
412 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_status
, tvb
, offset
, STATUS_LEN
, ENC_BIG_ENDIAN
);
414 /* if it is 4 bytes long it must be a finish request packet */
415 } else if ((tvb_reported_length(tvb
)) == FINISH_REQ_LEN
) {
416 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_end
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
418 /* read response packet */
419 } else if (tvb_reported_length(tvb
) >= READ_RESP_HEAD_LEN
&& tvb_reported_length(tvb
) ==
420 tvb_get_ntohl(tvb
, FIRST_READ_FRAGMENT_LEN
) +
421 FIRST_READ_FRAGMENT_LEN
+ SECOND_READ_FRAGMENT_LEN
- LAST_READ_FRAGMENT_LEN
){
423 dissect_read_response_start(tvb
, hdfsdata_tree
, offset
);
424 offset
+= FIRST_READ_FRAGMENT_LEN
;
426 dissect_read_response(tvb
, hdfsdata_tree
, offset
);
427 offset
+= SECOND_READ_FRAGMENT_LEN
;
429 /* This message just contains data so we can display it all as one block */
431 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_rest
, tvb
, offset
, (tvb_reported_length(tvb
)) - offset
, ENC_ASCII
);
435 uint8_t op
= tvb_get_uint8(tvb
, 2);
438 if ((tvb_reported_length(tvb
)) >= MIN_READ_REQ
&& op
== READ_OP
) {
439 dissect_header(tvb
, hdfsdata_tree
, &offset
);
440 dissect_read_request(tvb
, hdfsdata_tree
, &offset
);
441 dissect_variable_int_string(tvb
, hdfsdata_tree
, &offset
);
442 dissect_access_tokens(tvb
, hdfsdata_tree
, &offset
);
445 } else if ((tvb_reported_length(tvb
)) >= MIN_WRITE_REQ
&& op
== WRITE_OP
) {
446 dissect_header(tvb
, hdfsdata_tree
, &offset
);
447 dissect_write_request(tvb
, hdfsdata_tree
, &offset
);
448 dissect_variable_int_string(tvb
, hdfsdata_tree
, &offset
);
449 dissect_write_request_end(tvb
, hdfsdata_tree
, &offset
);
450 dissect_access_tokens(tvb
, hdfsdata_tree
, &offset
);
452 /* checksum type = 1 byte. 1 = crc32, 0 = null */
453 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_checksumtype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
456 /* 4 bytes = chunksize */
457 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_chunksize
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
459 /* write responses store the data length in the first 4 bytes. This length does not
460 include 21 bits of header */
461 } else if (tvb_reported_length(tvb
) >= 4 && tvb_get_ntohl(tvb
, 0) ==
462 tvb_reported_length(tvb
) - WRITE_RESP_HEAD_LEN
) {
464 dissect_write_response(tvb
, hdfsdata_tree
, offset
);
467 /* This message contains some form of data that we have not successfully been able to
468 pattern match and catagorize. Display all of it as data. */
469 proto_tree_add_item(hdfsdata_tree
, hf_hdfsdata_rest
, tvb
, offset
, (tvb_reported_length(tvb
)), ENC_ASCII
);
474 return tvb_captured_length(tvb
);
478 dissect_hdfsdata(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data
)
480 int frame_header_len
= 0;
482 bool need_reassemble
= false;
484 bool only_packet
= tvb_reported_length(tvb
) == 1 || (tvb_reported_length(tvb
) == 2 &&
485 tvb_get_ntohs(tvb
, 0) == STATUS_SUCCESS
);
487 if (tvb_reported_length(tvb
) >= 3)
488 op
= tvb_get_uint8(tvb
, 2);
490 if (!only_packet
&& tvb_reported_length(tvb
) != 4 && !(tvb_reported_length(tvb
) >= MIN_READ_REQ
&& op
== READ_OP
) &&
491 !(tvb_reported_length(tvb
) >= MIN_WRITE_REQ
&& op
== WRITE_OP
) && !(tvb_reported_length(tvb
) == END_PACKET_LEN
&&
492 !tvb_get_ntohl(tvb
, 0) && !tvb_get_ntohl(tvb
, 4))) {
494 need_reassemble
= true;
497 /* setting the header size for the different types of packets */
498 if (only_packet
|| tvb_reported_length(tvb
) == END_PACKET_LEN
) {
499 frame_header_len
= tvb_reported_length(tvb
);
501 } else if (tvb_reported_length(tvb
) == FIRST_READ_FRAGMENT_LEN
||(tvb_reported_length(tvb
) >= MIN_READ_REQ
&&
502 op
== READ_OP
&& !((tvb_reported_length(tvb
)) == 2 && !tvb_get_ntohs(tvb
, 0)))) {
504 frame_header_len
= READ_RESP_HEAD_LEN
;
506 } else if (tvb_reported_length(tvb
) >= MIN_WRITE_REQ
&& op
== WRITE_OP
) {
507 frame_header_len
= WRITE_REQ_HEAD_LEN
;
510 tcp_dissect_pdus(tvb
, pinfo
, tree
, need_reassemble
, frame_header_len
, get_hdfsdata_message_len
, dissect_hdfsdata_message
, data
);
511 return tvb_captured_length(tvb
);
514 /* registers the protocol with the given names */
516 proto_register_hdfsdata(void)
518 static hf_register_info hf
[] = {
520 /* list of all options for dissecting the protocol */
522 /*************************************************
524 **************************************************/
525 { &hf_hdfsdata_version
,
526 { "HDFSDATA protocol version", "hdfsdata.version",
532 { "HDFSDATA command", "hdfsdata.cmd",
537 { &hf_hdfsdata_blockid
,
538 { "HDFSDATA block id", "hdfsdata.blockid",
543 { &hf_hdfsdata_timestamp
,
544 { "HDFSDATA timestamp", "hdfsdata.timestamp",
552 { &hf_hdfsdata_startoffset
,
553 { "HDFSDATA start offset", "hdfsdata.startoffset",
558 { &hf_hdfsdata_blocklen
,
559 { "HDFSDATA block length", "hdfsdata.blocklen",
567 { &hf_hdfsdata_pipelinenum
,
568 { "HDFSDATA number in pipeline", "hdfsdata.pipelinenum",
573 { &hf_hdfsdata_recovery
,
574 { "HDFSDATA recovery boolean", "hdfsdata.recovery",
579 { &hf_hdfsdata_sourcenode
,
580 { "HDFSDATA source node", "hdfsdata.sourcenode",
585 { &hf_hdfsdata_currentpipeline
,
586 { "HDFSDATA current number of nodes in the pipeline", "hdfsdata.currentpipeline",
592 { "HDFSDATA node object", "hdfsdata.node",
600 { &hf_hdfsdata_clientlen
,
601 { "HDFSDATA client id length", "hdfsdata.clientlen",
606 { &hf_hdfsdata_clientid
,
607 { "HDFSDATA client id", "hdfsdata.clientid",
608 FT_STRING
, BASE_NONE
,
613 { "HDFSDATA end data request", "hdfsdata.end",
618 /*************************************************
620 **************************************************/
621 { &hf_hdfsdata_tokenlen
,
622 { "HDFSDATA access token length", "hdfsdata.tokenlen",
627 { &hf_hdfsdata_tokenid
,
628 { "HDFSDATA access token ID", "hdfsdata.tokenid",
629 FT_STRING
, BASE_NONE
,
633 { &hf_hdfsdata_tokenpassword
,
634 { "HDFSDATA access token password", "hdfsdata.tokenpassword",
635 FT_STRING
, BASE_NONE
,
639 { &hf_hdfsdata_tokentype
,
640 { "HDFSDATA access token type", "hdfsdata.tokentype",
641 FT_STRING
, BASE_NONE
,
645 { &hf_hdfsdata_tokenservice
,
646 { "HDFSDATA access token service", "hdfsdata.tokenservice",
647 FT_STRING
, BASE_NONE
,
651 /***********************************************
653 ***********************************************/
654 { &hf_hdfsdata_status
,
655 { "HDFSDATA status code", "hdfsdata.status",
660 { &hf_hdfsdata_checksumtype
,
661 { "HDFSDATA checksum type", "hdfsdata.checksumtype",
666 { &hf_hdfsdata_chunksize
,
667 { "HDFSDATA chunk size", "hdfsdata.chunksize",
672 { &hf_hdfsdata_chunkoffset
,
673 { "HDFSDATA chunk offset", "hdfsdata.chunkoffset",
678 /***********************************************
680 ***********************************************/
681 { &hf_hdfsdata_datalength
,
682 { "HDFSDATA length of data", "hdfsdata.datalength",
687 { &hf_hdfsdata_inblockoffset
,
688 { "HDFSDATA in block offset", "hdfsdata.inblockoffset",
693 { &hf_hdfsdata_seqnum
,
694 { "HDFSDATA sequence number", "hdfsdata.seqnum",
700 { "HDFSDATA last packet in block", "hdfsdata.last",
705 { &hf_hdfsdata_datalen
,
706 { "HDFSDATA length of data", "hdfsdata.datalen",
711 { &hf_hdfsdata_crc32
,
712 { "HDFSDATA crc32 checksum", "hdfsdata.crc32",
717 /***********************************************
719 ***********************************************/
721 { "HDFSDATA data", "hdfsdata.rest",
722 FT_STRING
, BASE_NONE
,
726 /***********************************************
728 ***********************************************/
729 { &hf_hdfsdata_packetsize
,
730 { "HDFSDATA packet size", "hdfsdata.packetsize",
735 { &hf_hdfsdata_chunklength
,
736 { "HDFSDATA chunk length", "hdfsdata.chunklength",
741 { &hf_hdfsdata_crc64
,
742 { "HDFSDATA crc64 checksum", "hdfsdata.crc64",
747 { &hf_hdfsdata_pipelinestatus
,
748 { "HDFSDATA pipeline status", "hdfsdata.pipelinestatus",
755 /* Setup protocol subtree array */
756 static int *ett
[] = {
760 proto_hdfsdata
= proto_register_protocol ("HDFSDATA Protocol", "HDFSDATA", "hdfsdata");
762 proto_register_field_array(proto_hdfsdata
, hf
, array_length(hf
));
763 proto_register_subtree_array(ett
, array_length(ett
));
765 hdfsdata_handle
= register_dissector("hdfsdata", dissect_hdfsdata
, proto_hdfsdata
);
768 /* registers handoff */
770 proto_reg_handoff_hdfsdata(void)
772 dissector_add_for_decode_as_with_preference("tcp.port", hdfsdata_handle
);
780 * indent-tabs-mode: nil
783 * ex: set shiftwidth=2 tabstop=8 expandtab:
784 * :indentSize=2:tabSize=8:noTabs=true: