Fixing formatting with astyle

This commit is contained in:
Alexandre Quesnel 2021-05-08 16:58:11 +00:00
parent f8652e3a0f
commit 52707ac686
58 changed files with 839 additions and 826 deletions

View File

@ -767,9 +767,9 @@ log_end(void)
/* log a hex dump */ /* log a hex dump */
enum logReturns enum logReturns
log_hexdump(const enum logLevels log_level, log_hexdump(const enum logLevels log_level,
const char *message, const char *message,
const char *src, const char *src,
int len) int len)
{ {
return log_hexdump_with_location("", "", 0, log_level, message, src, len); return log_hexdump_with_location("", "", 0, log_level, message, src, len);
} }

View File

@ -537,7 +537,7 @@ g_bytes_to_hexdump(const char *src, int len)
+ HEX_DUMP_NEWLINE_SIZE); + HEX_DUMP_NEWLINE_SIZE);
dump_number_lines = (len / HEX_DUMP_SOURCE_BYTES_PER_LINE) + 1; /* +1 to round up */ dump_number_lines = (len / HEX_DUMP_SOURCE_BYTES_PER_LINE) + 1; /* +1 to round up */
dump_length = (dump_number_lines *dump_line_length /* hex dump lines */ dump_length = (dump_number_lines * dump_line_length /* hex dump lines */
+ 1); /* terminating NULL */ + 1); /* terminating NULL */
dump_buffer = (char *)g_malloc(dump_length, 1); dump_buffer = (char *)g_malloc(dump_length, 1);
if (dump_buffer == NULL) if (dump_buffer == NULL)

View File

@ -22,7 +22,8 @@
* xfree86(base)->evdev keycode mapping * xfree86(base)->evdev keycode mapping
*/ */
int xfree86_to_evdev[137-8+1] = { int xfree86_to_evdev[137 - 8 + 1] =
{
/* MDSW */ 203, /* MDSW */ 203,
/* ESC */ 9, /* ESC */ 9,
/* AE01 */ 10, /* AE01 */ 10,

View File

@ -44,7 +44,7 @@
#include <X11/XKBlib.h> #include <X11/XKBlib.h>
#include <locale.h> #include <locale.h>
extern int xfree86_to_evdev[137-8+1]; extern int xfree86_to_evdev[137 - 8 + 1];
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
@ -52,7 +52,8 @@ int main(int argc, char **argv)
char text[256]; char text[256];
char *displayname = NULL; char *displayname = NULL;
char *outfname; char *outfname;
const char *sections[8] = { const char *sections[8] =
{
"noshift", "shift", "altgr", "shiftaltgr", "noshift", "shift", "altgr", "shiftaltgr",
"capslock", "capslockaltgr", "shiftcapslock", "shiftcapslockaltgr" "capslock", "capslockaltgr", "shiftcapslock", "shiftcapslockaltgr"
}; };
@ -139,9 +140,13 @@ int main(int argc, char **argv)
for (i = 8; i < 137; i++) /* Keycodes */ for (i = 8; i < 137; i++) /* Keycodes */
{ {
if (is_evdev) if (is_evdev)
e.keycode = xfree86_to_evdev[i-8]; {
e.keycode = xfree86_to_evdev[i - 8];
}
else else
{
e.keycode = i; e.keycode = i;
}
nbytes = XLookupString(&e, text, 255, &ks, NULL); nbytes = XLookupString(&e, text, 255, &ks, NULL);
text[nbytes] = 0; text[nbytes] = 0;
char_count = mbstowcs(wtext, text, 255); char_count = mbstowcs(wtext, text, 255);

View File

@ -83,9 +83,9 @@ struct mod
int (*mod_suppress_output)(struct mod *mod, int suppress, int (*mod_suppress_output)(struct mod *mod, int suppress,
int left, int top, int right, int bottom); int left, int top, int right, int bottom);
int (*mod_server_monitor_resize)(struct mod *mod, int (*mod_server_monitor_resize)(struct mod *mod,
int width, int height); int width, int height);
int (*mod_server_monitor_full_invalidate)(struct mod *mod, int (*mod_server_monitor_full_invalidate)(struct mod *mod,
int width, int height); int width, int height);
int (*mod_server_version_message)(struct mod *mod); int (*mod_server_version_message)(struct mod *mod);
tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod
functions above */ functions above */

View File

@ -35,9 +35,9 @@ int
g_is_term(void); g_is_term(void);
int send_channel_data(int chan_id, const char *data, int size); int send_channel_data(int chan_id, const char *data, int size);
int send_rail_drawing_orders(char* data, int size); int send_rail_drawing_orders(char *data, int size);
int main_cleanup(void); int main_cleanup(void);
int add_timeout(int msoffset, void (*callback)(void* data), void* data); int add_timeout(int msoffset, void (*callback)(void *data), void *data);
#ifndef GSET_UINT8 #ifndef GSET_UINT8
#define GSET_UINT8(_ptr, _offset, _data) \ #define GSET_UINT8(_ptr, _offset, _data) \

View File

@ -76,9 +76,9 @@ struct state_close;
/* functions that are invoked from devredir */ /* functions that are invoked from devredir */
void xfuse_devredir_cb_enum_dir_add_entry( void xfuse_devredir_cb_enum_dir_add_entry(
struct state_dirscan *fip, struct state_dirscan *fip,
const char *name, const char *name,
const struct file_attr *fattr); const struct file_attr *fattr);
void xfuse_devredir_cb_enum_dir_done(struct state_dirscan *fip, void xfuse_devredir_cb_enum_dir_done(struct state_dirscan *fip,
enum NTSTATUS IoStatus); enum NTSTATUS IoStatus);
@ -101,10 +101,10 @@ void xfuse_devredir_cb_read_file(struct state_read *fip,
enum NTSTATUS IoStatus, enum NTSTATUS IoStatus,
const char *buf, size_t length); const char *buf, size_t length);
void xfuse_devredir_cb_write_file( void xfuse_devredir_cb_write_file(
struct state_write *fip, struct state_write *fip,
enum NTSTATUS IoStatus, enum NTSTATUS IoStatus,
off_t offset, off_t offset,
size_t length); size_t length);
void xfuse_devredir_cb_rmdir_or_file(struct state_remove *fip, void xfuse_devredir_cb_rmdir_or_file(struct state_remove *fip,
enum NTSTATUS IoStatus); enum NTSTATUS IoStatus);

View File

@ -278,7 +278,7 @@ xfs_get_file_open_count(struct xfs_fs *xfs, fuse_ino_t inum);
*/ */
void void
xfs_delete_redirected_entries_with_device_id(struct xfs_fs *xfs, xfs_delete_redirected_entries_with_device_id(struct xfs_fs *xfs,
tui32 device_id); tui32 device_id);
/* /*
* Check an entry move will be successful * Check an entry move will be successful

View File

@ -128,7 +128,7 @@ struct clip_file_desc /* CLIPRDR_FILEDESCRIPTOR */
}; };
int clipboard_out_unicode(struct stream *s, const char *text, int clipboard_out_unicode(struct stream *s, const char *text,
int num_chars); int num_chars);
int clipboard_in_unicode(struct stream *s, char *text, int *num_chars); int clipboard_in_unicode(struct stream *s, char *text, int *num_chars);
#endif #endif

View File

@ -27,10 +27,10 @@
int devredir_init(void); int devredir_init(void);
int devredir_deinit(void); int devredir_deinit(void);
int devredir_data_in(struct stream* s, int chan_id, int chan_flags, int devredir_data_in(struct stream *s, int chan_id, int chan_flags,
int length, int total_length); int length, int total_length);
int devredir_get_wait_objs(tbus* objs, int* count, int* timeout); int devredir_get_wait_objs(tbus *objs, int *count, int *timeout);
int devredir_check_wait_objs(void); int devredir_check_wait_objs(void);
/* misc stuff */ /* misc stuff */
@ -57,23 +57,23 @@ struct state_close;
/* called from FUSE module */ /* called from FUSE module */
int devredir_get_dir_listing(struct state_dirscan *fusep, tui32 device_id, int devredir_get_dir_listing(struct state_dirscan *fusep, tui32 device_id,
const char *path); const char *path);
int devredir_lookup_entry(struct state_lookup *fusep, tui32 device_id, int devredir_lookup_entry(struct state_lookup *fusep, tui32 device_id,
const char *path); const char *path);
int devredir_setattr_for_entry( int devredir_setattr_for_entry(
struct state_setattr *fusep, tui32 device_id, struct state_setattr *fusep, tui32 device_id,
const char *filename, const char *filename,
const struct file_attr *fattr, const struct file_attr *fattr,
tui32 to_set); tui32 to_set);
int devredir_file_create( int devredir_file_create(
struct state_create *fusep, tui32 device_id, struct state_create *fusep, tui32 device_id,
const char *path, int mode); const char *path, int mode);
int devredir_file_open(struct state_open *fusep, tui32 device_id, int devredir_file_open(struct state_open *fusep, tui32 device_id,
const char *path, int flags); const char *path, int flags);
int devredir_file_close(struct state_close *fusep, tui32 device_id, int devredir_file_close(struct state_close *fusep, tui32 device_id,
tui32 file_id); tui32 file_id);
@ -87,9 +87,9 @@ devredir_file_write(struct state_write *fusep, tui32 DeviceId, tui32 FileId,
const char *buf, int Length, tui64 Offset); const char *buf, int Length, tui64 Offset);
int devredir_file_rename( int devredir_file_rename(
struct state_rename *fusep, tui32 device_id, struct state_rename *fusep, tui32 device_id,
const char *old_name, const char *old_name,
const char *new_name); const char *new_name);
int int
devredir_rmdir_or_file(struct state_remove *fusep, tui32 device_id, devredir_rmdir_or_file(struct state_remove *fusep, tui32 device_id,

View File

@ -16,20 +16,20 @@
* limitations under the License. * limitations under the License.
*/ */
/* FIFO implementation to store a pointer to a user struct */ /* FIFO implementation to store a pointer to a user struct */
typedef struct fifo typedef struct fifo
{ {
long* user_data; long *user_data;
int rd_ptr; int rd_ptr;
int wr_ptr; int wr_ptr;
int entries; int entries;
} FIFO; } FIFO;
int fifo_init(FIFO* fp, int num_entries); int fifo_init(FIFO *fp, int num_entries);
int fifo_deinit(FIFO* fp); int fifo_deinit(FIFO *fp);
int fifo_is_empty(FIFO* fp); int fifo_is_empty(FIFO *fp);
int fifo_insert(FIFO* fp, void* data); int fifo_insert(FIFO *fp, void *data);
void* fifo_remove(FIFO* fp); void *fifo_remove(FIFO *fp);
void* fifo_peek(FIFO* fp); void *fifo_peek(FIFO *fp);

View File

@ -105,18 +105,18 @@ struct irp
void *user_data; void *user_data;
}; };
IRP * devredir_irp_new(void); IRP *devredir_irp_new(void);
/* As above, but allocates sufficent space for the specified /* As above, but allocates sufficent space for the specified
* pathname, and copies it in to the pathname field */ * pathname, and copies it in to the pathname field */
IRP * devredir_irp_with_pathname_new(const char *pathname); IRP *devredir_irp_with_pathname_new(const char *pathname);
/* As above, but specifies a pathname length with pathname /* As above, but specifies a pathname length with pathname
* initially set to "". Use if you need to modify the pathname * initially set to "". Use if you need to modify the pathname
* significantly */ * significantly */
IRP * devredir_irp_with_pathnamelen_new(unsigned int pathnamelen); IRP *devredir_irp_with_pathnamelen_new(unsigned int pathnamelen);
int devredir_irp_delete(IRP *irp); int devredir_irp_delete(IRP *irp);
IRP * devredir_irp_find(tui32 completion_id); IRP *devredir_irp_find(tui32 completion_id);
IRP * devredir_irp_find_by_fileid(tui32 FileId); IRP *devredir_irp_find_by_fileid(tui32 FileId);
IRP * devredir_irp_get_last(void); IRP *devredir_irp_get_last(void);
void devredir_irp_dump(void); void devredir_irp_dump(void);
#endif /* end ifndef __IRP_H */ #endif /* end ifndef __IRP_H */

