Rename the FT_BYTES separator types to SEP_ from BASE_.

There's no requirement for "display" field values to have names
beginning with BASE_; use SEP_, to indicate that they're separators.

(And, yes, we should introduce SEP_NONE, with a value of 0, and use it.)

While we're at it, fix BASE_SEMICOLON - the separator is a colon, not a
semicolon - and document SEP_SPACE in doc/README.dissector.

Change-Id: I856aafda2c60b8320dffe287f0deb06a9604a2bf
Reviewed-on: https://code.wireshark.org/review/6486
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2015-01-10 16:26:46 -08:00
parent b4f5b6e72b
commit fdd6554ccd
18 changed files with 53 additions and 53 deletions

View File

@ -133,8 +133,8 @@ FIELDDISPLAY --For FT_UINT{8,16,24,32,64} and FT_INT{8,16,24,32,64):
--For FT_BYTES:
BASE_DOT, BASE_DASH, or BASE_SEMICOLON to provide a
separator between bytes.
SEP_DOT, SEP_DASH, SEP_COLON, or SEP_SPACE to provide
a separator between bytes.
BASE_NONE has no separator between bytes
--For all other types:

View File

@ -1411,16 +1411,16 @@ proto_register_fc(void)
{"Frame type", "fc.ftype", FT_UINT8, BASE_HEX, VALS(fc_ftype_vals),
0x0, "Derived Type", HFILL}},
{ &hf_fc_did,
{ "Dest Addr", "fc.d_id", FT_BYTES, BASE_DOT, NULL, 0x0,
{ "Dest Addr", "fc.d_id", FT_BYTES, SEP_DOT, NULL, 0x0,
"Destination Address", HFILL}},
{ &hf_fc_csctl,
{"CS_CTL", "fc.cs_ctl", FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL}},
{ &hf_fc_sid,
{"Src Addr", "fc.s_id", FT_BYTES, BASE_DOT, NULL, 0x0,
{"Src Addr", "fc.s_id", FT_BYTES, SEP_DOT, NULL, 0x0,
"Source Address", HFILL}},
{ &hf_fc_id,
{"Addr", "fc.id", FT_BYTES, BASE_DOT, NULL, 0x0,
{"Addr", "fc.id", FT_BYTES, SEP_DOT, NULL, 0x0,
"Source or Destination Address", HFILL}},
{ &hf_fc_type,
{"Type", "fc.type", FT_UINT8, BASE_HEX, VALS (fc_fc4_val), 0x0,

View File

@ -67,7 +67,7 @@ static header_field_info hfi_fcdns_vendor FCDNS_HFI_INIT =
BASE_HEX, NULL, 0x0, NULL, HFILL};
static header_field_info hfi_fcdns_req_portid FCDNS_HFI_INIT =
{"Port Identifier", "fcdns.req.portid", FT_BYTES, BASE_DOT, NULL, 0x0,
{"Port Identifier", "fcdns.req.portid", FT_BYTES, SEP_DOT, NULL, 0x0,
NULL, HFILL};
static header_field_info hfi_fcdns_rply_pname FCDNS_HFI_INIT =
@ -115,7 +115,7 @@ static header_field_info hfi_fcdns_req_pname FCDNS_HFI_INIT =
NULL, HFILL};
static header_field_info hfi_fcdns_rply_portid FCDNS_HFI_INIT =
{"Port Identifier", "fcdns.rply.portid", FT_BYTES, BASE_DOT, NULL,
{"Port Identifier", "fcdns.rply.portid", FT_BYTES, SEP_DOT, NULL,
0x0, NULL, HFILL};
static header_field_info hfi_fcdns_req_nname FCDNS_HFI_INIT =
@ -183,7 +183,7 @@ static header_field_info hfi_fcdns_rply_fc4desclen FCDNS_HFI_INIT =
BASE_DEC, NULL, 0x0, NULL, HFILL};
static header_field_info hfi_fcdns_rply_hrdaddr FCDNS_HFI_INIT =
{"Hard Address", "fcdns.rply.hrdaddr", FT_BYTES, BASE_DOT, NULL,
{"Hard Address", "fcdns.rply.hrdaddr", FT_BYTES, SEP_DOT, NULL,
0x0, NULL, HFILL};
static header_field_info hfi_fcdns_req_fdesclen FCDNS_HFI_INIT =
@ -219,7 +219,7 @@ static header_field_info hfi_fcdns_zone_mbrid_uint FCDNS_HFI_INIT =
0x0, NULL, HFILL};
static header_field_info hfi_fcdns_zone_mbrid_fc FCDNS_HFI_INIT =
{"Member Identifier", "fcdns.zone.mbrid.fc", FT_BYTES, BASE_DOT, NULL,
{"Member Identifier", "fcdns.zone.mbrid.fc", FT_BYTES, SEP_DOT, NULL,
0x0, NULL, HFILL};
static header_field_info hfi_fcdns_id_length FCDNS_HFI_INIT =

View File

@ -2376,7 +2376,7 @@ proto_register_fcels (void)
{"Open Seq Per Exchg", "fcels.logi.openseq", FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}},
{ &hf_fcels_nportid,
{"Originator S_ID", "fcels.portid", FT_BYTES, BASE_DOT, NULL, 0x0,
{"Originator S_ID", "fcels.portid", FT_BYTES, SEP_DOT, NULL, 0x0,
NULL, HFILL}},
{ &hf_fcels_oxid,
{"OXID", "fcels.oxid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},
@ -2386,7 +2386,7 @@ proto_register_fcels (void)
{"Recovery Qualifier", "fcels.rcovqual", FT_UINT8, BASE_HEX, NULL,
0x0, NULL, HFILL}},
{ &hf_fcels_fabricaddr,
{"Fabric Address", "fcels.faddr", FT_BYTES, BASE_DOT, NULL, 0x0, NULL,
{"Fabric Address", "fcels.faddr", FT_BYTES, SEP_DOT, NULL, 0x0, NULL,
HFILL}},
{ &hf_fcels_fabricpname,
{"Fabric Port Name", "fcels.fpname", FT_FCWWN, BASE_NONE, NULL, 0x0,
@ -2419,7 +2419,7 @@ proto_register_fcels (void)
{"Responder Action", "fcels.respaction", FT_UINT8, BASE_HEX,
VALS (fc_els_farp_respaction_val), 0x0, NULL, HFILL}},
{ &hf_fcels_resportid,
{"Responding Port ID", "fcels.resportid", FT_BYTES, BASE_DOT,
{"Responding Port ID", "fcels.resportid", FT_BYTES, SEP_DOT,
NULL, 0x0, NULL, HFILL}},
{ &hf_fcels_respname,
{"Responding Port Name", "fcels.respname", FT_FCWWN, BASE_NONE,
@ -2434,7 +2434,7 @@ proto_register_fcels (void)
{"Responding IP Address", "fcels.respipaddr", FT_IPv6, BASE_NONE,
NULL, 0x0, NULL, HFILL}},
{ &hf_fcels_hardaddr,
{"Hard Address of Originator", "fcels.hrdaddr", FT_BYTES, BASE_DOT,
{"Hard Address of Originator", "fcels.hrdaddr", FT_BYTES, SEP_DOT,
NULL, 0x0, NULL, HFILL}},
{ &hf_fcels_rps_flag,
{"Flag", "fcels.flag", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},
@ -2716,7 +2716,7 @@ proto_register_fcels (void)
{ &hf_fcels_rpl_list_length, { "List Length", "fcels.rpl.list_length", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_rpl_index_of_i_port_block, { "Index of I Port Block", "fcels.rpl.index_of_i_port_block", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_rpl_physical_port, { "Physical Port #", "fcels.rpl.physical_port", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_rpl_port_identifier, { "Port Identifier", "fcels.rpl.port_identifier", FT_BYTES, BASE_DOT, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_rpl_port_identifier, { "Port Identifier", "fcels.rpl.port_identifier", FT_BYTES, SEP_DOT, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_rpl_port_name, { "Port Name", "fcels.rpl.port_name", FT_FCWWN, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_rscn_page_len, { "Page Len", "fcels.rscn.page_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_rscn_payload_len, { "Payload Len", "fcels.rscn.payload_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
@ -2735,11 +2735,11 @@ proto_register_fcels (void)
{ &hf_fcels_prlilo_3rd_party_originator_pa, { "3rd Party Originator PA", "fcels.prlilo.3rd_party_originator_pa", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_prlilo_responder_pa, { "Responder PA", "fcels.prlilo.responder_pa", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_prlilo_service_parameter_response, { "Service Parameter Response", "fcels.prlilo.service_parameter_response", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_prlilo_3rd_party_n_port_id, { "3rd Party N_Port Id", "fcels.prlilo.3rd_party_n_port_id", FT_BYTES, BASE_DOT, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_prlilo_3rd_party_n_port_id, { "3rd Party N_Port Id", "fcels.prlilo.3rd_party_n_port_id", FT_BYTES, SEP_DOT, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_lirr_regn_function, { "Regn. Function", "fcels.lirr.regn_function", FT_UINT8, BASE_HEX, VALS(fc_els_lirr_regfunc_val), 0x0, NULL, HFILL }},
{ &hf_fcels_lirr_regn_format, { "Regn. Format", "fcels.lirr.regn_format", FT_UINT8, BASE_HEX, VALS(fc_fc4_val), 0x0, NULL, HFILL }},
{ &hf_fcels_srl_flag, { "Flag", "fcels.srl.flag", FT_BOOLEAN, 8, TFS(&tfs_srl_flag), 0x01, NULL, HFILL }},
{ &hf_fcels_srl_fl_port_addr, { "FL_Port Addr", "fcels.srl.fl_port_addr", FT_BYTES, BASE_DOT, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_srl_fl_port_addr, { "FL_Port Addr", "fcels.srl.fl_port_addr", FT_BYTES, SEP_DOT, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_rpsc_number_of_entries, { "Number of Entries", "fcels.rpsc.number_of_entries", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_fcels_rpsc_port_oper_speed, { "Port Oper Speed", "fcels.rpsc.port_oper_speed", FT_UINT16, BASE_HEX, VALS(fc_els_portspeed_val), 0x0, NULL, HFILL }},
{ &hf_fcels_common_identification_data_length, { "Common Identification Data Length", "fcels.common_identification_data_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},

View File

@ -970,7 +970,7 @@ proto_register_fcfcs (void)
BASE_HEX, NULL, 0x0, NULL, HFILL}},
{ &hf_fcs_mgmtid,
{"Interconnect Element Mgmt. ID", "fcs.ie.mgmtid", FT_BYTES,
BASE_DOT, NULL, 0x0, NULL, HFILL}},
SEP_DOT, NULL, 0x0, NULL, HFILL}},
{ &hf_fcs_fabricname,
{"Interconnect Element Fabric Name", "fcs.ie.fname", FT_FCWWN,
BASE_NONE, NULL, 0x0, NULL, HFILL}},

View File

@ -810,7 +810,7 @@ proto_register_fcfzs(void)
{ &hf_fcfzs_mbrid_fc,
{"Zone Member Identifier", "fcfzs.zone.mbrid.fc",
FT_BYTES, BASE_DOT, NULL, 0x0,
FT_BYTES, SEP_DOT, NULL, 0x0,
NULL, HFILL}},
{ &hf_fcfzs_mbrid_uint,

View File

@ -1254,7 +1254,7 @@ proto_register_fcsbccs (void)
{ &hf_sbccs_logical_path,
{ "Logical Path", "fcsb3.logical_path",
FT_BYTES, BASE_SEMICOLON, NULL, 0x0,
FT_BYTES, SEP_COLON, NULL, 0x0,
NULL, HFILL}},
};

View File

@ -2078,7 +2078,7 @@ proto_register_fcswils(void)
{ &hf_swils_ldrec_linkid,
{"Link ID", "swils.ldr.linkid",
FT_BYTES, BASE_DOT, NULL, 0x0,
FT_BYTES, SEP_DOT, NULL, 0x0,
NULL, HFILL}},
{ &hf_swils_ldrec_out_pidx,
@ -2113,7 +2113,7 @@ proto_register_fcswils(void)
{ &hf_swils_rscn_affectedport,
{"Affected Port ID", "swils.rscn.affectedport",
FT_BYTES, BASE_DOT, NULL, 0x0,
FT_BYTES, SEP_DOT, NULL, 0x0,
NULL, HFILL}},
{ &hf_swils_rscn_detectfn,
@ -2128,7 +2128,7 @@ proto_register_fcswils(void)
{ &hf_swils_rscn_portid,
{"Port Id", "swils.rscn.portid",
FT_BYTES, BASE_DOT, NULL, 0x0,
FT_BYTES, SEP_DOT, NULL, 0x0,
NULL, HFILL}},
{ &hf_swils_rscn_pwwn,
@ -2193,7 +2193,7 @@ proto_register_fcswils(void)
{ &hf_swils_zone_mbrid_fc,
{"Member Identifier", "swils.zone.mbrid.fc",
FT_BYTES, BASE_DOT, NULL, 0x0,
FT_BYTES, SEP_DOT, NULL, 0x0,
NULL, HFILL}},
{ &hf_swils_zone_mbrid_uint,

View File

@ -655,7 +655,7 @@ proto_register_fip(void)
{ &hf_fip_desc_map,
{ "FC-MAP-OUI", "fip.map",
FT_BYTES, BASE_DOT, NULL, 0,
FT_BYTES, SEP_DOT, NULL, 0,
NULL, HFILL}},
{ &hf_fip_desc_name,
@ -670,7 +670,7 @@ proto_register_fip(void)
{ &hf_fip_desc_fab_map,
{ "FC-MAP", "fip.fab.map",
FT_BYTES, BASE_DOT, NULL, 0,
FT_BYTES, SEP_DOT, NULL, 0,
NULL, HFILL}},
{ &hf_fip_desc_fab_name,

View File

@ -1390,7 +1390,7 @@ proto_register_isis_hello(void)
{ &hf_isis_hello_digest_v, { "V", "isis.hello.digest.v", FT_UINT8, BASE_DEC, NULL, 0x10, NULL, HFILL }},
{ &hf_isis_hello_digest_a, { "A", "isis.hello.digest.a", FT_UINT8, BASE_DEC, NULL, 0x0c, NULL, HFILL }},
{ &hf_isis_hello_digest_d, { "D", "isis.hello.digest.d", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL }},
{ &hf_isis_hello_ect, { "ECT", "isis.hello.ect", FT_BYTES, BASE_DASH, NULL, 0x0, NULL, HFILL }},
{ &hf_isis_hello_ect, { "ECT", "isis.hello.ect", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL }},
{ &hf_isis_hello_bvid, { "BVID", "isis.hello.bvid", FT_UINT16, BASE_HEX_DEC, NULL, 0x0FFF, NULL, HFILL }},
{ &hf_isis_hello_bvid_u, { "U", "isis.hello.bvid.u", FT_UINT16, BASE_HEX_DEC, NULL, 0x0008, NULL, HFILL }},
{ &hf_isis_hello_bvid_m, { "M", "isis.hello.bvid.m", FT_UINT16, BASE_HEX_DEC, NULL, 0x0004, NULL, HFILL }},

View File

@ -4368,7 +4368,7 @@ proto_register_mip6(void)
{ &hf_fmip6_lla,
{ "Link-layer address", "mip6.lla",
FT_BYTES, BASE_SEMICOLON, NULL, 0,
FT_BYTES, SEP_COLON, NULL, 0,
NULL, HFILL }
},

View File

@ -6749,7 +6749,7 @@ proto_register_ipv6cp(void)
{
static hf_register_info hf[] = {
/* Generated from convert_proto_tree_add_text.pl */
{ &hf_ipv6cp_interface_identifier, { "Interface Identifier", "ipv6cp.interface_identifier", FT_BYTES, BASE_SEMICOLON, NULL, 0x0, NULL, HFILL }},
{ &hf_ipv6cp_interface_identifier, { "Interface Identifier", "ipv6cp.interface_identifier", FT_BYTES, SEP_COLON, NULL, 0x0, NULL, HFILL }},
};
static gint *ett[] = {
&ett_ipv6cp,

View File

@ -1455,7 +1455,7 @@ void proto_register_zbee_zcl_part(void)
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_part_part_frame,
{ "Partition Frame", "zbee_zcl_general.part.part_frame", FT_BYTES, BASE_SEMICOLON, NULL,
{ "Partition Frame", "zbee_zcl_general.part.part_frame", FT_BYTES, SEP_COLON, NULL,
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_part_partitioned_cluster_id,
@ -2663,7 +2663,7 @@ void proto_register_zbee_zcl_ota(void)
0x00, NULL, HFILL } },
{ &hf_zbee_zcl_ota_image_data,
{ "Image Data", "zbee_zcl_general.ota.image.data", FT_BYTES, BASE_SEMICOLON, NULL,
{ "Image Data", "zbee_zcl_general.ota.image.data", FT_BYTES, SEP_COLON, NULL,
0x00, NULL, HFILL } }
};

View File

@ -1379,7 +1379,7 @@ proto_register_zbee_zcl_appl_stats(void)
0x0, NULL, HFILL } },
{ &hf_zbee_zcl_appl_stats_log_payload,
{ "Log Payload", "zbee_zcl_ha.applstats.log.payload", FT_BYTES, BASE_SEMICOLON, NULL,
{ "Log Payload", "zbee_zcl_ha.applstats.log.payload", FT_BYTES, SEP_COLON, NULL,
0x00, NULL, HFILL } },
};

View File

@ -2309,7 +2309,7 @@ void proto_register_zbee_zcl(void)
NULL, HFILL }},
{ &hf_zbee_zcl_attr_ostr,
{ "Octet String", "zbee_zcl.attr.ostr", FT_BYTES, BASE_SEMICOLON, NULL, 0x0,
{ "Octet String", "zbee_zcl.attr.ostr", FT_BYTES, SEP_COLON, NULL, 0x0,
NULL, HFILL }},
{ &hf_zbee_zcl_attr_array_elements_type,

View File

@ -154,14 +154,14 @@ bytes_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display, char *buf)
else {
switch(field_display)
{
case BASE_DOT:
case SEP_DOT:
separator = '.';
break;
case BASE_DASH:
case SEP_DASH:
separator = '-';
break;
case BASE_SPACE:
case BASE_SEMICOLON:
case SEP_SPACE:
case SEP_COLON:
case BASE_NONE:
default:
separator = ':';

View File

@ -4252,16 +4252,16 @@ proto_custom_set(proto_tree* tree, GSList *field_ids, gint occurrence,
if (bytes) {
switch(hfinfo->display)
{
case BASE_DOT:
case SEP_DOT:
str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&finfo->value), '.');
break;
case BASE_DASH:
case SEP_DASH:
str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&finfo->value), '-');
break;
case BASE_SEMICOLON:
case SEP_COLON:
str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&finfo->value), ':');
break;
case BASE_SPACE:
case SEP_SPACE:
str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&finfo->value), ' ');
break;
case BASE_NONE:
@ -5628,13 +5628,13 @@ tmp_fld_check_assert(header_field_info *hfinfo)
*/
switch (hfinfo->display & FIELD_DISPLAY_E_MASK) {
case BASE_NONE:
case BASE_DOT:
case BASE_DASH:
case BASE_SEMICOLON:
case BASE_SPACE:
case SEP_DOT:
case SEP_DASH:
case SEP_COLON:
case SEP_SPACE:
break;
default:
g_error("Field '%s' (%s) is an byte array but is being displayed as %s instead of BASE_NONE, BASE_DOT, BASE_DASH, BASE_SEMICOLON, or BASE_SPACE\n",
g_error("Field '%s' (%s) is an byte array but is being displayed as %s instead of BASE_NONE, SEP_DOT, SEP_DASH, SEP_COLON, or SEP_SPACE\n",
hfinfo->name, hfinfo->abbrev,
val_to_str(hfinfo->display, hf_display, "(Bit count: %d)"));
}
@ -6024,16 +6024,16 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
char* str = NULL;
switch(hfinfo->display)
{
case BASE_DOT:
case SEP_DOT:
str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&fi->value), '.');
break;
case BASE_DASH:
case SEP_DASH:
str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&fi->value), '-');
break;
case BASE_SEMICOLON:
case SEP_COLON:
str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&fi->value), ':');
break;
case BASE_SPACE:
case SEP_SPACE:
str = (char*)bytestring_to_str(NULL, bytes, fvalue_length(&fi->value), ' ');
break;
case BASE_NONE:

View File

@ -497,10 +497,10 @@ typedef enum {
STR_UNICODE = 7, /**< shows non-printable UNICODE characters as \\uXXXX (XXX for now non-printable characters display depends on UI) */
/* Byte types */
BASE_DOT = 8, /**< hexadecimal bytes with a period (.) between each byte */
BASE_DASH = 9, /**< hexadecimal bytes with a dash (-) between each byte */
BASE_SEMICOLON = 10, /**< hexadecimal bytes with a dash (:) between each byte */
BASE_SPACE = 11 /**< hexadecimal bytes with a space between each byte */
SEP_DOT = 8, /**< hexadecimal bytes with a period (.) between each byte */
SEP_DASH = 9, /**< hexadecimal bytes with a dash (-) between each byte */
SEP_COLON = 10, /**< hexadecimal bytes with a colon (:) between each byte */
SEP_SPACE = 11 /**< hexadecimal bytes with a space between each byte */
} field_display_e;
/* Following constants have to be ORed with a field_display_e when dissector