diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-04-12 15:26:34 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-04-12 22:27:22 +0000 |
commit | cb16dff992c3844936bf5829f19e5a5247458503 (patch) | |
tree | 901b7be3379f5b94f150de71d1c0f3e2fa2d12e4 /epan/dfilter/semcheck.c | |
parent | ef8a0a2ce172810d48371eb65c73b1bd4a6303ca (diff) |
Get rid of more tvb_get_nstringz* calls.
Add an FT_STRINGZPAD type, for null-padded strings (typically
fixed-length fields, where the string can be up to the length of the
field, and is null-padded if it's shorter than that), and use it. Use
IS_FT_STRING() in more cases, so that less code needs to know what types
are string types.
Add a tvb_get_stringzpad() routine, which gets null-padded strings.
Currently, it does the same thing that tvb_get_string_enc() does, but
that might change if we don't store string values as null-terminated
strings.
Change-Id: I46f56e130de8f419a19b56ded914e24cc7518a66
Reviewed-on: https://code.wireshark.org/review/1082
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dfilter/semcheck.c')
-rw-r--r-- | epan/dfilter/semcheck.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/epan/dfilter/semcheck.c b/epan/dfilter/semcheck.c index 501dce4e3e..c76859dc28 100644 --- a/epan/dfilter/semcheck.c +++ b/epan/dfilter/semcheck.c @@ -116,10 +116,12 @@ compatible_ftypes(ftenum_t a, ftenum_t b) case FT_STRING: case FT_STRINGZ: case FT_UINT_STRING: + case FT_STRINGZPAD: switch (b) { case FT_STRING: case FT_STRINGZ: case FT_UINT_STRING: + case FT_STRINGZPAD: return TRUE; default: return FALSE; @@ -186,6 +188,7 @@ mk_fvalue_from_val_string(header_field_info *hfinfo, char *s) case FT_STRING: case FT_STRINGZ: case FT_UINT_STRING: + case FT_STRINGZPAD: case FT_EUI64: case FT_PCRE: case FT_GUID: @@ -314,6 +317,7 @@ is_bytes_type(enum ftenum type) case FT_STRING: case FT_STRINGZ: case FT_UINT_STRING: + case FT_STRINGZPAD: case FT_BOOLEAN: case FT_FRAMENUM: case FT_UINT8: |