summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-usb-ccid.c
diff options
context:
space:
mode:
authorpascal <pascal@localhost>2012-05-17 21:24:48 +0000
committerpascal <pascal@localhost>2012-05-17 21:24:48 +0000
commitb3dec16072aa463adfa0d21865f24e1db48d0b05 (patch)
treea43771733bf3b3f1b194ede9cfdaf265a232f37b /epan/dissectors/packet-usb-ccid.c
parent8f789f7ee264a47a542258107c41b509f737922a (diff)
downloadwireshark-b3dec16072aa463adfa0d21865f24e1db48d0b05.tar.gz
Tabs -> spaces
svn path=/trunk/; revision=42691
Diffstat (limited to 'epan/dissectors/packet-usb-ccid.c')
-rw-r--r--epan/dissectors/packet-usb-ccid.c256
1 files changed, 128 insertions, 128 deletions
diff --git a/epan/dissectors/packet-usb-ccid.c b/epan/dissectors/packet-usb-ccid.c
index b32c6d6d3a..05e1d18040 100644
--- a/epan/dissectors/packet-usb-ccid.c
+++ b/epan/dissectors/packet-usb-ccid.c
@@ -179,201 +179,201 @@ dissect_ccid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (cmd) {
case PC_RDR_SET_PARAMS:
- proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bProtocolNum, tvb, 7, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bProtocolNum, tvb, 7, 1, ENC_LITTLE_ENDIAN);
- /* Placeholder for abRFU */
- proto_tree_add_text(ccid_tree, tvb, 8, 2, "Reserved for Future Use");
+ /* Placeholder for abRFU */
+ proto_tree_add_text(ccid_tree, tvb, 8, 2, "Reserved for Future Use");
- next_tvb = tvb_new_subset_remaining(tvb, 10);
- call_dissector(sub_handles[SUB_DATA], next_tvb, pinfo, ccid_tree);
+ next_tvb = tvb_new_subset_remaining(tvb, 10);
+ call_dissector(sub_handles[SUB_DATA], next_tvb, pinfo, ccid_tree);
- col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Set Parameters");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Set Parameters");
+ break;
case PC_RDR_ICC_ON:
- proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bPowerSelect, tvb, 7, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bPowerSelect, tvb, 7, 1, ENC_LITTLE_ENDIAN);
- /* Placeholder for abRFU */
- proto_tree_add_text(ccid_tree, tvb, 8, 2, "Reserved for Future Use");
+ /* Placeholder for abRFU */
+ proto_tree_add_text(ccid_tree, tvb, 8, 2, "Reserved for Future Use");
- col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: ICC Power On");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: ICC Power On");
+ break;
case PC_RDR_ICC_OFF:
- proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
- /* Placeholder for abRFU */
- proto_tree_add_text(ccid_tree, tvb, 7, 3, "Reserved for Future Use");
+ /* Placeholder for abRFU */
+ proto_tree_add_text(ccid_tree, tvb, 7, 3, "Reserved for Future Use");
- col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: ICC Power Off");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: ICC Power Off");
+ break;
case PC_RDR_GET_SLOT_STATUS:
- proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
- /* Placeholder for abRFU */
- proto_tree_add_text(ccid_tree, tvb, 7, 3, "Reserved for Future Use");
+ /* Placeholder for abRFU */
+ proto_tree_add_text(ccid_tree, tvb, 7, 3, "Reserved for Future Use");
- col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Get Slot Status");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Get Slot Status");
+ break;
case PC_RDR_SECURE:
- col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Secure");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Secure");
+ break;
case PC_RDR_T0APDU:
- col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: T=0 APDU");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: T=0 APDU");
+ break;
case PC_RDR_ESCAPE:
- col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Escape");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Escape");
+ break;
case PC_RDR_GET_PARAMS:
- proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
- /* Placeholder for abRFU */
- proto_tree_add_text(ccid_tree, tvb, 7, 3, "Reserved for Future Use");
+ /* Placeholder for abRFU */
+ proto_tree_add_text(ccid_tree, tvb, 7, 3, "Reserved for Future Use");
- col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Get Parameters");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Get Parameters");
+ break;
case PC_RDR_RESET_PARAMS:
- col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Reset Parameters");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Reset Parameters");
+ break;
case PC_RDR_ICC_CLOCK:
- col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: ICC Clock");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: ICC Clock");
+ break;
case PC_RDR_XFR_BLOCK:
- col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Transfer Block");
+ col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Transfer Block");
- proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bBWI, tvb, 7, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_wLevelParameter, tvb, 8, 2, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bBWI, tvb, 7, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_wLevelParameter, tvb, 8, 2, ENC_LITTLE_ENDIAN);
- next_tvb = tvb_new_subset_remaining(tvb, 10);
+ next_tvb = tvb_new_subset_remaining(tvb, 10);
- /* See if the dissector isn't Data */
- if (sub_selected != SUB_DATA) {
+ /* See if the dissector isn't Data */
+ if (sub_selected != SUB_DATA) {
- /* See if we're in PN532-with-ACS PseudoHeader Mode */
- if (sub_selected == SUB_PN532_ACS_PSEUDO_APDU) {
+ /* See if we're in PN532-with-ACS PseudoHeader Mode */
+ if (sub_selected == SUB_PN532_ACS_PSEUDO_APDU) {
- /* See if the payload starts with 0xD4 (Host -> PN532) */
- if (tvb_get_guint8(tvb, 15) == 0xD4) {
+ /* See if the payload starts with 0xD4 (Host -> PN532) */
+ if (tvb_get_guint8(tvb, 15) == 0xD4) {
- /* Skip the 5 byte ACS Pseudo-Header */
- call_dissector(sub_handles[sub_selected], tvb_new_subset_remaining(tvb, 15), pinfo, tree);
- }
+ /* Skip the 5 byte ACS Pseudo-Header */
+ call_dissector(sub_handles[sub_selected], tvb_new_subset_remaining(tvb, 15), pinfo, tree);
+ }
- else {
+ else {
- /* We've probably got an APDU addressed elsewhere */
- call_dissector(sub_handles[SUB_DATA], next_tvb, pinfo, tree);
- }
- }
+ /* We've probably got an APDU addressed elsewhere */
+ call_dissector(sub_handles[SUB_DATA], next_tvb, pinfo, tree);
+ }
+ }
- else if (sub_selected == SUB_ISO7816) {
- /* sent/received is from the perspective of the card reader */
- pinfo->p2p_dir = P2P_DIR_SENT;
- call_dissector(sub_handles[SUB_ISO7816], next_tvb, pinfo, tree);
- }
+ else if (sub_selected == SUB_ISO7816) {
+ /* sent/received is from the perspective of the card reader */
+ pinfo->p2p_dir = P2P_DIR_SENT;
+ call_dissector(sub_handles[SUB_ISO7816], next_tvb, pinfo, tree);
+ }
- /* The user probably wanted GSM SIM, or something else */
- else {
- call_dissector(sub_handles[sub_selected], next_tvb, pinfo, tree);
- }
+ /* The user probably wanted GSM SIM, or something else */
+ else {
+ call_dissector(sub_handles[sub_selected], next_tvb, pinfo, tree);
+ }
- }
+ }
- /* The user only wants plain data */
- else {
- call_dissector(sub_handles[SUB_DATA], next_tvb, pinfo, tree);
- }
+ /* The user only wants plain data */
+ else {
+ call_dissector(sub_handles[SUB_DATA], next_tvb, pinfo, tree);
+ }
- break;
+ break;
case PC_RDR_MECH:
- col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Mechanical");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Mechanical");
+ break;
case PC_RDR_ABORT:
- col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Abort");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Abort");
+ break;
case PC_RDR_DATA_CLOCK:
- col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Set Data Rate and Clock Frequency");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "PC to Reader: Set Data Rate and Clock Frequency");
+ break;
case RDR_PC_DATA_BLOCK:
- col_set_str(pinfo->cinfo, COL_INFO, "Reader to PC: Data Block");
- proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bStatus, tvb, 7, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bError, tvb, 8, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bChainParameter, tvb, 9, 1, ENC_LITTLE_ENDIAN);
-
- next_tvb = tvb_new_subset_remaining(tvb, 10);
-
- /* If the user has opted to use the PN532 dissector for PC -> Reader comms, then use it here */
- if (sub_selected == SUB_PN532_ACS_PSEUDO_APDU && tvb_get_guint8(tvb, 10) == 0xD5) {
- call_dissector(sub_handles[SUB_PN532_ACS_PSEUDO_APDU], next_tvb, pinfo, ccid_tree);
- }
+ col_set_str(pinfo->cinfo, COL_INFO, "Reader to PC: Data Block");
+ proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bStatus, tvb, 7, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bError, tvb, 8, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bChainParameter, tvb, 9, 1, ENC_LITTLE_ENDIAN);
+
+ next_tvb = tvb_new_subset_remaining(tvb, 10);
+
+ /* If the user has opted to use the PN532 dissector for PC -> Reader comms, then use it here */
+ if (sub_selected == SUB_PN532_ACS_PSEUDO_APDU && tvb_get_guint8(tvb, 10) == 0xD5) {
+ call_dissector(sub_handles[SUB_PN532_ACS_PSEUDO_APDU], next_tvb, pinfo, ccid_tree);
+ }
else if (sub_selected == SUB_ISO7816) {
- pinfo->p2p_dir = P2P_DIR_RECV;
- call_dissector(sub_handles[SUB_ISO7816], next_tvb, pinfo, tree);
+ pinfo->p2p_dir = P2P_DIR_RECV;
+ call_dissector(sub_handles[SUB_ISO7816], next_tvb, pinfo, tree);
}
- else {
- call_dissector(sub_handles[SUB_DATA], next_tvb, pinfo, ccid_tree);
- }
+ else {
+ call_dissector(sub_handles[SUB_DATA], next_tvb, pinfo, ccid_tree);
+ }
- break;
+ break;
case RDR_PC_SLOT_STATUS:
- proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bStatus, tvb, 7, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bError, tvb, 8, 1, ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ccid_tree, hf_ccid_bClockStatus, tvb, 9, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bStatus, tvb, 7, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bError, tvb, 8, 1, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ccid_tree, hf_ccid_bClockStatus, tvb, 9, 1, ENC_LITTLE_ENDIAN);
- col_set_str(pinfo->cinfo, COL_INFO, "Reader to PC: Slot Status");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "Reader to PC: Slot Status");
+ break;
case RDR_PC_PARAMS:
- col_set_str(pinfo->cinfo, COL_INFO, "Reader to PC: Parameters");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "Reader to PC: Parameters");
+ break;
case RDR_PC_ESCAPE:
- col_set_str(pinfo->cinfo, COL_INFO, "Reader to PC: Escape");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "Reader to PC: Escape");
+ break;
case RDR_PC_DATA_CLOCK:
- col_set_str(pinfo->cinfo, COL_INFO, "Reader to PC: Data Rate and Clock Frequency");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "Reader to PC: Data Rate and Clock Frequency");
+ break;
default:
- col_set_str(pinfo->cinfo, COL_INFO, "Unknown type");
- break;
+ col_set_str(pinfo->cinfo, COL_INFO, "Unknown type");
+ break;
}
}
@@ -429,7 +429,7 @@ proto_register_ccid(void)
{ "data", "Data", SUB_DATA },
{ "iso7816", "Generic ISO 7816", SUB_ISO7816 },
{ "gsm_sim", "GSM SIM", SUB_GSM_SIM },
- { "pn532", "NXP PN532 with ACS Pseudo-Header", SUB_PN532_ACS_PSEUDO_APDU},
+ { "pn532", "NXP PN532 with ACS Pseudo-Header", SUB_PN532_ACS_PSEUDO_APDU},
{ NULL, NULL, 0 }
};