aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-tftp.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2013-12-12 23:11:04 +0000
committerBill Meier <wmeier@newsguy.com>2013-12-12 23:11:04 +0000
commit37f60fa2d62eeed4a9fc31142fb036cc4ecf1a20 (patch)
treee22c68a294e2d7d0e75d939e265450fd9861378e /epan/dissectors/packet-tftp.c
parent5db2d622e4fa800d406efe94d0b961bebd60420c (diff)
In one or more of the files:
- Create/use some extended value-strings; - Remove some unneeded initializers; - 'offset++' --> 'offset += 1' for consistency; - Set editor modelines 'tab-width' to 8 (not 4); - tabs --> spaces (to match editor modelines); - Rework/add whitespace. svn path=/trunk/; revision=53998
Diffstat (limited to 'epan/dissectors/packet-tftp.c')
-rw-r--r--epan/dissectors/packet-tftp.c504
1 files changed, 252 insertions, 252 deletions
diff --git a/epan/dissectors/packet-tftp.c b/epan/dissectors/packet-tftp.c
index 2517984abb..6cd181d138 100644
--- a/epan/dissectors/packet-tftp.c
+++ b/epan/dissectors/packet-tftp.c
@@ -55,8 +55,8 @@ void proto_register_tftp(void);
/* Things we may want to remember for a whole conversation */
typedef struct _tftp_conv_info_t {
- guint16 blocksize;
- gchar *source_file, *destination_file;
+ guint16 blocksize;
+ gchar *source_file, *destination_file;
} tftp_conv_info_t;
@@ -86,13 +86,13 @@ void proto_reg_handoff_tftp (void);
/* User definable values */
static range_t *global_tftp_port_range;
-#define TFTP_RRQ 1
-#define TFTP_WRQ 2
-#define TFTP_DATA 3
-#define TFTP_ACK 4
-#define TFTP_ERROR 5
-#define TFTP_OACK 6
-#define TFTP_INFO 255
+#define TFTP_RRQ 1
+#define TFTP_WRQ 2
+#define TFTP_DATA 3
+#define TFTP_ACK 4
+#define TFTP_ERROR 5
+#define TFTP_OACK 6
+#define TFTP_INFO 255
static const value_string tftp_opcode_vals[] = {
{ TFTP_RRQ, "Read Request" },
@@ -111,7 +111,7 @@ static const value_string tftp_error_code_vals[] = {
{ 2, "Access violation" },
{ 3, "Disk full or allocation exceeded" },
{ 4, "Illegal TFTP Operation" },
- { 5, "Unknown transfer ID" }, /* Does not cause termination */
+ { 5, "Unknown transfer ID" }, /* Does not cause termination */
{ 6, "File already exists" },
{ 7, "No such user" },
{ 8, "Option negotiation failed" },
@@ -120,206 +120,206 @@ static const value_string tftp_error_code_vals[] = {
static void
tftp_dissect_options(tvbuff_t *tvb, packet_info *pinfo, int offset,
- proto_tree *tree, guint16 opcode, tftp_conv_info_t *tftp_info)
+ proto_tree *tree, guint16 opcode, tftp_conv_info_t *tftp_info)
{
- int option_len, value_len;
- int value_offset;
- const char *optionname;
- const char *optionvalue;
- proto_item *opt_item;
- proto_tree *opt_tree;
-
- while (tvb_offset_exists(tvb, offset)) {
- option_len = tvb_strsize(tvb, offset); /* length of option */
- value_offset = offset + option_len;
- value_len = tvb_strsize(tvb, value_offset); /* length of value */
- optionname = tvb_format_text(tvb, offset, option_len);
- optionvalue = tvb_format_text(tvb, value_offset, value_len);
- opt_item = proto_tree_add_text(tree, tvb, offset, option_len+value_len,
- "Option: %s = %s", optionname, optionvalue);
-
- opt_tree = proto_item_add_subtree(opt_item, ett_tftp_option);
- proto_tree_add_item(opt_tree, hf_tftp_option_name, tvb, offset,
- option_len, ENC_ASCII|ENC_NA);
- proto_tree_add_item(opt_tree, hf_tftp_option_value, tvb, value_offset,
- value_len, ENC_ASCII|ENC_NA);
-
- offset += option_len + value_len;
-
- col_append_fstr(pinfo->cinfo, COL_INFO, ", %s=%s",
- optionname, optionvalue);
-
- /* Special code to handle individual options */
- if (!g_ascii_strcasecmp((const char *)optionname, "blksize") &&
- opcode == TFTP_OACK) {
- gint blocksize = (gint)strtol((const char *)optionvalue, NULL, 10);
- if (blocksize < 8 || blocksize > 65464) {
- expert_add_info(pinfo, NULL, &ei_tftp_blocksize_range);
- } else {
- tftp_info->blocksize = blocksize;
- }
- }
- }
+ int option_len, value_len;
+ int value_offset;
+ const char *optionname;
+ const char *optionvalue;
+ proto_item *opt_item;
+ proto_tree *opt_tree;
+
+ while (tvb_offset_exists(tvb, offset)) {
+ option_len = tvb_strsize(tvb, offset); /* length of option */
+ value_offset = offset + option_len;
+ value_len = tvb_strsize(tvb, value_offset); /* length of value */
+ optionname = tvb_format_text(tvb, offset, option_len);
+ optionvalue = tvb_format_text(tvb, value_offset, value_len);
+ opt_item = proto_tree_add_text(tree, tvb, offset, option_len+value_len,
+ "Option: %s = %s", optionname, optionvalue);
+
+ opt_tree = proto_item_add_subtree(opt_item, ett_tftp_option);
+ proto_tree_add_item(opt_tree, hf_tftp_option_name, tvb, offset,
+ option_len, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(opt_tree, hf_tftp_option_value, tvb, value_offset,
+ value_len, ENC_ASCII|ENC_NA);
+
+ offset += option_len + value_len;
+
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s=%s",
+ optionname, optionvalue);
+
+ /* Special code to handle individual options */
+ if (!g_ascii_strcasecmp((const char *)optionname, "blksize") &&
+ opcode == TFTP_OACK) {
+ gint blocksize = (gint)strtol((const char *)optionvalue, NULL, 10);
+ if (blocksize < 8 || blocksize > 65464) {
+ expert_add_info(pinfo, NULL, &ei_tftp_blocksize_range);
+ } else {
+ tftp_info->blocksize = blocksize;
+ }
+ }
+ }
}
static void dissect_tftp_message(tftp_conv_info_t *tftp_info,
- tvbuff_t *tvb, packet_info *pinfo,
- proto_tree *tree)
+ tvbuff_t *tvb, packet_info *pinfo,
+ proto_tree *tree)
{
- proto_tree *tftp_tree = NULL;
- proto_item *ti;
- gint offset = 0;
- guint16 opcode;
- guint16 bytes;
- guint16 blocknum;
- guint i1;
- guint16 error;
-
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "TFTP");
-
- opcode = tvb_get_ntohs(tvb, offset);
-
- col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(opcode, tftp_opcode_vals, "Unknown (0x%04x)"));
-
- if (tree) {
- ti = proto_tree_add_item(tree, proto_tftp, tvb, offset, -1, ENC_NA);
- tftp_tree = proto_item_add_subtree(ti, ett_tftp);
-
- if (tftp_info->source_file) {
- ti = proto_tree_add_string(tftp_tree, hf_tftp_source_file, tvb,
- 0, 0, tftp_info->source_file);
- PROTO_ITEM_SET_GENERATED(ti);
- }
-
- if (tftp_info->destination_file) {
- ti = proto_tree_add_string(tftp_tree, hf_tftp_destination_file, tvb,
- 0, 0, tftp_info->destination_file);
- PROTO_ITEM_SET_GENERATED(ti);
- }
-
- proto_tree_add_uint(tftp_tree, hf_tftp_opcode, tvb,
- offset, 2, opcode);
- }
- offset += 2;
+ proto_tree *tftp_tree = NULL;
+ proto_item *ti;
+ gint offset = 0;
+ guint16 opcode;
+ guint16 bytes;
+ guint16 blocknum;
+ guint i1;
+ guint16 error;
+
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "TFTP");
+
+ opcode = tvb_get_ntohs(tvb, offset);
+
+ col_add_str(pinfo->cinfo, COL_INFO,
+ val_to_str(opcode, tftp_opcode_vals, "Unknown (0x%04x)"));
+
+ if (tree) {
+ ti = proto_tree_add_item(tree, proto_tftp, tvb, offset, -1, ENC_NA);
+ tftp_tree = proto_item_add_subtree(ti, ett_tftp);
+
+ if (tftp_info->source_file) {
+ ti = proto_tree_add_string(tftp_tree, hf_tftp_source_file, tvb,
+ 0, 0, tftp_info->source_file);
+ PROTO_ITEM_SET_GENERATED(ti);
+ }
+
+ if (tftp_info->destination_file) {
+ ti = proto_tree_add_string(tftp_tree, hf_tftp_destination_file, tvb,
+ 0, 0, tftp_info->destination_file);
+ PROTO_ITEM_SET_GENERATED(ti);
+ }
+
+ proto_tree_add_uint(tftp_tree, hf_tftp_opcode, tvb,
+ offset, 2, opcode);
+ }
+ offset += 2;
- switch (opcode) {
+ switch (opcode) {
- case TFTP_RRQ:
- i1 = tvb_strsize(tvb, offset);
- proto_tree_add_item(tftp_tree, hf_tftp_source_file,
- tvb, offset, i1, ENC_ASCII|ENC_NA);
+ case TFTP_RRQ:
+ i1 = tvb_strsize(tvb, offset);
+ proto_tree_add_item(tftp_tree, hf_tftp_source_file,
+ tvb, offset, i1, ENC_ASCII|ENC_NA);
- tftp_info->source_file = tvb_get_string(wmem_file_scope(), tvb, offset, i1);
+ tftp_info->source_file = tvb_get_string(wmem_file_scope(), tvb, offset, i1);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", File: %s",
- tvb_format_stringzpad(tvb, offset, i1));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", File: %s",
+ tvb_format_stringzpad(tvb, offset, i1));
- offset += i1;
+ offset += i1;
- i1 = tvb_strsize(tvb, offset);
- proto_tree_add_item(tftp_tree, hf_tftp_transfer_type,
- tvb, offset, i1, ENC_ASCII|ENC_NA);
+ i1 = tvb_strsize(tvb, offset);
+ proto_tree_add_item(tftp_tree, hf_tftp_transfer_type,
+ tvb, offset, i1, ENC_ASCII|ENC_NA);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Transfer type: %s",
- tvb_format_stringzpad(tvb, offset, i1));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Transfer type: %s",
+ tvb_format_stringzpad(tvb, offset, i1));
- offset += i1;
+ offset += i1;
- tftp_dissect_options(tvb, pinfo, offset, tftp_tree,
- opcode, tftp_info);
- break;
+ tftp_dissect_options(tvb, pinfo, offset, tftp_tree,
+ opcode, tftp_info);
+ break;
- case TFTP_WRQ:
- i1 = tvb_strsize(tvb, offset);
- proto_tree_add_item(tftp_tree, hf_tftp_destination_file,
- tvb, offset, i1, ENC_ASCII|ENC_NA);
+ case TFTP_WRQ:
+ i1 = tvb_strsize(tvb, offset);
+ proto_tree_add_item(tftp_tree, hf_tftp_destination_file,
+ tvb, offset, i1, ENC_ASCII|ENC_NA);
- tftp_info->destination_file =
- tvb_get_string(wmem_file_scope(), tvb, offset, i1);
+ tftp_info->destination_file =
+ tvb_get_string(wmem_file_scope(), tvb, offset, i1);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", File: %s",
- tvb_format_stringzpad(tvb, offset, i1));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", File: %s",
+ tvb_format_stringzpad(tvb, offset, i1));
- offset += i1;
+ offset += i1;
- i1 = tvb_strsize(tvb, offset);
- proto_tree_add_item(tftp_tree, hf_tftp_transfer_type,
- tvb, offset, i1, ENC_ASCII|ENC_NA);
+ i1 = tvb_strsize(tvb, offset);
+ proto_tree_add_item(tftp_tree, hf_tftp_transfer_type,
+ tvb, offset, i1, ENC_ASCII|ENC_NA);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Transfer type: %s",
- tvb_format_stringzpad(tvb, offset, i1));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Transfer type: %s",
+ tvb_format_stringzpad(tvb, offset, i1));
- offset += i1;
+ offset += i1;
- tftp_dissect_options(tvb, pinfo, offset, tftp_tree,
- opcode, tftp_info);
- break;
+ tftp_dissect_options(tvb, pinfo, offset, tftp_tree,
+ opcode, tftp_info);
+ break;
- case TFTP_INFO:
- tftp_dissect_options(tvb, pinfo, offset, tftp_tree,
- opcode, tftp_info);
- break;
+ case TFTP_INFO:
+ tftp_dissect_options(tvb, pinfo, offset, tftp_tree,
+ opcode, tftp_info);
+ break;
- case TFTP_DATA:
- blocknum = tvb_get_ntohs(tvb, offset);
- proto_tree_add_uint(tftp_tree, hf_tftp_blocknum, tvb, offset, 2,
- blocknum);
+ case TFTP_DATA:
+ blocknum = tvb_get_ntohs(tvb, offset);
+ proto_tree_add_uint(tftp_tree, hf_tftp_blocknum, tvb, offset, 2,
+ blocknum);
- offset += 2;
+ offset += 2;
- bytes = tvb_reported_length_remaining(tvb, offset);
+ bytes = tvb_reported_length_remaining(tvb, offset);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Block: %i%s",
- blocknum,
- (bytes < tftp_info->blocksize)?" (last)":"" );
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Block: %i%s",
+ blocknum,
+ (bytes < tftp_info->blocksize)?" (last)":"" );
- if (bytes != 0) {
- tvbuff_t *data_tvb = tvb_new_subset(tvb, offset, -1, bytes);
- call_dissector(data_handle, data_tvb, pinfo, tree);
- }
- break;
+ if (bytes != 0) {
+ tvbuff_t *data_tvb = tvb_new_subset(tvb, offset, -1, bytes);
+ call_dissector(data_handle, data_tvb, pinfo, tree);
+ }
+ break;
- case TFTP_ACK:
- blocknum = tvb_get_ntohs(tvb, offset);
- proto_tree_add_uint(tftp_tree, hf_tftp_blocknum, tvb, offset, 2,
- blocknum);
+ case TFTP_ACK:
+ blocknum = tvb_get_ntohs(tvb, offset);
+ proto_tree_add_uint(tftp_tree, hf_tftp_blocknum, tvb, offset, 2,
+ blocknum);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Block: %i",
- blocknum);
- break;
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Block: %i",
+ blocknum);
+ break;
- case TFTP_ERROR:
- error = tvb_get_ntohs(tvb, offset);
- proto_tree_add_uint(tftp_tree, hf_tftp_error_code, tvb, offset, 2,
- error);
+ case TFTP_ERROR:
+ error = tvb_get_ntohs(tvb, offset);
+ proto_tree_add_uint(tftp_tree, hf_tftp_error_code, tvb, offset, 2,
+ error);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Code: %s",
- val_to_str(error, tftp_error_code_vals, "Unknown (%u)"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Code: %s",
+ val_to_str(error, tftp_error_code_vals, "Unknown (%u)"));
- offset += 2;
+ offset += 2;
- i1 = tvb_strsize(tvb, offset);
- proto_tree_add_item(tftp_tree, hf_tftp_error_string, tvb, offset,
- i1, ENC_ASCII|ENC_NA);
+ i1 = tvb_strsize(tvb, offset);
+ proto_tree_add_item(tftp_tree, hf_tftp_error_string, tvb, offset,
+ i1, ENC_ASCII|ENC_NA);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Message: %s",
- tvb_format_stringzpad(tvb, offset, i1));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Message: %s",
+ tvb_format_stringzpad(tvb, offset, i1));
- expert_add_info(pinfo, NULL, &ei_tftp_blocksize_range);
- break;
+ expert_add_info(pinfo, NULL, &ei_tftp_blocksize_range);
+ break;
- case TFTP_OACK:
- tftp_dissect_options(tvb, pinfo, offset, tftp_tree,
- opcode, tftp_info);
- break;
+ case TFTP_OACK:
+ tftp_dissect_options(tvb, pinfo, offset, tftp_tree,
+ opcode, tftp_info);
+ break;
- default:
- proto_tree_add_text(tftp_tree, tvb, offset, -1,
- "Data (%d bytes)", tvb_reported_length_remaining(tvb, offset));
- break;
+ default:
+ proto_tree_add_text(tftp_tree, tvb, offset, -1,
+ "Data (%d bytes)", tvb_reported_length_remaining(tvb, offset));
+ break;
- }
+ }
return;
}
@@ -365,61 +365,61 @@ dissect_embeddedtftp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
static void
dissect_tftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- conversation_t *conversation = NULL;
- tftp_conv_info_t *tftp_info;
-
- /*
- * The first TFTP packet goes to the TFTP port; the second one
- * comes from some *other* port, but goes back to the same
- * IP address and port as the ones from which the first packet
- * came; all subsequent packets go between those two IP addresses
- * and ports.
- *
- * If this packet went to the TFTP port, we check to see if
- * there's already a conversation with one address/port pair
- * matching the source IP address and port of this packet,
- * the other address matching the destination IP address of this
- * packet, and any destination port.
- *
- * If not, we create one, with its address 1/port 1 pair being
- * the source address/port of this packet, its address 2 being
- * the destination address of this packet, and its port 2 being
- * wildcarded, and give it the TFTP dissector as a dissector.
- */
- if (value_is_in_range(global_tftp_port_range, pinfo->destport)) {
- conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_UDP,
- pinfo->srcport, 0, NO_PORT_B);
- if( (conversation == NULL) || (conversation->dissector_handle != tftp_handle) ){
- conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_UDP,
- pinfo->srcport, 0, NO_PORT2);
- conversation_set_dissector(conversation, tftp_handle);
- }
- } else {
- conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
- pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
- if( (conversation == NULL) || (conversation->dissector_handle != tftp_handle) ){
- conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_UDP,
- pinfo->destport, pinfo->srcport, 0);
- conversation_set_dissector(conversation, tftp_handle);
- } else if (conversation->options & NO_PORT_B) {
- if (pinfo->destport == conversation->key_ptr->port1)
- conversation_set_port2(conversation, pinfo->srcport);
- else
- return;
- }
- }
- tftp_info = (tftp_conv_info_t *)conversation_get_proto_data(conversation, proto_tftp);
- if (!tftp_info) {
- tftp_info = wmem_new(wmem_file_scope(), tftp_conv_info_t);
- tftp_info->blocksize = 512; /* TFTP default block size */
- tftp_info->source_file = NULL;
- tftp_info->destination_file = NULL;
- conversation_add_proto_data(conversation, proto_tftp, tftp_info);
- }
-
- dissect_tftp_message(tftp_info, tvb, pinfo, tree);
-
- return;
+ conversation_t *conversation = NULL;
+ tftp_conv_info_t *tftp_info;
+
+ /*
+ * The first TFTP packet goes to the TFTP port; the second one
+ * comes from some *other* port, but goes back to the same
+ * IP address and port as the ones from which the first packet
+ * came; all subsequent packets go between those two IP addresses
+ * and ports.
+ *
+ * If this packet went to the TFTP port, we check to see if
+ * there's already a conversation with one address/port pair
+ * matching the source IP address and port of this packet,
+ * the other address matching the destination IP address of this
+ * packet, and any destination port.
+ *
+ * If not, we create one, with its address 1/port 1 pair being
+ * the source address/port of this packet, its address 2 being
+ * the destination address of this packet, and its port 2 being
+ * wildcarded, and give it the TFTP dissector as a dissector.
+ */
+ if (value_is_in_range(global_tftp_port_range, pinfo->destport)) {
+ conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_UDP,
+ pinfo->srcport, 0, NO_PORT_B);
+ if( (conversation == NULL) || (conversation->dissector_handle != tftp_handle) ){
+ conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_UDP,
+ pinfo->srcport, 0, NO_PORT2);
+ conversation_set_dissector(conversation, tftp_handle);
+ }
+ } else {
+ conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
+ pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
+ if( (conversation == NULL) || (conversation->dissector_handle != tftp_handle) ){
+ conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_UDP,
+ pinfo->destport, pinfo->srcport, 0);
+ conversation_set_dissector(conversation, tftp_handle);
+ } else if (conversation->options & NO_PORT_B) {
+ if (pinfo->destport == conversation->key_ptr->port1)
+ conversation_set_port2(conversation, pinfo->srcport);
+ else
+ return;
+ }
+ }
+ tftp_info = (tftp_conv_info_t *)conversation_get_proto_data(conversation, proto_tftp);
+ if (!tftp_info) {
+ tftp_info = wmem_new(wmem_file_scope(), tftp_conv_info_t);
+ tftp_info->blocksize = 512; /* TFTP default block size */
+ tftp_info->source_file = NULL;
+ tftp_info->destination_file = NULL;
+ conversation_add_proto_data(conversation, proto_tftp, tftp_info);
+ }
+
+ dissect_tftp_message(tftp_info, tvb, pinfo, tree);
+
+ return;
}
@@ -428,49 +428,49 @@ proto_register_tftp(void)
{
static hf_register_info hf[] = {
{ &hf_tftp_opcode,
- { "Opcode", "tftp.opcode",
- FT_UINT16, BASE_DEC, VALS(tftp_opcode_vals), 0x0,
- "TFTP message type", HFILL }},
+ { "Opcode", "tftp.opcode",
+ FT_UINT16, BASE_DEC, VALS(tftp_opcode_vals), 0x0,
+ "TFTP message type", HFILL }},
{ &hf_tftp_source_file,
- { "Source File", "tftp.source_file",
- FT_STRINGZ, BASE_NONE, NULL, 0x0,
- "TFTP source file name", HFILL }},
+ { "Source File", "tftp.source_file",
+ FT_STRINGZ, BASE_NONE, NULL, 0x0,
+ "TFTP source file name", HFILL }},
{ &hf_tftp_destination_file,
{ "DESTINATION File", "tftp.destination_file",
- FT_STRINGZ, BASE_NONE, NULL, 0x0,
- "TFTP source file name", HFILL }},
+ FT_STRINGZ, BASE_NONE, NULL, 0x0,
+ "TFTP source file name", HFILL }},
{ &hf_tftp_transfer_type,
- { "Type", "tftp.type",
- FT_STRINGZ, BASE_NONE, NULL, 0x0,
- "TFTP transfer type", HFILL }},
+ { "Type", "tftp.type",
+ FT_STRINGZ, BASE_NONE, NULL, 0x0,
+ "TFTP transfer type", HFILL }},
{ &hf_tftp_blocknum,
{ "Block", "tftp.block",
- FT_UINT16, BASE_DEC, NULL, 0x0,
- "Block number", HFILL }},
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "Block number", HFILL }},
{ &hf_tftp_error_code,
{ "Error code", "tftp.error.code",
- FT_UINT16, BASE_DEC, VALS(tftp_error_code_vals), 0x0,
- "Error code in case of TFTP error message", HFILL }},
+ FT_UINT16, BASE_DEC, VALS(tftp_error_code_vals), 0x0,
+ "Error code in case of TFTP error message", HFILL }},
{ &hf_tftp_error_string,
{ "Error message", "tftp.error.message",
- FT_STRINGZ, BASE_NONE, NULL, 0x0,
- "Error string in case of TFTP error message", HFILL }},
+ FT_STRINGZ, BASE_NONE, NULL, 0x0,
+ "Error string in case of TFTP error message", HFILL }},
{ &hf_tftp_option_name,
{ "Option name", "tftp.option.name",
- FT_STRINGZ, BASE_NONE, NULL, 0x0,
- NULL, HFILL }},
+ FT_STRINGZ, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
{ &hf_tftp_option_value,
{ "Option value", "tftp.option.value",
- FT_STRINGZ, BASE_NONE, NULL, 0x0,
- NULL, HFILL }},
+ FT_STRINGZ, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
};
static gint *ett[] = {
@@ -486,7 +486,7 @@ proto_register_tftp(void)
expert_module_t* expert_tftp;
proto_tftp = proto_register_protocol("Trivial File Transfer Protocol",
- "TFTP", "tftp");
+ "TFTP", "tftp");
proto_register_field_array(proto_tftp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_tftp = expert_register_protocol(proto_tftp);
@@ -499,10 +499,10 @@ proto_register_tftp(void)
tftp_module = prefs_register_protocol(proto_tftp, proto_reg_handoff_tftp);
prefs_register_range_preference(tftp_module, "udp_ports",
- "TFTP port numbers",
- "Port numbers used for TFTP traffic "
- "(default " UDP_PORT_TFTP_RANGE ")",
- &global_tftp_port_range, MAX_UDP_PORT);
+ "TFTP port numbers",
+ "Port numbers used for TFTP traffic "
+ "(default " UDP_PORT_TFTP_RANGE ")",
+ &global_tftp_port_range, MAX_UDP_PORT);
}
void