diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2007-11-19 21:27:01 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2007-11-19 21:27:01 +0000 |
commit | 849e6283346ef76c5fd405f2fec445484b990e70 (patch) | |
tree | cdd747c833875091e8c335b5d27e83c4b050afb4 /epan/ftypes | |
parent | 53faa469bdb97d7c9b8f7efec6e7c2118a5ebdbe (diff) | |
download | wireshark-849e6283346ef76c5fd405f2fec445484b990e70.tar.gz |
Introduce a new field type called FT_EBCDIC. This field works the same as
FT_STRING, except that it converts the data from the packet from EBCDIC
to ASCII for display in Wireshark.
svn path=/trunk/; revision=23503
Diffstat (limited to 'epan/ftypes')
-rw-r--r-- | epan/ftypes/ftype-string.c | 38 | ||||
-rw-r--r-- | epan/ftypes/ftypes.h | 1 |
2 files changed, 39 insertions, 0 deletions
diff --git a/epan/ftypes/ftype-string.c b/epan/ftypes/ftype-string.c index fed7c2b017..e7fd24ad50 100644 --- a/epan/ftypes/ftype-string.c +++ b/epan/ftypes/ftype-string.c @@ -370,6 +370,43 @@ ftype_register_string(void) len, slice, }; + static ftype_t ebcdic_type = { + FT_EBCDIC, /* ftype */ + "FT_EBCDIC", /* name */ + "EBCDIC character string", /* pretty name */ + 0, /* wire_size */ + string_fvalue_new, /* new_value */ + string_fvalue_free, /* free_value */ + val_from_unparsed, /* val_from_unparsed */ + val_from_string, /* val_from_string */ + string_to_repr, /* val_to_string_repr */ + string_repr_len, /* len_string_repr */ + + string_fvalue_set, /* set_value */ + NULL, /* set_value_uinteger */ + NULL, /* set_value_sinteger */ + NULL, /* set_value_integer64 */ + NULL, /* set_value_floating */ + + value_get, /* get_value */ + NULL, /* get_value_uinteger */ + NULL, /* get_value_sinteger */ + NULL, /* get_value_integer64 */ + NULL, /* get_value_floating */ + + cmp_eq, + cmp_ne, + cmp_gt, + cmp_ge, + cmp_lt, + cmp_le, + NULL, /* cmp_bitwise_and */ + cmp_contains, /* cmp_contains */ + CMP_MATCHES, + + len, + slice, + }; static ftype_t uint_string_type = { FT_UINT_STRING, /* ftype */ "FT_UINT_STRING", /* name */ @@ -410,5 +447,6 @@ ftype_register_string(void) ftype_register(FT_STRING, &string_type); ftype_register(FT_STRINGZ, &stringz_type); + ftype_register(FT_EBCDIC, &ebcdic_type); ftype_register(FT_UINT_STRING, &uint_string_type); } diff --git a/epan/ftypes/ftypes.h b/epan/ftypes/ftypes.h index 78c322555d..2b7d6f0388 100644 --- a/epan/ftypes/ftypes.h +++ b/epan/ftypes/ftypes.h @@ -50,6 +50,7 @@ enum ftenum { FT_RELATIVE_TIME, FT_STRING, FT_STRINGZ, /* for use with proto_tree_add_item() */ + FT_EBCDIC, /* for use with proto_tree_add_item() */ FT_UINT_STRING, /* for use with proto_tree_add_item() */ /*FT_UCS2_LE, */ /* Unicode, 2 byte, Little Endian */ FT_ETHER, |