summaryrefslogtreecommitdiff
path: root/src/plugins/relay/relay-remote.h
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-03-31 09:49:10 +0200
committerSébastien Helleu <flashcode@flashtux.org>2024-04-07 13:18:13 +0200
commit90b855e1aa23886dbb4bd794e2527a26973dd5fb (patch)
tree2ffc437362634955d801bb0ca8442e611bbcb321 /src/plugins/relay/relay-remote.h
parentfd3219246432b35f165c5d1edfa78c76a743723e (diff)
downloadweechat-90b855e1aa23886dbb4bd794e2527a26973dd5fb.zip
relay: add connection to remote (issue #2066)
Connection to remote: - handshake: offer support for all supported hash algorithms - network connect with a socket - upgrade to websocket and authenticate with remote (password/TOTP) - check websocket response - get list of buffers (not used yet) Note: connection to remote with TLS or a proxy is not yet supported.
Diffstat (limited to 'src/plugins/relay/relay-remote.h')
-rw-r--r--src/plugins/relay/relay-remote.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/relay/relay-remote.h b/src/plugins/relay/relay-remote.h
index 2e6b938dc..b2f0b2cdb 100644
--- a/src/plugins/relay/relay-remote.h
+++ b/src/plugins/relay/relay-remote.h
@@ -22,6 +22,8 @@
#include <gnutls/gnutls.h>
+#define RELAY_REMOTE_DEFAULT_PORT 9000
+
enum t_relay_remote_option
{
RELAY_REMOTE_OPTION_URL = 0, /* remote URL */
@@ -42,8 +44,17 @@ struct t_relay_remote
int port; /* port number */
int tls; /* 1 if TLS is enabled */
enum t_relay_status status; /* status (connecting, active,..) */
+ int password_hash_algo; /* hash algo (from handshake) */
+ int password_hash_iterations; /* hash iterations (from handshake) */
+ int totp; /* TOTP enabled (from handshake) */
+ char *websocket_key; /* random key sent to the remote */
+ /* in the websocket handshake */
int sock; /* connected socket */
+ struct t_hook *hook_url_handshake; /* URL hook for the handshake */
+ struct t_hook *hook_connect; /* connection hook */
+ struct t_hook *hook_fd; /* hook for socket */
gnutls_session_t gnutls_sess; /* gnutls session (only if TLS used) */
+ struct t_relay_websocket_deflate *ws_deflate; /* websocket deflate data */
struct t_relay_remote *prev_remote;/* link to previous remote */
struct t_relay_remote *next_remote;/* link to next remote */
};
@@ -76,6 +87,7 @@ extern struct t_relay_remote *relay_remote_new (const char *name,
extern struct t_relay_remote *relay_remote_new_with_infolist (struct t_infolist *infolist);
extern void relay_remote_set_status (struct t_relay_remote *remote,
enum t_relay_status status);
+extern int relay_remote_connect (struct t_relay_remote *remote);
extern int relay_remote_rename (struct t_relay_remote *remote, const char *name);
extern void relay_remote_free (struct t_relay_remote *remote);
extern void relay_remote_free_all ();