Fix tfs strings that have leading or trailing space characters.

Change-Id: I3e456e24f171ea2073806ad56606e6ce9092890c
Reviewed-on: https://code.wireshark.org/review/38096
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Martin Mathieson 2020-08-09 13:04:44 +01:00 committed by Anders Broman
parent e9f6958c46
commit 9a7b30aea8
5 changed files with 14 additions and 8 deletions

View File

@ -275,7 +275,7 @@ static const true_false_string ber_real_binary_vals = {
static const true_false_string ber_real_decimal_vals = {
"SpecialRealValue",
"Decimal encoding "
"Decimal encoding"
};
#endif

View File

@ -172,8 +172,8 @@ static const true_false_string pd_bit = {
"OK"
};
static const true_false_string e_bit = {
" encrypted frame",
" non encrypted frame"
"encrypted frame",
"non encrypted frame"
};
static const true_false_string pm_bit = {
"FCS covers the frame header and information fields",

View File

@ -2000,7 +2000,7 @@ be_int_band(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 off
*/
static const true_false_string bssmap_lsa_only_value = {
"Access to the LSAs that are defined ",
"Access to the LSAs that are defined",
"Allowing emergency call"
};

View File

@ -36,7 +36,7 @@ static const value_string mcast_sap_ver[] = {
static const true_false_string mcast_sap_address_type = {"IPv6", "IPv4"};
static const true_false_string mcast_sap_message_type = { "Deletion", "Announcement"};
static const true_false_string mcast_sap_crypt_type = { "Payload encrypted", "Payload not encrypted "};
static const true_false_string mcast_sap_crypt_type = { "Payload encrypted", "Payload not encrypted"};
static const true_false_string mcast_sap_comp_type = { "Payload compressed", "Payload not compressed"};
static const value_string mcast_sap_auth_ver[] = {

View File

@ -16,7 +16,6 @@ import signal
# TODO:
# - check how many of the definitions in epan/tfs.c are used in other dissectors
# - see if there are other values that should be in epan/tfs.c and shared
# - look for leading/trailing whitespace in true/flase strings?
# Try to exit soon after Ctrl-C is pressed.
@ -30,11 +29,18 @@ def signal_handler(sig, frame):
signal.signal(signal.SIGINT, signal_handler)
class TFS:
def __init__(self, file, val1, val2):
def __init__(self, file, name, val1, val2):
self.file = file
self.name = name
self.val1 = val1
self.val2 = val2
# Do some extra checks on values.
if val1.startswith(' ') or val1.endswith(' '):
print('N.B.: file=' + self.file + ' ' + self.name + ' - false val begins or ends with space \"' + self.val1 + '\"')
if val2.startswith(' ') or val2.endswith(' '):
print('N.B.: file=' + self.file + ' ' + self.name + ' - true val begins or ends with space \"' + self.val2 + '\"')
def __str__(self):
return '{' + self.val1 + ',' + self.val2 + '}'
@ -62,7 +68,7 @@ def find_items(filename):
val1 = m.group(2)
val2 = m.group(3)
# Store this entry.
items[name] = TFS(filename, val1, val2)
items[name] = TFS(filename, name, val1, val2)
return items