diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-11-28 19:16:55 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-11-29 03:17:37 +0000 |
commit | 0cb44e4277f3366234019c2f919ab1aea308822d (patch) | |
tree | 647f59f51200e50587a92482fbfc65fbe14b9974 /epan/wslua | |
parent | a222812787c83fb4f91e677c24ea40576864ac0a (diff) |
Handle FT_CHAR, and report unsupported types as such.
FT_CHAR is straightforward to support.
Split the list of "invalid" types into a list of "unsupported" types and
a short list of "invalid" types, containing FT_PCRE (which isn't a valid
type for a field) and "everything else". Add FT_IEEE_11073_SFLOAT and
FT_IEEE_11073_FLOAT to the "unsupported" list.
Flag the whole unsupported list as just "not handled yet".
Change-Id: I62d2d7eead53377e4e601594a035b4395fdbeead
Reviewed-on: https://code.wireshark.org/review/18979
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/wslua_proto_field.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/epan/wslua/wslua_proto_field.c b/epan/wslua/wslua_proto_field.c index 4e5f2a822e..98e00e6d8b 100644 --- a/epan/wslua/wslua_proto_field.c +++ b/epan/wslua/wslua_proto_field.c @@ -373,6 +373,7 @@ WSLUA_CONSTRUCTOR ProtoField_new(lua_State* L) { } } break; + case FT_CHAR: case FT_UINT8: case FT_UINT16: case FT_UINT24: @@ -384,7 +385,10 @@ WSLUA_CONSTRUCTOR ProtoField_new(lua_State* L) { case FT_INT32: case FT_INT64: if (base == BASE_NONE) { - base = BASE_DEC; /* Default base for integer */ + if (type == FT_CHAR) + base = BASE_OCT; /* default base for characters (BASE_HEX instead?) */ + else + base = BASE_DEC; /* Default base for integer */ } else if (base < BASE_DEC || base > BASE_HEX_DEC) { WSLUA_OPTARG_ERROR(ProtoField_new,BASE,"Base must be either base.DEC, base.HEX, base.OCT," " base.DEC_HEX, base.DEC_HEX or base.HEX_DEC"); @@ -458,18 +462,22 @@ WSLUA_CONSTRUCTOR ProtoField_new(lua_State* L) { return 0; } break; - /* TODO: new in 1.99 and not handled yet */ + /* TODO: not handled yet */ case FT_UINT40: case FT_UINT48: case FT_UINT56: case FT_INT40: case FT_INT48: case FT_INT56: - /* older but not supported yet (or maybe ever) */ + case FT_IEEE_11073_SFLOAT: + case FT_IEEE_11073_FLOAT: case FT_UINT_STRING: - case FT_PCRE: case FT_AX25: case FT_STRINGZPAD: + WSLUA_ARG_ERROR(ProtoField_new,TYPE,"Unsupported ProtoField field type"); + break; + /* FT_PCRE isn't a valid field type. */ + case FT_PCRE: default: WSLUA_ARG_ERROR(ProtoField_new,TYPE,"Invalid ProtoField field type"); break; |