View File

@ -198,7 +198,7 @@ connect_to_chansrv(void)
if (dis < 0) if (dis < 0)
{ {
LLOGLN(0, ("connect_to_chansrv: error, don't understand DISPLAY='%s'", LLOGLN(0, ("connect_to_chansrv: error, don't understand DISPLAY='%s'",
xrdp_display)); xrdp_display));
return 1; return 1;
} }
g_sck = socket(PF_LOCAL, SOCK_STREAM, 0); g_sck = socket(PF_LOCAL, SOCK_STREAM, 0);

View File

@ -28,10 +28,10 @@ rail_init(void);
int int
rail_deinit(void); rail_deinit(void);
int int
rail_data_in(struct stream* s, int chan_id, int chan_flags, rail_data_in(struct stream *s, int chan_id, int chan_flags,
int length, int total_length); int length, int total_length);
int int
rail_xevent(void* xevent); rail_xevent(void *xevent);
int rail_request_title(int window_id); int rail_request_title(int window_id);
#endif #endif

View File

@ -112,61 +112,61 @@ int scard_init(void);
int scard_deinit(void); int scard_deinit(void);
int scard_send_establish_context(void *user_data, int scope); int scard_send_establish_context(void *user_data, int scope);
int scard_send_release_context(void *user_data, int scard_send_release_context(void *user_data,
char *context, int context_bytes); char *context, int context_bytes);
int scard_send_is_valid_context(void *user_data, int scard_send_is_valid_context(void *user_data,
char *context, int context_bytes); char *context, int context_bytes);
int scard_send_list_readers(void *user_data, int scard_send_list_readers(void *user_data,
char *context, int context_bytes, char *context, int context_bytes,
char *groups, int cchReaders, int wide); char *groups, int cchReaders, int wide);
int scard_send_get_status_change(void *user_data, int scard_send_get_status_change(void *user_data,
char *context, int context_bytes, char *context, int context_bytes,
int wide, tui32 timeout, int wide, tui32 timeout,
tui32 num_readers, READER_STATE* rsa); tui32 num_readers, READER_STATE *rsa);
int scard_send_connect(void *user_data, int scard_send_connect(void *user_data,
char *context, int context_bytes, int wide, char *context, int context_bytes, int wide,
READER_STATE* rs); READER_STATE *rs);
int scard_send_reconnect(void *user_data, int scard_send_reconnect(void *user_data,
char *context, int context_bytes, char *context, int context_bytes,
char *card, int card_bytes, char *card, int card_bytes,
READER_STATE* rs); READER_STATE *rs);
int scard_send_begin_transaction(void *user_data, int scard_send_begin_transaction(void *user_data,
char *context, int context_bytes,
char *card, int card_bytes);
int scard_send_end_transaction(void *user_data,
char *context, int context_bytes,
char *card, int card_bytes,
tui32 dwDisposition);
int scard_send_status(void *user_data, int wide,
char *context, int context_bytes,
char *card, int card_bytes,
int cchReaderLen, int cbAtrLen);
int scard_send_disconnect(void *user_data,
char *context, int context_bytes, char *context, int context_bytes,
char *card, int card_bytes, char *card, int card_bytes);
int dwDisposition); int scard_send_end_transaction(void *user_data,
int scard_send_transmit(void *user_data,
char *context, int context_bytes, char *context, int context_bytes,
char *card, int card_bytes, char *card, int card_bytes,
char *send_data, int send_bytes, int recv_bytes, tui32 dwDisposition);
struct xrdp_scard_io_request *send_ior, int scard_send_status(void *user_data, int wide,
struct xrdp_scard_io_request *recv_ior); char *context, int context_bytes,
char *card, int card_bytes,
int cchReaderLen, int cbAtrLen);
int scard_send_disconnect(void *user_data,
char *context, int context_bytes,
char *card, int card_bytes,
int dwDisposition);
int scard_send_transmit(void *user_data,
char *context, int context_bytes,
char *card, int card_bytes,
char *send_data, int send_bytes, int recv_bytes,
struct xrdp_scard_io_request *send_ior,
struct xrdp_scard_io_request *recv_ior);
int scard_send_control(void *user_data, int scard_send_control(void *user_data,
char *context, int context_bytes, char *context, int context_bytes,
char *card, int card_bytes, char *card, int card_bytes,
char *send_data, int send_bytes, char *send_data, int send_bytes,
int recv_bytes, int control_code); int recv_bytes, int control_code);
int scard_send_cancel(void *user_data, int scard_send_cancel(void *user_data,
char *context, int context_bytes); char *context, int context_bytes);
int scard_send_get_attrib(void *user_data, char *card, int card_bytes, int scard_send_get_attrib(void *user_data, char *card, int card_bytes,
READER_STATE* rs); READER_STATE *rs);
/* /*
* Notes: * Notes:

View File

@ -29,61 +29,61 @@ int scard_pcsc_check_wait_objs(void);
int scard_pcsc_init(void); int scard_pcsc_init(void);
int scard_pcsc_deinit(void); int scard_pcsc_deinit(void);
int scard_function_establish_context_return(void *user_data, int scard_function_establish_context_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
int scard_function_release_context_return(void *user_data, int scard_function_release_context_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
int scard_function_list_readers_return(void *user_data, int scard_function_list_readers_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
int scard_function_transmit_return(void *user_data, int scard_function_transmit_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
int scard_function_control_return(void *user_data, int scard_function_control_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
int scard_function_get_status_change_return(void *user_data, int scard_function_get_status_change_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
int scard_function_connect_return(void *user_data, int scard_function_connect_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
int scard_function_status_return(void *user_data, int scard_function_status_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
int scard_function_begin_transaction_return(void *user_data, int scard_function_begin_transaction_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
int scard_function_end_transaction_return(void *user_data, int scard_function_end_transaction_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
int scard_function_is_context_valid_return(void *user_data, int scard_function_is_context_valid_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
int scard_function_reconnect_return(void *user_data, int scard_function_reconnect_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
int scard_function_disconnect_return(void *user_data, int scard_function_disconnect_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
int scard_function_cancel_return(void *user_data, int scard_function_cancel_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
int scard_function_get_attrib_return(void *user_data, int scard_function_get_attrib_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status); int len, int status);
#endif /* end #ifndef _SMARTCARD_PCSC_H */ #endif /* end #ifndef _SMARTCARD_PCSC_H */

View File

@ -52,10 +52,10 @@
int sound_init(void); int sound_init(void);
int sound_deinit(void); int sound_deinit(void);
int sound_get_wait_objs(tbus* objs, int* count, int* timeout); int sound_get_wait_objs(tbus *objs, int *count, int *timeout);
int sound_check_wait_objs(void); int sound_check_wait_objs(void);
int sound_data_in(struct stream* s, int chan_id, int chan_flags, int sound_data_in(struct stream *s, int chan_id, int chan_flags,
int length, int total_length); int length, int total_length);
#endif #endif

View File

@ -33,7 +33,7 @@ xcommon_get_local_time(void);
int int
xcommon_init(void); xcommon_init(void);
int int
xcommon_get_wait_objs(tbus* objs, int* count, int* timeout); xcommon_get_wait_objs(tbus *objs, int *count, int *timeout);
int int
xcommon_check_wait_objs(void); xcommon_check_wait_objs(void);
void void

View File

