22 #ifndef FREERDP_TRANSPORT_IO_H
23 #define FREERDP_TRANSPORT_IO_H
25 #include <winpr/stream.h>
27 #include <freerdp/api.h>
28 #include <freerdp/types.h>
29 #include <freerdp/settings.h>
44 typedef int (*pTransportLayerRead)(
void* userContext,
void* data,
int bytes);
54 typedef int (*pTransportLayerWrite)(
void* userContext,
const void* data,
int bytes);
55 typedef BOOL (*pTransportLayerFkt)(
void* userContext);
56 typedef BOOL (*pTransportLayerWait)(
void* userContext, BOOL waitWrite, DWORD timeout);
57 typedef HANDLE (*pTransportLayerGetEvent)(
void* userContext);
64 ALIGN64
void* userContext;
65 ALIGN64 pTransportLayerRead Read;
66 ALIGN64 pTransportLayerWrite Write;
67 ALIGN64 pTransportLayerFkt Close;
68 ALIGN64 pTransportLayerWait Wait;
69 ALIGN64 pTransportLayerGetEvent GetEvent;
70 UINT64 reserved[64 - 6];
73 typedef int (*pTCPConnect)(rdpContext* context, rdpSettings* settings,
const char* hostname,
74 int port, DWORD timeout);
75 typedef BOOL (*pTransportFkt)(rdpTransport* transport);
76 typedef BOOL (*pTransportAttach)(rdpTransport* transport,
int sockfd);
77 typedef int (*pTransportRWFkt)(rdpTransport* transport,
wStream* s);
78 typedef SSIZE_T (*pTransportRead)(rdpTransport* transport, BYTE* data,
size_t bytes);
79 typedef BOOL (*pTransportGetPublicKey)(rdpTransport* transport,
const BYTE** data,
90 typedef BOOL (*pTransportSetBlockingMode)(rdpTransport* transport, BOOL blocking);
92 const char* hostname,
int port,
103 typedef BOOL (*pTransportAttachLayer)(rdpTransport* transport,
rdpTransportLayer* layer);
107 pTCPConnect TCPConnect;
108 pTransportFkt TLSConnect;
109 pTransportFkt TLSAccept;
110 pTransportAttach TransportAttach;
111 pTransportFkt TransportDisconnect;
112 pTransportRWFkt ReadPdu;
113 pTransportRWFkt WritePdu;
114 pTransportRead ReadBytes;
115 pTransportGetPublicKey GetPublicKey;
123 FREERDP_API BOOL freerdp_io_callback_set_event(rdpContext* context, BOOL set);
125 FREERDP_API
const rdpTransportIo* freerdp_get_io_callbacks(rdpContext* context);
126 FREERDP_API BOOL freerdp_set_io_callbacks(rdpContext* context,
127 const rdpTransportIo* io_callbacks);
129 FREERDP_API BOOL freerdp_set_io_callback_context(rdpContext* context,
void* usercontext);
130 FREERDP_API
void* freerdp_get_io_callback_context(rdpContext* context);
138 FREERDP_API SSIZE_T transport_parse_pdu(rdpTransport* transport,
wStream* s, BOOL* incomplete);
139 FREERDP_API rdpContext* transport_get_context(rdpTransport* transport);
140 FREERDP_API rdpTransport* freerdp_get_transport(rdpContext* context);
156 WINPR_ATTR_MALLOC(transport_layer_free, 1)
157 FREERDP_API
rdpTransportLayer* transport_layer_new(rdpTransport* transport,
size_t contextSize);
pTransportSetBlockingMode SetBlockingMode
pTransportAttachLayer AttachLayer
pTransportConnectLayer ConnectLayer