Create BASE_DOT, BASE_DASH, and BASE_SEMICOLON types for the FT_BYTES field type.

These "bases" will put a ".", "-", or ":" respectively between hexidecimal bytes in the field in packet view and display filter.  FT_BYTES with BASE_NONE will have no separator in the packet view, but continue to have the ':' as a separator in the display filter.

Converted the "string" hf_ entries that used tvb_fc_to_str as a string to use proto_tree_add_item with FT_BYTES/BASE_DOT type.

Converted applicable tvb_bytes_to_ep_str_punct() calls to use the new BASE values.

Change-Id: I2442185bb314d04a3ff2ba57883652ecd738b5f9
Reviewed-on: https://code.wireshark.org/review/6098
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Michael Mann 2015-01-03 21:56:16 -05:00
parent 2085bbec9d
commit 553da37446
38 changed files with 300 additions and 264 deletions

View File

@ -106,7 +106,7 @@ FIELDTYPE FT_NONE, FT_BOOLEAN, FT_UINT8, FT_UINT16, FT_UINT24,
FT_RELATIVE_TIME, FT_STRING, FT_STRINGZ, FT_EUI64, FT_RELATIVE_TIME, FT_STRING, FT_STRINGZ, FT_EUI64,
FT_UINT_STRING, FT_ETHER, FT_BYTES, FT_UINT_BYTES, FT_IPv4, FT_UINT_STRING, FT_ETHER, FT_BYTES, FT_UINT_BYTES, FT_IPv4,
FT_IPv6, FT_IPXNET, FT_FRAMENUM, FT_PROTOCOL, FT_GUID, FT_OID, FT_IPv6, FT_IPXNET, FT_FRAMENUM, FT_PROTOCOL, FT_GUID, FT_OID,
FT_REL_OID, FT_AX25, FT_VINES, FT_SYSTEM_ID, FT_FCWWN FT_REL_OID, FT_AX25, FT_VINES, FT_SYSTEM_ID, FT_FC, FT_FCWWN
FIELDDISPLAY --For FT_UINT{8,16,24,32,64} and FT_INT{8,16,24,32,64): FIELDDISPLAY --For FT_UINT{8,16,24,32,64} and FT_INT{8,16,24,32,64):
@ -131,6 +131,12 @@ FIELDDISPLAY --For FT_UINT{8,16,24,32,64} and FT_INT{8,16,24,32,64):
STR_ASCII or STR_UNICODE STR_ASCII or STR_UNICODE
--For FT_BYTES:
BASE_DOT, BASE_DASH, or BASE_SEMICOLON to provide a
separator between bytes.
BASE_NONE has no separator between bytes
--For all other types: --For all other types:
BASE_NONE BASE_NONE

View File

@ -79,7 +79,7 @@ static gboolean fvt_cache_cb(proto_node * node, gpointer data _U_) {
} }
e = g_new(fvt_cache_entry_t,1); e = g_new(fvt_cache_entry_t,1);
e->name = finfo->hfinfo->abbrev, e->name = finfo->hfinfo->abbrev,
e->repr = fvalue_to_string_repr(&(finfo->value), FTREPR_DFILTER, NULL); e->repr = fvalue_to_string_repr(&(finfo->value), FTREPR_DFILTER, finfo->hfinfo->display, NULL);
e->usable = TRUE; e->usable = TRUE;
g_hash_table_insert(fvt_cache,(void*)finfo->hfinfo->abbrev,e); g_hash_table_insert(fvt_cache,(void*)finfo->hfinfo->abbrev,e);
} }

View File