@ -77,13 +77,15 @@
#define SESMAN_CFG_SESS_POLICY_UBDI_S "UBDI" #define SESMAN_CFG_SESS_POLICY_UBDI_S "UBDI"
#define SESMAN_CFG_SESS_POLICY_UBDC_S "UBDC" #define SESMAN_CFG_SESS_POLICY_UBDC_S "UBDC"
enum SESMAN_CFG_SESS_POLICY_BITS { enum SESMAN_CFG_SESS_POLICY_BITS
{
SESMAN_CFG_SESS_POLICY_D = 0x01, SESMAN_CFG_SESS_POLICY_D = 0x01,
SESMAN_CFG_SESS_POLICY_I = 0x02, SESMAN_CFG_SESS_POLICY_I = 0x02,
SESMAN_CFG_SESS_POLICY_C = 0x04 SESMAN_CFG_SESS_POLICY_C = 0x04
}; };
enum SESMAN_CFG_SESS_POLICY { enum SESMAN_CFG_SESS_POLICY
{
SESMAN_CFG_SESS_POLICY_DFLT = 0, SESMAN_CFG_SESS_POLICY_DFLT = 0,
SESMAN_CFG_SESS_POLICY_UBD = SESMAN_CFG_SESS_POLICY_D, SESMAN_CFG_SESS_POLICY_UBD = SESMAN_CFG_SESS_POLICY_D,
SESMAN_CFG_SESS_POLICY_UBI = SESMAN_CFG_SESS_POLICY_I, SESMAN_CFG_SESS_POLICY_UBI = SESMAN_CFG_SESS_POLICY_I,
@ -100,38 +102,38 @@ enum SESMAN_CFG_SESS_POLICY {
*/ */
struct config_security struct config_security
{ {
/** /**
* @var allow_root * @var allow_root
* @brief allow root login on TS * @brief allow root login on TS
*/ */
int allow_root; int allow_root;
/** /**
* @var login_retry * @var login_retry
* @brief maximum login attempts * @brief maximum login attempts
*/ */
int login_retry; int login_retry;
/** /**
* @var ts_users * @var ts_users
* @brief Terminal Server Users group * @brief Terminal Server Users group
*/ */
int ts_users_enable; int ts_users_enable;
int ts_users; int ts_users;
/** /**
* @var ts_admins * @var ts_admins
* @brief Terminal Server Administrators group * @brief Terminal Server Administrators group
*/ */
int ts_admins_enable; int ts_admins_enable;
int ts_admins; int ts_admins;
/** /**
* @var ts_always_group_check * @var ts_always_group_check
* @brief if the Groups are not found deny access * @brief if the Groups are not found deny access
*/ */
int ts_always_group_check; int ts_always_group_check;
/** /**
* @var restrict_outbound_clipboard * @var restrict_outbound_clipboard
* @brief if the clipboard should be enforced restricted. If true only allow client -> server, not vice versa. * @brief if the clipboard should be enforced restricted. If true only allow client -> server, not vice versa.
*/ */
int restrict_outbound_clipboard; int restrict_outbound_clipboard;
}; };
/** /**
@ -142,36 +144,36 @@ struct config_security
*/ */
struct config_sessions struct config_sessions
{ {
/** /**
* @var x11_display_offset * @var x11_display_offset
* @brief X11 TCP port offset. default value: 10 * @brief X11 TCP port offset. default value: 10
*/ */
int x11_display_offset; int x11_display_offset;
/** /**
* @var max_sessions * @var max_sessions
* @brief maximum number of allowed sessions. 0 for unlimited * @brief maximum number of allowed sessions. 0 for unlimited
*/ */
int max_sessions; int max_sessions;
/** /**
* @var max_idle_time * @var max_idle_time
* @brief maximum idle time for each session * @brief maximum idle time for each session
*/ */
int max_idle_time; int max_idle_time;
/** /**
* @var max_disc_time * @var max_disc_time
* @brief maximum disconnected time for each session * @brief maximum disconnected time for each session
*/ */
int max_disc_time; int max_disc_time;
/** /**
* @var kill_disconnected * @var kill_disconnected
* @brief enables automatic killing of disconnected session * @brief enables automatic killing of disconnected session
*/ */
int kill_disconnected; int kill_disconnected;
/** /**
* @var policy * @var policy
* @brief session allocation policy * @brief session allocation policy
*/ */
enum SESMAN_CFG_SESS_POLICY policy; enum SESMAN_CFG_SESS_POLICY policy;
}; };
/** /**
@ -186,88 +188,88 @@ struct config_sessions
*/ */
struct config_sesman struct config_sesman
{ {
/** /**
* @var sesman_ini * @var sesman_ini
* @brief File that these parameters are read from * @brief File that these parameters are read from
*/ */
char *sesman_ini; char *sesman_ini;
/** /**
* @var listen_address * @var listen_address
* @brief Listening address * @brief Listening address
*/ */
char listen_address[32]; char listen_address[32];
/** /**
* @var listen_port * @var listen_port
* @brief Listening port * @brief Listening port
*/ */
char listen_port[16]; char listen_port[16];
/** /**
* @var enable_user_wm * @var enable_user_wm
* @brief Flag that enables user specific wm * @brief Flag that enables user specific wm
*/ */
int enable_user_wm; int enable_user_wm;
/** /**
* @var default_wm * @var default_wm
* @brief Default window manager * @brief Default window manager
*/ */
char *default_wm; char *default_wm;
/** /**
* @var user_wm * @var user_wm
* @brief Default window manager * @brief Default window manager
*/ */
char user_wm[32]; char user_wm[32];
/** /**
* @var reconnect_sh * @var reconnect_sh
* @brief Script executed when reconnected * @brief Script executed when reconnected
*/ */
char *reconnect_sh; char *reconnect_sh;
/** /**
* @var auth_file_path * @var auth_file_path
* @brief Auth file path * @brief Auth file path
*/ */
char* auth_file_path; char *auth_file_path;
/** /**
* @var vnc_params * @var vnc_params
* @brief Xvnc additional parameter list * @brief Xvnc additional parameter list
*/ */
struct list* vnc_params; struct list *vnc_params;
/** /**
* @var rdp_params * @var rdp_params
* @brief X11rdp additional parameter list * @brief X11rdp additional parameter list
*/ */
struct list* rdp_params; struct list *rdp_params;
/** /**
* @var xorg_params * @var xorg_params
* @brief Xorg additional parameter list * @brief Xorg additional parameter list
*/ */
struct list* xorg_params; struct list *xorg_params;
/** /**
* @var log * @var log
* @brief Log configuration struct * @brief Log configuration struct
*/ */
//struct log_config log; //struct log_config log;
/** /**
* @var sec * @var sec
* @brief Security configuration options struct * @brief Security configuration options struct
*/ */
struct config_security sec; struct config_security sec;
/** /**
* @var sess * @var sess
* @brief Session configuration options struct * @brief Session configuration options struct
*/ */
struct config_sessions sess; struct config_sessions sess;
/** /**
* @var env_names * @var env_names
* @brief environment variable name list * @brief environment variable name list
*/ */
struct list* env_names; struct list *env_names;
/** /**
* @var env_values * @var env_values
* @brief environment variable value list * @brief environment variable value list
*/ */
struct list* env_values; struct list *env_values;
}; };
/** /**
@ -279,7 +281,7 @@ struct config_sesman
* @post pass return value to config_free() to prevent memory leaks * @post pass return value to config_free() to prevent memory leaks
* *
*/ */
struct config_sesman* struct config_sesman *
config_read(const char *sesman_ini); config_read(const char *sesman_ini);
/** /**

View File

@ -37,7 +37,7 @@
* @return a struct SCP_CONNECTION* object on success, NULL otherwise * @return a struct SCP_CONNECTION* object on success, NULL otherwise
* *
*/ */
struct SCP_CONNECTION* struct SCP_CONNECTION *
scp_connection_create(int sck); scp_connection_create(int sck);
/** /**
@ -47,6 +47,6 @@ scp_connection_create(int sck);
* *
*/ */
void void
scp_connection_destroy(struct SCP_CONNECTION* c); scp_connection_destroy(struct SCP_CONNECTION *c);
#endif #endif

View File

@ -37,59 +37,59 @@
* @return a struct SCP_SESSION* object on success, NULL otherwise * @return a struct SCP_SESSION* object on success, NULL otherwise
* *
*/ */
struct SCP_SESSION* struct SCP_SESSION *
scp_session_create(void); scp_session_create(void);
int int
scp_session_set_type(struct SCP_SESSION* s, tui8 type); scp_session_set_type(struct SCP_SESSION *s, tui8 type);
int int
scp_session_set_version(struct SCP_SESSION* s, tui32 version); scp_session_set_version(struct SCP_SESSION *s, tui32 version);
int int
scp_session_set_height(struct SCP_SESSION* s, tui16 h); scp_session_set_height(struct SCP_SESSION *s, tui16 h);
int int
scp_session_set_width(struct SCP_SESSION* s, tui16 w); scp_session_set_width(struct SCP_SESSION *s, tui16 w);
int int
scp_session_set_bpp(struct SCP_SESSION* s, tui8 bpp); scp_session_set_bpp(struct SCP_SESSION *s, tui8 bpp);
int int
scp_session_set_rsr(struct SCP_SESSION* s, tui8 rsr); scp_session_set_rsr(struct SCP_SESSION *s, tui8 rsr);
int int
scp_session_set_locale(struct SCP_SESSION* s, const char *str); scp_session_set_locale(struct SCP_SESSION *s, const char *str);
int int
scp_session_set_username(struct SCP_SESSION* s, const char *str); scp_session_set_username(struct SCP_SESSION *s, const char *str);
int int
scp_session_set_password(struct SCP_SESSION* s, const char *str); scp_session_set_password(struct SCP_SESSION *s, const char *str);
int int
scp_session_set_domain(struct SCP_SESSION* s, const char *str); scp_session_set_domain(struct SCP_SESSION *s, const char *str);
int int
scp_session_set_program(struct SCP_SESSION* s, const char *str); scp_session_set_program(struct SCP_SESSION *s, const char *str);
int int
scp_session_set_directory(struct SCP_SESSION* s, const char *str); scp_session_set_directory(struct SCP_SESSION *s, const char *str);
int int
scp_session_set_client_ip(struct SCP_SESSION* s, const char *str); scp_session_set_client_ip(struct SCP_SESSION *s, const char *str);
int int
scp_session_set_hostname(struct SCP_SESSION* s, const char *str); scp_session_set_hostname(struct SCP_SESSION *s, const char *str);
int int
scp_session_set_addr(struct SCP_SESSION* s, int type, const void* addr); scp_session_set_addr(struct SCP_SESSION *s, int type, const void *addr);
int int
scp_session_set_display(struct SCP_SESSION* s, SCP_DISPLAY display); scp_session_set_display(struct SCP_SESSION *s, SCP_DISPLAY display);
int int
scp_session_set_errstr(struct SCP_SESSION* s, const char *str); scp_session_set_errstr(struct SCP_SESSION *s, const char *str);
int int
scp_session_set_guid(struct SCP_SESSION *s, const tui8 *guid); scp_session_set_guid(struct SCP_SESSION *s, const tui8 *guid);
@ -101,6 +101,6 @@ scp_session_set_guid(struct SCP_SESSION *s, const tui8 *guid);
* *
*/ */
void void
scp_session_destroy(struct SCP_SESSION* s); scp_session_destroy(struct SCP_SESSION *s);
#endif #endif

View File

@ -39,7 +39,7 @@
* *
*/ */
int int
scp_tcp_force_recv(int sck, char* data, int len); scp_tcp_force_recv(int sck, char *data, int len);
/** /**
* *
@ -51,7 +51,7 @@ scp_tcp_force_recv(int sck, char* data, int len);
* *
*/ */
int int
scp_tcp_force_send(int sck, char* data, int len); scp_tcp_force_send(int sck, char *data, int len);
/** /**
* *
@ -63,6 +63,6 @@ scp_tcp_force_send(int sck, char* data, int len);
* *
*/ */
int int
scp_tcp_bind(int sck, char* addr, char* port); scp_tcp_bind(int sck, char *addr, char *port);
#endif #endif

View File

@ -65,90 +65,90 @@
struct SCP_CONNECTION struct SCP_CONNECTION
{ {
int in_sck; int in_sck;
struct stream* in_s; struct stream *in_s;
struct stream* out_s; struct stream *out_s;
}; };
struct SCP_SESSION struct SCP_SESSION
{ {
tui8 type; tui8 type;
tui32 version; tui32 version;
tui16 height; tui16 height;
tui16 width; tui16 width;
tui8 bpp; tui8 bpp;
tui8 rsr; tui8 rsr;
char locale[18]; char locale[18];
char* username; char *username;
char* password; char *password;
char* hostname; char *hostname;
tui8 addr_type; tui8 addr_type;
tui32 ipv4addr; tui32 ipv4addr;
tui8 ipv6addr[16]; tui8 ipv6addr[16];
SCP_DISPLAY display; SCP_DISPLAY display;
char* errstr; char *errstr;
struct SCP_MNG_DATA* mng; struct SCP_MNG_DATA *mng;
char* domain; char *domain;
char* program; char *program;
char* directory; char *directory;
char* client_ip; char *client_ip;
tui8 guid[16]; tui8 guid[16];
}; };
struct SCP_DISCONNECTED_SESSION struct SCP_DISCONNECTED_SESSION
{ {
tui32 SID; tui32 SID;
tui8 type; tui8 type;
tui8 status; tui8 status;
tui16 height; tui16 height;
tui16 width; tui16 width;
tui8 bpp; tui8 bpp;
tui8 idle_days; tui8 idle_days;
tui8 idle_hours; tui8 idle_hours;
tui8 idle_minutes; tui8 idle_minutes;
tui16 conn_year; tui16 conn_year;
tui8 conn_month; tui8 conn_month;
tui8 conn_day; tui8 conn_day;
tui8 conn_hour; tui8 conn_hour;
tui8 conn_minute; tui8 conn_minute;
tui8 addr_type; tui8 addr_type;
tui32 ipv4addr; tui32 ipv4addr;
tui8 ipv6addr[16]; tui8 ipv6addr[16];
}; };
enum SCP_CLIENT_STATES_E enum SCP_CLIENT_STATES_E
{ {
SCP_CLIENT_STATE_OK, SCP_CLIENT_STATE_OK,
SCP_CLIENT_STATE_NETWORK_ERR, SCP_CLIENT_STATE_NETWORK_ERR,
SCP_CLIENT_STATE_VERSION_ERR, SCP_CLIENT_STATE_VERSION_ERR,
SCP_CLIENT_STATE_SEQUENCE_ERR, SCP_CLIENT_STATE_SEQUENCE_ERR,
SCP_CLIENT_STATE_SIZE_ERR, SCP_CLIENT_STATE_SIZE_ERR,
SCP_CLIENT_STATE_INTERNAL_ERR, SCP_CLIENT_STATE_INTERNAL_ERR,
SCP_CLIENT_STATE_SESSION_LIST, SCP_CLIENT_STATE_SESSION_LIST,
SCP_CLIENT_STATE_LIST_OK, SCP_CLIENT_STATE_LIST_OK,
SCP_CLIENT_STATE_RESEND_CREDENTIALS, SCP_CLIENT_STATE_RESEND_CREDENTIALS,
SCP_CLIENT_STATE_CONNECTION_DENIED, SCP_CLIENT_STATE_CONNECTION_DENIED,
SCP_CLIENT_STATE_PWD_CHANGE_REQ, SCP_CLIENT_STATE_PWD_CHANGE_REQ,
SCP_CLIENT_STATE_RECONNECT_SINGLE, SCP_CLIENT_STATE_RECONNECT_SINGLE,
SCP_CLIENT_STATE_SELECTION_CANCEL, SCP_CLIENT_STATE_SELECTION_CANCEL,
SCP_CLIENT_STATE_END SCP_CLIENT_STATE_END
}; };
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
{ {
SCP_SERVER_STATE_OK, SCP_SERVER_STATE_OK,
SCP_SERVER_STATE_VERSION_ERR, SCP_SERVER_STATE_VERSION_ERR,
SCP_SERVER_STATE_NETWORK_ERR, SCP_SERVER_STATE_NETWORK_ERR,
SCP_SERVER_STATE_SEQUENCE_ERR, SCP_SERVER_STATE_SEQUENCE_ERR,
SCP_SERVER_STATE_INTERNAL_ERR, SCP_SERVER_STATE_INTERNAL_ERR,
SCP_SERVER_STATE_SESSION_TYPE_ERR, SCP_SERVER_STATE_SESSION_TYPE_ERR,
SCP_SERVER_STATE_SIZE_ERR, SCP_SERVER_STATE_SIZE_ERR,
SCP_SERVER_STATE_SELECTION_CANCEL, SCP_SERVER_STATE_SELECTION_CANCEL,
/*SCP_SERVER_STATE_FORCE_NEW,*/ /*SCP_SERVER_STATE_FORCE_NEW,*/
SCP_SERVER_STATE_START_MANAGE, SCP_SERVER_STATE_START_MANAGE,
SCP_SERVER_STATE_MNG_LISTREQ, SCP_SERVER_STATE_MNG_LISTREQ,
SCP_SERVER_STATE_MNG_ACTION, SCP_SERVER_STATE_MNG_ACTION,
SCP_SERVER_STATE_END SCP_SERVER_STATE_END
}; };
#endif #endif

View File

@ -34,14 +34,14 @@
enum SCP_MNG_COMMAND enum SCP_MNG_COMMAND
{ {
SCP_MNG_CMD_KILL, SCP_MNG_CMD_KILL,
SCP_MNG_CMD_DISCONNECT SCP_MNG_CMD_DISCONNECT
}; };
struct SCP_MNG_DATA struct SCP_MNG_DATA
{ {
enum SCP_MNG_COMMAND cmd; enum SCP_MNG_COMMAND cmd;
SCP_SID sid; SCP_SID sid;
}; };
#endif #endif

View File

@ -39,7 +39,7 @@
* *
*/ */
enum SCP_CLIENT_STATES_E enum SCP_CLIENT_STATES_E
scp_v0c_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s); scp_v0c_connect(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
/* server API */ /* server API */
/** /**
@ -52,7 +52,7 @@ scp_v0c_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s);
* *
*/ */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v0s_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s, int skipVchk); scp_v0s_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s, int skipVchk);
/** /**
* *
@ -61,7 +61,7 @@ scp_v0s_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s, int skipVchk);
* *
*/ */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v0s_allow_connection(struct SCP_CONNECTION* c, SCP_DISPLAY d, const tui8 *guid); scp_v0s_allow_connection(struct SCP_CONNECTION *c, SCP_DISPLAY d, const tui8 *guid);
/** /**
* *
@ -70,7 +70,7 @@ scp_v0s_allow_connection(struct SCP_CONNECTION* c, SCP_DISPLAY d, const tui8 *gu
* *
*/ */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v0s_deny_connection(struct SCP_CONNECTION* c); scp_v0s_deny_connection(struct SCP_CONNECTION *c);
/** /**
* @brief send reply to an authentication request * @brief send reply to an authentication request
@ -79,6 +79,6 @@ scp_v0s_deny_connection(struct SCP_CONNECTION* c);
* @return * @return
*/ */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v0s_replyauthentication(struct SCP_CONNECTION* c, unsigned short int value); scp_v0s_replyauthentication(struct SCP_CONNECTION *c, unsigned short int value);
#endif #endif

View File

@ -32,32 +32,32 @@
/* client API */ /* client API */
/* 001 */ /* 001 */
enum SCP_CLIENT_STATES_E enum SCP_CLIENT_STATES_E
scp_v1c_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s); scp_v1c_connect(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
/* 004 */ /* 004 */
enum SCP_CLIENT_STATES_E enum SCP_CLIENT_STATES_E
scp_v1c_resend_credentials(struct SCP_CONNECTION* c, struct SCP_SESSION* s); scp_v1c_resend_credentials(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
/* 021 */ /* 021 */
enum SCP_CLIENT_STATES_E enum SCP_CLIENT_STATES_E
scp_v1c_pwd_change(struct SCP_CONNECTION* c, char* newpass); scp_v1c_pwd_change(struct SCP_CONNECTION *c, char *newpass);
/* 022 */ /* 022 */
enum SCP_CLIENT_STATES_E enum SCP_CLIENT_STATES_E
scp_v1c_pwd_change_cancel(struct SCP_CONNECTION* c); scp_v1c_pwd_change_cancel(struct SCP_CONNECTION *c);
/* 041 */ /* 041 */
enum SCP_CLIENT_STATES_E enum SCP_CLIENT_STATES_E
scp_v1c_get_session_list(struct SCP_CONNECTION* c, int* scount, scp_v1c_get_session_list(struct SCP_CONNECTION *c, int *scount,
struct SCP_DISCONNECTED_SESSION** s); struct SCP_DISCONNECTED_SESSION **s);
/* 043 */ /* 043 */
enum SCP_CLIENT_STATES_E enum SCP_CLIENT_STATES_E
scp_v1c_select_session(struct SCP_CONNECTION* c, struct SCP_SESSION* s, scp_v1c_select_session(struct SCP_CONNECTION *c, struct SCP_SESSION *s,
SCP_SID sid); SCP_SID sid);
/* 044 */ /* 044 */
enum SCP_CLIENT_STATES_E enum SCP_CLIENT_STATES_E
scp_v1c_select_session_cancel(struct SCP_CONNECTION* c); scp_v1c_select_session_cancel(struct SCP_CONNECTION *c);
#endif #endif

View File

@ -32,7 +32,7 @@
/* client API */ /* client API */
/* 001 */ /* 001 */
enum SCP_CLIENT_STATES_E enum SCP_CLIENT_STATES_E
scp_v1c_mng_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s); scp_v1c_mng_connect(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
/* 004 * / /* 004 * /
enum SCP_CLIENT_STATES_E enum SCP_CLIENT_STATES_E
@ -49,7 +49,7 @@ scp_v1c_pwd_change_cancel(struct SCP_CONNECTION* c);
/* 041 */ /* 041 */
enum SCP_CLIENT_STATES_E enum SCP_CLIENT_STATES_E
scp_v1c_mng_get_session_list(struct SCP_CONNECTION* c, int* scount, scp_v1c_mng_get_session_list(struct SCP_CONNECTION *c, int *scount,
struct SCP_DISCONNECTED_SESSION** s); struct SCP_DISCONNECTED_SESSION **s);
#endif #endif

View File

@ -42,7 +42,7 @@
* that should be free()d * that should be free()d
*/ */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v1s_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s, int skipVchk); scp_v1s_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s, int skipVchk);
/** /**
* *
@ -53,35 +53,35 @@ scp_v1s_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s, int skipVchk);
*/ */
/* 002 */ /* 002 */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v1s_deny_connection(struct SCP_CONNECTION* c, const char *reason); scp_v1s_deny_connection(struct SCP_CONNECTION *c, const char *reason);
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v1s_request_password(struct SCP_CONNECTION* c, struct SCP_SESSION* s, scp_v1s_request_password(struct SCP_CONNECTION *c, struct SCP_SESSION *s,
const char *reason); const char *reason);
/* 020 */ /* 020 */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v1s_request_pwd_change(struct SCP_CONNECTION* c, char* reason, char* npw); scp_v1s_request_pwd_change(struct SCP_CONNECTION *c, char *reason, char *npw);
/* 023 */ /* 023 */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v1s_pwd_change_error(struct SCP_CONNECTION* c, char* error, int retry, char* npw); scp_v1s_pwd_change_error(struct SCP_CONNECTION *c, char *error, int retry, char *npw);
/* 030 */ /* 030 */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v1s_connect_new_session(struct SCP_CONNECTION* c, SCP_DISPLAY d); scp_v1s_connect_new_session(struct SCP_CONNECTION *c, SCP_DISPLAY d);
/* 032 */ /* 032 */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v1s_connection_error(struct SCP_CONNECTION* c, const char *error); scp_v1s_connection_error(struct SCP_CONNECTION *c, const char *error);
/* 040 */ /* 040 */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v1s_list_sessions(struct SCP_CONNECTION* c, int sescnt, scp_v1s_list_sessions(struct SCP_CONNECTION *c, int sescnt,
struct SCP_DISCONNECTED_SESSION* ds, SCP_SID* sid); struct SCP_DISCONNECTED_SESSION *ds, SCP_SID *sid);
/* 046 was: 031 struct SCP_DISCONNECTED_SESSION* ds, */ /* 046 was: 031 struct SCP_DISCONNECTED_SESSION* ds, */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v1s_reconnect_session(struct SCP_CONNECTION* c, SCP_DISPLAY d); scp_v1s_reconnect_session(struct SCP_CONNECTION *c, SCP_DISPLAY d);
#endif #endif

