proto_item *ti;
tree = proto_item_add_subtree(ti_arg, ett_arg);
proto_item *ti;
tree = proto_item_add_subtree(ti_arg, ett_arg);
* Coding of address:
* ELCOM-90 TRA3825.02 User Element conventions, p. 5-2 and Appendix G
*/
* Coding of address:
* ELCOM-90 TRA3825.02 User Element conventions, p. 5-2 and Appendix G
*/
/* length of User Data, should be 1 byte field ... */
flen = tvb_get_guint8(tvb, offset);
lenbytes = 1;
/* length of User Data, should be 1 byte field ... */
flen = tvb_get_guint8(tvb, offset);
lenbytes = 1;
/* ... but sometimes it seems to be 2 bytes; try to be clever */
if (flen == 0) {
flen = tvb_get_guint8(tvb, offset+1);
/* ... but sometimes it seems to be 2 bytes; try to be clever */
if (flen == 0) {
flen = tvb_get_guint8(tvb, offset+1);
/* show the rest */
/* tree2 = proto_tree_add_text(tree, tvb, offset, -1, "User Data"); */
/* show the rest */
/* tree2 = proto_tree_add_text(tree, tvb, offset, -1, "User Data"); */
if (tvb_length_remaining(tvb, offset) <= 0)
return offset;
restmark = tvb_get_guint8(tvb, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
return offset;
restmark = tvb_get_guint8(tvb, offset);
proto_item_append_text(ti, " = Test Connection Response");
result = tvb_get_guint8(tvb, offset);
proto_item_append_text(ti, " = Test Connection Response");
result = tvb_get_guint8(tvb, offset);
- ti = proto_tree_add_uint(tree, hf_elcom_datarequest_result,
- tvb, offset, 1, result);
+ proto_tree_add_uint(tree, hf_elcom_datarequest_result,
+ tvb, offset, 1, result);
tvb_get_guint8(tvb, offset));
offset++;
}
tvb_get_guint8(tvb, offset));
offset++;
}
col_append_fstr(pinfo->cinfo, COL_INFO, " %s Connect", suffix);
g_free(suffix);
break;
col_append_fstr(pinfo->cinfo, COL_INFO, " %s Connect", suffix);
g_free(suffix);
break;
case P_RELRQ:
case P_RELRS:
col_append_str(pinfo->cinfo, COL_INFO, " Release");
break;
case P_RELRQ:
case P_RELRS:
col_append_str(pinfo->cinfo, COL_INFO, " Release");
break;
case P_DATRQ:
col_append_str(pinfo->cinfo, COL_INFO, " Data");
break;
case P_DATRQ:
col_append_str(pinfo->cinfo, COL_INFO, " Data");
break;
case P_RELRQ:
col_append_str(pinfo->cinfo, COL_INFO, " Request");
break;
case P_RELRQ:
col_append_str(pinfo->cinfo, COL_INFO, " Request");
break;
case P_CONRS:
case P_RELRS:
col_append_str(pinfo->cinfo, COL_INFO, " Response");
break;
}
case P_CONRS:
case P_RELRS:
col_append_str(pinfo->cinfo, COL_INFO, " Response");
break;
}
ti = proto_tree_add_item(tree, proto_elcom, tvb, offset, -1, FALSE);
elcom_tree = proto_item_add_subtree(ti, ett_elcom);
ti = proto_tree_add_item(tree, proto_elcom, tvb, offset, -1, FALSE);
elcom_tree = proto_item_add_subtree(ti, ett_elcom);
hidden_item = proto_tree_add_boolean(elcom_tree,
is_request ? hf_elcom_request : hf_elcom_response,
tvb, 0, 0, TRUE);
hidden_item = proto_tree_add_boolean(elcom_tree,
is_request ? hf_elcom_request : hf_elcom_response,
tvb, 0, 0, TRUE);
* Connection request/release assiciated PDU's,
* /ELCOM-90 P Protocol spec/ p. 85...
*/
* Connection request/release assiciated PDU's,
* /ELCOM-90 P Protocol spec/ p. 85...
*/
- proto_item_append_text(elcom_tree, " (Connect %s)",
+ proto_item_append_text(elcom_tree, " (Connect %s)",
((elcom_msg_type == P_CONRQ)
? "Request" : "Response"));
((elcom_msg_type == P_CONRQ)
? "Request" : "Response"));
- proto_item_append_text(ti, " (Connect %s)",
+ proto_item_append_text(ti, " (Connect %s)",
((elcom_msg_type == P_CONRQ)
? "Request" : "Response"));
((elcom_msg_type == P_CONRQ)
? "Request" : "Response"));
/* We need the lenght here, hardcode the LOWADR_LEN = 21 */
ti = proto_tree_add_text(elcom_tree, tvb, offset, TOTAL_LEN, "Initiator");
offset = dissect_lower_address(ti, ett_elcom_initiator, tvb, offset,
/* We need the lenght here, hardcode the LOWADR_LEN = 21 */
ti = proto_tree_add_text(elcom_tree, tvb, offset, TOTAL_LEN, "Initiator");
offset = dissect_lower_address(ti, ett_elcom_initiator, tvb, offset,
hf_elcom_initiator_suff);
if (tvb_length_remaining(tvb, offset) <= 0)
return;
hf_elcom_initiator_suff);
if (tvb_length_remaining(tvb, offset) <= 0)
return;
ti = proto_tree_add_text(elcom_tree, tvb, offset, TOTAL_LEN, "Responder");
offset = dissect_lower_address(ti, ett_elcom_responder, tvb, offset,
hf_elcom_responder_endian,
ti = proto_tree_add_text(elcom_tree, tvb, offset, TOTAL_LEN, "Responder");
offset = dissect_lower_address(ti, ett_elcom_responder, tvb, offset,
hf_elcom_responder_endian,
hf_elcom_responder_suff);
if (tvb_length_remaining(tvb, offset) <= 0)
return;
hf_elcom_responder_suff);
if (tvb_length_remaining(tvb, offset) <= 0)
return;
/* Rest of the payload is USER-DATA, 0..82 bytes */
ti = proto_tree_add_text(elcom_tree, tvb, offset, -1, "User Data");
offset = dissect_userdata(ti, ett_elcom_userdata, tvb, offset);
/* Rest of the payload is USER-DATA, 0..82 bytes */
ti = proto_tree_add_text(elcom_tree, tvb, offset, -1, "User Data");
offset = dissect_userdata(ti, ett_elcom_userdata, tvb, offset);
case P_RELRQ:
case P_RELRS:
case P_RELRQ:
case P_RELRS:
- proto_item_append_text(elcom_tree, " (Release %s)",
+ proto_item_append_text(elcom_tree, " (Release %s)",
((elcom_msg_type == P_RELRQ)
? "Request" : "Response"));
((elcom_msg_type == P_RELRQ)
? "Request" : "Response"));
- proto_item_append_text(ti, " (Release %s)",
+ proto_item_append_text(ti, " (Release %s)",
((elcom_msg_type == P_RELRQ)
? "Request" : "Response"));
result = tvb_get_guint8(tvb, offset);
((elcom_msg_type == P_RELRQ)
? "Request" : "Response"));
result = tvb_get_guint8(tvb, offset);
- ti = proto_tree_add_uint(elcom_tree,
- (elcom_msg_type == P_RELRQ)
- ? hf_elcom_release_reason
- : hf_elcom_release_result,
- tvb, offset, 1, result);
+ proto_tree_add_uint(elcom_tree,
+ (elcom_msg_type == P_RELRQ)
+ ? hf_elcom_release_reason
+ : hf_elcom_release_result,
+ tvb, offset, 1, result);
proto_item_append_text(ti, " <<--- meaning WHAT??");
break;
}
proto_item_append_text(ti, " <<--- meaning WHAT??");
break;
}
if (tvb_length_remaining(tvb, offset) <= 0)
return;
if (tvb_length_remaining(tvb, offset) <= 0)
return;
{ &hf_elcom_response,
{ "Response", "elcom.response",
FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
{ &hf_elcom_response,
{ "Response", "elcom.response",
FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
{ &hf_elcom_request,
{ "Request", "elcom.request",
{ &hf_elcom_request,
{ "Request", "elcom.request",