diff options
Diffstat (limited to 'epan/dissectors/packet-tfp.c')
-rw-r--r-- | epan/dissectors/packet-tfp.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/epan/dissectors/packet-tfp.c b/epan/dissectors/packet-tfp.c index 19af67a4..47c28324 100644 --- a/epan/dissectors/packet-tfp.c +++ b/epan/dissectors/packet-tfp.c @@ -29,35 +29,35 @@ void proto_register_tfp(void); static dissector_handle_t tfp_handle_tcp; /* variables for creating the tree */ -static gint proto_tfp = -1; -static gint ett_tfp = -1; +static int proto_tfp; +static int ett_tfp; /* header field variables */ -static gint hf_tfp_uid = -1; -static gint hf_tfp_uid_numeric = -1; -static gint hf_tfp_len = -1; -static gint hf_tfp_fid = -1; -static gint hf_tfp_seq = -1; -static gint hf_tfp_r = -1; -static gint hf_tfp_a = -1; -static gint hf_tfp_oo = -1; -static gint hf_tfp_e = -1; -static gint hf_tfp_future_use = -1; -static gint hf_tfp_payload = -1; +static int hf_tfp_uid; +static int hf_tfp_uid_numeric; +static int hf_tfp_len; +static int hf_tfp_fid; +static int hf_tfp_seq; +static int hf_tfp_r; +static int hf_tfp_a; +static int hf_tfp_oo; +static int hf_tfp_e; +static int hf_tfp_future_use; +static int hf_tfp_payload; /* bit and byte offsets for dissection */ -static const gint byte_offset_len = 4; -static const gint byte_offset_fid = 5; -static const gint byte_count_tfp_uid = 4; -static const gint byte_count_tfp_len = 1; -static const gint byte_count_tfp_fid = 1; -static const gint byte_count_tfp_flags = 2; -static const gint bit_count_tfp_seq = 4; -static const gint bit_count_tfp_r = 1; -static const gint bit_count_tfp_a = 1; -static const gint bit_count_tfp_oo = 2; -static const gint bit_count_tfp_e = 2; -static const gint bit_count_tfp_future_use = 6; +static const int byte_offset_len = 4; +static const int byte_offset_fid = 5; +static const int byte_count_tfp_uid = 4; +static const int byte_count_tfp_len = 1; +static const int byte_count_tfp_fid = 1; +static const int byte_count_tfp_flags = 2; +static const int bit_count_tfp_seq = 4; +static const int bit_count_tfp_r = 1; +static const int bit_count_tfp_a = 1; +static const int bit_count_tfp_oo = 2; +static const int bit_count_tfp_e = 2; +static const int bit_count_tfp_future_use = 6; /* base58 encoding variable */ static const char BASE58_ALPHABET[] = @@ -65,12 +65,12 @@ static const char BASE58_ALPHABET[] = /* function for encoding a number to base58 string */ static void -base58_encode(guint32 value, char *str) { +base58_encode(uint32_t value, char *str) { - guint32 mod; - gint i = 0; - gint k; - gchar reverse_str[BASE58_MAX_STR_SIZE] = {'\0'}; + uint32_t mod; + int i = 0; + int k; + char reverse_str[BASE58_MAX_STR_SIZE] = {'\0'}; while (value >= 58) { mod = value % 58; @@ -94,19 +94,19 @@ base58_encode(guint32 value, char *str) { static void dissect_tfp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - gint byte_offset = 0; - gint bit_offset = 48; + int byte_offset = 0; + int bit_offset = 48; - guint8 hv_tfp_len; - guint8 hv_tfp_fid; - guint8 hv_tfp_seq; + uint8_t hv_tfp_len; + uint8_t hv_tfp_fid; + uint8_t hv_tfp_seq; - gchar tfp_uid_string[BASE58_MAX_STR_SIZE]; + char tfp_uid_string[BASE58_MAX_STR_SIZE]; base58_encode(tvb_get_letohl(tvb, 0), &tfp_uid_string[0]); - hv_tfp_len = tvb_get_guint8(tvb, byte_offset_len); - hv_tfp_fid = tvb_get_guint8(tvb, byte_offset_fid); + hv_tfp_len = tvb_get_uint8(tvb, byte_offset_len); + hv_tfp_fid = tvb_get_uint8(tvb, byte_offset_fid); hv_tfp_seq = tvb_get_bits8(tvb, bit_offset, bit_count_tfp_seq); col_add_fstr(pinfo->cinfo, COL_INFO, @@ -233,21 +233,21 @@ dissect_tfp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data } /* dissector function for dissecting USB payloads */ -static gboolean +static bool dissect_tfp_bulk_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data; + urb_info_t *urb = (urb_info_t *)data; - if ((usb_conv_info != NULL) && - (usb_conv_info->deviceVendor == tfp_USB_VENDOR_ID) && - (usb_conv_info->deviceProduct == tfp_USB_PRODUCT_ID)) { + if ((urb != NULL) && (urb->conv != NULL) && + (urb->conv->deviceVendor == tfp_USB_VENDOR_ID) && + (urb->conv->deviceProduct == tfp_USB_PRODUCT_ID)) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "TFP over USB"); col_clear(pinfo->cinfo, COL_INFO); dissect_tfp_common(tvb, pinfo, tree); - return TRUE; + return true; } - return FALSE; + return false; } /* protocol register function */ @@ -380,7 +380,7 @@ proto_register_tfp(void) }; /* setup protocol subtree array */ - static gint *ett[] = { + static int *ett[] = { &ett_tfp }; |