View File

@ -40,7 +40,7 @@
* that should be free()d * that should be free()d
*/ */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v1s_mng_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s); scp_v1s_mng_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s);
/** /**
* *
@ -50,7 +50,7 @@ scp_v1s_mng_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s);
*/ */
/* 002 */ /* 002 */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v1s_mng_allow_connection(struct SCP_CONNECTION* c, struct SCP_SESSION* s); scp_v1s_mng_allow_connection(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
/** /**
* *
@ -61,7 +61,7 @@ scp_v1s_mng_allow_connection(struct SCP_CONNECTION* c, struct SCP_SESSION* s);
*/ */
/* 003 */ /* 003 */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v1s_mng_deny_connection(struct SCP_CONNECTION* c, const char *reason); scp_v1s_mng_deny_connection(struct SCP_CONNECTION *c, const char *reason);
/** /**
* *
@ -71,8 +71,8 @@ scp_v1s_mng_deny_connection(struct SCP_CONNECTION* c, const char *reason);
*/ */
/* 006 */ /* 006 */
enum SCP_SERVER_STATES_E enum SCP_SERVER_STATES_E
scp_v1s_mng_list_sessions(struct SCP_CONNECTION* c, struct SCP_SESSION* s, scp_v1s_mng_list_sessions(struct SCP_CONNECTION *c, struct SCP_SESSION *s,
int sescnt, struct SCP_DISCONNECTED_SESSION* ds); int sescnt, struct SCP_DISCONNECTED_SESSION *ds);
// SCP_SID* sid); // SCP_SID* sid);
#endif #endif

View File

@ -42,6 +42,6 @@
* It this memory needs to be g_free()d * It this memory needs to be g_free()d
* *
*/ */
enum SCP_SERVER_STATES_E scp_vXs_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s); enum SCP_SERVER_STATES_E scp_vXs_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s);
#endif #endif

