2008-05-18 16:44:30 +00:00
|
|
|
/*
|
2014-01-19 01:09:44 +00:00
|
|
|
* This file Copyright (C) 2008-2014 Mnemosyne LLC
|
2008-05-18 16:44:30 +00:00
|
|
|
*
|
2014-01-21 03:10:30 +00:00
|
|
|
* It may be used under the GNU GPL versions 2 or 3
|
2014-01-19 01:09:44 +00:00
|
|
|
* or any future license endorsed by Mnemosyne LLC.
|
2008-05-18 16:44:30 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2017-11-14 20:21:28 +00:00
|
|
|
#pragma once
|
|
|
|
|
2008-11-24 20:17:36 +00:00
|
|
|
#ifndef __TRANSMISSION__
|
2017-04-19 12:04:45 +00:00
|
|
|
#error only libtransmission should #include this header.
|
2008-11-24 20:17:36 +00:00
|
|
|
#endif
|
|
|
|
|
2021-10-06 14:26:07 +00:00
|
|
|
struct tr_rpc_server;
|
2021-11-09 03:30:03 +00:00
|
|
|
struct tr_variant;
|
2008-05-18 16:44:30 +00:00
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
tr_rpc_server* tr_rpcInit(tr_session* session, tr_variant* settings);
|
2008-05-18 16:44:30 +00:00
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
void tr_rpcClose(tr_rpc_server** freeme);
|
2008-05-18 16:44:30 +00:00
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
void tr_rpcSetEnabled(tr_rpc_server* server, bool isEnabled);
|
2008-05-18 16:44:30 +00:00
|
|
|
|
2017-04-20 16:02:19 +00:00
|
|
|
bool tr_rpcIsEnabled(tr_rpc_server const* server);
|
2008-05-18 16:44:30 +00:00
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
void tr_rpcSetPort(tr_rpc_server* server, tr_port port);
|
2008-05-18 16:44:30 +00:00
|
|
|
|
2017-04-20 16:02:19 +00:00
|
|
|
tr_port tr_rpcGetPort(tr_rpc_server const* server);
|
2008-05-18 16:44:30 +00:00
|
|
|
|
2017-04-20 16:02:19 +00:00
|
|
|
void tr_rpcSetUrl(tr_rpc_server* server, char const* url);
|
2010-12-12 18:22:11 +00:00
|
|
|
|
2017-04-20 16:02:19 +00:00
|
|
|
char const* tr_rpcGetUrl(tr_rpc_server const* server);
|
2010-12-12 18:22:11 +00:00
|
|
|
|
2017-04-20 16:02:19 +00:00
|
|
|
int tr_rpcSetTest(tr_rpc_server const* server, char const* whitelist, char** allocme_errmsg);
|
2008-06-04 17:14:58 +00:00
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
void tr_rpcSetWhitelistEnabled(tr_rpc_server* server, bool isEnabled);
|
2008-10-01 22:59:29 +00:00
|
|
|
|
2017-04-20 16:02:19 +00:00
|
|
|
bool tr_rpcGetWhitelistEnabled(tr_rpc_server const* server);
|
2008-10-01 22:59:29 +00:00
|
|
|
|
2017-04-20 16:02:19 +00:00
|
|
|
void tr_rpcSetWhitelist(tr_rpc_server* server, char const* whitelist);
|
2008-05-18 16:44:30 +00:00
|
|
|
|
2017-04-20 16:02:19 +00:00
|
|
|
char const* tr_rpcGetWhitelist(tr_rpc_server const* server);
|
2008-06-05 16:23:03 +00:00
|
|
|
|
2018-01-11 18:00:41 +00:00
|
|
|
void tr_rpcSetHostWhitelistEnabled(tr_rpc_server* server, bool isEnabled);
|
|
|
|
|
|
|
|
void tr_rpcSetHostWhitelist(tr_rpc_server* server, char const* whitelist);
|
|
|
|
|
2017-04-20 16:02:19 +00:00
|
|
|
void tr_rpcSetPassword(tr_rpc_server* server, char const* password);
|
2008-06-05 16:23:03 +00:00
|
|
|
|
2017-04-20 16:02:19 +00:00
|
|
|
char const* tr_rpcGetPassword(tr_rpc_server const* server);
|
2008-06-05 16:23:03 +00:00
|
|
|
|
2017-04-20 16:02:19 +00:00
|
|
|
void tr_rpcSetUsername(tr_rpc_server* server, char const* username);
|
2008-06-05 16:23:03 +00:00
|
|
|
|
2017-04-20 16:02:19 +00:00
|
|
|
char const* tr_rpcGetUsername(tr_rpc_server const* server);
|
2008-06-05 16:23:03 +00:00
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
void tr_rpcSetPasswordEnabled(tr_rpc_server* server, bool isEnabled);
|
2008-06-05 16:23:03 +00:00
|
|
|
|
2017-04-20 16:02:19 +00:00
|
|
|
bool tr_rpcIsPasswordEnabled(tr_rpc_server const* session);
|
2008-08-15 20:28:43 +00:00
|
|
|
|
2020-11-14 18:43:42 +00:00
|
|
|
bool tr_rpcGetAntiBruteForceEnabled(tr_rpc_server const* server);
|
|
|
|
|
|
|
|
void tr_rpcSetAntiBruteForceEnabled(tr_rpc_server* server, bool is_enabled);
|
|
|
|
|
|
|
|
int tr_rpcGetAntiBruteForceThreshold(tr_rpc_server const* server);
|
|
|
|
|
|
|
|
void tr_rpcSetAntiBruteForceThreshold(tr_rpc_server* server, int badRequests);
|
|
|
|
|
2017-04-20 16:02:19 +00:00
|
|
|
char const* tr_rpcGetBindAddress(tr_rpc_server const* server);
|