diff options
Diffstat (limited to 'epan/dissectors/packet-adb_service.c')
-rw-r--r-- | epan/dissectors/packet-adb_service.c | 117 |
1 files changed, 59 insertions, 58 deletions
diff --git a/epan/dissectors/packet-adb_service.c b/epan/dissectors/packet-adb_service.c index 53bf63612b..3caaa94c89 100644 --- a/epan/dissectors/packet-adb_service.c +++ b/epan/dissectors/packet-adb_service.c @@ -18,50 +18,50 @@ #include "packet-adb_service.h" -static int proto_adb_service = -1; - -static int hf_service = -1; -static int hf_fragment = -1; -static int hf_data = -1; -static int hf_hex_ascii_length = -1; -static int hf_length = -1; -static int hf_version = -1; -static int hf_hex_ascii_version = -1; -static int hf_framebuffer_version = -1; -static int hf_framebuffer_depth = -1; -static int hf_framebuffer_size = -1; -static int hf_framebuffer_width = -1; -static int hf_framebuffer_height = -1; -static int hf_framebuffer_red_offset = -1; -static int hf_framebuffer_red_length = -1; -static int hf_framebuffer_blue_offset = -1; -static int hf_framebuffer_blue_length = -1; -static int hf_framebuffer_green_offset = -1; -static int hf_framebuffer_green_length = -1; -static int hf_framebuffer_alpha_offset = -1; -static int hf_framebuffer_alpha_length = -1; -static int hf_framebuffer_pixel = -1; -static int hf_framebuffer_red_5 = -1; -static int hf_framebuffer_green_6 = -1; -static int hf_framebuffer_blue_5 = -1; -static int hf_framebuffer_red = -1; -static int hf_framebuffer_green = -1; -static int hf_framebuffer_blue = -1; -static int hf_framebuffer_alpha = -1; -static int hf_framebuffer_unused = -1; -static int hf_devices = -1; -static int hf_stdin = -1; -static int hf_stdout = -1; -static int hf_pids = -1; -static int hf_result = -1; - -static expert_field ei_incomplete_message = EI_INIT; - -static gint ett_adb_service = -1; -static gint ett_length = -1; -static gint ett_version = -1; -static gint ett_pixel = -1; -static gint ett_data = -1; +static int proto_adb_service; + +static int hf_service; +static int hf_fragment; +static int hf_data; +static int hf_hex_ascii_length; +static int hf_length; +static int hf_version; +static int hf_hex_ascii_version; +static int hf_framebuffer_version; +static int hf_framebuffer_depth; +static int hf_framebuffer_size; +static int hf_framebuffer_width; +static int hf_framebuffer_height; +static int hf_framebuffer_red_offset; +static int hf_framebuffer_red_length; +static int hf_framebuffer_blue_offset; +static int hf_framebuffer_blue_length; +static int hf_framebuffer_green_offset; +static int hf_framebuffer_green_length; +static int hf_framebuffer_alpha_offset; +static int hf_framebuffer_alpha_length; +static int hf_framebuffer_pixel; +static int hf_framebuffer_red_5; +static int hf_framebuffer_green_6; +static int hf_framebuffer_blue_5; +static int hf_framebuffer_red; +static int hf_framebuffer_green; +static int hf_framebuffer_blue; +static int hf_framebuffer_alpha; +static int hf_framebuffer_unused; +static int hf_devices; +static int hf_stdin; +static int hf_stdout; +static int hf_pids; +static int hf_result; + +static expert_field ei_incomplete_message; + +static gint ett_adb_service; +static gint ett_length; +static gint ett_version; +static gint ett_pixel; +static gint ett_data; static dissector_handle_t adb_service_handle; static dissector_handle_t logcat_handle; @@ -140,6 +140,7 @@ dissect_adb_service(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d wmem_tree_key_t key[5]; wmem_tree_t *subtree; guint32 i_key; + char *display_str; main_item = proto_tree_add_item(tree, proto_adb_service, tvb, offset, -1, ENC_NA); main_tree = proto_item_add_subtree(main_item, ett_adb_service); @@ -518,12 +519,12 @@ dissect_adb_service(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d offset = tvb_captured_length(tvb); } else if (g_str_has_prefix(service, "shell:")) { if (adb_service_data->direction == P2P_DIR_SENT) { - proto_tree_add_item(main_tree, hf_stdin, tvb, offset, -1, ENC_NA | ENC_ASCII); - col_append_fstr(pinfo->cinfo, COL_INFO, " Stdin=<%s>", tvb_format_text_wsp(pinfo->pool, tvb, offset, tvb_captured_length_remaining(tvb, offset))); + proto_tree_add_item_ret_display_string(main_tree, hf_stdin, tvb, offset, -1, ENC_ASCII, pinfo->pool, &display_str); + col_append_fstr(pinfo->cinfo, COL_INFO, " Stdin=<%s>", display_str); } else { - proto_tree_add_item(main_tree, hf_stdout, tvb, offset, -1, ENC_NA | ENC_ASCII); - col_append_fstr(pinfo->cinfo, COL_INFO, " Stdout=<%s>", tvb_format_text_wsp(pinfo->pool, tvb, offset, tvb_captured_length_remaining(tvb, offset))); + proto_tree_add_item_ret_display_string(main_tree, hf_stdout, tvb, offset, -1, ENC_ASCII, pinfo->pool, &display_str); + col_append_fstr(pinfo->cinfo, COL_INFO, " Stdout=<%s>", display_str); } offset = tvb_captured_length(tvb); } else if (g_str_has_prefix(service, "jdwp:")) { @@ -540,8 +541,8 @@ dissect_adb_service(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d g_str_has_prefix(service, "tcpip:") || g_str_has_prefix(service, "usb:")) { if (tvb_reported_length_remaining(tvb, offset)) { - proto_tree_add_item(main_tree, hf_result, tvb, offset, -1, ENC_NA | ENC_ASCII); - col_append_fstr(pinfo->cinfo, COL_INFO, " Result=<%s>", tvb_format_text_wsp(pinfo->pool, tvb, offset, tvb_captured_length_remaining(tvb, offset))); + proto_tree_add_item_ret_display_string(main_tree, hf_result, tvb, offset, -1, ENC_ASCII, pinfo->pool, &display_str); + col_append_fstr(pinfo->cinfo, COL_INFO, " Result=<%s>", display_str); offset = tvb_captured_length(tvb); } @@ -563,7 +564,7 @@ proto_register_adb_service(void) static hf_register_info hf[] = { { &hf_service, { "Service", "adb_service.service", - FT_STRING, STR_ASCII, NULL, 0x00, + FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_fragment, @@ -578,7 +579,7 @@ proto_register_adb_service(void) }, { &hf_hex_ascii_length, { "Hex ASCII String Length", "adb_service.hex_ascii_length", - FT_STRING, STR_ASCII, NULL, 0x00, + FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_length, @@ -593,7 +594,7 @@ proto_register_adb_service(void) }, { &hf_hex_ascii_version, { "Hex ASCII String Version", "adb_service.hex_ascii_version", - FT_STRING, STR_ASCII, NULL, 0x00, + FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_version, @@ -708,27 +709,27 @@ proto_register_adb_service(void) }, { &hf_devices, { "Devices", "adb_service.devices", - FT_STRING, STR_ASCII, NULL, 0x00, + FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_stdin, { "Stdin", "adb_service.stdin", - FT_STRING, STR_ASCII, NULL, 0x00, + FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_stdout, { "Stdout", "adb_service.stdout", - FT_STRING, STR_ASCII, NULL, 0x00, + FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_result, { "Result", "adb_service.result", - FT_STRING, STR_ASCII, NULL, 0x00, + FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_pids, { "PIDs", "adb_service.pids", - FT_STRING, STR_ASCII, NULL, 0x00, + FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, }; |