View File

@ -39,7 +39,7 @@
* @param socket the connection socket * @param socket the connection socket
* *
*/ */
void* void *
scp_process_start(void* sck); scp_process_start(void *sck);
#endif #endif

View File

@ -38,6 +38,6 @@
* *
*/ */
void void
scp_v0_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s); scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
#endif #endif

View File

@ -36,6 +36,6 @@
* *
*/ */
void void
scp_v1_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s); scp_v1_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
#endif #endif

View File

@ -36,6 +36,6 @@
* *
*/ */
void void
scp_v1_mng_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s); scp_v1_mng_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
#endif #endif

View File

@ -48,41 +48,41 @@
struct session_date struct session_date
{ {
tui16 year; tui16 year;
tui8 month; tui8 month;
tui8 day; tui8 day;
tui8 hour; tui8 hour;
tui8 minute; tui8 minute;
}; };
#define zero_time(s) { (s)->year=0; (s)->month=0; (s)->day=0; (s)->hour=0; (s)->minute=0; } #define zero_time(s) { (s)->year=0; (s)->month=0; (s)->day=0; (s)->hour=0; (s)->minute=0; }
struct session_item struct session_item
{ {
char name[256]; char name[256];
int pid; /* pid of sesman waiting for wm to end */ int pid; /* pid of sesman waiting for wm to end */
int display; int display;
int width; int width;
int height; int height;
int bpp; int bpp;
long data; long data;
/* status info */ /* status info */
unsigned char status; unsigned char status;
unsigned char type; unsigned char type;
/* time data */ /* time data */
struct session_date connect_time; struct session_date connect_time;
struct session_date disconnect_time; struct session_date disconnect_time;
struct session_date idle_time; struct session_date idle_time;
char client_ip[256]; char client_ip[256];
tui8 guid[16]; tui8 guid[16];
}; };
struct session_chain struct session_chain
{ {
struct session_chain* next; struct session_chain *next;
struct session_item* item; struct session_item *item;
}; };
/** /**
@ -91,11 +91,11 @@ struct session_chain
* @return session data or 0 * @return session data or 0
* *
*/ */
struct session_item* struct session_item *
session_get_bydata(const char *name, int width, int height, int bpp, int type, session_get_bydata(const char *name, int width, int height, int bpp, int type,
const char *client_ip); const char *client_ip);
#ifndef session_find_item #ifndef session_find_item
#define session_find_item(a, b, c, d, e, f) session_get_bydata(a, b, c, d, e, f); #define session_find_item(a, b, c, d, e, f) session_get_bydata(a, b, c, d, e, f);
#endif #endif
/** /**
@ -137,7 +137,7 @@ session_sigkill_all(void);
* @return a pointer to the session descriptor on success, NULL otherwise * @return a pointer to the session descriptor on success, NULL otherwise
* *
*/ */
struct session_item* struct session_item *
session_get_bypid(int pid); session_get_bypid(int pid);
/** /**
@ -147,7 +147,7 @@ session_get_bypid(int pid);
* @return a pointer to the session descriptor on success, NULL otherwise * @return a pointer to the session descriptor on success, NULL otherwise
* *
*/ */
struct SCP_DISCONNECTED_SESSION* struct SCP_DISCONNECTED_SESSION *
session_get_byuser(const char *user, int *cnt, unsigned char flags); session_get_byuser(const char *user, int *cnt, unsigned char flags);
/** /**

View File

@ -59,7 +59,7 @@ sig_sesman_session_end(int sig);
* @brief signal handling thread * @brief signal handling thread
* *
*/ */
void* void *
sig_handler_thread(void* arg); sig_handler_thread(void *arg);
#endif #endif

View File

@ -220,8 +220,8 @@ parse_geometry_string(const char *geom_str, struct session_params *sp)
} }
if (sep_count != 1 || other_count > 0 || if (sep_count != 1 || other_count > 0 ||
sepp == geom_str || /* Separator at start of string */ sepp == geom_str || /* Separator at start of string */
sepp == (p - 1) ) /* Separator at end of string */ sepp == (p - 1) ) /* Separator at end of string */
{ {
LOG(LOG_LEVEL_ERROR, "Invalid geometry string '%s'", geom_str); LOG(LOG_LEVEL_ERROR, "Invalid geometry string '%s'", geom_str);
} }

View File

@ -37,7 +37,7 @@
* *
*/ */
int int
tcp_force_recv(int sck, char* data, int len); tcp_force_recv(int sck, char *data, int len);
/** /**
* *
@ -49,7 +49,7 @@ tcp_force_recv(int sck, char* data, int len);
* *
*/ */
int int
tcp_force_send(int sck, char* data, int len); tcp_force_send(int sck, char *data, int len);
/** /**
* *
@ -61,6 +61,6 @@ tcp_force_send(int sck, char* data, int len);
* *
*/ */
int int
tcp_bind(int sck, char* addr, char* port); tcp_bind(int sck, char *addr, char *port);
#endif #endif

View File

@ -17,41 +17,42 @@
#include "utils.h" #include "utils.h"
namespace Ui { namespace Ui
class MainWindow; {
class MainWindow;
} }
class MainWindow : public QMainWindow class MainWindow : public QMainWindow
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit MainWindow(QWidget *parent = 0); explicit MainWindow(QWidget *parent = 0);
~MainWindow(); ~MainWindow();
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
void *wtsChannel; void *wtsChannel;
QSystemTrayIcon *trayIcon; QSystemTrayIcon *trayIcon;
QMenu *trayMenu; QMenu *trayMenu;
bool okToQuit; bool okToQuit;
QRect savedGeometry; QRect savedGeometry;
QStatusBar *statusBar; QStatusBar *statusBar;
QList<QListWidgetItem *> itemList; QList<QListWidgetItem *> itemList;
void setupSystemTray(); void setupSystemTray();
int initWtsChannel(); int initWtsChannel();
int deinitWtsChannel(); int deinitWtsChannel();
void setStatusMsg(QString msg); void setStatusMsg(QString msg);
void closeEvent(QCloseEvent * event); void closeEvent(QCloseEvent *event);
private slots: private slots:
void onBtnRefreshClicked(); void onBtnRefreshClicked();
void onBtnUnmountClicked(); void onBtnUnmountClicked();
void onActionQuit(); void onActionQuit();
void onActionLaunch(); void onActionLaunch();
void onSystemTrayClicked(QSystemTrayIcon::ActivationReason); void onSystemTrayClicked(QSystemTrayIcon::ActivationReason);
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H

View File

