/******************************************************************************/ /* return error */ int
lib_mod_start(struct mod *mod, int w, int h, int bpp)
{
LOG_DEVEL(LOG_LEVEL_TRACE, "in lib_mod_start");
mod->width = w;
mod->height = h;
mod->bpp = bpp;
LOG_DEVEL(LOG_LEVEL_TRACE, "out lib_mod_start"); return0;
}
/******************************************************************************/ staticint
lib_mod_log_peer(struct mod *mod)
{ int my_pid; int pid; int uid; int gid;
/******************************************************************************/ staticint
lib_data_in(struct trans *trans)
{ struct mod *self; struct stream *s; int len;
LOG_DEVEL(LOG_LEVEL_TRACE, "lib_data_in:"); if (trans == 0)
{ return1;
}
self = (struct mod *)(trans->callback_data);
s = trans_get_in_s(trans);
if (s == 0)
{ return1;
}
switch (trans->extra_flags)
{ case1:
s->p = s->data;
in_uint8s(s, 4); /* processed later in lib_mod_process_message */
in_uint32_le(s, len); if (len < 0 || len > 128 * 1024)
{
LOG(LOG_LEVEL_ERROR, "lib_data_in: bad size"); return1;
} if (len > 0)
{
trans->header_size = len + 8;
trans->extra_flags = 2; break;
} /* fall through */ case2:
s->p = s->data; if (lib_mod_process_message(self, s) != 0)
{
LOG(LOG_LEVEL_ERROR, "lib_data_in: lib_mod_process_message failed"); return1;
}
init_stream(s, 0);
trans->header_size = 8;
trans->extra_flags = 1; break;
}
return0;
}
/******************************************************************************/ /* return error */ int
lib_mod_connect(struct mod *mod)
{ int error; int socket_mode; struct stream *s; char con_port[256];
mod->server_msg(mod, "started connecting", 0);
/* only support 8, 15, 16, 24, and 32 bpp connections from rdp client */ if (mod->bpp != 8
&& mod->bpp != 15
&& mod->bpp != 16
&& mod->bpp != 24
&& mod->bpp != 32)
{
mod->server_msg(mod, "error - only supporting 8, 15, 16, 24, and 32" " bpp rdp connections", 0); return1;
}
// This is a good place to finalise any parameters that need to // be set. if (mod->client_info.h264_frame_interval <= 0)
{
mod->client_info.h264_frame_interval = DEFAULT_H264_FRAME_INTERVAL;
} if (mod->client_info.rfx_frame_interval <= 0)
{
mod->client_info.rfx_frame_interval = DEFAULT_RFX_FRAME_INTERVAL;
} if (mod->client_info.normal_frame_interval <= 0)
{
mod->client_info.normal_frame_interval = DEFAULT_NORMAL_FRAME_INTERVAL;
}
/* Give the X server a bit of time to start */ if (trans_connect(mod->trans, mod->ip, con_port, 30 * 1000) == 0)
{
LOG_DEVEL(LOG_LEVEL_INFO, "lib_mod_connect: connected to Xserver " "(Xorg) sck %lld",
(longlong) (mod->trans->sck));
} else
{
LOG(LOG_LEVEL_ERROR, "Error connecting to X server [%s]",
g_get_strerror());
error = 1;
}
/******************************************************************************/ /* return error */ int
lib_mod_event(struct mod *mod, int msg, tbus param1, tbus param2,
tbus param3, tbus param4)
{ struct stream *s; int len; int key; int rv;
LOG_DEVEL(LOG_LEVEL_TRACE, "in lib_mod_event");
make_stream(s);
/******************************************************************************/ /* return error */ staticint
process_server_fill_rect(struct mod *mod, struct stream *s)
{ int rv; int x; int y; int cx; int cy;
/******************************************************************************/ /* return error */ staticint
process_server_screen_blt(struct mod *mod, struct stream *s)
{ int rv; int x; int y; int cx; int cy; int srcx; int srcy;
/******************************************************************************/ /* return error */ staticint
process_server_paint_rect(struct mod *mod, struct stream *s)
{ int rv; int x; int y; int cx; int cy; int len_bmpdata; char *bmpdata; int width; int height; int srcx; int srcy;
/******************************************************************************/ /* return error */ staticint
process_server_set_clip(struct mod *mod, struct stream *s)
{ int rv; int x; int y; int cx; int cy;
/******************************************************************************/ /* return error */ staticint
process_server_set_pen(struct mod *mod, struct stream *s)
{ int rv; int style; int width;
/******************************************************************************/ /* return error */ staticint
process_server_draw_line(struct mod *mod, struct stream *s)
{ int rv; int x1; int y1; int x2; int y2;
/******************************************************************************/ /* return error */ staticint
process_server_create_os_surface(struct mod *mod, struct stream *s)
{ int rv; int rdpid; int width; int height;
/******************************************************************************/ /* return error */ staticint
process_server_paint_rect_os(struct mod *mod, struct stream *s)
{ int rv; int x; int y; int cx; int cy; int rdpid; int srcx; int srcy;
/******************************************************************************/ /* return error */ staticint
process_server_set_hints(struct mod *mod, struct stream *s)
{ int rv; int hints; int mask;
/******************************************************************************/ /* return error */ staticint
process_server_window_new_update(struct mod *mod, struct stream *s)
{ int flags; int window_id; int title_bytes; int index; int bytes; int rv; struct rail_window_state_order rwso;
/******************************************************************************/ /* return error */ staticint
process_server_add_char(struct mod *mod, struct stream *s)
{ int rv; int font; int character; int x; int y; int cx; int cy; int len_bmpdata; char *bmpdata;
/******************************************************************************/ /* return error */ staticint
process_server_add_char_alpha(struct mod *mod, struct stream *s)
{ int rv; int font; int character; int x; int y; int cx; int cy; int len_bmpdata; char *bmpdata;
/******************************************************************************/ /* return error */ staticint
process_server_draw_text(struct mod *mod, struct stream *s)
{ int rv; int font; int flags; int mixmode; int clip_left; int clip_top; int clip_right; int clip_bottom; int box_left; int box_top; int box_right; int box_bottom; int x; int y; int len_bmpdata; char *bmpdata;
/******************************************************************************/ /* return error */ staticint
process_server_create_os_surface_bpp(struct mod *mod, struct stream *s)
{ int rv; int rdpid; int width; int height; int bpp;
/******************************************************************************/ /* return error */ staticint
process_server_paint_rect_bpp(struct mod *mod, struct stream *s)
{ int rv; int x; int y; int cx; int cy; int len_bmpdata; char *bmpdata; int width; int height; int srcx; int srcy; int bpp;
/******************************************************************************/ /* return error */ staticint
process_server_composite(struct mod *mod, struct stream *s)
{ int rv; int srcidx; int srcformat; int srcwidth; int srcrepeat; int transform[10]; int mskflags; 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;
/******************************************************************************/ /* return error */ staticint
send_paint_rect_ack(struct mod *mod, int flags, int x, int y, int cx, int cy, int frame_id)
{ int len; struct stream *s;
/******************************************************************************/ /* return error */ staticint
process_server_paint_rect_shmem(struct mod *amod, struct stream *s)
{ int rv; int x; int y; int cx; int cy; int flags; int frame_id; int shmem_id; int shmem_offset; int width; int height; int srcx; int srcy; char *bmpdata;
/******************************************************************************/ /* return error */ staticint
send_paint_rect_ex_ack(struct mod *mod, int flags, int frame_id)
{ int len; struct stream *s;
/******************************************************************************/ /* return error */ staticint
send_suppress_output(struct mod *mod, int suppress, int left, int top, int right, int bottom)
{ int len; struct stream *s;
int num_drects; int num_crects; int flags; int frame_id; int shmem_id; int shmem_offset; int width; int height; int index; int rv;
tsi16 *ldrects;
tsi16 *ldrects1;
tsi16 *lcrects;
tsi16 *lcrects1; char *bmpdata;
/******************************************************************************/ /* return error */ int
process_server_egfx_shmfd(struct mod *amod, struct stream *s)
{ char *data; char *cmd; int rv; int cmd_bytes; int shmem_bytes; int fd; int recv_bytes; unsignedint num_fds; void *shmem_ptr; char msg[4];
/******************************************************************************/ /* return error */ staticint
process_server_set_pointer_shmfd(struct mod *amod, struct stream *s)
{ int rv; int x; int y; int bpp; int Bpp; int width; int height; int fd; int recv_bytes; int shmembytes; unsignedint num_fds; void *shmemptr; char *cur_data; char *cur_mask; char msg[4];
/******************************************************************************/ /* return error */ staticint
process_server_paint_rect_shmfd(struct mod *amod, struct stream *s)
{ int num_drects; int num_crects; int flags; int frame_id; int shmem_bytes; int shmem_offset; int left; int top; int width; int height; int index; int rv;
int16_t *ldrects;
int16_t *ldrects1;
int16_t *lcrects;
int16_t *lcrects1; char *bmpdata; int fd; int recv_bytes; unsignedint num_fds; void *shmem_ptr; char msg[4];
/******************************************************************************/ /* return error */ staticint
process_server_set_pointer_position(struct mod *amod, struct stream *s)
{ int rv; int x; int y;
/******************************************************************************/ /* return error */ staticint
lib_mod_process_message(struct mod *mod, struct stream *s)
{ int num_orders; int index; int rv; int len; int type; char *phold;
rv = 0; if (type == 1) /* original order list */
{ for (index = 0; index < num_orders; ++index)
{
in_uint16_le(s, type);
rv = lib_mod_process_orders(mod, type, s);
if (rv != 0)
{ break;
}
}
} elseif (type == 2) /* caps */
{
LOG_DEVEL(LOG_LEVEL_TRACE, "lib_mod_process_message: type 2 len %d", len); for (index = 0; index < num_orders; index++)
{
phold = s->p;
in_uint16_le(s, type);
in_uint16_le(s, len);
switch (type)
{ default:
LOG_DEVEL(LOG_LEVEL_TRACE, "lib_mod_process_message: unknown" " cap type %d len %d",
type, len); break;
}
s->p = phold + len;
}
lib_send_client_info(mod);
} elseif (type == 3) /* order list with len after type */
{
LOG_DEVEL(LOG_LEVEL_INFO, "lib_mod_process_message: type 3 len %d", len); for (index = 0; index < num_orders; index++)
{
phold = s->p;
in_uint16_le(s, type);
in_uint16_le(s, len);
rv = lib_mod_process_orders(mod, type, s);
/******************************************************************************/ /* return error */ int
lib_mod_get_wait_objs(struct mod *mod, tbus *read_objs, int *rcount,
tbus *write_objs, int *wcount, int *timeout)
{ if (mod != 0)
{ if (mod->trans != 0)
{
trans_get_wait_objs_rw(mod->trans, read_objs, rcount,
write_objs, wcount, timeout);
}
} return0;
}
/******************************************************************************/ /* return error */ int
lib_mod_check_wait_objs(struct mod *mod)
{ int rv;
rv = 0; if (mod != 0)
{ if (mod->trans != 0)
{
rv = trans_check_wait_objs(mod->trans); if (rv != 0)
{
LOG(LOG_LEVEL_ERROR, "Xorg server closed connection");
}
}
}
return rv;
}
/******************************************************************************/ /* return error */ int
lib_mod_frame_ack(struct mod *amod, int flags, int frame_id)
{
LOG_DEVEL(LOG_LEVEL_TRACE, "lib_mod_frame_ack: flags 0x%8.8x frame_id %d", flags, frame_id);
send_paint_rect_ex_ack(amod, flags, frame_id); return0;
}
/******************************************************************************/ /* return error */ int
lib_mod_suppress_output(struct mod *amod, int suppress, int left, int top, int right, int bottom)
{
LOG_DEVEL(LOG_LEVEL_TRACE, "lib_mod_suppress_output: suppress 0x%8.8x left %d top %d " "right %d bottom %d", suppress, left, top, right, bottom);
send_suppress_output(amod, suppress, left, top, right, bottom); return0;
}
/******************************************************************************/
tintptr EXPORT_CC
mod_init(void)
{ struct mod *mod;
/******************************************************************************/ int EXPORT_CC
mod_exit(tintptr handle)
{ struct mod *mod = (struct mod *) handle;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.