@ -110,7 +110,7 @@ dfvm_dump(FILE *f, dfilter_t *df)
switch (insn->op) { switch (insn->op) {
case PUT_FVALUE: case PUT_FVALUE:
value_str = fvalue_to_string_repr(arg1->value.fvalue, value_str = fvalue_to_string_repr(arg1->value.fvalue,
FTREPR_DFILTER, NULL); FTREPR_DFILTER, BASE_NONE, NULL);
fprintf(f, "%05d PUT_FVALUE\t%s <%s> -> reg#%u\n", fprintf(f, "%05d PUT_FVALUE\t%s <%s> -> reg#%u\n",
id, value_str, id, value_str,
fvalue_type_name(arg1->value.fvalue), fvalue_type_name(arg1->value.fvalue),

View File

@ -956,20 +956,16 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
/* XXX - use "fc_wka_vals[]" on this? */ /* XXX - use "fc_wka_vals[]" on this? */
SET_ADDRESS(&addr, AT_FC, 3, fchdr.d_id.data); SET_ADDRESS(&addr, AT_FC, 3, fchdr.d_id.data);
proto_tree_add_string (fc_tree, hf_fc_did, tvb, offset+1, 3, proto_tree_add_item(fc_tree, hf_fc_did, tvb, offset+1, 3, ENC_NA);
address_to_str(wmem_packet_scope(), &addr)); hidden_item = proto_tree_add_item (fc_tree, hf_fc_id, tvb, offset+1, 3, ENC_NA);
hidden_item = proto_tree_add_string (fc_tree, hf_fc_id, tvb, offset+1, 3,
address_to_str(wmem_packet_scope(), &addr));
PROTO_ITEM_SET_HIDDEN(hidden_item); PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_uint (fc_tree, hf_fc_csctl, tvb, offset+4, 1, fchdr.cs_ctl); proto_tree_add_uint (fc_tree, hf_fc_csctl, tvb, offset+4, 1, fchdr.cs_ctl);
/* XXX - use "fc_wka_vals[]" on this? */ /* XXX - use "fc_wka_vals[]" on this? */
SET_ADDRESS(&addr, AT_FC, 3, fchdr.s_id.data); SET_ADDRESS(&addr, AT_FC, 3, fchdr.s_id.data);
proto_tree_add_string (fc_tree, hf_fc_sid, tvb, offset+5, 3, proto_tree_add_item(fc_tree, hf_fc_sid, tvb, offset+5, 3, ENC_NA);
address_to_str(wmem_packet_scope(), &addr)); hidden_item = proto_tree_add_item (fc_tree, hf_fc_id, tvb, offset+5, 3, ENC_NA);
hidden_item = proto_tree_add_string (fc_tree, hf_fc_id, tvb, offset+5, 3,
address_to_str(wmem_packet_scope(), &addr));
PROTO_ITEM_SET_HIDDEN(hidden_item); PROTO_ITEM_SET_HIDDEN(hidden_item);
if (ftype == FC_FTYPE_LINKCTL) { if (ftype == FC_FTYPE_LINKCTL) {
@ -1415,16 +1411,16 @@ proto_register_fc(void)
{"Frame type", "fc.ftype", FT_UINT8, BASE_HEX, VALS(fc_ftype_vals), {"Frame type", "fc.ftype", FT_UINT8, BASE_HEX, VALS(fc_ftype_vals),
0x0, "Derived Type", HFILL}}, 0x0, "Derived Type", HFILL}},
{ &hf_fc_did, { &hf_fc_did,
{ "Dest Addr", "fc.d_id", FT_STRING, BASE_NONE, NULL, 0x0, { "Dest Addr", "fc.d_id", FT_BYTES, BASE_DOT, NULL, 0x0,
"Destination Address", HFILL}}, "Destination Address", HFILL}},
{ &hf_fc_csctl, { &hf_fc_csctl,
{"CS_CTL", "fc.cs_ctl", FT_UINT8, BASE_HEX, NULL, 0x0, {"CS_CTL", "fc.cs_ctl", FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL}}, NULL, HFILL}},
{ &hf_fc_sid, { &hf_fc_sid,
{"Src Addr", "fc.s_id", FT_STRING, BASE_NONE, NULL, 0x0, {"Src Addr", "fc.s_id", FT_BYTES, BASE_DOT, NULL, 0x0,
"Source Address", HFILL}}, "Source Address", HFILL}},
{ &hf_fc_id, { &hf_fc_id,
{"Addr", "fc.id", FT_STRING, BASE_NONE, NULL, 0x0, {"Addr", "fc.id", FT_BYTES, BASE_DOT, NULL, 0x0,
"Source or Destination Address", HFILL}}, "Source or Destination Address", HFILL}},
{ &hf_fc_type, { &hf_fc_type,
{"Type", "fc.type", FT_UINT8, BASE_HEX, VALS (fc_fc4_val), 0x0, {"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}; BASE_HEX, NULL, 0x0, NULL, HFILL};
static header_field_info hfi_fcdns_req_portid FCDNS_HFI_INIT = static header_field_info hfi_fcdns_req_portid FCDNS_HFI_INIT =
{"Port Identifier", "fcdns.req.portid", FT_STRING, BASE_NONE, NULL, 0x0, {"Port Identifier", "fcdns.req.portid", FT_BYTES, BASE_DOT, NULL, 0x0,
NULL, HFILL}; NULL, HFILL};
static header_field_info hfi_fcdns_rply_pname FCDNS_HFI_INIT = 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}; NULL, HFILL};
static header_field_info hfi_fcdns_rply_portid FCDNS_HFI_INIT = static header_field_info hfi_fcdns_rply_portid FCDNS_HFI_INIT =
{"Port Identifier", "fcdns.rply.portid", FT_STRING, BASE_NONE, NULL, {"Port Identifier", "fcdns.rply.portid", FT_BYTES, BASE_DOT, NULL,
0x0, NULL, HFILL}; 0x0, NULL, HFILL};
static header_field_info hfi_fcdns_req_nname FCDNS_HFI_INIT = 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}; BASE_DEC, NULL, 0x0, NULL, HFILL};
static header_field_info hfi_fcdns_rply_hrdaddr FCDNS_HFI_INIT = static header_field_info hfi_fcdns_rply_hrdaddr FCDNS_HFI_INIT =
{"Hard Address", "fcdns.rply.hrdaddr", FT_STRING, BASE_NONE, NULL, {"Hard Address", "fcdns.rply.hrdaddr", FT_BYTES, BASE_DOT, NULL,
0x0, NULL, HFILL}; 0x0, NULL, HFILL};
static header_field_info hfi_fcdns_req_fdesclen FCDNS_HFI_INIT = static header_field_info hfi_fcdns_req_fdesclen FCDNS_HFI_INIT =
@ -562,10 +562,7 @@ dissect_fc4type (proto_tree *parent_tree, tvbuff_t *tvb, int offset, header_fiel
static void static void
dissect_fcdns_req_portid (tvbuff_t *tvb, proto_tree *tree, int offset) dissect_fcdns_req_portid (tvbuff_t *tvb, proto_tree *tree, int offset)
{ {
if (tree) { proto_tree_add_item (tree, &hfi_fcdns_req_portid, tvb, offset, 3, ENC_NA);
proto_tree_add_string (tree, &hfi_fcdns_req_portid, tvb, offset, 3,
tvb_fc_to_str (tvb, offset));
}
} }
static void static void
@ -581,9 +578,8 @@ dissect_fcdns_ganxt (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else { else {
proto_tree_add_item (req_tree, &hfi_fcdns_rply_ptype, tvb, offset, proto_tree_add_item (req_tree, &hfi_fcdns_rply_ptype, tvb, offset,
1, ENC_BIG_ENDIAN); 1, ENC_BIG_ENDIAN);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid, tvb,
offset+1, 3, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_pname, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_rply_pname, tvb,
offset+4, 8, ENC_NA); offset+4, 8, ENC_NA);
len = tvb_get_guint8 (tvb, offset+12); len = tvb_get_guint8 (tvb, offset+12);
@ -633,9 +629,8 @@ dissect_fcdns_ganxt (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
offset+608, 8, ENC_NA); offset+608, 8, ENC_NA);
} }
if (tvb_offset_exists (tvb, 635)) { if (tvb_offset_exists (tvb, 635)) {
proto_tree_add_string (req_tree, &hfi_fcdns_rply_hrdaddr, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_rply_hrdaddr, tvb,
offset+617, 3, offset+617, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+617));
} }
} }
} }
@ -808,9 +803,8 @@ dissect_fcdns_gidpn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
offset, 8, ENC_NA); offset, 8, ENC_NA);
} }
else { else {
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid, tvb,
offset+1, 3, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
} }
} }
} }
@ -846,9 +840,8 @@ dissect_fcdns_gidnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else { else {
do { do {
islast = tvb_get_guint8 (tvb, offset); islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
offset += 4; offset += 4;
} while (!(islast & 0x80)); } while (!(islast & 0x80));
} }
@ -886,9 +879,8 @@ dissect_fcdns_gpnnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else { else {
do { do {
islast = tvb_get_guint8 (tvb, offset); islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_pname, proto_tree_add_item (req_tree, &hfi_fcdns_rply_pname,
tvb, offset+8, 8, ENC_NA); tvb, offset+8, 8, ENC_NA);
offset += 16; offset += 16;
@ -936,9 +928,8 @@ dissect_fcdns_gidft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else { else {
do { do {
islast = tvb_get_guint8 (tvb, offset); islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
offset += 4; offset += 4;
} while (!(islast & 0x80)); } while (!(islast & 0x80));
} }
@ -963,9 +954,8 @@ dissect_fcdns_gpnft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else { else {
do { do {
islast = tvb_get_guint8 (tvb, offset); islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_pname, proto_tree_add_item (req_tree, &hfi_fcdns_rply_pname,
tvb, offset+4, 8, ENC_NA); tvb, offset+4, 8, ENC_NA);
offset += 16; offset += 16;
@ -992,9 +982,8 @@ dissect_fcdns_gnnft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else { else {
do { do {
islast = tvb_get_guint8 (tvb, offset); islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_nname, proto_tree_add_item (req_tree, &hfi_fcdns_rply_nname,
tvb, offset+4, 8, ENC_NA); tvb, offset+4, 8, ENC_NA);
offset += 16; offset += 16;
@ -1021,9 +1010,8 @@ dissect_fcdns_gidpt (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else { else {
do { do {
islast = tvb_get_guint8 (tvb, offset); islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
offset += 4; offset += 4;
} while (!(islast & 0x80)); } while (!(islast & 0x80));
} }
@ -1044,9 +1032,8 @@ dissect_fcdns_gidipp (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else { else {
do { do {
islast = tvb_get_guint8 (tvb, offset); islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
offset += 4; offset += 4;
} while (!(islast & 0x80)); } while (!(islast & 0x80));
} }
@ -1070,9 +1057,8 @@ dissect_fcdns_gidff (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else { else {
do { do {
islast = tvb_get_guint8 (tvb, offset); islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
offset += 4; offset += 4;
} while (!(islast & 0x80)); } while (!(islast & 0x80));
} }
@ -1086,9 +1072,8 @@ dissect_fcdns_rpnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) { if (req_tree) {
if (isreq) { if (isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, proto_tree_add_item (req_tree, &hfi_fcdns_req_portid,
tvb, offset+1, 3, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_req_pname, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_req_pname, tvb,
offset+4, 8, ENC_NA); offset+4, 8, ENC_NA);
} }
@ -1102,9 +1087,8 @@ dissect_fcdns_rnnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) { if (req_tree) {
if (isreq) { if (isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, proto_tree_add_item (req_tree, &hfi_fcdns_req_portid,
tvb, offset+1, 3, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_req_nname, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_req_nname, tvb,
offset+4, 8, ENC_NA); offset+4, 8, ENC_NA);
} }
@ -1117,9 +1101,8 @@ dissect_fcdns_rcsid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
int offset = 16; /* past the fc_ct header */ int offset = 16; /* past the fc_ct header */
if (req_tree && isreq) { if (req_tree && isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
dissect_cos_flags(req_tree, tvb, offset+4, &hfi_fcdns_req_cos); dissect_cos_flags(req_tree, tvb, offset+4, &hfi_fcdns_req_cos);
} }
} }
@ -1129,10 +1112,9 @@ dissect_fcdns_rptid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
{ {
int offset = 16; /* past the fc_ct header */ int offset = 16; /* past the fc_ct header */
if (req_tree && isreq) { if (isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_req_ptype, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_req_ptype, tvb,
offset+4, 1, ENC_BIG_ENDIAN); offset+4, 1, ENC_BIG_ENDIAN);
} }
@ -1143,10 +1125,9 @@ dissect_fcdns_rftid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
{ {
int offset = 16; /* past the fc_ct header */ int offset = 16; /* past the fc_ct header */
if (req_tree && isreq) { if (isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
dissect_fc4type(req_tree, tvb, offset+4, &hfi_fcdns_req_fc4types); dissect_fc4type(req_tree, tvb, offset+4, &hfi_fcdns_req_fc4types);
} }
} }
@ -1158,9 +1139,8 @@ dissect_fcdns_rspnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
guint8 len; guint8 len;
if (req_tree && isreq) { if (req_tree && isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_req_spnamelen, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_req_spnamelen, tvb,
offset+4, 1, ENC_BIG_ENDIAN); offset+4, 1, ENC_BIG_ENDIAN);
len = tvb_get_guint8 (tvb, offset+4); len = tvb_get_guint8 (tvb, offset+4);
@ -1175,10 +1155,9 @@ dissect_fcdns_rippid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
{ {
int offset = 16; /* past the fc_ct header */ int offset = 16; /* past the fc_ct header */
if (req_tree && isreq) { if (isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_req_ip, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_req_ip, tvb,
offset+4, 16, ENC_NA); offset+4, 16, ENC_NA);
} }
@ -1190,10 +1169,9 @@ dissect_fcdns_rfdid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
int offset = 16; /* past the fc_ct header */ int offset = 16; /* past the fc_ct header */
int len; int len;
if (req_tree && isreq) { if (isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
dissect_fc4type(req_tree, tvb, offset+4, &hfi_fcdns_req_fc4types); dissect_fc4type(req_tree, tvb, offset+4, &hfi_fcdns_req_fc4types);
offset += 36; offset += 36;
@ -1215,9 +1193,8 @@ dissect_fcdns_rffid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
{ {
int offset = 16; /* past the fc_ct header */ int offset = 16; /* past the fc_ct header */
if (req_tree && isreq) { if (isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, offset+1, 3, proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
dissect_fc4features_and_type(req_tree, tvb, offset+6); dissect_fc4features_and_type(req_tree, tvb, offset+6);
} }
} }
@ -1255,9 +1232,8 @@ dissect_fcdns_daid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
{ {
int offset = 16; /* past the fc_ct header */ int offset = 16; /* past the fc_ct header */
if (req_tree && isreq) { if (isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, offset+1, 3, proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
} }
} }
@ -1326,12 +1302,10 @@ dissect_fcdns_swils_entries (tvbuff_t *tvb, proto_tree *tree, int offset)
objfmt = tvb_get_guint8 (tvb, offset); objfmt = tvb_get_guint8 (tvb, offset);
proto_tree_add_item (tree, &hfi_fcdns_sw2_objfmt, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (tree, &hfi_fcdns_sw2_objfmt, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_string (tree, &hfi_fcdns_rply_ownerid, tvb, offset+1, proto_tree_add_item (tree, &hfi_fcdns_rply_ownerid, tvb, offset+1, 3, ENC_NA);
3, tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (tree, &hfi_fcdns_rply_ptype, tvb, offset+4, proto_tree_add_item (tree, &hfi_fcdns_rply_ptype, tvb, offset+4,
1, ENC_BIG_ENDIAN); 1, ENC_BIG_ENDIAN);
proto_tree_add_string (tree, &hfi_fcdns_rply_portid, tvb, offset+5, 3, proto_tree_add_item (tree, &hfi_fcdns_rply_portid, tvb, offset+5, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+5));
proto_tree_add_item (tree, &hfi_fcdns_rply_pname, tvb, offset+8, 8, ENC_NA); proto_tree_add_item (tree, &hfi_fcdns_rply_pname, tvb, offset+8, 8, ENC_NA);
offset += 16; offset += 16;
if (!(objfmt & 0x1)) { if (!(objfmt & 0x1)) {
@ -1361,8 +1335,8 @@ dissect_fcdns_swils_entries (tvbuff_t *tvb, proto_tree *tree, int offset)
16, ENC_NA); 16, ENC_NA);
proto_tree_add_item (tree, &hfi_fcdns_rply_fpname, tvb, offset+76, proto_tree_add_item (tree, &hfi_fcdns_rply_fpname, tvb, offset+76,
8, ENC_NA); 8, ENC_NA);
proto_tree_add_string (tree, &hfi_fcdns_rply_hrdaddr, tvb, offset+85, proto_tree_add_item (tree, &hfi_fcdns_rply_hrdaddr, tvb, offset+85,
3, tvb_fc_to_str (tvb, offset+85)); 3, ENC_NA);
offset += 88; offset += 88;
if (objfmt & 0x2) { if (objfmt & 0x2) {
dissect_fc4features(tree, tvb, offset); dissect_fc4features(tree, tvb, offset);
@ -1393,10 +1367,7 @@ dissect_fcdns_geid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
int offset = 16; /* past the fc_ct header */ int offset = 16; /* past the fc_ct header */
if (isreq) { if (isreq) {
if (req_tree) { proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb, offset+1, 3, ENC_NA);
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, offset+1,
3, tvb_fc_to_str (tvb, offset+1));
}
} }
else { else {
dissect_fcdns_swils_entries (tvb, req_tree, offset); dissect_fcdns_swils_entries (tvb, req_tree, offset);

View File

@ -1262,8 +1262,7 @@ dissect_fcels_logout (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
return; return;
} }
proto_tree_add_string (logo_tree, hf_fcels_nportid, tvb, offset, 3, proto_tree_add_item (logo_tree, hf_fcels_nportid, tvb, offset, 3, ENC_NA);
tvb_fc_to_str (tvb, offset));
proto_tree_add_item (logo_tree, hf_fcels_npname, tvb, offset+3, 6, ENC_NA); proto_tree_add_item (logo_tree, hf_fcels_npname, tvb, offset+3, 6, ENC_NA);
} }
} }
@ -1286,8 +1285,7 @@ dissect_fcels_abtx (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
} }
proto_tree_add_item(abtx_tree, hf_fcels_recovery_qualifier_status, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(abtx_tree, hf_fcels_recovery_qualifier_status, tvb, offset+4, 1, ENC_BIG_ENDIAN);
proto_tree_add_string (abtx_tree, hf_fcels_nportid, tvb, offset+5, 3, proto_tree_add_item (abtx_tree, hf_fcels_nportid, tvb, offset+5, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+5));
proto_tree_add_item (abtx_tree, hf_fcels_oxid, tvb, offset+8, 2, ENC_BIG_ENDIAN); proto_tree_add_item (abtx_tree, hf_fcels_oxid, tvb, offset+8, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (abtx_tree, hf_fcels_rxid, tvb, offset+10, 2, ENC_BIG_ENDIAN); proto_tree_add_item (abtx_tree, hf_fcels_rxid, tvb, offset+10, 2, ENC_BIG_ENDIAN);
} }
@ -1309,8 +1307,7 @@ dissect_fcels_rsi (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
return; return;
proto_tree_add_item (rsi_tree, hf_fcels_recovqual, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rsi_tree, hf_fcels_recovqual, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_string (rsi_tree, hf_fcels_nportid, tvb, offset+1, 3, proto_tree_add_item (rsi_tree, hf_fcels_nportid, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (rsi_tree, hf_fcels_rxid, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item (rsi_tree, hf_fcels_rxid, tvb, offset+4, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (rsi_tree, hf_fcels_oxid, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_item (rsi_tree, hf_fcels_oxid, tvb, offset+6, 2, ENC_BIG_ENDIAN);
} }
@ -1331,8 +1328,7 @@ dissect_fcels_rrq (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
if (!isreq) if (!isreq)
return; return;
proto_tree_add_string (rrq_tree, hf_fcels_nportid, tvb, offset+5, 3, proto_tree_add_item (rrq_tree, hf_fcels_nportid, tvb, offset+5, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+5));
proto_tree_add_item (rrq_tree, hf_fcels_oxid, tvb, offset+8, 2, ENC_BIG_ENDIAN); proto_tree_add_item (rrq_tree, hf_fcels_oxid, tvb, offset+8, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (rrq_tree, hf_fcels_rxid, tvb, offset+10, 2, ENC_BIG_ENDIAN); proto_tree_add_item (rrq_tree, hf_fcels_rxid, tvb, offset+10, 2, ENC_BIG_ENDIAN);
} }
@ -1352,9 +1348,8 @@ dissect_fcels_rec (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
proto_tree_add_item (rec_tree, hf_fcels_opcode, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (rec_tree, hf_fcels_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
if (isreq) { if (isreq) {
proto_tree_add_string (rec_tree, hf_fcels_nportid, tvb, proto_tree_add_item (rec_tree, hf_fcels_nportid, tvb,
offset+5, 3, offset+5, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+5));
proto_tree_add_item (rec_tree, hf_fcels_oxid, tvb, proto_tree_add_item (rec_tree, hf_fcels_oxid, tvb,
offset+8, 2, ENC_BIG_ENDIAN); offset+8, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (rec_tree, hf_fcels_rxid, tvb, proto_tree_add_item (rec_tree, hf_fcels_rxid, tvb,
@ -1364,12 +1359,10 @@ dissect_fcels_rec (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
offset+4, 2, ENC_BIG_ENDIAN); offset+4, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (rec_tree, hf_fcels_rxid, tvb, proto_tree_add_item (rec_tree, hf_fcels_rxid, tvb,
offset+6, 2, ENC_BIG_ENDIAN); offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_string (rec_tree, hf_fcels_nportid, tvb, proto_tree_add_item (rec_tree, hf_fcels_nportid, tvb,
offset+9, 3, offset+9, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+9)); proto_tree_add_item (rec_tree, hf_fcels_resportid, tvb,
proto_tree_add_string (rec_tree, hf_fcels_resportid, tvb, offset+13, 3, ENC_NA);
offset+13, 3,
tvb_fc_to_str (tvb, offset+13));
proto_tree_add_item (rec_tree, hf_fcels_rec_fc4, tvb, proto_tree_add_item (rec_tree, hf_fcels_rec_fc4, tvb,
offset+16, 4, ENC_BIG_ENDIAN); offset+16, 4, ENC_BIG_ENDIAN);
proto_tree_add_bitmask (rec_tree, tvb, offset+20, hf_fcels_estat, proto_tree_add_bitmask (rec_tree, tvb, offset+20, hf_fcels_estat,
@ -1406,12 +1399,10 @@ dissect_fcels_adisc (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
proto_tree_add_item (adisc_tree, hf_fcels_opcode, tvb, offset-5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (adisc_tree, hf_fcels_opcode, tvb, offset-5, 1, ENC_BIG_ENDIAN);
proto_tree_add_string (adisc_tree, hf_fcels_hardaddr, tvb, offset, 3, proto_tree_add_item (adisc_tree, hf_fcels_hardaddr, tvb, offset, 3, ENC_NA);
tvb_fc_to_str (tvb, offset));
proto_tree_add_item (adisc_tree, hf_fcels_npname, tvb, offset+3, 8, ENC_NA); proto_tree_add_item (adisc_tree, hf_fcels_npname, tvb, offset+3, 8, ENC_NA);
proto_tree_add_item (adisc_tree, hf_fcels_fnname, tvb, offset+11, 8, ENC_NA); proto_tree_add_item (adisc_tree, hf_fcels_fnname, tvb, offset+11, 8, ENC_NA);
proto_tree_add_string (adisc_tree, hf_fcels_nportid, tvb, offset+20, 3, proto_tree_add_item (adisc_tree, hf_fcels_nportid, tvb, offset+20, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+20));
} }
} }
@ -1430,12 +1421,12 @@ dissect_fcels_farp (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
proto_tree_add_item (farp_tree, hf_fcels_farp_matchcodept, proto_tree_add_item (farp_tree, hf_fcels_farp_matchcodept,
tvb, offset, 1, ENC_BIG_ENDIAN); tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_string (farp_tree, hf_fcels_nportid, tvb, offset+1, proto_tree_add_item (farp_tree, hf_fcels_nportid, tvb, offset+1,
3, tvb_fc_to_str (tvb, offset+1)); 3, ENC_NA);
proto_tree_add_item (farp_tree, hf_fcels_farp_respaction, tvb, proto_tree_add_item (farp_tree, hf_fcels_farp_respaction, tvb,
offset+4, 1, ENC_BIG_ENDIAN); offset+4, 1, ENC_BIG_ENDIAN);
proto_tree_add_string (farp_tree, hf_fcels_resportid, tvb, offset+5, proto_tree_add_item (farp_tree, hf_fcels_resportid, tvb, offset+5,
3, tvb_fc_to_str (tvb, offset+5)); 3, ENC_NA);
proto_tree_add_item (farp_tree, hf_fcels_npname, tvb, offset+8, 8, ENC_NA); proto_tree_add_item (farp_tree, hf_fcels_npname, tvb, offset+8, 8, ENC_NA);
proto_tree_add_item (farp_tree, hf_fcels_fnname, tvb, offset+16, 8, ENC_NA); proto_tree_add_item (farp_tree, hf_fcels_fnname, tvb, offset+16, 8, ENC_NA);
proto_tree_add_item (farp_tree, hf_fcels_respname, tvb, offset+24, proto_tree_add_item (farp_tree, hf_fcels_respname, tvb, offset+24,
@ -1546,7 +1537,7 @@ dissect_fcels_rpl (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
ett_fcels_rplpb, NULL, "Port Block %u", loop); ett_fcels_rplpb, NULL, "Port Block %u", loop);
proto_tree_add_item(pb_tree, hf_fcels_rpl_physical_port, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(pb_tree, hf_fcels_rpl_physical_port, tvb, offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_string(pb_tree, hf_fcels_rpl_port_identifier, tvb, offset+5, 3, tvb_fc_to_str (tvb, offset+5)); proto_tree_add_item(pb_tree, hf_fcels_rpl_port_identifier, tvb, offset+5, 3, ENC_NA);
proto_tree_add_item(pb_tree, hf_fcels_rpl_port_name, tvb, offset+8, 8, ENC_NA); proto_tree_add_item(pb_tree, hf_fcels_rpl_port_name, tvb, offset+8, 8, ENC_NA);
offset += 16; offset += 16;
} }
@ -1567,8 +1558,7 @@ dissect_fcels_fan (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
proto_tree_add_item (fan_tree, hf_fcels_opcode, tvb, offset-5, 1, ENC_BIG_ENDIAN); proto_tree_add_item (fan_tree, hf_fcels_opcode, tvb, offset-5, 1, ENC_BIG_ENDIAN);
proto_tree_add_string (fan_tree, hf_fcels_fabricaddr, tvb, offset, 3, proto_tree_add_item (fan_tree, hf_fcels_fabricaddr, tvb, offset, 3, ENC_NA);
tvb_fc_to_str (tvb, offset));
proto_tree_add_item (fan_tree, hf_fcels_fabricpname, tvb, offset+3, proto_tree_add_item (fan_tree, hf_fcels_fabricpname, tvb, offset+3,
8, ENC_NA); 8, ENC_NA);
proto_tree_add_item (fan_tree, hf_fcels_fnname, tvb, offset+11, 8, ENC_NA); proto_tree_add_item (fan_tree, hf_fcels_fnname, tvb, offset+11, 8, ENC_NA);
@ -1754,7 +1744,7 @@ dissect_fcels_prlilo_payload (tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree_add_item(svcpg_tree, hf_fcels_prlilo_service_parameter_response, tvb, offset+12, 4, ENC_BIG_ENDIAN); proto_tree_add_item(svcpg_tree, hf_fcels_prlilo_service_parameter_response, tvb, offset+12, 4, ENC_BIG_ENDIAN);
} }
else if (opcode == FC_ELS_TPRLO) { else if (opcode == FC_ELS_TPRLO) {
proto_tree_add_string(svcpg_tree, hf_fcels_prlilo_3rd_party_n_port_id, tvb, offset+13, 3, tvb_fc_to_str (tvb, offset+13)); proto_tree_add_item(svcpg_tree, hf_fcels_prlilo_3rd_party_n_port_id, tvb, offset+13, 3, ENC_NA);
} }
} }
} }
@ -1835,7 +1825,7 @@ dissect_fcels_srl (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
return; return;
proto_tree_add_item(srl_tree, hf_fcels_srl_flag, tvb, offset, 1, ENC_NA); proto_tree_add_item(srl_tree, hf_fcels_srl_flag, tvb, offset, 1, ENC_NA);
proto_tree_add_string(srl_tree, hf_fcels_srl_fl_port_addr, tvb, offset+1, 3, tvb_fc_to_str (tvb, offset+1)); proto_tree_add_item(srl_tree, hf_fcels_srl_fl_port_addr, tvb, offset+1, 3, ENC_NA);
} }
} }
@ -2386,7 +2376,7 @@ proto_register_fcels (void)
{"Open Seq Per Exchg", "fcels.logi.openseq", FT_UINT8, BASE_DEC, NULL, 0x0, {"Open Seq Per Exchg", "fcels.logi.openseq", FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}}, NULL, HFILL}},
{ &hf_fcels_nportid, { &hf_fcels_nportid,
{"Originator S_ID", "fcels.portid", FT_STRING, BASE_NONE, NULL, 0x0, {"Originator S_ID", "fcels.portid", FT_BYTES, BASE_DOT, NULL, 0x0,
NULL, HFILL}}, NULL, HFILL}},
{ &hf_fcels_oxid, { &hf_fcels_oxid,
{"OXID", "fcels.oxid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}}, {"OXID", "fcels.oxid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},
@ -2396,7 +2386,7 @@ proto_register_fcels (void)
{"Recovery Qualifier", "fcels.rcovqual", FT_UINT8, BASE_HEX, NULL, {"Recovery Qualifier", "fcels.rcovqual", FT_UINT8, BASE_HEX, NULL,
0x0, NULL, HFILL}}, 0x0, NULL, HFILL}},
{ &hf_fcels_fabricaddr, { &hf_fcels_fabricaddr,
{"Fabric Address", "fcels.faddr", FT_STRING, BASE_NONE, NULL, 0x0, NULL, {"Fabric Address", "fcels.faddr", FT_BYTES, BASE_DOT, NULL, 0x0, NULL,
HFILL}}, HFILL}},
{ &hf_fcels_fabricpname, { &hf_fcels_fabricpname,
{"Fabric Port Name", "fcels.fpname", FT_FCWWN, BASE_NONE, NULL, 0x0, {"Fabric Port Name", "fcels.fpname", FT_FCWWN, BASE_NONE, NULL, 0x0,
@ -2429,7 +2419,7 @@ proto_register_fcels (void)
{"Responder Action", "fcels.respaction", FT_UINT8, BASE_HEX, {"Responder Action", "fcels.respaction", FT_UINT8, BASE_HEX,
VALS (fc_els_farp_respaction_val), 0x0, NULL, HFILL}}, VALS (fc_els_farp_respaction_val), 0x0, NULL, HFILL}},
{ &hf_fcels_resportid, { &hf_fcels_resportid,
{"Responding Port ID", "fcels.resportid", FT_STRING, BASE_NONE, {"Responding Port ID", "fcels.resportid", FT_BYTES, BASE_DOT,
NULL, 0x0, NULL, HFILL}}, NULL, 0x0, NULL, HFILL}},
{ &hf_fcels_respname, { &hf_fcels_respname,
{"Responding Port Name", "fcels.respname", FT_FCWWN, BASE_NONE, {"Responding Port Name", "fcels.respname", FT_FCWWN, BASE_NONE,
@ -2444,7 +2434,7 @@ proto_register_fcels (void)
{"Responding IP Address", "fcels.respipaddr", FT_IPv6, BASE_NONE, {"Responding IP Address", "fcels.respipaddr", FT_IPv6, BASE_NONE,
NULL, 0x0, NULL, HFILL}}, NULL, 0x0, NULL, HFILL}},
{ &hf_fcels_hardaddr, { &hf_fcels_hardaddr,
{"Hard Address of Originator", "fcels.hrdaddr", FT_STRING, BASE_NONE, {"Hard Address of Originator", "fcels.hrdaddr", FT_BYTES, BASE_DOT,
NULL, 0x0, NULL, HFILL}}, NULL, 0x0, NULL, HFILL}},
{ &hf_fcels_rps_flag, { &hf_fcels_rps_flag,
{"Flag", "fcels.flag", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, {"Flag", "fcels.flag", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},
@ -2726,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_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_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_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_STRING, BASE_NONE, 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_name, { "Port Name", "fcels.rpl.port_name", FT_FCWWN, BASE_NONE, 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_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 }}, { &hf_fcels_rscn_payload_len, { "Payload Len", "fcels.rscn.payload_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
@ -2745,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_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_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_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_STRING, BASE_NONE, 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_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_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_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_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_STRING, BASE_NONE, NULL, 0x0, 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_rpsc_number_of_entries, { "Number of Entries", "fcels.rpsc.number_of_entries", FT_UINT16, BASE_DEC, 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_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 }}, { &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

@ -183,8 +183,7 @@ dissect_fcfcs_gmid (tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
proto_tree_add_item (tree, hf_fcs_iename, tvb, offset, 8, ENC_NA); proto_tree_add_item (tree, hf_fcs_iename, tvb, offset, 8, ENC_NA);
} }
else { else {
proto_tree_add_string (tree, hf_fcs_mgmtid, tvb, offset+1, 3, proto_tree_add_item (tree, hf_fcs_mgmtid, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str (tvb, offset+1));
} }
} }
} }
@ -970,8 +969,8 @@ proto_register_fcfcs (void)
{"Interconnect Element Domain ID", "fcs.ie.domainid", FT_UINT8, {"Interconnect Element Domain ID", "fcs.ie.domainid", FT_UINT8,
BASE_HEX, NULL, 0x0, NULL, HFILL}}, BASE_HEX, NULL, 0x0, NULL, HFILL}},
{ &hf_fcs_mgmtid, { &hf_fcs_mgmtid,
{"Interconnect Element Mgmt. ID", "fcs.ie.mgmtid", FT_STRING, {"Interconnect Element Mgmt. ID", "fcs.ie.mgmtid", FT_BYTES,
BASE_NONE, NULL, 0x0, NULL, HFILL}}, BASE_DOT, NULL, 0x0, NULL, HFILL}},
{ &hf_fcs_fabricname, { &hf_fcs_fabricname,
{"Interconnect Element Fabric Name", "fcs.ie.fname", FT_FCWWN, {"Interconnect Element Fabric Name", "fcs.ie.fname", FT_FCWWN,
BASE_NONE, NULL, 0x0, NULL, HFILL}}, BASE_NONE, NULL, 0x0, NULL, HFILL}},

View File

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

View File

@ -1016,8 +1016,7 @@ dissect_swils_fspf_lsrechdr(tvbuff_t *tvb, proto_tree *tree, int offset)
static void static void
dissect_swils_fspf_ldrec(tvbuff_t *tvb, proto_tree *tree, int offset) dissect_swils_fspf_ldrec(tvbuff_t *tvb, proto_tree *tree, int offset)
{ {
proto_tree_add_string(tree, hf_swils_ldrec_linkid, tvb, offset, 4, proto_tree_add_item(tree, hf_swils_ldrec_linkid, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str(tvb, offset+1));
proto_tree_add_item(tree, hf_swils_ldrec_out_pidx, tvb, offset+5, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_swils_ldrec_out_pidx, tvb, offset+5, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_swils_ldrec_nbr_pidx, tvb, offset+9, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_swils_ldrec_nbr_pidx, tvb, offset+9, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_swils_ldrec_link_type, tvb, offset+12, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_swils_ldrec_link_type, tvb, offset+12, 1, ENC_BIG_ENDIAN);
@ -1138,8 +1137,8 @@ dissect_swils_rscn(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *rscn_tree,
1, ENC_BIG_ENDIAN); 1, ENC_BIG_ENDIAN);
proto_tree_add_item(rscn_tree, hf_swils_rscn_addrfmt, tvb, offset+4, proto_tree_add_item(rscn_tree, hf_swils_rscn_addrfmt, tvb, offset+4,
1, ENC_BIG_ENDIAN); 1, ENC_BIG_ENDIAN);
proto_tree_add_string(rscn_tree, hf_swils_rscn_affectedport, tvb, proto_tree_add_item(rscn_tree, hf_swils_rscn_affectedport, tvb,
offset+5, 3, tvb_fc_to_str(tvb, offset+5)); offset+5, 3, ENC_NA);
proto_tree_add_item(rscn_tree, hf_swils_rscn_detectfn, tvb, proto_tree_add_item(rscn_tree, hf_swils_rscn_detectfn, tvb,
offset+8, 4, ENC_BIG_ENDIAN); offset+8, 4, ENC_BIG_ENDIAN);
numrec = tvb_get_ntohl(tvb, offset+12); numrec = tvb_get_ntohl(tvb, offset+12);
@ -1157,8 +1156,7 @@ dissect_swils_rscn(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *rscn_tree,
ett_fcswils_rscn_dev, NULL, "Device Entry %d", i); ett_fcswils_rscn_dev, NULL, "Device Entry %d", i);
proto_tree_add_item(dev_tree, hf_swils_rscn_portstate, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(dev_tree, hf_swils_rscn_portstate, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_string(dev_tree, hf_swils_rscn_portid, tvb, offset+1, 3, proto_tree_add_item(dev_tree, hf_swils_rscn_portid, tvb, offset+1, 3, ENC_NA);
tvb_fc_to_str(tvb, offset+1));
proto_tree_add_item(dev_tree, hf_swils_rscn_pwwn, tvb, offset+4, 8, ENC_NA); proto_tree_add_item(dev_tree, hf_swils_rscn_pwwn, tvb, offset+4, 8, ENC_NA);
proto_tree_add_item(dev_tree, hf_swils_rscn_nwwn, tvb, offset+12, 8, ENC_NA); proto_tree_add_item(dev_tree, hf_swils_rscn_nwwn, tvb, offset+12, 8, ENC_NA);
offset += 20; offset += 20;
@ -2090,7 +2088,7 @@ proto_register_fcswils(void)
{ &hf_swils_ldrec_linkid, { &hf_swils_ldrec_linkid,
{"Link ID", "swils.ldr.linkid", {"Link ID", "swils.ldr.linkid",
FT_STRING, BASE_NONE, NULL, 0x0, FT_BYTES, BASE_DOT, NULL, 0x0,
NULL, HFILL}}, NULL, HFILL}},
{ &hf_swils_ldrec_out_pidx, { &hf_swils_ldrec_out_pidx,
@ -2125,7 +2123,7 @@ proto_register_fcswils(void)
{ &hf_swils_rscn_affectedport, { &hf_swils_rscn_affectedport,
{"Affected Port ID", "swils.rscn.affectedport", {"Affected Port ID", "swils.rscn.affectedport",
FT_STRING, BASE_NONE, NULL, 0x0, FT_BYTES, BASE_DOT, NULL, 0x0,
NULL, HFILL}}, NULL, HFILL}},
{ &hf_swils_rscn_detectfn, { &hf_swils_rscn_detectfn,
@ -2140,7 +2138,7 @@ proto_register_fcswils(void)
{ &hf_swils_rscn_portid, { &hf_swils_rscn_portid,
{"Port Id", "swils.rscn.portid", {"Port Id", "swils.rscn.portid",
FT_STRING, BASE_NONE, NULL, 0x0, FT_BYTES, BASE_DOT, NULL, 0x0,
NULL, HFILL}}, NULL, HFILL}},
{ &hf_swils_rscn_pwwn, { &hf_swils_rscn_pwwn,

View File

@ -352,7 +352,6 @@ dissect_fip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint val; guint val;
tvbuff_t *desc_tvb; tvbuff_t *desc_tvb;
const char *info; const char *info;
const char *text;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FIP"); col_set_str(pinfo->cinfo, COL_PROTOCOL, "FIP");
col_clear(pinfo->cinfo, COL_INFO); col_clear(pinfo->cinfo, COL_INFO);
@ -458,10 +457,9 @@ dissect_fip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break; break;
case FIP_DT_MAP_OUI: case FIP_DT_MAP_OUI:
subtree = fip_desc_type_len(fip_tree, desc_tvb, dtype, ett_fip_dt_map, &item); subtree = fip_desc_type_len(fip_tree, desc_tvb, dtype, ett_fip_dt_map, &item);
text = tvb_fc_to_str(desc_tvb, 5); proto_tree_add_item(subtree, hf_fip_desc_map, desc_tvb,
proto_tree_add_string(subtree, hf_fip_desc_map, desc_tvb, 5, 3, ENC_NA);
5, 3, text); proto_item_append_text(item, "%s", tvb_fc_to_str(desc_tvb, 5));
proto_item_append_text(item, "%s", text);
break; break;
case FIP_DT_NAME: case FIP_DT_NAME:
subtree = fip_desc_type_len(fip_tree, desc_tvb, dtype, ett_fip_dt_name, &item); subtree = fip_desc_type_len(fip_tree, desc_tvb, dtype, ett_fip_dt_name, &item);
@ -472,9 +470,8 @@ dissect_fip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
subtree = fip_desc_type_len(fip_tree, desc_tvb, dtype, ett_fip_dt_fab, &item); subtree = fip_desc_type_len(fip_tree, desc_tvb, dtype, ett_fip_dt_fab, &item);
proto_tree_add_item(subtree, hf_fip_desc_fab_vfid, desc_tvb, proto_tree_add_item(subtree, hf_fip_desc_fab_vfid, desc_tvb,
2, 2, ENC_BIG_ENDIAN); 2, 2, ENC_BIG_ENDIAN);
text = tvb_fc_to_str(desc_tvb, 5); proto_tree_add_item(subtree, hf_fip_desc_fab_map, desc_tvb,
proto_tree_add_string(subtree, hf_fip_desc_fab_map, desc_tvb, 5, 3, ENC_NA);
5, 3, text);
proto_tree_add_item(subtree, hf_fip_desc_fab_name, desc_tvb, 8, 8, ENC_NA); proto_tree_add_item(subtree, hf_fip_desc_fab_name, desc_tvb, 8, 8, ENC_NA);
proto_item_append_text(item, "%s", tvb_fcwwn_to_str(desc_tvb, 8)); proto_item_append_text(item, "%s", tvb_fcwwn_to_str(desc_tvb, 8));
break; break;
@ -658,7 +655,7 @@ proto_register_fip(void)
{ &hf_fip_desc_map, { &hf_fip_desc_map,
{ "FC-MAP-OUI", "fip.map", { "FC-MAP-OUI", "fip.map",
FT_STRING, BASE_NONE, NULL, 0, FT_BYTES, BASE_DOT, NULL, 0,
NULL, HFILL}}, NULL, HFILL}},
{ &hf_fip_desc_name, { &hf_fip_desc_name,
@ -673,7 +670,7 @@ proto_register_fip(void)
{ &hf_fip_desc_fab_map, { &hf_fip_desc_fab_map,
{ "FC-MAP", "fip.fab.map", { "FC-MAP", "fip.fab.map",
FT_STRING, BASE_NONE, NULL, 0, FT_BYTES, BASE_DOT, NULL, 0,
NULL, HFILL}}, NULL, HFILL}},
{ &hf_fip_desc_fab_name, { &hf_fip_desc_fab_name,

View File

@ -259,8 +259,7 @@ dissect_hello_mt_port_cap_spb_bvid_tuples_clv(tvbuff_t *tvb, packet_info* pinfo,
return; return;
} }
else { else {
proto_tree_add_bytes_format_value(subtree, hf_isis_hello_ect, tvb, subofs, 4, NULL, proto_tree_add_item( subtree, hf_isis_hello_ect, tvb, subofs, 4, ENC_NA);
"%s", tvb_bytes_to_ep_str_punct(tvb, subofs, 4, '-'));
proto_tree_add_item( subtree, hf_isis_hello_bvid, tvb, subofs+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item( subtree, hf_isis_hello_bvid, tvb, subofs+4, 2, ENC_BIG_ENDIAN);
proto_tree_add_item( subtree, hf_isis_hello_bvid_u, tvb, subofs+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item( subtree, hf_isis_hello_bvid_u, tvb, subofs+4, 2, ENC_BIG_ENDIAN);
proto_tree_add_item( subtree, hf_isis_hello_bvid_m, tvb, subofs+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item( subtree, hf_isis_hello_bvid_m, tvb, subofs+4, 2, ENC_BIG_ENDIAN);
@ -1391,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_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_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_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_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_isis_hello_ect, { "ECT", "isis.hello.ect", FT_BYTES, BASE_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, { "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_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 }}, { &hf_isis_hello_bvid_m, { "M", "isis.hello.bvid.m", FT_UINT16, BASE_HEX_DEC, NULL, 0x0004, NULL, HFILL }},

View File

@ -1031,6 +1031,7 @@ static int hf_mip6_ni_cni = -1;
static int hf_mip6_bad_auth = -1; static int hf_mip6_bad_auth = -1;
static int hf_fmip6_lla = -1;
static int hf_fmip6_lla_optcode = -1; static int hf_fmip6_lla_optcode = -1;
static int hf_mip6_mnid_subtype = -1; static int hf_mip6_mnid_subtype = -1;
@ -1979,7 +1980,7 @@ dissect_fmip6_opt_lla(const mip6_opt *optp _U_, tvbuff_t *tvb, int offset,
proto_tree *opt_tree, proto_item *hdr_item _U_ ) proto_tree *opt_tree, proto_item *hdr_item _U_ )
{ {
proto_tree *field_tree; proto_tree *field_tree;
int len, p; int len;
field_tree = proto_tree_add_subtree(opt_tree, tvb, offset, optlen, *optp->subtree_index, NULL, optp->name); field_tree = proto_tree_add_subtree(opt_tree, tvb, offset, optlen, *optp->subtree_index, NULL, optp->name);
@ -1988,13 +1989,10 @@ dissect_fmip6_opt_lla(const mip6_opt *optp _U_, tvbuff_t *tvb, int offset,
proto_tree_add_item(field_tree, hf_fmip6_lla_optcode, tvb, proto_tree_add_item(field_tree, hf_fmip6_lla_optcode, tvb,
offset + FMIP6_LLA_OPTCODE_OFF, FMIP6_LLA_OPTCODE_LEN, ENC_BIG_ENDIAN); offset + FMIP6_LLA_OPTCODE_OFF, FMIP6_LLA_OPTCODE_LEN, ENC_BIG_ENDIAN);
p = offset + FMIP6_LLA_LLA_OFF;
len = optlen - FMIP6_LLA_LLA_OFF; len = optlen - FMIP6_LLA_LLA_OFF;
if (len > 0) { if (len > 0) {
proto_tree_add_text(field_tree, tvb, proto_tree_add_item(field_tree, hf_fmip6_lla, tvb, offset + FMIP6_LLA_LLA_OFF, len, ENC_NA);
p, len, "Link-layer address: %s",
tvb_bytes_to_ep_str_punct(tvb, p, len, ':'));
} }
} }
@ -4382,6 +4380,12 @@ proto_register_mip6(void)
NULL, HFILL } NULL, HFILL }
}, },
{ &hf_fmip6_lla,
{ "Link-layer address", "mip6.lla",
FT_BYTES, BASE_SEMICOLON, NULL, 0,
NULL, HFILL }
},
{ &hf_fmip6_lla_optcode, { &hf_fmip6_lla_optcode,
{ "Option-Code", "mip6.lla.optcode", { "Option-Code", "mip6.lla.optcode",
FT_UINT8, BASE_DEC, VALS(fmip6_lla_optcode_value), 0, FT_UINT8, BASE_DEC, VALS(fmip6_lla_optcode_value), 0,

View File

@ -5334,10 +5334,9 @@ dissect_ipv6cp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static void static void
dissect_ipv6cp_if_id_opt(const ip_tcp_opt *optp _U_, tvbuff_t *tvb, int offset, dissect_ipv6cp_if_id_opt(const ip_tcp_opt *optp _U_, tvbuff_t *tvb, int offset,
guint length, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) guint length _U_, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{ {
proto_tree_add_bytes_format_value(tree, hf_ipv6cp_interface_identifier, tvb, offset+2, length-2, proto_tree_add_item(tree, hf_ipv6cp_interface_identifier, tvb, offset+2, 8, ENC_NA);
NULL, "%s", tvb_bytes_to_ep_str_punct(tvb, offset+2, 8, ':'));
} }
void void
@ -6750,7 +6749,7 @@ proto_register_ipv6cp(void)
{ {
static hf_register_info hf[] = { static hf_register_info hf[] = {
/* Generated from convert_proto_tree_add_text.pl */ /* Generated from convert_proto_tree_add_text.pl */
{ &hf_ipv6cp_interface_identifier, { "Interface Identifier", "ipv6cp.interface_identifier", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ipv6cp_interface_identifier, { "Interface Identifier", "ipv6cp.interface_identifier", FT_BYTES, BASE_SEMICOLON, NULL, 0x0, NULL, HFILL }},
}; };
static gint *ett[] = { static gint *ett[] = {
&ett_ipv6cp, &ett_ipv6cp,

View File

@ -1201,7 +1201,6 @@ static void dissect_zcl_part_trasfpartframe(tvbuff_t *tvb, proto_tree *tree, gui
guint8 options; guint8 options;
guint16 u16len; guint16 u16len;
guint8 frame_len; guint8 frame_len;
guint8 *data_frame;
static const int * part_opt[] = { static const int * part_opt[] = {
&hf_zbee_zcl_part_opt_first_block, &hf_zbee_zcl_part_opt_first_block,
@ -1238,8 +1237,7 @@ static void dissect_zcl_part_trasfpartframe(tvbuff_t *tvb, proto_tree *tree, gui
*offset += 1; *offset += 1;
/* Retrieve "PartitionedFrame" field */ /* Retrieve "PartitionedFrame" field */
data_frame = tvb_bytes_to_ep_str_punct(tvb, *offset, frame_len, ':'); proto_tree_add_item(tree, hf_zbee_zcl_part_part_frame, tvb, *offset, frame_len, ENC_NA);
proto_tree_add_string(tree, hf_zbee_zcl_part_part_frame, tvb, *offset, frame_len, data_frame);
*offset += frame_len; *offset += frame_len;
} /*dissect_zcl_part_trasfpartframe*/ } /*dissect_zcl_part_trasfpartframe*/
@ -1457,7 +1455,7 @@ void proto_register_zbee_zcl_part(void)
0x00, NULL, HFILL } }, 0x00, NULL, HFILL } },
{ &hf_zbee_zcl_part_part_frame, { &hf_zbee_zcl_part_part_frame,
{ "Partition Frame", "zbee_zcl_general.part.part_frame", FT_STRING, BASE_NONE, NULL, { "Partition Frame", "zbee_zcl_general.part.part_frame", FT_BYTES, BASE_SEMICOLON, NULL,
0x00, NULL, HFILL } }, 0x00, NULL, HFILL } },
{ &hf_zbee_zcl_part_partitioned_cluster_id, { &hf_zbee_zcl_part_partitioned_cluster_id,
@ -2155,7 +2153,6 @@ dissect_zcl_ota_imageblockrsp(tvbuff_t *tvb, proto_tree *tree, guint *offset)
{ {
guint8 status; guint8 status;
guint8 data_size; guint8 data_size;
guint8 *image_data;
/* Retrieve 'Status' field */ /* Retrieve 'Status' field */
status = tvb_get_guint8(tvb, *offset); status = tvb_get_guint8(tvb, *offset);
@ -2184,8 +2181,7 @@ dissect_zcl_ota_imageblockrsp(tvbuff_t *tvb, proto_tree *tree, guint *offset)
*offset += 1; *offset += 1;
/* Retrieve 'Image Data' field */ /* Retrieve 'Image Data' field */
image_data = tvb_bytes_to_ep_str_punct(tvb, *offset, data_size, ':'); proto_tree_add_item(tree, hf_zbee_zcl_ota_image_data, tvb, *offset, data_size, ENC_NA);
proto_tree_add_string(tree, hf_zbee_zcl_ota_image_data, tvb, *offset, data_size, image_data);
*offset += data_size; *offset += data_size;
} }
else if (status == ZBEE_ZCL_STAT_OTA_WAIT_FOR_DATA) { else if (status == ZBEE_ZCL_STAT_OTA_WAIT_FOR_DATA) {
@ -2667,7 +2663,7 @@ void proto_register_zbee_zcl_ota(void)
0x00, NULL, HFILL } }, 0x00, NULL, HFILL } },
{ &hf_zbee_zcl_ota_image_data, { &hf_zbee_zcl_ota_image_data,
{ "Image Data", "zbee_zcl_general.ota.image.data", FT_STRING, BASE_NONE, NULL, { "Image Data", "zbee_zcl_general.ota.image.data", FT_BYTES, BASE_SEMICOLON, NULL,
0x00, NULL, HFILL } } 0x00, NULL, HFILL } }
}; };

View File

@ -1254,7 +1254,6 @@ static void
dissect_zcl_appl_stats_log_rsp(tvbuff_t *tvb, proto_tree *tree, guint *offset) dissect_zcl_appl_stats_log_rsp(tvbuff_t *tvb, proto_tree *tree, guint *offset)
{ {
guint32 log_len; guint32 log_len;
guint8 *log_data;
/* Retrieve 'UTCTime' field */ /* Retrieve 'UTCTime' field */
proto_tree_add_item(tree, hf_zbee_zcl_appl_stats_utc_time, tvb, *offset, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_zbee_zcl_appl_stats_utc_time, tvb, *offset, 4, ENC_LITTLE_ENDIAN);
@ -1270,8 +1269,7 @@ dissect_zcl_appl_stats_log_rsp(tvbuff_t *tvb, proto_tree *tree, guint *offset)
*offset += 4; *offset += 4;
/* Retrieve 'Log Payload' field */ /* Retrieve 'Log Payload' field */
log_data = tvb_bytes_to_ep_str_punct(tvb, *offset, log_len, ':'); proto_tree_add_item(tree, hf_zbee_zcl_appl_stats_log_payload, tvb, *offset, log_len, ENC_NA);
proto_tree_add_string(tree, hf_zbee_zcl_appl_stats_log_payload, tvb, *offset, log_len, log_data);
*offset += log_len; *offset += log_len;
}/*dissect_zcl_appl_stats_log_rsp*/ }/*dissect_zcl_appl_stats_log_rsp*/
@ -1381,7 +1379,7 @@ proto_register_zbee_zcl_appl_stats(void)
0x0, NULL, HFILL } }, 0x0, NULL, HFILL } },
{ &hf_zbee_zcl_appl_stats_log_payload, { &hf_zbee_zcl_appl_stats_log_payload,
{ "Log Payload", "zbee_zcl_ha.applstats.log.payload", FT_STRING, BASE_NONE, NULL, { "Log Payload", "zbee_zcl_ha.applstats.log.payload", FT_BYTES, BASE_SEMICOLON, NULL,
0x00, NULL, HFILL } }, 0x00, NULL, HFILL } },
}; };

View File

@ -1786,10 +1786,8 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint
*offset += 1; *offset += 1;
attr_string = tvb_bytes_to_ep_str_punct(tvb, *offset, attr_uint, ':'); proto_tree_add_item(tree, hf_zbee_zcl_attr_ostr, tvb, *offset, attr_uint, ENC_NA);
proto_item_append_text(tree, ", Octets: %s", attr_string); proto_item_append_text(tree, ", Octets: %s", tvb_bytes_to_ep_str_punct(tvb, *offset, attr_uint, ':'));
proto_tree_add_string(tree, hf_zbee_zcl_attr_ostr, tvb, *offset, attr_uint,
attr_string);
*offset += attr_uint; *offset += attr_uint;
break; break;
@ -1821,9 +1819,8 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint
*offset += 2; *offset += 2;
attr_string = tvb_bytes_to_ep_str_punct(tvb, *offset, attr_uint, ':'); proto_tree_add_item(tree, hf_zbee_zcl_attr_ostr, tvb, *offset, attr_uint, ENC_NA);
proto_item_append_text(tree, ", Octets: %s", attr_string); proto_item_append_text(tree, ", Octets: %s", tvb_bytes_to_ep_str_punct(tvb, *offset, attr_uint, ':'));
proto_tree_add_string(tree, hf_zbee_zcl_attr_ostr, tvb, *offset, attr_uint, attr_string);
*offset += attr_uint; *offset += attr_uint;
break; break;
@ -2312,7 +2309,7 @@ void proto_register_zbee_zcl(void)
NULL, HFILL }}, NULL, HFILL }},
{ &hf_zbee_zcl_attr_ostr, { &hf_zbee_zcl_attr_ostr,
{ "Octet String", "zbee_zcl.attr.ostr", FT_STRING, BASE_NONE, NULL, 0x0, { "Octet String", "zbee_zcl.attr.ostr", FT_BYTES, BASE_SEMICOLON, NULL, 0x0,
NULL, HFILL }}, NULL, HFILL }},
{ &hf_zbee_zcl_attr_array_elements_type, { &hf_zbee_zcl_attr_array_elements_type,

View File

@ -56,15 +56,15 @@ bytes_fvalue_set(fvalue_t *fv, GByteArray *value)
} }
static int static int
bytes_repr_len(fvalue_t *fv, ftrepr_t rtype _U_) bytes_repr_len(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_)
{ {
if (fv->value.bytes->len == 0) { if (fv->value.bytes->len == 0) {
/* Empty array of bytes, so the representation /* Empty array of bytes, so the representation
* is an empty string. */ * is an empty string. */
return 0; return 0;
} else { } else {
/* 3 bytes for each byte of the byte "NN:" minus 1 byte /* 3 bytes for each byte of the byte "NN<separator character>" minus 1 byte
* as there's no trailing ":". */ * as there's no trailing "<separator character>". */
return fv->value.bytes->len * 3 - 1; return fv->value.bytes->len * 3 - 1;
} }
} }
@ -89,13 +89,13 @@ bytes_repr_len(fvalue_t *fv, ftrepr_t rtype _U_)
#define OID_REPR_LEN(fv) (1 + REL_OID_REPR_LEN(fv)) #define OID_REPR_LEN(fv) (1 + REL_OID_REPR_LEN(fv))
static int static int
oid_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_) oid_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
{ {
return OID_REPR_LEN(fv); return OID_REPR_LEN(fv);
} }
static void static void
oid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) oid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
const char* oid_str = oid_encoded2string(fv->value.bytes->data,fv->value.bytes->len); const char* oid_str = oid_encoded2string(fv->value.bytes->data,fv->value.bytes->len);
/* /*
@ -109,13 +109,13 @@ oid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
} }
static int static int
rel_oid_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_) rel_oid_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
{ {
return REL_OID_REPR_LEN(fv); return REL_OID_REPR_LEN(fv);
} }
static void static void
rel_oid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) rel_oid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
const char* oid_str = rel_oid_encoded2string(fv->value.bytes->data,fv->value.bytes->len); const char* oid_str = rel_oid_encoded2string(fv->value.bytes->data,fv->value.bytes->len);
/* /*
@ -130,17 +130,18 @@ rel_oid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
} }
static void static void
system_id_to_repr(fvalue_t *fv, ftrepr_t rtype, char *buf) system_id_to_repr(fvalue_t *fv, ftrepr_t rtype, int field_display, char *buf)
{ {
print_system_id_buf(fv->value.bytes->data,fv->value.bytes->len, buf, bytes_repr_len(fv, rtype)); print_system_id_buf(fv->value.bytes->data,fv->value.bytes->len, buf, bytes_repr_len(fv, rtype, field_display));
} }
static void static void
bytes_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) bytes_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display, char *buf)
{ {
guint8 *c; guint8 *c;
char *write_cursor; char *write_cursor;
unsigned int i; unsigned int i;
char separator;
c = fv->value.bytes->data; c = fv->value.bytes->data;
write_cursor = buf; write_cursor = buf;
@ -151,7 +152,21 @@ bytes_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
write_cursor += 2; write_cursor += 2;
} }
else { else {
sprintf(write_cursor, ":%02x", *c++); switch(field_display)
{
case BASE_DOT:
separator = '.';
break;
case BASE_DASH:
separator = '-';
break;
case BASE_SEMICOLON:
case BASE_NONE:
default:
separator = ':';
break;
}
sprintf(write_cursor, "%c%02x", separator, *c++);
write_cursor += 3; write_cursor += 3;
} }
} }
@ -1038,7 +1053,7 @@ ftype_register_bytes(void)
slice, slice,
}; };
static ftype_t fcwwc_type = { static ftype_t fcwwn_type = {
FT_FCWWN, /* ftype */ FT_FCWWN, /* ftype */
"FT_FCWWN", /* name */ "FT_FCWWN", /* name */
"Fibre Channel WWN", /* pretty_name */ "Fibre Channel WWN", /* pretty_name */
@ -1089,5 +1104,5 @@ ftype_register_bytes(void)
ftype_register(FT_OID, &oid_type); ftype_register(FT_OID, &oid_type);
ftype_register(FT_REL_OID, &rel_oid_type); ftype_register(FT_REL_OID, &rel_oid_type);
ftype_register(FT_SYSTEM_ID, &system_id_type); ftype_register(FT_SYSTEM_ID, &system_id_type);
ftype_register(FT_FCWWN, &fcwwc_type); ftype_register(FT_FCWWN, &fcwwn_type);
} }

View File

@ -76,7 +76,7 @@ val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_,
} }
static int static int
float_val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_) float_val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
{ {
/* /*
* 1 character for a sign. * 1 character for a sign.
@ -89,13 +89,13 @@ float_val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_)
} }
static void static void
float_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) float_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
sprintf(buf, "%." G_STRINGIFY(FLT_DIG) "g", fv->value.floating); sprintf(buf, "%." G_STRINGIFY(FLT_DIG) "g", fv->value.floating);
} }
static int static int
double_val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_) double_val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
{ {
/* /*
* 1 character for a sign. * 1 character for a sign.
@ -107,7 +107,7 @@ double_val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_)
} }
static void static void
double_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) double_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
sprintf(buf, "%." G_STRINGIFY(DBL_DIG) "g", fv->value.floating); sprintf(buf, "%." G_STRINGIFY(DBL_DIG) "g", fv->value.floating);
} }

View File

@ -98,13 +98,13 @@ guid_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_
} }
static int static int
guid_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_) guid_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
{ {
return GUID_STR_LEN; return GUID_STR_LEN;
} }
static void static void
guid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) guid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
guid_to_str_buf(&fv->value.guid, buf, GUID_STR_LEN); guid_to_str_buf(&fv->value.guid, buf, GUID_STR_LEN);
} }

View File

@ -224,13 +224,13 @@ sint8_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, L
} }
static int static int
integer_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_) integer_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
{ {
return 11; /* enough for 12^31-1, in decimal */ return 11; /* enough for 12^31-1, in decimal */
} }
static void static void
integer_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) integer_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
guint32 val; guint32 val;
@ -244,13 +244,13 @@ integer_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
} }
static int static int
uinteger_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_) uinteger_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
{ {
return 10; /* enough for 2^32-1, in decimal */ return 10; /* enough for 2^32-1, in decimal */
} }
static void static void
uinteger_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) uinteger_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
guint32_to_str_buf(fv->value.uinteger, buf, 11); guint32_to_str_buf(fv->value.uinteger, buf, 11);
} }
@ -281,13 +281,13 @@ ipxnet_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _
} }
static int static int
ipxnet_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_) ipxnet_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
{ {
return 2+8; /* 0xXXXXXXXX */ return 2+8; /* 0xXXXXXXXX */
} }
static void static void
ipxnet_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) ipxnet_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
sprintf(buf, "0x%08x", fv->value.uinteger); sprintf(buf, "0x%08x", fv->value.uinteger);
} }
@ -470,25 +470,25 @@ sint64_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _
} }
static int static int
integer64_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_) integer64_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
{ {
return 20; /* enough for -2^63-1, in decimal */ return 20; /* enough for -2^63-1, in decimal */
} }
static void static void
integer64_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) integer64_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
sprintf(buf, "%" G_GINT64_MODIFIER "d", fv->value.integer64); sprintf(buf, "%" G_GINT64_MODIFIER "d", fv->value.integer64);
} }
static int static int
uinteger64_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_) uinteger64_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
{ {
return 20; /* enough for 2^64-1, in decimal */ return 20; /* enough for 2^64-1, in decimal */
} }
static void static void
uinteger64_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) uinteger64_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
sprintf(buf, "%" G_GINT64_MODIFIER "u", fv->value.integer64); sprintf(buf, "%" G_GINT64_MODIFIER "u", fv->value.integer64);
} }
@ -568,13 +568,13 @@ boolean_fvalue_new(fvalue_t *fv)
} }
static int static int
boolean_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_) boolean_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
{ {
return 1; return 1;
} }
static void static void
boolean_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) boolean_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
*buf++ = (fv->value.uinteger) ? '1' : '0'; *buf++ = (fv->value.uinteger) ? '1' : '0';
*buf = '\0'; *buf = '\0';
@ -628,13 +628,13 @@ eui64_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U
} }
static int static int
eui64_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_) eui64_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
{ {
return 8*3-1; /* XX:XX:XX:XX:XX:XX:XX:XX */ return 8*3-1; /* XX:XX:XX:XX:XX:XX:XX:XX */
} }
static void static void
eui64_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) eui64_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
guint8 *p_eui64 = (guint8 *)ep_alloc(8); guint8 *p_eui64 = (guint8 *)ep_alloc(8);