@ -14,111 +14,111 @@
typedef struct stream typedef struct stream
{ {
char* data; /* holds stream data */ char *data; /* holds stream data */
char* pos; /* current read/write position */ char *pos; /* current read/write position */
int size; /* number of bytes in data */ int size; /* number of bytes in data */
} STREAM; } STREAM;
#define qstream_new(_s, _size) \ #define qstream_new(_s, _size) \
do \ do \
{ \ { \
(_s).data = (char *) malloc(_size); \ (_s).data = (char *) malloc(_size); \
(_s).pos = (_s).data; \ (_s).pos = (_s).data; \
(_s).size = (_size); \ (_s).size = (_size); \
} \ } \
while (0) while (0)
#define qstream_new_zero(_s, _size) \ #define qstream_new_zero(_s, _size) \
do \ do \
{ \ { \
(_s).data = (char *) calloc((_size), 1); \ (_s).data = (char *) calloc((_size), 1); \
(_s).pos = (_s).data; \ (_s).pos = (_s).data; \
(_s).size = (_size); \ (_s).size = (_size); \
} \ } \
while (0) while (0)
#define qstream_free(_s) \ #define qstream_free(_s) \
do \ do \
{ \ { \
if ((_s)->data) \ if ((_s)->data) \
free((_s)->data); \ free((_s)->data); \
} \ } \
while (0) while (0)
#define qstream_set_pos(_s, _p) \ #define qstream_set_pos(_s, _p) \
do \ do \
{ \ { \
(_s)->pos = (_s)->data + (_p); \ (_s)->pos = (_s)->data + (_p); \
} \ } \
while (0) while (0)
#define qstream_inc_pos(_s, _v) \ #define qstream_inc_pos(_s, _v) \
do \ do \
{ \ { \
(_s)->pos += (_v); \ (_s)->pos += (_v); \
} \ } \
while (0) while (0)
#define qstream_rd_u8(_s, _v) \ #define qstream_rd_u8(_s, _v) \
do \ do \
{ \ { \
(_v) = *((unsigned char *) ((_s)->pos)); \ (_v) = *((unsigned char *) ((_s)->pos)); \
(_s)->pos++; \ (_s)->pos++; \
} \ } \
while (0) while (0)
#define qstream_rd_u16(_s, _v) \ #define qstream_rd_u16(_s, _v) \
do \ do \
{ \ { \
(_v) = (unsigned short) \ (_v) = (unsigned short) \
( \ ( \
(*((unsigned char *) ((_s)->pos + 0)) << 0) | \ (*((unsigned char *) ((_s)->pos + 0)) << 0) | \
(*((unsigned char *) ((_s)->pos + 1)) << 8) \ (*((unsigned char *) ((_s)->pos + 1)) << 8) \
); \ ); \
(_s)->pos += 2; \ (_s)->pos += 2; \
} while (0) } while (0)
#define qstream_rd_u32(_s, _v) \ #define qstream_rd_u32(_s, _v) \
do \ do \
{ \ { \
(_v) = (unsigned int) \ (_v) = (unsigned int) \
( \ ( \
(*((unsigned char *) ((_s)->pos + 0)) << 0) | \ (*((unsigned char *) ((_s)->pos + 0)) << 0) | \
(*((unsigned char *) ((_s)->pos + 1)) << 8) | \ (*((unsigned char *) ((_s)->pos + 1)) << 8) | \
(*((unsigned char *) ((_s)->pos + 2)) << 16) | \ (*((unsigned char *) ((_s)->pos + 2)) << 16) | \
(*((unsigned char *) ((_s)->pos + 3)) << 24) \ (*((unsigned char *) ((_s)->pos + 3)) << 24) \
); \ ); \
(_s)->pos += 4; \ (_s)->pos += 4; \
} while (0) } while (0)
#define qstream_wr_u8(_s, _v) \ #define qstream_wr_u8(_s, _v) \
do \ do \
{ \ { \
*((_s)->pos) = (unsigned char) (_v); \ *((_s)->pos) = (unsigned char) (_v); \
(_s)->pos++; \ (_s)->pos++; \
} while (0) } while (0)
#define qstream_wr_u16(_s, _v) \ #define qstream_wr_u16(_s, _v) \
do \ do \
{ \ { \
*((_s)->pos) = (unsigned char) ((_v) >> 0); \ *((_s)->pos) = (unsigned char) ((_v) >> 0); \
(_s)->pos++; \ (_s)->pos++; \
*((_s)->pos) = (unsigned char) ((_v) >> 8); \ *((_s)->pos) = (unsigned char) ((_v) >> 8); \
(_s)->pos++; \ (_s)->pos++; \
} while (0) } while (0)
#define qstream_wr_u32(_s, _v) \ #define qstream_wr_u32(_s, _v) \
do \ do \
{ \ { \
*((_s)->pos) = (unsigned char) ((_v) >> 0); \ *((_s)->pos) = (unsigned char) ((_v) >> 0); \
(_s)->pos++; \ (_s)->pos++; \
*((_s)->pos) = (unsigned char) ((_v) >> 8); \ *((_s)->pos) = (unsigned char) ((_v) >> 8); \
(_s)->pos++; \ (_s)->pos++; \
*((_s)->pos) = (unsigned char) ((_v) >> 16); \ *((_s)->pos) = (unsigned char) ((_v) >> 16); \
(_s)->pos++; \ (_s)->pos++; \
*((_s)->pos) = (unsigned char) ((_v) >> 24); \ *((_s)->pos) = (unsigned char) ((_v) >> 24); \
(_s)->pos++; \ (_s)->pos++; \
} while (0) } while (0)
/* list of commands we support; this list should match the one in */ /* list of commands we support; this list should match the one in */
/* NeutrinoRDP channels/tcutils/tcutils_main.h */ /* NeutrinoRDP channels/tcutils/tcutils_main.h */
@ -141,10 +141,10 @@ enum TCU_UMOUNT_ERROR
class Utils class Utils
{ {
public: public:
Utils(); Utils();
static int getMountList(void *wtsChannel, QList<QListWidgetItem *> *itemList); static int getMountList(void *wtsChannel, QList<QListWidgetItem *> *itemList);
static int unmountDevice(void *wtsChannel, QString device, QStatusBar *statusBar); static int unmountDevice(void *wtsChannel, QString device, QStatusBar *statusBar);
}; };
#endif // UTILS_H #endif // UTILS_H

View File

@ -199,8 +199,8 @@ START_TEST(test_strnjoin__when_always__then_doesnt_write_beyond_end_of_destinati
{ {
/* setup */ /* setup */
const char *src[] = { "a","b","c"}; const char *src[] = { "a", "b", "c"};
char result[5+1+1]; /* a-b-c + term null + guard value */ char result[5 + 1 + 1]; /* a-b-c + term null + guard value */
/* test */ /* test */

View File

@ -78,9 +78,9 @@ struct vnc
int (*mod_suppress_output)(struct vnc *v, int suppress, int (*mod_suppress_output)(struct vnc *v, int suppress,
int left, int top, int right, int bottom); int left, int top, int right, int bottom);
int (*mod_server_monitor_resize)(struct vnc *v, int (*mod_server_monitor_resize)(struct vnc *v,
int width, int height); int width, int height);
int (*mod_server_monitor_full_invalidate)(struct vnc *v, int (*mod_server_monitor_full_invalidate)(struct vnc *v,
int width, int height); int width, int height);
int (*mod_server_version_message)(struct vnc *v); int (*mod_server_version_message)(struct vnc *v);
tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod
functions above */ functions above */

View File

@ -19,21 +19,21 @@
class Decoder : public QObject class Decoder : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit Decoder(QObject *parent = 0); explicit Decoder(QObject *parent = 0);
int init(QString filename); int init(QString filename);
//int deinit(); //int deinit();
//int setWindow(QRectangle rect); //int setWindow(QRectangle rect);
private: private:
void *channel; void *channel;
QRect mainWindowGeometry; QRect mainWindowGeometry;
signals: signals:
public slots: public slots:
void onGeometryChanged(QRect *geometry); void onGeometryChanged(QRect *geometry);
}; };
#endif // DECODER_H #endif // DECODER_H

View File

@ -22,8 +22,8 @@
/* ffmpeg related stuff */ /* ffmpeg related stuff */
extern "C" extern "C"
{ {
#include <libavformat/avformat.h> #include <libavformat/avformat.h>
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
} }
#define VCR_PLAY 1 #define VCR_PLAY 1
@ -34,42 +34,42 @@ extern "C"
class DemuxMedia : public QObject class DemuxMedia : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DemuxMedia(QObject *parent = 0, QQueue<MediaPacket *> *videoQueue = 0, explicit DemuxMedia(QObject *parent = 0, QQueue<MediaPacket *> *videoQueue = 0,
void *channel = 0, int stream_id = 101); void *channel = 0, int stream_id = 101);
void setVcrOp(int op); void setVcrOp(int op);
int clear(); int clear();
public slots: public slots:
void startDemuxing(); void startDemuxing();
void onMediaSeek(int value); void onMediaSeek(int value);
private: private:
QMutex vcrMutex; QMutex vcrMutex;
int vcrFlag; int vcrFlag;
void *channel; void *channel;
int stream_id; int stream_id;
QMutex sendMutex; QMutex sendMutex;
QMutex posMutex; QMutex posMutex;
int64_t elapsedTime; /* elapsed time in usecs since play started */ int64_t elapsedTime; /* elapsed time in usecs since play started */
int64_t pausedTime; /* time at which stream was paused */ int64_t pausedTime; /* time at which stream was paused */
int64_t la_seekPos; /* locked access; must hold posMutex */ int64_t la_seekPos; /* locked access; must hold posMutex */
bool isStopped; bool isStopped;
QQueue<MediaPacket *> *videoQueue; QQueue<MediaPacket *> *videoQueue;
PlayVideo *playVideo; PlayVideo *playVideo;
QThread *playVideoThread; QThread *playVideoThread;
void updateMediaPos(); void updateMediaPos();
signals: signals:
void onMediaRestarted(); void onMediaRestarted();
signals: signals:
void onElapsedtime(int val); /* in hundredth of a sec */ void onElapsedtime(int val); /* in hundredth of a sec */
}; };

View File

@ -3,23 +3,24 @@
#include <QDialog> #include <QDialog>
namespace Ui { namespace Ui
class DlgAbout; {
class DlgAbout;
} }
class DlgAbout : public QDialog class DlgAbout : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DlgAbout(QWidget *parent = 0); explicit DlgAbout(QWidget *parent = 0);
~DlgAbout(); ~DlgAbout();
private: private:
Ui::DlgAbout *ui; Ui::DlgAbout *ui;
private slots: private slots:
void onOk(); void onOk();
}; };
#endif // DLGABOUT_H #endif // DLGABOUT_H

View File

