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_UINT_STRING, FT_ETHER, FT_BYTES, FT_UINT_BYTES, FT_IPv4,
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):
@ -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
--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:
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->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;
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) {
case PUT_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",
id, value_str,
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? */
SET_ADDRESS(&addr, AT_FC, 3, fchdr.d_id.data);
proto_tree_add_string (fc_tree, hf_fc_did, tvb, offset+1, 3,
address_to_str(wmem_packet_scope(), &addr));
hidden_item = proto_tree_add_string (fc_tree, hf_fc_id, tvb, offset+1, 3,
address_to_str(wmem_packet_scope(), &addr));
proto_tree_add_item(fc_tree, hf_fc_did, tvb, offset+1, 3, ENC_NA);
hidden_item = proto_tree_add_item (fc_tree, hf_fc_id, tvb, offset+1, 3, ENC_NA);
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_uint (fc_tree, hf_fc_csctl, tvb, offset+4, 1, fchdr.cs_ctl);
/* XXX - use "fc_wka_vals[]" on this? */
SET_ADDRESS(&addr, AT_FC, 3, fchdr.s_id.data);
proto_tree_add_string (fc_tree, hf_fc_sid, tvb, offset+5, 3,
address_to_str(wmem_packet_scope(), &addr));
hidden_item = proto_tree_add_string (fc_tree, hf_fc_id, tvb, offset+5, 3,
address_to_str(wmem_packet_scope(), &addr));
proto_tree_add_item(fc_tree, hf_fc_sid, tvb, offset+5, 3, ENC_NA);
hidden_item = proto_tree_add_item (fc_tree, hf_fc_id, tvb, offset+5, 3, ENC_NA);
PROTO_ITEM_SET_HIDDEN(hidden_item);
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),
0x0, "Derived Type", HFILL}},
{ &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}},
{ &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_STRING, BASE_NONE, NULL, 0x0,
{"Src Addr", "fc.s_id", FT_BYTES, BASE_DOT, NULL, 0x0,
"Source Address", HFILL}},
{ &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}},
{ &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_STRING, BASE_NONE, NULL, 0x0,
{"Port Identifier", "fcdns.req.portid", FT_BYTES, BASE_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_STRING, BASE_NONE, NULL,
{"Port Identifier", "fcdns.rply.portid", FT_BYTES, BASE_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_STRING, BASE_NONE, NULL,
{"Hard Address", "fcdns.rply.hrdaddr", FT_BYTES, BASE_DOT, NULL,
0x0, NULL, HFILL};
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
dissect_fcdns_req_portid (tvbuff_t *tvb, proto_tree *tree, int offset)
{
if (tree) {
proto_tree_add_string (tree, &hfi_fcdns_req_portid, tvb, offset, 3,
tvb_fc_to_str (tvb, offset));
}
proto_tree_add_item (tree, &hfi_fcdns_req_portid, tvb, offset, 3, ENC_NA);
}
static void
@ -581,9 +578,8 @@ dissect_fcdns_ganxt (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else {
proto_tree_add_item (req_tree, &hfi_fcdns_rply_ptype, tvb, offset,
1, ENC_BIG_ENDIAN);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid, tvb,
offset+1, 3, ENC_NA);
proto_tree_add_item (req_tree, &hfi_fcdns_rply_pname, tvb,
offset+4, 8, ENC_NA);
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);
}
if (tvb_offset_exists (tvb, 635)) {
proto_tree_add_string (req_tree, &hfi_fcdns_rply_hrdaddr, tvb,
offset+617, 3,
tvb_fc_to_str (tvb, offset+617));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_hrdaddr, tvb,
offset+617, 3, ENC_NA);
}
}
}
@ -808,9 +803,8 @@ dissect_fcdns_gidpn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
offset, 8, ENC_NA);
}
else {
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid, tvb,
offset+1, 3, ENC_NA);
}
}
}
@ -846,9 +840,8 @@ dissect_fcdns_gidnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else {
do {
islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, ENC_NA);
offset += 4;
} while (!(islast & 0x80));
}
@ -886,9 +879,8 @@ dissect_fcdns_gpnnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else {
do {
islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, ENC_NA);
proto_tree_add_item (req_tree, &hfi_fcdns_rply_pname,
tvb, offset+8, 8, ENC_NA);
offset += 16;
@ -936,9 +928,8 @@ dissect_fcdns_gidft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else {
do {
islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, ENC_NA);
offset += 4;
} while (!(islast & 0x80));
}
@ -963,9 +954,8 @@ dissect_fcdns_gpnft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else {
do {
islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, ENC_NA);
proto_tree_add_item (req_tree, &hfi_fcdns_rply_pname,
tvb, offset+4, 8, ENC_NA);
offset += 16;
@ -992,9 +982,8 @@ dissect_fcdns_gnnft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else {
do {
islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, ENC_NA);
proto_tree_add_item (req_tree, &hfi_fcdns_rply_nname,
tvb, offset+4, 8, ENC_NA);
offset += 16;
@ -1021,9 +1010,8 @@ dissect_fcdns_gidpt (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else {
do {
islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, ENC_NA);
offset += 4;
} while (!(islast & 0x80));
}
@ -1044,9 +1032,8 @@ dissect_fcdns_gidipp (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else {
do {
islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, ENC_NA);
offset += 4;
} while (!(islast & 0x80));
}
@ -1070,9 +1057,8 @@ dissect_fcdns_gidff (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
else {
do {
islast = tvb_get_guint8 (tvb, offset);
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_rply_portid,
tvb, offset+1, 3, ENC_NA);
offset += 4;
} while (!(islast & 0x80));
}
@ -1086,9 +1072,8 @@ dissect_fcdns_rpnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
if (req_tree) {
if (isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_req_portid,
tvb, offset+1, 3, ENC_NA);
proto_tree_add_item (req_tree, &hfi_fcdns_req_pname, tvb,
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 (isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid,
tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_req_portid,
tvb, offset+1, 3, ENC_NA);
proto_tree_add_item (req_tree, &hfi_fcdns_req_nname, tvb,
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 */
if (req_tree && isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3, ENC_NA);
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 */
if (req_tree && isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
if (isreq) {
proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3, ENC_NA);
proto_tree_add_item (req_tree, &hfi_fcdns_req_ptype, tvb,
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 */
if (req_tree && isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
if (isreq) {
proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3, ENC_NA);
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;
if (req_tree && isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3, ENC_NA);
proto_tree_add_item (req_tree, &hfi_fcdns_req_spnamelen, tvb,
offset+4, 1, ENC_BIG_ENDIAN);
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 */
if (req_tree && isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
if (isreq) {
proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3, ENC_NA);
proto_tree_add_item (req_tree, &hfi_fcdns_req_ip, tvb,
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 len;
if (req_tree && isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
if (isreq) {
proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb,
offset+1, 3, ENC_NA);
dissect_fc4type(req_tree, tvb, offset+4, &hfi_fcdns_req_fc4types);
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 */
if (req_tree && isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
if (isreq) {
proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb, offset+1, 3, ENC_NA);
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 */
if (req_tree && isreq) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
if (isreq) {
proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb, offset+1, 3, ENC_NA);
}
}
@ -1326,12 +1302,10 @@ dissect_fcdns_swils_entries (tvbuff_t *tvb, proto_tree *tree, int 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_string (tree, &hfi_fcdns_rply_ownerid, tvb, offset+1,
3, tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (tree, &hfi_fcdns_rply_ownerid, tvb, offset+1, 3, ENC_NA);
proto_tree_add_item (tree, &hfi_fcdns_rply_ptype, tvb, offset+4,
1, ENC_BIG_ENDIAN);
proto_tree_add_string (tree, &hfi_fcdns_rply_portid, tvb, offset+5, 3,
tvb_fc_to_str (tvb, offset+5));
proto_tree_add_item (tree, &hfi_fcdns_rply_portid, tvb, offset+5, 3, ENC_NA);
proto_tree_add_item (tree, &hfi_fcdns_rply_pname, tvb, offset+8, 8, ENC_NA);
offset += 16;
if (!(objfmt & 0x1)) {
@ -1361,8 +1335,8 @@ dissect_fcdns_swils_entries (tvbuff_t *tvb, proto_tree *tree, int offset)
16, ENC_NA);
proto_tree_add_item (tree, &hfi_fcdns_rply_fpname, tvb, offset+76,
8, ENC_NA);
proto_tree_add_string (tree, &hfi_fcdns_rply_hrdaddr, tvb, offset+85,
3, tvb_fc_to_str (tvb, offset+85));
proto_tree_add_item (tree, &hfi_fcdns_rply_hrdaddr, tvb, offset+85,
3, ENC_NA);
offset += 88;
if (objfmt & 0x2) {
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 */
if (isreq) {
if (req_tree) {
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, offset+1,
3, tvb_fc_to_str (tvb, offset+1));
}
proto_tree_add_item (req_tree, &hfi_fcdns_req_portid, tvb, offset+1, 3, ENC_NA);
}
else {
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;
}
proto_tree_add_string (logo_tree, hf_fcels_nportid, tvb, offset, 3,
tvb_fc_to_str (tvb, offset));
proto_tree_add_item (logo_tree, hf_fcels_nportid, tvb, offset, 3, 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_string (abtx_tree, hf_fcels_nportid, tvb, offset+5, 3,
tvb_fc_to_str (tvb, offset+5));
proto_tree_add_item (abtx_tree, hf_fcels_nportid, tvb, offset+5, 3, ENC_NA);
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);
}
@ -1309,8 +1307,7 @@ dissect_fcels_rsi (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
return;
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,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (rsi_tree, hf_fcels_nportid, tvb, offset+1, 3, ENC_NA);
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);
}
@ -1331,8 +1328,7 @@ dissect_fcels_rrq (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
if (!isreq)
return;
proto_tree_add_string (rrq_tree, hf_fcels_nportid, tvb, offset+5, 3,
tvb_fc_to_str (tvb, offset+5));
proto_tree_add_item (rrq_tree, hf_fcels_nportid, tvb, offset+5, 3, ENC_NA);
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);
}
@ -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);
if (isreq) {
proto_tree_add_string (rec_tree, hf_fcels_nportid, tvb,
offset+5, 3,
tvb_fc_to_str (tvb, offset+5));
proto_tree_add_item (rec_tree, hf_fcels_nportid, tvb,
offset+5, 3, ENC_NA);
proto_tree_add_item (rec_tree, hf_fcels_oxid, tvb,
offset+8, 2, ENC_BIG_ENDIAN);
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);
proto_tree_add_item (rec_tree, hf_fcels_rxid, tvb,
offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_string (rec_tree, hf_fcels_nportid, tvb,
offset+9, 3,
tvb_fc_to_str (tvb, offset+9));
proto_tree_add_string (rec_tree, hf_fcels_resportid, tvb,
offset+13, 3,
tvb_fc_to_str (tvb, offset+13));
proto_tree_add_item (rec_tree, hf_fcels_nportid, tvb,
offset+9, 3, ENC_NA);
proto_tree_add_item (rec_tree, hf_fcels_resportid, tvb,
offset+13, 3, ENC_NA);
proto_tree_add_item (rec_tree, hf_fcels_rec_fc4, tvb,
offset+16, 4, ENC_BIG_ENDIAN);
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_string (adisc_tree, hf_fcels_hardaddr, tvb, offset, 3,
tvb_fc_to_str (tvb, offset));
proto_tree_add_item (adisc_tree, hf_fcels_hardaddr, tvb, offset, 3, 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_string (adisc_tree, hf_fcels_nportid, tvb, offset+20, 3,
tvb_fc_to_str (tvb, offset+20));
proto_tree_add_item (adisc_tree, hf_fcels_nportid, tvb, offset+20, 3, ENC_NA);
}
}
@ -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,
tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_string (farp_tree, hf_fcels_nportid, tvb, offset+1,
3, tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (farp_tree, hf_fcels_nportid, tvb, offset+1,
3, ENC_NA);
proto_tree_add_item (farp_tree, hf_fcels_farp_respaction, tvb,
offset+4, 1, ENC_BIG_ENDIAN);
proto_tree_add_string (farp_tree, hf_fcels_resportid, tvb, offset+5,
3, tvb_fc_to_str (tvb, offset+5));
proto_tree_add_item (farp_tree, hf_fcels_resportid, 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_fnname, tvb, offset+16, 8, ENC_NA);
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);
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);
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_string (fan_tree, hf_fcels_fabricaddr, tvb, offset, 3,
tvb_fc_to_str (tvb, offset));
proto_tree_add_item (fan_tree, hf_fcels_fabricaddr, tvb, offset, 3, ENC_NA);
proto_tree_add_item (fan_tree, hf_fcels_fabricpname, tvb, offset+3,
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);
}
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;
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,
NULL, HFILL}},
{ &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}},
{ &hf_fcels_oxid,
{"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,
0x0, NULL, HFILL}},
{ &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}},
{ &hf_fcels_fabricpname,
{"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,
VALS (fc_els_farp_respaction_val), 0x0, NULL, HFILL}},
{ &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}},
{ &hf_fcels_respname,
{"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,
NULL, 0x0, NULL, HFILL}},
{ &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}},
{ &hf_fcels_rps_flag,
{"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_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_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_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 }},
@ -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_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_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_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_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_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

@ -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);
}
else {
proto_tree_add_string (tree, hf_fcs_mgmtid, tvb, offset+1, 3,
tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (tree, hf_fcs_mgmtid, tvb, offset+1, 3, ENC_NA);
}
}
}
@ -970,8 +969,8 @@ proto_register_fcfcs (void)
{"Interconnect Element Domain ID", "fcs.ie.domainid", FT_UINT8,
BASE_HEX, NULL, 0x0, NULL, HFILL}},
{ &hf_fcs_mgmtid,
{"Interconnect Element Mgmt. ID", "fcs.ie.mgmtid", FT_STRING,
BASE_NONE, NULL, 0x0, NULL, HFILL}},
{"Interconnect Element Mgmt. ID", "fcs.ie.mgmtid", FT_BYTES,
BASE_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

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

View File

@ -1016,8 +1016,7 @@ dissect_swils_fspf_lsrechdr(tvbuff_t *tvb, proto_tree *tree, int offset)
static void
dissect_swils_fspf_ldrec(tvbuff_t *tvb, proto_tree *tree, int offset)
{
proto_tree_add_string(tree, hf_swils_ldrec_linkid, tvb, offset, 4,
tvb_fc_to_str(tvb, offset+1));
proto_tree_add_item(tree, hf_swils_ldrec_linkid, tvb, offset+1, 3, ENC_NA);
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_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);
proto_tree_add_item(rscn_tree, hf_swils_rscn_addrfmt, tvb, offset+4,
1, ENC_BIG_ENDIAN);
proto_tree_add_string(rscn_tree, hf_swils_rscn_affectedport, tvb,
offset+5, 3, tvb_fc_to_str(tvb, offset+5));
proto_tree_add_item(rscn_tree, hf_swils_rscn_affectedport, tvb,
offset+5, 3, ENC_NA);
proto_tree_add_item(rscn_tree, hf_swils_rscn_detectfn, tvb,
offset+8, 4, ENC_BIG_ENDIAN);
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);
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,
tvb_fc_to_str(tvb, offset+1));
proto_tree_add_item(dev_tree, hf_swils_rscn_portid, tvb, offset+1, 3, 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);
offset += 20;
@ -2090,7 +2088,7 @@ proto_register_fcswils(void)
{ &hf_swils_ldrec_linkid,
{"Link ID", "swils.ldr.linkid",
FT_STRING, BASE_NONE, NULL, 0x0,
FT_BYTES, BASE_DOT, NULL, 0x0,
NULL, HFILL}},
{ &hf_swils_ldrec_out_pidx,
@ -2125,7 +2123,7 @@ proto_register_fcswils(void)
{ &hf_swils_rscn_affectedport,
{"Affected Port ID", "swils.rscn.affectedport",
FT_STRING, BASE_NONE, NULL, 0x0,
FT_BYTES, BASE_DOT, NULL, 0x0,
NULL, HFILL}},
{ &hf_swils_rscn_detectfn,
@ -2140,7 +2138,7 @@ proto_register_fcswils(void)
{ &hf_swils_rscn_portid,
{"Port Id", "swils.rscn.portid",
FT_STRING, BASE_NONE, NULL, 0x0,
FT_BYTES, BASE_DOT, NULL, 0x0,
NULL, HFILL}},
{ &hf_swils_rscn_pwwn,

View File

@ -352,7 +352,6 @@ dissect_fip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint val;
tvbuff_t *desc_tvb;
const char *info;
const char *text;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FIP");
col_clear(pinfo->cinfo, COL_INFO);
@ -458,10 +457,9 @@ dissect_fip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
case FIP_DT_MAP_OUI:
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_string(subtree, hf_fip_desc_map, desc_tvb,
5, 3, text);
proto_item_append_text(item, "%s", text);
proto_tree_add_item(subtree, hf_fip_desc_map, desc_tvb,
5, 3, ENC_NA);
proto_item_append_text(item, "%s", tvb_fc_to_str(desc_tvb, 5));
break;
case FIP_DT_NAME:
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);
proto_tree_add_item(subtree, hf_fip_desc_fab_vfid, desc_tvb,
2, 2, ENC_BIG_ENDIAN);
text = tvb_fc_to_str(desc_tvb, 5);
proto_tree_add_string(subtree, hf_fip_desc_fab_map, desc_tvb,
5, 3, text);
proto_tree_add_item(subtree, hf_fip_desc_fab_map, desc_tvb,
5, 3, 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));
break;
@ -658,7 +655,7 @@ proto_register_fip(void)
{ &hf_fip_desc_map,
{ "FC-MAP-OUI", "fip.map",
FT_STRING, BASE_NONE, NULL, 0,
FT_BYTES, BASE_DOT, NULL, 0,
NULL, HFILL}},
{ &hf_fip_desc_name,
@ -673,7 +670,7 @@ proto_register_fip(void)
{ &hf_fip_desc_fab_map,
{ "FC-MAP", "fip.fab.map",
FT_STRING, BASE_NONE, NULL, 0,
FT_BYTES, BASE_DOT, NULL, 0,
NULL, HFILL}},
{ &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;
}
else {
proto_tree_add_bytes_format_value(subtree, hf_isis_hello_ect, tvb, subofs, 4, NULL,
"%s", tvb_bytes_to_ep_str_punct(tvb, subofs, 4, '-'));
proto_tree_add_item( subtree, hf_isis_hello_ect, tvb, subofs, 4, ENC_NA);
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_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_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_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_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

@ -1031,6 +1031,7 @@ static int hf_mip6_ni_cni = -1;
static int hf_mip6_bad_auth = -1;
static int hf_fmip6_lla = -1;
static int hf_fmip6_lla_optcode = -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 *field_tree;
int len, p;
int len;
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,
offset + FMIP6_LLA_OPTCODE_OFF, FMIP6_LLA_OPTCODE_LEN, ENC_BIG_ENDIAN);
p = offset + FMIP6_LLA_LLA_OFF;
len = optlen - FMIP6_LLA_LLA_OFF;
if (len > 0) {
proto_tree_add_text(field_tree, tvb,
p, len, "Link-layer address: %s",
tvb_bytes_to_ep_str_punct(tvb, p, len, ':'));
proto_tree_add_item(field_tree, hf_fmip6_lla, tvb, offset + FMIP6_LLA_LLA_OFF, len, ENC_NA);
}
}
@ -4382,6 +4380,12 @@ proto_register_mip6(void)
NULL, HFILL }
},
{ &hf_fmip6_lla,
{ "Link-layer address", "mip6.lla",
FT_BYTES, BASE_SEMICOLON, NULL, 0,
NULL, HFILL }
},
{ &hf_fmip6_lla_optcode,
{ "Option-Code", "mip6.lla.optcode",
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
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,
NULL, "%s", tvb_bytes_to_ep_str_punct(tvb, offset+2, 8, ':'));
proto_tree_add_item(tree, hf_ipv6cp_interface_identifier, tvb, offset+2, 8, ENC_NA);
}
void
@ -6750,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_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[] = {
&ett_ipv6cp,

View File

@ -1201,7 +1201,6 @@ static void dissect_zcl_part_trasfpartframe(tvbuff_t *tvb, proto_tree *tree, gui
guint8 options;
guint16 u16len;
guint8 frame_len;
guint8 *data_frame;
static const int * part_opt[] = {
&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;
/* Retrieve "PartitionedFrame" field */
data_frame = tvb_bytes_to_ep_str_punct(tvb, *offset, frame_len, ':');
proto_tree_add_string(tree, hf_zbee_zcl_part_part_frame, tvb, *offset, frame_len, data_frame);
proto_tree_add_item(tree, hf_zbee_zcl_part_part_frame, tvb, *offset, frame_len, ENC_NA);
*offset += frame_len;
} /*dissect_zcl_part_trasfpartframe*/
@ -1457,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_STRING, BASE_NONE, NULL,
{ "Partition Frame", "zbee_zcl_general.part.part_frame", FT_BYTES, BASE_SEMICOLON, NULL,
0x00, NULL, HFILL } },
{ &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 data_size;
guint8 *image_data;
/* Retrieve 'Status' field */
status = tvb_get_guint8(tvb, *offset);
@ -2184,8 +2181,7 @@ dissect_zcl_ota_imageblockrsp(tvbuff_t *tvb, proto_tree *tree, guint *offset)
*offset += 1;
/* Retrieve 'Image Data' field */
image_data = tvb_bytes_to_ep_str_punct(tvb, *offset, data_size, ':');
proto_tree_add_string(tree, hf_zbee_zcl_ota_image_data, tvb, *offset, data_size, image_data);
proto_tree_add_item(tree, hf_zbee_zcl_ota_image_data, tvb, *offset, data_size, ENC_NA);
*offset += data_size;
}
else if (status == ZBEE_ZCL_STAT_OTA_WAIT_FOR_DATA) {
@ -2667,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_STRING, BASE_NONE, NULL,
{ "Image Data", "zbee_zcl_general.ota.image.data", FT_BYTES, BASE_SEMICOLON, NULL,
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)
{
guint32 log_len;
guint8 *log_data;
/* Retrieve 'UTCTime' field */
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;
/* Retrieve 'Log Payload' field */
log_data = tvb_bytes_to_ep_str_punct(tvb, *offset, log_len, ':');
proto_tree_add_string(tree, hf_zbee_zcl_appl_stats_log_payload, tvb, *offset, log_len, log_data);
proto_tree_add_item(tree, hf_zbee_zcl_appl_stats_log_payload, tvb, *offset, log_len, ENC_NA);
*offset += log_len;
}/*dissect_zcl_appl_stats_log_rsp*/
@ -1381,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_STRING, BASE_NONE, NULL,
{ "Log Payload", "zbee_zcl_ha.applstats.log.payload", FT_BYTES, BASE_SEMICOLON, NULL,
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;
attr_string = tvb_bytes_to_ep_str_punct(tvb, *offset, attr_uint, ':');
proto_item_append_text(tree, ", Octets: %s", attr_string);
proto_tree_add_string(tree, hf_zbee_zcl_attr_ostr, tvb, *offset, attr_uint,
attr_string);
proto_tree_add_item(tree, hf_zbee_zcl_attr_ostr, tvb, *offset, attr_uint, ENC_NA);
proto_item_append_text(tree, ", Octets: %s", tvb_bytes_to_ep_str_punct(tvb, *offset, attr_uint, ':'));
*offset += attr_uint;
break;
@ -1821,9 +1819,8 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint
*offset += 2;
attr_string = tvb_bytes_to_ep_str_punct(tvb, *offset, attr_uint, ':');
proto_item_append_text(tree, ", Octets: %s", attr_string);
proto_tree_add_string(tree, hf_zbee_zcl_attr_ostr, tvb, *offset, attr_uint, attr_string);
proto_tree_add_item(tree, hf_zbee_zcl_attr_ostr, tvb, *offset, attr_uint, ENC_NA);
proto_item_append_text(tree, ", Octets: %s", tvb_bytes_to_ep_str_punct(tvb, *offset, attr_uint, ':'));
*offset += attr_uint;
break;
@ -2312,7 +2309,7 @@ void proto_register_zbee_zcl(void)
NULL, HFILL }},
{ &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 }},
{ &hf_zbee_zcl_attr_array_elements_type,

View File

@ -56,15 +56,15 @@ bytes_fvalue_set(fvalue_t *fv, GByteArray *value)
}
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) {
/* Empty array of bytes, so the representation
* is an empty string. */
return 0;
} else {
/* 3 bytes for each byte of the byte "NN:" minus 1 byte
* as there's no trailing ":". */
/* 3 bytes for each byte of the byte "NN<separator character>" minus 1 byte
* as there's no trailing "<separator character>". */
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))
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);
}
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);
/*
@ -109,13 +109,13 @@ oid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
}
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);
}
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);
/*
@ -130,17 +130,18 @@ rel_oid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
}
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
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;
char *write_cursor;
unsigned int i;
char separator;
c = fv->value.bytes->data;
write_cursor = buf;
@ -151,7 +152,21 @@ bytes_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
write_cursor += 2;
}
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;
}
}
@ -1038,7 +1053,7 @@ ftype_register_bytes(void)
slice,
};
static ftype_t fcwwc_type = {
static ftype_t fcwwn_type = {
FT_FCWWN, /* ftype */
"FT_FCWWN", /* name */
"Fibre Channel WWN", /* pretty_name */
@ -1089,5 +1104,5 @@ ftype_register_bytes(void)
ftype_register(FT_OID, &oid_type);
ftype_register(FT_REL_OID, &rel_oid_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
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.
@ -89,13 +89,13 @@ float_val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_)
}
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);
}
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.
@ -107,7 +107,7 @@ double_val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_)
}
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);
}