View File

@ -99,7 +99,7 @@ val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_,
} }
static int static int
val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_) val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
{ {
/* /*
* 15 characters for "XXX.XXX.XXX.XXX". * 15 characters for "XXX.XXX.XXX.XXX".
@ -108,7 +108,7 @@ val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_)
} }
static void static void
val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
ipv4_addr_str_buf(&fv->value.ipv4, buf); ipv4_addr_str_buf(&fv->value.ipv4, buf);
} }

View File

@ -77,7 +77,7 @@ ipv6_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_
} }
static int static int
ipv6_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_) ipv6_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
{ {
/* /*
* 39 characters for "XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX". * 39 characters for "XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX".
@ -86,7 +86,7 @@ ipv6_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_)
} }
static void static void
ipv6_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) ipv6_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
ip6_to_str_buf(&(fv->value.ipv6.addr), buf); ip6_to_str_buf(&(fv->value.ipv6.addr), buf);
} }

View File

@ -116,14 +116,14 @@ val_from_unparsed(fvalue_t *fv, const char *pattern, gboolean allow_partial_valu
} }
static int static int
gregex_repr_len(fvalue_t *fv, ftrepr_t rtype) gregex_repr_len(fvalue_t *fv, ftrepr_t rtype, int field_display _U_)
{ {
g_assert(rtype == FTREPR_DFILTER); g_assert(rtype == FTREPR_DFILTER);
return (int)strlen(g_regex_get_pattern(fv->value.re)); return (int)strlen(g_regex_get_pattern(fv->value.re));
} }
static void static void
gregex_to_repr(fvalue_t *fv, ftrepr_t rtype, char *buf) gregex_to_repr(fvalue_t *fv, ftrepr_t rtype, int field_display _U_, char *buf)
{ {
g_assert(rtype == FTREPR_DFILTER); g_assert(rtype == FTREPR_DFILTER);
strcpy(buf, g_regex_get_pattern(fv->value.re)); strcpy(buf, g_regex_get_pattern(fv->value.re));

View File

@ -53,7 +53,7 @@ string_fvalue_set_string(fvalue_t *fv, const gchar *value)
} }
static int static int
string_repr_len(fvalue_t *fv, ftrepr_t rtype) string_repr_len(fvalue_t *fv, ftrepr_t rtype, int field_display _U_)
{ {
switch (rtype) { switch (rtype) {
case FTREPR_DISPLAY: case FTREPR_DISPLAY:
@ -67,7 +67,7 @@ string_repr_len(fvalue_t *fv, ftrepr_t rtype)
} }
static void static void
string_to_repr(fvalue_t *fv, ftrepr_t rtype, char *buf) string_to_repr(fvalue_t *fv, ftrepr_t rtype, int field_display _U_, char *buf)
{ {
switch (rtype) { switch (rtype) {
case FTREPR_DISPLAY: case FTREPR_DISPLAY:

View File

@ -323,7 +323,7 @@ value_get(fvalue_t *fv)
} }
static int static int
absolute_val_repr_len(fvalue_t *fv, ftrepr_t rtype) absolute_val_repr_len(fvalue_t *fv, ftrepr_t rtype, int field_display _U_)
{ {
gchar *rep; gchar *rep;
int ret; int ret;
@ -339,7 +339,7 @@ absolute_val_repr_len(fvalue_t *fv, ftrepr_t rtype)
} }
static void static void
absolute_val_to_repr(fvalue_t *fv, ftrepr_t rtype, char *buf) absolute_val_to_repr(fvalue_t *fv, ftrepr_t rtype, int field_display _U_, char *buf)
{ {
gchar *rep = abs_time_to_str(NULL, &fv->value.time, ABSOLUTE_TIME_LOCAL, gchar *rep = abs_time_to_str(NULL, &fv->value.time, ABSOLUTE_TIME_LOCAL,
rtype == FTREPR_DISPLAY); rtype == FTREPR_DISPLAY);
@ -352,7 +352,7 @@ absolute_val_to_repr(fvalue_t *fv, ftrepr_t rtype, char *buf)
} }
static int static int
relative_val_repr_len(fvalue_t *fv, ftrepr_t rtype _U_) relative_val_repr_len(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_)
{ {
gchar *rep; gchar *rep;
int ret; int ret;
@ -365,7 +365,7 @@ relative_val_repr_len(fvalue_t *fv, ftrepr_t rtype _U_)
} }
static void static void
relative_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf) relative_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
{ {
gchar *rep; gchar *rep;
rep = rel_time_to_secs_str(NULL, &fv->value.time); rep = rel_time_to_secs_str(NULL, &fv->value.time);

View File

@ -118,7 +118,7 @@ val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_,
} }
static int static int
val_repr_len(fvalue_t *fv, ftrepr_t rtype) val_repr_len(fvalue_t *fv, ftrepr_t rtype, int field_display _U_)
{ {
volatile guint length = 0; volatile guint length = 0;
@ -138,7 +138,7 @@ val_repr_len(fvalue_t *fv, ftrepr_t rtype)
} }
static void static void
val_to_repr(fvalue_t *fv, ftrepr_t rtype, char * volatile buf) val_to_repr(fvalue_t *fv, ftrepr_t rtype, int field_display _U_, char * volatile buf)
{ {
guint length; guint length;
const guint8 *c; const guint8 *c;

View File

@ -50,8 +50,8 @@ typedef void (*FvalueFreeFunc)(fvalue_t*);
typedef gboolean (*FvalueFromUnparsed)(fvalue_t*, const char*, gboolean, LogFunc); typedef gboolean (*FvalueFromUnparsed)(fvalue_t*, const char*, gboolean, LogFunc);
typedef gboolean (*FvalueFromString)(fvalue_t*, const char*, LogFunc); typedef gboolean (*FvalueFromString)(fvalue_t*, const char*, LogFunc);
typedef void (*FvalueToStringRepr)(fvalue_t*, ftrepr_t, char*volatile); typedef void (*FvalueToStringRepr)(fvalue_t*, ftrepr_t, int field_display, char*volatile);
typedef int (*FvalueStringReprLen)(fvalue_t*, ftrepr_t); typedef int (*FvalueStringReprLen)(fvalue_t*, ftrepr_t, int field_display);
typedef void (*FvalueSetByteArrayFunc)(fvalue_t*, GByteArray *); typedef void (*FvalueSetByteArrayFunc)(fvalue_t*, GByteArray *);
typedef void (*FvalueSetBytesFunc)(fvalue_t*, const guint8 *); typedef void (*FvalueSetBytesFunc)(fvalue_t*, const guint8 *);

View File

@ -348,14 +348,14 @@ fvalue_length(fvalue_t *fv)
} }
int int
fvalue_string_repr_len(fvalue_t *fv, ftrepr_t rtype) fvalue_string_repr_len(fvalue_t *fv, ftrepr_t rtype, int field_display)
{ {
g_assert(fv->ftype->len_string_repr); g_assert(fv->ftype->len_string_repr);
return fv->ftype->len_string_repr(fv, rtype); return fv->ftype->len_string_repr(fv, rtype, field_display);
} }
char * char *
fvalue_to_string_repr(fvalue_t *fv, ftrepr_t rtype, char *buf) fvalue_to_string_repr(fvalue_t *fv, ftrepr_t rtype, int field_display, char *buf)
{ {
if (fv->ftype->val_to_string_repr == NULL) { if (fv->ftype->val_to_string_repr == NULL) {
/* no value-to-string-representation function, so the value cannot be represented */ /* no value-to-string-representation function, so the value cannot be represented */
@ -363,14 +363,14 @@ fvalue_to_string_repr(fvalue_t *fv, ftrepr_t rtype, char *buf)
} }
if (!buf) { if (!buf) {
int len; int len;
if ((len = fvalue_string_repr_len(fv, rtype)) >= 0) { if ((len = fvalue_string_repr_len(fv, rtype, field_display)) >= 0) {
buf = (char *)g_malloc0(len + 1); buf = (char *)g_malloc0(len + 1);
} else { } else {
/* the value cannot be represented in the given representation type (rtype) */ /* the value cannot be represented in the given representation type (rtype) */
return NULL; return NULL;
} }
} }
fv->ftype->val_to_string_repr(fv, rtype, buf); fv->ftype->val_to_string_repr(fv, rtype, field_display, buf);
return buf; return buf;
} }