@ -38,8 +38,8 @@
/* ffmpeg related stuff */ /* ffmpeg related stuff */
extern "C" extern "C"
{ {
#include <libavformat/avformat.h> #include <libavformat/avformat.h>
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
} }
#define VCR_PLAY 1 #define VCR_PLAY 1
@ -55,78 +55,78 @@ namespace Ui
class MainWindow : public QMainWindow class MainWindow : public QMainWindow
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit MainWindow(QWidget *parent = 0); explicit MainWindow(QWidget *parent = 0);
~MainWindow(); ~MainWindow();
signals: signals:
void onGeometryChanged(int x, int y, int width, int height); void onGeometryChanged(int x, int y, int width, int height);
public slots: public slots:
void onSliderValueChanged(int value); void onSliderValueChanged(int value);
private slots: private slots:
void on_actionOpen_Media_File_triggered(); void on_actionOpen_Media_File_triggered();
void on_actionExit_triggered(); void on_actionExit_triggered();
void onBtnPlayClicked(bool flag); void onBtnPlayClicked(bool flag);
void onBtnRewindClicked(bool flag); void onBtnRewindClicked(bool flag);
void onBtnStopClicked(bool flag); void onBtnStopClicked(bool flag);
void onMediaDurationInSeconds(int duration); void onMediaDurationInSeconds(int duration);
void onElapsedTime(int secs); void onElapsedTime(int secs);
void onSliderActionTriggered(int value); void onSliderActionTriggered(int value);
void onMoveCompleted(); void onMoveCompleted();
void on_actionAbout_triggered(); void on_actionAbout_triggered();
void onVolSliderValueChanged(int value); void onVolSliderValueChanged(int value);
protected: protected:
void resizeEvent(QResizeEvent *e); void resizeEvent(QResizeEvent *e);
void closeEvent(QCloseEvent *e); void closeEvent(QCloseEvent *e);
void moveEvent(QMoveEvent *e); void moveEvent(QMoveEvent *e);
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
/* for UI */ /* for UI */
QLabel *lblCurrentPos; QLabel *lblCurrentPos;
QLabel *lblDuration; QLabel *lblDuration;
QLabel *lblVideo; QLabel *lblVideo;
QHBoxLayout *hboxLayoutTop; QHBoxLayout *hboxLayoutTop;
QHBoxLayout *hboxLayoutMiddle; QHBoxLayout *hboxLayoutMiddle;
QHBoxLayout *hboxLayoutBottom; QHBoxLayout *hboxLayoutBottom;
QVBoxLayout *vboxLayout; QVBoxLayout *vboxLayout;
QPushButton *btnPlay; QPushButton *btnPlay;
QPushButton *btnStop; QPushButton *btnStop;
QPushButton *btnRewind; QPushButton *btnRewind;
QSlider *slider; QSlider *slider;
QSlider *volSlider; QSlider *volSlider;
QWidget *window; QWidget *window;
bool acceptSliderMove; bool acceptSliderMove;
QTimer *moveResizeTimer; QTimer *moveResizeTimer;
/* private stuff */ /* private stuff */
OurInterface *interface; OurInterface *interface;
//PlayVideo *playVideo; //PlayVideo *playVideo;
DemuxMedia *demuxMedia; DemuxMedia *demuxMedia;
QString filename; QString filename;
bool oneTimeInitSuccess; bool oneTimeInitSuccess;
bool remoteClientInited; bool remoteClientInited;
void *channel; void *channel;
int stream_id; int stream_id;
int64_t elapsedTime; /* elapsed time in usecs since play started */ int64_t elapsedTime; /* elapsed time in usecs since play started */
int vcrFlag; int vcrFlag;
bool gotMediaOnCmdline; bool gotMediaOnCmdline;
/* private methods */ /* private methods */
void setupUI(); void setupUI();
void openMediaFile(); void openMediaFile();
void getVdoGeometry(QRect *rect); void getVdoGeometry(QRect *rect);
void clearDisplay(); void clearDisplay();
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H

View File

@ -3,12 +3,12 @@
class MediaPacket class MediaPacket
{ {
public: public:
MediaPacket(); MediaPacket();
void *av_pkt; void *av_pkt;
int delay_in_us; int delay_in_us;
int seq; int seq;
}; };
#endif // MEDIAPACKET_H #endif // MEDIAPACKET_H

View File

@ -21,57 +21,57 @@
/* ffmpeg related stuff */ /* ffmpeg related stuff */
extern "C" extern "C"
{ {
#include <libavformat/avformat.h> #include <libavformat/avformat.h>
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
} }
class OurInterface : public QObject class OurInterface : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit OurInterface(QObject *parent = 0); explicit OurInterface(QObject *parent = 0);
/* public methods */ /* public methods */
int oneTimeInit(); int oneTimeInit();
void oneTimeDeinit(); void oneTimeDeinit();
int initRemoteClient(); int initRemoteClient();
void deInitRemoteClient(); void deInitRemoteClient();
int sendGeometry(QRect rect); int sendGeometry(QRect rect);
void setFilename(QString filename); void setFilename(QString filename);
void playMedia(); void playMedia();
//PlayVideo *getPlayVideoInstance(); //PlayVideo *getPlayVideoInstance();
DemuxMedia *getDemuxMediaInstance(); DemuxMedia *getDemuxMediaInstance();
void setVcrOp(int op); void setVcrOp(int op);
int setVolume(int volume); int setVolume(int volume);
public slots: public slots:
void onGeometryChanged(int x, int y, int width, int height); void onGeometryChanged(int x, int y, int width, int height);
signals: signals:
void on_ErrorMsg(QString title, QString msg); void on_ErrorMsg(QString title, QString msg);
void onMediaDurationInSeconds(int duration); void onMediaDurationInSeconds(int duration);
private: private:
/* private stuff */ /* private stuff */
QQueue<MediaPacket *> videoQueue; QQueue<MediaPacket *> videoQueue;
DemuxMedia *demuxMedia; DemuxMedia *demuxMedia;
QThread *demuxMediaThread; QThread *demuxMediaThread;
//PlayVideo *playVideo; //PlayVideo *playVideo;
QString filename; QString filename;
void *channel; void *channel;
int stream_id; int stream_id;
QRect savedGeometry; QRect savedGeometry;
/* private methods */ /* private methods */
int openVirtualChannel(); int openVirtualChannel();
int closeVirtualChannel(); int closeVirtualChannel();
int sendMetadataFile(); int sendMetadataFile();
int sendVideoFormat(); int sendVideoFormat();
int sendAudioFormat(); int sendAudioFormat();
}; };
#endif // INTERFACE_H #endif // INTERFACE_H

View File

@ -19,8 +19,8 @@
/* ffmpeg related stuff */ /* ffmpeg related stuff */
extern "C" extern "C"
{ {
#include <libavformat/avformat.h> #include <libavformat/avformat.h>
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
} }
#define VCR_PLAY 1 #define VCR_PLAY 1
@ -31,29 +31,29 @@ extern "C"
class PlayAudio : public QObject class PlayAudio : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit PlayAudio(QObject *parent = 0, explicit PlayAudio(QObject *parent = 0,
QQueue<MediaPacket *> *audioQueue = 0, QQueue<MediaPacket *> *audioQueue = 0,
QMutex *sendMutex = 0, QMutex *sendMutex = 0,
void *channel = 0, void *channel = 0,
int stream_id = 101); int stream_id = 101);
void setVcrOp(int op); void setVcrOp(int op);
public slots: public slots:
void play(); void play();
private: private:
QQueue<MediaPacket *> *audioQueue; QQueue<MediaPacket *> *audioQueue;
QMutex *sendMutex; QMutex *sendMutex;
QMutex vcrMutex; QMutex vcrMutex;
int vcrFlag; int vcrFlag;
void *channel; void *channel;
int stream_id; int stream_id;
void clearAudioQ(); void clearAudioQ();
}; };
#endif // PLAYAUDIO_H #endif // PLAYAUDIO_H

View File

@ -20,8 +20,8 @@
/* ffmpeg related stuff */ /* ffmpeg related stuff */
extern "C" extern "C"
{ {
#include <libavformat/avformat.h> #include <libavformat/avformat.h>
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
} }
#define VCR_PLAY 1 #define VCR_PLAY 1
@ -32,43 +32,43 @@ extern "C"
class PlayVideo : public QObject class PlayVideo : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit PlayVideo(QObject *parent = 0, explicit PlayVideo(QObject *parent = 0,
QQueue<MediaPacket *> *videoQueue = 0, QQueue<MediaPacket *> *videoQueue = 0,
QMutex *sendMutex = 0, QMutex *sendMutex = 0,
void *channel = 0, void *channel = 0,
int stream_id = 101, int stream_id = 101,
int fps = 24); int fps = 24);
//void onMediaSeek(int value); //void onMediaSeek(int value);
//void setVcrOp(int op); //void setVcrOp(int op);
//void onMediaRestarted(); //void onMediaRestarted();
public slots: public slots:
void play(); void play();
//signals: //signals:
// void onElapsedtime(int val); /* in hundredth of a sec */ // void onElapsedtime(int val); /* in hundredth of a sec */
private: private:
QQueue<MediaPacket *> *videoQueue; QQueue<MediaPacket *> *videoQueue;
// int vcrFlag; // int vcrFlag;
// QMutex vcrMutex; // QMutex vcrMutex;
QMutex *sendMutex; QMutex *sendMutex;
// QMutex posMutex; // QMutex posMutex;
// int64_t la_seekPos; /* locked access; must hold posMutex */ // int64_t la_seekPos; /* locked access; must hold posMutex */
void *channel; void *channel;
int stream_id; int stream_id;
int fps; int fps;
// int64_t elapsedTime; /* elapsed time in usecs since play started */ // int64_t elapsedTime; /* elapsed time in usecs since play started */
// int64_t pausedTime; /* time at which stream was paused */ // int64_t pausedTime; /* time at which stream was paused */
// bool isStopped; // bool isStopped;
// void updateMediaPos(); // void updateMediaPos();
// void clearVideoQ(); // void clearVideoQ();
}; };
#endif // PLAYVIDEO_H #endif // PLAYVIDEO_H

View File

