2013-12-29 04:53:12 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 Glyptodon LLC
|
2011-11-23 08:01:27 +00:00
|
|
|
*
|
2013-12-29 04:53:12 +00:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
2011-11-23 08:01:27 +00:00
|
|
|
*
|
2013-12-29 04:53:12 +00:00
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
2011-11-23 08:01:27 +00:00
|
|
|
*
|
2013-12-29 04:53:12 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*/
|
2011-11-23 08:01:27 +00:00
|
|
|
|
|
|
|
|
2016-03-01 05:40:39 +00:00
|
|
|
#ifndef _GUACD_USER_H
|
|
|
|
#define _GUACD_USER_H
|
2011-11-23 08:01:27 +00:00
|
|
|
|
2014-01-01 22:44:28 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2016-03-01 05:40:39 +00:00
|
|
|
#include <guacamole/parser.h>
|
|
|
|
#include <guacamole/socket.h>
|
|
|
|
#include <guacamole/user.h>
|
2011-11-30 20:03:27 +00:00
|
|
|
|
2011-11-23 08:01:27 +00:00
|
|
|
/**
|
|
|
|
* The number of milliseconds to wait for messages in any phase before
|
|
|
|
* timing out and closing the connection with an error.
|
|
|
|
*/
|
2011-11-30 20:03:27 +00:00
|
|
|
#define GUACD_TIMEOUT 15000
|
2011-11-23 08:01:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The number of microseconds to wait for messages in any phase before
|
|
|
|
* timing out and closing the conncetion with an error. This is always
|
2011-11-30 20:03:27 +00:00
|
|
|
* equal to GUACD_TIMEOUT * 1000.
|
2011-11-23 08:01:27 +00:00
|
|
|
*/
|
2011-11-30 20:03:27 +00:00
|
|
|
#define GUACD_USEC_TIMEOUT (GUACD_TIMEOUT*1000)
|
2011-11-23 08:01:27 +00:00
|
|
|
|
2014-07-05 20:14:48 +00:00
|
|
|
/**
|
|
|
|
* The maximum number of concurrent connections to a single instance
|
|
|
|
* of guacd.
|
|
|
|
*/
|
|
|
|
#define GUACD_CLIENT_MAX_CONNECTIONS 65536
|
|
|
|
|
2016-03-01 05:40:39 +00:00
|
|
|
/**
|
|
|
|
* Parameters required by the user input thread.
|
|
|
|
*/
|
|
|
|
typedef struct guacd_user_input_thread_params {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The parser which will be used throughout the user's session.
|
|
|
|
*/
|
|
|
|
guac_parser* parser;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A reference to the connected user.
|
|
|
|
*/
|
|
|
|
guac_user* user;
|
|
|
|
|
|
|
|
} guacd_user_input_thread_params;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Starts the input/output threads of a new user. This function will block
|
|
|
|
* until the user disconnects.
|
|
|
|
*/
|
|
|
|
int guacd_user_start(guac_parser* parser, guac_user* user);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The thread which handles all user input, calling event handlers for received
|
|
|
|
* instructions.
|
|
|
|
*/
|
|
|
|
void* guacd_user_input_thread(void* data);
|
2011-11-23 08:01:27 +00:00
|
|
|
|
|
|
|
#endif
|
2014-07-05 20:14:48 +00:00
|
|
|
|