From 808fc210e307fcdfdedcd10fdfb1d70d414073f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Thu, 13 Dec 2012 23:54:54 -0500 Subject: [PATCH] libfreerdp-utils: remove hexdump utils in favor of WinPR utils --- channels/cliprdr/client/cliprdr_format.c | 2 +- channels/serial/client/serial_tty.c | 2 +- .../smartcard/client/smartcard_operations.c | 4 +- channels/tsmf/client/tsmf_codec.c | 4 +- client/Windows/wf_rail.c | 2 +- client/X11/xf_rail.c | 4 +- cunit/test_bitmap.c | 2 +- cunit/test_cliprdr.c | 6 +- cunit/test_drdynvc.c | 4 +- cunit/test_freerdp.c | 8 +-- cunit/test_freerdp.h | 2 +- cunit/test_gcc.c | 2 +- cunit/test_license.c | 22 +++---- cunit/test_mcs.c | 2 +- cunit/test_nsc.c | 8 +-- cunit/test_orders.c | 2 +- cunit/test_pcap.c | 2 +- cunit/test_rail.c | 14 ++--- cunit/test_rfx.c | 10 ++-- include/freerdp/crypto/certificate.h | 2 +- include/freerdp/utils/hexdump.h | 29 --------- libfreerdp/core/certificate.h | 2 +- libfreerdp/core/gateway/ntlm.h | 2 +- libfreerdp/core/gateway/rpc.c | 2 +- libfreerdp/core/gateway/rpc.h | 2 +- libfreerdp/core/license.c | 30 +++++----- libfreerdp/core/redirection.c | 4 +- libfreerdp/core/transport.c | 10 ++-- libfreerdp/rail/icon.c | 2 +- libfreerdp/rail/window.c | 4 +- libfreerdp/utils/CMakeLists.txt | 1 - libfreerdp/utils/hexdump.c | 60 ------------------- libfreerdp/utils/unicode.c | 2 +- 33 files changed, 82 insertions(+), 172 deletions(-) delete mode 100644 include/freerdp/utils/hexdump.h delete mode 100644 libfreerdp/utils/hexdump.c diff --git a/channels/cliprdr/client/cliprdr_format.c b/channels/cliprdr/client/cliprdr_format.c index e86d1a218..161f18f97 100644 --- a/channels/cliprdr/client/cliprdr_format.c +++ b/channels/cliprdr/client/cliprdr_format.c @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include #include diff --git a/channels/serial/client/serial_tty.c b/channels/serial/client/serial_tty.c index c42860311..21da19caf 100644 --- a/channels/serial/client/serial_tty.c +++ b/channels/serial/client/serial_tty.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #ifndef _WIN32 diff --git a/channels/smartcard/client/smartcard_operations.c b/channels/smartcard/client/smartcard_operations.c index 0be825b9c..817c49139 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include #include @@ -1547,7 +1547,7 @@ void smartcard_device_control(SMARTCARD_DEVICE* scard, IRP* irp) stream_set_pos(irp->output, pos); #ifdef WITH_DEBUG_SCARD - freerdp_hexdump(stream_get_data(irp->output), stream_get_length(irp->output)); + winpr_HexDump(stream_get_data(irp->output), stream_get_length(irp->output)); #endif irp->IoStatus = 0; diff --git a/channels/tsmf/client/tsmf_codec.c b/channels/tsmf/client/tsmf_codec.c index f610c638d..0dc2414ac 100644 --- a/channels/tsmf/client/tsmf_codec.c +++ b/channels/tsmf/client/tsmf_codec.c @@ -27,7 +27,7 @@ #include #include -#include +#include #include "tsmf_constants.h" #include "tsmf_types.h" @@ -425,7 +425,7 @@ BOOL tsmf_codec_parse_media_type(TS_AM_MEDIA_TYPE* mediatype, STREAM* s) DEBUG_DVC("cbFormat %d", cbFormat); #ifdef WITH_DEBUG_DVC - freerdp_hexdump(stream_get_tail(s), cbFormat); + winpr_HexDump(stream_get_tail(s), cbFormat); #endif switch (mediatype->FormatType) diff --git a/client/Windows/wf_rail.c b/client/Windows/wf_rail.c index 900be237c..9e2741097 100644 --- a/client/Windows/wf_rail.c +++ b/client/Windows/wf_rail.c @@ -22,7 +22,7 @@ #endif #include -#include +#include #include #include diff --git a/client/X11/xf_rail.c b/client/X11/xf_rail.c index a35aff5e3..fe9f1c8b6 100644 --- a/client/X11/xf_rail.c +++ b/client/X11/xf_rail.c @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include @@ -657,7 +657,7 @@ void xf_process_rail_appid_resp_event(xfInfo* xfi, rdpChannels* channels, RDP_EV "applicationId=(length=%d dump)\n", appid_resp->windowId, appid_resp->applicationId.length); - freerdp_hexdump(appid_resp->applicationId.string, appid_resp->applicationId.length); + winpr_HexDump(appid_resp->applicationId.string, appid_resp->applicationId.length); } void xf_process_rail_langbarinfo_event(xfInfo* xfi, rdpChannels* channels, RDP_EVENT* event) diff --git a/cunit/test_bitmap.c b/cunit/test_bitmap.c index 6759b2e95..e6a860757 100644 --- a/cunit/test_bitmap.c +++ b/cunit/test_bitmap.c @@ -18,7 +18,7 @@ */ #include -#include +#include #include #include diff --git a/cunit/test_cliprdr.c b/cunit/test_cliprdr.c index 636d400c9..f4ed13f0f 100644 --- a/cunit/test_cliprdr.c +++ b/cunit/test_cliprdr.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include "test_cliprdr.h" @@ -89,7 +89,7 @@ static const BYTE test_data_response_data[] = static int test_rdp_channel_data(freerdp* instance, int chan_id, BYTE* data, int data_size) { printf("chan_id %d data_size %d\n", chan_id, data_size); - freerdp_hexdump(data, data_size); + winpr_HexDump(data, data_size); return 0; } @@ -238,7 +238,7 @@ void test_cliprdr(void) { data_response_event = (RDP_CB_DATA_RESPONSE_EVENT*)event; printf("Data response size: %d\n", data_response_event->size); - freerdp_hexdump(data_response_event->data, data_response_event->size); + winpr_HexDump(data_response_event->data, data_response_event->size); } freerdp_event_free(event); diff --git a/cunit/test_drdynvc.c b/cunit/test_drdynvc.c index c293f935c..fcbadcf22 100644 --- a/cunit/test_drdynvc.c +++ b/cunit/test_drdynvc.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include "test_drdynvc.h" @@ -60,7 +60,7 @@ static int data_received = 0; static int test_rdp_channel_data(freerdp* instance, int chan_id, BYTE* data, int data_size) { printf("chan_id %d data_size %d\n", chan_id, data_size); - freerdp_hexdump(data, data_size); + winpr_HexDump(data, data_size); data_received = 1; return 0; } diff --git a/cunit/test_freerdp.c b/cunit/test_freerdp.c index 46b8bedbe..dc18a4186 100644 --- a/cunit/test_freerdp.c +++ b/cunit/test_freerdp.c @@ -77,10 +77,10 @@ void assert_stream(STREAM* s, BYTE* data, int length, const char* func, int line printf("\n %s (%d): length mismatch, actual:%d, expected:%d\n", func, line, actual_length, length); printf("\nActual:\n"); - freerdp_hexdump(actual_data, actual_length); + winpr_HexDump(actual_data, actual_length); printf("Expected:\n"); - freerdp_hexdump(data, length); + winpr_HexDump(data, length); CU_FAIL("assert_stream, length mismatch"); return; @@ -93,10 +93,10 @@ void assert_stream(STREAM* s, BYTE* data, int length, const char* func, int line printf("\n %s (%d): buffer mismatch:\n", func, line); printf("\nActual:\n"); - freerdp_hexdump(actual_data, length); + winpr_HexDump(actual_data, length); printf("Expected:\n"); - freerdp_hexdump(data, length); + winpr_HexDump(data, length); CU_FAIL("assert_stream, buffer mismatch"); return; diff --git a/cunit/test_freerdp.h b/cunit/test_freerdp.h index 7a537f443..1d6370e92 100644 --- a/cunit/test_freerdp.h +++ b/cunit/test_freerdp.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #define add_test_suite(name) \ CU_pSuite pSuite; \ diff --git a/cunit/test_gcc.c b/cunit/test_gcc.c index 5d6e40a66..3fd65a11e 100644 --- a/cunit/test_gcc.c +++ b/cunit/test_gcc.c @@ -20,7 +20,7 @@ #include "gcc.h" #include -#include +#include #include #include "test_gcc.h" diff --git a/cunit/test_license.c b/cunit/test_license.c index f19b3259a..cd933deea 100644 --- a/cunit/test_license.c +++ b/cunit/test_license.c @@ -20,7 +20,7 @@ #include "license.h" #include -#include +#include #include #include "test_license.h" @@ -327,44 +327,44 @@ void test_license(void) printf("\n"); printf("client random:\n"); - freerdp_hexdump(license->client_random, 32); + winpr_HexDump(license->client_random, 32); printf("\n"); printf("server random:\n"); - freerdp_hexdump(license->server_random, 32); + winpr_HexDump(license->server_random, 32); printf("\n"); printf("premaster secret:\n"); - freerdp_hexdump(license->premaster_secret, 48); + winpr_HexDump(license->premaster_secret, 48); printf("\n"); printf("master secret:\n"); - freerdp_hexdump(license->master_secret, 48); + winpr_HexDump(license->master_secret, 48); printf("\n"); printf("session key blob:\n"); - freerdp_hexdump(license->session_key_blob, 48); + winpr_HexDump(license->session_key_blob, 48); printf("\n"); printf("licensing encryption key:\n"); - freerdp_hexdump(license->licensing_encryption_key, 16); + winpr_HexDump(license->licensing_encryption_key, 16); printf("\n"); printf("mac salt key:\n"); - freerdp_hexdump(license->mac_salt_key, 16); + winpr_HexDump(license->mac_salt_key, 16); printf("\n"); printf("modulus:\n"); - freerdp_hexdump(license->certificate->cert_info.modulus.data, + winpr_HexDump(license->certificate->cert_info.modulus.data, license->certificate->cert_info.modulus.length); printf("\n"); printf("exponent:\n"); - freerdp_hexdump(license->certificate->cert_info.exponent, 4); + winpr_HexDump(license->certificate->cert_info.exponent, 4); printf("\n"); printf("encrypted premaster secret:\n"); - freerdp_hexdump(license->encrypted_premaster_secret->data, + winpr_HexDump(license->encrypted_premaster_secret->data, license->encrypted_premaster_secret->length); printf("\n"); #endif diff --git a/cunit/test_mcs.c b/cunit/test_mcs.c index 6f1fd6e0d..2ddb70c47 100644 --- a/cunit/test_mcs.c +++ b/cunit/test_mcs.c @@ -20,7 +20,7 @@ #include "mcs.h" #include -#include +#include #include #include "test_mcs.h" diff --git a/cunit/test_nsc.c b/cunit/test_nsc.c index 4c0edb888..4e74cd5b0 100644 --- a/cunit/test_nsc.c +++ b/cunit/test_nsc.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include "test_nsc.h" @@ -337,7 +337,7 @@ void test_nsc_decode(void) context = nsc_context_new(); nsc_context_set_cpu_opt(context, CPU_SSE2); nsc_process_message(context, 32, 15, 10, (BYTE*) nsc_data, sizeof(nsc_data)); - /*freerdp_hexdump(context->bmpdata, 15 * 10 * 4);*/ + /*winpr_HexDump(context->bmpdata, 15 * 10 * 4);*/ for (i = 0; i < 30000; i++) { nsc_process_message(context, 32, 54, 44, (BYTE*) nsc_stress_data, sizeof(nsc_stress_data)); @@ -368,9 +368,9 @@ void test_nsc_encode(void) stream_set_pos(enc_stream, 0); nsc_compose_message(context, enc_stream, rgb_data, 64, 64, 64 * 3); } - /*freerdp_hexdump(stream_get_head(enc_stream), stream_get_length(enc_stream));*/ + /*winpr_HexDump(stream_get_head(enc_stream), stream_get_length(enc_stream));*/ nsc_process_message(context, 32, 64, 64, stream_get_head(enc_stream), stream_get_length(enc_stream)); - /*freerdp_hexdump(context->bmpdata, 64 * 64 * 4);*/ + /*winpr_HexDump(context->bmpdata, 64 * 64 * 4);*/ stream_free(enc_stream); nsc_context_free(context); diff --git a/cunit/test_orders.c b/cunit/test_orders.c index 63ee2cec5..da015a46c 100644 --- a/cunit/test_orders.c +++ b/cunit/test_orders.c @@ -18,7 +18,7 @@ */ #include -#include +#include #include #include "test_orders.h" diff --git a/cunit/test_pcap.c b/cunit/test_pcap.c index 1b2711ff5..9d6e5de64 100644 --- a/cunit/test_pcap.c +++ b/cunit/test_pcap.c @@ -18,7 +18,7 @@ */ #include -#include +#include #include #include "test_pcap.h" diff --git a/cunit/test_rail.c b/cunit/test_rail.c index 810ab322c..a8b113091 100644 --- a/cunit/test_rail.c +++ b/cunit/test_rail.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include @@ -446,10 +446,10 @@ int stream_equal_dump(void * dataS, size_t sizeS, void * data, size_t size) printf("Stream and dump have different length (%d != %d)\n", (int) sizeS, (int) size); printf("Stream hexdump:\n"); - freerdp_hexdump(dataS, sizeS); + winpr_HexDump(dataS, sizeS); printf("Dump hexdump:\n"); - freerdp_hexdump(data, size); + winpr_HexDump(data, size); printf("----------------- stream_equal_dump -----------------\n"); return 0; @@ -463,10 +463,10 @@ int stream_equal_dump(void * dataS, size_t sizeS, void * data, size_t size) printf("----------------- stream_equal_dump -----------------\n"); printf("Stream and dump have different content from %d offset.\n", (int) i); printf("Stream hexdump:\n"); - freerdp_hexdump(dataS, sizeS); + winpr_HexDump(dataS, sizeS); printf("Dump hexdump:\n"); - freerdp_hexdump(data, size); + winpr_HexDump(data, size); printf("----------------- stream_equal_dump -----------------\n"); return 0; } @@ -511,7 +511,7 @@ static void emulate_server_send_channel_data( counter++; printf("Emulate server packet (%d packet):\n", counter); - freerdp_hexdump(data, size); + winpr_HexDump(data, size); freerdp_channels_data(instance, 0, (char*)data, size, CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, size); @@ -539,7 +539,7 @@ static int emulate_client_send_channel_data( counter++; printf("Client send to server (%d packet):\n", counter); - freerdp_hexdump(data, size); + winpr_HexDump(data, size); // add to global dumps list save_dump(data, size); diff --git a/cunit/test_rfx.c b/cunit/test_rfx.c index 613153c77..ff8e5c6bf 100644 --- a/cunit/test_rfx.c +++ b/cunit/test_rfx.c @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include "rfx_types.h" @@ -337,7 +337,7 @@ void test_encode(void) rgb_data = (BYTE *) malloc(64 * 64 * 3); for (i = 0; i < 64; i++) memcpy(rgb_data + i * 64 * 3, rgb_scanline_data, 64 * 3); - //freerdp_hexdump(rgb_data, 64 * 64 * 3); + //winpr_HexDump(rgb_data, 64 * 64 * 3); enc_stream = stream_new(65536); stream_clear(enc_stream); @@ -352,11 +352,11 @@ void test_encode(void) //dump_buffer(context->priv->cb_g_buffer, 4096); /*printf("*** Y ***\n"); - freerdp_hexdump(stream_get_head(enc_stream), y_size); + winpr_HexDump(stream_get_head(enc_stream), y_size); printf("*** Cb ***\n"); - freerdp_hexdump(stream_get_head(enc_stream) + y_size, cb_size); + winpr_HexDump(stream_get_head(enc_stream) + y_size, cb_size); printf("*** Cr ***\n"); - freerdp_hexdump(stream_get_head(enc_stream) + y_size + cb_size, cr_size);*/ + winpr_HexDump(stream_get_head(enc_stream) + y_size + cb_size, cr_size);*/ stream_set_pos(enc_stream, 0); rfx_decode_rgb(context, enc_stream, diff --git a/include/freerdp/crypto/certificate.h b/include/freerdp/crypto/certificate.h index 117179359..8a496b693 100644 --- a/include/freerdp/crypto/certificate.h +++ b/include/freerdp/crypto/certificate.h @@ -29,7 +29,7 @@ typedef struct rdp_certificate_store rdpCertificateStore; #include #include #include -#include +#include struct rdp_certificate_data { diff --git a/include/freerdp/utils/hexdump.h b/include/freerdp/utils/hexdump.h deleted file mode 100644 index 7485f117e..000000000 --- a/include/freerdp/utils/hexdump.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * FreeRDP: A Remote Desktop Protocol Implementation - * Hex Dump Utils - * - * Copyright 2011 Marc-Andre Moreau - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __UTILS_HEXDUMP_H -#define __UTILS_HEXDUMP_H - -#include - -#define FREERDP_HEXDUMP_LINE_LENGTH 16 - -FREERDP_API void freerdp_hexdump(BYTE* data, int length); - -#endif /* __UTILS_HEXDUMP_H */ diff --git a/libfreerdp/core/certificate.h b/libfreerdp/core/certificate.h index 51b4f4969..c92c74b76 100644 --- a/libfreerdp/core/certificate.h +++ b/libfreerdp/core/certificate.h @@ -27,7 +27,7 @@ #include #include -#include +#include /* Certificate Version */ #define CERT_CHAIN_VERSION_1 0x00000001 diff --git a/libfreerdp/core/gateway/ntlm.h b/libfreerdp/core/gateway/ntlm.h index 554d19508..ce1dfb7a5 100644 --- a/libfreerdp/core/gateway/ntlm.h +++ b/libfreerdp/core/gateway/ntlm.h @@ -40,7 +40,7 @@ typedef struct rdp_ntlm_http rdpNtlmHttp; #include #include #include -#include +#include struct rdp_ntlm { diff --git a/libfreerdp/core/gateway/rpc.c b/libfreerdp/core/gateway/rpc.c index 6a2db175a..5d0e00b6a 100644 --- a/libfreerdp/core/gateway/rpc.c +++ b/libfreerdp/core/gateway/rpc.c @@ -337,7 +337,7 @@ int rpc_in_write(rdpRpc* rpc, BYTE* data, int length) #ifdef WITH_DEBUG_TSG rpc_pdu_header_print((rpcconn_hdr_t*) data); printf("Sending PDU (length: %d)\n", length); - freerdp_hexdump(data, length); + winpr_HexDump(data, length); #endif status = tls_write_all(rpc->TlsIn, data, length); diff --git a/libfreerdp/core/gateway/rpc.h b/libfreerdp/core/gateway/rpc.h index daf927f29..bcde49589 100644 --- a/libfreerdp/core/gateway/rpc.h +++ b/libfreerdp/core/gateway/rpc.h @@ -79,7 +79,7 @@ typedef struct _RPC_PDU #include #include #include -#include +#include /** * CAE Specification diff --git a/libfreerdp/core/license.c b/libfreerdp/core/license.c index 44f325531..ad2f52ac5 100644 --- a/libfreerdp/core/license.c +++ b/libfreerdp/core/license.c @@ -155,7 +155,7 @@ BOOL license_send(rdpLicense* license, STREAM* s, BYTE type) #ifdef WITH_DEBUG_LICENSE printf("Sending %s Packet, length %d\n", LICENSE_MESSAGE_STRINGS[type & 0x1F], wMsgSize); - freerdp_hexdump(s->p - 4, wMsgSize); + winpr_HexDump(s->p - 4, wMsgSize); #endif stream_set_pos(s, length); @@ -267,25 +267,25 @@ void license_generate_keys(rdpLicense* license) #ifdef WITH_DEBUG_LICENSE printf("ClientRandom:\n"); - freerdp_hexdump(license->client_random, CLIENT_RANDOM_LENGTH); + winpr_HexDump(license->client_random, CLIENT_RANDOM_LENGTH); printf("ServerRandom:\n"); - freerdp_hexdump(license->server_random, SERVER_RANDOM_LENGTH); + winpr_HexDump(license->server_random, SERVER_RANDOM_LENGTH); printf("PremasterSecret:\n"); - freerdp_hexdump(license->premaster_secret, PREMASTER_SECRET_LENGTH); + winpr_HexDump(license->premaster_secret, PREMASTER_SECRET_LENGTH); printf("MasterSecret:\n"); - freerdp_hexdump(license->master_secret, MASTER_SECRET_LENGTH); + winpr_HexDump(license->master_secret, MASTER_SECRET_LENGTH); printf("SessionKeyBlob:\n"); - freerdp_hexdump(license->session_key_blob, SESSION_KEY_BLOB_LENGTH); + winpr_HexDump(license->session_key_blob, SESSION_KEY_BLOB_LENGTH); printf("MacSaltKey:\n"); - freerdp_hexdump(license->mac_salt_key, MAC_SALT_KEY_LENGTH); + winpr_HexDump(license->mac_salt_key, MAC_SALT_KEY_LENGTH); printf("LicensingEncryptionKey:\n"); - freerdp_hexdump(license->licensing_encryption_key, LICENSING_ENCRYPTION_KEY_LENGTH); + winpr_HexDump(license->licensing_encryption_key, LICENSING_ENCRYPTION_KEY_LENGTH); #endif } @@ -327,10 +327,10 @@ void license_encrypt_premaster_secret(rdpLicense* license) #ifdef WITH_DEBUG_LICENSE printf("modulus (%d bits):\n", key_length * 8); - freerdp_hexdump(modulus, key_length); + winpr_HexDump(modulus, key_length); printf("exponent:\n"); - freerdp_hexdump(exponent, 4); + winpr_HexDump(exponent, 4); #endif encrypted_premaster_secret = (BYTE*) malloc(MODULUS_MAX_SIZE); @@ -369,11 +369,11 @@ void license_decrypt_platform_challenge(rdpLicense* license) #ifdef WITH_DEBUG_LICENSE printf("encrypted_platform challenge:\n"); - freerdp_hexdump(license->encrypted_platform_challenge->data, + winpr_HexDump(license->encrypted_platform_challenge->data, license->encrypted_platform_challenge->length); printf("platform challenge:\n"); - freerdp_hexdump(license->platform_challenge->data, license->platform_challenge->length); + winpr_HexDump(license->platform_challenge->data, license->platform_challenge->length); #endif crypto_rc4_free(rc4); @@ -851,13 +851,13 @@ void license_send_platform_challenge_response_packet(rdpLicense* license) #ifdef WITH_DEBUG_LICENSE printf("Licensing Encryption Key:\n"); - freerdp_hexdump(license->licensing_encryption_key, 16); + winpr_HexDump(license->licensing_encryption_key, 16); printf("HardwareID:\n"); - freerdp_hexdump(license->hwid, 20); + winpr_HexDump(license->hwid, 20); printf("Encrypted HardwareID:\n"); - freerdp_hexdump(buffer, 20); + winpr_HexDump(buffer, 20); #endif license->encrypted_hwid->type = BB_DATA_BLOB; diff --git a/libfreerdp/core/redirection.c b/libfreerdp/core/redirection.c index 27a8bdcd3..ea6c6070c 100644 --- a/libfreerdp/core/redirection.c +++ b/libfreerdp/core/redirection.c @@ -91,7 +91,7 @@ BOOL rdp_recv_server_redirection_pdu(rdpRdp* rdp, STREAM* s) stream_read(s, redirection->LoadBalanceInfo, redirection->LoadBalanceInfoLength); #ifdef WITH_DEBUG_REDIR DEBUG_REDIR("loadBalanceInfo:"); - freerdp_hexdump(redirection->LoadBalanceInfo, redirection->LoadBalanceInfoLength); + winpr_HexDump(redirection->LoadBalanceInfo, redirection->LoadBalanceInfoLength); #endif } @@ -116,7 +116,7 @@ BOOL rdp_recv_server_redirection_pdu(rdpRdp* rdp, STREAM* s) #ifdef WITH_DEBUG_REDIR DEBUG_REDIR("password_cookie:"); - freerdp_hexdump(redirection->PasswordCookie, redirection->PasswordCookieLength); + winpr_HexDump(redirection->PasswordCookie, redirection->PasswordCookieLength); #endif } diff --git a/libfreerdp/core/transport.c b/libfreerdp/core/transport.c index 06c037c72..f18c8b88d 100644 --- a/libfreerdp/core/transport.c +++ b/libfreerdp/core/transport.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include @@ -397,7 +397,7 @@ int transport_read(rdpTransport* transport, STREAM* s) if (stream_bytes + status >= pdu_bytes) { printf("Local < Remote\n"); - freerdp_hexdump(s->data, pdu_bytes); + winpr_HexDump(s->data, pdu_bytes); } #endif @@ -432,7 +432,7 @@ int transport_read(rdpTransport* transport, STREAM* s) if (status > 0) { printf("Local < Remote\n"); - freerdp_hexdump(s->data, status); + winpr_HexDump(s->data, status); } #endif @@ -468,7 +468,7 @@ int transport_write(rdpTransport* transport, STREAM* s) if (length > 0) { printf("Local > Remote\n"); - freerdp_hexdump(s->data, length); + winpr_HexDump(s->data, length); } #endif @@ -601,7 +601,7 @@ int transport_check_fds(rdpTransport** ptransport) if (length == 0) { printf("transport_check_fds: protocol error, not a TPKT or Fast Path header.\n"); - freerdp_hexdump(stream_get_head(transport->recv_buffer), pos); + winpr_HexDump(stream_get_head(transport->recv_buffer), pos); return -1; } diff --git a/libfreerdp/rail/icon.c b/libfreerdp/rail/icon.c index 1334b8aea..3fc029dcc 100644 --- a/libfreerdp/rail/icon.c +++ b/libfreerdp/rail/icon.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include diff --git a/libfreerdp/rail/window.c b/libfreerdp/rail/window.c index 3fc0145d6..7d65343fa 100644 --- a/libfreerdp/rail/window.c +++ b/libfreerdp/rail/window.c @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include "librail.h" @@ -176,7 +176,7 @@ void window_state_update(rdpWindow* window, WINDOW_ORDER_INFO* orderInfo, WINDOW memcpy(window->titleInfo.string, window_state->titleInfo.string, window->titleInfo.length); #ifdef WITH_DEBUG_RAIL - freerdp_hexdump(window->titleInfo.string, window->titleInfo.length); + winpr_HexDump(window->titleInfo.string, window->titleInfo.length); #endif } diff --git a/libfreerdp/utils/CMakeLists.txt b/libfreerdp/utils/CMakeLists.txt index 6fcf9fa89..d050f2c7d 100644 --- a/libfreerdp/utils/CMakeLists.txt +++ b/libfreerdp/utils/CMakeLists.txt @@ -22,7 +22,6 @@ set(${MODULE_PREFIX}_SRCS dsp.c event.c bitmap.c - hexdump.c list.c file.c passphrase.c diff --git a/libfreerdp/utils/hexdump.c b/libfreerdp/utils/hexdump.c deleted file mode 100644 index 0f20709e0..000000000 --- a/libfreerdp/utils/hexdump.c +++ /dev/null @@ -1,60 +0,0 @@ -/** - * FreeRDP: A Remote Desktop Protocol Implementation - * Hex Dump Utils - * - * Copyright 2011 Marc-Andre Moreau - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include - -#include - -void freerdp_hexdump(BYTE* data, int length) -{ - BYTE* p = data; - int i, line, offset = 0; - - while (offset < length) - { - printf("%04x ", offset); - - line = length - offset; - - if (line > FREERDP_HEXDUMP_LINE_LENGTH) - line = FREERDP_HEXDUMP_LINE_LENGTH; - - for (i = 0; i < line; i++) - printf("%02x ", p[i]); - - for (; i < FREERDP_HEXDUMP_LINE_LENGTH; i++) - printf(" "); - - for (i = 0; i < line; i++) - printf("%c", (p[i] >= 0x20 && p[i] < 0x7F) ? p[i] : '.'); - - printf("\n"); - - offset += line; - p += line; - } -} - diff --git a/libfreerdp/utils/unicode.c b/libfreerdp/utils/unicode.c index 6bfe9d7a9..fc582e20a 100644 --- a/libfreerdp/utils/unicode.c +++ b/libfreerdp/utils/unicode.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include