View File

@ -226,7 +226,7 @@ fvalue_from_string(ftenum_t ftype, const char *s, LogFunc logfunc);
* The length DOES NOT include the terminating NUL. */ * The length DOES NOT include the terminating NUL. */
WS_DLL_PUBLIC WS_DLL_PUBLIC
int int
fvalue_string_repr_len(fvalue_t *fv, ftrepr_t rtype); fvalue_string_repr_len(fvalue_t *fv, ftrepr_t rtype, int field_display);
/* Creates the string representation of the field value. /* Creates the string representation of the field value.
* If given non-NULL 'buf', the string is written at the memory * If given non-NULL 'buf', the string is written at the memory
@ -237,9 +237,12 @@ fvalue_string_repr_len(fvalue_t *fv, ftrepr_t rtype);
* memory. if 'buf' was non-NULL, then the return value will be * memory. if 'buf' was non-NULL, then the return value will be
* 'buf'. * 'buf'.
* *
* field_display parameter should be a BASE_ value (enum field_display_e)
* BASE_NONE should be used if field information isn't available.
*
* Returns NULL if the string cannot be represented in the given rtype.*/ * Returns NULL if the string cannot be represented in the given rtype.*/
WS_DLL_PUBLIC char * WS_DLL_PUBLIC char *
fvalue_to_string_repr(fvalue_t *fv, ftrepr_t rtype, char *buf); fvalue_to_string_repr(fvalue_t *fv, ftrepr_t rtype, int field_display, char *buf);
WS_DLL_PUBLIC ftenum_t WS_DLL_PUBLIC ftenum_t
fvalue_type_ftenum(fvalue_t *fv); fvalue_type_ftenum(fvalue_t *fv);