View File

@ -98,13 +98,13 @@ guid_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_
}
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;
}
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);
}

View File

@ -224,13 +224,13 @@ sint8_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value, L
}
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 */
}
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;
@ -244,13 +244,13 @@ integer_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
}
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 */
}
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);
}
@ -281,13 +281,13 @@ ipxnet_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _
}
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 */
}
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);
}
@ -470,25 +470,25 @@ sint64_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _
}
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 */
}
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);
}
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 */
}
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);
}
@ -568,13 +568,13 @@ boolean_fvalue_new(fvalue_t *fv)
}
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;
}
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 = '\0';
@ -628,13 +628,13 @@ eui64_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U
}
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 */
}
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);

View File

@ -99,7 +99,7 @@ val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_,
}
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".
@ -108,7 +108,7 @@ val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_)
}
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);
}

View File

@ -77,7 +77,7 @@ ipv6_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_
}
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".
@ -86,7 +86,7 @@ ipv6_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_)
}
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);
}

View File

@ -116,14 +116,14 @@ val_from_unparsed(fvalue_t *fv, const char *pattern, gboolean allow_partial_valu
}
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);
return (int)strlen(g_regex_get_pattern(fv->value.re));
}
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);
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
string_repr_len(fvalue_t *fv, ftrepr_t rtype)
string_repr_len(fvalue_t *fv, ftrepr_t rtype, int field_display _U_)
{
switch (rtype) {
case FTREPR_DISPLAY:
@ -67,7 +67,7 @@ string_repr_len(fvalue_t *fv, ftrepr_t rtype)
}
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) {
case FTREPR_DISPLAY:

View File

@ -323,7 +323,7 @@ value_get(fvalue_t *fv)
}
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;
int ret;
@ -339,7 +339,7 @@ absolute_val_repr_len(fvalue_t *fv, ftrepr_t rtype)
}
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,
rtype == FTREPR_DISPLAY);
@ -352,7 +352,7 @@ absolute_val_to_repr(fvalue_t *fv, ftrepr_t rtype, char *buf)
}
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;
int ret;
@ -365,7 +365,7 @@ relative_val_repr_len(fvalue_t *fv, ftrepr_t rtype _U_)
}
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;
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
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;
@ -138,7 +138,7 @@ val_repr_len(fvalue_t *fv, ftrepr_t rtype)
}
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;
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 (*FvalueFromString)(fvalue_t*, const char*, LogFunc);
typedef void (*FvalueToStringRepr)(fvalue_t*, ftrepr_t, char*volatile);
typedef int (*FvalueStringReprLen)(fvalue_t*, ftrepr_t);
typedef void (*FvalueToStringRepr)(fvalue_t*, ftrepr_t, int field_display, char*volatile);
typedef int (*FvalueStringReprLen)(fvalue_t*, ftrepr_t, int field_display);
typedef void (*FvalueSetByteArrayFunc)(fvalue_t*, GByteArray *);
typedef void (*FvalueSetBytesFunc)(fvalue_t*, const guint8 *);