@ -1076,7 +1076,7 @@ dynamic_monitor_data(intptr_t id, int chan_id, char *data, int bytes)
in_uint32_le(s, msg_type); in_uint32_le(s, msg_type);
in_uint32_le(s, msg_length); in_uint32_le(s, msg_length);
LOG(LOG_LEVEL_DEBUG, "dynamic_monitor_data: msg_type %d msg_length %d", LOG(LOG_LEVEL_DEBUG, "dynamic_monitor_data: msg_type %d msg_length %d",
msg_type, msg_length); msg_type, msg_length);
rect.left = 8192; rect.left = 8192;
rect.top = 8192; rect.top = 8192;
@ -1088,7 +1088,7 @@ dynamic_monitor_data(intptr_t id, int chan_id, char *data, int bytes)
in_uint32_le(s, MonitorLayoutSize); in_uint32_le(s, MonitorLayoutSize);
in_uint32_le(s, NumMonitor); in_uint32_le(s, NumMonitor);
LOG(LOG_LEVEL_DEBUG, " MonitorLayoutSize %d NumMonitor %d", LOG(LOG_LEVEL_DEBUG, " MonitorLayoutSize %d NumMonitor %d",
MonitorLayoutSize, NumMonitor); MonitorLayoutSize, NumMonitor);
for (monitor_index = 0; monitor_index < NumMonitor; monitor_index++) for (monitor_index = 0; monitor_index < NumMonitor; monitor_index++)
{ {
monitor_layout = monitor_layouts + monitor_index; monitor_layout = monitor_layouts + monitor_index;
@ -1103,13 +1103,13 @@ dynamic_monitor_data(intptr_t id, int chan_id, char *data, int bytes)
in_uint32_le(s, monitor_layout->desktop_scale_factor); in_uint32_le(s, monitor_layout->desktop_scale_factor);
in_uint32_le(s, monitor_layout->device_scale_factor); in_uint32_le(s, monitor_layout->device_scale_factor);
LOG_DEVEL(LOG_LEVEL_DEBUG, " Flags 0x%8.8x Left %d Top %d " LOG_DEVEL(LOG_LEVEL_DEBUG, " Flags 0x%8.8x Left %d Top %d "
"Width %d Height %d PhysicalWidth %d PhysicalHeight %d " "Width %d Height %d PhysicalWidth %d PhysicalHeight %d "
"Orientation %d DesktopScaleFactor %d DeviceScaleFactor %d", "Orientation %d DesktopScaleFactor %d DeviceScaleFactor %d",
monitor_layout->flags, monitor_layout->left, monitor_layout->top, monitor_layout->flags, monitor_layout->left, monitor_layout->top,
monitor_layout->width, monitor_layout->height, monitor_layout->width, monitor_layout->height,
monitor_layout->physical_width, monitor_layout->physical_height, monitor_layout->physical_width, monitor_layout->physical_height,
monitor_layout->orientation, monitor_layout->desktop_scale_factor, monitor_layout->orientation, monitor_layout->desktop_scale_factor,
monitor_layout->device_scale_factor); monitor_layout->device_scale_factor);
rect.left = MIN(monitor_layout->left, rect.left); rect.left = MIN(monitor_layout->left, rect.left);
rect.top = MIN(monitor_layout->top, rect.top); rect.top = MIN(monitor_layout->top, rect.top);
@ -1133,8 +1133,9 @@ dynamic_monitor_data(intptr_t id, int chan_id, char *data, int bytes)
/* redraw */ /* redraw */
xrdp_bitmap_invalidate(wm->screen, 0); xrdp_bitmap_invalidate(wm->screen, 0);
struct xrdp_mod* v = wm->mm->mod; struct xrdp_mod *v = wm->mm->mod;
if (v != 0) { if (v != 0)
{
v->mod_server_version_message(v); v->mod_server_version_message(v);
v->mod_server_monitor_resize(v, session_width, session_height); v->mod_server_monitor_resize(v, session_width, session_height);
v->mod_server_monitor_full_invalidate(v, session_width, session_height); v->mod_server_monitor_full_invalidate(v, session_width, session_height);

View File

@ -53,11 +53,11 @@ struct xrdp_mod
int (*mod_frame_ack)(struct xrdp_mod *v, int flags, int frame_id); int (*mod_frame_ack)(struct xrdp_mod *v, int flags, int frame_id);
int (*mod_suppress_output)(struct xrdp_mod *v, int suppress, int (*mod_suppress_output)(struct xrdp_mod *v, int suppress,
int left, int top, int right, int bottom); int left, int top, int right, int bottom);
int (*mod_server_monitor_resize)(struct xrdp_mod* v, int (*mod_server_monitor_resize)(struct xrdp_mod *v,
int width, int height); int width, int height);
int (*mod_server_monitor_full_invalidate)(struct xrdp_mod* v, int (*mod_server_monitor_full_invalidate)(struct xrdp_mod *v,
int width, int height); int width, int height);
int (*mod_server_version_message)(struct xrdp_mod* v); int (*mod_server_version_message)(struct xrdp_mod *v);
tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod
functions above */ functions above */
/* server functions */ /* server functions */

View File

@ -216,19 +216,19 @@ xrdpvr_play_media(void *channel, int stream_id, char *filename)
for (i = 0; i < g_psi.p_format_ctx->nb_streams; i++) for (i = 0; i < g_psi.p_format_ctx->nb_streams; i++)
{ {
if (g_psi.p_format_ctx->streams[i]->codec->codec_type == if (g_psi.p_format_ctx->streams[i]->codec->codec_type ==
CODEC_TYPE_VIDEO && CODEC_TYPE_VIDEO &&
g_psi.p_format_ctx->streams[i]->codec->codec_id == g_psi.p_format_ctx->streams[i]->codec->codec_id ==
CODEC_ID_H264 && CODEC_ID_H264 &&
g_video_index < 0) g_video_index < 0)
{ {
g_video_index = i; g_video_index = i;
} }
if (g_psi.p_format_ctx->streams[i]->codec->codec_type == if (g_psi.p_format_ctx->streams[i]->codec->codec_type ==
CODEC_TYPE_AUDIO && CODEC_TYPE_AUDIO &&
g_psi.p_format_ctx->streams[i]->codec->codec_id == g_psi.p_format_ctx->streams[i]->codec->codec_id ==
CODEC_ID_AAC && CODEC_ID_AAC &&
g_audio_index < 0) g_audio_index < 0)
{ {
g_audio_index = i; g_audio_index = i;
} }
@ -252,7 +252,7 @@ xrdpvr_play_media(void *channel, int stream_id, char *filename)
/* find decoder for audio stream */ /* find decoder for audio stream */
g_psi.p_audio_codec = g_psi.p_audio_codec =
avcodec_find_decoder(g_psi.p_audio_codec_ctx->codec_id); avcodec_find_decoder(g_psi.p_audio_codec_ctx->codec_id);
if (g_psi.p_audio_codec == NULL) if (g_psi.p_audio_codec == NULL)
{ {
@ -261,7 +261,7 @@ xrdpvr_play_media(void *channel, int stream_id, char *filename)
/* find decoder for video stream */ /* find decoder for video stream */
g_psi.p_video_codec = g_psi.p_video_codec =
avcodec_find_decoder(g_psi.p_video_codec_ctx->codec_id); avcodec_find_decoder(g_psi.p_video_codec_ctx->codec_id);
if (g_psi.p_video_codec == NULL) if (g_psi.p_video_codec == NULL)
{ {
@ -337,7 +337,9 @@ xrdpvr_get_frame(void **av_pkt_ret, int *is_video_frame, int *delay_in_us)
//printf("xrdpvr_get_frame:\n"); //printf("xrdpvr_get_frame:\n");
/* alloc an AVPacket */ /* alloc an AVPacket */
if ((av_pkt = (AVPacket *) malloc(sizeof(AVPacket))) == NULL) if ((av_pkt = (AVPacket *) malloc(sizeof(AVPacket))) == NULL)
{
return -1; return -1;
}
/* read one frame into AVPacket */ /* read one frame into AVPacket */
if (av_read_frame(g_psi.p_format_ctx, av_pkt) < 0) if (av_read_frame(g_psi.p_format_ctx, av_pkt) < 0)
@ -491,7 +493,7 @@ xrdpvr_play_frame(void *channel, int stream_id, int *videoTimeout,
bsfc = g_psi.bsfc; bsfc = g_psi.bsfc;
while (bsfc != 0) while (bsfc != 0)
{ {
new_pkt= av_pkt; new_pkt = av_pkt;
error = av_bitstream_filter_filter(bsfc, g_psi.p_video_codec_ctx, 0, error = av_bitstream_filter_filter(bsfc, g_psi.p_video_codec_ctx, 0,
&new_pkt.data, &new_pkt.size, &new_pkt.data, &new_pkt.size,
av_pkt.data, av_pkt.size, av_pkt.data, av_pkt.size,
@ -552,11 +554,11 @@ xrdpvr_seek_media(int64_t pos, int backward)
seek_target = av_rescale_q(pos * AV_TIME_BASE, seek_target = av_rescale_q(pos * AV_TIME_BASE,
AV_TIME_BASE_Q, AV_TIME_BASE_Q,
g_psi.p_format_ctx->streams[g_video_index]->time_base); g_psi.p_format_ctx->streams[g_video_index]->time_base);
if (av_seek_frame(g_psi.p_format_ctx, g_video_index, seek_target, if (av_seek_frame(g_psi.p_format_ctx, g_video_index, seek_target,
seek_flag) < 0) seek_flag) < 0)
{ {
printf("media seek error\n"); printf("media seek error\n");
return -1; return -1;
@ -801,7 +803,7 @@ xrdpvr_create_metadata_file(void *channel, char *filename)
int len; int len;
int fd; int fd;
if ((fd = open(filename , O_RDONLY)) < 0) if ((fd = open(filename, O_RDONLY)) < 0)
{ {
return -1; return -1;
} }

View File

@ -1305,8 +1305,8 @@ send_server_monitor_resize(struct mod *mod, struct stream *s, int width, int hei
out_uint32_le(s, len); out_uint32_le(s, len);
int rv = lib_send_copy(mod, s); int rv = lib_send_copy(mod, s);
LOG_DEVEL(LOG_LEVEL_DEBUG, "send_server_monitor_resize: sent resize message with following properties to xorgxrdp backend " LOG_DEVEL(LOG_LEVEL_DEBUG, "send_server_monitor_resize: sent resize message with following properties to xorgxrdp backend "
"width=%d, height=%d, bpp=%d, return value=%d", "width=%d, height=%d, bpp=%d, return value=%d",
width, height, bpp, rv); width, height, bpp, rv);
return rv; return rv;
} }
@ -1332,8 +1332,8 @@ send_server_monitor_full_invalidate(struct mod *mod, struct stream *s, int width
out_uint32_le(s, len); out_uint32_le(s, len);
int rv = lib_send_copy(mod, s); int rv = lib_send_copy(mod, s);
LOG_DEVEL(LOG_LEVEL_DEBUG, "send_server_monitor_full_invalidate: sent invalidate message with following properties to xorgxrdp backend " LOG_DEVEL(LOG_LEVEL_DEBUG, "send_server_monitor_full_invalidate: sent invalidate message with following properties to xorgxrdp backend "
"width=%d, height=%d, return value=%d", "width=%d, height=%d, return value=%d",
width, height, rv); width, height, rv);
return rv; return rv;
} }

View File

@ -51,11 +51,11 @@ struct mod
int (*mod_frame_ack)(struct mod *v, int flags, int frame_id); int (*mod_frame_ack)(struct mod *v, int flags, int frame_id);
int (*mod_suppress_output)(struct mod *v, int suppress, int (*mod_suppress_output)(struct mod *v, int suppress,
int left, int top, int right, int bottom); int left, int top, int right, int bottom);
int (*mod_server_monitor_resize)(struct mod* v, int (*mod_server_monitor_resize)(struct mod *v,
int width, int height); int width, int height);
int (*mod_server_monitor_full_invalidate)(struct mod* v, int (*mod_server_monitor_full_invalidate)(struct mod *v,
int width, int height); int width, int height);
int (*mod_server_version_message)(struct mod* v); int (*mod_server_version_message)(struct mod *v);
tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod
functions above */ functions above */
/* server functions */ /* server functions */