mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 22:25:04 -04:00
made server settings more generic and added i2p support
This commit is contained in:
parent
95d6b06eb5
commit
fed43450ae
7 changed files with 82 additions and 50 deletions
|
@ -40,17 +40,17 @@ class DNSResolver ;
|
|||
|
||||
|
||||
/* order of attempts ... */
|
||||
const uint32_t RS_NET_CONN_TCP_ALL = 0x001f;
|
||||
const uint32_t RS_NET_CONN_UDP_ALL = 0x00e0;
|
||||
const uint32_t RS_NET_CONN_TCP_ALL = 0x00ff;
|
||||
const uint32_t RS_NET_CONN_UDP_ALL = 0x0f00;
|
||||
|
||||
const uint32_t RS_NET_CONN_TCP_LOCAL = 0x0001;
|
||||
const uint32_t RS_NET_CONN_TCP_EXTERNAL = 0x0002;
|
||||
const uint32_t RS_NET_CONN_TCP_UNKNOW_TOPOLOGY = 0x0004;
|
||||
const uint32_t RS_NET_CONN_TCP_HIDDEN_TOR = 0x0008;
|
||||
const uint32_t RS_NET_CONN_TCP_HIDDEN_I2P = 0x0010;
|
||||
const uint32_t RS_NET_CONN_TCP_HIDDEN_TOR = 0x0008;
|
||||
const uint32_t RS_NET_CONN_TCP_HIDDEN_I2P = 0x0010;
|
||||
|
||||
const uint32_t RS_NET_CONN_UDP_DHT_SYNC = 0x0020;
|
||||
const uint32_t RS_NET_CONN_UDP_PEER_SYNC = 0x0040; /* coming soon */
|
||||
const uint32_t RS_NET_CONN_UDP_DHT_SYNC = 0x0100;
|
||||
const uint32_t RS_NET_CONN_UDP_PEER_SYNC = 0x0200; /* coming soon */
|
||||
|
||||
// These are set in pqipersongroup.
|
||||
const uint32_t RS_TCP_STD_TIMEOUT_PERIOD = 5; /* 5 seconds! */
|
||||
|
|
|
@ -194,6 +194,7 @@ virtual bool isHidden(const uint32_t type) = 0;
|
|||
virtual bool isHiddenPeer(const RsPeerId &ssl_id) = 0;
|
||||
virtual bool isHiddenPeer(const RsPeerId &ssl_id, const uint32_t type) = 0;
|
||||
virtual bool getProxyAddress(const RsPeerId &ssl_id, struct sockaddr_storage &proxy_addr, std::string &domain_addr, uint16_t &domain_port) = 0;
|
||||
virtual uint32_t hiddenDomainToHiddenType(const std::string &domain) = 0;
|
||||
|
||||
|
||||
virtual int getFriendCount(bool ssl, bool online) = 0;
|
||||
|
|
|
@ -238,6 +238,7 @@ class RsPeerDetails
|
|||
bool isHiddenNode;
|
||||
std::string hiddenNodeAddress;
|
||||
uint16_t hiddenNodePort;
|
||||
uint32_t hiddenType;
|
||||
|
||||
// Filled in for Standard Node.
|
||||
std::string localAddr;
|
||||
|
|
|
@ -313,6 +313,7 @@ bool p3Peers::getPeerDetails(const RsPeerId& id, RsPeerDetails &d)
|
|||
d.isHiddenNode = true;
|
||||
d.hiddenNodeAddress = ps.hiddenDomain;
|
||||
d.hiddenNodePort = ps.hiddenPort;
|
||||
d.hiddenType = ps.hiddenType;
|
||||
d.localAddr = sockaddr_storage_iptostring(ps.localaddr);
|
||||
d.localPort = sockaddr_storage_port(ps.localaddr);
|
||||
d.extAddr = "hidden";
|
||||
|
@ -324,6 +325,7 @@ bool p3Peers::getPeerDetails(const RsPeerId& id, RsPeerDetails &d)
|
|||
d.isHiddenNode = false;
|
||||
d.hiddenNodeAddress = "";
|
||||
d.hiddenNodePort = 0;
|
||||
d.hiddenType = RS_HIDDEN_TYPE_NONE;
|
||||
|
||||
d.localAddr = sockaddr_storage_iptostring(ps.localaddr);
|
||||
d.localPort = sockaddr_storage_port(ps.localaddr);
|
||||
|
@ -1113,6 +1115,7 @@ bool p3Peers::loadDetailsFromStringCert(const std::string &certstr, RsPeerDetai
|
|||
{
|
||||
pd.hiddenNodeAddress = domain;
|
||||
pd.hiddenNodePort = port;
|
||||
pd.hiddenType = mPeerMgr->hiddenDomainToHiddenType(domain);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1317,7 +1320,7 @@ RsPeerDetails::RsPeerDetails()
|
|||
hasSignedMe(false),accept_connection(false),
|
||||
state(0),localAddr(""),localPort(0),extAddr(""),extPort(0),netMode(0),vs_disc(0), vs_dht(0),
|
||||
lastConnect(0),connectState(0),connectStateString(""),connectPeriod(0),foundDHT(false),
|
||||
wasDeniedConnection(false), deniedTS(0)
|
||||
wasDeniedConnection(false), deniedTS(0), hiddenType(RS_HIDDEN_TYPE_NONE)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue