FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
server/echo.h
1
22#ifndef FREERDP_CHANNEL_ECHO_SERVER_H
23#define FREERDP_CHANNEL_ECHO_SERVER_H
24
25#include <freerdp/channels/wtsvc.h>
26
27#ifdef __cplusplus
28extern "C"
29{
30#endif
31
32 typedef enum ECHO_SERVER_OPEN_RESULT
33 {
34 ECHO_SERVER_OPEN_RESULT_OK = 0,
35 ECHO_SERVER_OPEN_RESULT_CLOSED = 1,
36 ECHO_SERVER_OPEN_RESULT_NOTSUPPORTED = 2,
37 ECHO_SERVER_OPEN_RESULT_ERROR = 3
38 } ECHO_SERVER_OPEN_RESULT;
39
40 typedef struct s_echo_server_context echo_server_context;
41
42 typedef BOOL (*psEchoServerChannelIdAssigned)(echo_server_context* context, UINT32 channelId);
43
44 typedef UINT (*psEchoServerOpen)(echo_server_context* context);
45 typedef UINT (*psEchoServerClose)(echo_server_context* context);
46 typedef BOOL (*psEchoServerRequest)(echo_server_context* context, const BYTE* buffer,
47 UINT32 length);
48
49 typedef UINT (*psEchoServerOpenResult)(echo_server_context* context,
50 ECHO_SERVER_OPEN_RESULT result);
51 typedef UINT (*psEchoServerResponse)(echo_server_context* context, const BYTE* buffer,
52 UINT32 length);
53
55 {
56 HANDLE vcm;
57
58 /* Server self-defined pointer. */
59 void* data;
60
61 /*** APIs called by the server. ***/
65 psEchoServerOpen Open;
69 psEchoServerClose Close;
73 psEchoServerRequest Request;
74
75 /*** Callbacks registered by the server. ***/
79 psEchoServerOpenResult OpenResult;
83 psEchoServerResponse Response;
84
85 rdpContext* rdpcontext;
86
90 psEchoServerChannelIdAssigned ChannelIdAssigned;
91 };
92
93 FREERDP_API void echo_server_context_free(echo_server_context* context);
94
95 WINPR_ATTR_MALLOC(echo_server_context_free, 1)
96 FREERDP_API echo_server_context* echo_server_context_new(HANDLE vcm);
97
98#ifdef __cplusplus
99}
100#endif
101
102#endif /* FREERDP_CHANNEL_ECHO_SERVER_H */
psEchoServerClose Close
Definition server/echo.h:69
psEchoServerOpenResult OpenResult
Definition server/echo.h:79
psEchoServerChannelIdAssigned ChannelIdAssigned
Definition server/echo.h:90
psEchoServerResponse Response
Definition server/echo.h:83
psEchoServerRequest Request
Definition server/echo.h:73
psEchoServerOpen Open
Definition server/echo.h:65