2007-01-10 07:47:00 +00:00
|
|
|
/* tfs.c
|
|
|
|
* true_false strings
|
|
|
|
* Copyright 2007, Jaap Keuter <jaap.keuter@xs4all.nl>
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-08 16:59:17 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2007-01-10 07:47:00 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 01:48:30 +00:00
|
|
|
#include "config.h"
|
2007-01-10 07:47:00 +00:00
|
|
|
|
|
|
|
#include "tfs.h"
|
|
|
|
|
2020-04-29 07:29:53 +00:00
|
|
|
/** Returns the string representing the true or false value. */
|
2020-04-24 12:21:51 +00:00
|
|
|
const char *tfs_get_string(gboolean value, const true_false_string *tfs)
|
|
|
|
{
|
|
|
|
return value ? tfs->true_string : tfs->false_string;
|
|
|
|
}
|
|
|
|
|
2007-01-10 07:47:00 +00:00
|
|
|
/*
|
|
|
|
* A default set of true/false strings that dissectors can use for
|
|
|
|
* FT_BOOLEAN header fields.
|
|
|
|
*/
|
|
|
|
const true_false_string tfs_true_false = { "True", "False" };
|
|
|
|
const true_false_string tfs_yes_no = { "Yes", "No" };
|
2012-09-25 01:00:41 +00:00
|
|
|
const true_false_string tfs_no_yes = { "No", "Yes" };
|
2009-07-07 14:58:25 +00:00
|
|
|
const true_false_string tfs_set_notset = { "Set", "Not set" };
|
2007-01-10 07:47:00 +00:00
|
|
|
const true_false_string tfs_enabled_disabled = { "Enabled", "Disabled" };
|
2012-07-23 15:27:52 +00:00
|
|
|
const true_false_string tfs_disabled_enabled = { "Disabled", "Enabled" };
|
2007-01-10 07:47:00 +00:00
|
|
|
const true_false_string tfs_ok_error = { "Ok", "Error" };
|
2010-04-27 16:29:37 +00:00
|
|
|
const true_false_string tfs_error_ok = { "Error", "Ok" };
|
2007-01-10 07:47:00 +00:00
|
|
|
const true_false_string tfs_success_fail = { "Success", "Fail" };
|
2010-04-27 16:29:37 +00:00
|
|
|
const true_false_string tfs_fail_success = { "Fail", "Success" };
|
2007-01-10 07:47:00 +00:00
|
|
|
const true_false_string tfs_on_off = { "On", "Off" };
|
|
|
|
const true_false_string tfs_ack_nack = { "Ack", "Nack" };
|
|
|
|
const true_false_string tfs_odd_even = { "Odd", "Even" };
|
|
|
|
const true_false_string tfs_allow_block = { "Allow", "Block" };
|
|
|
|
const true_false_string tfs_restricted_allowed = { "Restricted", "Allowed" };
|
2017-07-12 21:34:42 +00:00
|
|
|
const true_false_string tfs_restricted_not_restricted = { "Restricted", "Not restricted" };
|
2007-01-10 07:47:00 +00:00
|
|
|
const true_false_string tfs_accept_reject = { "Accept", "Reject" };
|
2009-07-07 14:58:25 +00:00
|
|
|
const true_false_string tfs_more_nomore = { "More", "No more" };
|
2007-01-10 07:47:00 +00:00
|
|
|
const true_false_string tfs_present_absent = { "Present", "Absent" };
|
2011-01-17 13:09:08 +00:00
|
|
|
const true_false_string tfs_present_not_present = { "Present", "Not Present" };
|
2007-01-10 07:47:00 +00:00
|
|
|
const true_false_string tfs_active_inactive = { "Active", "Inactive" };
|
2018-03-10 12:52:04 +00:00
|
|
|
const true_false_string tfs_activated_deactivated = { "Activated", "Deactivated" };
|
2007-01-10 07:47:00 +00:00
|
|
|
const true_false_string tfs_found_not_found = { "Found", "Not found" };
|
|
|
|
const true_false_string tfs_command_response = { "Command", "Response" };
|
2016-04-04 04:07:53 +00:00
|
|
|
const true_false_string tfs_response_command = { "Response", "Command" };
|
2007-01-10 07:47:00 +00:00
|
|
|
const true_false_string tfs_capable_not_capable = { "Capable", "Not capable" };
|
|
|
|
const true_false_string tfs_supported_not_supported = { "Supported", "Not supported" };
|
2018-12-19 03:40:23 +00:00
|
|
|
const true_false_string tfs_not_supported_supported = { "Not Supported", "Supported" };
|
2009-03-05 22:25:36 +00:00
|
|
|
const true_false_string tfs_used_notused = { "Used", "Not used" };
|
2010-04-27 16:29:37 +00:00
|
|
|
const true_false_string tfs_high_low = { "High", "Low" };
|
2018-03-10 22:14:12 +00:00
|
|
|
const true_false_string tfs_high_normal = { "High", "Normal" };
|
|
|
|
const true_false_string tfs_low_normal = { "Low", "Normal" };
|
2010-04-27 16:29:37 +00:00
|
|
|
const true_false_string tfs_pressed_not_pressed = { "Pressed", "Not pressed" };
|
2011-01-17 13:09:08 +00:00
|
|
|
const true_false_string tfs_implemented_not_implemented = { "Implemented", "Not Implemented" };
|
2011-01-25 13:55:20 +00:00
|
|
|
const true_false_string tfs_requested_not_requested = { "Requested", "Not Requested" };
|
|
|
|
const true_false_string tfs_reliable_not_reliable = { "Reliable", "Not Reliable" };
|
2011-01-26 19:36:00 +00:00
|
|
|
const true_false_string tfs_allowed_not_allowed = { "Allowed", "Not Allowed" };
|
2012-04-12 14:07:31 +00:00
|
|
|
const true_false_string tfs_not_allowed_allowed = { "Not Allowed", "Allowed" };
|
2011-01-31 20:37:17 +00:00
|
|
|
const true_false_string tfs_accepted_not_accepted = { "Accepted", "Not Accepted" };
|
|
|
|
const true_false_string tfs_detected_not_detected = { "Detected", "Not Detected" };
|
2012-07-21 12:38:59 +00:00
|
|
|
const true_false_string tfs_available_not_available = { "Available", "Not available" };
|
2012-09-26 18:19:15 +00:00
|
|
|
const true_false_string tfs_shared_independent = { "Shared", "Independent" };
|
|
|
|
const true_false_string tfs_valid_invalid = { "Valid", "Invalid" };
|
2014-05-23 22:40:08 +00:00
|
|
|
const true_false_string tfs_invalid_valid = { "Invalid", "Valid" };
|
2012-09-26 18:19:15 +00:00
|
|
|
const true_false_string tfs_group_unique_name = { "Group name", "Unique name" };
|
2013-02-24 19:09:04 +00:00
|
|
|
const true_false_string tfs_inuse_not_inuse = { "In use", "Not in use" };
|
2013-07-03 16:46:29 +00:00
|
|
|
const true_false_string tfs_critical_not_critical = { "Critical", "Not critical" };
|
2013-07-17 10:44:08 +00:00
|
|
|
const true_false_string tfs_complete_incomplete = { "Complete", "Incomplete" };
|
|
|
|
const true_false_string tfs_valid_not_valid = { "Valid", "Not Valid" };
|
2013-07-17 10:44:26 +00:00
|
|
|
const true_false_string tfs_do_not_clear_clear = { "Do not clear", "Clear" };
|
|
|
|
const true_false_string tfs_confirmed_unconfirmed = { "Confirmed", "Unconfirmed" };
|
2013-07-17 10:44:35 +00:00
|
|
|
const true_false_string tfs_enforced_not_enforced = { "Enforced", "Not enforced" };
|
2014-06-03 14:49:33 +00:00
|
|
|
const true_false_string tfs_possible_not_possible = { "Possible", "Not possible" };
|
|
|
|
const true_false_string tfs_required_not_required = { "Required", "Not required" };
|
2014-08-07 13:30:24 +00:00
|
|
|
const true_false_string tfs_registered_not_registered = { "Registered", "Not registered" };
|
|
|
|
const true_false_string tfs_provisioned_not_provisioned = { "Provisioned", "Not provisioned" };
|
2014-10-07 11:51:52 +00:00
|
|
|
const true_false_string tfs_included_not_included = { "Included", "Not included" };
|
2014-10-15 16:55:08 +00:00
|
|
|
const true_false_string tfs_allocated_by_receiver_sender = {"allocated by receiver", "allocated by sender"};
|
2014-10-29 21:33:12 +00:00
|
|
|
const true_false_string tfs_asynchronous_synchronous = { "Asynchronous", "Synchronous" };
|
|
|
|
const true_false_string tfs_protocol_sensative_bit_transparent = { "Protocol sensitive", "Bit transparent" };
|
2014-11-07 22:11:02 +00:00
|
|
|
const true_false_string tfs_full_half = { "Full", "Half" };
|
|
|
|
const true_false_string tfs_acknowledged_not_acknowledged = { "Acknowledged", "Not Acknowledged" };
|
2016-04-04 04:07:53 +00:00
|
|
|
const true_false_string tfs_segmentation_no_segmentation = { "Segmentation", "No segmentation" };
|
2015-06-15 18:18:33 +00:00
|
|
|
const true_false_string tfs_response_request = { "Response", "Request" };
|
2015-07-07 08:46:34 +00:00
|
|
|
const true_false_string tfs_defined_not_defined = { "Defined", "Not defined" };
|
2015-07-13 07:47:21 +00:00
|
|
|
const true_false_string tfs_constructed_primitive = { "Constructed", "Primitive" };
|
2015-12-16 17:19:55 +00:00
|
|
|
const true_false_string tfs_client_server = { "Client", "Server" };
|
|
|
|
const true_false_string tfs_server_client = { "Server", "Client" };
|
2016-03-18 08:57:13 +00:00
|
|
|
const true_false_string tfs_preferred_no_preference = { "Preferred", "No preference" };
|
2016-04-04 04:07:53 +00:00
|
|
|
const true_false_string tfs_encrypt_do_not_encrypt = { "Encrypt", "Do Not Encrypt" };
|
2017-06-30 14:57:07 +00:00
|
|
|
const true_false_string tfs_down_up = { "Down", "Up" };
|
2017-07-09 14:11:48 +00:00
|
|
|
const true_false_string tfs_up_down = { "Up", "Down" };
|
2017-08-02 16:17:19 +00:00
|
|
|
const true_false_string tfs_downlink_uplink = { "Downlink", "Uplink" };
|
|
|
|
const true_false_string tfs_uplink_downlink = { "Uplink", "Downlink" };
|
2017-07-15 01:18:50 +00:00
|
|
|
const true_false_string tfs_s2c_c2s = { "Server to Client", "Client to Server" };
|
|
|
|
const true_false_string tfs_c2s_s2c = { "Client to Server", "Server to Client" };
|
2017-07-20 15:36:59 +00:00
|
|
|
const true_false_string tfs_open_closed = { "Open", "Closed" };
|
2018-12-19 03:40:23 +00:00
|
|
|
const true_false_string tfs_external_internal = { "External", "Internal" };
|
2019-01-29 15:43:34 +00:00
|
|
|
const true_false_string tfs_changed_not_changed = { "Changed", "Not Changed" };
|
2019-01-31 13:27:00 +00:00
|
|
|
const true_false_string tfs_needed_not_needed = { "Needed", "Not Needed" };
|
|
|
|
const true_false_string tfs_selected_not_selected = { "Selected", "Not Selected" };
|
2020-04-15 19:52:03 +00:00
|
|
|
const true_false_string tfs_add_drop = { "Add", "Drop" };
|
TFS: Add some commonly-defined string pairs to tfs.c
'check_tfs.py --common' can look for tfs values that appear multiple times.
Current output prior to these dssector changes was:
('No Extension', 'Extension') appears 3 times in: ['epan/dissectors/packet-bssap.c', 'epan/dissectors/packet-camel.c', 'epan/dissectors/packet-gsm_map.c']
('Optimised for signalling traffic', 'Not optimised for signalling traffic') appears 3 times in: ['epan/dissectors/packet-gsm_a_gm.c', 'epan/dissectors/packet-gsm_map.c', 'epan/dissectors/packet-gtp.c']
('Data PDU', 'Control PDU') appears 3 times in: ['epan/dissectors/packet-pdcp-lte.c', 'epan/dissectors/packet-pdcp-nr.c', 'epan/dissectors/packet-rlc-nr.c']
('Message sent to originating side', 'Message sent from originating side') appears 3 times in: ['epan/dissectors/packet-q2931.c', 'epan/dissectors/packet-q931.c', 'epan/dissectors/packet-q933.c']
('User', 'Provider') appears 3 times in: ['epan/dissectors/packet-q2931.c', 'epan/dissectors/packet-q931.c', 'epan/dissectors/packet-q933.c']
The first and last ones were made common, the others seem a little too specialised.
Checking some of the existing items in tfs.c (using QtCreator's 'Find Usages'),
some of the common items are used a lot, but many of them are not referenced.
Change-Id: Ia4006d2c4fa7cafbc3b004dc7a367a986dbeb0c4
Reviewed-on: https://code.wireshark.org/review/38177
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-16 20:41:18 +00:00
|
|
|
const true_false_string tfs_no_extension_extension = { "No Extension", "Extension" };
|
|
|
|
const true_false_string tfs_user_provider = { "User", "Provider" };
|
2020-12-17 08:59:52 +00:00
|
|
|
const true_false_string tfs_applicable_not_applicable = { "Applicable", "Not Applicable" };
|
2020-04-24 12:21:51 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|