diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2015-03-21 12:05:46 +0100 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2015-03-29 16:02:04 +0000 |
commit | 4e4de74000a9fd2435016b061e4337b90e6d4fae (patch) | |
tree | ec20523c9d93d42a38b669352df67ca291aa2115 /epan/dissectors/packet-dvbci.c | |
parent | e91d070665dbd1e973723ee1933da115fce41e82 (diff) | |
download | wireshark-4e4de74000a9fd2435016b061e4337b90e6d4fae.tar.gz |
DVB-CI Card Information Structure (CIS): start dissecting the device tuples
Change-Id: I20a098eb1fdcfd34eb03b685d6936a6cf5868c0d
Reviewed-on: https://code.wireshark.org/review/7848
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/packet-dvbci.c')
-rw-r--r-- | epan/dissectors/packet-dvbci.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/epan/dissectors/packet-dvbci.c b/epan/dissectors/packet-dvbci.c index 304ae9b4c4..ebabc2e357 100644 --- a/epan/dissectors/packet-dvbci.c +++ b/epan/dissectors/packet-dvbci.c @@ -104,6 +104,9 @@ void proto_reg_handoff_dvbci(void); #define TPCE_IF_TYPE_CUST1 5 #define TPCE_IF_TYPE_CUST2 6 #define TPCE_IF_TYPE_CUST3 7 +/* "voltage used" field in the device tuples */ +#define CIS_DEV_VCC50 0 +#define CIS_DEV_VCC33 1 /* link layer */ #define ML_MORE 0x80 @@ -873,6 +876,9 @@ static int hf_dvbci_cis_tpce_if_type = -1; static int hf_dvbci_cis_tpce_fs_mem_space = -1; static int hf_dvbci_cis_tpce_fs_irq = -1; static int hf_dvbci_cis_tpce_fs_io = -1; +static int hf_dvbci_cis_dev_vcc_used = -1; +static int hf_dvbci_cis_dev_mwait = -1; +static int hf_dvbci_cis_dev_oth_cond_info = -1; static int hf_dvbci_cis_tplmid_manf = -1; static int hf_dvbci_cis_tplmid_card = -1; static int hf_dvbci_buf_size = -1; @@ -1202,6 +1208,11 @@ static const value_string dvbci_cis_tpce_if_type[] = { { TPCE_IF_TYPE_CUST3, "Custom Interface 3" }, { 0, NULL } }; +static const value_string dvbci_cis_dev_vcc_used[] = { + { CIS_DEV_VCC50, "5.0V" }, + { CIS_DEV_VCC33, "3.3V" }, + { 0, NULL } +}; static const value_string dvbci_ml[] = { { ML_MORE, "more TPDU fragments pending" }, { ML_LAST, "last TPDU fragment" }, @@ -4873,6 +4884,33 @@ dissect_dvbci_cis_payload_cftable_entry(tvbuff_t *data_tvb, return offset; } +/* dissect the payload of a device_oc or device_oa tuple */ +static gint +dissect_dvbci_cis_payload_device(tvbuff_t *data_tvb, + packet_info *pinfo _U_, proto_tree *tree) +{ + gint offset = 0; + gboolean ext; + + ext = ((tvb_get_guint8(data_tvb, offset) & 0x80) == 0x80); + + proto_tree_add_item(tree, hf_dvbci_cis_dev_vcc_used, + data_tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(tree, hf_dvbci_cis_dev_mwait, + data_tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset++; + + while (ext) { + ext = ((tvb_get_guint8(data_tvb, offset) & 0x80) == 0x80); + + proto_tree_add_item(tree, hf_dvbci_cis_dev_oth_cond_info, + data_tvb, offset, 1, ENC_LITTLE_ENDIAN); + offset++; + } + + return offset; +} + static void dissect_dvbci_cis(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree) @@ -4928,6 +4966,13 @@ dissect_dvbci_cis(tvbuff_t *tvb, gint offset, tpl_data_tvb, pinfo, tpl_tree); offset += len_field; break; + case CISTPL_DEVICE_OC: + /* fall through: those two tuples' data is identical */ + case CISTPL_DEVICE_OA: + dissect_dvbci_cis_payload_device( + tpl_data_tvb, pinfo, tpl_tree); + offset += len_field; + break; case CISTPL_MANFID: proto_tree_add_item(tpl_tree, hf_dvbci_cis_tplmid_manf, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -5208,6 +5253,18 @@ proto_register_dvbci(void) { "IO Space", "dvb-ci.cis.tpce_fs.io", FT_UINT8, BASE_HEX, NULL, 0x08, NULL, HFILL } }, + { &hf_dvbci_cis_dev_vcc_used, + { "Vcc used", "dvb-ci.cis.device.vcc_used", + FT_UINT8, BASE_HEX, VALS(dvbci_cis_dev_vcc_used), 0x06, NULL, HFILL } + }, + { &hf_dvbci_cis_dev_mwait, + { "MWait", "dvb-ci.cis.device.mwait", + FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL } + }, + { &hf_dvbci_cis_dev_oth_cond_info, + { "Other conditions info", "dvb-ci.cis.device.other_cond", + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } + }, { &hf_dvbci_cis_tplmid_manf, { "PC Card manufacturer code", "dvb-ci.cis.tplmid_manf", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } |