2012-09-20 07:51:34 +04:00
|
|
|
/**
|
|
|
|
* xrdp: A Remote Desktop Protocol server.
|
|
|
|
*
|
2014-02-20 12:41:53 +04:00
|
|
|
* Copyright (C) Jay Sorg 2004-2014
|
2012-09-20 07:51:34 +04:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* libxrdp header
|
|
|
|
*/
|
2005-06-28 07:11:35 +04:00
|
|
|
|
|
|
|
#if !defined(LIBXRDP_H)
|
|
|
|
#define LIBXRDP_H
|
|
|
|
|
|
|
|
#include "arch.h"
|
|
|
|
#include "parse.h"
|
2010-05-04 13:24:24 +04:00
|
|
|
#include "trans.h"
|
2005-06-28 07:11:35 +04:00
|
|
|
#include "xrdp_constants.h"
|
|
|
|
#include "defines.h"
|
|
|
|
#include "os_calls.h"
|
|
|
|
#include "ssl_calls.h"
|
|
|
|
#include "list.h"
|
|
|
|
#include "file.h"
|
|
|
|
#include "libxrdpinc.h"
|
2012-05-14 00:56:15 +04:00
|
|
|
#include "xrdp_client_info.h"
|
2005-06-28 07:11:35 +04:00
|
|
|
|
|
|
|
|
|
|
|
/* iso */
|
|
|
|
struct xrdp_iso
|
|
|
|
{
|
2014-06-03 09:00:51 +04:00
|
|
|
struct xrdp_mcs *mcs_layer; /* owner */
|
2014-07-10 16:40:16 +04:00
|
|
|
int rdpNegData; /* bool */
|
2014-06-03 09:00:51 +04:00
|
|
|
int requestedProtocol;
|
|
|
|
int selectedProtocol;
|
2014-07-10 16:40:16 +04:00
|
|
|
int failureCode;
|
2014-06-03 09:00:51 +04:00
|
|
|
struct trans *trans;
|
2005-06-28 07:11:35 +04:00
|
|
|
};
|
|
|
|
|
2006-12-28 09:15:13 +03:00
|
|
|
/* used in mcs */
|
|
|
|
struct mcs_channel_item
|
|
|
|
{
|
2014-06-03 09:00:51 +04:00
|
|
|
char name[16];
|
|
|
|
int flags;
|
|
|
|
int chanid;
|
2006-12-28 09:15:13 +03:00
|
|
|
};
|
|
|
|
|
2005-06-28 07:11:35 +04:00
|
|
|
/* mcs */
|
|
|
|
struct xrdp_mcs
|
|
|
|
{
|
2014-06-03 09:00:51 +04:00
|
|
|
struct xrdp_sec *sec_layer; /* owner */
|
|
|
|
struct xrdp_iso *iso_layer;
|
|
|
|
int userid;
|
|
|
|
int chanid;
|
|
|
|
struct stream *client_mcs_data;
|
|
|
|
struct stream *server_mcs_data;
|
|
|
|
struct list *channel_list;
|
2005-06-28 07:11:35 +04:00
|
|
|
};
|
|
|
|
|
2014-02-09 03:42:04 +04:00
|
|
|
/* fastpath */
|
|
|
|
struct xrdp_fastpath
|
|
|
|
{
|
2014-06-03 09:00:51 +04:00
|
|
|
struct xrdp_sec *sec_layer; /* owner */
|
|
|
|
struct trans *trans;
|
|
|
|
struct xrdp_session *session;
|
|
|
|
int numEvents;
|
|
|
|
int secFlags;
|
2014-02-09 03:42:04 +04:00
|
|
|
};
|
|
|
|
|
2014-02-20 12:41:53 +04:00
|
|
|
/* Encryption Methods */
|
|
|
|
#define CRYPT_METHOD_NONE 0x00000000
|
|
|
|
#define CRYPT_METHOD_40BIT 0x00000001
|
|
|
|
#define CRYPT_METHOD_128BIT 0x00000002
|
|
|
|
#define CRYPT_METHOD_56BIT 0x00000008
|
|
|
|
#define CRYPT_METHOD_FIPS 0x00000010
|
|
|
|
|
|
|
|
/* Encryption Levels */
|
|
|
|
#define CRYPT_LEVEL_NONE 0x00000000
|
|
|
|
#define CRYPT_LEVEL_LOW 0x00000001
|
|
|
|
#define CRYPT_LEVEL_CLIENT_COMPATIBLE 0x00000002
|
|
|
|
#define CRYPT_LEVEL_HIGH 0x00000003
|
|
|
|
#define CRYPT_LEVEL_FIPS 0x00000004
|
|
|
|
|
2014-03-02 03:39:34 +04:00
|
|
|
|
2005-06-28 07:11:35 +04:00
|
|
|
/* sec */
|
|
|
|
struct xrdp_sec
|
|
|
|
{
|
2014-06-03 09:00:51 +04:00
|
|
|
struct xrdp_rdp *rdp_layer; /* owner */
|
|
|
|
struct xrdp_mcs *mcs_layer;
|
|
|
|
struct xrdp_fastpath *fastpath_layer;
|
|
|
|
struct xrdp_channel *chan_layer;
|
|
|
|
char server_random[32];
|
2014-06-19 09:02:58 +04:00
|
|
|
char client_random[256];
|
|
|
|
char client_crypt_random[256 + 8]; /* 64 + 8, 256 + 8 */
|
2014-06-03 09:00:51 +04:00
|
|
|
struct stream client_mcs_data;
|
|
|
|
struct stream server_mcs_data;
|
|
|
|
int decrypt_use_count;
|
|
|
|
int encrypt_use_count;
|
|
|
|
char decrypt_key[16];
|
|
|
|
char encrypt_key[16];
|
|
|
|
char decrypt_update_key[16];
|
|
|
|
char encrypt_update_key[16];
|
|
|
|
int crypt_method;
|
|
|
|
int rc4_key_len; /* 8 = 40 bit, 16 = 128 bit */
|
|
|
|
int crypt_level;
|
|
|
|
char sign_key[16];
|
|
|
|
void *decrypt_rc4_info;
|
|
|
|
void *encrypt_rc4_info;
|
|
|
|
char pub_exp[4];
|
2014-06-18 09:41:10 +04:00
|
|
|
char pub_mod[256];
|
2014-06-03 09:00:51 +04:00
|
|
|
char pub_sig[64];
|
2014-06-18 09:41:10 +04:00
|
|
|
char pri_exp[256];
|
2014-07-23 16:31:45 +04:00
|
|
|
int rsa_key_bytes; /* 64 or 256 , 0 = no rdp security */
|
2014-06-03 09:00:51 +04:00
|
|
|
char fips_encrypt_key[24];
|
|
|
|
char fips_decrypt_key[24];
|
|
|
|
char fips_sign_key[20];
|
|
|
|
void *encrypt_fips_info;
|
|
|
|
void *decrypt_fips_info;
|
|
|
|
void *sign_fips_info;
|
2014-11-07 03:51:39 +03:00
|
|
|
int is_security_header_present; /* boolean */
|
2006-12-28 09:15:13 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/* channel */
|
|
|
|
struct xrdp_channel
|
|
|
|
{
|
2014-06-03 09:00:51 +04:00
|
|
|
struct xrdp_sec *sec_layer;
|
|
|
|
struct xrdp_mcs *mcs_layer;
|
2005-06-28 07:11:35 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/* rdp */
|
|
|
|
struct xrdp_rdp
|
|
|
|
{
|
2014-06-03 09:00:51 +04:00
|
|
|
struct xrdp_session *session;
|
|
|
|
struct xrdp_sec *sec_layer;
|
|
|
|
int share_id;
|
|
|
|
int mcs_channel;
|
|
|
|
struct xrdp_client_info client_info;
|
|
|
|
struct xrdp_mppc_enc *mppc_enc;
|
|
|
|
void *rfx_enc;
|
2005-06-28 07:11:35 +04:00
|
|
|
};
|
|
|
|
|
2007-01-20 08:14:11 +03:00
|
|
|
/* state */
|
|
|
|
struct xrdp_orders_state
|
2005-06-28 07:11:35 +04:00
|
|
|
{
|
2014-06-03 09:00:51 +04:00
|
|
|
int last_order; /* last order sent */
|
|
|
|
|
|
|
|
int clip_left; /* RDP_ORDER_BOUNDS, RDP_ORDER_LASTBOUNDS */
|
|
|
|
int clip_top;
|
|
|
|
int clip_right;
|
|
|
|
int clip_bottom;
|
|
|
|
|
|
|
|
int rect_x; /* RDP_ORDER_RECT */
|
|
|
|
int rect_y;
|
|
|
|
int rect_cx;
|
|
|
|
int rect_cy;
|
|
|
|
int rect_color;
|
|
|
|
|
|
|
|
int scr_blt_x; /* RDP_ORDER_SCREENBLT */
|
|
|
|
int scr_blt_y;
|
|
|
|
int scr_blt_cx;
|
|
|
|
int scr_blt_cy;
|
|
|
|
int scr_blt_rop;
|
|
|
|
int scr_blt_srcx;
|
|
|
|
int scr_blt_srcy;
|
|
|
|
|
|
|
|
int pat_blt_x; /* RDP_ORDER_PATBLT */
|
|
|
|
int pat_blt_y;
|
|
|
|
int pat_blt_cx;
|
|
|
|
int pat_blt_cy;
|
|
|
|
int pat_blt_rop;
|
|
|
|
int pat_blt_bg_color;
|
|
|
|
int pat_blt_fg_color;
|
|
|
|
struct xrdp_brush pat_blt_brush;
|
|
|
|
|
|
|
|
int dest_blt_x; /* RDP_ORDER_DESTBLT */
|
|
|
|
int dest_blt_y;
|
|
|
|
int dest_blt_cx;
|
|
|
|
int dest_blt_cy;
|
|
|
|
int dest_blt_rop;
|
|
|
|
|
|
|
|
int line_mix_mode; /* RDP_ORDER_LINE */
|
|
|
|
int line_startx;
|
|
|
|
int line_starty;
|
|
|
|
int line_endx;
|
|
|
|
int line_endy;
|
|
|
|
int line_bg_color;
|
|
|
|
int line_rop;
|
|
|
|
struct xrdp_pen line_pen;
|
|
|
|
|
|
|
|
int mem_blt_color_table; /* RDP_ORDER_MEMBLT */
|
|
|
|
int mem_blt_cache_id;
|
|
|
|
int mem_blt_x;
|
|
|
|
int mem_blt_y;
|
|
|
|
int mem_blt_cx;
|
|
|
|
int mem_blt_cy;
|
|
|
|
int mem_blt_rop;
|
|
|
|
int mem_blt_srcx;
|
|
|
|
int mem_blt_srcy;
|
|
|
|
int mem_blt_cache_idx;
|
|
|
|
|
|
|
|
int text_font; /* RDP_ORDER_TEXT2 */
|
|
|
|
int text_flags;
|
|
|
|
int text_unknown;
|
|
|
|
int text_mixmode;
|
|
|
|
int text_fg_color;
|
|
|
|
int text_bg_color;
|
|
|
|
int text_clip_left;
|
|
|
|
int text_clip_top;
|
|
|
|
int text_clip_right;
|
|
|
|
int text_clip_bottom;
|
|
|
|
int text_box_left;
|
|
|
|
int text_box_top;
|
|
|
|
int text_box_right;
|
|
|
|
int text_box_bottom;
|
|
|
|
int text_x;
|
|
|
|
int text_y;
|
|
|
|
int text_len;
|
|
|
|
char *text_data;
|
|
|
|
|
|
|
|
int com_blt_srcidx; /* RDP_ORDER_COMPOSITE */ /* 2 */
|
|
|
|
int com_blt_srcformat; /* 2 */
|
|
|
|
int com_blt_srcwidth; /* 2 */
|
|
|
|
int com_blt_srcrepeat; /* 1 */
|
|
|
|
int com_blt_srctransform[10]; /* 40 */
|
|
|
|
int com_blt_mskflags; /* 1 */
|
|
|
|
int com_blt_mskidx; /* 2 */
|
|
|
|
int com_blt_mskformat; /* 2 */
|
|
|
|
int com_blt_mskwidth; /* 2 */
|
|
|
|
int com_blt_mskrepeat; /* 1 */
|
|
|
|
int com_blt_op; /* 1 */
|
|
|
|
int com_blt_srcx; /* 2 */
|
|
|
|
int com_blt_srcy; /* 2 */
|
|
|
|
int com_blt_mskx; /* 2 */
|
|
|
|
int com_blt_msky; /* 2 */
|
|
|
|
int com_blt_dstx; /* 2 */
|
|
|
|
int com_blt_dsty; /* 2 */
|
|
|
|
int com_blt_width; /* 2 */
|
|
|
|
int com_blt_height; /* 2 */
|
|
|
|
int com_blt_dstformat; /* 2 */
|
2014-01-21 05:48:17 +04:00
|
|
|
|
2005-06-28 07:11:35 +04:00
|
|
|
};
|
|
|
|
|
2007-01-20 08:14:11 +03:00
|
|
|
/* orders */
|
|
|
|
struct xrdp_orders
|
|
|
|
{
|
2014-06-03 09:00:51 +04:00
|
|
|
struct stream *out_s;
|
|
|
|
struct xrdp_rdp *rdp_layer;
|
|
|
|
struct xrdp_session *session;
|
|
|
|
struct xrdp_wm *wm;
|
|
|
|
|
|
|
|
char *order_count_ptr; /* pointer to count, set when sending */
|
|
|
|
int order_count;
|
|
|
|
int order_level; /* inc for every call to xrdp_orders_init */
|
|
|
|
struct xrdp_orders_state orders_state;
|
|
|
|
void *jpeg_han;
|
|
|
|
int rfx_min_pixel;
|
2014-06-19 08:10:15 +04:00
|
|
|
/* shared */
|
|
|
|
struct stream *s;
|
|
|
|
struct stream *temp_s;
|
2007-01-20 08:14:11 +03:00
|
|
|
};
|
|
|
|
|
2012-12-29 10:37:48 +04:00
|
|
|
#define PROTO_RDP_40 1
|
|
|
|
#define PROTO_RDP_50 2
|
|
|
|
|
|
|
|
struct xrdp_mppc_enc
|
|
|
|
{
|
2014-06-03 09:00:51 +04:00
|
|
|
int protocol_type; /* PROTO_RDP_40, PROTO_RDP_50 etc */
|
|
|
|
char *historyBuffer; /* contains uncompressed data */
|
|
|
|
char *outputBuffer; /* contains compressed data */
|
|
|
|
char *outputBufferPlus;
|
|
|
|
int historyOffset; /* next free slot in historyBuffer */
|
2016-01-14 19:32:09 +03:00
|
|
|
int buf_len; /* length of historyBuffer, protocol dependent */
|
2014-06-03 09:00:51 +04:00
|
|
|
int bytes_in_opb; /* compressed bytes available in outputBuffer */
|
|
|
|
int flags; /* PACKET_COMPRESSED, PACKET_AT_FRONT, PACKET_FLUSHED etc */
|
|
|
|
int flagsHold;
|
|
|
|
int first_pkt; /* this is the first pkt passing through enc */
|
|
|
|
tui16 *hash_table;
|
2012-12-29 10:37:48 +04:00
|
|
|
};
|
|
|
|
|
2014-07-15 19:29:40 +04:00
|
|
|
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2012-12-29 10:37:48 +04:00
|
|
|
compress_rdp(struct xrdp_mppc_enc *enc, tui8 *srcData, int len);
|
2017-03-12 19:35:00 +03:00
|
|
|
struct xrdp_mppc_enc *
|
2012-12-29 10:37:48 +04:00
|
|
|
mppc_enc_new(int protocol_type);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2012-12-29 10:37:48 +04:00
|
|
|
mppc_enc_free(struct xrdp_mppc_enc *enc);
|
|
|
|
|
2005-06-28 07:11:35 +04:00
|
|
|
/* xrdp_tcp.c */
|
2017-03-12 19:35:00 +03:00
|
|
|
struct xrdp_tcp *
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_tcp_create(struct xrdp_iso *owner, struct trans *trans);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_tcp_delete(struct xrdp_tcp *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_tcp_init(struct xrdp_tcp *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_tcp_recv(struct xrdp_tcp *self, struct stream *s, int len);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_tcp_send(struct xrdp_tcp *self, struct stream *s);
|
2005-06-28 07:11:35 +04:00
|
|
|
|
|
|
|
/* xrdp_iso.c */
|
2017-03-12 19:35:00 +03:00
|
|
|
struct xrdp_iso *
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_iso_create(struct xrdp_mcs *owner, struct trans *trans);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_iso_delete(struct xrdp_iso *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_iso_init(struct xrdp_iso *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_iso_recv(struct xrdp_iso *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_iso_send(struct xrdp_iso *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_iso_incoming(struct xrdp_iso *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-02-08 15:34:01 +04:00
|
|
|
xrdp_iso_detect_tpkt(struct xrdp_iso *self, struct stream *s);
|
2005-06-28 07:11:35 +04:00
|
|
|
|
|
|
|
/* xrdp_mcs.c */
|
2017-03-12 19:35:00 +03:00
|
|
|
struct xrdp_mcs *
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_mcs_create(struct xrdp_sec *owner, struct trans *trans,
|
|
|
|
struct stream *client_mcs_data,
|
|
|
|
struct stream *server_mcs_data);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_mcs_delete(struct xrdp_mcs *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_mcs_init(struct xrdp_mcs *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_mcs_recv(struct xrdp_mcs *self, struct stream *s, int *chan);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_mcs_send(struct xrdp_mcs *self, struct stream *s, int chan);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_mcs_incoming(struct xrdp_mcs *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_mcs_disconnect(struct xrdp_mcs *self);
|
2005-06-28 07:11:35 +04:00
|
|
|
|
|
|
|
/* xrdp_sec.c */
|
2017-03-12 19:35:00 +03:00
|
|
|
struct xrdp_sec *
|
2014-07-23 16:31:45 +04:00
|
|
|
xrdp_sec_create(struct xrdp_rdp *owner, struct trans *trans);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_sec_delete(struct xrdp_sec *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_sec_init(struct xrdp_sec *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-03-09 23:11:36 +04:00
|
|
|
xrdp_sec_get_fastpath_bytes(struct xrdp_sec *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-03-08 00:45:33 +04:00
|
|
|
xrdp_sec_init_fastpath(struct xrdp_sec *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-03-08 00:45:33 +04:00
|
|
|
xrdp_sec_send_fastpath(struct xrdp_sec *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-03-07 11:28:57 +04:00
|
|
|
xrdp_sec_recv_fastpath(struct xrdp_sec *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_sec_recv(struct xrdp_sec *self, struct stream *s, int *chan);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_sec_send(struct xrdp_sec *self, struct stream *s, int chan);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_sec_process_mcs_data(struct xrdp_sec *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_sec_incoming(struct xrdp_sec *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_sec_disconnect(struct xrdp_sec *self);
|
2005-06-28 07:11:35 +04:00
|
|
|
|
|
|
|
/* xrdp_rdp.c */
|
2017-03-12 19:35:00 +03:00
|
|
|
struct xrdp_rdp *
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_rdp_create(struct xrdp_session *session, struct trans *trans);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_rdp_delete(struct xrdp_rdp *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_rdp_init(struct xrdp_rdp *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_rdp_init_data(struct xrdp_rdp *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-03-18 11:07:11 +04:00
|
|
|
xrdp_rdp_get_fastpath_bytes(struct xrdp_rdp *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-03-08 00:45:33 +04:00
|
|
|
xrdp_rdp_init_fastpath(struct xrdp_rdp *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_rdp_recv(struct xrdp_rdp *self, struct stream *s, int *code);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_rdp_send(struct xrdp_rdp *self, struct stream *s, int pdu_type);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_rdp_send_data(struct xrdp_rdp *self, struct stream *s,
|
2005-06-28 07:11:35 +04:00
|
|
|
int data_pdu_type);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-03-08 00:45:33 +04:00
|
|
|
xrdp_rdp_send_fastpath(struct xrdp_rdp *self, struct stream *s,
|
|
|
|
int data_pdu_type);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_rdp_send_data_update_sync(struct xrdp_rdp *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_rdp_incoming(struct xrdp_rdp *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_rdp_process_data(struct xrdp_rdp *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_rdp_disconnect(struct xrdp_rdp *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2016-05-03 23:07:13 +03:00
|
|
|
xrdp_rdp_send_deactivate(struct xrdp_rdp *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2016-07-18 09:28:37 +03:00
|
|
|
xrdp_rdp_send_session_info(struct xrdp_rdp *self, const char *data,
|
|
|
|
int data_bytes);
|
2005-06-28 07:11:35 +04:00
|
|
|
|
|
|
|
/* xrdp_orders.c */
|
2017-03-12 19:35:00 +03:00
|
|
|
struct xrdp_orders *
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_create(struct xrdp_session *session,
|
|
|
|
struct xrdp_rdp *rdp_layer);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_delete(struct xrdp_orders *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_reset(struct xrdp_orders *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_init(struct xrdp_orders *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_send(struct xrdp_orders *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_force_send(struct xrdp_orders *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_check(struct xrdp_orders *self, int max_size);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_rect(struct xrdp_orders *self, int x, int y, int cx, int cy,
|
|
|
|
int color, struct xrdp_rect *rect);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_screen_blt(struct xrdp_orders *self, int x, int y,
|
2005-06-28 07:11:35 +04:00
|
|
|
int cx, int cy, int srcx, int srcy,
|
2014-06-03 09:00:51 +04:00
|
|
|
int rop, struct xrdp_rect *rect);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_pat_blt(struct xrdp_orders *self, int x, int y,
|
2005-06-28 07:11:35 +04:00
|
|
|
int cx, int cy, int rop, int bg_color,
|
2014-06-03 09:00:51 +04:00
|
|
|
int fg_color, struct xrdp_brush *brush,
|
|
|
|
struct xrdp_rect *rect);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_dest_blt(struct xrdp_orders *self, int x, int y,
|
2005-06-28 07:11:35 +04:00
|
|
|
int cx, int cy, int rop,
|
2014-06-03 09:00:51 +04:00
|
|
|
struct xrdp_rect *rect);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_line(struct xrdp_orders *self, int mix_mode,
|
2005-06-28 07:11:35 +04:00
|
|
|
int startx, int starty,
|
|
|
|
int endx, int endy, int rop, int bg_color,
|
2014-06-03 09:00:51 +04:00
|
|
|
struct xrdp_pen *pen,
|
|
|
|
struct xrdp_rect *rect);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_mem_blt(struct xrdp_orders *self, int cache_id,
|
2005-06-28 07:11:35 +04:00
|
|
|
int color_table, int x, int y, int cx, int cy,
|
|
|
|
int rop, int srcx, int srcy,
|
2014-06-03 09:00:51 +04:00
|
|
|
int cache_idx, struct xrdp_rect *rect);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_composite_blt(struct xrdp_orders *self, int srcidx,
|
2013-07-07 08:03:58 +04:00
|
|
|
int srcformat, int srcwidth,
|
2014-06-03 09:00:51 +04:00
|
|
|
int srcrepeat, int *srctransform, int mskflags,
|
2013-07-07 08:03:58 +04:00
|
|
|
int mskidx, int mskformat, int mskwidth,
|
|
|
|
int mskrepeat, int op, int srcx, int srcy,
|
|
|
|
int mskx, int msky, int dstx, int dsty,
|
|
|
|
int width, int height, int dstformat,
|
2014-06-03 09:00:51 +04:00
|
|
|
struct xrdp_rect *rect);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_text(struct xrdp_orders *self,
|
2005-06-28 07:11:35 +04:00
|
|
|
int font, int flags, int mixmode,
|
|
|
|
int fg_color, int bg_color,
|
|
|
|
int clip_left, int clip_top,
|
|
|
|
int clip_right, int clip_bottom,
|
|
|
|
int box_left, int box_top,
|
|
|
|
int box_right, int box_bottom,
|
2014-06-03 09:00:51 +04:00
|
|
|
int x, int y, char *data, int data_len,
|
|
|
|
struct xrdp_rect *rect);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_send_palette(struct xrdp_orders *self, int *palette,
|
2005-06-28 07:11:35 +04:00
|
|
|
int cache_id);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_send_raw_bitmap(struct xrdp_orders *self,
|
|
|
|
int width, int height, int bpp, char *data,
|
2005-06-28 07:11:35 +04:00
|
|
|
int cache_id, int cache_idx);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_send_bitmap(struct xrdp_orders *self,
|
|
|
|
int width, int height, int bpp, char *data,
|
2005-06-28 07:11:35 +04:00
|
|
|
int cache_id, int cache_idx);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_send_font(struct xrdp_orders *self,
|
|
|
|
struct xrdp_font_char *font_char,
|
2005-06-28 07:11:35 +04:00
|
|
|
int font_index, int char_index);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_send_raw_bitmap2(struct xrdp_orders *self,
|
|
|
|
int width, int height, int bpp, char *data,
|
2006-03-17 04:10:24 +03:00
|
|
|
int cache_id, int cache_idx);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_send_bitmap2(struct xrdp_orders *self,
|
|
|
|
int width, int height, int bpp, char *data,
|
2012-05-21 21:38:32 +04:00
|
|
|
int cache_id, int cache_idx, int hints);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_send_bitmap3(struct xrdp_orders *self,
|
|
|
|
int width, int height, int bpp, char *data,
|
2012-07-18 02:24:11 +04:00
|
|
|
int cache_id, int cache_idx, int hints);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_send_brush(struct xrdp_orders *self, int width, int height,
|
|
|
|
int bpp, int type, int size, char *data, int cache_id);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_send_create_os_surface(struct xrdp_orders *self, int id,
|
2012-05-22 19:27:09 +04:00
|
|
|
int width, int height,
|
2014-06-03 09:00:51 +04:00
|
|
|
struct list *del_list);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_orders_send_switch_os_surface(struct xrdp_orders *self, int id);
|
2005-06-28 07:11:35 +04:00
|
|
|
|
|
|
|
/* xrdp_bitmap_compress.c */
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_bitmap_compress(char *in_data, int width, int height,
|
|
|
|
struct stream *s, int bpp, int byte_limit,
|
|
|
|
int start_line, struct stream *temp_s,
|
2005-06-28 07:11:35 +04:00
|
|
|
int e);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_bitmap32_compress(char *in_data, int width, int height,
|
|
|
|
struct stream *s, int bpp, int byte_limit,
|
|
|
|
int start_line, struct stream *temp_s,
|
2014-06-18 09:41:10 +04:00
|
|
|
int e, int flags);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_jpeg_compress(void *handle, char *in_data, int width, int height,
|
|
|
|
struct stream *s, int bpp, int byte_limit,
|
|
|
|
int start_line, struct stream *temp_s,
|
2012-07-24 22:56:09 +04:00
|
|
|
int e, int quality);
|
2014-01-21 05:48:17 +04:00
|
|
|
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-01-21 05:48:17 +04:00
|
|
|
xrdp_codec_jpeg_compress(void *handle,
|
|
|
|
int format, /* input data format */
|
|
|
|
char *inp_data, /* input data */
|
|
|
|
int width, /* width of inp_data */
|
|
|
|
int height, /* height of inp_data */
|
|
|
|
int stride, /* inp_data stride, in bytes*/
|
|
|
|
int x, /* x loc in inp_data */
|
|
|
|
int y, /* y loc in inp_data */
|
|
|
|
int cx, /* width of area to compress */
|
|
|
|
int cy, /* height of area to compress */
|
|
|
|
int quality, /* higher numbers compress less */
|
|
|
|
char *out_data, /* dest for jpg image */
|
|
|
|
int *io_len /* length of out_data and on return */
|
|
|
|
/* len of compressed data */
|
|
|
|
);
|
|
|
|
|
2017-03-12 19:35:00 +03:00
|
|
|
void *
|
2013-09-19 21:59:29 +04:00
|
|
|
xrdp_jpeg_init(void);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2013-09-19 21:59:29 +04:00
|
|
|
xrdp_jpeg_deinit(void *handle);
|
2005-06-28 07:11:35 +04:00
|
|
|
|
2006-12-28 09:15:13 +03:00
|
|
|
/* xrdp_channel.c */
|
2017-03-12 19:35:00 +03:00
|
|
|
struct xrdp_channel*
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_channel_create(struct xrdp_sec *owner, struct xrdp_mcs *mcs_layer);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_channel_delete(struct xrdp_channel *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_channel_init(struct xrdp_channel *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_channel_send(struct xrdp_channel *self, struct stream *s, int channel_id,
|
2008-12-16 05:18:36 +03:00
|
|
|
int total_data_len, int flags);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-06-03 09:00:51 +04:00
|
|
|
xrdp_channel_process(struct xrdp_channel *self, struct stream *s,
|
2006-12-28 09:15:13 +03:00
|
|
|
int chanid);
|
|
|
|
|
2014-02-09 03:42:04 +04:00
|
|
|
/* xrdp_fastpath.c */
|
2017-03-12 19:35:00 +03:00
|
|
|
struct xrdp_fastpath *
|
2014-02-09 03:42:04 +04:00
|
|
|
xrdp_fastpath_create(struct xrdp_sec *owner, struct trans *trans);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2014-02-09 03:42:04 +04:00
|
|
|
xrdp_fastpath_delete(struct xrdp_fastpath *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-02-09 03:42:04 +04:00
|
|
|
xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-03-05 01:56:26 +04:00
|
|
|
xrdp_fastpath_process_input_event(struct xrdp_fastpath *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-03-08 00:45:33 +04:00
|
|
|
xrdp_fastpath_init(struct xrdp_fastpath *self, struct stream *s);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-03-08 00:45:33 +04:00
|
|
|
xrdp_fastpath_send(struct xrdp_fastpath *self, struct stream *s);
|
|
|
|
|
2014-03-10 05:39:39 +04:00
|
|
|
/* xrdp_caps.c */
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-03-10 05:39:39 +04:00
|
|
|
xrdp_caps_send_demand_active(struct xrdp_rdp *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-03-10 05:39:39 +04:00
|
|
|
xrdp_caps_process_confirm_active(struct xrdp_rdp *self, struct stream *s);
|
2005-06-28 07:11:35 +04:00
|
|
|
#endif
|