From c4f9d8abda53c86e87cb5152616a53249f0b97df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Wed, 23 Feb 2022 00:47:00 +0000 Subject: [PATCH] dfilter: Rename "unparsed" to "literal" A literal value is a value that cannot be interpreted as a registered protocol. An unparsed value can be a literal or an identifier (protocol/field) according to context and the current disambiguation rules. Strictly literal here is to be understood to mean "numeric literal, including numeric arrays, but not strings or character constants". --- epan/dfilter/grammar.lemon | 5 +- epan/dfilter/semcheck.c | 50 ++++----- epan/dfilter/sttype-string.c | 8 +- epan/dfilter/syntax-tree.c | 4 +- epan/dfilter/syntax-tree.h | 4 +- epan/ftypes/ftype-bytes.c | 60 +++++------ epan/ftypes/ftype-double.c | 6 +- epan/ftypes/ftype-guid.c | 4 +- epan/ftypes/ftype-ieee-11073-float.c | 8 +- epan/ftypes/ftype-integer.c | 130 +++++++++++------------ epan/ftypes/ftype-ipv4.c | 6 +- epan/ftypes/ftype-ipv6.c | 6 +- epan/ftypes/ftype-none.c | 2 +- epan/ftypes/ftype-protocol.c | 6 +- epan/ftypes/ftype-string.c | 16 +-- epan/ftypes/ftype-time.c | 8 +- epan/ftypes/ftypes-int.h | 6 +- epan/ftypes/ftypes.c | 6 +- epan/ftypes/ftypes.h | 2 +- test/suite_dfilter/group_range_method.py | 2 +- 20 files changed, 169 insertions(+), 170 deletions(-) diff --git a/epan/dfilter/grammar.lemon b/epan/dfilter/grammar.lemon index c12e8d711f..e457127f6e 100644 --- a/epan/dfilter/grammar.lemon +++ b/epan/dfilter/grammar.lemon @@ -147,14 +147,13 @@ entity(E) ::= UNPARSED(U). E = stnode_new(STTYPE_FIELD, hfinfo, df_lval_value(U)); } else { - E = stnode_new_unparsed(df_lval_value(U), df_lval_value(U)); + E = stnode_new_literal(df_lval_value(U), df_lval_value(U)); } df_lval_free(U, FALSE); } entity(E) ::= LITERAL(S). { - /* Literals are unparsed that do not get resolved to protocols/fields. */ - E = stnode_new_unparsed(df_lval_value(S), df_lval_value(S)); + E = stnode_new_literal(df_lval_value(S), df_lval_value(S)); df_lval_free(S, FALSE); } entity(E) ::= IDENTIFIER(F). diff --git a/epan/dfilter/semcheck.c b/epan/dfilter/semcheck.c index 11f8e19b07..40c14114c8 100644 --- a/epan/dfilter/semcheck.c +++ b/epan/dfilter/semcheck.c @@ -139,14 +139,14 @@ compatible_ftypes(ftenum_t a, ftenum_t b) /* Gets an fvalue from a string, and sets the error message on failure. */ WS_RETNONNULL static fvalue_t* -dfilter_fvalue_from_unparsed(dfwork_t *dfw, ftenum_t ftype, stnode_t *st, +dfilter_fvalue_from_literal(dfwork_t *dfw, ftenum_t ftype, stnode_t *st, gboolean allow_partial_value, header_field_info *hfinfo_value_string) { fvalue_t *fv; const char *s = stnode_data(st); /* Don't set the error message if it's already set. */ - fv = fvalue_from_unparsed(ftype, s, allow_partial_value, + fv = fvalue_from_literal(ftype, s, allow_partial_value, dfw->error_message == NULL ? &dfw->error_message : NULL); if (fv == NULL && hfinfo_value_string) { /* check value_string */ @@ -435,7 +435,7 @@ check_exists(dfwork_t *dfw, stnode_t *st_arg1) /* This is OK */ break; case STTYPE_STRING: - case STTYPE_UNPARSED: + case STTYPE_LITERAL: case STTYPE_CHARCONST: FAIL(dfw, "%s is neither a field nor a protocol name.", stnode_todisplay(st_arg1)); @@ -603,7 +603,7 @@ check_relation_LHS_FIELD(dfwork_t *dfw, test_op_t st_op, hfinfo2->abbrev, ftype_pretty_name(ftype2)); } } - else if (type2 == STTYPE_STRING || type2 == STTYPE_UNPARSED) { + else if (type2 == STTYPE_STRING || type2 == STTYPE_LITERAL) { /* Skip incompatible fields */ while (hfinfo1->same_name_prev_id != -1 && ((type2 == STTYPE_STRING && ftype1 != FT_STRING && ftype1!= FT_STRINGZ) || @@ -616,7 +616,7 @@ check_relation_LHS_FIELD(dfwork_t *dfw, test_op_t st_op, fvalue = dfilter_fvalue_from_string(dfw, ftype1, st_arg2, hfinfo1); } else { - fvalue = dfilter_fvalue_from_unparsed(dfw, ftype1, st_arg2, allow_partial_value, hfinfo1); + fvalue = dfilter_fvalue_from_literal(dfw, ftype1, st_arg2, allow_partial_value, hfinfo1); } stnode_replace(st_arg2, STTYPE_FVALUE, fvalue); } @@ -691,7 +691,7 @@ check_relation_LHS_STRING(dfwork_t *dfw, test_op_t st_op _U_, fvalue = dfilter_fvalue_from_string(dfw, ftype2, st_arg1, hfinfo2); stnode_replace(st_arg1, STTYPE_FVALUE, fvalue); } - else if (type2 == STTYPE_STRING || type2 == STTYPE_UNPARSED || + else if (type2 == STTYPE_STRING || type2 == STTYPE_LITERAL || type2 == STTYPE_CHARCONST) { /* Well now that's silly... */ FAIL(dfw, "Neither %s nor %s are field or protocol names.", @@ -724,7 +724,7 @@ check_relation_LHS_STRING(dfwork_t *dfw, test_op_t st_op _U_, } static void -check_relation_LHS_UNPARSED(dfwork_t *dfw, test_op_t st_op _U_, +check_relation_LHS_LITERAL(dfwork_t *dfw, test_op_t st_op _U_, FtypeCanFunc can_func, gboolean allow_partial_value, stnode_t *st_node, stnode_t *st_arg1, stnode_t *st_arg2) @@ -749,10 +749,10 @@ check_relation_LHS_UNPARSED(dfwork_t *dfw, test_op_t st_op _U_, stnode_todisplay(st_node)); } - fvalue = dfilter_fvalue_from_unparsed(dfw, ftype2, st_arg1, allow_partial_value, hfinfo2); + fvalue = dfilter_fvalue_from_literal(dfw, ftype2, st_arg1, allow_partial_value, hfinfo2); stnode_replace(st_arg1, STTYPE_FVALUE, fvalue); } - else if (type2 == STTYPE_STRING || type2 == STTYPE_UNPARSED || + else if (type2 == STTYPE_STRING || type2 == STTYPE_LITERAL || type2 == STTYPE_CHARCONST) { /* Well now that's silly... */ FAIL(dfw, "Neither %s nor %s are field or protocol names.", @@ -761,7 +761,7 @@ check_relation_LHS_UNPARSED(dfwork_t *dfw, test_op_t st_op _U_, } else if (type2 == STTYPE_RANGE) { check_drange_sanity(dfw, st_arg2); - fvalue = dfilter_fvalue_from_unparsed(dfw, FT_BYTES, st_arg1, allow_partial_value, NULL); + fvalue = dfilter_fvalue_from_literal(dfw, FT_BYTES, st_arg1, allow_partial_value, NULL); stnode_replace(st_arg1, STTYPE_FVALUE, fvalue); } else if (type2 == STTYPE_FUNCTION) { @@ -775,7 +775,7 @@ check_relation_LHS_UNPARSED(dfwork_t *dfw, test_op_t st_op _U_, funcdef->name, ftype_pretty_name(ftype2), stnode_todisplay(st_node)); } - fvalue = dfilter_fvalue_from_unparsed(dfw, ftype2, st_arg1, allow_partial_value, NULL); + fvalue = dfilter_fvalue_from_literal(dfw, ftype2, st_arg1, allow_partial_value, NULL); stnode_replace(st_arg1, STTYPE_FVALUE, fvalue); } else { @@ -812,7 +812,7 @@ check_relation_LHS_CHARCONST(dfwork_t *dfw, test_op_t st_op _U_, fvalue = dfilter_fvalue_from_charconst(dfw, ftype2, st_arg1); stnode_replace(st_arg1, STTYPE_FVALUE, fvalue); } - else if (type2 == STTYPE_STRING || type2 == STTYPE_UNPARSED || + else if (type2 == STTYPE_STRING || type2 == STTYPE_LITERAL || type2 == STTYPE_CHARCONST) { /* Well now that's silly... */ FAIL(dfw, "Neither %s nor %s are field or protocol names.", @@ -880,8 +880,8 @@ check_relation_LHS_RANGE(dfwork_t *dfw, test_op_t st_op, fvalue = dfilter_fvalue_from_string(dfw, FT_BYTES, st_arg2, NULL); stnode_replace(st_arg2, STTYPE_FVALUE, fvalue); } - else if (type2 == STTYPE_UNPARSED) { - fvalue = dfilter_fvalue_from_unparsed(dfw, FT_BYTES, st_arg2, allow_partial_value, NULL); + else if (type2 == STTYPE_LITERAL) { + fvalue = dfilter_fvalue_from_literal(dfw, FT_BYTES, st_arg2, allow_partial_value, NULL); stnode_replace(st_arg2, STTYPE_FVALUE, fvalue); } else if (type2 == STTYPE_CHARCONST) { @@ -965,8 +965,8 @@ check_relation_LHS_FUNCTION(dfwork_t *dfw, test_op_t st_op, fvalue = dfilter_fvalue_from_string(dfw, ftype1, st_arg2, NULL); stnode_replace(st_arg2, STTYPE_FVALUE, fvalue); } - else if (type2 == STTYPE_UNPARSED) { - fvalue = dfilter_fvalue_from_unparsed(dfw, ftype1, st_arg2, allow_partial_value, NULL); + else if (type2 == STTYPE_LITERAL) { + fvalue = dfilter_fvalue_from_literal(dfw, ftype1, st_arg2, allow_partial_value, NULL); stnode_replace(st_arg2, STTYPE_FVALUE, fvalue); } else if (type2 == STTYPE_CHARCONST) { @@ -1034,8 +1034,8 @@ check_relation(dfwork_t *dfw, test_op_t st_op, check_relation_LHS_RANGE(dfw, st_op, can_func, allow_partial_value, st_node, st_arg1, st_arg2); break; - case STTYPE_UNPARSED: - check_relation_LHS_UNPARSED(dfw, st_op, can_func, + case STTYPE_LITERAL: + check_relation_LHS_LITERAL(dfw, st_op, can_func, allow_partial_value, st_node, st_arg1, st_arg2); break; case STTYPE_CHARCONST: @@ -1059,15 +1059,15 @@ check_relation_contains(dfwork_t *dfw, stnode_t *st_node, LOG_NODE(st_node); /* Protocol can only be on LHS for "contains". - * Check to see if protocol is on RHS, and re-interpret it as UNPARSED + * Check to see if protocol is on RHS, and re-interpret it as LITERAL * instead. The subsequent functions will parse it according to the - * existing rules for unparsed unquoted strings. + * existing rules for literal unquoted strings. * * This catches the case where the user has written "fc" on the RHS, * probably intending a byte value rather than the fibre channel * protocol, or similar for a number of other possibilities * ("dc", "ff", "fefd"), and also catches the case where the user - * has written a generic string on the RHS. (The now unparsed value + * has written a generic string on the RHS. (The now literal value * will be interpreted in a way that matches the LHS; e.g. * FT_PROTOCOL and FT_BYTES fields expect byte arrays whereas * FT_STRING[Z][PAD] fields expect strings.) @@ -1079,11 +1079,11 @@ check_relation_contains(dfwork_t *dfw, stnode_t *st_node, if (stnode_type_id(st_arg2) == STTYPE_FIELD) { header_field_info *hfinfo = stnode_data(st_arg2); if (hfinfo->type == FT_PROTOCOL) { - /* Send it through as unparsed and all the other + /* Send it through as literal and all the other * functions will take care of it as if it didn't * match a protocol string. */ - stnode_replace(st_arg2, STTYPE_UNPARSED, g_strdup(hfinfo->abbrev)); + stnode_replace(st_arg2, STTYPE_LITERAL, g_strdup(hfinfo->abbrev)); } } @@ -1101,7 +1101,7 @@ check_relation_contains(dfwork_t *dfw, stnode_t *st_node, TRUE, st_node, st_arg1, st_arg2); break; case STTYPE_STRING: - case STTYPE_UNPARSED: + case STTYPE_LITERAL: case STTYPE_CHARCONST: FAIL(dfw, "%s is not a valid operand for contains.", stnode_todisplay(st_arg1)); break; @@ -1150,7 +1150,7 @@ check_relation_matches(dfwork_t *dfw, stnode_t *st_node, TRUE, st_node, st_arg1, st_arg2); break; case STTYPE_STRING: - case STTYPE_UNPARSED: + case STTYPE_LITERAL: case STTYPE_CHARCONST: FAIL(dfw, "Matches requires a field-like value on the left side."); break; diff --git a/epan/dfilter/sttype-string.c b/epan/dfilter/sttype-string.c index 9eb6024aff..677e360af2 100644 --- a/epan/dfilter/sttype-string.c +++ b/epan/dfilter/sttype-string.c @@ -40,9 +40,9 @@ sttype_register_string(void) string_tostr }; - static sttype_t unparsed_type = { - STTYPE_UNPARSED, - "UNPARSED", + static sttype_t literal_type = { + STTYPE_LITERAL, + "LITERAL", NULL, string_free, string_dup, @@ -50,7 +50,7 @@ sttype_register_string(void) }; sttype_register(&string_type); - sttype_register(&unparsed_type); + sttype_register(&literal_type); } /* diff --git a/epan/dfilter/syntax-tree.c b/epan/dfilter/syntax-tree.c index 6f9ff4efb4..54e3d518fe 100644 --- a/epan/dfilter/syntax-tree.c +++ b/epan/dfilter/syntax-tree.c @@ -171,10 +171,10 @@ stnode_new_string(const char *str, char *token) } stnode_t * -stnode_new_unparsed(const char *str, char *token) +stnode_new_literal(const char *str, char *token) { char *value = dfilter_literal_normalized(str); - return stnode_new(STTYPE_UNPARSED, value, token); + return stnode_new(STTYPE_LITERAL, value, token); } stnode_t * diff --git a/epan/dfilter/syntax-tree.h b/epan/dfilter/syntax-tree.h index 8264e5c683..bf12bf67fb 100644 --- a/epan/dfilter/syntax-tree.h +++ b/epan/dfilter/syntax-tree.h @@ -22,7 +22,7 @@ typedef enum { STTYPE_UNINITIALIZED, STTYPE_TEST, - STTYPE_UNPARSED, + STTYPE_LITERAL, STTYPE_STRING, STTYPE_CHARCONST, STTYPE_FIELD, @@ -111,7 +111,7 @@ stnode_t * stnode_new_string(const char *str, char *token); stnode_t * -stnode_new_unparsed(const char *str, char *token); +stnode_new_literal(const char *str, char *token); stnode_t * stnode_new_charconst(unsigned long number, char *token); diff --git a/epan/ftypes/ftype-bytes.c b/epan/ftypes/ftype-bytes.c index 91c000cbd5..59841fbd4e 100644 --- a/epan/ftypes/ftype-bytes.c +++ b/epan/ftypes/ftype-bytes.c @@ -169,7 +169,7 @@ bytes_from_string(fvalue_t *fv, const char *s, gchar **err_msg _U_) } GByteArray * -byte_array_from_unparsed(const char *s, gchar **err_msg) +byte_array_from_literal(const char *s, gchar **err_msg) { GByteArray *bytes; gboolean res; @@ -198,11 +198,11 @@ byte_array_from_unparsed(const char *s, gchar **err_msg) } static gboolean -bytes_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +bytes_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { GByteArray *bytes; - bytes = byte_array_from_unparsed(s, err_msg); + bytes = byte_array_from_literal(s, err_msg); if (bytes == NULL) return FALSE; @@ -248,14 +248,14 @@ bytes_from_charconst(fvalue_t *fv, unsigned long num, gchar **err_msg) } static gboolean -ax25_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +ax25_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { /* - * Don't request an error message if bytes_from_unparsed fails; + * Don't request an error message if bytes_from_literal fails; * if it does, we'll report an error specific to this address * type. */ - if (bytes_from_unparsed(fv, s, TRUE, NULL)) { + if (bytes_from_literal(fv, s, TRUE, NULL)) { if (fv->value.bytes->len > FT_AX25_ADDR_LEN) { if (err_msg != NULL) { *err_msg = ws_strdup_printf("\"%s\" contains too many bytes to be a valid AX.25 address.", @@ -311,14 +311,14 @@ ax25_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gc } static gboolean -vines_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +vines_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { /* - * Don't request an error message if bytes_from_unparsed fails; + * Don't request an error message if bytes_from_literal fails; * if it does, we'll report an error specific to this address * type. */ - if (bytes_from_unparsed(fv, s, TRUE, NULL)) { + if (bytes_from_literal(fv, s, TRUE, NULL)) { if (fv->value.bytes->len > FT_VINES_ADDR_LEN) { if (err_msg != NULL) { *err_msg = ws_strdup_printf("\"%s\" contains too many bytes to be a valid Vines address.", @@ -345,14 +345,14 @@ vines_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, g } static gboolean -ether_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +ether_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { /* - * Don't request an error message if bytes_from_unparsed fails; + * Don't request an error message if bytes_from_literal fails; * if it does, we'll report an error specific to this address * type. */ - if (bytes_from_unparsed(fv, s, TRUE, NULL)) { + if (bytes_from_literal(fv, s, TRUE, NULL)) { if (fv->value.bytes->len > FT_ETHER_LEN) { if (err_msg != NULL) { *err_msg = ws_strdup_printf("\"%s\" contains too many bytes to be a valid Ethernet address.", @@ -379,7 +379,7 @@ ether_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, g } static gboolean -oid_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +oid_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { GByteArray *bytes; gboolean res; @@ -392,7 +392,7 @@ oid_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, * we'll log a message. */ /* do not try it as '.' is handled as valid separator for hexbytes :( */ - if (bytes_from_unparsed(fv, s, TRUE, NULL)) { + if (bytes_from_literal(fv, s, TRUE, NULL)) { return TRUE; } #endif @@ -414,7 +414,7 @@ oid_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, } static gboolean -rel_oid_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +rel_oid_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { GByteArray *bytes; gboolean res; @@ -436,14 +436,14 @@ rel_oid_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value } static gboolean -system_id_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +system_id_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { /* - * Don't request an error message if bytes_from_unparsed fails; + * Don't request an error message if bytes_from_literal fails; * if it does, we'll report an error specific to this address * type. */ - if (bytes_from_unparsed(fv, s, TRUE, NULL)) { + if (bytes_from_literal(fv, s, TRUE, NULL)) { if (fv->value.bytes->len > MAX_SYSTEMID_LEN) { if (err_msg != NULL) { *err_msg = ws_strdup_printf("\"%s\" contains too many bytes to be a valid OSI System-ID.", @@ -463,14 +463,14 @@ system_id_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_valu } static gboolean -fcwwn_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +fcwwn_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { /* - * Don't request an error message if bytes_from_unparsed fails; + * Don't request an error message if bytes_from_literal fails; * if it does, we'll report an error specific to this address * type. */ - if (bytes_from_unparsed(fv, s, TRUE, NULL)) { + if (bytes_from_literal(fv, s, TRUE, NULL)) { if (fv->value.bytes->len > FT_FCWWN_LEN) { if (err_msg != NULL) { *err_msg = ws_strdup_printf("\"%s\" contains too many bytes to be a valid FCWWN.", @@ -572,7 +572,7 @@ ftype_register_bytes(void) 0, /* wire_size */ bytes_fvalue_new, /* new_value */ bytes_fvalue_free, /* free_value */ - bytes_from_unparsed, /* val_from_unparsed */ + bytes_from_literal, /* val_from_literal */ bytes_from_string, /* val_from_string */ bytes_from_charconst, /* val_from_charconst */ bytes_to_repr, /* val_to_string_repr */ @@ -596,7 +596,7 @@ ftype_register_bytes(void) 0, /* wire_size */ bytes_fvalue_new, /* new_value */ bytes_fvalue_free, /* free_value */ - bytes_from_unparsed, /* val_from_unparsed */ + bytes_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ bytes_to_repr, /* val_to_string_repr */ @@ -620,7 +620,7 @@ ftype_register_bytes(void) FT_AX25_ADDR_LEN, /* wire_size */ bytes_fvalue_new, /* new_value */ bytes_fvalue_free, /* free_value */ - ax25_from_unparsed, /* val_from_unparsed */ + ax25_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ bytes_to_repr, /* val_to_string_repr */ @@ -644,7 +644,7 @@ ftype_register_bytes(void) FT_VINES_ADDR_LEN, /* wire_size */ bytes_fvalue_new, /* new_value */ bytes_fvalue_free, /* free_value */ - vines_from_unparsed, /* val_from_unparsed */ + vines_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ bytes_to_repr, /* val_to_string_repr */ @@ -668,7 +668,7 @@ ftype_register_bytes(void) FT_ETHER_LEN, /* wire_size */ bytes_fvalue_new, /* new_value */ bytes_fvalue_free, /* free_value */ - ether_from_unparsed, /* val_from_unparsed */ + ether_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ bytes_to_repr, /* val_to_string_repr */ @@ -692,7 +692,7 @@ ftype_register_bytes(void) 0, /* wire_size */ bytes_fvalue_new, /* new_value */ bytes_fvalue_free, /* free_value */ - oid_from_unparsed, /* val_from_unparsed */ + oid_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ oid_to_repr, /* val_to_string_repr */ @@ -716,7 +716,7 @@ ftype_register_bytes(void) 0, /* wire_size */ bytes_fvalue_new, /* new_value */ bytes_fvalue_free, /* free_value */ - rel_oid_from_unparsed, /* val_from_unparsed */ + rel_oid_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ rel_oid_to_repr, /* val_to_string_repr */ @@ -740,7 +740,7 @@ ftype_register_bytes(void) 0, /* wire_size */ bytes_fvalue_new, /* new_value */ bytes_fvalue_free, /* free_value */ - system_id_from_unparsed, /* val_from_unparsed */ + system_id_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ system_id_to_repr, /* val_to_string_repr */ @@ -764,7 +764,7 @@ ftype_register_bytes(void) FT_FCWWN_LEN, /* wire_size */ bytes_fvalue_new, /* new_value */ bytes_fvalue_free, /* free_value */ - fcwwn_from_unparsed, /* val_from_unparsed */ + fcwwn_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ bytes_to_repr, /* val_to_string_repr */ diff --git a/epan/ftypes/ftype-double.c b/epan/ftypes/ftype-double.c index 6e5f8640b0..17f212a090 100644 --- a/epan/ftypes/ftype-double.c +++ b/epan/ftypes/ftype-double.c @@ -35,7 +35,7 @@ value_get_floating(fvalue_t *fv) } static gboolean -val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +val_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { char *endptr = NULL; @@ -106,7 +106,7 @@ ftype_register_double(void) 0, /* wire_size */ double_fvalue_new, /* new_value */ NULL, /* free_value */ - val_from_unparsed, /* val_from_unparsed */ + val_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ float_val_to_repr, /* val_to_string_repr */ @@ -130,7 +130,7 @@ ftype_register_double(void) 0, /* wire_size */ double_fvalue_new, /* new_value */ NULL, /* free_value */ - val_from_unparsed, /* val_from_unparsed */ + val_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ double_val_to_repr, /* val_to_string_repr */ diff --git a/epan/ftypes/ftype-guid.c b/epan/ftypes/ftype-guid.c index 34ad57953f..2fe1ddb67f 100644 --- a/epan/ftypes/ftype-guid.c +++ b/epan/ftypes/ftype-guid.c @@ -67,7 +67,7 @@ get_guid(const char *s, e_guid_t *guid) } static gboolean -guid_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +guid_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { e_guid_t guid; @@ -104,7 +104,7 @@ ftype_register_guid(void) GUID_LEN, /* wire_size */ NULL, /* new_value */ NULL, /* free_value */ - guid_from_unparsed, /* val_from_unparsed */ + guid_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ guid_to_repr, /* val_to_string_repr */ diff --git a/epan/ftypes/ftype-ieee-11073-float.c b/epan/ftypes/ftype-ieee-11073-float.c index 588da10d53..0e6458d4b0 100644 --- a/epan/ftypes/ftype-ieee-11073-float.c +++ b/epan/ftypes/ftype-ieee-11073-float.c @@ -42,7 +42,7 @@ sfloat_ieee_11073_fvalue_new(fvalue_t *fv) } static gboolean -sfloat_ieee_11073_val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg _U_) +sfloat_ieee_11073_val_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg _U_) { const char *i_char = s; char c; @@ -467,7 +467,7 @@ float_ieee_11073_fvalue_new(fvalue_t *fv) } static gboolean -float_ieee_11073_val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg _U_) +float_ieee_11073_val_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg _U_) { const char *i_char = s; char c; @@ -905,7 +905,7 @@ Example: 114 is 0x0072 sfloat_ieee_11073_fvalue_new, /* new_value */ NULL, /* free_value */ - sfloat_ieee_11073_val_from_unparsed, /* val_from_unparsed */ + sfloat_ieee_11073_val_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ sfloat_ieee_11073_val_to_repr, /* val_to_string_repr */ @@ -956,7 +956,7 @@ Example: 36.4 is 0xFF00016C float_ieee_11073_fvalue_new, /* new_value */ NULL, /* free_value */ - float_ieee_11073_val_from_unparsed, /* val_from_unparsed */ + float_ieee_11073_val_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ float_ieee_11073_val_to_repr, /* val_to_string_repr */ diff --git a/epan/ftypes/ftype-integer.c b/epan/ftypes/ftype-integer.c index 64c29923f6..a977bc2ea4 100644 --- a/epan/ftypes/ftype-integer.c +++ b/epan/ftypes/ftype-integer.c @@ -65,7 +65,7 @@ binary_strtoul(const char *s, char **endptr) } static gboolean -uint_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg, +uint_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg, guint32 max) { unsigned long value; @@ -121,27 +121,27 @@ uint_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_ } static gboolean -uint32_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +uint32_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return uint_from_unparsed (fv, s, allow_partial_value, err_msg, G_MAXUINT32); + return uint_from_literal (fv, s, allow_partial_value, err_msg, G_MAXUINT32); } static gboolean -uint24_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +uint24_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return uint_from_unparsed (fv, s, allow_partial_value, err_msg, 0xFFFFFF); + return uint_from_literal (fv, s, allow_partial_value, err_msg, 0xFFFFFF); } static gboolean -uint16_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +uint16_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return uint_from_unparsed (fv, s, allow_partial_value, err_msg, G_MAXUINT16); + return uint_from_literal (fv, s, allow_partial_value, err_msg, G_MAXUINT16); } static gboolean -uint8_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +uint8_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return uint_from_unparsed (fv, s, allow_partial_value, err_msg, G_MAXUINT8); + return uint_from_literal (fv, s, allow_partial_value, err_msg, G_MAXUINT8); } static gboolean @@ -174,7 +174,7 @@ binary_strtol(const char *s, char **endptr) } static gboolean -sint_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg, +sint_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg, gint32 max, gint32 min) { long value; @@ -239,27 +239,27 @@ sint_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_ } static gboolean -sint32_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +sint32_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return sint_from_unparsed (fv, s, allow_partial_value, err_msg, G_MAXINT32, G_MININT32); + return sint_from_literal (fv, s, allow_partial_value, err_msg, G_MAXINT32, G_MININT32); } static gboolean -sint24_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +sint24_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return sint_from_unparsed (fv, s, allow_partial_value, err_msg, 0x7FFFFF, -0x800000); + return sint_from_literal (fv, s, allow_partial_value, err_msg, 0x7FFFFF, -0x800000); } static gboolean -sint16_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +sint16_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return sint_from_unparsed (fv, s, allow_partial_value, err_msg, G_MAXINT16, G_MININT16); + return sint_from_literal (fv, s, allow_partial_value, err_msg, G_MAXINT16, G_MININT16); } static gboolean -sint8_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +sint8_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return sint_from_unparsed (fv, s, allow_partial_value, err_msg, G_MAXINT8, G_MININT8); + return sint_from_literal (fv, s, allow_partial_value, err_msg, G_MAXINT8, G_MININT8); } static gboolean @@ -402,14 +402,14 @@ char_to_repr(wmem_allocator_t *scope, const fvalue_t *fv, ftrepr_t rtype _U_, in } static gboolean -ipxnet_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +ipxnet_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { /* - * Don't request an error message if bytes_from_unparsed fails; + * Don't request an error message if bytes_from_literal fails; * if it does, we'll report an error specific to this address * type. */ - if (uint32_from_unparsed(fv, s, TRUE, NULL)) { + if (uint32_from_literal(fv, s, TRUE, NULL)) { return TRUE; } @@ -511,7 +511,7 @@ binary_strtoull(const char *s, char **endptr) } static gboolean -_uint64_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg, +_uint64_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg, guint64 max) { guint64 value; @@ -563,27 +563,27 @@ _uint64_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value } static gboolean -uint64_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +uint64_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return _uint64_from_unparsed (fv, s, allow_partial_value, err_msg, G_MAXUINT64); + return _uint64_from_literal (fv, s, allow_partial_value, err_msg, G_MAXUINT64); } static gboolean -uint56_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +uint56_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return _uint64_from_unparsed (fv, s, allow_partial_value, err_msg, G_GUINT64_CONSTANT(0xFFFFFFFFFFFFFF)); + return _uint64_from_literal (fv, s, allow_partial_value, err_msg, G_GUINT64_CONSTANT(0xFFFFFFFFFFFFFF)); } static gboolean -uint48_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +uint48_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return _uint64_from_unparsed (fv, s, allow_partial_value, err_msg, G_GUINT64_CONSTANT(0xFFFFFFFFFFFF)); + return _uint64_from_literal (fv, s, allow_partial_value, err_msg, G_GUINT64_CONSTANT(0xFFFFFFFFFFFF)); } static gboolean -uint40_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +uint40_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return _uint64_from_unparsed (fv, s, allow_partial_value, err_msg, G_GUINT64_CONSTANT(0xFFFFFFFFFF)); + return _uint64_from_literal (fv, s, allow_partial_value, err_msg, G_GUINT64_CONSTANT(0xFFFFFFFFFF)); } static gboolean @@ -616,7 +616,7 @@ binary_strtoll(const char *s, char **endptr) } static gboolean -_sint64_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg, +_sint64_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg, gint64 max, gint64 min) { gint64 value; @@ -675,27 +675,27 @@ _sint64_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value } static gboolean -sint64_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +sint64_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return _sint64_from_unparsed (fv, s, allow_partial_value, err_msg, G_MAXINT64, G_MININT64); + return _sint64_from_literal (fv, s, allow_partial_value, err_msg, G_MAXINT64, G_MININT64); } static gboolean -sint56_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +sint56_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return _sint64_from_unparsed (fv, s, allow_partial_value, err_msg, G_GINT64_CONSTANT(0x7FFFFFFFFFFFFF), G_GINT64_CONSTANT(-0x80000000000000)); + return _sint64_from_literal (fv, s, allow_partial_value, err_msg, G_GINT64_CONSTANT(0x7FFFFFFFFFFFFF), G_GINT64_CONSTANT(-0x80000000000000)); } static gboolean -sint48_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +sint48_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return _sint64_from_unparsed (fv, s, allow_partial_value, err_msg, G_GINT64_CONSTANT(0x7FFFFFFFFFFF), G_GINT64_CONSTANT(-0x800000000000)); + return _sint64_from_literal (fv, s, allow_partial_value, err_msg, G_GINT64_CONSTANT(0x7FFFFFFFFFFF), G_GINT64_CONSTANT(-0x800000000000)); } static gboolean -sint40_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +sint40_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { - return _sint64_from_unparsed (fv, s, allow_partial_value, err_msg, G_GINT64_CONSTANT(0x7FFFFFFFFF), G_GINT64_CONSTANT(-0x8000000000)); + return _sint64_from_literal (fv, s, allow_partial_value, err_msg, G_GINT64_CONSTANT(0x7FFFFFFFFF), G_GINT64_CONSTANT(-0x8000000000)); } static gboolean @@ -755,7 +755,7 @@ cmp_bitwise_and64(const fvalue_t *a, const fvalue_t *b) /* BOOLEAN-specific */ static gboolean -boolean_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) +boolean_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value, gchar **err_msg) { if (g_ascii_strcasecmp(s, "true") == 0) { fv->value.uinteger64 = 1; @@ -766,7 +766,7 @@ boolean_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, return TRUE; } - return uint64_from_unparsed(fv, s, allow_partial_value, err_msg); + return uint64_from_literal(fv, s, allow_partial_value, err_msg); } static char * @@ -801,7 +801,7 @@ boolean_cmp_order(const fvalue_t *a, const fvalue_t *b) /* EUI64-specific */ static gboolean -eui64_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +eui64_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { GByteArray *bytes; gboolean res; @@ -811,11 +811,11 @@ eui64_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U } eui64; /* - * Don't request an error message if uint64_from_unparsed fails; + * Don't request an error message if uint64_from_literal fails; * if it does, we'll try parsing it as a sequence of bytes, and * report an error if *that* fails. */ - if (uint64_from_unparsed(fv, s, TRUE, NULL)) { + if (uint64_from_literal(fv, s, TRUE, NULL)) { return TRUE; } @@ -860,7 +860,7 @@ ftype_register_integers(void) 1, /* wire_size */ int_fvalue_new, /* new_value */ NULL, /* free_value */ - uint8_from_unparsed, /* val_from_unparsed */ + uint8_from_literal, /* val_from_literal */ NULL, /* val_from_string */ uint_from_charconst, /* val_from_charconst */ char_to_repr, /* val_to_string_repr */ @@ -883,7 +883,7 @@ ftype_register_integers(void) 1, /* wire_size */ int_fvalue_new, /* new_value */ NULL, /* free_value */ - uint8_from_unparsed, /* val_from_unparsed */ + uint8_from_literal, /* val_from_literal */ NULL, /* val_from_string */ uint_from_charconst, /* val_from_charconst */ uinteger_to_repr, /* val_to_string_repr */ @@ -906,7 +906,7 @@ ftype_register_integers(void) 2, /* wire_size */ int_fvalue_new, /* new_value */ NULL, /* free_value */ - uint16_from_unparsed, /* val_from_unparsed */ + uint16_from_literal, /* val_from_literal */ NULL, /* val_from_string */ uint_from_charconst, /* val_from_charconst */ uinteger_to_repr, /* val_to_string_repr */ @@ -929,7 +929,7 @@ ftype_register_integers(void) 3, /* wire_size */ int_fvalue_new, /* new_value */ NULL, /* free_value */ - uint24_from_unparsed, /* val_from_unparsed */ + uint24_from_literal, /* val_from_literal */ NULL, /* val_from_string */ uint_from_charconst, /* val_from_charconst */ uinteger_to_repr, /* val_to_string_repr */ @@ -952,7 +952,7 @@ ftype_register_integers(void) 4, /* wire_size */ int_fvalue_new, /* new_value */ NULL, /* free_value */ - uint32_from_unparsed, /* val_from_unparsed */ + uint32_from_literal, /* val_from_literal */ NULL, /* val_from_string */ uint_from_charconst, /* val_from_charconst */ uinteger_to_repr, /* val_to_string_repr */ @@ -975,7 +975,7 @@ ftype_register_integers(void) 5, /* wire_size */ int64_fvalue_new, /* new_value */ NULL, /* free_value */ - uint40_from_unparsed, /* val_from_unparsed */ + uint40_from_literal, /* val_from_literal */ NULL, /* val_from_string */ uint64_from_charconst, /* val_from_charconst */ uinteger64_to_repr, /* val_to_string_repr */ @@ -998,7 +998,7 @@ ftype_register_integers(void) 6, /* wire_size */ int64_fvalue_new, /* new_value */ NULL, /* free_value */ - uint48_from_unparsed, /* val_from_unparsed */ + uint48_from_literal, /* val_from_literal */ NULL, /* val_from_string */ uint64_from_charconst, /* val_from_charconst */ uinteger64_to_repr, /* val_to_string_repr */ @@ -1021,7 +1021,7 @@ ftype_register_integers(void) 7, /* wire_size */ int64_fvalue_new, /* new_value */ NULL, /* free_value */ - uint56_from_unparsed, /* val_from_unparsed */ + uint56_from_literal, /* val_from_literal */ NULL, /* val_from_string */ uint64_from_charconst, /* val_from_charconst */ uinteger64_to_repr, /* val_to_string_repr */ @@ -1044,7 +1044,7 @@ ftype_register_integers(void) 8, /* wire_size */ int64_fvalue_new, /* new_value */ NULL, /* free_value */ - uint64_from_unparsed, /* val_from_unparsed */ + uint64_from_literal, /* val_from_literal */ NULL, /* val_from_string */ uint64_from_charconst, /* val_from_charconst */ uinteger64_to_repr, /* val_to_string_repr */ @@ -1067,7 +1067,7 @@ ftype_register_integers(void) 1, /* wire_size */ int_fvalue_new, /* new_value */ NULL, /* free_value */ - sint8_from_unparsed, /* val_from_unparsed */ + sint8_from_literal, /* val_from_literal */ NULL, /* val_from_string */ sint_from_charconst, /* val_from_charconst */ integer_to_repr, /* val_to_string_repr */ @@ -1090,7 +1090,7 @@ ftype_register_integers(void) 2, /* wire_size */ int_fvalue_new, /* new_value */ NULL, /* free_value */ - sint16_from_unparsed, /* val_from_unparsed */ + sint16_from_literal, /* val_from_literal */ NULL, /* val_from_string */ sint_from_charconst, /* val_from_charconst */ integer_to_repr, /* val_to_string_repr */ @@ -1113,7 +1113,7 @@ ftype_register_integers(void) 3, /* wire_size */ int_fvalue_new, /* new_value */ NULL, /* free_value */ - sint24_from_unparsed, /* val_from_unparsed */ + sint24_from_literal, /* val_from_literal */ NULL, /* val_from_string */ sint_from_charconst, /* val_from_charconst */ integer_to_repr, /* val_to_string_repr */ @@ -1136,7 +1136,7 @@ ftype_register_integers(void) 4, /* wire_size */ int_fvalue_new, /* new_value */ NULL, /* free_value */ - sint32_from_unparsed, /* val_from_unparsed */ + sint32_from_literal, /* val_from_literal */ NULL, /* val_from_string */ sint_from_charconst, /* val_from_charconst */ integer_to_repr, /* val_to_string_repr */ @@ -1159,7 +1159,7 @@ ftype_register_integers(void) 5, /* wire_size */ int64_fvalue_new, /* new_value */ NULL, /* free_value */ - sint40_from_unparsed, /* val_from_unparsed */ + sint40_from_literal, /* val_from_literal */ NULL, /* val_from_string */ sint64_from_charconst, /* val_from_charconst */ integer64_to_repr, /* val_to_string_repr */ @@ -1182,7 +1182,7 @@ ftype_register_integers(void) 6, /* wire_size */ int64_fvalue_new, /* new_value */ NULL, /* free_value */ - sint48_from_unparsed, /* val_from_unparsed */ + sint48_from_literal, /* val_from_literal */ NULL, /* val_from_string */ sint64_from_charconst, /* val_from_charconst */ integer64_to_repr, /* val_to_string_repr */ @@ -1205,7 +1205,7 @@ ftype_register_integers(void) 7, /* wire_size */ int64_fvalue_new, /* new_value */ NULL, /* free_value */ - sint56_from_unparsed, /* val_from_unparsed */ + sint56_from_literal, /* val_from_literal */ NULL, /* val_from_string */ sint64_from_charconst, /* val_from_charconst */ integer64_to_repr, /* val_to_string_repr */ @@ -1228,7 +1228,7 @@ ftype_register_integers(void) 8, /* wire_size */ int64_fvalue_new, /* new_value */ NULL, /* free_value */ - sint64_from_unparsed, /* val_from_unparsed */ + sint64_from_literal, /* val_from_literal */ NULL, /* val_from_string */ sint64_from_charconst, /* val_from_charconst */ integer64_to_repr, /* val_to_string_repr */ @@ -1251,7 +1251,7 @@ ftype_register_integers(void) 0, /* wire_size */ int_fvalue_new, /* new_value */ NULL, /* free_value */ - boolean_from_unparsed, /* val_from_unparsed */ + boolean_from_literal, /* val_from_literal */ NULL, /* val_from_string */ uint64_from_charconst, /* val_from_charconst */ boolean_to_repr, /* val_to_string_repr */ @@ -1275,7 +1275,7 @@ ftype_register_integers(void) 4, /* wire_size */ int_fvalue_new, /* new_value */ NULL, /* free_value */ - ipxnet_from_unparsed, /* val_from_unparsed */ + ipxnet_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ ipxnet_to_repr, /* val_to_string_repr */ @@ -1299,7 +1299,7 @@ ftype_register_integers(void) 4, /* wire_size */ int_fvalue_new, /* new_value */ NULL, /* free_value */ - uint32_from_unparsed, /* val_from_unparsed */ + uint32_from_literal, /* val_from_literal */ NULL, /* val_from_string */ uint_from_charconst, /* val_from_charconst */ uinteger_to_repr, /* val_to_string_repr */ @@ -1323,7 +1323,7 @@ ftype_register_integers(void) FT_EUI64_LEN, /* wire_size */ int64_fvalue_new, /* new_value */ NULL, /* free_value */ - eui64_from_unparsed, /* val_from_unparsed */ + eui64_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ eui64_to_repr, /* val_to_string_repr */ diff --git a/epan/ftypes/ftype-ipv4.c b/epan/ftypes/ftype-ipv4.c index 32a0d70655..5f2745b1ae 100644 --- a/epan/ftypes/ftype-ipv4.c +++ b/epan/ftypes/ftype-ipv4.c @@ -29,7 +29,7 @@ value_get(fvalue_t *fv) } static gboolean -val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +val_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { guint32 addr; unsigned int nmask_bits; @@ -71,7 +71,7 @@ val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, net_str = slash + 1; /* XXX - this is inefficient */ - nmask_fvalue = fvalue_from_unparsed(FT_UINT32, net_str, FALSE, err_msg); + nmask_fvalue = fvalue_from_literal(FT_UINT32, net_str, FALSE, err_msg); if (!nmask_fvalue) { return FALSE; } @@ -153,7 +153,7 @@ ftype_register_ipv4(void) 4, /* wire_size */ NULL, /* new_value */ NULL, /* free_value */ - val_from_unparsed, /* val_from_unparsed */ + val_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ val_to_repr, /* val_to_string_repr */ diff --git a/epan/ftypes/ftype-ipv6.c b/epan/ftypes/ftype-ipv6.c index 57fc0b7db3..93f22f595f 100644 --- a/epan/ftypes/ftype-ipv6.c +++ b/epan/ftypes/ftype-ipv6.c @@ -23,7 +23,7 @@ ipv6_fvalue_set(fvalue_t *fv, const guint8 *value) } static gboolean -ipv6_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +ipv6_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { const char *slash; const char *addr_str; @@ -56,7 +56,7 @@ ipv6_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_ /* If prefix */ if (slash) { /* XXX - this is inefficient */ - nmask_fvalue = fvalue_from_unparsed(FT_UINT32, slash+1, FALSE, err_msg); + nmask_fvalue = fvalue_from_literal(FT_UINT32, slash+1, FALSE, err_msg); if (!nmask_fvalue) { return FALSE; } @@ -175,7 +175,7 @@ ftype_register_ipv6(void) FT_IPv6_LEN, /* wire_size */ NULL, /* new_value */ NULL, /* free_value */ - ipv6_from_unparsed, /* val_from_unparsed */ + ipv6_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ ipv6_to_repr, /* val_to_string_repr */ diff --git a/epan/ftypes/ftype-none.c b/epan/ftypes/ftype-none.c index 6507eee6f3..38befcc202 100644 --- a/epan/ftypes/ftype-none.c +++ b/epan/ftypes/ftype-none.c @@ -22,7 +22,7 @@ ftype_register_none(void) 0, /* wire_size */ NULL, /* new_value */ NULL, /* free_value */ - NULL, /* val_from_unparsed */ + NULL, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ NULL, /* val_to_string_repr */ diff --git a/epan/ftypes/ftype-protocol.c b/epan/ftypes/ftype-protocol.c index dba821d7d6..32329efce4 100644 --- a/epan/ftypes/ftype-protocol.c +++ b/epan/ftypes/ftype-protocol.c @@ -78,7 +78,7 @@ val_from_string(fvalue_t *fv, const char *s, gchar **err_msg _U_) } static gboolean -val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +val_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { GByteArray *bytes; tvbuff_t *new_tvb; @@ -89,7 +89,7 @@ val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, fv->value.protocol.proto_string = NULL; /* Does this look like a byte string? */ - bytes = byte_array_from_unparsed(s, err_msg); + bytes = byte_array_from_literal(s, err_msg); if (bytes != NULL) { /* Make a tvbuff from the bytes */ new_tvb = tvb_new_real_data(bytes->data, bytes->len, bytes->len); @@ -314,7 +314,7 @@ ftype_register_tvbuff(void) 0, /* wire_size */ value_new, /* new_value */ value_free, /* free_value */ - val_from_unparsed, /* val_from_unparsed */ + val_from_literal, /* val_from_literal */ val_from_string, /* val_from_string */ val_from_charconst, /* val_from_charconst */ val_to_repr, /* val_to_string_repr */ diff --git a/epan/ftypes/ftype-string.c b/epan/ftypes/ftype-string.c index 606cdd0194..390cba9345 100644 --- a/epan/ftypes/ftype-string.c +++ b/epan/ftypes/ftype-string.c @@ -70,11 +70,11 @@ val_from_string(fvalue_t *fv, const char *s, gchar **err_msg _U_) } static gboolean -val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +val_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { /* Just turn it into a string */ /* XXX Should probably be a syntax error instead. It's more user-friendly to ask the - * user to be explicit about the meaning of unparsed than them trying to figure out + * user to be explicit about the meaning of an unquoted literal than them trying to figure out * why a valid filter expression is giving wrong results. */ return val_from_string(fv, s, err_msg); } @@ -82,7 +82,7 @@ val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, static gboolean val_from_charconst(fvalue_t *fv, unsigned long num, gchar **err_msg) { - /* XXX Should be a syntax error if unparsed is also a syntax error. */ + /* XXX Should be a syntax error if literal is also a syntax error. */ /* Free up the old value, if we have one */ string_fvalue_free(fv); @@ -166,7 +166,7 @@ ftype_register_string(void) 0, /* wire_size */ string_fvalue_new, /* new_value */ string_fvalue_free, /* free_value */ - val_from_unparsed, /* val_from_unparsed */ + val_from_literal, /* val_from_literal */ val_from_string, /* val_from_string */ val_from_charconst, /* val_from_charconst */ string_to_repr, /* val_to_string_repr */ @@ -189,7 +189,7 @@ ftype_register_string(void) 0, /* wire_size */ string_fvalue_new, /* new_value */ string_fvalue_free, /* free_value */ - val_from_unparsed, /* val_from_unparsed */ + val_from_literal, /* val_from_literal */ val_from_string, /* val_from_string */ val_from_charconst, /* val_from_charconst */ string_to_repr, /* val_to_string_repr */ @@ -212,7 +212,7 @@ ftype_register_string(void) 0, /* wire_size */ string_fvalue_new, /* new_value */ string_fvalue_free, /* free_value */ - val_from_unparsed, /* val_from_unparsed */ + val_from_literal, /* val_from_literal */ val_from_string, /* val_from_string */ val_from_charconst, /* val_from_charconst */ string_to_repr, /* val_to_string_repr */ @@ -235,7 +235,7 @@ ftype_register_string(void) 0, /* wire_size */ string_fvalue_new, /* new_value */ string_fvalue_free, /* free_value */ - val_from_unparsed, /* val_from_unparsed */ + val_from_literal, /* val_from_literal */ val_from_string, /* val_from_string */ val_from_charconst, /* val_from_charconst */ string_to_repr, /* val_to_string_repr */ @@ -258,7 +258,7 @@ ftype_register_string(void) 0, /* wire_size */ string_fvalue_new, /* new_value */ string_fvalue_free, /* free_value */ - val_from_unparsed, /* val_from_unparsed */ + val_from_literal, /* val_from_literal */ val_from_string, /* val_from_string */ val_from_charconst, /* val_from_charconst */ string_to_repr, /* val_to_string_repr */ diff --git a/epan/ftypes/ftype-time.c b/epan/ftypes/ftype-time.c index d0242e2512..8fc6a63704 100644 --- a/epan/ftypes/ftype-time.c +++ b/epan/ftypes/ftype-time.c @@ -91,7 +91,7 @@ get_nsecs(const char *startp, int *nsecs, const char **endptr) } static gboolean -relative_val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +relative_val_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { const char *curptr; char *endptr; @@ -308,7 +308,7 @@ fail: } static gboolean -absolute_val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) +absolute_val_from_literal(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, gchar **err_msg) { return absolute_val_from_string(fv, s, err_msg); } @@ -416,7 +416,7 @@ ftype_register_time(void) 0, /* wire_size */ time_fvalue_new, /* new_value */ NULL, /* free_value */ - absolute_val_from_unparsed, /* val_from_unparsed */ + absolute_val_from_literal, /* val_from_literal */ absolute_val_from_string, /* val_from_string */ NULL, /* val_from_charconst */ absolute_val_to_repr, /* val_to_string_repr */ @@ -439,7 +439,7 @@ ftype_register_time(void) 0, /* wire_size */ time_fvalue_new, /* new_value */ NULL, /* free_value */ - relative_val_from_unparsed, /* val_from_unparsed */ + relative_val_from_literal, /* val_from_literal */ NULL, /* val_from_string */ NULL, /* val_from_charconst */ relative_val_to_repr, /* val_to_string_repr */ diff --git a/epan/ftypes/ftypes-int.h b/epan/ftypes/ftypes-int.h index 548c1422fc..a8a3661f57 100644 --- a/epan/ftypes/ftypes-int.h +++ b/epan/ftypes/ftypes-int.h @@ -16,7 +16,7 @@ typedef void (*FvalueNewFunc)(fvalue_t*); typedef void (*FvalueFreeFunc)(fvalue_t*); -typedef gboolean (*FvalueFromUnparsed)(fvalue_t*, const char*, gboolean, gchar **); +typedef gboolean (*FvalueFromLiteral)(fvalue_t*, const char*, gboolean, gchar **); typedef gboolean (*FvalueFromString)(fvalue_t*, const char*, gchar **); typedef gboolean (*FvalueFromCharConst)(fvalue_t*, unsigned long, gchar **); typedef char *(*FvalueToStringRepr)(wmem_allocator_t *, const fvalue_t*, ftrepr_t, int field_display); @@ -55,7 +55,7 @@ struct _ftype_t { int wire_size; FvalueNewFunc new_value; FvalueFreeFunc free_value; - FvalueFromUnparsed val_from_unparsed; + FvalueFromLiteral val_from_literal; FvalueFromString val_from_string; FvalueFromCharConst val_from_charconst; FvalueToStringRepr val_to_string_repr; @@ -107,7 +107,7 @@ void ftype_register_time(void); void ftype_register_tvbuff(void); GByteArray * -byte_array_from_unparsed(const char *s, gchar **err_msg); +byte_array_from_literal(const char *s, gchar **err_msg); GByteArray * byte_array_from_charconst(unsigned long num, gchar **err_msg); diff --git a/epan/ftypes/ftypes.c b/epan/ftypes/ftypes.c index 44b9016508..8f1f86ffef 100644 --- a/epan/ftypes/ftypes.c +++ b/epan/ftypes/ftypes.c @@ -264,13 +264,13 @@ fvalue_free(fvalue_t *fv) } fvalue_t* -fvalue_from_unparsed(ftenum_t ftype, const char *s, gboolean allow_partial_value, gchar **err_msg) +fvalue_from_literal(ftenum_t ftype, const char *s, gboolean allow_partial_value, gchar **err_msg) { fvalue_t *fv; fv = fvalue_new(ftype); - if (fv->ftype->val_from_unparsed) { - if (fv->ftype->val_from_unparsed(fv, s, allow_partial_value, err_msg)) { + if (fv->ftype->val_from_literal) { + if (fv->ftype->val_from_literal(fv, s, allow_partial_value, err_msg)) { /* Success */ if (err_msg != NULL) *err_msg = NULL; diff --git a/epan/ftypes/ftypes.h b/epan/ftypes/ftypes.h index 5776a6129f..16bfc03219 100644 --- a/epan/ftypes/ftypes.h +++ b/epan/ftypes/ftypes.h @@ -247,7 +247,7 @@ fvalue_free(fvalue_t *fv); WS_DLL_PUBLIC fvalue_t* -fvalue_from_unparsed(ftenum_t ftype, const char *s, gboolean allow_partial_value, gchar **err_msg); +fvalue_from_literal(ftenum_t ftype, const char *s, gboolean allow_partial_value, gchar **err_msg); fvalue_t* fvalue_from_string(ftenum_t ftype, const char *s, gchar **err_msg); diff --git a/test/suite_dfilter/group_range_method.py b/test/suite_dfilter/group_range_method.py index 646e65a0e2..e0776fda46 100644 --- a/test/suite_dfilter/group_range_method.py +++ b/test/suite_dfilter/group_range_method.py @@ -41,7 +41,7 @@ class case_range(unittest.TestCase): def test_slice_unparsed_1(self, checkDFilterFail): dfilter = "a == b[1]" - checkDFilterFail(dfilter, "Range is not supported for entity \"b\" of type UNPARSED") + checkDFilterFail(dfilter, "Range is not supported for entity \"b\" of type LITERAL") def test_slice_func_1(self, checkDFilterSucceed): dfilter = "string(ipx.src.node)[3:2] == \"cc:dd\""