diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-09-27 08:03:13 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-09-27 08:03:13 +0000 |
commit | 70f17cd417a5faff43642b42a1f6f820401e7544 (patch) | |
tree | 1b52f2e552ea9eead54644f474877a1362735e7f /epan/dissectors/packet-fc.c | |
parent | 04fc893ad74d7eaa18d02140bd48895d12f28912 (diff) |
remove all strcpy from fcels
ito make it easier to read use doublespace to separate the items on the expansion line instead of ',' since so many of the strings contain spaces.
cleanup fc slightly and remove a redundant parameter
svn path=/trunk/; revision=16019
Diffstat (limited to 'epan/dissectors/packet-fc.c')
-rw-r--r-- | epan/dissectors/packet-fc.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c index b4b3bceba6..a48982cf52 100644 --- a/epan/dissectors/packet-fc.c +++ b/epan/dissectors/packet-fc.c @@ -522,20 +522,22 @@ static const true_false_string tfs_fc_fctl_rel_offset = { /* code to dissect the F_CTL bitmask */ static void -dissect_fc_fctl(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, int offset, guint32 fctl) +dissect_fc_fctl(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, int offset) { - proto_item *item; - proto_tree *tree; + proto_item *item=NULL; + proto_tree *tree=NULL; guint32 flags; - item=proto_tree_add_uint(parent_tree, hf_fc_fctl, tvb, offset, 3, fctl); - tree=proto_item_add_subtree(item, ett_fctl); - flags = tvb_get_guint8 (tvb, offset); flags = (flags<<8) | tvb_get_guint8 (tvb, offset+1); flags = (flags<<8) | tvb_get_guint8 (tvb, offset+2); - proto_tree_add_boolean(tree, hf_fc_fctl_exchange_responder, tvb, offset, 3, fctl); + if(parent_tree){ + item=proto_tree_add_uint(parent_tree, hf_fc_fctl, tvb, offset, 3, flags); + tree=proto_item_add_subtree(item, ett_fctl); + } + + proto_tree_add_boolean(tree, hf_fc_fctl_exchange_responder, tvb, offset, 3, flags); if (flags&FC_FCTL_EXCHANGE_RESPONDER){ proto_item_append_text(item, " Exchange Responder"); if (flags & (~( FC_FCTL_EXCHANGE_RESPONDER ))) @@ -547,7 +549,7 @@ dissect_fc_fctl(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, } flags&=(~( FC_FCTL_EXCHANGE_RESPONDER )); - proto_tree_add_boolean(tree, hf_fc_fctl_seq_recipient, tvb, offset, 3, fctl); + proto_tree_add_boolean(tree, hf_fc_fctl_seq_recipient, tvb, offset, 3, flags); if (flags&FC_FCTL_SEQ_RECIPIENT){ proto_item_append_text(item, " Seq Recipient"); if (flags & (~( FC_FCTL_SEQ_RECIPIENT ))) @@ -559,7 +561,7 @@ dissect_fc_fctl(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, } flags&=(~( FC_FCTL_SEQ_RECIPIENT )); - proto_tree_add_boolean(tree, hf_fc_fctl_exchange_first, tvb, offset, 3, fctl); + proto_tree_add_boolean(tree, hf_fc_fctl_exchange_first, tvb, offset, 3, flags); if (flags&FC_FCTL_EXCHANGE_FIRST){ proto_item_append_text(item, " Exchg First"); if (flags & (~( FC_FCTL_EXCHANGE_FIRST ))) @@ -567,7 +569,7 @@ dissect_fc_fctl(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, } flags&=(~( FC_FCTL_EXCHANGE_FIRST )); - proto_tree_add_boolean(tree, hf_fc_fctl_exchange_last, tvb, offset, 3, fctl); + proto_tree_add_boolean(tree, hf_fc_fctl_exchange_last, tvb, offset, 3, flags); if (flags&FC_FCTL_EXCHANGE_LAST){ proto_item_append_text(item, " Exchg Last"); if (flags & (~( FC_FCTL_EXCHANGE_LAST ))) @@ -575,7 +577,7 @@ dissect_fc_fctl(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, } flags&=(~( FC_FCTL_EXCHANGE_LAST )); - proto_tree_add_boolean(tree, hf_fc_fctl_seq_last, tvb, offset, 3, fctl); + proto_tree_add_boolean(tree, hf_fc_fctl_seq_last, tvb, offset, 3, flags); if (flags&FC_FCTL_SEQ_LAST){ proto_item_append_text(item, " Seq Last"); if (flags & (~( FC_FCTL_SEQ_LAST ))) @@ -583,7 +585,7 @@ dissect_fc_fctl(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, } flags&=(~( FC_FCTL_SEQ_LAST )); - proto_tree_add_boolean(tree, hf_fc_fctl_priority, tvb, offset, 3, fctl); + proto_tree_add_boolean(tree, hf_fc_fctl_priority, tvb, offset, 3, flags); if (flags&FC_FCTL_PRIORITY){ proto_item_append_text(item, " Priority"); if (flags & (~( FC_FCTL_PRIORITY ))) @@ -595,7 +597,7 @@ dissect_fc_fctl(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, } flags&=(~( FC_FCTL_PRIORITY )); - proto_tree_add_boolean(tree, hf_fc_fctl_transfer_seq_initiative, tvb, offset, 3, fctl); + proto_tree_add_boolean(tree, hf_fc_fctl_transfer_seq_initiative, tvb, offset, 3, flags); if (flags&FC_FCTL_TRANSFER_SEQ_INITIATIVE){ proto_item_append_text(item, " Transfer Seq Initiative"); if (flags & (~( FC_FCTL_TRANSFER_SEQ_INITIATIVE ))) @@ -603,11 +605,11 @@ dissect_fc_fctl(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, } flags&=(~( FC_FCTL_TRANSFER_SEQ_INITIATIVE )); - proto_tree_add_uint(tree, hf_fc_fctl_last_data_frame, tvb, offset, 3, fctl); + proto_tree_add_uint(tree, hf_fc_fctl_last_data_frame, tvb, offset, 3, flags); - proto_tree_add_uint(tree, hf_fc_fctl_ack_0_1, tvb, offset, 3, fctl); + proto_tree_add_uint(tree, hf_fc_fctl_ack_0_1, tvb, offset, 3, flags); - proto_tree_add_boolean(tree, hf_fc_fctl_rexmitted_seq, tvb, offset, 3, fctl); + proto_tree_add_boolean(tree, hf_fc_fctl_rexmitted_seq, tvb, offset, 3, flags); if (flags&FC_FCTL_REXMITTED_SEQ){ proto_item_append_text(item, " Rexmitted Seq"); if (flags & (~( FC_FCTL_REXMITTED_SEQ ))) @@ -615,9 +617,9 @@ dissect_fc_fctl(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, } flags&=(~( FC_FCTL_REXMITTED_SEQ )); - proto_tree_add_uint(tree, hf_fc_fctl_abts_ack, tvb, offset, 3, fctl); + proto_tree_add_uint(tree, hf_fc_fctl_abts_ack, tvb, offset, 3, flags); - proto_tree_add_boolean(tree, hf_fc_fctl_rel_offset, tvb, offset, 3, fctl); + proto_tree_add_boolean(tree, hf_fc_fctl_rel_offset, tvb, offset, 3, flags); if (flags&FC_FCTL_REL_OFFSET){ proto_item_append_text(item, " Rel Offset"); if (flags & (~( FC_FCTL_REL_OFFSET ))) @@ -959,7 +961,7 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean } - dissect_fc_fctl(pinfo, fc_tree, tvb, offset+9, fchdr.fctl); + dissect_fc_fctl(pinfo, fc_tree, tvb, offset+9); proto_tree_add_item (fc_tree, hf_fc_seqid, tvb, offset+12, 1, FALSE); |