View File

@ -348,14 +348,14 @@ fvalue_length(fvalue_t *fv)
}
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);
return fv->ftype->len_string_repr(fv, rtype);
return fv->ftype->len_string_repr(fv, rtype, field_display);
}
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) {
/* 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) {
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);
} else {
/* the value cannot be represented in the given representation type (rtype) */
return NULL;
}
}
fv->ftype->val_to_string_repr(fv, rtype, buf);
fv->ftype->val_to_string_repr(fv, rtype, field_display, 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. */
WS_DLL_PUBLIC
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.
* 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
* '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.*/
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
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);
break;
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) {
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 */
return g_strdup("1");
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) {
return dfilter_string;
} else {

View File

@ -4268,9 +4268,30 @@ proto_custom_set(proto_tree* tree, GSList *field_ids, gint occurrence,
case FT_UINT_BYTES:
case FT_BYTES:
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>",
size-offset_r);
break;
}
break;
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)"));
}
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_FRAMENUM:
@ -5958,7 +6003,7 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
guint32 n_addr; /* network-order IPv4 address */
const gchar *name;
address addr;
char *tmp;
char *tmp;
if (!fi) {
if (label_str)
@ -5982,8 +6027,26 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
case FT_BYTES:
case FT_UINT_BYTES:
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>");
break;
}
break;
/* 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) {
dfilter_len = fvalue_string_repr_len(&finfo->value,
FTREPR_DFILTER);
FTREPR_DFILTER, finfo->hfinfo->display);
dfilter_len += abbrev_len + 4 + 1;
*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 == ",
hfinfo->abbrev);
fvalue_to_string_repr(&finfo->value,
FTREPR_DFILTER,
FTREPR_DFILTER, finfo->hfinfo->display,
&(*filter)[abbrev_len + 4]);
}
break;

View File

@ -494,7 +494,12 @@ typedef enum {
/* String types */
STR_ASCII = BASE_NONE, /**< shows non-printable ASCII characters as C-style escapes */
/* 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;
/* 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_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)
lua_pushstring(L,repr);
else
@ -220,10 +220,10 @@ WSLUA_METAMETHOD FieldInfo__tostring(lua_State* L) {
gchar* repr = NULL;
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 {
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) {

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);
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) {
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,
* 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) {
fs_buf_len *= 2;
fs_buf = (char *)g_realloc(fs_buf, fs_buf_len + 1);
fs_ptr = fs_buf;
}
fvalue_to_string_repr(&finfo->value,
FTREPR_DFILTER,
FTREPR_DFILTER, finfo->hfinfo->display,
fs_buf);
/* 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);
if (ftype != FT_NONE && ftype != FT_PROTOCOL) {
/* 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)
{
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);
}
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){
browser_open_url(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)) {
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){
// browser_open_url(url);
QDesktopServices::openUrl(QUrl(url));