View File

@ -386,7 +386,7 @@ proto_tree_write_node_pdml(proto_node *node, gpointer data)
fputs("\" show=\"\" value=\"", pdata->fh); fputs("\" show=\"\" value=\"", pdata->fh);
break; break;
default: default:
dfilter_string = fvalue_to_string_repr(&fi->value, FTREPR_DISPLAY, NULL); dfilter_string = fvalue_to_string_repr(&fi->value, FTREPR_DISPLAY, fi->hfinfo->display, NULL);
if (dfilter_string != NULL) { if (dfilter_string != NULL) {
fputs("\" show=\"", pdata->fh); fputs("\" show=\"", pdata->fh);
@ -1418,7 +1418,7 @@ gchar* get_node_field_value(field_info* fi, epan_dissect_t* edt)
* FT_NONE can be checked when using -T fields */ * FT_NONE can be checked when using -T fields */
return g_strdup("1"); return g_strdup("1");
default: default:
dfilter_string = fvalue_to_string_repr(&fi->value, FTREPR_DISPLAY, NULL); dfilter_string = fvalue_to_string_repr(&fi->value, FTREPR_DISPLAY, fi->hfinfo->display, NULL);
if (dfilter_string != NULL) { if (dfilter_string != NULL) {
return dfilter_string; return dfilter_string;
} else { } else {

View File

@ -4268,9 +4268,30 @@ proto_custom_set(proto_tree* tree, GSList *field_ids, gint occurrence,
case FT_UINT_BYTES: case FT_UINT_BYTES:
case FT_BYTES: case FT_BYTES:
bytes = (guint8 *)fvalue_get(&finfo->value); bytes = (guint8 *)fvalue_get(&finfo->value);
offset_r += protoo_strlcpy(result+offset_r, switch(hfinfo->display)
{
case BASE_DOT:
offset_r += protoo_strlcpy(result+offset_r,
bytes ? bytes_to_ep_str_punct(bytes, fvalue_length(&finfo->value), '.') : "<MISSING>",
size-offset_r);
break;
case BASE_DASH:
offset_r += protoo_strlcpy(result+offset_r,
bytes ? bytes_to_ep_str_punct(bytes, fvalue_length(&finfo->value), '-') : "<MISSING>",
size-offset_r);
break;
case BASE_SEMICOLON:
offset_r += protoo_strlcpy(result+offset_r,
bytes ? bytes_to_ep_str_punct(bytes, fvalue_length(&finfo->value), ':') : "<MISSING>",
size-offset_r);
break;
case BASE_NONE:
default:
offset_r += protoo_strlcpy(result+offset_r,
bytes ? bytes_to_ep_str(bytes, fvalue_length(&finfo->value)) : "<MISSING>", bytes ? bytes_to_ep_str(bytes, fvalue_length(&finfo->value)) : "<MISSING>",
size-offset_r); size-offset_r);
break;
}
break; break;
case FT_ABSOLUTE_TIME: case FT_ABSOLUTE_TIME:
@ -5610,6 +5631,30 @@ tmp_fld_check_assert(header_field_info *hfinfo)
val_to_str(hfinfo->display, hf_display, "(Unknown: 0x%x)")); val_to_str(hfinfo->display, hf_display, "(Unknown: 0x%x)"));
} }
break; break;
case FT_BYTES:
/* Require bytes to have a "display type" that could
* add a character between displayed bytes.
*/
switch (hfinfo->display & FIELD_DISPLAY_E_MASK) {
case BASE_NONE:
case BASE_DOT:
case BASE_DASH:
case BASE_SEMICOLON:
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, or BASE_SEMICOLON\n",
hfinfo->name, hfinfo->abbrev,
val_to_str(hfinfo->display, hf_display, "(Bit count: %d)"));
}
if (hfinfo->bitmask != 0)
g_error("Field '%s' (%s) is an %s but has a bitmask\n",
hfinfo->name, hfinfo->abbrev,
ftype_name(hfinfo->type));
if (hfinfo->strings != NULL)
g_error("Field '%s' (%s) is an %s but has a strings value\n",
hfinfo->name, hfinfo->abbrev,
ftype_name(hfinfo->type));
break;
case FT_PROTOCOL: case FT_PROTOCOL:
case FT_FRAMENUM: case FT_FRAMENUM:
@ -5958,7 +6003,7 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
guint32 n_addr; /* network-order IPv4 address */ guint32 n_addr; /* network-order IPv4 address */
const gchar *name; const gchar *name;
address addr; address addr;
char *tmp; char *tmp;
if (!fi) { if (!fi) {
if (label_str) if (label_str)
@ -5982,8 +6027,26 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
case FT_BYTES: case FT_BYTES:
case FT_UINT_BYTES: case FT_UINT_BYTES:
bytes = (guint8 *)fvalue_get(&fi->value); bytes = (guint8 *)fvalue_get(&fi->value);
label_fill(label_str, 0, hfinfo, switch(hfinfo->display)
{
case BASE_DOT:
label_fill(label_str, 0, hfinfo,
(bytes) ? bytes_to_ep_str_punct(bytes, fvalue_length(&fi->value), '.') : "<MISSING>");
break;
case BASE_DASH:
label_fill(label_str, 0, hfinfo,
(bytes) ? bytes_to_ep_str_punct(bytes, fvalue_length(&fi->value), '-') : "<MISSING>");
break;
case BASE_SEMICOLON:
label_fill(label_str, 0, hfinfo,
(bytes) ? bytes_to_ep_str_punct(bytes, fvalue_length(&fi->value), ':') : "<MISSING>");
break;
case BASE_NONE:
default:
label_fill(label_str, 0, hfinfo,
(bytes) ? bytes_to_ep_str(bytes, fvalue_length(&fi->value)) : "<MISSING>"); (bytes) ? bytes_to_ep_str(bytes, fvalue_length(&fi->value)) : "<MISSING>");
break;
}
break; break;
/* Four types of integers to take care of: /* Four types of integers to take care of:
@ -7465,7 +7528,7 @@ construct_match_selected_string(field_info *finfo, epan_dissect_t *edt,
*/ */
if (filter != NULL) { if (filter != NULL) {
dfilter_len = fvalue_string_repr_len(&finfo->value, dfilter_len = fvalue_string_repr_len(&finfo->value,
FTREPR_DFILTER); FTREPR_DFILTER, finfo->hfinfo->display);
dfilter_len += abbrev_len + 4 + 1; dfilter_len += abbrev_len + 4 + 1;
*filter = (char *)ep_alloc0(dfilter_len); *filter = (char *)ep_alloc0(dfilter_len);
@ -7473,7 +7536,7 @@ construct_match_selected_string(field_info *finfo, epan_dissect_t *edt,
g_snprintf(*filter, dfilter_len, "%s == ", g_snprintf(*filter, dfilter_len, "%s == ",
hfinfo->abbrev); hfinfo->abbrev);
fvalue_to_string_repr(&finfo->value, fvalue_to_string_repr(&finfo->value,
FTREPR_DFILTER, FTREPR_DFILTER, finfo->hfinfo->display,
&(*filter)[abbrev_len + 4]); &(*filter)[abbrev_len + 4]);
} }
break; break;

View File

@ -494,7 +494,12 @@ typedef enum {
/* String types */ /* String types */
STR_ASCII = BASE_NONE, /**< shows non-printable ASCII characters as C-style escapes */ STR_ASCII = BASE_NONE, /**< shows non-printable ASCII characters as C-style escapes */
/* XXX, support for format_text_wsp() ? */ /* XXX, support for format_text_wsp() ? */
STR_UNICODE = 7 /**< shows non-printable UNICODE characters as \\uXXXX (XXX for now non-printable characters display depends on UI) */ 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 */
} field_display_e; } field_display_e;
/* Following constants have to be ORed with a field_display_e when dissector /* Following constants have to be ORed with a field_display_e when dissector

View File

@ -166,7 +166,7 @@ WSLUA_METAMETHOD FieldInfo__call(lua_State* L) {
} }
case FT_STRING: case FT_STRING:
case FT_STRINGZ: { case FT_STRINGZ: {
gchar* repr = fvalue_to_string_repr(&fi->ws_fi->value,FTREPR_DISPLAY,NULL); gchar* repr = fvalue_to_string_repr(&fi->ws_fi->value,FTREPR_DISPLAY,BASE_NONE,NULL);
if (repr) if (repr)
lua_pushstring(L,repr); lua_pushstring(L,repr);
else else
@ -220,10 +220,10 @@ WSLUA_METAMETHOD FieldInfo__tostring(lua_State* L) {
gchar* repr = NULL; gchar* repr = NULL;
if (fi->ws_fi->hfinfo->type == FT_PROTOCOL || fi->ws_fi->hfinfo->type == FT_PCRE) { if (fi->ws_fi->hfinfo->type == FT_PROTOCOL || fi->ws_fi->hfinfo->type == FT_PCRE) {
repr = fvalue_to_string_repr(&fi->ws_fi->value,FTREPR_DFILTER,NULL); repr = fvalue_to_string_repr(&fi->ws_fi->value,FTREPR_DFILTER,BASE_NONE,NULL);
} }
else { else {
repr = fvalue_to_string_repr(&fi->ws_fi->value,FTREPR_DISPLAY,NULL); repr = fvalue_to_string_repr(&fi->ws_fi->value,FTREPR_DISPLAY,fi->ws_fi->hfinfo->display,NULL);
} }
if (repr) { if (repr) {

View File

@ -313,7 +313,7 @@ extern AVP* new_avp_from_finfo(const gchar* name, field_info* finfo) {
new_avp_val->n = scs_subscribe(avp_strings, name); new_avp_val->n = scs_subscribe(avp_strings, name);
repr = fvalue_to_string_repr(&finfo->value,FTREPR_DISPLAY,NULL); repr = fvalue_to_string_repr(&finfo->value,FTREPR_DISPLAY,finfo->hfinfo->display,NULL);
if (repr) { if (repr) {
value = scs_subscribe(avp_strings, repr); value = scs_subscribe(avp_strings, repr);

View File

@ -1290,14 +1290,14 @@ static gboolean print_field_value(field_info *finfo, int cmd_line_index)
* this field has an associated value, * this field has an associated value,
* e.g: ip.hdr_len * e.g: ip.hdr_len
*/ */
fs_len = fvalue_string_repr_len(&finfo->value, FTREPR_DFILTER); fs_len = fvalue_string_repr_len(&finfo->value, FTREPR_DFILTER, finfo->hfinfo->display);
while (fs_buf_len < fs_len) { while (fs_buf_len < fs_len) {
fs_buf_len *= 2; fs_buf_len *= 2;
fs_buf = (char *)g_realloc(fs_buf, fs_buf_len + 1); fs_buf = (char *)g_realloc(fs_buf, fs_buf_len + 1);
fs_ptr = fs_buf; fs_ptr = fs_buf;
} }
fvalue_to_string_repr(&finfo->value, fvalue_to_string_repr(&finfo->value,
FTREPR_DFILTER, FTREPR_DFILTER, finfo->hfinfo->display,
fs_buf); fs_buf);
/* String types are quoted. Remove them. */ /* String types are quoted. Remove them. */

View File

@ -104,7 +104,7 @@ diam_tree_to_csv(proto_node *node, gpointer data)
ftype = fvalue_type_ftenum(&fi->value); ftype = fvalue_type_ftenum(&fi->value);
if (ftype != FT_NONE && ftype != FT_PROTOCOL) { if (ftype != FT_NONE && ftype != FT_PROTOCOL) {
/* convert value to string */ /* convert value to string */
val_tmp = fvalue_to_string_repr(&fi->value, FTREPR_DISPLAY, NULL); val_tmp = fvalue_to_string_repr(&fi->value, FTREPR_DISPLAY, hfi->display, NULL);
if (val_tmp) if (val_tmp)
{ {
val_str = ep_strdup(val_tmp); val_str = ep_strdup(val_tmp);

View File

@ -1348,7 +1348,7 @@ tree_view_follow_link(field_info *fi)
cf_goto_frame(&cfile, fi->value.value.uinteger); cf_goto_frame(&cfile, fi->value.value.uinteger);
} }
if(FI_GET_FLAG(fi, FI_URL) && IS_FT_STRING(fi->hfinfo->type)) { if(FI_GET_FLAG(fi, FI_URL) && IS_FT_STRING(fi->hfinfo->type)) {
url = fvalue_to_string_repr(&fi->value, FTREPR_DISPLAY, NULL); url = fvalue_to_string_repr(&fi->value, FTREPR_DISPLAY, fi->hfinfo->display, NULL);
if(url){ if(url){
browser_open_url(url); browser_open_url(url);
g_free(url); g_free(url);

View File

@ -451,7 +451,7 @@ void ProtoTree::itemDoubleClick(QTreeWidgetItem *item, int column) {
if(FI_GET_FLAG(fi, FI_URL) && IS_FT_STRING(fi->hfinfo->type)) { if(FI_GET_FLAG(fi, FI_URL) && IS_FT_STRING(fi->hfinfo->type)) {
gchar *url; gchar *url;
url = fvalue_to_string_repr(&fi->value, FTREPR_DISPLAY, NULL); url = fvalue_to_string_repr(&fi->value, FTREPR_DISPLAY, fi->hfinfo->display, NULL);
if(url){ if(url){
// browser_open_url(url); // browser_open_url(url);
QDesktopServices::openUrl(QUrl(url)); QDesktopServices::openUrl(QUrl(url));