aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r--epan/tvbuff.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index 3358b7ae1f..38ac3e06e6 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -2476,6 +2476,15 @@ tvb_get_ebcdic_string(wmem_allocator_t *scope, tvbuff_t *tvb, gint offset, gint
return get_ebcdic_string(scope, ptr, length);
}
+static guint8 *
+tvb_get_t61_string(wmem_allocator_t *scope, tvbuff_t *tvb, gint offset, gint length)
+{
+ const guint8 *ptr;
+
+ ptr = ensure_contiguous(tvb, offset, length);
+ return get_t61_string(scope, ptr, length);
+}
+
/*
* Given a tvbuff, an offset, a length, and an encoding, allocate a
* buffer big enough to hold a non-null-terminated string of that length
@@ -2636,6 +2645,10 @@ tvb_get_string_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset,
*/
strptr = tvb_get_ebcdic_string(scope, tvb, offset, length);
break;
+
+ case ENC_T61:
+ strptr = tvb_get_t61_string(scope, tvb, offset, length);
+ break;
}
return strptr;
}
@@ -2812,6 +2825,20 @@ tvb_get_ebcdic_stringz(wmem_allocator_t *scope, tvbuff_t *tvb, gint offset, gint
return get_ebcdic_string(scope, ptr, size);
}
+static guint8 *
+tvb_get_t61_stringz(wmem_allocator_t *scope, tvbuff_t *tvb, gint offset, gint *lengthp)
+{
+ guint size;
+ const guint8 *ptr;
+
+ size = tvb_strsize(tvb, offset);
+ ptr = ensure_contiguous(tvb, offset, size);
+ /* XXX, conversion between signed/unsigned integer */
+ if (lengthp)
+ *lengthp = size;
+ return get_t61_string(scope, ptr, size);
+}
+
guint8 *
tvb_get_stringz_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, gint *lengthp, const guint encoding)
{
@@ -2951,6 +2978,10 @@ tvb_get_stringz_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, g
*/
strptr = tvb_get_ebcdic_stringz(scope, tvb, offset, lengthp);
break;
+
+ case ENC_T61:
+ strptr = tvb_get_t61_stringz(scope, tvb, offset, lengthp);
+ break;
}
return strptr;