diff options
author | Bill Meier <wmeier@newsguy.com> | 2010-10-10 20:39:00 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2010-10-10 20:39:00 +0000 |
commit | 4ae8d2530043b4e300504fd0f71c7a4a0e52d611 (patch) | |
tree | 026030119c29abb37313423f1ce0e4dee99c57ce /epan/dissectors/packet-rmt-common.c | |
parent | 4d56c5b57b31de38673afea8300715aaf31c8a78 (diff) |
Minor code cleanup:
- define some vars & fcns as static;
- remove an unused var;
- use tfs_set_notset in tfs.c;
- slightly simplify reg_handoff.
svn path=/trunk/; revision=34462
Diffstat (limited to 'epan/dissectors/packet-rmt-common.c')
-rw-r--r-- | epan/dissectors/packet-rmt-common.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/epan/dissectors/packet-rmt-common.c b/epan/dissectors/packet-rmt-common.c index 6b6f9035ef..554ce19a8c 100644 --- a/epan/dissectors/packet-rmt-common.c +++ b/epan/dissectors/packet-rmt-common.c @@ -13,12 +13,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -38,10 +38,6 @@ #include "packet-rmt-common.h" -/* Boolean string tables */ -const true_false_string boolean_set_notset = { "Set", "Not set" }; -const true_false_string boolean_yes_no = { "Yes", "No" }; - /* Common RMT exported functions */ /* ============================= */ @@ -49,16 +45,16 @@ const true_false_string boolean_yes_no = { "Yes", "No" }; void rmt_ext_parse(GArray *a, tvbuff_t *tvb, guint *offset, guint offset_max) { struct _ext e; - + while (*offset < offset_max) { /* Clear the temporary extension */ memset(&e, 0, sizeof(struct _ext)); - + /* Dissect the extension */ e.offset = *offset; e.het = tvb_get_guint8(tvb, *offset); - + if (e.het <= 127) { /* If HET <= 127, we have a variable-size extention */ e.hel = tvb_get_guint8(tvb, *offset+1); @@ -72,11 +68,11 @@ void rmt_ext_parse(GArray *a, tvbuff_t *tvb, guint *offset, guint offset_max) e.hec_size = 3; e.length = 4; } - + /* Prevents infinite loops */ if (e.length == 0) break; - + g_array_append_val(a, e); *offset += e.length; } @@ -97,10 +93,10 @@ void rmt_ext_decode_default_header(struct _ext *e, tvbuff_t *tvb, proto_tree *tr void rmt_ext_decode_default_subtree(struct _ext *e, tvbuff_t *tvb, proto_item *ti, gint ett) { proto_tree *ext_tree; - + ext_tree = proto_item_add_subtree(ti, ett); rmt_ext_decode_default_header(e, tvb, ext_tree); - + if (ext_tree) proto_tree_add_text(ext_tree, tvb, e->hec_offset, e->hec_size, "Header Extension Content (HEC): %s", tvb_bytes_to_str(tvb, e->hec_offset, e->hec_size)); @@ -110,12 +106,12 @@ void rmt_ext_decode_default_subtree(struct _ext *e, tvbuff_t *tvb, proto_item *t void rmt_ext_decode_default(struct _ext *e, tvbuff_t *tvb, proto_tree *tree, gint ett) { proto_item *ti; - + if (tree) { ti = proto_tree_add_text(tree, tvb, e->offset, e->length, "Unknown extension (%u)", e->het); - + rmt_ext_decode_default_subtree(e, tvb, ti, ett); } } |