char -> const char warning fixes

svn path=/trunk/; revision=15126
This commit is contained in:
Jörg Mayer 2005-07-28 07:53:38 +00:00
parent f5b39c3ef9
commit 34493e8f9e
16 changed files with 144 additions and 149 deletions

View File

@ -32,7 +32,7 @@
/* some necessary forward function prototypes */ /* some necessary forward function prototypes */
static guint static guint
fApplicationTypesEnumerated (tvbuff_t *tvb, proto_tree *tree, guint offset, fApplicationTypesEnumerated (tvbuff_t *tvb, proto_tree *tree, guint offset,
guint8 *label, const value_string *vs); const gchar *label, const value_string *vs);
static const char *bacapp_unknown_service_str = "unknown service"; static const char *bacapp_unknown_service_str = "unknown service";
static const char *ASHRAE_Reserved_Fmt = "(%d) Reserved for Use by ASHRAE"; static const char *ASHRAE_Reserved_Fmt = "(%d) Reserved for Use by ASHRAE";
@ -1473,14 +1473,14 @@ fTagHeader (tvbuff_t *tvb, guint offset, guint8 *tag_no, guint8* class_tag,
} }
static guint static guint
fNullTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label) fNullTag (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label)
{ {
guint8 tag_no, class_tag; guint8 tag_no, class_tag;
guint32 lvt; guint32 lvt;
proto_item *ti; proto_item *ti;
proto_tree *subtree; proto_tree *subtree;
ti = proto_tree_add_text(tree, tvb, offset, 1, "%sNULL", LABEL(label)); ti = proto_tree_add_text(tree, tvb, offset, 1, "%sNULL", label);
subtree = proto_item_add_subtree(ti, ett_bacapp_tag); subtree = proto_item_add_subtree(ti, ett_bacapp_tag);
fTagHeaderTree (tvb, subtree, offset, &tag_no, &class_tag, &lvt); fTagHeaderTree (tvb, subtree, offset, &tag_no, &class_tag, &lvt);
@ -1488,7 +1488,7 @@ fNullTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
} }
static guint static guint
fBooleanTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label) fBooleanTag (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label)
{ {
guint8 tag_no, class_tag; guint8 tag_no, class_tag;
guint32 lvt = 0; guint32 lvt = 0;
@ -1496,7 +1496,7 @@ fBooleanTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
proto_tree *subtree; proto_tree *subtree;
ti = proto_tree_add_text(tree, tvb, offset, 1, ti = proto_tree_add_text(tree, tvb, offset, 1,
"%s%s", LABEL(label), lvt == 0 ? "FALSE" : "TRUE"); "%s%s", label, lvt == 0 ? "FALSE" : "TRUE");
subtree = proto_item_add_subtree(ti, ett_bacapp_tag); subtree = proto_item_add_subtree(ti, ett_bacapp_tag);
fTagHeaderTree (tvb, subtree, offset, &tag_no, &class_tag, &lvt); fTagHeaderTree (tvb, subtree, offset, &tag_no, &class_tag, &lvt);
@ -1504,7 +1504,7 @@ fBooleanTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
} }
static guint static guint
fUnsignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label) fUnsignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label)
{ {
guint64 val = 0; guint64 val = 0;
guint8 tag_no, class_tag; guint8 tag_no, class_tag;
@ -1517,10 +1517,10 @@ fUnsignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
/* only support up to an 8 byte (64-bit) integer */ /* only support up to an 8 byte (64-bit) integer */
if (fUnsigned64 (tvb, offset + tag_len, lvt, &val)) if (fUnsigned64 (tvb, offset + tag_len, lvt, &val))
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len, ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%s(Unsigned) %" PRIu64, LABEL(label), val); "%s(Unsigned) %" PRIu64, label, val);
else else
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len, ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%s - %u octets (Unsigned)", LABEL(label), lvt); "%s - %u octets (Unsigned)", label, lvt);
subtree = proto_item_add_subtree(ti, ett_bacapp_tag); subtree = proto_item_add_subtree(ti, ett_bacapp_tag);
fTagHeaderTree (tvb, subtree, offset, &tag_no, &class_tag, &lvt); fTagHeaderTree (tvb, subtree, offset, &tag_no, &class_tag, &lvt);
@ -1529,7 +1529,7 @@ fUnsignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
/* set split_val to zero when not needed */ /* set split_val to zero when not needed */
static guint static guint
fEnumeratedTagSplit (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label, fEnumeratedTagSplit (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label,
const value_string *vs, guint32 split_val) const value_string *vs, guint32 split_val)
{ {
guint32 val = 0; guint32 val = 0;
@ -1544,14 +1544,14 @@ fEnumeratedTagSplit (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *labe
if (fUnsigned32 (tvb, offset+tag_len, lvt, &val)) { if (fUnsigned32 (tvb, offset+tag_len, lvt, &val)) {
if (vs) if (vs)
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len, ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%s %s", LABEL(label), val_to_split_str(val, split_val, vs, "%s %s", label, val_to_split_str(val, split_val, vs,
ASHRAE_Reserved_Fmt,Vendor_Proprietary_Fmt)); ASHRAE_Reserved_Fmt,Vendor_Proprietary_Fmt));
else else
ti =proto_tree_add_text(tree, tvb, offset, lvt+tag_len, ti =proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%s %u", LABEL(label), val); "%s %u", label, val);
} else { } else {
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len, ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%s - %u octets (enumeration)", LABEL(label), lvt); "%s - %u octets (enumeration)", label, lvt);
} }
subtree = proto_item_add_subtree(ti, ett_bacapp_tag); subtree = proto_item_add_subtree(ti, ett_bacapp_tag);
fTagHeaderTree (tvb, subtree, offset, &tag_no, &class_tag, &lvt); fTagHeaderTree (tvb, subtree, offset, &tag_no, &class_tag, &lvt);
@ -1560,14 +1560,14 @@ fEnumeratedTagSplit (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *labe
} }
static guint static guint
fEnumeratedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label, fEnumeratedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label,
const value_string *vs) const value_string *vs)
{ {
return fEnumeratedTagSplit (tvb, tree, offset, label, vs, 0); return fEnumeratedTagSplit (tvb, tree, offset, label, vs, 0);
} }
static guint static guint
fSignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label) fSignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label)
{ {
guint64 val = 0; guint64 val = 0;
guint8 tag_no, class_tag; guint8 tag_no, class_tag;
@ -1579,10 +1579,10 @@ fSignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
tag_len = fTagHeader (tvb, offset, &tag_no, &class_tag, &lvt); tag_len = fTagHeader (tvb, offset, &tag_no, &class_tag, &lvt);
if (fUnsigned64 (tvb, offset + tag_len, lvt, &val)) if (fUnsigned64 (tvb, offset + tag_len, lvt, &val))
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len, ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%s(Signed) %" PRId64, LABEL(label), (gint64) val); "%s(Signed) %" PRId64, label, (gint64) val);
else else
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len, ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%s - %u octets (Signed)", LABEL(label), lvt); "%s - %u octets (Signed)", label, lvt);
subtree = proto_item_add_subtree(ti, ett_bacapp_tag); subtree = proto_item_add_subtree(ti, ett_bacapp_tag);
fTagHeaderTree(tvb, subtree, offset, &tag_no, &class_tag, &lvt); fTagHeaderTree(tvb, subtree, offset, &tag_no, &class_tag, &lvt);
@ -1590,7 +1590,7 @@ fSignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
} }
static guint static guint
fRealTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label) fRealTag (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label)
{ {
guint8 tag_no, class_tag; guint8 tag_no, class_tag;
guint32 lvt; guint32 lvt;
@ -1602,7 +1602,7 @@ fRealTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
tag_len = fTagHeader(tvb, offset, &tag_no, &class_tag, &lvt); tag_len = fTagHeader(tvb, offset, &tag_no, &class_tag, &lvt);
f_val = tvb_get_ntohieee_float(tvb, offset+tag_len); f_val = tvb_get_ntohieee_float(tvb, offset+tag_len);
ti = proto_tree_add_text(tree, tvb, offset, 4+tag_len, ti = proto_tree_add_text(tree, tvb, offset, 4+tag_len,
"%s%f (Real)", LABEL(label), f_val); "%s%f (Real)", label, f_val);
subtree = proto_item_add_subtree(ti, ett_bacapp_tag); subtree = proto_item_add_subtree(ti, ett_bacapp_tag);
fTagHeaderTree(tvb, subtree, offset, &tag_no, &class_tag, &lvt); fTagHeaderTree(tvb, subtree, offset, &tag_no, &class_tag, &lvt);
@ -1610,7 +1610,7 @@ fRealTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
} }
static guint static guint
fDoubleTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label) fDoubleTag (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label)
{ {
guint8 tag_no, class_tag; guint8 tag_no, class_tag;
guint32 lvt; guint32 lvt;
@ -1622,7 +1622,7 @@ fDoubleTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
tag_len = fTagHeader(tvb, offset, &tag_no, &class_tag, &lvt); tag_len = fTagHeader(tvb, offset, &tag_no, &class_tag, &lvt);
d_val = tvb_get_ntohieee_double(tvb, offset+tag_len); d_val = tvb_get_ntohieee_double(tvb, offset+tag_len);
ti = proto_tree_add_text(tree, tvb, offset, 8+tag_len, ti = proto_tree_add_text(tree, tvb, offset, 8+tag_len,
"%s%lf (Double)", LABEL(label), d_val); "%s%lf (Double)", label, d_val);
subtree = proto_item_add_subtree(ti, ett_bacapp_tag); subtree = proto_item_add_subtree(ti, ett_bacapp_tag);
fTagHeaderTree(tvb, subtree, offset, &tag_no, &class_tag, &lvt); fTagHeaderTree(tvb, subtree, offset, &tag_no, &class_tag, &lvt);
@ -1652,7 +1652,7 @@ fProcessId (tvbuff_t *tvb, proto_tree *tree, guint offset)
} }
static guint static guint
fTimeSpan (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label) fTimeSpan (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label)
{ {
guint32 val = 0, lvt; guint32 val = 0, lvt;
guint8 tag_no, class_tag; guint8 tag_no, class_tag;
@ -1664,12 +1664,12 @@ fTimeSpan (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
if (fUnsigned32 (tvb, offset+tag_len, lvt, &val)) if (fUnsigned32 (tvb, offset+tag_len, lvt, &val))
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len, ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%s (hh.mm.ss): %d.%02d.%02d%s", "%s (hh.mm.ss): %d.%02d.%02d%s",
LABEL(label), label,
(val / 3600), ((val % 3600) / 60), (val % 60), (val / 3600), ((val % 3600) / 60), (val % 60),
val == 0 ? " (indefinite)" : ""); val == 0 ? " (indefinite)" : "");
else else
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len, ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%s - %u octets (Signed)", LABEL(label), lvt); "%s - %u octets (Signed)", label, lvt);
subtree = proto_item_add_subtree(ti, ett_bacapp_tag); subtree = proto_item_add_subtree(ti, ett_bacapp_tag);
fTagHeaderTree(tvb, subtree, offset, &tag_no, &class_tag, &lvt); fTagHeaderTree(tvb, subtree, offset, &tag_no, &class_tag, &lvt);
@ -1701,7 +1701,7 @@ fWeekNDay (tvbuff_t *tvb, proto_tree *tree, guint offset)
} }
static guint static guint
fDate (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label) fDate (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label)
{ {
guint32 year, month, day, weekday; guint32 year, month, day, weekday;
guint8 tag_no, class_tag; guint8 tag_no, class_tag;
@ -1717,11 +1717,11 @@ fDate (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
weekday = tvb_get_guint8(tvb, offset+tag_len+3); weekday = tvb_get_guint8(tvb, offset+tag_len+3);
if ((year == 255) && (day == 255) && (month == 255) && (weekday == 255)) if ((year == 255) && (day == 255) && (month == 255) && (weekday == 255))
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len, ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%sany", LABEL(label)); "%sany", label);
else else
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len, ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%s%s %d, %d, (Day of Week = %s)", "%s%s %d, %d, (Day of Week = %s)",
LABEL(label), val_to_str(month, label, val_to_str(month,
months, months,
"month (%d) not found"), "month (%d) not found"),
day, year, val_to_str(weekday, day, year, val_to_str(weekday,
@ -1734,7 +1734,7 @@ fDate (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
} }
static guint static guint
fTime (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label) fTime (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label)
{ {
guint32 year, month, day, weekday, lvt; guint32 year, month, day, weekday, lvt;
guint8 tag_no, class_tag; guint8 tag_no, class_tag;
@ -1749,11 +1749,11 @@ fTime (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
weekday = tvb_get_guint8(tvb, offset+tag_len+3); weekday = tvb_get_guint8(tvb, offset+tag_len+3);
if ((year == 255) && (day == 255) && (month == 255) && (weekday == 255)) if ((year == 255) && (day == 255) && (month == 255) && (weekday == 255))
ti = proto_tree_add_text(tree, tvb, offset, ti = proto_tree_add_text(tree, tvb, offset,
lvt+tag_len, "%sany", LABEL(label)); lvt+tag_len, "%sany", label);
else else
ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len, ti = proto_tree_add_text(tree, tvb, offset, lvt+tag_len,
"%s%d:%02d:%02d.%d %s = %02d:%02d:%02d.%d", "%s%d:%02d:%02d.%d %s = %02d:%02d:%02d.%d",
LABEL(label), label,
year > 12 ? year -12 : year, year > 12 ? year -12 : year,
month, day, weekday, month, day, weekday,
year > 12 ? "P.M." : "A.M.", year > 12 ? "P.M." : "A.M.",
@ -1765,13 +1765,13 @@ fTime (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
} }
static guint static guint
fDateTime (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label) fDateTime (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label)
{ {
proto_tree *subtree = tree; proto_tree *subtree = tree;
proto_item *tt; proto_item *tt;
if (label != NULL) { if (label != NULL) {
tt = proto_tree_add_text (subtree, tvb, offset, 1, "%s", LABEL(label)); tt = proto_tree_add_text (subtree, tvb, offset, 1, "%s", label);
subtree = proto_item_add_subtree(tt, ett_bacapp_value); subtree = proto_item_add_subtree(tt, ett_bacapp_value);
} }
offset = fDate (tvb,subtree,offset,"Date: "); offset = fDate (tvb,subtree,offset,"Date: ");
@ -1894,7 +1894,7 @@ fDestination (tvbuff_t *tvb, proto_tree *tree, guint offset)
} }
static guint static guint
fOctetString (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label, guint32 lvt) fOctetString (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label, guint32 lvt)
{ {
gchar *tmp; gchar *tmp;
@ -1902,7 +1902,7 @@ fOctetString (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label, guin
return offset; return offset;
tmp = tvb_bytes_to_str(tvb, offset, lvt); tmp = tvb_bytes_to_str(tvb, offset, lvt);
proto_tree_add_text(tree, tvb, offset, lvt, "%s %s", LABEL(label), tmp); proto_tree_add_text(tree, tvb, offset, lvt, "%s %s", label, tmp);
return offset + lvt; return offset + lvt;
} }
@ -2112,7 +2112,7 @@ fPropertyIdentifier (tvbuff_t *tvb, proto_tree *tree, guint offset)
} }
static guint static guint
fCharacterString (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label) fCharacterString (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label)
{ {
guint8 tag_no, class_tag, character_set; guint8 tag_no, class_tag, character_set;
guint32 lvt, l; guint32 lvt, l;
@ -2214,7 +2214,7 @@ fCharacterString (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
out = str_val; out = str_val;
break; break;
} }
proto_tree_add_text(tree, tvb, offset, l, "%s'%s'", LABEL(label), out); proto_tree_add_text(tree, tvb, offset, l, "%s'%s'", label, out);
lvt-=l; lvt-=l;
offset+=l; offset+=l;
} while (lvt > 0); } while (lvt > 0);
@ -2223,7 +2223,7 @@ fCharacterString (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
} }
static guint static guint
fBitStringTagVS (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label, fBitStringTagVS (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label,
const value_string *src) const value_string *src)
{ {
guint8 tag_no, class_tag, tmp; guint8 tag_no, class_tag, tmp;
@ -2243,7 +2243,7 @@ fBitStringTagVS (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label,
proto_tree_add_text(tree, tvb, proto_tree_add_text(tree, tvb,
offset+i+1, 1, offset+i+1, 1,
"%s%s = TRUE", "%s%s = TRUE",
LABEL(label), label,
val_to_str((guint) (i*8 +j), val_to_str((guint) (i*8 +j),
src, src,
ASHRAE_Reserved_Fmt)); ASHRAE_Reserved_Fmt));
@ -2251,7 +2251,7 @@ fBitStringTagVS (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label,
proto_tree_add_text(tree, tvb, proto_tree_add_text(tree, tvb,
offset+i+1, 1, offset+i+1, 1,
"%s%s = FALSE", "%s%s = FALSE",
LABEL(label), label,
val_to_str((guint) (i*8 +j), val_to_str((guint) (i*8 +j),
src, src,
ASHRAE_Reserved_Fmt)); ASHRAE_Reserved_Fmt));
@ -2268,19 +2268,19 @@ fBitStringTagVS (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label,
for (; j < 8; j++) for (; j < 8; j++)
bf_arr[min(255,((lvt-2)*8)+j)] = 'x'; bf_arr[min(255,((lvt-2)*8)+j)] = 'x';
bf_arr[min(255,((lvt-2)*8)+j)] = '\0'; bf_arr[min(255,((lvt-2)*8)+j)] = '\0';
proto_tree_add_text(tree, tvb, offset, lvt, "%sB'%s'", LABEL(label), bf_arr); proto_tree_add_text(tree, tvb, offset, lvt, "%sB'%s'", label, bf_arr);
} else { } else {
for (j = 0; j < (int) (8 - unused); j++) { for (j = 0; j < (int) (8 - unused); j++) {
if (tmp & (1 << (7 - j))) if (tmp & (1 << (7 - j)))
proto_tree_add_text(tree, tvb, offset+i+1, 1, proto_tree_add_text(tree, tvb, offset+i+1, 1,
"%s%s = TRUE", "%s%s = TRUE",
LABEL(label), label,
val_to_str((guint) (i*8 +j), val_to_str((guint) (i*8 +j),
src, src,
ASHRAE_Reserved_Fmt)); ASHRAE_Reserved_Fmt));
else else
proto_tree_add_text(tree, tvb, offset+i+1, 1, proto_tree_add_text(tree, tvb, offset+i+1, 1,
"%s%s = FALSE", LABEL(label), "%s%s = FALSE", label,
val_to_str((guint) (i*8 +j), val_to_str((guint) (i*8 +j),
src, src,
ASHRAE_Reserved_Fmt)); ASHRAE_Reserved_Fmt));
@ -2292,7 +2292,7 @@ fBitStringTagVS (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label,
} }
static guint static guint
fBitStringTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label) fBitStringTag (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label)
{ {
return fBitStringTagVS (tvb, tree, offset, label, NULL); return fBitStringTagVS (tvb, tree, offset, label, NULL);
} }
@ -2301,7 +2301,7 @@ fBitStringTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
with reserved and proprietarty ranges (split) */ with reserved and proprietarty ranges (split) */
static guint static guint
fApplicationTypesEnumeratedSplit (tvbuff_t *tvb, proto_tree *tree, guint offset, fApplicationTypesEnumeratedSplit (tvbuff_t *tvb, proto_tree *tree, guint offset,
guint8 *label, const value_string *src, guint32 split_val) const gchar *label, const value_string *src, guint32 split_val)
{ {
guint8 tag_no, class_tag; guint8 tag_no, class_tag;
guint32 lvt; guint32 lvt;
@ -2333,7 +2333,7 @@ fApplicationTypesEnumeratedSplit (tvbuff_t *tvb, proto_tree *tree, guint offset,
offset = fDoubleTag(tvb, tree, offset, label); offset = fDoubleTag(tvb, tree, offset, label);
break; break;
case 6: /** Octet String 20.2.8 */ case 6: /** Octet String 20.2.8 */
ti = proto_tree_add_text(tree, tvb, offset, tag_len, "%s (%d Characters)", LABEL(label), lvt); ti = proto_tree_add_text(tree, tvb, offset, tag_len, "%s (%d Characters)", label, lvt);
subtree = proto_item_add_subtree(ti, ett_bacapp_tag); subtree = proto_item_add_subtree(ti, ett_bacapp_tag);
offset += fTagHeaderTree(tvb, subtree, offset, &tag_no, &class_tag, &lvt); offset += fTagHeaderTree(tvb, subtree, offset, &tag_no, &class_tag, &lvt);
offset = fOctetString (tvb, tree, offset, label, lvt); offset = fOctetString (tvb, tree, offset, label, lvt);
@ -2359,7 +2359,7 @@ fApplicationTypesEnumeratedSplit (tvbuff_t *tvb, proto_tree *tree, guint offset,
case 13: /* reserved for ASHRAE */ case 13: /* reserved for ASHRAE */
case 14: case 14:
case 15: case 15:
proto_tree_add_text(tree, tvb, offset, lvt+tag_len, "%s'reserved for ASHRAE'", LABEL(label)); proto_tree_add_text(tree, tvb, offset, lvt+tag_len, "%s'reserved for ASHRAE'", label);
offset+=lvt+tag_len; offset+=lvt+tag_len;
break; break;
default: default:
@ -2371,14 +2371,14 @@ fApplicationTypesEnumeratedSplit (tvbuff_t *tvb, proto_tree *tree, guint offset,
static guint static guint
fApplicationTypesEnumerated (tvbuff_t *tvb, proto_tree *tree, guint offset, fApplicationTypesEnumerated (tvbuff_t *tvb, proto_tree *tree, guint offset,
guint8 *label, const value_string *vs) const gchar *label, const value_string *vs)
{ {
return fApplicationTypesEnumeratedSplit(tvb, tree, offset, label, vs, 0); return fApplicationTypesEnumeratedSplit(tvb, tree, offset, label, vs, 0);
} }
static guint static guint
fApplicationTypes (tvbuff_t *tvb, proto_tree *tree, guint offset, fApplicationTypes (tvbuff_t *tvb, proto_tree *tree, guint offset,
guint8 *label) const gchar *label)
{ {
return fApplicationTypesEnumeratedSplit(tvb, tree, offset, label, NULL, 0); return fApplicationTypesEnumeratedSplit(tvb, tree, offset, label, NULL, 0);
} }
@ -2770,7 +2770,7 @@ fConfirmedPrivateTransferAck(tvbuff_t *tvb, proto_tree *tree, guint offset)
} }
static guint static guint
fLifeSafetyOperationRequest(tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label) fLifeSafetyOperationRequest(tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label)
{ {
guint lastoffset = 0; guint lastoffset = 0;
guint8 tag_no, class_tag; guint8 tag_no, class_tag;
@ -2779,7 +2779,7 @@ fLifeSafetyOperationRequest(tvbuff_t *tvb, proto_tree *tree, guint offset, guint
proto_item *tt; proto_item *tt;
if (label != NULL) { if (label != NULL) {
tt = proto_tree_add_text (subtree, tvb, offset, 1, "%s", LABEL(label)); tt = proto_tree_add_text (subtree, tvb, offset, 1, "%s", label);
subtree = proto_item_add_subtree(tt, ett_bacapp_value); subtree = proto_item_add_subtree(tt, ett_bacapp_value);
} }
@ -5747,7 +5747,7 @@ proto_reg_handoff_bacapp(void)
} }
guint32 guint32
fConvertXXXtoUTF8 (const guint8 *in, size_t *inbytesleft, guint8 *out, size_t *outbytesleft, guint8 *fromcoding) fConvertXXXtoUTF8 (const guint8 *in, size_t *inbytesleft, guint8 *out, size_t *outbytesleft, const gchar *fromcoding)
{ /* I don't want to let in and out be modified */ { /* I don't want to let in and out be modified */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#if HAVE_ICONV_H #if HAVE_ICONV_H
@ -5760,7 +5760,7 @@ fConvertXXXtoUTF8 (const guint8 *in, size_t *inbytesleft, guint8 *out, size_t *o
if ((icd = iconv_open ("UTF-8", fromcoding)) != (iconv_t) -1) { if ((icd = iconv_open ("UTF-8", fromcoding)) != (iconv_t) -1) {
i = iconv (icd, (char**) inpp, inbytesleft, (char**) outpp, outbytesleft); i = iconv (icd, inpp, inbytesleft, (char**) outpp, outbytesleft);
*outpp[0] = '\0'; *outpp[0] = '\0';
iconv_close (icd); iconv_close (icd);
return i; return i;

View File

@ -63,11 +63,6 @@
#define true 1 #define true 1
#endif #endif
#ifndef LABEL
#define LABEL(lbl) (lbl==NULL ? (guint8 *) "Value: " : lbl)
#endif
/* BACnet PDU Types */ /* BACnet PDU Types */
#define BACAPP_TYPE_CONFIRMED_SERVICE_REQUEST 0 #define BACAPP_TYPE_CONFIRMED_SERVICE_REQUEST 0
#define BACAPP_TYPE_UNCONFIRMED_SERVICE_REQUEST 1 #define BACAPP_TYPE_UNCONFIRMED_SERVICE_REQUEST 1
@ -252,7 +247,7 @@ fAbortPDU(tvbuff_t *tvb, proto_tree *tree, guint offset);
* @return modified offset * @return modified offset
*/ */
static guint static guint
fUnsignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label); fUnsignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
/** /**
* 20.2.5, adds the label with max 64Bit signed Integer Value to tree * 20.2.5, adds the label with max 64Bit signed Integer Value to tree
@ -263,7 +258,7 @@ fUnsignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label);
* @return modified offset * @return modified offset
*/ */
static guint static guint
fSignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label); fSignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
/** /**
* 20.2.8, adds the label with Octet String to tree; if lvt == 0 then lvt = restOfFrame * 20.2.8, adds the label with Octet String to tree; if lvt == 0 then lvt = restOfFrame
@ -275,7 +270,7 @@ fSignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label);
* @return modified offset * @return modified offset
*/ */
static guint static guint
fOctetString (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label, guint32 lvt); fOctetString (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label, guint32 lvt);
/** /**
* 20.2.12, adds the label with Date Value to tree * 20.2.12, adds the label with Date Value to tree
@ -286,7 +281,7 @@ fOctetString (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label, guin
* @return modified offset * @return modified offset
*/ */
static guint static guint
fDate (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label); fDate (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
/** /**
* 20.2.13, adds the label with Time Value to tree * 20.2.13, adds the label with Time Value to tree
@ -297,7 +292,7 @@ fDate (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label);
* @return modified offset * @return modified offset
*/ */
static guint static guint
fTime (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label); fTime (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
/** /**
* 20.2.14, adds Object Identifier to tree * 20.2.14, adds Object Identifier to tree
@ -489,7 +484,7 @@ fGetEventInformationACK (tvbuff_t *tvb, proto_tree *tree, guint offset);
* @return modified offset * @return modified offset
*/ */
static guint static guint
fLifeSafetyOperationRequest(tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label); fLifeSafetyOperationRequest(tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
/** /**
* SubscribeCOV-Request ::= SEQUENCE { * SubscribeCOV-Request ::= SEQUENCE {
@ -1289,7 +1284,7 @@ fVTCloseError(tvbuff_t *tvb, proto_tree *tree, guint offset);
* @return modified offset * @return modified offset
*/ */
static guint static guint
fApplicationTypes (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label); fApplicationTypes (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
/** /**
* BACnetActionCommand ::= SEQUENCE { * BACnetActionCommand ::= SEQUENCE {
@ -1415,7 +1410,7 @@ fDateRange (tvbuff_t *tvb, proto_tree *tree, guint offset);
* @return modified offset * @return modified offset
*/ */
static guint static guint
fDateTime (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label); fDateTime (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
/** /**
* BACnetDestination ::= SEQUENCE { * BACnetDestination ::= SEQUENCE {
@ -1893,7 +1888,7 @@ fProcessId (tvbuff_t *tvb, proto_tree *tree, guint offset);
* @return modified offset * @return modified offset
*/ */
static guint static guint
fTimeSpan (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label); fTimeSpan (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
/** /**
* BACnet Application PDUs chapter 21 * BACnet Application PDUs chapter 21
@ -2016,7 +2011,7 @@ proto_reg_handoff_bacapp(void);
* @return count of modified characters of returned string, -1 for errors * @return count of modified characters of returned string, -1 for errors
*/ */
guint32 guint32
fConvertXXXtoUTF8(const guint8 *in, size_t *inbytesleft,guint8 *out, size_t *outbytesleft, guint8 *fromcoding); fConvertXXXtoUTF8(const guint8 *in, size_t *inbytesleft,guint8 *out, size_t *outbytesleft, const gchar *fromcoding);
#endif /* __BACAPP_H__ */ #endif /* __BACAPP_H__ */

View File

@ -547,7 +547,7 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
int st_offset, msgno, ansno, seqno, size, channel, ackno, window, cc, int st_offset, msgno, ansno, seqno, size, channel, ackno, window, cc,
more; more;
char * cmd_temp = NULL; const char * cmd_temp = NULL;
int is_ANS = 0; int is_ANS = 0;
st_offset = offset; st_offset = offset;

View File

@ -156,14 +156,14 @@ dissect_ber_oid_NULL_callback(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_t
void void
register_ber_oid_dissector_handle(char *oid, dissector_handle_t dissector, int proto _U_, char *name) register_ber_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name)
{ {
dissector_add_string("ber.oid", oid, dissector); dissector_add_string("ber.oid", oid, dissector);
g_hash_table_insert(oid_table, oid, name); g_hash_table_insert(oid_table, oid, name);
} }
void void
register_ber_oid_dissector(char *oid, dissector_t dissector, int proto, char *name) register_ber_oid_dissector(const char *oid, dissector_t dissector, int proto, const char *name)
{ {
dissector_handle_t dissector_handle; dissector_handle_t dissector_handle;
@ -174,7 +174,7 @@ register_ber_oid_dissector(char *oid, dissector_t dissector, int proto, char *na
/* Register the oid name to get translation in proto dissection */ /* Register the oid name to get translation in proto dissection */
void void
register_ber_oid_name(char *oid, char *name) register_ber_oid_name(const char *oid, const char *name)
{ {
g_hash_table_insert(oid_table, oid, name); g_hash_table_insert(oid_table, oid, name);
} }
@ -1731,7 +1731,7 @@ int dissect_ber_bitstring(gboolean implicit_tag, packet_info *pinfo, proto_tree
proto_item *item = NULL; proto_item *item = NULL;
proto_tree *tree = NULL; proto_tree *tree = NULL;
const asn_namedbit *nb; const asn_namedbit *nb;
char *sep; const char *sep;
gboolean term; gboolean term;
if(!implicit_tag){ if(!implicit_tag){
@ -1828,7 +1828,7 @@ int dissect_ber_bitstring32(gboolean implicit_tag, packet_info *pinfo, proto_tre
guint32 val; guint32 val;
int **bf; int **bf;
header_field_info *hfi; header_field_info *hfi;
char *sep; const char *sep;
gboolean term; gboolean term;
unsigned int i, tvb_len; unsigned int i, tvb_len;

View File

@ -153,8 +153,8 @@ typedef struct _asn_namedbit {
int *p_id; int *p_id;
gint32 gb0; /* the 1st bit of "bit group", -1 = the 1st bit of current byte */ gint32 gb0; /* the 1st bit of "bit group", -1 = the 1st bit of current byte */
gint32 gb1; /* last bit of "bit group", -1 = last bit of current byte */ gint32 gb1; /* last bit of "bit group", -1 = last bit of current byte */
gchar *tstr; /* true string */ const gchar *tstr; /* true string */
gchar *fstr; /* false string */ const gchar *fstr; /* false string */
} asn_namedbit; } asn_namedbit;
/* this function dissects a BER BIT-STRING /* this function dissects a BER BIT-STRING
*/ */
@ -166,9 +166,9 @@ extern proto_item *ber_last_created_item;
extern proto_item *get_ber_last_created_item(void); extern proto_item *get_ber_last_created_item(void);
int call_ber_oid_callback(char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree); int call_ber_oid_callback(char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
void register_ber_oid_dissector_handle(char *oid, dissector_handle_t dissector, int proto, char *name); void register_ber_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto, const char *name);
void register_ber_oid_dissector(char *oid, dissector_t dissector, int proto, char *name); void register_ber_oid_dissector(const char *oid, dissector_t dissector, int proto, const char *name);
void register_ber_oid_name(char *oid, char *name); void register_ber_oid_name(const char *oid, const char *name);
void dissect_ber_oid_NULL_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); void dissect_ber_oid_NULL_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
char * get_ber_oid_name(char *str); char * get_ber_oid_name(char *str);

View File

@ -381,7 +381,7 @@ static gint bgp_asn_len = 0;
*/ */
static int static int
decode_prefix4(proto_tree *tree, int hf_addr, tvbuff_t *tvb, gint offset, decode_prefix4(proto_tree *tree, int hf_addr, tvbuff_t *tvb, gint offset,
guint16 tlen, char *tag) guint16 tlen, const char *tag)
{ {
proto_item *ti; proto_item *ti;
proto_tree *prefix_tree; proto_tree *prefix_tree;
@ -423,7 +423,7 @@ decode_prefix4(proto_tree *tree, int hf_addr, tvbuff_t *tvb, gint offset,
*/ */
static int static int
decode_prefix6(proto_tree *tree, int hf_addr, tvbuff_t *tvb, gint offset, decode_prefix6(proto_tree *tree, int hf_addr, tvbuff_t *tvb, gint offset,
guint16 tlen, char *tag) guint16 tlen, const char *tag)
{ {
proto_item *ti; proto_item *ti;
proto_tree *prefix_tree; proto_tree *prefix_tree;
@ -635,7 +635,7 @@ mp_addr_to_str (guint16 afi, guint8 safi, tvbuff_t *tvb, gint offset, GString *b
*/ */
static int static int
decode_prefix_MP(proto_tree *tree, int hf_addr4, int hf_addr6, decode_prefix_MP(proto_tree *tree, int hf_addr4, int hf_addr6,
guint16 afi, guint8 safi, tvbuff_t *tvb, gint offset, char *tag) guint16 afi, guint8 safi, tvbuff_t *tvb, gint offset, const char *tag)
{ {
int start_offset = offset; int start_offset = offset;
proto_item *ti; proto_item *ti;

View File

@ -382,7 +382,7 @@ static const value_string tab_bssgp_ie_types[] = {
typedef struct { typedef struct {
guint8 iei; guint8 iei;
char *name; const char *name;
guint8 presence_req; guint8 presence_req;
int format; int format;
gint16 value_length; /* in bytes (read from capture)*/ gint16 value_length; /* in bytes (read from capture)*/
@ -574,15 +574,15 @@ tvb_get_bits8(tvbuff_t *tvb, guint64 bo, guint8 num_bits) {
return (data & mask) >> (16 - shift_value - num_bits); return (data & mask) >> (16 - shift_value - num_bits);
} }
proto_item * static proto_item *
bit_proto_tree_add_text(proto_tree *tree, tvbuff_t *tvb, bit_proto_tree_add_text(proto_tree *tree, tvbuff_t *tvb,
guint64 bo, guint8 bl, char *value) { guint64 bo, guint8 bl, const char *value) {
/* XXX: Use varargs */ /* XXX: Use varargs */
return proto_tree_add_text(tree, tvb, get_start_octet(bo), return proto_tree_add_text(tree, tvb, get_start_octet(bo),
get_num_octets_spanned(bo, bl), value); get_num_octets_spanned(bo, bl), value);
} }
proto_item * static proto_item *
bit_proto_tree_add_bit_field8(proto_tree *tree, tvbuff_t *tvb, bit_proto_tree_add_bit_field8(proto_tree *tree, tvbuff_t *tvb,
guint64 bo, guint8 bl) { guint64 bo, guint8 bl) {
/* XXX: Use varargs */ /* XXX: Use varargs */
@ -610,7 +610,7 @@ bit_proto_tree_add_bit_field8(proto_tree *tree, tvbuff_t *tvb,
return pi; return pi;
} }
static char* static const char*
translate_abqp_reliability_class(guint8 value, build_info_t *bi) { translate_abqp_reliability_class(guint8 value, build_info_t *bi) {
switch (value) { switch (value) {
case 0: case 0:
@ -636,7 +636,7 @@ translate_abqp_reliability_class(guint8 value, build_info_t *bi) {
return "Unacknowledged GTP and LLC; Acknowledged RLC, Protected data"; return "Unacknowledged GTP and LLC; Acknowledged RLC, Protected data";
} }
} }
static char* static const char*
translate_abqp_delay_class(guint8 value, build_info_t *bi) { translate_abqp_delay_class(guint8 value, build_info_t *bi) {
switch (value) { switch (value) {
case 0: case 0:
@ -655,7 +655,7 @@ translate_abqp_delay_class(guint8 value, build_info_t *bi) {
return "Delay class 4 (best effort)"; return "Delay class 4 (best effort)";
} }
} }
static char* static const char*
translate_abqp_peak_throughput(guint8 value, build_info_t *bi) { translate_abqp_peak_throughput(guint8 value, build_info_t *bi) {
switch (value) { switch (value) {
case 0: case 0:
@ -679,7 +679,7 @@ translate_abqp_peak_throughput(guint8 value, build_info_t *bi) {
return "Up to 1 000 octets/s"; return "Up to 1 000 octets/s";
} }
} }
static char* static const char*
translate_abqp_precedence_class(guint8 value, build_info_t *bi) { translate_abqp_precedence_class(guint8 value, build_info_t *bi) {
switch (value) { switch (value) {
case 0: case 0:
@ -697,7 +697,7 @@ translate_abqp_precedence_class(guint8 value, build_info_t *bi) {
return "Normal priority"; return "Normal priority";
} }
} }
static char* static const char*
translate_abqp_mean_throughput(guint8 value, build_info_t *bi) { translate_abqp_mean_throughput(guint8 value, build_info_t *bi) {
switch (value) { switch (value) {
case 0: case 0:
@ -731,7 +731,7 @@ translate_abqp_mean_throughput(guint8 value, build_info_t *bi) {
return "Best effort"; return "Best effort";
} }
} }
static char* static const char*
translate_abqp_traffic_class(guint8 value, build_info_t *bi) { translate_abqp_traffic_class(guint8 value, build_info_t *bi) {
switch (value) { switch (value) {
case 0: case 0:
@ -757,7 +757,7 @@ translate_abqp_traffic_class(guint8 value, build_info_t *bi) {
} }
} }
} }
static char* static const char*
translate_abqp_delivery_order(guint8 value, build_info_t *bi) { translate_abqp_delivery_order(guint8 value, build_info_t *bi) {
switch (value) { switch (value) {
case 0: case 0:
@ -774,7 +774,7 @@ translate_abqp_delivery_order(guint8 value, build_info_t *bi) {
return "Error in BSSGP dissector"; return "Error in BSSGP dissector";
} }
} }
static char* static const char*
translate_abqp_delivery_of_erroneous_sdu(guint8 value, build_info_t *bi) { translate_abqp_delivery_of_erroneous_sdu(guint8 value, build_info_t *bi) {
switch (value) { switch (value) {
case 0: case 0:
@ -799,7 +799,7 @@ translate_abqp_delivery_of_erroneous_sdu(guint8 value, build_info_t *bi) {
} }
} }
} }
static char* static const char*
translate_abqp_max_sdu_size(guint8 value, build_info_t *bi) { translate_abqp_max_sdu_size(guint8 value, build_info_t *bi) {
static char result[BSSGP_TRANSLATION_MAX_LEN]; static char result[BSSGP_TRANSLATION_MAX_LEN];
@ -836,7 +836,7 @@ translate_abqp_max_sdu_size(guint8 value, build_info_t *bi) {
} }
} }
static char* static const char*
translate_abqp_max_bit_rate_for_ul(guint8 value, build_info_t *bi) { translate_abqp_max_bit_rate_for_ul(guint8 value, build_info_t *bi) {
static char result[BSSGP_TRANSLATION_MAX_LEN]; static char result[BSSGP_TRANSLATION_MAX_LEN];
@ -863,12 +863,12 @@ translate_abqp_max_bit_rate_for_ul(guint8 value, build_info_t *bi) {
return "0 kbps"; return "0 kbps";
} }
static char* static const char*
translate_abqp_max_bit_rate_for_dl(guint8 value, build_info_t *bi) { translate_abqp_max_bit_rate_for_dl(guint8 value, build_info_t *bi) {
return translate_abqp_max_bit_rate_for_ul(value, bi); return translate_abqp_max_bit_rate_for_ul(value, bi);
} }
static char* static const char*
translate_abqp_residual_ber(guint8 value, build_info_t *bi) { translate_abqp_residual_ber(guint8 value, build_info_t *bi) {
switch (value) { switch (value) {
case 0: case 0:
@ -899,7 +899,7 @@ translate_abqp_residual_ber(guint8 value, build_info_t *bi) {
} }
} }
static char* static const char*
translate_abqp_sdu_error_ratio(guint8 value, build_info_t *bi) { translate_abqp_sdu_error_ratio(guint8 value, build_info_t *bi) {
switch (value) { switch (value) {
case 0: case 0:
@ -928,7 +928,7 @@ translate_abqp_sdu_error_ratio(guint8 value, build_info_t *bi) {
} }
} }
static char* static const char*
translate_abqp_transfer_delay(guint8 value, build_info_t *bi) { translate_abqp_transfer_delay(guint8 value, build_info_t *bi) {
static char result[BSSGP_TRANSLATION_MAX_LEN]; static char result[BSSGP_TRANSLATION_MAX_LEN];
@ -955,7 +955,7 @@ translate_abqp_transfer_delay(guint8 value, build_info_t *bi) {
return "Reserved"; return "Reserved";
} }
static char* static const char*
translate_abqp_traffic_handling_priority(guint8 value, build_info_t *bi) { translate_abqp_traffic_handling_priority(guint8 value, build_info_t *bi) {
switch (value) { switch (value) {
case 0: case 0:
@ -972,16 +972,16 @@ translate_abqp_traffic_handling_priority(guint8 value, build_info_t *bi) {
} }
} }
static char* static const char*
translate_abqp_guaranteed_bit_rate_for_ul(guint8 value, build_info_t *bi) { translate_abqp_guaranteed_bit_rate_for_ul(guint8 value, build_info_t *bi) {
return translate_abqp_max_bit_rate_for_ul(value, bi); return translate_abqp_max_bit_rate_for_ul(value, bi);
} }
static char* static const char*
translate_abqp_guaranteed_bit_rate_for_dl(guint8 value, build_info_t *bi) { translate_abqp_guaranteed_bit_rate_for_dl(guint8 value, build_info_t *bi) {
return translate_abqp_max_bit_rate_for_ul(value, bi); return translate_abqp_max_bit_rate_for_ul(value, bi);
} }
static char* static const char*
translate_abqp_source_statistics_descriptor(guint8 value, build_info_t *bi) { translate_abqp_source_statistics_descriptor(guint8 value, build_info_t *bi) {
if (bi->ul_data) { if (bi->ul_data) {
switch (value) { switch (value) {
@ -995,7 +995,7 @@ translate_abqp_source_statistics_descriptor(guint8 value, build_info_t *bi) {
} }
} }
static char* static const char*
translate_abqp_max_bit_rate_for_dl_extended(guint8 value, build_info_t *bi _U_) { translate_abqp_max_bit_rate_for_dl_extended(guint8 value, build_info_t *bi _U_) {
static char result[BSSGP_TRANSLATION_MAX_LEN]; static char result[BSSGP_TRANSLATION_MAX_LEN];
@ -1010,7 +1010,7 @@ translate_abqp_max_bit_rate_for_dl_extended(guint8 value, build_info_t *bi _U_)
return ""; return "";
} }
static char* static const char*
translate_abqp_guaranteed_bit_rate_for_dl_extended(guint8 value, build_info_t *bi _U_) { translate_abqp_guaranteed_bit_rate_for_dl_extended(guint8 value, build_info_t *bi _U_) {
static char result[BSSGP_TRANSLATION_MAX_LEN]; static char result[BSSGP_TRANSLATION_MAX_LEN];
@ -1060,7 +1060,7 @@ translate_msrac_dtm_gprs_multislot_class(guint8 value) {
return val_to_str(value, tab_values, ""); return val_to_str(value, tab_values, "");
} }
static char* static const char*
translate_msrac_extended_dtm_gprs_multislot_class(guint8 value, guint8 dgmsc) { translate_msrac_extended_dtm_gprs_multislot_class(guint8 value, guint8 dgmsc) {
switch (dgmsc) { switch (dgmsc) {
case 0: return "Unused, interpreted as Multislot class 5 supported"; case 0: return "Unused, interpreted as Multislot class 5 supported";
@ -1191,7 +1191,7 @@ translate_msrac_high_multislot_capability(guint8 capability, guint8 class) {
} }
#endif #endif
static char* static const char*
translate_channel_needed(guint8 value) { translate_channel_needed(guint8 value) {
switch (value) { switch (value) {
case 0: return "Any channel"; case 0: return "Any channel";
@ -1610,7 +1610,7 @@ get_value_length(bssgp_ie_t *ie, build_info_t *bi) {
static void static void
decode_simple_ie(bssgp_ie_t *ie, build_info_t *bi, int ie_start_offset, decode_simple_ie(bssgp_ie_t *ie, build_info_t *bi, int ie_start_offset,
char *pre_str, char *post_str, const char *pre_str, const char *post_str,
gboolean show_as_dec) { gboolean show_as_dec) {
/* XXX: Allow mask? */ /* XXX: Allow mask? */
proto_item *ti; proto_item *ti;

View File

@ -656,7 +656,7 @@ dissect_address_tlv(tvbuff_t *tvb, int offset, int length, proto_tree *tree)
int nlpid; int nlpid;
const char *protocol_str; const char *protocol_str;
guint16 address_length; guint16 address_length;
char *address_type_str; const char *address_type_str;
char *address_str; char *address_str;
if (length < 1) if (length < 1)

View File

@ -156,7 +156,7 @@ struct _COPS_CNV
guint class; guint class;
guint tag; guint tag;
gint syntax; gint syntax;
gchar *name; const gchar *name;
}; };
static COPS_CNV CopsCnv [] = static COPS_CNV CopsCnv [] =
@ -174,7 +174,7 @@ static COPS_CNV CopsCnv [] =
{0, 0, -1, NULL} {0, 0, -1, NULL}
}; };
static gchar * static const gchar *
cops_tag_cls2syntax ( guint tag, guint cls, gushort *syntax) cops_tag_cls2syntax ( guint tag, guint cls, gushort *syntax)
{ {
COPS_CNV *cnv; COPS_CNV *cnv;
@ -796,8 +796,8 @@ static int dissect_cops_pr_object_data(tvbuff_t *tvb, guint32 offset, proto_tree
guint8 s_num, guint8 s_type, int len); guint8 s_num, guint8 s_type, int len);
/* Added for PacketCable */ /* Added for PacketCable */
static proto_tree *info_to_cops_subtree(tvbuff_t *, proto_tree *, int, int, char *); static proto_tree *info_to_cops_subtree(tvbuff_t *, proto_tree *, int, int, const char *);
static proto_item *info_to_display(tvbuff_t *, proto_item *, int, int, char *, const value_string *, int, gint *); static proto_item *info_to_display(tvbuff_t *, proto_item *, int, int, const char *, const value_string *, int, gint *);
static void cops_transaction_id(tvbuff_t *, packet_info *, proto_tree *, guint8, guint, guint32); static void cops_transaction_id(tvbuff_t *, packet_info *, proto_tree *, guint8, guint, guint32);
static void cops_subscriber_id_v4(tvbuff_t *, proto_tree *, guint, guint32); static void cops_subscriber_id_v4(tvbuff_t *, proto_tree *, guint, guint32);
@ -906,7 +906,7 @@ dissect_cops_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} }
} }
static char *cops_c_type_to_str(guint8 c_num, guint8 c_type) static const char *cops_c_type_to_str(guint8 c_num, guint8 c_type)
{ {
switch (c_num) { switch (c_num) {
case COPS_OBJ_HANDLE: case COPS_OBJ_HANDLE:
@ -969,7 +969,7 @@ static int dissect_cops_object(tvbuff_t *tvb, packet_info *pinfo, guint8 op_code
guint8 c_num, c_type; guint8 c_num, c_type;
proto_item *ti; proto_item *ti;
proto_tree *obj_tree; proto_tree *obj_tree;
char *type_str; const char *type_str;
object_len = tvb_get_ntohs(tvb, offset); object_len = tvb_get_ntohs(tvb, offset);
if (object_len < COPS_OBJECT_HDR_SIZE) { if (object_len < COPS_OBJECT_HDR_SIZE) {
@ -1329,7 +1329,7 @@ static int decode_cops_pr_asn1_data(tvbuff_t *tvb, guint32 offset,
guint vb_length; guint vb_length;
gushort vb_type; gushort vb_type;
gchar *vb_type_name; const gchar *vb_type_name;
int ret; int ret;
guint cls, con, tag; guint cls, con, tag;
@ -2498,7 +2498,7 @@ void proto_reg_handoff_cops(void)
*/ */
static proto_item * static proto_item *
info_to_display(tvbuff_t *tvb, proto_item *stt, int offset, int octets, char *str, const value_string *vsp, int mode,gint *hf_proto_parameter) info_to_display(tvbuff_t *tvb, proto_item *stt, int offset, int octets, const char *str, const value_string *vsp, int mode,gint *hf_proto_parameter)
{ {
proto_item *pi = NULL; proto_item *pi = NULL;
guint8 code8 = 0; guint8 code8 = 0;
@ -2627,7 +2627,7 @@ info_to_display(tvbuff_t *tvb, proto_item *stt, int offset, int octets, char *st
/* Print the subtree information for cops */ /* Print the subtree information for cops */
static proto_tree * static proto_tree *
info_to_cops_subtree(tvbuff_t *tvb, proto_tree *st, int n, int offset, char *str) { info_to_cops_subtree(tvbuff_t *tvb, proto_tree *st, int n, int offset, const char *str) {
proto_item *tv; proto_item *tv;
tv = proto_tree_add_uint_format( st, hf_cops_subtree, tvb, offset, n, (guint)NULL, str); tv = proto_tree_add_uint_format( st, hf_cops_subtree, tvb, offset, n, (guint)NULL, str);

View File

@ -65,8 +65,8 @@ enum /* Not a typedef'd enum so we can OR */
typedef struct { typedef struct {
guint32 bit; guint32 bit;
char *on_string; const char *on_string;
char *off_string; const char *off_string;
} cups_ptype_bit_info; } cups_ptype_bit_info;
static const cups_ptype_bit_info cups_ptype_bits[] = { static const cups_ptype_bit_info cups_ptype_bits[] = {

View File

@ -3056,7 +3056,7 @@ netlogon_dissect_CIPHER_VALUE_DATA(tvbuff_t *tvb, int offset,
static int static int
netlogon_dissect_CIPHER_VALUE(tvbuff_t *tvb, int offset, netlogon_dissect_CIPHER_VALUE(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *parent_tree, packet_info *pinfo, proto_tree *parent_tree,
guint8 *drep, char *name, int hf_index) guint8 *drep, const char *name, int hf_index)
{ {
proto_item *item=NULL; proto_item *item=NULL;
proto_tree *tree=NULL; proto_tree *tree=NULL;

View File

@ -163,8 +163,8 @@ struct dcmItem {
struct dcmItem *next, *prev; struct dcmItem *next, *prev;
int valid; int valid;
guint8 id; /* 0x20 Presentation Context */ guint8 id; /* 0x20 Presentation Context */
guint8 *abs; /* 0x30 Abstract syntax */ const guint8 *abs; /* 0x30 Abstract syntax */
char *xfer; /* 0x40 Transfer syntax */ const char *xfer; /* 0x40 Transfer syntax */
guint8 syntax; guint8 syntax;
#define DCM_ILE 0x01 /* implicit, little endian */ #define DCM_ILE 0x01 /* implicit, little endian */
#define DCM_EBE 0x02 /* explicit, big endian */ #define DCM_EBE 0x02 /* explicit, big endian */
@ -172,7 +172,7 @@ struct dcmItem {
#define DCM_UNK 0xf0 #define DCM_UNK 0xf0
}; };
typedef struct dcmItem dcmItem_t; typedef struct dcmItem dcmItem_t;
static char *dcm_xfer_unk = "not found - click on ASSOC Request"; static const char *dcm_xfer_unk = "not found - click on ASSOC Request";
struct dcmState { struct dcmState {
dcmItem_t *first, *last; dcmItem_t *first, *last;
@ -189,7 +189,7 @@ typedef struct dcmState dcmState_t;
struct dcmTag { struct dcmTag {
int tag; int tag;
int dtype; int dtype;
char *desc; const char *desc;
#define DCM_TSTR 1 #define DCM_TSTR 1
#define DCM_TINT2 2 #define DCM_TINT2 2
#define DCM_TINT4 3 #define DCM_TINT4 3
@ -316,10 +316,10 @@ mkds(void)
return ds; return ds;
} }
char * const char *
dcm_pdu2str(guint8 item) dcm_pdu2str(guint8 item)
{ {
char *s = ""; const char *s = "";
switch (item) { switch (item) {
case 1: s = "ASSOC Request"; break; case 1: s = "ASSOC Request"; break;
case 2: s = "ASSOC Accept"; break; case 2: s = "ASSOC Accept"; break;
@ -340,10 +340,10 @@ dcm_pdu2str(guint8 item)
return s; return s;
} }
char * const char *
dcm_result2str(guint8 result) dcm_result2str(guint8 result)
{ {
char *s = ""; const char *s = "";
switch (result) { switch (result) {
case 1: s = "Reject Permanent"; break; case 1: s = "Reject Permanent"; break;
case 2: s = "Reject Transient"; break; case 2: s = "Reject Transient"; break;
@ -352,10 +352,10 @@ dcm_result2str(guint8 result)
return s; return s;
} }
char * const char *
dcm_source2str(guint8 source) dcm_source2str(guint8 source)
{ {
char *s = ""; const char *s = "";
switch (source) { switch (source) {
case 1: s = "User"; break; case 1: s = "User"; break;
case 2: s = "Provider (ACSE)"; break; case 2: s = "Provider (ACSE)"; break;
@ -365,10 +365,10 @@ dcm_source2str(guint8 source)
return s; return s;
} }
char * const char *
dcm_reason2str(guint8 source, guint8 reason) dcm_reason2str(guint8 source, guint8 reason)
{ {
char *s = ""; const char *s = "";
if (1 == source) switch (reason) { if (1 == source) switch (reason) {
case 1: s = "No reason"; break; case 1: s = "No reason"; break;
case 2: s = "App Name not supported"; break; case 2: s = "App Name not supported"; break;
@ -387,10 +387,10 @@ dcm_reason2str(guint8 source, guint8 reason)
return s; return s;
} }
char * const char *
dcm_abort2str(guint8 reason) dcm_abort2str(guint8 reason)
{ {
char *s = ""; const char *s = "";
switch (reason) { switch (reason) {
case 0: s = "not specified"; break; case 0: s = "not specified"; break;
case 1: s = "unrecognized"; break; case 1: s = "unrecognized"; break;
@ -403,10 +403,10 @@ dcm_abort2str(guint8 reason)
return s; return s;
} }
char * const char *
dcm_PCresult2str(guint8 result) dcm_PCresult2str(guint8 result)
{ {
char *s = ""; const char *s = "";
switch (result) { switch (result) {
case 0: s = "accept"; break; case 0: s = "accept"; break;
case 1: s = "user-reject"; break; case 1: s = "user-reject"; break;
@ -418,10 +418,10 @@ dcm_PCresult2str(guint8 result)
return s; return s;
} }
char * const char *
dcm_flags2str(guint8 flags) dcm_flags2str(guint8 flags)
{ {
char *s = ""; const char *s = "";
switch (flags) { switch (flags) {
case 0: s = "Data, more Fragments"; break; /* 00 */ case 0: s = "Data, more Fragments"; break; /* 00 */
case 1: s = "Command, more Fragments"; break; /* 01 */ case 1: s = "Command, more Fragments"; break; /* 01 */
@ -432,10 +432,10 @@ dcm_flags2str(guint8 flags)
return s; return s;
} }
char * const char *
dcm_cmd2str(guint16 us) dcm_cmd2str(guint16 us)
{ {
char *s = ""; const char *s = "";
/* there should be a better way to do this */ /* there should be a better way to do this */
switch (us) { switch (us) {
case 0x0001: s = "C-STORE-RQ"; break; case 0x0001: s = "C-STORE-RQ"; break;
@ -466,10 +466,10 @@ dcm_cmd2str(guint16 us)
return s; return s;
} }
char * const char *
dcm_rsp2str(guint16 us) dcm_rsp2str(guint16 us)
{ {
char *s = ""; const char *s = "";
switch (us) { switch (us) {
case 0x0000: s = "Success"; break; case 0x0000: s = "Success"; break;
case 0xa701: case 0xa701:

View File

@ -130,7 +130,7 @@ typedef struct value_name {
typedef struct old_avp_info { typedef struct old_avp_info {
guint32 code; guint32 code;
gchar *name; const gchar *name;
diameterDataType type; diameterDataType type;
const value_string *values; const value_string *values;
} oldAvpInfo; } oldAvpInfo;
@ -1076,7 +1076,7 @@ diameter_avp_get_name(guint32 avpCode, guint32 vendorId)
sprintf(buffer, "Unknown AVP:0x%08x", avpCode); sprintf(buffer, "Unknown AVP:0x%08x", avpCode);
return buffer; return buffer;
} /* diameter_avp_get_name */ } /* diameter_avp_get_name */
static gchar * static const gchar *
diameter_avp_get_value(guint32 avpCode, guint32 vendorId, guint32 avpValue) diameter_avp_get_value(guint32 avpCode, guint32 vendorId, guint32 avpValue)
{ {
avpInfo *probe; avpInfo *probe;
@ -1158,7 +1158,7 @@ dissect_diameter_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint32 commandCode=0, pktLength=0; guint32 commandCode=0, pktLength=0;
guint8 version=0, flags=0; guint8 version=0, flags=0;
gchar flagstr[64] = "<None>"; gchar flagstr[64] = "<None>";
gchar *fstr[] = {"RSVD7", "RSVD6", "RSVD5", "RSVD4", "RSVD3", "Error", "Proxyable", "Request" }; const gchar *fstr[] = {"RSVD7", "RSVD6", "RSVD5", "RSVD4", "RSVD3", "Error", "Proxyable", "Request" };
gchar commandString[64], vendorName[64], applicationName[64]; gchar commandString[64], vendorName[64], applicationName[64];
gint i; gint i;
guint bpos; guint bpos;
@ -1536,7 +1536,7 @@ static void dissect_avps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *avp_tree
size_t avpDataLength; size_t avpDataLength;
int avpType; int avpType;
gchar flagstr[64] = "<None>"; gchar flagstr[64] = "<None>";
gchar *fstr[] = {"RSVD7", "RSVD6", "RSVD5", "RSVD4", "RSVD3", "Protected", "Mandatory", "Vendor-Specific" }; const gchar *fstr[] = {"RSVD7", "RSVD6", "RSVD5", "RSVD4", "RSVD3", "Protected", "Mandatory", "Vendor-Specific" };
gint i; gint i;
guint bpos; guint bpos;

View File

@ -199,7 +199,7 @@ static GHashTable *oui_info_table = NULL;
* Add an entry for a new OUI. * Add an entry for a new OUI.
*/ */
void void
llc_add_oui(guint32 oui, const char *table_name, char *table_ui_name, llc_add_oui(guint32 oui, const char *table_name, const char *table_ui_name,
hf_register_info *hf_item) hf_register_info *hf_item)
{ {
oui_info_t *new_info; oui_info_t *new_info;

View File

@ -33,7 +33,7 @@ void dissect_snap(tvbuff_t *, int, packet_info *, proto_tree *,
/* /*
* Add an entry for a new OUI. * Add an entry for a new OUI.
*/ */
void llc_add_oui(guint32, const char *, char *, hf_register_info *); void llc_add_oui(guint32, const char *, const char *, hf_register_info *);
extern const value_string sap_vals[]; extern const value_string sap_vals[];

View File

@ -110,7 +110,7 @@ typedef int (dissect_function_t)(tvbuff_t *tvb, int offset, packet_info *pinfo,
typedef struct _vsff { typedef struct _vsff {
guint32 value; guint32 value;
gchar *strptr; const gchar *strptr;
dissect_function_t *dissect_call; dissect_function_t *dissect_call;
dissect_function_t *dissect_reply; dissect_function_t *dissect_reply;
} vsff; } vsff;