Add T.61 character set support

Bug: 13032
Change-Id: I6bf2cc2c43a6262d899a304df6576d9831115966
Reviewed-on: https://code.wireshark.org/review/18350
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Pascal Quantin 2016-10-21 10:10:06 +02:00 committed by Michael Mann
parent 53d3e3c25e
commit 321b756dc4
16 changed files with 464 additions and 59 deletions

View File

@ -1556,6 +1556,7 @@ currently supported are:
ENC_MAC_ROMAN - MAC ROMAN
ENC_CP437 - DOS CP437
ENC_ASCII_7BITS - 7 bits ASCII
ENC_T61 - ITU T.61
Other encodings will be added in the future.

View File

@ -1036,6 +1036,300 @@ get_ebcdic_string(wmem_allocator_t *scope, const guint8 *ptr, gint length)
return (guint8 *) wmem_strbuf_finalize(str);
}
/* T.61 to UTF-8 conversion table from OpenLDAP project
* http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=libraries/libldap/t61.c;hb=HEAD
*/
static const gunichar2 t61_tab[] = {
0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007,
0x008, 0x009, 0x00a, 0x00b, 0x00c, 0x00d, 0x00e, 0x00f,
0x010, 0x011, 0x012, 0x013, 0x014, 0x015, 0x016, 0x017,
0x018, 0x019, 0x01a, 0x01b, 0x01c, 0x01d, 0x01e, 0x01f,
0x020, 0x021, 0x022, 0x000, 0x000, 0x025, 0x026, 0x027,
0x028, 0x029, 0x02a, 0x02b, 0x02c, 0x02d, 0x02e, 0x02f,
0x030, 0x031, 0x032, 0x033, 0x034, 0x035, 0x036, 0x037,
0x038, 0x039, 0x03a, 0x03b, 0x03c, 0x03d, 0x03e, 0x03f,
0x040, 0x041, 0x042, 0x043, 0x044, 0x045, 0x046, 0x047,
0x048, 0x049, 0x04a, 0x04b, 0x04c, 0x04d, 0x04e, 0x04f,
0x050, 0x051, 0x052, 0x053, 0x054, 0x055, 0x056, 0x057,
0x058, 0x059, 0x05a, 0x05b, 0x000, 0x05d, 0x000, 0x05f,
0x000, 0x061, 0x062, 0x063, 0x064, 0x065, 0x066, 0x067,
0x068, 0x069, 0x06a, 0x06b, 0x06c, 0x06d, 0x06e, 0x06f,
0x070, 0x071, 0x072, 0x073, 0x074, 0x075, 0x076, 0x077,
0x078, 0x079, 0x07a, 0x000, 0x07c, 0x000, 0x000, 0x07f,
0x080, 0x081, 0x082, 0x083, 0x084, 0x085, 0x086, 0x087,
0x088, 0x089, 0x08a, 0x08b, 0x08c, 0x08d, 0x08e, 0x08f,
0x090, 0x091, 0x092, 0x093, 0x094, 0x095, 0x096, 0x097,
0x098, 0x099, 0x09a, 0x09b, 0x09c, 0x09d, 0x09e, 0x09f,
0x0a0, 0x0a1, 0x0a2, 0x0a3, 0x024, 0x0a5, 0x023, 0x0a7,
0x0a4, 0x000, 0x000, 0x0ab, 0x000, 0x000, 0x000, 0x000,
0x0b0, 0x0b1, 0x0b2, 0x0b3, 0x0d7, 0x0b5, 0x0b6, 0x0b7,
0x0f7, 0x000, 0x000, 0x0bb, 0x0bc, 0x0bd, 0x0be, 0x0bf,
0x000, 0x300, 0x301, 0x302, 0x303, 0x304, 0x306, 0x307,
0x308, 0x000, 0x30a, 0x327, 0x332, 0x30b, 0x328, 0x30c,
0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000,
0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000,
0x2126, 0xc6, 0x0d0, 0x0aa, 0x126, 0x000, 0x132, 0x13f,
0x141, 0x0d8, 0x152, 0x0ba, 0x0de, 0x166, 0x14a, 0x149,
0x138, 0x0e6, 0x111, 0x0f0, 0x127, 0x131, 0x133, 0x140,
0x142, 0x0f8, 0x153, 0x0df, 0x0fe, 0x167, 0x14b, 0x000
};
typedef gunichar2 wvec16[16];
typedef gunichar2 wvec32[32];
/* Substitutions when 0xc1-0xcf appears by itself or with space 0x20 */
static const wvec16 accents = {
0x000, 0x060, 0x0b4, 0x05e, 0x07e, 0x0af, 0x2d8, 0x2d9,
0x0a8, 0x000, 0x2da, 0x0b8, 0x000, 0x2dd, 0x2db, 0x2c7};
/* In the following tables, base characters commented in (parentheses)
* are not defined by T.61 but are mapped anyway since their Unicode
* composite exists.
*/
/* Grave accented chars AEIOU (NWY) */
static const wvec32 c1_vec1 = {
/* Upper case */
0, 0xc0, 0, 0, 0, 0xc8, 0, 0, 0, 0xcc, 0, 0, 0, 0, 0x1f8, 0xd2,
0, 0, 0, 0, 0, 0xd9, 0, 0x1e80, 0, 0x1ef2, 0, 0, 0, 0, 0, 0};
static const wvec32 c1_vec2 = {
/* Lower case */
0, 0xe0, 0, 0, 0, 0xe8, 0, 0, 0, 0xec, 0, 0, 0, 0, 0x1f9, 0xf2,
0, 0, 0, 0, 0, 0xf9, 0, 0x1e81, 0, 0x1ef3, 0, 0, 0, 0, 0, 0};
static const wvec32 *c1_grave[] = {
NULL, NULL, &c1_vec1, &c1_vec2, NULL, NULL, NULL, NULL
};
/* Acute accented chars AEIOUYCLNRSZ (GKMPW) */
static const wvec32 c2_vec1 = {
/* Upper case */
0, 0xc1, 0, 0x106, 0, 0xc9, 0, 0x1f4,
0, 0xcd, 0, 0x1e30, 0x139, 0x1e3e, 0x143, 0xd3,
0x1e54, 0, 0x154, 0x15a, 0, 0xda, 0, 0x1e82,
0, 0xdd, 0x179, 0, 0, 0, 0, 0};
static const wvec32 c2_vec2 = {
/* Lower case */
0, 0xe1, 0, 0x107, 0, 0xe9, 0, 0x1f5,
0, 0xed, 0, 0x1e31, 0x13a, 0x1e3f, 0x144, 0xf3,
0x1e55, 0, 0x155, 0x15b, 0, 0xfa, 0, 0x1e83,
0, 0xfd, 0x17a, 0, 0, 0, 0, 0};
static const wvec32 c2_vec3 = {
/* (AE and ae) */
0, 0x1fc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0x1fd, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const wvec32 *c2_acute[] = {
NULL, NULL, &c2_vec1, &c2_vec2, NULL, NULL, NULL, &c2_vec3
};
/* Circumflex AEIOUYCGHJSW (Z) */
static const wvec32 c3_vec1 = {
/* Upper case */
0, 0xc2, 0, 0x108, 0, 0xca, 0, 0x11c,
0x124, 0xce, 0x134, 0, 0, 0, 0, 0xd4,
0, 0, 0, 0x15c, 0, 0xdb, 0, 0x174,
0, 0x176, 0x1e90, 0, 0, 0, 0, 0};
static const wvec32 c3_vec2 = {
/* Lower case */
0, 0xe2, 0, 0x109, 0, 0xea, 0, 0x11d,
0x125, 0xee, 0x135, 0, 0, 0, 0, 0xf4,
0, 0, 0, 0x15d, 0, 0xfb, 0, 0x175,
0, 0x177, 0x1e91, 0, 0, 0, 0, 0};
static const wvec32 *c3_circumflex[] = {
NULL, NULL, &c3_vec1, &c3_vec2, NULL, NULL, NULL, NULL
};
/* Tilde AIOUN (EVY) */
static const wvec32 c4_vec1 = {
/* Upper case */
0, 0xc3, 0, 0, 0, 0x1ebc, 0, 0, 0, 0x128, 0, 0, 0, 0, 0xd1, 0xd5,
0, 0, 0, 0, 0, 0x168, 0x1e7c, 0, 0, 0x1ef8, 0, 0, 0, 0, 0, 0};
static const wvec32 c4_vec2 = {
/* Lower case */
0, 0xe3, 0, 0, 0, 0x1ebd, 0, 0, 0, 0x129, 0, 0, 0, 0, 0xf1, 0xf5,
0, 0, 0, 0, 0, 0x169, 0x1e7d, 0, 0, 0x1ef9, 0, 0, 0, 0, 0, 0};
static const wvec32 *c4_tilde[] = {
NULL, NULL, &c4_vec1, &c4_vec2, NULL, NULL, NULL, NULL
};
/* Macron AEIOU (YG) */
static const wvec32 c5_vec1 = {
/* Upper case */
0, 0x100, 0, 0, 0, 0x112, 0, 0x1e20, 0, 0x12a, 0, 0, 0, 0, 0, 0x14c,
0, 0, 0, 0, 0, 0x16a, 0, 0, 0, 0x232, 0, 0, 0, 0, 0, 0};
static const wvec32 c5_vec2 = {
/* Lower case */
0, 0x101, 0, 0, 0, 0x113, 0, 0x1e21, 0, 0x12b, 0, 0, 0, 0, 0, 0x14d,
0, 0, 0, 0, 0, 0x16b, 0, 0, 0, 0x233, 0, 0, 0, 0, 0, 0};
static const wvec32 c5_vec3 = {
/* (AE and ae) */
0, 0x1e2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0x1e3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const wvec32 *c5_macron[] = {
NULL, NULL, &c5_vec1, &c5_vec2, NULL, NULL, NULL, &c5_vec3
};
/* Breve AUG (EIO) */
static const wvec32 c6_vec1 = {
/* Upper case */
0, 0x102, 0, 0, 0, 0x114, 0, 0x11e, 0, 0x12c, 0, 0, 0, 0, 0, 0x14e,
0, 0, 0, 0, 0, 0x16c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const wvec32 c6_vec2 = {
/* Lower case */
0, 0x103, 0, 0, 0, 0x115, 0, 0x11f, 0, 0x12d, 0, 0, 0, 0, 0, 0x14f,
0, 0, 0, 0, 0, 0x16d, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const wvec32 *c6_breve[] = {
NULL, NULL, &c6_vec1, &c6_vec2, NULL, NULL, NULL, NULL
};
/* Dot Above CEGIZ (AOBDFHMNPRSTWXY) */
static const wvec32 c7_vec1 = {
/* Upper case */
0, 0x226, 0x1e02, 0x10a, 0x1e0a, 0x116, 0x1e1e, 0x120,
0x1e22, 0x130, 0, 0, 0, 0x1e40, 0x1e44, 0x22e,
0x1e56, 0, 0x1e58, 0x1e60, 0x1e6a, 0, 0, 0x1e86,
0x1e8a, 0x1e8e, 0x17b, 0, 0, 0, 0, 0};
static const wvec32 c7_vec2 = {
/* Lower case */
0, 0x227, 0x1e03, 0x10b, 0x1e0b, 0x117, 0x1e1f, 0x121,
0x1e23, 0, 0, 0, 0, 0x1e41, 0x1e45, 0x22f,
0x1e57, 0, 0x1e59, 0x1e61, 0x1e6b, 0, 0, 0x1e87,
0x1e8b, 0x1e8f, 0x17c, 0, 0, 0, 0, 0};
static const wvec32 *c7_dotabove[] = {
NULL, NULL, &c7_vec1, &c7_vec2, NULL, NULL, NULL, NULL
};
/* Diaeresis AEIOUY (HWXt) */
static const wvec32 c8_vec1 = {
/* Upper case */
0, 0xc4, 0, 0, 0, 0xcb, 0, 0, 0x1e26, 0xcf, 0, 0, 0, 0, 0, 0xd6,
0, 0, 0, 0, 0, 0xdc, 0, 0x1e84, 0x1e8c, 0x178, 0, 0, 0, 0, 0, 0};
static const wvec32 c8_vec2 = {
/* Lower case */
0, 0xe4, 0, 0, 0, 0xeb, 0, 0, 0x1e27, 0xef, 0, 0, 0, 0, 0, 0xf6,
0, 0, 0, 0, 0x1e97, 0xfc, 0, 0x1e85, 0x1e8d, 0xff, 0, 0, 0, 0, 0, 0};
static const wvec32 *c8_diaeresis[] = {
NULL, NULL, &c8_vec1, &c8_vec2, NULL, NULL, NULL, NULL
};
/* Ring Above AU (wy) */
static const wvec32 ca_vec1 = {
/* Upper case */
0, 0xc5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0x16e, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const wvec32 ca_vec2 = {
/* Lower case */
0, 0xe5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0x16f, 0, 0x1e98, 0, 0x1e99, 0, 0, 0, 0, 0, 0};
static const wvec32 *ca_ringabove[] = {
NULL, NULL, &ca_vec1, &ca_vec2, NULL, NULL, NULL, NULL
};
/* Cedilla CGKLNRST (EDH) */
static const wvec32 cb_vec1 = {
/* Upper case */
0, 0, 0, 0xc7, 0x1e10, 0x228, 0, 0x122,
0x1e28, 0, 0, 0x136, 0x13b, 0, 0x145, 0,
0, 0, 0x156, 0x15e, 0x162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const wvec32 cb_vec2 = {
/* Lower case */
0, 0, 0, 0xe7, 0x1e11, 0x229, 0, 0x123,
0x1e29, 0, 0, 0x137, 0x13c, 0, 0x146, 0,
0, 0, 0x157, 0x15f, 0x163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const wvec32 *cb_cedilla[] = {
NULL, NULL, &cb_vec1, &cb_vec2, NULL, NULL, NULL, NULL
};
/* Double Acute Accent OU */
static const wvec32 cd_vec1 = {
/* Upper case */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x150,
0, 0, 0, 0, 0, 0x170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const wvec32 cd_vec2 = {
/* Lower case */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x151,
0, 0, 0, 0, 0, 0x171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const wvec32 *cd_doubleacute[] = {
NULL, NULL, &cd_vec1, &cd_vec2, NULL, NULL, NULL, NULL
};
/* Ogonek AEIU (O) */
static const wvec32 ce_vec1 = {
/* Upper case */
0, 0x104, 0, 0, 0, 0x118, 0, 0, 0, 0x12e, 0, 0, 0, 0, 0, 0x1ea,
0, 0, 0, 0, 0, 0x172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const wvec32 ce_vec2 = {
/* Lower case */
0, 0x105, 0, 0, 0, 0x119, 0, 0, 0, 0x12f, 0, 0, 0, 0, 0, 0x1eb,
0, 0, 0, 0, 0, 0x173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const wvec32 *ce_ogonek[] = {
NULL, NULL, &ce_vec1, &ce_vec2, NULL, NULL, NULL, NULL
};
/* Caron CDELNRSTZ (AIOUGKjH) */
static const wvec32 cf_vec1 = {
/* Upper case */
0, 0x1cd, 0, 0x10c, 0x10e, 0x11a, 0, 0x1e6,
0x21e, 0x1cf, 0, 0x1e8, 0x13d, 0, 0x147, 0x1d1,
0, 0, 0x158, 0x160, 0x164, 0x1d3, 0, 0,
0, 0, 0x17d, 0, 0, 0, 0, 0};
static const wvec32 cf_vec2 = {
/* Lower case */
0, 0x1ce, 0, 0x10d, 0x10f, 0x11b, 0, 0x1e7,
0x21f, 0x1d0, 0x1f0, 0x1e9, 0x13e, 0, 0x148, 0x1d2,
0, 0, 0x159, 0x161, 0x165, 0x1d4, 0, 0,
0, 0, 0x17e, 0, 0, 0, 0, 0};
static const wvec32 *cf_caron[] = {
NULL, NULL, &cf_vec1, &cf_vec2, NULL, NULL, NULL, NULL
};
static const wvec32 **cx_tab[] = {
NULL, c1_grave, c2_acute, c3_circumflex, c4_tilde, c5_macron,
c6_breve, c7_dotabove, c8_diaeresis, NULL, ca_ringabove,
cb_cedilla, NULL, cd_doubleacute, ce_ogonek, cf_caron };
guint8 *
get_t61_string(wmem_allocator_t *scope, const guint8 *ptr, gint length)
{
gint i;
guint8 *c;
wmem_strbuf_t *strbuf;
strbuf = wmem_strbuf_sized_new(scope, length+1, 0);
for (i = 0, c = (guint8 *)ptr; i < length; c++, i++) {
if (!t61_tab[*c]) {
wmem_strbuf_append_unichar(strbuf, UNREPL);
} else if ((*c & 0xf0) == 0xc0) {
gint j = *c & 0x0f;
/* If this is the end of the string, or if the base
* character is just a space, treat this as a regular
* spacing character.
*/
if ((!c[1] || c[1] == 0x20) && accents[j]) {
wmem_strbuf_append_unichar(strbuf, accents[j]);
} else if (cx_tab[j] && cx_tab[j][c[1]>>5] &&
/* We have a composite mapping for this pair */
(*cx_tab[j][c[1]>>5])[c[1]&0x1f]) {
wmem_strbuf_append_unichar(strbuf, (*cx_tab[j][c[1]>>5])[c[1]&0x1f]);
} else {
/* No mapping, just swap it around so the base
* character comes first.
*/
wmem_strbuf_append_unichar(strbuf, c[1]);
wmem_strbuf_append_unichar(strbuf, t61_tab[*c]);
}
c++; i++;
continue;
} else {
wmem_strbuf_append_unichar(strbuf, t61_tab[*c]);
}
}
return (guint8 *)wmem_strbuf_finalize(strbuf);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*

View File

@ -97,6 +97,9 @@ get_ascii_7bits_string(wmem_allocator_t *scope, const guint8 *ptr,
WS_DLL_PUBLIC guint8 *
get_ebcdic_string(wmem_allocator_t *scope, const guint8 *ptr, gint length);
WS_DLL_PUBLIC guint8 *
get_t61_string(wmem_allocator_t *scope, const guint8 *ptr, gint length);
#if 0
void ASCII_to_EBCDIC(guint8 *buf, guint bytes);
guint8 ASCII_to_EBCDIC1(guint8 c);

View File

@ -1254,5 +1254,51 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token"
#.FN_HDR MTSBindResult
/* TODO: there may be other entry points where this global should be initialized... */
actx->subtree.tree = NULL;
#.TYPE_ATTR
RecipientNumberForAdvice DISPLAY = STR_UNICODE
#.TYPE_ATTR
TeletexCommonName DISPLAY = STR_UNICODE
#.TYPE_ATTR
TeletexOrganizationName DISPLAY = STR_UNICODE
#.TYPE_ATTR
TeletexPersonalName/surname DISPLAY = STR_UNICODE
#.TYPE_ATTR
TeletexPersonalName/given-name DISPLAY = STR_UNICODE
#.TYPE_ATTR
TeletexPersonalName/initials DISPLAY = STR_UNICODE
#.TYPE_ATTR
TeletexPersonalName/generation-qualifier DISPLAY = STR_UNICODE
#.TYPE_ATTR
TeletexOrganizationalUnitName DISPLAY = STR_UNICODE
#.TYPE_ATTR
UnformattedPostalAddress/teletex-string DISPLAY = STR_UNICODE
#.TYPE_ATTR
PDSParameter/teletex-string DISPLAY = STR_UNICODE
#.TYPE_ATTR
TeletexDomainDefinedAttribute/type DISPLAY = STR_UNICODE
#.TYPE_ATTR
TeletexDomainDefinedAttribute/value DISPLAY = STR_UNICODE
#.TYPE_ATTR
TeletexNonBasicParameters/graphic-character-sets DISPLAY = STR_UNICODE
#.TYPE_ATTR
TeletexNonBasicParameters/control-character-sets DISPLAY = STR_UNICODE
#.TYPE_ATTR
TeletexNonBasicParameters/miscellaneous-terminal-capabilities DISPLAY = STR_UNICODE
#.END

View File

@ -250,7 +250,20 @@ IpnSecurityResponse B "2.6.1.18.1" "id-sec-security-common-fields"
%(DEFAULT_BODY)s
if(subject)
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%%s)", tvb_format_text(subject, 0, tvb_reported_length(subject)));
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%%s)", tvb_get_string_enc(wmem_packet_scope(), subject, 0,
tvb_reported_length(subject), ENC_T61));
#.TYPE_ATTR
SubjectField DISPLAY = STR_UNICODE
#.TYPE_ATTR
TeletexData/_item DISPLAY = STR_UNICODE
#.TYPE_ATTR
FreeFormName DISPLAY = STR_UNICODE
#.TYPE_ATTR
VideotexData DISPLAY = STR_UNICODE
#.FN_PARS CharacterSetRegistration
VAL_PTR=&crs

View File

@ -85,6 +85,11 @@ ASIdentifiers B "1.3.6.1.5.5.7.1.8" "id-pe-autonomousSysIds"
if(tvb_reported_length(parameter_tvb)>2)
proto_tree_add_item(subtree, hf_pkix1explicit_addressFamily_safi, parameter_tvb, 0, 2, ENC_BIG_ENDIAN);
#.TYPE_ATTR
TeletexDomainDefinedAttribute/type DISPLAY = STR_UNICODE
#.TYPE_ATTR
TeletexDomainDefinedAttribute/value DISPLAY = STR_UNICODE
#.END

View File

@ -116,7 +116,11 @@ RTSE-apdus
tvbuff_t *string = NULL;
%(DEFAULT_BODY)s
if(open_request && string)
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_reported_length(string)));
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_get_string_enc(wmem_packet_scope(), string, 0,
tvb_reported_length(string), ENC_T61));
#.TYPE_ATTR
CallingSSuserReference/t61String DISPLAY = STR_UNICODE
#.FN_PARS CommonReference
VAL_PTR=&string
@ -176,4 +180,7 @@ RTSE-apdus
if(reason != -1)
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%%s)", val_to_str(reason, rtse_AbortReason_vals, "reason(%%d)"));
#.TYPE_ATTR
AdditionalReferenceInformation DISPLAY = STR_UNICODE
#.END

View File

@ -393,6 +393,18 @@ XDayOf/fifth fifth_dayof
actx->created_item = proto_tree_add_guid(tree, hf_index, tvb, offset, len, &uuid);
#.END
#.TYPE_ATTR
DirectoryString/teletexString DISPLAY = STR_UNICODE
#.TYPE_ATTR
SyntaxTeletexString DISPLAY = STR_UNICODE
#.TYPE_ATTR
SyntaxT61String DISPLAY = STR_UNICODE
#.TYPE_ATTR
SyntaxVideotexString DISPLAY = STR_UNICODE
#.END

View File

@ -1706,21 +1706,11 @@ proto_tree_add_debug_text(tree, "OCTET STRING dissect_ber_octet_string(%s) enter
break;
case BER_UNI_TAG_TeletexString:
/*
* XXX - the G0 part of this starts out as T.61, not ASCII.
*
* XXX - treat as ASCII for now.
*/
encoding = ENC_ASCII|ENC_NA;
encoding = ENC_T61|ENC_NA;
break;
case BER_UNI_TAG_VideotexString:
/*
* XXX - the G0 part of this starts out as T.61, not ASCII.
*
* XXX - treat as ASCII for now.
*/
encoding = ENC_ASCII|ENC_NA;
encoding = ENC_T61|ENC_NA;
break;
case BER_UNI_TAG_GraphicString:

View File

@ -4018,6 +4018,7 @@ dissect_p1_MTSBindResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
/* TODO: there may be other entry points where this global should be initialized... */
actx->subtree.tree = NULL;
offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset,
MTSBindResult_set, hf_index, ett_p1_MTSBindResult);
@ -8922,7 +8923,7 @@ void proto_register_p1(void) {
NULL, HFILL }},
{ &hf_p1_RecipientNumberForAdvice_PDU,
{ "RecipientNumberForAdvice", "p1.RecipientNumberForAdvice",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_p1_PhysicalRenditionAttributes_PDU,
{ "PhysicalRenditionAttributes", "p1.PhysicalRenditionAttributes",
@ -9058,7 +9059,7 @@ void proto_register_p1(void) {
NULL, HFILL }},
{ &hf_p1_TeletexCommonName_PDU,
{ "TeletexCommonName", "p1.TeletexCommonName",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_p1_UniversalCommonName_PDU,
{ "UniversalCommonName", "p1.UniversalCommonName_element",
@ -9066,7 +9067,7 @@ void proto_register_p1(void) {
NULL, HFILL }},
{ &hf_p1_TeletexOrganizationName_PDU,
{ "TeletexOrganizationName", "p1.TeletexOrganizationName",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_p1_UniversalOrganizationName_PDU,
{ "UniversalOrganizationName", "p1.UniversalOrganizationName_element",
@ -10206,19 +10207,19 @@ void proto_register_p1(void) {
NULL, HFILL }},
{ &hf_p1_teletex_surname,
{ "surname", "p1.surname",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"T_teletex_surname", HFILL }},
{ &hf_p1_teletex_given_name,
{ "given-name", "p1.given_name",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"T_teletex_given_name", HFILL }},
{ &hf_p1_teletex_initials,
{ "initials", "p1.initials",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"T_teletex_initials", HFILL }},
{ &hf_p1_teletex_generation_qualifier,
{ "generation-qualifier", "p1.generation_qualifier",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"T_teletex_generation_qualifier", HFILL }},
{ &hf_p1_universal_surname,
{ "surname", "p1.surname_element",
@ -10238,7 +10239,7 @@ void proto_register_p1(void) {
"UniversalOrBMPString", HFILL }},
{ &hf_p1_TeletexOrganizationalUnitNames_item,
{ "TeletexOrganizationalUnitName", "p1.TeletexOrganizationalUnitName",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_p1_UniversalOrganizationalUnitNames_item,
{ "UniversalOrganizationalUnitName", "p1.UniversalOrganizationalUnitName_element",
@ -10286,7 +10287,7 @@ void proto_register_p1(void) {
"PrintableString_SIZE_1_ub_pds_parameter_length", HFILL }},
{ &hf_p1_teletex_string,
{ "teletex-string", "p1.teletex_string",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"TeletexString_SIZE_1_ub_unformatted_address_length", HFILL }},
{ &hf_p1_printable_string,
{ "printable-string", "p1.printable_string",
@ -10294,7 +10295,7 @@ void proto_register_p1(void) {
"PrintableString_SIZE_1_ub_pds_parameter_length", HFILL }},
{ &hf_p1_pds_teletex_string,
{ "teletex-string", "p1.teletex_string",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"TeletexString_SIZE_1_ub_pds_parameter_length", HFILL }},
{ &hf_p1_e163_4_address,
{ "e163-4-address", "p1.e163_4_address_element",
@ -10318,11 +10319,11 @@ void proto_register_p1(void) {
NULL, HFILL }},
{ &hf_p1_type,
{ "type", "p1.type",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_p1_teletex_value,
{ "value", "p1.value",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"T_teletex_value", HFILL }},
{ &hf_p1_UniversalDomainDefinedAttributes_item,
{ "UniversalDomainDefinedAttribute", "p1.UniversalDomainDefinedAttribute_element",
@ -10350,11 +10351,11 @@ void proto_register_p1(void) {
"TeletexNonBasicParameters", HFILL }},
{ &hf_p1_graphic_character_sets,
{ "graphic-character-sets", "p1.graphic_character_sets",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"TeletexString", HFILL }},
{ &hf_p1_control_character_sets,
{ "control-character-sets", "p1.control_character_sets",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"TeletexString", HFILL }},
{ &hf_p1_page_formats,
{ "page-formats", "p1.page_formats",
@ -10362,7 +10363,7 @@ void proto_register_p1(void) {
"OCTET_STRING", HFILL }},
{ &hf_p1_miscellaneous_terminal_capabilities,
{ "miscellaneous-terminal-capabilities", "p1.miscellaneous_terminal_capabilities",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"TeletexString", HFILL }},
{ &hf_p1_private_use,
{ "private-use", "p1.private_use",

View File

@ -1233,7 +1233,8 @@ dissect_p22_SubjectField(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
if(subject)
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%s)", tvb_format_text(subject, 0, tvb_reported_length(subject)));
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%s)", tvb_get_string_enc(wmem_packet_scope(), subject, 0,
tvb_reported_length(subject), ENC_T61));
@ -1490,7 +1491,7 @@ dissect_p22_G3FacsimileBodyPart(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
static int
dissect_p22_Interchange_Data_Element(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 266 "./asn1/p22/p22.cnf"
#line 279 "./asn1/p22/p22.cnf"
/* XXX Not implemented yet */
@ -1731,7 +1732,7 @@ dissect_p22_BilaterallyDefinedBodyPart(gboolean implicit_tag _U_, tvbuff_t *tvb
static int
dissect_p22_NationallyDefinedBodyPart(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 269 "./asn1/p22/p22.cnf"
#line 282 "./asn1/p22/p22.cnf"
/* XXX Not implemented yet */
@ -2701,7 +2702,7 @@ dissect_p22_Precedence(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
static int
dissect_p22_CharacterSetRegistration(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 259 "./asn1/p22/p22.cnf"
#line 272 "./asn1/p22/p22.cnf"
guint32 crs;
offset = dissect_ber_constrained_integer(implicit_tag, actx, tree, tvb, offset,
1U, 32767U, hf_index, &crs);
@ -2942,7 +2943,7 @@ dissect_p22_Document_Type_Name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
static int
dissect_p22_T_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 272 "./asn1/p22/p22.cnf"
#line 285 "./asn1/p22/p22.cnf"
/* XXX: Not implemented yet */
@ -3098,7 +3099,7 @@ dissect_p22_EnvironmentParameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i
static int
dissect_p22_T_compression_algorithm_id(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 275 "./asn1/p22/p22.cnf"
#line 288 "./asn1/p22/p22.cnf"
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &actx->external.direct_reference);
@ -3110,7 +3111,7 @@ dissect_p22_T_compression_algorithm_id(gboolean implicit_tag _U_, tvbuff_t *tvb
static int
dissect_p22_T_compression_algorithm_param(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 278 "./asn1/p22/p22.cnf"
#line 291 "./asn1/p22/p22.cnf"
/* XXX: Not implemented yet */
@ -4756,7 +4757,7 @@ void proto_register_p22(void) {
NULL, HFILL }},
{ &hf_p22_SubjectField_PDU,
{ "SubjectField", "p22.SubjectField",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_p22_ExpiryTimeField_PDU,
{ "ExpiryTimeField", "p22.ExpiryTimeField",
@ -4824,7 +4825,7 @@ void proto_register_p22(void) {
NULL, HFILL }},
{ &hf_p22_VideotexData_PDU,
{ "VideotexData", "p22.VideotexData",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_p22_EncryptedParameters_PDU,
{ "EncryptedParameters", "p22.EncryptedParameters_element",
@ -5100,7 +5101,7 @@ void proto_register_p22(void) {
"RelatedIPMsField", HFILL }},
{ &hf_p22_subject,
{ "subject", "p22.subject",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"SubjectField", HFILL }},
{ &hf_p22_expiry_time,
{ "expiry-time", "p22.expiry_time",
@ -5160,7 +5161,7 @@ void proto_register_p22(void) {
"ORName", HFILL }},
{ &hf_p22_free_form_name,
{ "free-form-name", "p22.free_form_name",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"FreeFormName", HFILL }},
{ &hf_p22_telephone_number,
{ "telephone-number", "p22.telephone_number",
@ -5320,7 +5321,7 @@ void proto_register_p22(void) {
"TeletexNonBasicParameters", HFILL }},
{ &hf_p22_TeletexData_item,
{ "TeletexData item", "p22.TeletexData_item",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"TeletexString", HFILL }},
{ &hf_p22_videotex_parameters,
{ "parameters", "p22.parameters_element",
@ -5328,7 +5329,7 @@ void proto_register_p22(void) {
"VideotexParameters", HFILL }},
{ &hf_p22_videotex_data,
{ "data", "p22.data",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"VideotexData", HFILL }},
{ &hf_p22_syntax,
{ "syntax", "p22.syntax",

View File

@ -571,7 +571,6 @@ dissect_pkix1explicit_T_addressFamily(gboolean implicit_tag _U_, tvbuff_t *tvb _
return offset;
}
@ -941,11 +940,11 @@ void proto_register_pkix1explicit(void) {
NULL, HFILL }},
{ &hf_pkix1explicit_type_01,
{ "type", "pkix1explicit.type",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"TeletexString", HFILL }},
{ &hf_pkix1explicit_value_01,
{ "value", "pkix1explicit.value",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
"TeletexString", HFILL }},
{ &hf_pkix1explicit_IPAddrBlocks_item,
{ "IPAddressFamily", "pkix1explicit.IPAddressFamily_element",

View File

@ -317,7 +317,8 @@ dissect_rtse_T_t61String(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
&string);
if(open_request && string)
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_reported_length(string)));
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_get_string_enc(wmem_packet_scope(), string, 0,
tvb_reported_length(string), ENC_T61));
@ -328,7 +329,7 @@ dissect_rtse_T_t61String(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
static int
dissect_rtse_T_octetString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 132 "./asn1/rtse/rtse.cnf"
#line 136 "./asn1/rtse/rtse.cnf"
tvbuff_t *string = NULL;
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
&string);
@ -367,7 +368,7 @@ dissect_rtse_CallingSSuserReference(gboolean implicit_tag _U_, tvbuff_t *tvb _U_
static int
dissect_rtse_CommonReference(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 124 "./asn1/rtse/rtse.cnf"
#line 128 "./asn1/rtse/rtse.cnf"
tvbuff_t *string = NULL;
offset = dissect_ber_UTCTime(implicit_tag, actx, tree, tvb, offset, hf_index);
@ -519,7 +520,7 @@ static const value_string rtse_RefuseReason_vals[] = {
static int
dissect_rtse_RefuseReason(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 156 "./asn1/rtse/rtse.cnf"
#line 160 "./asn1/rtse/rtse.cnf"
int reason = -1;
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
@ -579,7 +580,7 @@ static const ber_sequence_t RTORJapdu_set[] = {
int
dissect_rtse_RTORJapdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 148 "./asn1/rtse/rtse.cnf"
#line 152 "./asn1/rtse/rtse.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "Refuse");
offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset,
@ -595,7 +596,7 @@ dissect_rtse_RTORJapdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
static int
dissect_rtse_RTTPapdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 138 "./asn1/rtse/rtse.cnf"
#line 142 "./asn1/rtse/rtse.cnf"
int priority = -1;
col_append_str(actx->pinfo->cinfo, COL_INFO, "Turn-Please");
@ -655,7 +656,7 @@ static const value_string rtse_AbortReason_vals[] = {
static int
dissect_rtse_AbortReason(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 172 "./asn1/rtse/rtse.cnf"
#line 176 "./asn1/rtse/rtse.cnf"
int reason = -1;
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
@ -703,7 +704,7 @@ static const ber_sequence_t RTABapdu_set[] = {
int
dissect_rtse_RTABapdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 164 "./asn1/rtse/rtse.cnf"
#line 168 "./asn1/rtse/rtse.cnf"
col_append_str(actx->pinfo->cinfo, COL_INFO, "Abort");
offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset,
@ -998,11 +999,11 @@ void proto_register_rtse(void) {
NULL, HFILL }},
{ &hf_rtse_additionalReferenceInformation,
{ "additionalReferenceInformation", "rtse.additionalReferenceInformation",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_rtse_t61String,
{ "t61String", "rtse.t61String",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_rtse_octetString,
{ "octetString", "rtse.octetString",

View File

@ -2040,15 +2040,15 @@ void proto_register_x509sat(void) {
NULL, HFILL }},
{ &hf_x509sat_SyntaxTeletexString_PDU,
{ "TeletexString", "x509sat.TeletexString",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_x509sat_SyntaxT61String_PDU,
{ "T61String", "x509sat.T61String",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_x509sat_SyntaxVideotexString_PDU,
{ "VideotexString", "x509sat.VideotexString",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_x509sat_SyntaxGraphicString_PDU,
{ "GraphicString", "x509sat.GraphicString",
@ -2072,7 +2072,7 @@ void proto_register_x509sat(void) {
NULL, HFILL }},
{ &hf_x509sat_teletexString,
{ "teletexString", "x509sat.teletexString",
FT_STRING, BASE_NONE, NULL, 0,
FT_STRING, STR_UNICODE, NULL, 0,
NULL, HFILL }},
{ &hf_x509sat_printableString,
{ "printableString", "x509sat.printableString",

View File

@ -429,6 +429,7 @@ WS_DLL_PUBLIC WS_NORETURN void proto_report_dissector_bug(const char *message);
#define ENC_MAC_ROMAN 0x00000030
#define ENC_CP437 0x00000032
#define ENC_ASCII_7BITS 0x00000034
#define ENC_T61 0x00000036
/*
* TODO:

View File

@ -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;