aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ipmi-chassis.c
diff options
context:
space:
mode:
authorU-beauty\bdn <dima_b@pigeonpoint.com>2014-06-06 09:41:07 +0600
committerAnders Broman <a.broman58@gmail.com>2014-06-06 06:43:45 +0000
commit977a811217d2ce9853aeeac4e4e97167d35a94fb (patch)
treef01b5e9b5c3aba1202befd41018c898cd8a85dab /epan/dissectors/packet-ipmi-chassis.c
parenta537b3f745b5520792afbaf0b32d2df95b9abf16 (diff)
IPMI trace dissector (without PCAP-dependent part).
Added KCS and TMode protocol dissectors. Request/response logic has been revised. Saved request data logic has been revised. Added Get Message command response dissector. Added missing PICMG command dissectors. Added new PICMG command dissectors. Added new PPS OEM command entries. Added VITA 46.11 command dissectors. From: Bill Meier: - refs to value_strings/range_strings in hf[] entries, by convention, should use VALS/RVALS macros; - refs to true_false_strings should use TFS(&...) macro. also: true_false_string definitions should not be defined as arrays. - remove some unneeded #includes (packet-ipmi.c). - Do some re-indentation. - Add editor-modelines as needed. bug: 10004 Change-Id: Ib269b35784c0b70892d1e0111bcfb483ea64092c Reviewed-on: https://code.wireshark.org/review/1185 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-ipmi-chassis.c')
-rw-r--r--epan/dissectors/packet-ipmi-chassis.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/epan/dissectors/packet-ipmi-chassis.c b/epan/dissectors/packet-ipmi-chassis.c
index 2d8d85c5a6..98e9ed68b3 100644
--- a/epan/dissectors/packet-ipmi-chassis.c
+++ b/epan/dissectors/packet-ipmi-chassis.c
@@ -404,7 +404,7 @@ static void
bootopt_07(tvbuff_t *tvb, proto_tree *tree)
{
proto_tree_add_item(tree, hf_ipmi_chs_bo07_block_selector, tvb, 0, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(tree, hf_ipmi_chs_bo07_block_data, tvb, 1, tvb_length(tvb) - 1, ENC_NA);
+ proto_tree_add_item(tree, hf_ipmi_chs_bo07_block_data, tvb, 1, -1, ENC_NA);
}
@@ -438,7 +438,7 @@ rs00(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
proto_tree_add_item(tree, hf_ipmi_chs_00_sel_dev_addr, tvb, 3, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_ipmi_chs_00_sm_dev_addr, tvb, 4, 1, ENC_LITTLE_ENDIAN);
- if (tvb_length(tvb) >= 5) {
+ if (tvb_captured_length(tvb) >= 5) {
proto_tree_add_item(tree, hf_ipmi_chs_00_bridge_dev_addr, tvb, 5, 1, ENC_LITTLE_ENDIAN);
}
}
@@ -470,7 +470,7 @@ rs01(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
ett_ipmi_chs_01_last_event, byte2, ENC_LITTLE_ENDIAN, 0);
proto_tree_add_bitmask_text(tree, tvb, 2, 1, "Misc. State: ", NULL,
ett_ipmi_chs_01_misc, byte3, ENC_LITTLE_ENDIAN, 0);
- if (tvb_length(tvb) > 3) {
+ if (tvb_captured_length(tvb) > 3) {
proto_tree_add_bitmask_text(tree, tvb, 3, 1, "Front panel buttons capabilities: ",
NULL, ett_ipmi_chs_01_fpb, byte4, ENC_LITTLE_ENDIAN, BMT_NO_TFS);
};
@@ -494,11 +494,11 @@ rq04(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
static const int *byte2[] = { &hf_ipmi_chs_04_perm_on, NULL };
- if (tvb_length(tvb) > 0) {
+ if (tvb_captured_length(tvb) > 0) {
proto_tree_add_item(tree, hf_ipmi_chs_04_ival, tvb, 0, 1, ENC_LITTLE_ENDIAN);
}
- if (tvb_length(tvb) > 1) {
+ if (tvb_captured_length(tvb) > 1) {
proto_tree_add_bitmask_text(tree, tvb, 1, 1, "Flags: ", "None",
ett_ipmi_chs_04_byte2, byte2, ENC_LITTLE_ENDIAN, 0);
}
@@ -517,7 +517,7 @@ rq05(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
proto_tree_add_item(tree, hf_ipmi_chs_05_sdr_dev_addr, tvb, 2, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_ipmi_chs_05_sel_dev_addr, tvb, 3, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_ipmi_chs_05_sm_dev_addr, tvb, 4, 1, ENC_LITTLE_ENDIAN);
- if (tvb_length(tvb) > 5) {
+ if (tvb_captured_length(tvb) > 5) {
/* Bridge device address is optional */
proto_tree_add_item(tree, hf_ipmi_chs_05_bridge_dev_addr, tvb, 5, 1, ENC_LITTLE_ENDIAN);
}
@@ -588,13 +588,13 @@ rq08(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
ipmi_dcd8(pno, 0x7f), desc, pno);
/* Data is optional; no data means 'just set validity' */
- if (tvb_length(tvb) > 1) {
+ if (tvb_captured_length(tvb) > 1) {
if (pno < array_length(boot_options)) {
- sub = tvb_new_subset(tvb, 1, tvb_length(tvb) - 1, tvb_length(tvb) - 1);
+ sub = tvb_new_subset_remaining(tvb, 1);
boot_options[pno].intrp(sub, tree);
} else {
proto_tree_add_none_format(tree, hf_ipmi_chs_08_data, tvb, 1,
- tvb_length(tvb) - 1, "Parameter data: %s", desc);
+ -1, "Parameter data: %s", desc);
}
}
}
@@ -670,11 +670,10 @@ rs09(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
ipmi_dcd8(pno, 0x7f), desc, pno);
if (pno < array_length(boot_options)) {
- sub = tvb_new_subset(tvb, 2, tvb_length(tvb) - 2, tvb_length(tvb) - 2);
+ sub = tvb_new_subset_remaining(tvb, 2);
boot_options[pno].intrp(sub, tree);
} else {
- proto_tree_add_item(tree, hf_ipmi_chs_09_rs_param_data, tvb, 2,
- tvb_length(tvb) - 2, ENC_NA);
+ proto_tree_add_item(tree, hf_ipmi_chs_09_rs_param_data, tvb, 2, -1, ENC_NA);
}
}
@@ -715,7 +714,7 @@ ipmi_register_chassis(gint proto_ipmi)
static hf_register_info hf[] = {
{ &hf_ipmi_chs_bo00_sip,
{ "Set In Progress",
- "ipmi.bootopt00.sip", FT_UINT8, BASE_HEX, VALS(bo00_sip_vals), 0x03, NULL, HFILL }},
+ "ipmi.bootopt00.sip", FT_UINT8, BASE_HEX, VALS(bo00_sip_vals), 0x03, NULL, HFILL }},
{ &hf_ipmi_chs_bo01_spsel,
{ "Service Partition Selector",
"ipmi.bootopt01.spsel", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},