aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mmse.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2005-06-26 19:56:52 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2005-06-26 19:56:52 +0000
commit1d0038e8c0b97f22ca359184defde2cc98a6fa48 (patch)
tree82a95df0652f9df59634fd7a7f8dd36026fa4ea7 /epan/dissectors/packet-mmse.c
parent3f18d499f8ca5c32014c4762604ebf7a22caf4b9 (diff)
Get rid of the private "my_match_strval()" routine in many dissectors;
add a "match_strval_idx()" routine that does the same thing, and have "match_strval()" call it. Make those routines, and "val_to_str()", return a "const" pointer. Update dissectors as necessary to squelch compiler warnings produced by that. Use "val_to_str()" rather than using "match_strval()" and then, if the result is null, substituting a specific string. Clean up some other "match_strval()"/"val_to_str()" usages. Add a null pointer check in the NDPS dissector's "attribute_value()" routine, as it's not clear that "global_attribute_name" won't be null at that point. Make some global variables in the AFS4INT dissector local. Make some routines not used outside the module they're in static. Make some tables "static const". Clean up white space. Fix Gerald's address in some files. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14786 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-mmse.c')
-rw-r--r--epan/dissectors/packet-mmse.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/epan/dissectors/packet-mmse.c b/epan/dissectors/packet-mmse.c
index 908a9ce0a0..703cf067d8 100644
--- a/epan/dissectors/packet-mmse.c
+++ b/epan/dissectors/packet-mmse.c
@@ -75,7 +75,7 @@
static void dissect_mmse_standalone(tvbuff_t *, packet_info *, proto_tree *);
static void dissect_mmse_encapsulated(tvbuff_t *, packet_info *, proto_tree *);
static void dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- guint8 pdut, char *message_type);
+ guint8 pdut, const char *message_type);
/*
* Header field values
@@ -668,13 +668,13 @@ static void
dissect_mmse_standalone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint8 pdut;
- char *message_type;
+ const char *message_type;
DebugLog(("dissect_mmse_standalone() - START (Packet %u)\n",
pinfo->fd->num));
pdut = tvb_get_guint8(tvb, 1);
- message_type = match_strval(pdut, vals_message_type);
+ message_type = val_to_str(pdut, vals_message_type, "Unknown type %u");
/* Make entries in Protocol column and Info column on summary display */
if (check_col(pinfo->cinfo, COL_PROTOCOL))
@@ -692,13 +692,13 @@ static void
dissect_mmse_encapsulated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint8 pdut;
- char *message_type;
+ const char *message_type;
DebugLog(("dissect_mmse_encapsulated() - START (Packet %u)\n",
pinfo->fd->num));
pdut = tvb_get_guint8(tvb, 1);
- message_type = match_strval(pdut, vals_message_type);
+ message_type = val_to_str(pdut, vals_message_type, "Unknown type %u");
/* Make entries in Info column on summary display */
if (check_col(pinfo->cinfo, COL_INFO)) {
@@ -711,7 +711,7 @@ dissect_mmse_encapsulated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static void
dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
- char *message_type)
+ const char *message_type)
{
guint offset;
guint8 field = 0;
@@ -1235,7 +1235,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
default:
if (field & 0x80) { /* Well-known WSP header encoding */
guint8 peek = tvb_get_guint8(tvb, offset);
- char *hdr_name = val_to_str(field, vals_mm_header_names,
+ const char *hdr_name = val_to_str(field, vals_mm_header_names,
"Unknown field (0x%02x)");
DebugLog(("\t\tUndecoded well-known header: %s\n",
hdr_name));