2 * HDFS 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 <epan/prefs.h>
20 #include "packet-tcp.h"
22 void proto_register_hdfs(void);
23 void proto_reg_handoff_hdfs(void);
26 #define NAMENODE_PORT 8020
29 #define REQUEST_STR "hrpc"
31 #define SEND_DEC 1936027236
32 #define SEND_OFFSET 13
33 #define HEAR_DEC 1214603634
35 #define TBEA_DEC 1952605537
40 #define FIRST_READ_FRAGMENT_LEN 15
41 #define SECOND_READ_FRAGMENT_LEN 29
45 static const int START
;
46 static const int AUTHENTICATION
= 1;
47 static const int DATA
= 2;
50 static range_t
*tcp_ports
;
52 static int proto_hdfs
;
53 static int hf_hdfs_pdu_type
;
54 static int hf_hdfs_flags
;
55 static int hf_hdfs_sequenceno
;
56 static int hf_hdfs_packetno
;
57 static int hf_hdfs_authlen
;
58 static int hf_hdfs_success
;
59 static int hf_hdfs_auth
;
60 static int hf_hdfs_len
;
61 static int hf_hdfs_strcall
;
62 static int hf_hdfs_params
;
63 static int hf_hdfs_paramtype
;
64 static int hf_hdfs_paramval
;
65 static int hf_hdfs_paramvalnum
;
66 /* static int hf_hdfs_rest; */
67 static int hf_hdfs_fileperm
;
68 static int hf_hdfs_blockloc
;
69 static int hf_hdfs_endblockloc
;
70 static int hf_hdfs_blockgen
;
71 static int hf_hdfs_prover
;
72 static int hf_hdfs_objname
;
73 static int hf_hdfs_filename
;
74 static int hf_hdfs_blockcount
;
75 static int hf_hdfs_ownername
;
76 static int hf_hdfs_groupname
;
77 static int hf_hdfs_namelenone
;
78 static int hf_hdfs_namelentwo
;
79 static int hf_hdfs_accesstime
;
80 static int hf_hdfs_modtime
;
81 static int hf_hdfs_blockrep
;
82 static int hf_hdfs_isdir
;
83 static int hf_hdfs_blocksize
;
84 static int hf_hdfs_filelen
;
85 static int hf_hdfs_construct
;
86 static int hf_hdfs_hostname
;
87 static int hf_hdfs_rackloc
;
88 static int hf_hdfs_adminstate
;
89 static int hf_hdfs_activecon
;
90 static int hf_hdfs_lastupdate
;
91 static int hf_hdfs_remaining
;
92 static int hf_hdfs_dfsused
;
93 static int hf_hdfs_capacity
;
94 static int hf_hdfs_ipcport
;
95 static int hf_hdfs_infoport
;
96 static int hf_hdfs_storageid
;
97 static int hf_hdfs_datanodeid
;
98 static int hf_hdfs_locations
;
99 static int hf_hdfs_offset
;
100 static int hf_hdfs_corrupt
;
101 static int hf_hdfs_identifier
;
102 static int hf_hdfs_password
;
103 static int hf_hdfs_kind
;
104 static int hf_hdfs_service
;
108 static dissector_handle_t hdfs_handle
;
110 /* Parses the parameters of a function.
111 Parses the type length which is always in 2 bytes.
112 Next the type which is the previously found length.
113 If this type is variable length it then reads the length of the data
114 from 2 bytes and then the data.
115 Otherwise reads just the data. */
117 dissect_params (tvbuff_t
*tvb
, proto_tree
*hdfs_tree
, unsigned offset
, int params
) {
121 const uint8_t* type_name
;
122 for (i
= 0; i
< params
; i
++) {
124 /* get length that we just dissected */
125 length
= tvb_get_ntohs(tvb
, offset
);
127 /* 2 bytes = parameter type length */
128 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelentwo
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
131 /* length bytes = parameter type */
132 proto_tree_add_item(hdfs_tree
, hf_hdfs_paramtype
, tvb
, offset
, length
, ENC_ASCII
);
135 if (offset
>= length
&& (!tvb_memeql(tvb
, offset
- length
, (const uint8_t*)"long", length
) || !tvb_memeql(tvb
, offset
- length
, (const uint8_t*)"int", length
) ||
136 !tvb_memeql(tvb
, offset
- length
, (const uint8_t*)"short", length
) || !tvb_memeql(tvb
, offset
- length
, (const uint8_t*)"char", length
) ||
137 !tvb_memeql(tvb
, offset
- length
, (const uint8_t*)"byte", length
) || !tvb_memeql(tvb
, offset
- length
, (const uint8_t*)"float", length
)
138 || !tvb_memeql(tvb
, offset
- length
, (const uint8_t*)"double", length
) || !tvb_memeql(tvb
, offset
- length
, (const uint8_t*)"boolean", length
))) {
140 if (!tvb_memeql(tvb
, offset
- length
, (const uint8_t*)"boolean", length
)) {
142 } else if (!tvb_memeql(tvb
, offset
- length
, (const uint8_t*)"short", length
)) {
145 length
= sizeof(type_name
);
148 proto_tree_add_item(hdfs_tree
, hf_hdfs_paramvalnum
, tvb
, offset
, length
, ENC_BIG_ENDIAN
);
153 length
= tvb_get_ntohs(tvb
, offset
);
155 /* 2 bytes = parameter value length */
156 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelentwo
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
159 proto_tree_add_item(hdfs_tree
, hf_hdfs_paramval
, tvb
, offset
, length
, ENC_ASCII
);
162 if (!tvb_memeql(tvb
, offset
- length
, (const uint8_t*)"org.apache.hadoop.fs.permission.FsPermission", length
)) {
163 proto_tree_add_item(hdfs_tree
, hf_hdfs_fileperm
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
171 /* Dissects a data packet of the form:
172 method name length : 2B
173 method name : above value
174 number of parameters : 4B
175 -- list of parameters the length of above --
176 parameter type length : 2B
177 parameter type : above value
178 -- if the type is variable size --
179 parameter value length : 2B
180 parameter value : above value
182 parameter value : length of the type */
184 dissect_data (tvbuff_t
*tvb
, proto_tree
*hdfs_tree
, unsigned offset
) {
189 length
= tvb_get_ntohs(tvb
, offset
);
191 /* method name length = 2 B */
192 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelentwo
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
195 /* length bytes = method name */
196 proto_tree_add_item(hdfs_tree
, hf_hdfs_strcall
, tvb
, offset
, length
, ENC_ASCII
);
199 /* we only want to parse the packet if it is not a heartbeat (random looking numbers are the decimal
200 representation of sendHeartbeat */
201 if (!(tvb_get_ntohl(tvb
, offset
- SEND_OFFSET
) == SEND_DEC
&& tvb_get_ntohl(tvb
, offset
- HEAR_OFFSET
) == HEAR_DEC
&&
202 tvb_get_ntohl(tvb
, offset
- TBEA_OFFSET
) == TBEA_DEC
&& tvb_get_uint8(tvb
, offset
- T_OFFSET
) == T_DEC
)) {
204 /* get number of params */
205 params
= tvb_get_ntohl(tvb
, offset
);
207 /* 4 bytes = # of parameters */
208 proto_tree_add_item(hdfs_tree
, hf_hdfs_params
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
211 /* go through all params and dissect their type length, type, value length and value */
212 dissect_params (tvb
, hdfs_tree
, offset
, params
);
217 response to a get protocol version message
218 contains a type length, type name and the value
221 dissect_resp_long (tvbuff_t
*tvb
, proto_tree
*hdfs_tree
, int offset
) {
222 /* get length that we just dissected */
223 int length
= tvb_get_ntohs(tvb
, offset
);
225 /* 2 bytes = parameter type length */
226 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelentwo
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
229 /* length bytes = parameter type */
230 proto_tree_add_item(hdfs_tree
, hf_hdfs_paramtype
, tvb
, offset
, length
, ENC_ASCII
);
234 proto_tree_add_item(hdfs_tree
, hf_hdfs_prover
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
241 Response to a file status message
244 dissect_resp_filestatus (tvbuff_t
*tvb
, proto_tree
*hdfs_tree
, int offset
) {
249 proto_tree_add_item(hdfs_tree
, hf_hdfs_fileperm
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
253 length
= tvb_get_ntohs(tvb
, offset
);
255 /* 2 bytes = file name length */
256 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelentwo
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
260 proto_tree_add_item(hdfs_tree
, hf_hdfs_filename
, tvb
, offset
, length
, ENC_ASCII
);
264 /* 8 file size / end location */
265 proto_tree_add_item(hdfs_tree
, hf_hdfs_endblockloc
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
269 proto_tree_add_item(hdfs_tree
, hf_hdfs_isdir
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
272 /* block replication factor */
273 proto_tree_add_item(hdfs_tree
, hf_hdfs_blockrep
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
277 proto_tree_add_item(hdfs_tree
, hf_hdfs_blocksize
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
281 proto_tree_add_item(hdfs_tree
, hf_hdfs_modtime
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
285 proto_tree_add_item(hdfs_tree
, hf_hdfs_accesstime
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
288 /* 2 of file permissions */
289 proto_tree_add_item(hdfs_tree
, hf_hdfs_fileperm
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
294 length
= tvb_get_uint8 (tvb
, offset
);
296 /* owner name length */
297 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelenone
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
301 proto_tree_add_item(hdfs_tree
, hf_hdfs_ownername
, tvb
, offset
, length
, ENC_ASCII
);
305 length
= tvb_get_uint8 (tvb
, offset
);
307 /* group name length */
308 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelenone
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
312 proto_tree_add_item(hdfs_tree
, hf_hdfs_groupname
, tvb
, offset
, length
, ENC_ASCII
);
320 Response to the get block info message
321 parses the sent back information about each blcok
324 dissect_block_info (tvbuff_t
*tvb
, proto_tree
*hdfs_tree
, int offset
) {
328 length
= tvb_get_uint8(tvb
, offset
);
330 /* identifier length */
331 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelenone
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
335 proto_tree_add_item(hdfs_tree
, hf_hdfs_identifier
, tvb
, offset
, length
, ENC_ASCII
);
338 length
= tvb_get_uint8(tvb
, offset
);
340 /* password length */
341 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelenone
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
345 proto_tree_add_item(hdfs_tree
, hf_hdfs_password
, tvb
, offset
, length
, ENC_ASCII
);
348 length
= tvb_get_uint8(tvb
, offset
);
351 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelenone
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
355 proto_tree_add_item(hdfs_tree
, hf_hdfs_kind
, tvb
, offset
, length
, ENC_ASCII
);
358 length
= tvb_get_uint8(tvb
, offset
);
361 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelenone
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
365 proto_tree_add_item(hdfs_tree
, hf_hdfs_service
, tvb
, offset
, length
, ENC_ASCII
);
369 proto_tree_add_item(hdfs_tree
, hf_hdfs_corrupt
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
373 proto_tree_add_item(hdfs_tree
, hf_hdfs_offset
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
377 /* block info section */
380 proto_tree_add_item(hdfs_tree
, hf_hdfs_blockloc
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
384 proto_tree_add_item(hdfs_tree
, hf_hdfs_blocksize
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
388 proto_tree_add_item(hdfs_tree
, hf_hdfs_blockgen
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
392 proto_tree_add_item(hdfs_tree
, hf_hdfs_locations
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
396 /* address section */
399 length
= tvb_get_ntohs(tvb
, offset
);
402 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelentwo
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
406 proto_tree_add_item(hdfs_tree
, hf_hdfs_datanodeid
, tvb
, offset
, length
, ENC_ASCII
);
409 length
= tvb_get_ntohs(tvb
, offset
);
412 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelentwo
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
416 proto_tree_add_item(hdfs_tree
, hf_hdfs_storageid
, tvb
, offset
, length
, ENC_ASCII
);
420 proto_tree_add_item(hdfs_tree
, hf_hdfs_infoport
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
424 /* default name node port */
425 proto_tree_add_item(hdfs_tree
, hf_hdfs_ipcport
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
429 proto_tree_add_item(hdfs_tree
, hf_hdfs_capacity
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
433 proto_tree_add_item(hdfs_tree
, hf_hdfs_dfsused
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
437 proto_tree_add_item(hdfs_tree
, hf_hdfs_remaining
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
441 proto_tree_add_item(hdfs_tree
, hf_hdfs_lastupdate
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
444 /* num active connections */
445 proto_tree_add_item(hdfs_tree
, hf_hdfs_activecon
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
449 length
= tvb_get_uint8(tvb
, offset
);
451 /* location rack length */
452 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelenone
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
456 proto_tree_add_item(hdfs_tree
, hf_hdfs_rackloc
, tvb
, offset
, length
, ENC_ASCII
);
459 length
= tvb_get_uint8(tvb
, offset
);
461 /* hostname length */
462 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelenone
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
466 proto_tree_add_item(hdfs_tree
, hf_hdfs_hostname
, tvb
, offset
, length
, ENC_ASCII
);
469 length
= tvb_get_uint8(tvb
, offset
);
471 /* admin state length */
472 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelenone
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
476 proto_tree_add_item(hdfs_tree
, hf_hdfs_adminstate
, tvb
, offset
, length
, ENC_ASCII
);
486 dissects the response from get block info.
489 dissect_resp_locatedblocks (tvbuff_t
*tvb
, proto_tree
*hdfs_tree
, int offset
) {
492 /* file length = 8 */
493 proto_tree_add_item(hdfs_tree
, hf_hdfs_filelen
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
496 /* under construction = 1 */
497 proto_tree_add_item(hdfs_tree
, hf_hdfs_construct
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
500 /* number of blocks */
501 proto_tree_add_item(hdfs_tree
, hf_hdfs_blockcount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
504 /* dissect info for each block */
505 while (tvb_reported_length(tvb
) - offset
> 0) {
506 offset
= dissect_block_info (tvb
, hdfs_tree
, offset
);
513 dissect_hdfs_message(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
520 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "HDFS");
521 /* Clear out stuff in the info column */
522 col_clear(pinfo
->cinfo
,COL_INFO
);
527 proto_tree
*hdfs_tree
;
529 ti
= proto_tree_add_item(tree
, proto_hdfs
, tvb
, 0, -1, ENC_NA
);
530 hdfs_tree
= proto_item_add_subtree(ti
, ett_hdfs
);
533 if (value_is_in_range(tcp_ports
, pinfo
->srcport
)) {
534 /* 4 bytes = sequence number */
535 proto_tree_add_item(hdfs_tree
, hf_hdfs_packetno
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
538 /* 4 bytes = status -> 0000 = success, 0001 = error, ffff = fatal */
539 success
= tvb_get_ntohl(tvb
, offset
);
540 proto_tree_add_item(hdfs_tree
, hf_hdfs_success
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
547 if (!tvb_memeql(tvb
, offset
+ 2, (const uint8_t*)"long", 4)) {
548 dissect_resp_long (tvb
, hdfs_tree
, offset
);
552 /* name length = 2 B */
553 length
= tvb_get_ntohs(tvb
, offset
);
554 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelentwo
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
557 /* length bytes = method name */
558 proto_tree_add_item(hdfs_tree
, hf_hdfs_objname
, tvb
, offset
, length
, ENC_ASCII
);
561 /* get length that we just dissected */
562 length
= tvb_get_ntohs(tvb
, offset
);
564 /* 2 bytes = objects length */
565 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelentwo
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
568 /* length bytes = object name */
569 proto_tree_add_item(hdfs_tree
, hf_hdfs_objname
, tvb
, offset
, length
, ENC_ASCII
);
572 /* responses about block location info */
573 if (!tvb_memeql(tvb
, offset
- length
, (const uint8_t*)"org.apache.hadoop.hdfs.protocol.LocatedBlocks", length
)) {
574 dissect_resp_locatedblocks (tvb
, hdfs_tree
, offset
);
576 /* responses about file statuses */
577 } else if (!tvb_memeql(tvb
, offset
- length
, (const uint8_t*)"org.apache.hadoop.hdfs.protocol.HdfsFileStatus", length
)) {
578 dissect_resp_filestatus (tvb
, hdfs_tree
, offset
);
582 length
= tvb_get_ntohs(tvb
, offset
);
584 /* 2 bytes = parameter value length */
585 proto_tree_add_item(hdfs_tree
, hf_hdfs_namelentwo
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
588 /* the value of the parameter */
589 proto_tree_add_item(hdfs_tree
, hf_hdfs_paramval
, tvb
, offset
, length
, ENC_ASCII
);
590 /*offset += length;*/
594 /* Request to namenode */
597 /* check the packet length */
598 unsigned auth
= tvb_get_ntohl(tvb
, offset
);
600 /* first setup packet starts with "hrpc" */
601 if (!tvb_memeql(tvb
, offset
, (const uint8_t*)REQUEST_STR
, sizeof(REQUEST_STR
) - 1)) {
603 proto_tree_add_item(hdfs_tree
, hf_hdfs_sequenceno
, tvb
, offset
, sizeof(REQUEST_STR
) - 1, ENC_ASCII
);
604 offset
+= (int)sizeof(REQUEST_STR
) - 1;
606 proto_tree_add_item(hdfs_tree
, hf_hdfs_pdu_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
609 proto_tree_add_item(hdfs_tree
, hf_hdfs_flags
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
613 /* second authentication packet */
614 if (auth
+ 4 != tvb_reported_length(tvb
)) {
616 /* authentication length (read out of first 4 bytes) */
617 length
= tvb_get_ntohl(tvb
, offset
);
618 proto_tree_add_item(hdfs_tree
, hf_hdfs_authlen
, tvb
, offset
, 4, ENC_ASCII
);
621 /* authentication (length the number we just got) */
622 proto_tree_add_item(hdfs_tree
, hf_hdfs_auth
, tvb
, offset
, length
, ENC_ASCII
);
628 /* 4 bytes = length */
629 proto_tree_add_item(hdfs_tree
, hf_hdfs_len
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
632 /* 4 bytes = sequence number */
633 proto_tree_add_item(hdfs_tree
, hf_hdfs_packetno
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
636 /* dissect packet data */
637 dissect_data (tvb
, hdfs_tree
, offset
);
641 return tvb_captured_length(tvb
);
644 /* determine PDU length of protocol */
645 static unsigned get_hdfs_message_len(packet_info
*pinfo _U_
, tvbuff_t
*tvb
,
646 int offset _U_
, void *data _U_
)
648 int len
= tvb_reported_length(tvb
);
650 if (tvb_reported_length(tvb
) == 1448 || tvb_reported_length(tvb
) == 1321) {
651 len
= 150 * tvb_get_ntohs(tvb
, 113) + 115 ;
659 dissect_hdfs(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data
)
661 int frame_header_len
= 0;
662 bool need_reassemble
= false;
664 frame_header_len
= tvb_reported_length(tvb
);
666 if (frame_header_len
== 1448 || frame_header_len
== 1321) {
667 need_reassemble
= true;
670 tcp_dissect_pdus(tvb
, pinfo
, tree
, need_reassemble
, frame_header_len
, get_hdfs_message_len
, dissect_hdfs_message
, data
);
671 return tvb_captured_length(tvb
);
675 apply_hdfs_prefs(void)
677 /* HDFS uses the port preference to determine request/response */
678 tcp_ports
= prefs_get_range_value("hdfs", "tcp.port");
681 /* registers the protcol with the given names */
683 proto_register_hdfs(void)
686 static hf_register_info hf
[] = {
688 /* list of all options for dissecting the protocol */
690 /*************************************************
692 **************************************************/
693 { &hf_hdfs_sequenceno
,
694 { "HDFS protocol type", "hdfs.type",
695 FT_STRING
, BASE_NONE
,
700 { "HDFS protocol version", "hdfs.version",
706 { "HDFS authentication type", "hdfs.auth_type",
711 /***********************************************
712 Authentication packet
713 ***********************************************/
715 { "HDFS authentication length", "hdfs.authlen",
716 FT_STRING
, BASE_NONE
,
721 { "HDFS authorization bits", "hdfs.auth",
722 FT_STRING
, BASE_NONE
,
726 /**********************************************
728 **********************************************/
730 { "HDFS packet number", "hdfs.seqno",
736 { "HDFS success", "hdfs.success",
742 { "HDFS method name", "hdfs.strcall",
743 FT_STRING
, BASE_NONE
,
749 { "HDFS value", "hdfs.rest",
750 FT_STRING
, BASE_NONE
,
756 { "HDFS block location", "hdfs.blockloc",
761 { &hf_hdfs_blocksize
,
762 { "HDFS block size", "hdfs.blocksize",
767 { &hf_hdfs_endblockloc
,
768 { "HDFS file size", "hdfs.endblockloc",
774 { "HDFS block gen", "hdfs.blockgen",
780 { "HDFS protocol version", "hdfs.prover",
786 { "HDFS object name", "hdfs.objname",
787 FT_STRING
, BASE_NONE
,
792 { "HDFS file name", "hdfs.filename",
793 FT_STRING
, BASE_NONE
,
797 { &hf_hdfs_blockcount
,
798 { "HDFS block count", "hdfs.blockcount",
803 { &hf_hdfs_ownername
,
804 { "HDFS owner name", "hdfs.ownername",
805 FT_STRING
, BASE_NONE
,
809 { &hf_hdfs_groupname
,
810 { "HDFS group name", "hdfs.groupname",
811 FT_STRING
, BASE_NONE
,
815 { &hf_hdfs_accesstime
,
816 { "HDFS access time", "hdfs.accesstime",
822 { "HDFS modified time", "hdfs.modtime",
828 { "HDFS block replication factor", "hdfs.blockrep",
834 { "HDFS is directory", "hdfs.isdir",
840 { "HDFS file length", "hdfs.filelen",
845 { &hf_hdfs_construct
,
846 { "HDFS under construction", "hdfs.construct",
852 { "HDFS rack location", "hdfs.rackloc",
853 FT_STRING
, BASE_NONE
,
857 { &hf_hdfs_adminstate
,
858 { "HDFS admin state", "hdfs.adminstate",
859 FT_STRING
, BASE_NONE
,
864 { "HDFS hostname", "hdfs.hostname",
865 FT_STRING
, BASE_NONE
,
871 { &hf_hdfs_namelenone
,
872 { "HDFS name length", "hdfs.namelenone",
877 { &hf_hdfs_namelentwo
,
878 { "HDFS name length", "hdfs.namelentwo",
885 /***************************************
887 ***************************************/
888 { &hf_hdfs_activecon
,
889 { "HDFS active connections", "hdfs.activecon",
894 { &hf_hdfs_lastupdate
,
895 { "HDFS lastupdate", "hdfs.lastupdate",
900 { &hf_hdfs_remaining
,
901 { "HDFS remaining", "hdfs.remaining",
907 { "HDFS dfs used", "hdfs.dfsused",
913 { "HDFS capacity", "hdfs.capacity",
919 { "HDFS ipcport", "hdfs.ipcport",
925 { "HDFS info port", "hdfs.infoport",
930 { &hf_hdfs_storageid
,
931 { "HDFS storage id", "hdfs.storageid",
932 FT_STRING
, BASE_NONE
,
936 { &hf_hdfs_datanodeid
,
937 { "HDFS datanodeid", "hdfs.datanodeid",
938 FT_STRING
, BASE_NONE
,
942 { &hf_hdfs_locations
,
943 { "HDFS locations", "hdfs.locations",
949 { &hf_hdfs_identifier
,
950 { "HDFS locations", "hdfs.identifier",
951 FT_STRING
, BASE_NONE
,
956 { "HDFS password", "hdfs.password",
957 FT_STRING
, BASE_NONE
,
962 { "HDFS kind", "hdfs.kind",
963 FT_STRING
, BASE_NONE
,
968 { "HDFS locations", "hdfs.service",
969 FT_STRING
, BASE_NONE
,
974 { "HDFS corrupt", "hdfs.corrupt",
980 { "HDFS offset", "hdfs.offset",
987 /***********************************************
989 ***********************************************/
991 { "HDFS length", "hdfs.len",
996 /* packet number, same as in response
997 method name length, same as in response
998 string call, same as in response */
1000 { "HDFS number of parameters", "hdfs.params",
1001 FT_UINT32
, BASE_DEC
,
1005 { &hf_hdfs_paramtype
,
1006 { "HDFS parameter type", "hdfs.paramtype",
1007 FT_STRING
, BASE_NONE
,
1011 { &hf_hdfs_paramval
,
1012 { "HDFS parameter value", "hdfs.paramval",
1013 FT_STRING
, BASE_NONE
,
1017 /* param value that is displayed as a number not a string */
1018 { &hf_hdfs_paramvalnum
,
1019 { "HDFS parameter value", "hdfs.paramvalnum",
1024 { &hf_hdfs_fileperm
,
1025 { "HDFS File permission", "hdfs.fileperm",
1033 /* Setup protocol subtree array */
1034 static int *ett
[] = {
1038 proto_hdfs
= proto_register_protocol ("HDFS Protocol", "HDFS", "hdfs");
1040 proto_register_field_array(proto_hdfs
, hf
, array_length(hf
));
1041 proto_register_subtree_array(ett
, array_length(ett
));
1043 prefs_register_protocol(proto_hdfs
, apply_hdfs_prefs
);
1044 hdfs_handle
= register_dissector("hdfs", dissect_hdfs
, proto_hdfs
);
1047 /* registers handoff */
1049 proto_reg_handoff_hdfs(void)
1051 dissector_add_for_decode_as_with_preference("tcp.port", hdfs_handle
);
1060 * indent-tabs-mode: nil
1063 * ex: set shiftwidth=4 tabstop=8 expandtab:
1064 * :indentSize=4:tabSize=8:noTabs=true: