echo.h (2784B)
1/** 2 * FreeRDP: A Remote Desktop Protocol Implementation 3 * Echo Virtual Channel Extension 4 * 5 * Copyright 2014 Vic Lee 6 * Copyright 2015 Thincast Technologies GmbH 7 * Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com> 8 * 9 * Licensed under the Apache License, Version 2.0 (the "License"); 10 * you may not use this file except in compliance with the License. 11 * You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 */ 21 22#ifndef FREERDP_CHANNEL_ECHO_SERVER_H 23#define FREERDP_CHANNEL_ECHO_SERVER_H 24 25#include <freerdp/channels/wtsvc.h> 26 27typedef enum ECHO_SERVER_OPEN_RESULT 28{ 29 ECHO_SERVER_OPEN_RESULT_OK = 0, 30 ECHO_SERVER_OPEN_RESULT_CLOSED = 1, 31 ECHO_SERVER_OPEN_RESULT_NOTSUPPORTED = 2, 32 ECHO_SERVER_OPEN_RESULT_ERROR = 3 33} ECHO_SERVER_OPEN_RESULT; 34 35typedef struct _echo_server_context echo_server_context; 36 37typedef BOOL (*psEchoServerChannelIdAssigned)(echo_server_context* context, UINT32 channelId); 38 39typedef UINT (*psEchoServerOpen)(echo_server_context* context); 40typedef UINT (*psEchoServerClose)(echo_server_context* context); 41typedef BOOL (*psEchoServerRequest)(echo_server_context* context, const BYTE* buffer, 42 UINT32 length); 43 44typedef UINT (*psEchoServerOpenResult)(echo_server_context* context, 45 ECHO_SERVER_OPEN_RESULT result); 46typedef UINT (*psEchoServerResponse)(echo_server_context* context, const BYTE* buffer, 47 UINT32 length); 48 49struct _echo_server_context 50{ 51 HANDLE vcm; 52 53 /* Server self-defined pointer. */ 54 void* data; 55 56 /*** APIs called by the server. ***/ 57 /** 58 * Open the echo channel. 59 */ 60 psEchoServerOpen Open; 61 /** 62 * Close the echo channel. 63 */ 64 psEchoServerClose Close; 65 /** 66 * Send echo request PDU. 67 */ 68 psEchoServerRequest Request; 69 70 /*** Callbacks registered by the server. ***/ 71 /** 72 * Indicate whether the channel is opened successfully. 73 */ 74 psEchoServerOpenResult OpenResult; 75 /** 76 * Receive echo response PDU. 77 */ 78 psEchoServerResponse Response; 79 80 rdpContext* rdpcontext; 81 82 /** 83 * Callback, when the channel got its id assigned. 84 */ 85 psEchoServerChannelIdAssigned ChannelIdAssigned; 86}; 87 88#ifdef __cplusplus 89extern "C" 90{ 91#endif 92 93 FREERDP_API echo_server_context* echo_server_context_new(HANDLE vcm); 94 FREERDP_API void echo_server_context_free(echo_server_context* context); 95 96#ifdef __cplusplus 97} 98#endif 99 100#endif /* FREERDP_CHANNEL_ECHO_SERVER_H */