diff options
Diffstat (limited to 'epan/dissectors/packet-rfid-pn532-hci.c')
-rw-r--r-- | epan/dissectors/packet-rfid-pn532-hci.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/epan/dissectors/packet-rfid-pn532-hci.c b/epan/dissectors/packet-rfid-pn532-hci.c index 732667ba..41f18e77 100644 --- a/epan/dissectors/packet-rfid-pn532-hci.c +++ b/epan/dissectors/packet-rfid-pn532-hci.c @@ -19,24 +19,24 @@ #include <epan/expert.h> #include "packet-usb.h" -static int proto_pn532_hci = -1; -static int hf_preamble = -1; -static int hf_start_code = -1; -static int hf_length = -1; -static int hf_length_checksum = -1; -static int hf_length_checksum_status = -1; -static int hf_extended_length = -1; -static int hf_packet_code = -1; -static int hf_postable = -1; -static int hf_specific_application_level_error_code = -1; -static int hf_data_checksum = -1; -static int hf_data_checksum_status = -1; -static int hf_ignored = -1; - -static gint ett_pn532_hci = -1; - -static expert_field ei_invalid_length_checksum = EI_INIT; -static expert_field ei_invalid_data_checksum = EI_INIT; +static int proto_pn532_hci; +static int hf_preamble; +static int hf_start_code; +static int hf_length; +static int hf_length_checksum; +static int hf_length_checksum_status; +static int hf_extended_length; +static int hf_packet_code; +static int hf_postable; +static int hf_specific_application_level_error_code; +static int hf_data_checksum; +static int hf_data_checksum_status; +static int hf_ignored; + +static int ett_pn532_hci; + +static expert_field ei_invalid_length_checksum; +static expert_field ei_invalid_data_checksum; static dissector_handle_t pn532_handle; static dissector_handle_t pn532_hci_handle; @@ -52,22 +52,22 @@ static const value_string packet_code_vals[] = { void proto_register_pn532_hci(void); void proto_reg_handoff_pn532_hci(void); -static gint +static int dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_item *main_item; proto_tree *main_tree; - gint offset = 0; + int offset = 0; tvbuff_t *next_tvb; - guint16 packet_code; - guint16 length; - guint8 checksum; - usb_conv_info_t *usb_conv_info; + uint16_t packet_code; + uint16_t length; + uint8_t checksum; + urb_info_t *urb; /* Reject the packet if data is NULL */ if (data == NULL) return 0; - usb_conv_info = (usb_conv_info_t *)data; + urb = (urb_info_t *)data; length = tvb_captured_length_remaining(tvb, offset); if (length < 6) return offset; @@ -116,18 +116,18 @@ dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat length = tvb_get_ntohs(tvb, offset); offset += 2; - checksum = (length >> 8) + (length & 0xFF) + tvb_get_guint8(tvb, offset); + checksum = (length >> 8) + (length & 0xFF) + tvb_get_uint8(tvb, offset); proto_tree_add_checksum(main_tree, tvb, offset, hf_length_checksum, hf_length_checksum_status, &ei_invalid_length_checksum, pinfo, checksum, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY|PROTO_CHECKSUM_ZERO); offset += 1; next_tvb = tvb_new_subset_length(tvb, offset, length); - call_dissector_with_data(pn532_handle, next_tvb, pinfo, tree, usb_conv_info); + call_dissector_with_data(pn532_handle, next_tvb, pinfo, tree, urb); offset += length; - checksum = tvb_get_guint8(tvb, offset); + checksum = tvb_get_uint8(tvb, offset); while (length) { - checksum += tvb_get_guint8(tvb, offset - length); + checksum += tvb_get_uint8(tvb, offset - length); length -= 1; } proto_tree_add_checksum(main_tree, tvb, offset, hf_data_checksum, hf_data_checksum_status, &ei_invalid_data_checksum, pinfo, 0, @@ -137,22 +137,22 @@ dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat col_set_str(pinfo->cinfo, COL_INFO, "Normal Information Frame"); proto_tree_add_item(main_tree, hf_length, tvb, offset, 1, ENC_BIG_ENDIAN); - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); offset += 1; - checksum = length + tvb_get_guint8(tvb, offset); + checksum = length + tvb_get_uint8(tvb, offset); proto_tree_add_checksum(main_tree, tvb, offset, hf_length_checksum, hf_length_checksum_status, &ei_invalid_length_checksum, pinfo, checksum, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY|PROTO_CHECKSUM_ZERO); offset += 1; next_tvb = tvb_new_subset_length(tvb, offset, length); - call_dissector_with_data(pn532_handle, next_tvb, pinfo, tree, usb_conv_info); + call_dissector_with_data(pn532_handle, next_tvb, pinfo, tree, urb); offset += length; proto_tree_add_item(main_tree, hf_data_checksum, tvb, offset, 1, ENC_BIG_ENDIAN); - checksum = tvb_get_guint8(tvb, offset); + checksum = tvb_get_uint8(tvb, offset); while (length) { - checksum += tvb_get_guint8(tvb, offset - length); + checksum += tvb_get_uint8(tvb, offset - length); length -= 1; } if (checksum != 0) { @@ -249,7 +249,7 @@ proto_register_pn532_hci(void) } }; - static gint *ett[] = { + static int *ett[] = { &ett_pn532_hci }; |