GUACAMOLE-422: Add protocol version as initial item passed back in args.

This commit is contained in:
Nick Couchman 2019-03-30 13:43:01 -04:00
parent 0ee47e0186
commit 2b68925ec9
6 changed files with 73 additions and 2 deletions

View File

@ -199,7 +199,7 @@ int __guac_handshake_size_handler(guac_user* user, int argc, char** argv) {
} }
int __guac_handshake_audio_handler(guac_user* user, int argc, char** argv) { int __guac_handshake_audio_handler(guac_user* user, int argc, char** argv) {
/* Store audio mimetypes */ /* Store audio mimetypes */
user->info.audio_mimetypes = (const char**) guac_copy_mimetypes(argv, argc); user->info.audio_mimetypes = (const char**) guac_copy_mimetypes(argv, argc);
@ -208,7 +208,7 @@ int __guac_handshake_audio_handler(guac_user* user, int argc, char** argv) {
} }
int __guac_handshake_video_handler(guac_user* user, int argc, char** argv) { int __guac_handshake_video_handler(guac_user* user, int argc, char** argv) {
/* Store video mimetypes */ /* Store video mimetypes */
user->info.video_mimetypes = (const char**) guac_copy_mimetypes(argv, argc); user->info.video_mimetypes = (const char**) guac_copy_mimetypes(argv, argc);
@ -227,6 +227,9 @@ int __guac_handshake_image_handler(guac_user* user, int argc, char** argv) {
int __guac_handshake_timezone_handler(guac_user* user, int argc, char** argv) { int __guac_handshake_timezone_handler(guac_user* user, int argc, char** argv) {
/* Free any past value */
free((char *) user->info.timezone);
/* Store timezone, if present */ /* Store timezone, if present */
if (argc > 0 && strcmp(argv[0], "")) if (argc > 0 && strcmp(argv[0], ""))
user->info.timezone = (const char*) strdup(argv[0]); user->info.timezone = (const char*) strdup(argv[0]);
@ -393,6 +396,9 @@ int guac_user_handle_connection(guac_user* user, int usec_timeout) {
if (strcmp(parser->opcode, "connect") == 0) if (strcmp(parser->opcode, "connect") == 0)
break; break;
guac_user_log(user, GUAC_LOG_DEBUG, "Processing instruction: %s",
parser->opcode);
/* Loop available opcodes and run handler if/when match found. */ /* Loop available opcodes and run handler if/when match found. */
__guac_handshake_mapping* current = __guac_handshake_map; __guac_handshake_mapping* current = __guac_handshake_map;
while (current->opcode != NULL) { while (current->opcode != NULL) {

View File

@ -25,6 +25,14 @@
/* Client plugin arguments */ /* Client plugin arguments */
const char* GUAC_KUBERNETES_CLIENT_ARGS[] = { const char* GUAC_KUBERNETES_CLIENT_ARGS[] = {
/**
* This first argument defines the protocol version in use so that the
* client knows how to handle talking to different versions of guacd.
* If this is omitted the client may choose not to enable certain
* features.
*/
"VERSION_1_1_0",
"hostname", "hostname",
"port", "port",
"namespace", "namespace",
@ -55,6 +63,11 @@ const char* GUAC_KUBERNETES_CLIENT_ARGS[] = {
enum KUBERNETES_ARGS_IDX { enum KUBERNETES_ARGS_IDX {
/**
* The protocol version provided to the client.
*/
IDX_PROTOCOL_VERSION,
/** /**
* The hostname to connect to. Required. * The hostname to connect to. Required.
*/ */

View File

@ -42,6 +42,14 @@
/* Client plugin arguments */ /* Client plugin arguments */
const char* GUAC_RDP_CLIENT_ARGS[] = { const char* GUAC_RDP_CLIENT_ARGS[] = {
/**
* This first argument defines the protocol version in use so that the
* client knows how to handle talking to different versions of guacd.
* If this is omitted the client may choose not to enable certain
* features.
*/
"VERSION_1_1_0",
"hostname", "hostname",
"port", "port",
"domain", "domain",
@ -124,6 +132,11 @@ const char* GUAC_RDP_CLIENT_ARGS[] = {
enum RDP_ARGS_IDX { enum RDP_ARGS_IDX {
/**
* The protocol version sent to the client.
*/
IDX_PROTOCOL_VERSION,
/** /**
* The hostname to connect to. * The hostname to connect to.
*/ */

View File

@ -30,6 +30,14 @@
/* Client plugin arguments */ /* Client plugin arguments */
const char* GUAC_SSH_CLIENT_ARGS[] = { const char* GUAC_SSH_CLIENT_ARGS[] = {
/**
* This first argument defines the protocol version in use so that the
* client knows how to handle talking to different versions of guacd.
* If this is omitted the client may choose not to enable certain
* features.
*/
"VERSION_1_1_0",
"hostname", "hostname",
"host-key", "host-key",
"port", "port",
@ -66,6 +74,11 @@ const char* GUAC_SSH_CLIENT_ARGS[] = {
}; };
enum SSH_ARGS_IDX { enum SSH_ARGS_IDX {
/**
* The protocol version
*/
IDX_PROTOCOL_VERSION,
/** /**
* The hostname to connect to. Required. * The hostname to connect to. Required.

View File

@ -31,6 +31,14 @@
/* Client plugin arguments */ /* Client plugin arguments */
const char* GUAC_TELNET_CLIENT_ARGS[] = { const char* GUAC_TELNET_CLIENT_ARGS[] = {
/**
* This first argument defines the protocol version in use so that the
* client knows how to handle talking to different versions of guacd.
* If this is omitted the client may choose not to enable certain
* features.
*/
"VERSION_1_1_0",
"hostname", "hostname",
"port", "port",
"username", "username",
@ -60,6 +68,11 @@ const char* GUAC_TELNET_CLIENT_ARGS[] = {
enum TELNET_ARGS_IDX { enum TELNET_ARGS_IDX {
/**
* The protocol version provided by the client.
*/
IDX_PROTOCOL_VERSION,
/** /**
* The hostname to connect to. Required. * The hostname to connect to. Required.
*/ */

View File

@ -31,6 +31,14 @@
/* Client plugin arguments */ /* Client plugin arguments */
const char* GUAC_VNC_CLIENT_ARGS[] = { const char* GUAC_VNC_CLIENT_ARGS[] = {
/**
* This first argument defines the protocol version in use so that the
* client knows how to handle talking to different versions of guacd.
* If this is omitted the client may choose not to enable certain
* features.
*/
"VERSION_1_1_0",
"hostname", "hostname",
"port", "port",
"read-only", "read-only",
@ -83,6 +91,11 @@ const char* GUAC_VNC_CLIENT_ARGS[] = {
enum VNC_ARGS_IDX { enum VNC_ARGS_IDX {
/**
* The protocol version provided to the client.
*/
IDX_PROTOCOL_VERSION,
/** /**
* The hostname of the VNC server (or repeater) to connect to. * The hostname of the VNC server (or repeater) to connect to.
*/ */