2011-07-01 05:23:36 +04:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Client
|
|
|
|
* FreeRDP Interface
|
|
|
|
*
|
|
|
|
* Copyright 2009-2011 Jay Sorg
|
|
|
|
*
|
|
|
|
* 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 __FREERDP_H
|
|
|
|
#define __FREERDP_H
|
|
|
|
|
2011-10-16 08:50:10 +04:00
|
|
|
typedef struct rdp_rdp rdpRdp;
|
|
|
|
typedef struct rdp_gdi rdpGdi;
|
|
|
|
typedef struct rdp_rail rdpRail;
|
|
|
|
typedef struct rdp_cache rdpCache;
|
2011-10-17 04:10:09 +04:00
|
|
|
typedef struct rdp_channels rdpChannels;
|
2011-10-21 01:28:59 +04:00
|
|
|
typedef struct rdp_graphics rdpGraphics;
|
2011-10-17 04:10:09 +04:00
|
|
|
|
2011-08-16 01:19:59 +04:00
|
|
|
typedef struct rdp_freerdp freerdp;
|
2011-10-16 08:50:10 +04:00
|
|
|
typedef struct rdp_context rdpContext;
|
2011-10-18 11:10:12 +04:00
|
|
|
typedef struct rdp_freerdp_peer freerdp_peer;
|
2011-08-16 01:19:59 +04:00
|
|
|
|
2011-07-07 07:08:37 +04:00
|
|
|
#include <freerdp/api.h>
|
2011-07-07 21:37:48 +04:00
|
|
|
#include <freerdp/types.h>
|
2011-07-07 07:22:14 +04:00
|
|
|
#include <freerdp/settings.h>
|
|
|
|
#include <freerdp/extension.h>
|
2011-07-01 05:23:36 +04:00
|
|
|
|
2011-07-28 08:38:25 +04:00
|
|
|
#include <freerdp/input.h>
|
|
|
|
#include <freerdp/update.h>
|
|
|
|
|
2011-07-01 05:23:36 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2011-10-21 07:15:18 +04:00
|
|
|
typedef void (*pContextNew)(freerdp* instance, rdpContext* context);
|
|
|
|
typedef void (*pContextFree)(freerdp* instance, rdpContext* context);
|
2011-07-28 08:38:25 +04:00
|
|
|
|
2011-10-21 07:15:18 +04:00
|
|
|
typedef boolean (*pPreConnect)(freerdp* instance);
|
|
|
|
typedef boolean (*pPostConnect)(freerdp* instance);
|
|
|
|
typedef boolean (*pAuthenticate)(freerdp* instance, char** username, char** password, char** domain);
|
|
|
|
typedef boolean (*pVerifyCertificate)(freerdp* instance, char* subject, char* issuer, char* fingerprint);
|
2011-10-17 05:02:28 +04:00
|
|
|
|
2011-10-21 07:15:18 +04:00
|
|
|
typedef int (*pSendChannelData)(freerdp* instance, int channelId, uint8* data, int size);
|
|
|
|
typedef int (*pReceiveChannelData)(freerdp* instance, int channelId, uint8* data, int size, int flags, int total_size);
|
2011-10-16 08:50:10 +04:00
|
|
|
|
|
|
|
struct rdp_context
|
|
|
|
{
|
2011-11-20 23:25:59 +04:00
|
|
|
freerdp* instance; /* 0 */
|
|
|
|
freerdp_peer* peer; /* 1 */
|
|
|
|
uint32 paddingA[16 - 2]; /* 2 */
|
|
|
|
|
|
|
|
int argc; /* 16 */
|
|
|
|
char** argv; /* 17 */
|
|
|
|
uint32 paddingB[32 - 18]; /* 18 */
|
|
|
|
|
|
|
|
rdpRdp* rdp; /* 32 */
|
|
|
|
rdpGdi* gdi; /* 33 */
|
|
|
|
rdpRail* rail; /* 34 */
|
|
|
|
rdpCache* cache; /* 35 */
|
|
|
|
rdpChannels* channels; /* 36 */
|
|
|
|
rdpGraphics* graphics; /* 37 */
|
|
|
|
uint32 paddingC[64 - 38]; /* 38 */
|
2011-10-16 08:50:10 +04:00
|
|
|
};
|
|
|
|
|
2011-07-28 09:04:01 +04:00
|
|
|
struct rdp_freerdp
|
2011-07-28 08:38:25 +04:00
|
|
|
{
|
2011-11-20 23:25:59 +04:00
|
|
|
rdpContext* context; /* 0 */
|
|
|
|
uint32 paddingA[16 - 1]; /* 1 */
|
|
|
|
|
|
|
|
rdpInput* input; /* 16 */
|
|
|
|
rdpUpdate* update; /* 17 */
|
|
|
|
rdpSettings* settings; /* 18 */
|
|
|
|
uint32 paddingB[32 - 19]; /* 19 */
|
|
|
|
|
|
|
|
size_t context_size; /* 32 */
|
|
|
|
pContextNew ContextNew; /* 33 */
|
|
|
|
pContextFree ContextFree; /* 34 */
|
|
|
|
uint32 paddingC[48 - 35]; /* 35 */
|
|
|
|
|
|
|
|
pPreConnect PreConnect; /* 48 */
|
|
|
|
pPostConnect PostConnect; /* 49 */
|
|
|
|
pAuthenticate Authenticate; /* 50 */
|
|
|
|
pVerifyCertificate VerifyCertificate; /* 51 */
|
|
|
|
uint32 paddingD[64 - 52]; /* 52 */
|
|
|
|
|
|
|
|
pSendChannelData SendChannelData; /* 64 */
|
|
|
|
pReceiveChannelData ReceiveChannelData; /* 65 */
|
|
|
|
uint32 paddingE[80 - 66]; /* 66 */
|
2011-07-28 09:04:01 +04:00
|
|
|
};
|
2011-07-28 08:38:25 +04:00
|
|
|
|
2011-10-16 08:50:10 +04:00
|
|
|
FREERDP_API void freerdp_context_new(freerdp* instance);
|
|
|
|
FREERDP_API void freerdp_context_free(freerdp* instance);
|
|
|
|
|
2011-10-17 05:02:28 +04:00
|
|
|
FREERDP_API boolean freerdp_connect(freerdp* instance);
|
|
|
|
FREERDP_API boolean freerdp_disconnect(freerdp* instance);
|
|
|
|
|
|
|
|
FREERDP_API boolean freerdp_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, int* wcount);
|
|
|
|
FREERDP_API boolean freerdp_check_fds(freerdp* instance);
|
|
|
|
|
2011-10-24 22:37:21 +04:00
|
|
|
FREERDP_API uint32 freerdp_error_info(freerdp* instance);
|
|
|
|
|
2011-07-28 08:38:25 +04:00
|
|
|
FREERDP_API freerdp* freerdp_new();
|
|
|
|
FREERDP_API void freerdp_free(freerdp* instance);
|
|
|
|
|
2011-07-01 05:23:36 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|