mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-15 01:25:56 -04:00
ID cleaning. Unfinished yet.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-IdCleaning@7098 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
effbf8f683
commit
18f5128319
19 changed files with 141 additions and 141 deletions
|
@ -277,7 +277,7 @@ bool p3Config::loadAttempt(const std::string& cfgFname,const std::string& signFn
|
||||||
uint32_t stream_flags = BIN_FLAGS_READABLE;
|
uint32_t stream_flags = BIN_FLAGS_READABLE;
|
||||||
|
|
||||||
BinEncryptedFileInterface *bio = new BinEncryptedFileInterface(cfgFname.c_str(), bioflags);
|
BinEncryptedFileInterface *bio = new BinEncryptedFileInterface(cfgFname.c_str(), bioflags);
|
||||||
pqiSSLstore stream(setupSerialiser(), "CONFIG", bio, stream_flags);
|
pqiSSLstore stream(setupSerialiser(), RsPeerId(), bio, stream_flags);
|
||||||
|
|
||||||
if(!stream.getEncryptedItems(load))
|
if(!stream.getEncryptedItems(load))
|
||||||
{
|
{
|
||||||
|
@ -343,7 +343,7 @@ bool p3Config::saveConfig()
|
||||||
stream_flags |= BIN_FLAGS_NO_DELETE;
|
stream_flags |= BIN_FLAGS_NO_DELETE;
|
||||||
|
|
||||||
BinEncryptedFileInterface *cfg_bio = new BinEncryptedFileInterface(newCfgFname.c_str(), bioflags);
|
BinEncryptedFileInterface *cfg_bio = new BinEncryptedFileInterface(newCfgFname.c_str(), bioflags);
|
||||||
pqiSSLstore *stream = new pqiSSLstore(setupSerialiser(), "CONFIG", cfg_bio, stream_flags);
|
pqiSSLstore *stream = new pqiSSLstore(setupSerialiser(), RsPeerId(), cfg_bio, stream_flags);
|
||||||
|
|
||||||
written = written && stream->encryptedSendItems(toSave);
|
written = written && stream->encryptedSendItems(toSave);
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ const int pqipersonzone = 82371;
|
||||||
* #define PERSON_DEBUG 1
|
* #define PERSON_DEBUG 1
|
||||||
****/
|
****/
|
||||||
|
|
||||||
pqiperson::pqiperson(std::string id, pqipersongrp *pg)
|
pqiperson::pqiperson(const RsPeerId& id, pqipersongrp *pg)
|
||||||
:PQInterface(id), mNotifyMtx("pqiperson-notify"), mPersonMtx("pqiperson"),
|
:PQInterface(id), mNotifyMtx("pqiperson-notify"), mPersonMtx("pqiperson"),
|
||||||
active(false), activepqi(NULL),
|
active(false), activepqi(NULL),
|
||||||
inConnectAttempt(false), waittimes(0),
|
inConnectAttempt(false), waittimes(0),
|
||||||
|
@ -122,7 +122,7 @@ int pqiperson::receiveHeartbeat()
|
||||||
{
|
{
|
||||||
RsStackMutex stack(mPersonMtx); /**** LOCK MUTEX ****/
|
RsStackMutex stack(mPersonMtx); /**** LOCK MUTEX ****/
|
||||||
|
|
||||||
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::receiveHeartbeat() from peer : " + PeerId());
|
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::receiveHeartbeat() from peer : " + PeerId().toStdString());
|
||||||
lastHeartbeatReceived = time(NULL);
|
lastHeartbeatReceived = time(NULL);
|
||||||
|
|
||||||
return true ;
|
return true ;
|
||||||
|
@ -140,7 +140,7 @@ int pqiperson::tick()
|
||||||
(time(NULL) - lastHeartbeatReceived) > HEARTBEAT_REPEAT_TIME * 5)
|
(time(NULL) - lastHeartbeatReceived) > HEARTBEAT_REPEAT_TIME * 5)
|
||||||
{
|
{
|
||||||
int ageLastIncoming = time(NULL) - activepqi->getLastIncomingTS();
|
int ageLastIncoming = time(NULL) - activepqi->getLastIncomingTS();
|
||||||
std::string out = "pqiperson::tick() WARNING No heartbeat from: " + PeerId();
|
std::string out = "pqiperson::tick() WARNING No heartbeat from: " + PeerId().toStdString();
|
||||||
//out << " assume dead. calling pqissl::reset(), LastHeartbeat was: ";
|
//out << " assume dead. calling pqissl::reset(), LastHeartbeat was: ";
|
||||||
rs_sprintf_append(out, " LastHeartbeat was: %ld secs ago", time(NULL) - lastHeartbeatReceived);
|
rs_sprintf_append(out, " LastHeartbeat was: %ld secs ago", time(NULL) - lastHeartbeatReceived);
|
||||||
rs_sprintf_append(out, " LastIncoming was: %d secs ago", ageLastIncoming);
|
rs_sprintf_append(out, " LastIncoming was: %d secs ago", ageLastIncoming);
|
||||||
|
@ -150,7 +150,7 @@ int pqiperson::tick()
|
||||||
|
|
||||||
if (ageLastIncoming > NO_PACKET_TIMEOUT)
|
if (ageLastIncoming > NO_PACKET_TIMEOUT)
|
||||||
{
|
{
|
||||||
out = "pqiperson::tick() " + PeerId();
|
out = "pqiperson::tick() " + PeerId().toStdString();
|
||||||
out += " No Heartbeat & No Packets -> assume dead. calling pqissl::reset()";
|
out += " No Heartbeat & No Packets -> assume dead. calling pqissl::reset()";
|
||||||
pqioutput(PQL_WARNING, pqipersonzone, out);
|
pqioutput(PQL_WARNING, pqipersonzone, out);
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ int pqiperson::tick()
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
std::string out = "pqiperson::tick() Id: " + PeerId() + " ";
|
std::string out = "pqiperson::tick() Id: " + PeerId().toStdString() + " ";
|
||||||
if (active)
|
if (active)
|
||||||
out += "***Active***";
|
out += "***Active***";
|
||||||
else
|
else
|
||||||
|
@ -255,7 +255,7 @@ int pqiperson::handleNotifyEvent_locked(NetInterface *ni, int newState, const s
|
||||||
{
|
{
|
||||||
|
|
||||||
{
|
{
|
||||||
std::string out = "pqiperson::notifyEvent() Id: " + PeerId() + "\n";
|
std::string out = "pqiperson::notifyEvent() Id: " + PeerId().toStdString() + "\n";
|
||||||
rs_sprintf_append(out, "Message: %d from: %p\n", newState, ni);
|
rs_sprintf_append(out, "Message: %d from: %p\n", newState, ni);
|
||||||
rs_sprintf_append(out, "Active pqi : %p", activepqi);
|
rs_sprintf_append(out, "Active pqi : %p", activepqi);
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ int pqiperson::handleNotifyEvent_locked(NetInterface *ni, int newState, const s
|
||||||
|
|
||||||
if ((active) && (activepqi != pqi)) // already connected - trouble
|
if ((active) && (activepqi != pqi)) // already connected - trouble
|
||||||
{
|
{
|
||||||
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::notifyEvent() Id: " + PeerId() + " CONNECT_SUCCESS+active-> activing new connection, shutting others");
|
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::notifyEvent() Id: " + PeerId().toStdString() + " CONNECT_SUCCESS+active-> activing new connection, shutting others");
|
||||||
|
|
||||||
// This is the RESET that's killing the connections.....
|
// This is the RESET that's killing the connections.....
|
||||||
//activepqi -> reset();
|
//activepqi -> reset();
|
||||||
|
@ -315,7 +315,7 @@ int pqiperson::handleNotifyEvent_locked(NetInterface *ni, int newState, const s
|
||||||
/* now install a new one. */
|
/* now install a new one. */
|
||||||
{
|
{
|
||||||
|
|
||||||
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::notifyEvent() Id: " + PeerId() + " CONNECT_SUCCESS->marking so! (resetting others)");
|
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::notifyEvent() Id: " + PeerId().toStdString() + " CONNECT_SUCCESS->marking so! (resetting others)");
|
||||||
|
|
||||||
// mark as active.
|
// mark as active.
|
||||||
active = true;
|
active = true;
|
||||||
|
@ -350,7 +350,7 @@ int pqiperson::handleNotifyEvent_locked(NetInterface *ni, int newState, const s
|
||||||
{
|
{
|
||||||
if (activepqi == pqi)
|
if (activepqi == pqi)
|
||||||
{
|
{
|
||||||
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::notifyEvent() Id: " + PeerId() + " CONNECT_FAILED->marking so!");
|
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::notifyEvent() Id: " + PeerId().toStdString() + " CONNECT_FAILED->marking so!");
|
||||||
|
|
||||||
activepqi->stop(); // STOP THREAD.
|
activepqi->stop(); // STOP THREAD.
|
||||||
active = false;
|
active = false;
|
||||||
|
@ -358,12 +358,12 @@ int pqiperson::handleNotifyEvent_locked(NetInterface *ni, int newState, const s
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::notifyEvent() Id: " + PeerId() + " CONNECT_FAILED-> from an unactive connection, don't flag the peer as not connected, just try next attempt !");
|
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::notifyEvent() Id: " + PeerId().toStdString() + " CONNECT_FAILED-> from an unactive connection, don't flag the peer as not connected, just try next attempt !");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::notifyEvent() Id: " + PeerId() + " CONNECT_FAILED+NOT active -> try connect again");
|
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::notifyEvent() Id: " + PeerId().toStdString() + " CONNECT_FAILED+NOT active -> try connect again");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* notify up */
|
/* notify up */
|
||||||
|
@ -392,7 +392,7 @@ int pqiperson::reset()
|
||||||
|
|
||||||
int pqiperson::reset_locked()
|
int pqiperson::reset_locked()
|
||||||
{
|
{
|
||||||
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::reset() resetting all pqiconnect for Id: " + PeerId());
|
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::reset() resetting all pqiconnect for Id: " + PeerId().toStdString());
|
||||||
|
|
||||||
std::map<uint32_t, pqiconnect *>::iterator it;
|
std::map<uint32_t, pqiconnect *>::iterator it;
|
||||||
for(it = kids.begin(); it != kids.end(); it++)
|
for(it = kids.begin(); it != kids.end(); it++)
|
||||||
|
@ -412,7 +412,7 @@ int pqiperson::fullstopthreads()
|
||||||
{
|
{
|
||||||
RsStackMutex stack(mPersonMtx); /**** LOCK MUTEX ****/
|
RsStackMutex stack(mPersonMtx); /**** LOCK MUTEX ****/
|
||||||
|
|
||||||
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::fullstopthreads() for Id: " + PeerId());
|
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::fullstopthreads() for Id: " + PeerId().toStdString());
|
||||||
|
|
||||||
std::map<uint32_t, pqiconnect *>::iterator it;
|
std::map<uint32_t, pqiconnect *>::iterator it;
|
||||||
for(it = kids.begin(); it != kids.end(); it++)
|
for(it = kids.begin(); it != kids.end(); it++)
|
||||||
|
@ -433,7 +433,7 @@ int pqiperson::addChildInterface(uint32_t type, pqiconnect *pqi)
|
||||||
|
|
||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
rs_sprintf(out, "pqiperson::addChildInterface() : Id %s %u", PeerId().c_str(), type);
|
rs_sprintf(out, "pqiperson::addChildInterface() : Id %s %u", PeerId().toStdString().c_str(), type);
|
||||||
pqioutput(PQL_DEBUG_BASIC, pqipersonzone, out);
|
pqioutput(PQL_DEBUG_BASIC, pqipersonzone, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,7 +449,7 @@ int pqiperson::listen()
|
||||||
{
|
{
|
||||||
RsStackMutex stack(mPersonMtx); /**** LOCK MUTEX ****/
|
RsStackMutex stack(mPersonMtx); /**** LOCK MUTEX ****/
|
||||||
|
|
||||||
pqioutput(PQL_DEBUG_BASIC, pqipersonzone, "pqiperson::listen() Id: " + PeerId());
|
pqioutput(PQL_DEBUG_BASIC, pqipersonzone, "pqiperson::listen() Id: " + PeerId().toStdString());
|
||||||
|
|
||||||
if (!active)
|
if (!active)
|
||||||
{
|
{
|
||||||
|
@ -468,7 +468,7 @@ int pqiperson::stoplistening()
|
||||||
{
|
{
|
||||||
RsStackMutex stack(mPersonMtx); /**** LOCK MUTEX ****/
|
RsStackMutex stack(mPersonMtx); /**** LOCK MUTEX ****/
|
||||||
|
|
||||||
pqioutput(PQL_DEBUG_BASIC, pqipersonzone, "pqiperson::stoplistening() Id: " + PeerId());
|
pqioutput(PQL_DEBUG_BASIC, pqipersonzone, "pqiperson::stoplistening() Id: " + PeerId().toStdString());
|
||||||
|
|
||||||
std::map<uint32_t, pqiconnect *>::iterator it;
|
std::map<uint32_t, pqiconnect *>::iterator it;
|
||||||
for(it = kids.begin(); it != kids.end(); it++)
|
for(it = kids.begin(); it != kids.end(); it++)
|
||||||
|
@ -489,7 +489,7 @@ int pqiperson::connect(uint32_t type, const struct sockaddr_storage &raddr,
|
||||||
#ifdef PERSON_DEBUG
|
#ifdef PERSON_DEBUG
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
std::string out = "pqiperson::connect() Id: " + PeerId();
|
std::string out = "pqiperson::connect() Id: " + PeerId().toStdString();
|
||||||
rs_sprintf_append(out, " type: %u", type);
|
rs_sprintf_append(out, " type: %u", type);
|
||||||
out += " addr: ";
|
out += " addr: ";
|
||||||
out += sockaddr_storage_tostring(raddr);
|
out += sockaddr_storage_tostring(raddr);
|
||||||
|
|
|
@ -126,7 +126,7 @@ class NotifyData
|
||||||
class pqiperson: public PQInterface
|
class pqiperson: public PQInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
pqiperson(std::string id, pqipersongrp *ppg);
|
pqiperson(const RsPeerId& id, pqipersongrp *ppg);
|
||||||
virtual ~pqiperson(); // must clean up children.
|
virtual ~pqiperson(); // must clean up children.
|
||||||
|
|
||||||
// control of the connection.
|
// control of the connection.
|
||||||
|
|
|
@ -36,7 +36,7 @@ const int pqipersongrpzone = 354;
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// hack for too many connections
|
// hack for too many connections
|
||||||
#include "retroshare/rsinit.h"
|
#include "retroshare/rsinit.h"
|
||||||
static std::list<std::string> waitingIds;
|
static std::list<RsPeerId> waitingIds;
|
||||||
#define MAX_CONNECT_COUNT 3
|
#define MAX_CONNECT_COUNT 3
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
#endif
|
#endif
|
||||||
|
@ -320,7 +320,7 @@ void pqipersongrp::statusChanged()
|
||||||
|
|
||||||
/* check for active connections and start waiting id's */
|
/* check for active connections and start waiting id's */
|
||||||
long connect_count = 0;
|
long connect_count = 0;
|
||||||
std::list<std::string> toConnect;
|
std::list<RsPeerId> toConnect;
|
||||||
|
|
||||||
{
|
{
|
||||||
RsStackMutex stack(coreMtx); /**************** LOCKED MUTEX ****************/
|
RsStackMutex stack(coreMtx); /**************** LOCKED MUTEX ****************/
|
||||||
|
@ -331,11 +331,11 @@ void pqipersongrp::statusChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check for active connections and start waiting id's */
|
/* check for active connections and start waiting id's */
|
||||||
std::list<std::string> peers;
|
std::list<RsPeerId> peers;
|
||||||
mLinkMgr->getFriendList(peers);
|
mLinkMgr->getFriendList(peers);
|
||||||
|
|
||||||
/* count connection attempts */
|
/* count connection attempts */
|
||||||
std::list<std::string>::iterator peer;
|
std::list<RsPeerId>::iterator peer;
|
||||||
for (peer = peers.begin(); peer != peers.end(); peer++) {
|
for (peer = peers.begin(); peer != peers.end(); peer++) {
|
||||||
peerConnectState state;
|
peerConnectState state;
|
||||||
if (mLinkMgr->getFriendNetStatus(*peer, state) == false) {
|
if (mLinkMgr->getFriendNetStatus(*peer, state) == false) {
|
||||||
|
@ -367,7 +367,7 @@ void pqipersongrp::statusChanged()
|
||||||
if (waitingIds.empty()) {
|
if (waitingIds.empty()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
std::string waitingId = waitingIds.front();
|
RsPeerId waitingId = waitingIds.front();
|
||||||
waitingIds.pop_front();
|
waitingIds.pop_front();
|
||||||
|
|
||||||
#ifdef PGRP_DEBUG
|
#ifdef PGRP_DEBUG
|
||||||
|
@ -379,7 +379,7 @@ void pqipersongrp::statusChanged()
|
||||||
}
|
}
|
||||||
} /* UNLOCKED */
|
} /* UNLOCKED */
|
||||||
|
|
||||||
std::list<std::string>::iterator cit;
|
std::list<RsPeerId>::iterator cit;
|
||||||
for(cit = toConnect.begin(); cit != toConnect.end(); cit++)
|
for(cit = toConnect.begin(); cit != toConnect.end(); cit++)
|
||||||
{
|
{
|
||||||
connectPeer(*cit, true);
|
connectPeer(*cit, true);
|
||||||
|
@ -388,11 +388,11 @@ void pqipersongrp::statusChanged()
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool pqipersongrp::getCryptoParams(const std::string& id,RsPeerCryptoParams& params)
|
bool pqipersongrp::getCryptoParams(const RsPeerId& id,RsPeerCryptoParams& params)
|
||||||
{
|
{
|
||||||
RsStackMutex stack(coreMtx); /******* LOCKED MUTEX **********/
|
RsStackMutex stack(coreMtx); /******* LOCKED MUTEX **********/
|
||||||
|
|
||||||
std::map<std::string, SearchModule *>::iterator it = mods.find(id) ;
|
std::map<RsPeerId, SearchModule *>::iterator it = mods.find(id) ;
|
||||||
|
|
||||||
if(it == mods.end())
|
if(it == mods.end())
|
||||||
return false ;
|
return false ;
|
||||||
|
@ -402,9 +402,9 @@ bool pqipersongrp::getCryptoParams(const std::string& id,RsPeerCryptoParams& par
|
||||||
//return locked_getCryptoParams(id,params) ;
|
//return locked_getCryptoParams(id,params) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pqipersongrp::addPeer(std::string id)
|
int pqipersongrp::addPeer(const RsPeerId& id)
|
||||||
{
|
{
|
||||||
pqioutput(PQL_DEBUG_BASIC, pqipersongrpzone, "pqipersongrp::addPeer() PeerId: " + id);
|
pqioutput(PQL_DEBUG_BASIC, pqipersongrpzone, "pqipersongrp::addPeer() PeerId: " + id.toStdString());
|
||||||
|
|
||||||
std::cerr << "pqipersongrp::addPeer() id: " << id;
|
std::cerr << "pqipersongrp::addPeer() id: " << id;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
@ -435,9 +435,9 @@ int pqipersongrp::addPeer(std::string id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int pqipersongrp::removePeer(std::string id)
|
int pqipersongrp::removePeer(const RsPeerId& id)
|
||||||
{
|
{
|
||||||
std::map<std::string, SearchModule *>::iterator it;
|
std::map<RsPeerId, SearchModule *>::iterator it;
|
||||||
|
|
||||||
#ifdef PGRP_DEBUG
|
#ifdef PGRP_DEBUG
|
||||||
#endif
|
#endif
|
||||||
|
@ -467,9 +467,9 @@ int pqipersongrp::removePeer(std::string id)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pqipersongrp::tagHeartbeatRecvd(std::string id)
|
int pqipersongrp::tagHeartbeatRecvd(const RsPeerId& id)
|
||||||
{
|
{
|
||||||
std::map<std::string, SearchModule *>::iterator it;
|
std::map<RsPeerId, SearchModule *>::iterator it;
|
||||||
|
|
||||||
#ifdef PGRP_DEBUG
|
#ifdef PGRP_DEBUG
|
||||||
std::cerr << " pqipersongrp::tagHeartbeatRecvd() id: " << id;
|
std::cerr << " pqipersongrp::tagHeartbeatRecvd() id: " << id;
|
||||||
|
@ -494,7 +494,7 @@ int pqipersongrp::tagHeartbeatRecvd(std::string id)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int pqipersongrp::connectPeer(std::string id
|
int pqipersongrp::connectPeer(const RsPeerId& id
|
||||||
#ifdef WINDOWS_SYS
|
#ifdef WINDOWS_SYS
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// hack for too many connections
|
// hack for too many connections
|
||||||
|
@ -515,7 +515,7 @@ int pqipersongrp::connectPeer(std::string id
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
std::map<std::string, SearchModule *>::iterator it;
|
std::map<RsPeerId, SearchModule *>::iterator it;
|
||||||
it = mods.find(id);
|
it = mods.find(id);
|
||||||
if (it == mods.end())
|
if (it == mods.end())
|
||||||
{
|
{
|
||||||
|
@ -662,7 +662,7 @@ int pqipersongrp::connectPeer(std::string id
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool pqipersongrp::notifyConnect(std::string id, uint32_t ptype, bool success, const struct sockaddr_storage &raddr)
|
bool pqipersongrp::notifyConnect(const RsPeerId& id, uint32_t ptype, bool success, const struct sockaddr_storage &raddr)
|
||||||
{
|
{
|
||||||
uint32_t type = 0;
|
uint32_t type = 0;
|
||||||
if (ptype == PQI_CONNECT_TCP)
|
if (ptype == PQI_CONNECT_TCP)
|
||||||
|
@ -691,9 +691,9 @@ pqilistener * pqipersongrpDummy::locked_createListener(const struct sockaddr_sto
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pqiperson * pqipersongrpDummy::locked_createPerson(std::string id, pqilistener * /*listener*/)
|
pqiperson * pqipersongrpDummy::locked_createPerson(const RsPeerId& id, pqilistener * /*listener*/)
|
||||||
{
|
{
|
||||||
pqioutput(PQL_DEBUG_BASIC, pqipersongrpzone, "pqipersongrpDummy::createPerson() PeerId: " + id);
|
pqioutput(PQL_DEBUG_BASIC, pqipersongrpzone, "pqipersongrpDummy::createPerson() PeerId: " + id.toStdString());
|
||||||
|
|
||||||
pqiperson *pqip = new pqiperson(id, this);
|
pqiperson *pqip = new pqiperson(id, this);
|
||||||
|
|
||||||
|
|
|
@ -69,9 +69,9 @@ virtual void statusChanged();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/******************* Peer Control **************************/
|
/******************* Peer Control **************************/
|
||||||
virtual int addPeer(std::string id); /* can be overloaded for testing */
|
virtual int addPeer(const RsPeerId& id); /* can be overloaded for testing */
|
||||||
int removePeer(std::string id);
|
int removePeer(const RsPeerId& id);
|
||||||
int connectPeer(std::string id
|
int connectPeer(const RsPeerId& id
|
||||||
#ifdef WINDOWS_SYS
|
#ifdef WINDOWS_SYS
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// hack for too many connections
|
// hack for too many connections
|
||||||
|
@ -85,25 +85,25 @@ virtual bool RecvRsRawItem(RsRawItem *item);
|
||||||
|
|
||||||
|
|
||||||
/* Work-around to dodgy pointer stuff */
|
/* Work-around to dodgy pointer stuff */
|
||||||
int tagHeartbeatRecvd(std::string id);
|
int tagHeartbeatRecvd(const RsPeerId& id);
|
||||||
|
|
||||||
/*** callback from children ****/
|
/*** callback from children ****/
|
||||||
bool notifyConnect(std::string id, uint32_t type, bool success, const struct sockaddr_storage &remote_peer_address);
|
bool notifyConnect(const RsPeerId& id, uint32_t type, bool success, const struct sockaddr_storage &remote_peer_address);
|
||||||
//bool notifyConnect(std::string id, uint32_t type, bool success);
|
//bool notifyConnect(std::string id, uint32_t type, bool success);
|
||||||
|
|
||||||
// tick interfaces.
|
// tick interfaces.
|
||||||
virtual int tick();
|
virtual int tick();
|
||||||
virtual int status();
|
virtual int status();
|
||||||
|
|
||||||
virtual bool getCryptoParams(const std::string&,RsPeerCryptoParams&) ;
|
virtual bool getCryptoParams(const RsPeerId&,RsPeerCryptoParams&) ;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual bool locked_getCryptoParams(const std::string&, RsPeerCryptoParams&) { return false ;}
|
virtual bool locked_getCryptoParams(const RsPeerId&, RsPeerCryptoParams&) { return false ;}
|
||||||
|
|
||||||
/********* FUNCTIONS to OVERLOAD for specialisation ********/
|
/********* FUNCTIONS to OVERLOAD for specialisation ********/
|
||||||
// THESE NEED TO BE LOCKED UNTIL PQILISTENER IS THREAD-SAFE.
|
// THESE NEED TO BE LOCKED UNTIL PQILISTENER IS THREAD-SAFE.
|
||||||
virtual pqilistener *locked_createListener(const struct sockaddr_storage &laddr) = 0;
|
virtual pqilistener *locked_createListener(const struct sockaddr_storage &laddr) = 0;
|
||||||
virtual pqiperson *locked_createPerson(std::string id, pqilistener *listener) = 0;
|
virtual pqiperson *locked_createPerson(const RsPeerId& id, pqilistener *listener) = 0;
|
||||||
/********* FUNCTIONS to OVERLOAD for specialisation ********/
|
/********* FUNCTIONS to OVERLOAD for specialisation ********/
|
||||||
|
|
||||||
/* Overloaded RsItem Check
|
/* Overloaded RsItem Check
|
||||||
|
@ -136,7 +136,7 @@ class pqipersongrpDummy: public pqipersongrp
|
||||||
|
|
||||||
/********* FUNCTIONS to OVERLOAD for specialisation ********/
|
/********* FUNCTIONS to OVERLOAD for specialisation ********/
|
||||||
virtual pqilistener *locked_createListener(const struct sockaddr_storage &laddr);
|
virtual pqilistener *locked_createListener(const struct sockaddr_storage &laddr);
|
||||||
virtual pqiperson *locked_createPerson(std::string id, pqilistener *listener);
|
virtual pqiperson *locked_createPerson(const RsPeerId& id, pqilistener *listener);
|
||||||
/********* FUNCTIONS to OVERLOAD for specialisation ********/
|
/********* FUNCTIONS to OVERLOAD for specialisation ********/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include "pqiqosstreamer.h"
|
#include "pqiqosstreamer.h"
|
||||||
|
|
||||||
pqiQoSstreamer::pqiQoSstreamer(PQInterface *parent, RsSerialiser *rss, std::string peerid, BinInterface *bio_in, int bio_flagsin)
|
pqiQoSstreamer::pqiQoSstreamer(PQInterface *parent, RsSerialiser *rss, const RsPeerId& peerid, BinInterface *bio_in, int bio_flagsin)
|
||||||
: pqithreadstreamer(parent,rss,peerid,bio_in,bio_flagsin), pqiQoS(PQI_QOS_STREAMER_MAX_LEVELS, PQI_QOS_STREAMER_ALPHA)
|
: pqithreadstreamer(parent,rss,peerid,bio_in,bio_flagsin), pqiQoS(PQI_QOS_STREAMER_MAX_LEVELS, PQI_QOS_STREAMER_ALPHA)
|
||||||
{
|
{
|
||||||
_total_item_size = 0 ;
|
_total_item_size = 0 ;
|
||||||
|
|
|
@ -218,7 +218,7 @@ int pqissl::reset_locked()
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
outLog += "pqissl::reset():" + PeerId();
|
outLog += "pqissl::reset():" + PeerId().toStdString();
|
||||||
rs_sprintf_append(outLog, " (A: %d", (int) active);
|
rs_sprintf_append(outLog, " (A: %d", (int) active);
|
||||||
rs_sprintf_append(outLog, " FD: %d", sockfd);
|
rs_sprintf_append(outLog, " FD: %d", sockfd);
|
||||||
rs_sprintf_append(outLog, " W: %d", waiting);
|
rs_sprintf_append(outLog, " W: %d", waiting);
|
||||||
|
@ -674,7 +674,7 @@ int pqissl::Initiate_Connection()
|
||||||
|
|
||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
rs_sprintf(out, "pqissl::Initiate_Connection() Connecting To: %s via: ", PeerId().c_str());
|
rs_sprintf(out, "pqissl::Initiate_Connection() Connecting To: %s via: ", PeerId().toStdString().c_str());
|
||||||
out += sockaddr_storage_tostring(addr);
|
out += sockaddr_storage_tostring(addr);
|
||||||
rslog(RSL_WARNING, pqisslzone, out);
|
rslog(RSL_WARNING, pqisslzone, out);
|
||||||
}
|
}
|
||||||
|
@ -757,7 +757,7 @@ int pqissl::Initiate_Connection()
|
||||||
}
|
}
|
||||||
else if ((errno == ENETUNREACH) || (errno == ETIMEDOUT))
|
else if ((errno == ENETUNREACH) || (errno == ETIMEDOUT))
|
||||||
{
|
{
|
||||||
out += "ENETUNREACHABLE: cert: " + PeerId();
|
out += "ENETUNREACHABLE: cert: " + PeerId().toStdString();
|
||||||
rslog(RSL_WARNING, pqisslzone, out);
|
rslog(RSL_WARNING, pqisslzone, out);
|
||||||
|
|
||||||
// Then send unreachable message.
|
// Then send unreachable message.
|
||||||
|
@ -828,7 +828,7 @@ bool pqissl::CheckConnectionTimeout()
|
||||||
if (time(NULL) > mTimeoutTS)
|
if (time(NULL) > mTimeoutTS)
|
||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
rs_sprintf(out, "pqissl::Basic_Connection_Complete() Connection Timed Out. Peer: %s Period: %lu", PeerId().c_str(), mConnectTimeout);
|
rs_sprintf(out, "pqissl::Basic_Connection_Complete() Connection Timed Out. Peer: %s Period: %lu", PeerId().toStdString().c_str(), mConnectTimeout);
|
||||||
|
|
||||||
rslog(RSL_WARNING, pqisslzone, out);
|
rslog(RSL_WARNING, pqisslzone, out);
|
||||||
/* as sockfd is valid, this should close it all up */
|
/* as sockfd is valid, this should close it all up */
|
||||||
|
@ -971,20 +971,20 @@ int pqissl::Basic_Connection_Complete()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
rs_sprintf(out, "pqissl::Basic_Connection_Complete() TCP Connection Complete: cert: %s on osock: ", PeerId().c_str(), sockfd);
|
rs_sprintf(out, "pqissl::Basic_Connection_Complete() TCP Connection Complete: cert: %s on osock: ", PeerId().toStdString().c_str(), sockfd);
|
||||||
rslog(RSL_WARNING, pqisslzone, out);
|
rslog(RSL_WARNING, pqisslzone, out);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (err == EINPROGRESS)
|
else if (err == EINPROGRESS)
|
||||||
{
|
{
|
||||||
rslog(RSL_WARNING, pqisslzone, "pqissl::Basic_Connection_Complete() EINPROGRESS: cert: " + PeerId());
|
rslog(RSL_WARNING, pqisslzone, "pqissl::Basic_Connection_Complete() EINPROGRESS: cert: " + PeerId().toStdString());
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if ((err == ENETUNREACH) || (err == ETIMEDOUT))
|
else if ((err == ENETUNREACH) || (err == ETIMEDOUT))
|
||||||
{
|
{
|
||||||
rslog(RSL_WARNING, pqisslzone, "pqissl::Basic_Connection_Complete() ENETUNREACH/ETIMEDOUT: cert: " + PeerId());
|
rslog(RSL_WARNING, pqisslzone, "pqissl::Basic_Connection_Complete() ENETUNREACH/ETIMEDOUT: cert: " + PeerId().toStdString());
|
||||||
|
|
||||||
// Then send unreachable message.
|
// Then send unreachable message.
|
||||||
net_internal_close(sockfd);
|
net_internal_close(sockfd);
|
||||||
|
@ -997,7 +997,7 @@ int pqissl::Basic_Connection_Complete()
|
||||||
}
|
}
|
||||||
else if ((err == EHOSTUNREACH) || (err == EHOSTDOWN))
|
else if ((err == EHOSTUNREACH) || (err == EHOSTDOWN))
|
||||||
{
|
{
|
||||||
rslog(RSL_WARNING, pqisslzone, "pqissl::Basic_Connection_Complete() EHOSTUNREACH/EHOSTDOWN: cert: " + PeerId());
|
rslog(RSL_WARNING, pqisslzone, "pqissl::Basic_Connection_Complete() EHOSTUNREACH/EHOSTDOWN: cert: " + PeerId().toStdString());
|
||||||
|
|
||||||
// Then send unreachable message.
|
// Then send unreachable message.
|
||||||
net_internal_close(sockfd);
|
net_internal_close(sockfd);
|
||||||
|
@ -1009,7 +1009,7 @@ int pqissl::Basic_Connection_Complete()
|
||||||
}
|
}
|
||||||
else if ((err == ECONNREFUSED))
|
else if ((err == ECONNREFUSED))
|
||||||
{
|
{
|
||||||
rslog(RSL_WARNING, pqisslzone, "pqissl::Basic_Connection_Complete() ECONNREFUSED: cert: " + PeerId());
|
rslog(RSL_WARNING, pqisslzone, "pqissl::Basic_Connection_Complete() ECONNREFUSED: cert: " + PeerId().toStdString());
|
||||||
|
|
||||||
// Then send unreachable message.
|
// Then send unreachable message.
|
||||||
net_internal_close(sockfd);
|
net_internal_close(sockfd);
|
||||||
|
@ -1175,7 +1175,7 @@ int pqissl::SSL_Connection_Complete()
|
||||||
}
|
}
|
||||||
// if we get here... success v quickly.
|
// if we get here... success v quickly.
|
||||||
|
|
||||||
rslog(RSL_WARNING, pqisslzone, "pqissl::SSL_Connection_Complete() Success!: Peer: " + PeerId());
|
rslog(RSL_WARNING, pqisslzone, "pqissl::SSL_Connection_Complete() Success!: Peer: " + PeerId().toStdString());
|
||||||
|
|
||||||
waiting = WAITING_SSL_AUTHORISE;
|
waiting = WAITING_SSL_AUTHORISE;
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1222,11 +1222,11 @@ int pqissl::Extract_Failed_SSL_Certificate()
|
||||||
std::string sslid ;
|
std::string sslid ;
|
||||||
getX509id(peercert, sslid) ;
|
getX509id(peercert, sslid) ;
|
||||||
|
|
||||||
std::string gpgid = getX509CNString(peercert->cert_info->issuer);
|
PGPIdType gpgid(getX509CNString(peercert->cert_info->issuer));
|
||||||
std::string sslcn = getX509CNString(peercert->cert_info->subject);
|
std::string sslcn = getX509CNString(peercert->cert_info->subject);
|
||||||
|
|
||||||
AuthSSL::getAuthSSL()->FailedCertificate(peercert, gpgid,sslid,sslcn,remote_addr, false);
|
AuthSSL::getAuthSSL()->FailedCertificate(peercert, gpgid,RsPeerId(sslid),sslcn,remote_addr, false);
|
||||||
mLinkMgr->notifyDeniedConnection(gpgid, sslid, sslcn, remote_addr, false);
|
mLinkMgr->notifyDeniedConnection(gpgid, RsPeerId(sslid), sslcn, remote_addr, false);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -1279,7 +1279,7 @@ int pqissl::Authorise_SSL_Connection()
|
||||||
|
|
||||||
std::string certPeerId;
|
std::string certPeerId;
|
||||||
getX509id(peercert, certPeerId);
|
getX509id(peercert, certPeerId);
|
||||||
if (certPeerId != PeerId()) {
|
if (RsPeerId(certPeerId) != PeerId()) {
|
||||||
rslog(RSL_WARNING, pqisslzone,
|
rslog(RSL_WARNING, pqisslzone,
|
||||||
"pqissl::Authorise_SSL_Connection() the cert Id doesn't match the Peer id we're trying to connect to.");
|
"pqissl::Authorise_SSL_Connection() the cert Id doesn't match the Peer id we're trying to connect to.");
|
||||||
|
|
||||||
|
@ -1307,13 +1307,13 @@ int pqissl::Authorise_SSL_Connection()
|
||||||
if (certCorrect)
|
if (certCorrect)
|
||||||
{
|
{
|
||||||
// then okay...
|
// then okay...
|
||||||
rslog(RSL_WARNING, pqisslzone, "pqissl::Authorise_SSL_Connection() Accepting Conn. Peer: " + PeerId());
|
rslog(RSL_WARNING, pqisslzone, "pqissl::Authorise_SSL_Connection() Accepting Conn. Peer: " + PeerId().toStdString());
|
||||||
|
|
||||||
accept_locked(ssl_connection, sockfd, remote_addr);
|
accept_locked(ssl_connection, sockfd, remote_addr);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
rslog(RSL_WARNING, pqisslzone, "pqissl::Authorise_SSL_Connection() Something Wrong ... Shutdown. Peer: " + PeerId());
|
rslog(RSL_WARNING, pqisslzone, "pqissl::Authorise_SSL_Connection() Something Wrong ... Shutdown. Peer: " + PeerId().toStdString());
|
||||||
|
|
||||||
// else shutdown ssl connection.
|
// else shutdown ssl connection.
|
||||||
rslog(RSL_ALERT, pqisslzone, "pqissl::Authorise_Connection_Complete() -> calling reset()");
|
rslog(RSL_ALERT, pqisslzone, "pqissl::Authorise_Connection_Complete() -> calling reset()");
|
||||||
|
@ -1338,7 +1338,7 @@ int pqissl::accept_locked(SSL *ssl, int fd, const struct sockaddr_storage &forei
|
||||||
{
|
{
|
||||||
if (waiting != WAITING_NOT)
|
if (waiting != WAITING_NOT)
|
||||||
{
|
{
|
||||||
rslog(RSL_WARNING, pqisslzone, "pqissl::accept() Peer: " + PeerId() + " - Two connections in progress - Shut 1 down!");
|
rslog(RSL_WARNING, pqisslzone, "pqissl::accept() Peer: " + PeerId().toStdString() + " - Two connections in progress - Shut 1 down!");
|
||||||
|
|
||||||
// outgoing connection in progress.
|
// outgoing connection in progress.
|
||||||
// shut this baby down.
|
// shut this baby down.
|
||||||
|
@ -1433,7 +1433,7 @@ int pqissl::accept_locked(SSL *ssl, int fd, const struct sockaddr_storage &forei
|
||||||
sameLAN = sockaddr_storage_samesubnet(remote_addr, localaddr);
|
sameLAN = sockaddr_storage_samesubnet(remote_addr, localaddr);
|
||||||
|
|
||||||
{
|
{
|
||||||
std::string out = "pqissl::accept() SUCCESSFUL connection to: " + PeerId();
|
std::string out = "pqissl::accept() SUCCESSFUL connection to: " + PeerId().toStdString();
|
||||||
out += " localaddr: " + sockaddr_storage_iptostring(localaddr);
|
out += " localaddr: " + sockaddr_storage_iptostring(localaddr);
|
||||||
out += " remoteaddr: " + sockaddr_storage_iptostring(remote_addr);
|
out += " remoteaddr: " + sockaddr_storage_iptostring(remote_addr);
|
||||||
|
|
||||||
|
@ -1520,7 +1520,7 @@ int pqissl::senddata(void *data, int len)
|
||||||
|
|
||||||
if (len != tmppktlen)
|
if (len != tmppktlen)
|
||||||
{
|
{
|
||||||
std::string out = "pqissl::senddata() " + PeerId();
|
std::string out = "pqissl::senddata() " + PeerId().toStdString();
|
||||||
rs_sprintf_append(out, " Partial Send: len: %d sent: %d ", len, tmppktlen);
|
rs_sprintf_append(out, " Partial Send: len: %d sent: %d ", len, tmppktlen);
|
||||||
|
|
||||||
int err = SSL_get_error(ssl_connection, tmppktlen);
|
int err = SSL_get_error(ssl_connection, tmppktlen);
|
||||||
|
@ -1649,7 +1649,7 @@ int pqissl::readdata(void *data, int len)
|
||||||
}
|
}
|
||||||
|
|
||||||
++n_read_zero;
|
++n_read_zero;
|
||||||
out += "pqissl::readdata() " + PeerId();
|
out += "pqissl::readdata() " + PeerId().toStdString();
|
||||||
rs_sprintf_append(out, " SSL_read() SSL_ERROR_ZERO_RETURN : nReadZero: %d", n_read_zero);
|
rs_sprintf_append(out, " SSL_read() SSL_ERROR_ZERO_RETURN : nReadZero: %d", n_read_zero);
|
||||||
|
|
||||||
if ((PQISSL_MAX_READ_ZERO_COUNT < n_read_zero)
|
if ((PQISSL_MAX_READ_ZERO_COUNT < n_read_zero)
|
||||||
|
@ -1670,7 +1670,7 @@ int pqissl::readdata(void *data, int len)
|
||||||
/* the only real error we expect */
|
/* the only real error we expect */
|
||||||
if (error == SSL_ERROR_SYSCALL)
|
if (error == SSL_ERROR_SYSCALL)
|
||||||
{
|
{
|
||||||
out += "pqissl::readdata() " + PeerId();
|
out += "pqissl::readdata() " + PeerId().toStdString();
|
||||||
out += " SSL_read() SSL_ERROR_SYSCALL";
|
out += " SSL_read() SSL_ERROR_SYSCALL";
|
||||||
out += " SOCKET_DEAD -> calling reset()";
|
out += " SOCKET_DEAD -> calling reset()";
|
||||||
rs_sprintf_append(out, " errno: %d", errno);
|
rs_sprintf_append(out, " errno: %d", errno);
|
||||||
|
|
|
@ -55,12 +55,12 @@ pqilistener * pqisslpersongrp::locked_createListener(const struct sockaddr_stora
|
||||||
return listener;
|
return listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
pqiperson * pqisslpersongrp::locked_createPerson(std::string id, pqilistener *listener)
|
pqiperson * pqisslpersongrp::locked_createPerson(const RsPeerId& id, pqilistener *listener)
|
||||||
{
|
{
|
||||||
std::cerr << "pqisslpersongrp::locked_createPerson() PeerId: " << id;
|
std::cerr << "pqisslpersongrp::locked_createPerson() PeerId: " << id;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
pqioutput(PQL_DEBUG_BASIC, pqipersongrpzone, "pqipersongrp::createPerson() PeerId: " + id);
|
pqioutput(PQL_DEBUG_BASIC, pqipersongrpzone, "pqipersongrp::createPerson() PeerId: " + id.toStdString());
|
||||||
|
|
||||||
pqiperson *pqip = new pqiperson(id, this);
|
pqiperson *pqip = new pqiperson(id, this);
|
||||||
|
|
||||||
|
|
|
@ -44,13 +44,13 @@ class pqisslpersongrp: public pqipersongrp
|
||||||
|
|
||||||
/********* FUNCTIONS to OVERLOAD for specialisation ********/
|
/********* FUNCTIONS to OVERLOAD for specialisation ********/
|
||||||
virtual pqilistener *locked_createListener(const struct sockaddr_storage &laddr);
|
virtual pqilistener *locked_createListener(const struct sockaddr_storage &laddr);
|
||||||
virtual pqiperson *locked_createPerson(std::string id, pqilistener *listener);
|
virtual pqiperson *locked_createPerson(const RsPeerId& id, pqilistener *listener);
|
||||||
/********* FUNCTIONS to OVERLOAD for specialisation ********/
|
/********* FUNCTIONS to OVERLOAD for specialisation ********/
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
p3PeerMgr *mPeerMgr;
|
p3PeerMgr *mPeerMgr;
|
||||||
std::map<std::string,pqissl*> ssl_tunnels ;
|
std::map<RsPeerId,pqissl*> ssl_tunnels ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -472,7 +472,7 @@ bool pqisslproxy::connect_parameter(uint32_t type, const std::string &value)
|
||||||
if (type == NET_PARAM_CONNECT_DOMAIN_ADDRESS)
|
if (type == NET_PARAM_CONNECT_DOMAIN_ADDRESS)
|
||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
rs_sprintf(out, "pqisslproxy::connect_parameter() Peer: %s DOMAIN_ADDRESS: %s", PeerId().c_str(), value.c_str());
|
rs_sprintf(out, "pqisslproxy::connect_parameter() Peer: %s DOMAIN_ADDRESS: %s", PeerId().toStdString().c_str(), value.c_str());
|
||||||
rslog(RSL_WARNING, pqisslproxyzone, out);
|
rslog(RSL_WARNING, pqisslproxyzone, out);
|
||||||
|
|
||||||
mDomainAddress = value;
|
mDomainAddress = value;
|
||||||
|
@ -492,7 +492,7 @@ bool pqisslproxy::connect_parameter(uint32_t type, uint32_t value)
|
||||||
if (type == NET_PARAM_CONNECT_REMOTE_PORT)
|
if (type == NET_PARAM_CONNECT_REMOTE_PORT)
|
||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
rs_sprintf(out, "pqisslproxy::connect_parameter() Peer: %s REMOTE_PORT: %lu", PeerId().c_str(), value);
|
rs_sprintf(out, "pqisslproxy::connect_parameter() Peer: %s REMOTE_PORT: %lu", PeerId().toStdString().c_str(), value);
|
||||||
rslog(RSL_WARNING, pqisslproxyzone, out);
|
rslog(RSL_WARNING, pqisslproxyzone, out);
|
||||||
|
|
||||||
mRemotePort = value;
|
mRemotePort = value;
|
||||||
|
|
|
@ -201,7 +201,7 @@ int pqissludp::Initiate_Connection()
|
||||||
"pqissludp::Initiate_Connection() Opening Socket");
|
"pqissludp::Initiate_Connection() Opening Socket");
|
||||||
|
|
||||||
{
|
{
|
||||||
std::string out = "pqissludp::Initiate_Connection() Connecting To: " + PeerId();
|
std::string out = "pqissludp::Initiate_Connection() Connecting To: " + PeerId().toStdString();
|
||||||
out += " via: ";
|
out += " via: ";
|
||||||
out += sockaddr_storage_tostring(remote_addr);
|
out += sockaddr_storage_tostring(remote_addr);
|
||||||
out += " ";
|
out += " ";
|
||||||
|
@ -318,7 +318,7 @@ int pqissludp::Initiate_Connection()
|
||||||
}
|
}
|
||||||
else if ((tou_err == ENETUNREACH) || (tou_err == ETIMEDOUT))
|
else if ((tou_err == ENETUNREACH) || (tou_err == ETIMEDOUT))
|
||||||
{
|
{
|
||||||
out += "ENETUNREACHABLE: cert: " + PeerId() + "\n";
|
out += "ENETUNREACHABLE: cert: " + PeerId().toStdString() + "\n";
|
||||||
|
|
||||||
// Then send unreachable message.
|
// Then send unreachable message.
|
||||||
waiting = WAITING_FAIL_INTERFACE;
|
waiting = WAITING_FAIL_INTERFACE;
|
||||||
|
@ -372,11 +372,11 @@ int pqissludp::Basic_Connection_Complete()
|
||||||
{
|
{
|
||||||
if (err == EINPROGRESS)
|
if (err == EINPROGRESS)
|
||||||
{
|
{
|
||||||
rslog(RSL_DEBUG_BASIC, pqissludpzone, "pqissludp::Basic_Connection_Complete() EINPROGRESS: cert: " + PeerId());
|
rslog(RSL_DEBUG_BASIC, pqissludpzone, "pqissludp::Basic_Connection_Complete() EINPROGRESS: cert: " + PeerId().toStdString());
|
||||||
}
|
}
|
||||||
else if ((err == ENETUNREACH) || (err == ETIMEDOUT))
|
else if ((err == ENETUNREACH) || (err == ETIMEDOUT))
|
||||||
{
|
{
|
||||||
rslog(RSL_WARNING, pqissludpzone, "pqissludp::Basic_Connection_Complete() ENETUNREACH/ETIMEDOUT: cert: " + PeerId());
|
rslog(RSL_WARNING, pqissludpzone, "pqissludp::Basic_Connection_Complete() ENETUNREACH/ETIMEDOUT: cert: " + PeerId().toStdString());
|
||||||
|
|
||||||
/* is the second one needed? */
|
/* is the second one needed? */
|
||||||
std::string out = "pqissludp::Basic_Connection_Complete() ";
|
std::string out = "pqissludp::Basic_Connection_Complete() ";
|
||||||
|
@ -396,7 +396,7 @@ int pqissludp::Basic_Connection_Complete()
|
||||||
if (tou_connected(sockfd))
|
if (tou_connected(sockfd))
|
||||||
/* <===================== UDP Difference *******************/
|
/* <===================== UDP Difference *******************/
|
||||||
{
|
{
|
||||||
rslog(RSL_WARNING, pqissludpzone, "pqissludp::Basic_Connection_Complete() Connection Complete: cert: " + PeerId());
|
rslog(RSL_WARNING, pqissludpzone, "pqissludp::Basic_Connection_Complete() Connection Complete: cert: " + PeerId().toStdString());
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -481,7 +481,7 @@ bool pqissludp::connect_parameter(uint32_t type, uint32_t value)
|
||||||
if (type == NET_PARAM_CONNECT_PERIOD)
|
if (type == NET_PARAM_CONNECT_PERIOD)
|
||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
rs_sprintf(out, "pqissludp::connect_parameter() Peer: %s PERIOD: %lu", PeerId().c_str(), value);
|
rs_sprintf(out, "pqissludp::connect_parameter() Peer: %s PERIOD: %lu", PeerId().toStdString().c_str(), value);
|
||||||
rslog(RSL_WARNING, pqissludpzone, out);
|
rslog(RSL_WARNING, pqissludpzone, out);
|
||||||
|
|
||||||
mConnectPeriod = value;
|
mConnectPeriod = value;
|
||||||
|
@ -491,7 +491,7 @@ bool pqissludp::connect_parameter(uint32_t type, uint32_t value)
|
||||||
else if (type == NET_PARAM_CONNECT_FLAGS)
|
else if (type == NET_PARAM_CONNECT_FLAGS)
|
||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
rs_sprintf(out, "pqissludp::connect_parameter() Peer: %s FLAGS: %lu", PeerId().c_str(), value);
|
rs_sprintf(out, "pqissludp::connect_parameter() Peer: %s FLAGS: %lu", PeerId().toStdString().c_str(), value);
|
||||||
rslog(RSL_WARNING, pqissludpzone, out);
|
rslog(RSL_WARNING, pqissludpzone, out);
|
||||||
|
|
||||||
mConnectFlags = value;
|
mConnectFlags = value;
|
||||||
|
@ -501,7 +501,7 @@ bool pqissludp::connect_parameter(uint32_t type, uint32_t value)
|
||||||
else if (type == NET_PARAM_CONNECT_BANDWIDTH)
|
else if (type == NET_PARAM_CONNECT_BANDWIDTH)
|
||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
rs_sprintf(out, "pqissludp::connect_parameter() Peer: %s BANDWIDTH: %lu", PeerId().c_str(), value);
|
rs_sprintf(out, "pqissludp::connect_parameter() Peer: %s BANDWIDTH: %lu", PeerId().toStdString().c_str(), value);
|
||||||
rslog(RSL_WARNING, pqissludpzone, out);
|
rslog(RSL_WARNING, pqissludpzone, out);
|
||||||
|
|
||||||
mConnectBandwidth = value;
|
mConnectBandwidth = value;
|
||||||
|
@ -521,7 +521,7 @@ bool pqissludp::connect_additional_address(uint32_t type, const struct sockaddr_
|
||||||
if (type == NET_PARAM_CONNECT_PROXY)
|
if (type == NET_PARAM_CONNECT_PROXY)
|
||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
rs_sprintf(out, "pqissludp::connect_additional_address() Peer: %s PROXYADDR: ", PeerId().c_str());
|
rs_sprintf(out, "pqissludp::connect_additional_address() Peer: %s PROXYADDR: ", PeerId().toStdString().c_str());
|
||||||
out += sockaddr_storage_tostring(addr);
|
out += sockaddr_storage_tostring(addr);
|
||||||
rslog(RSL_WARNING, pqissludpzone, out);
|
rslog(RSL_WARNING, pqissludpzone, out);
|
||||||
|
|
||||||
|
@ -533,7 +533,7 @@ bool pqissludp::connect_additional_address(uint32_t type, const struct sockaddr_
|
||||||
else if (type == NET_PARAM_CONNECT_SOURCE)
|
else if (type == NET_PARAM_CONNECT_SOURCE)
|
||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
rs_sprintf(out, "pqissludp::connect_additional_address() Peer: %s SRCADDR: ", PeerId().c_str());
|
rs_sprintf(out, "pqissludp::connect_additional_address() Peer: %s SRCADDR: ", PeerId().toStdString().c_str());
|
||||||
out += sockaddr_storage_tostring(addr);
|
out += sockaddr_storage_tostring(addr);
|
||||||
rslog(RSL_WARNING, pqissludpzone, out);
|
rslog(RSL_WARNING, pqissludpzone, out);
|
||||||
|
|
||||||
|
@ -590,22 +590,22 @@ bool pqissludp::moretoread(uint32_t usec)
|
||||||
{
|
{
|
||||||
if ((err == EAGAIN) || (err == EINPROGRESS))
|
if ((err == EAGAIN) || (err == EINPROGRESS))
|
||||||
{
|
{
|
||||||
rslog(RSL_DEBUG_BASIC, pqissludpzone, "pqissludp::moretoread() EAGAIN/EINPROGRESS: cert " + PeerId());
|
rslog(RSL_DEBUG_BASIC, pqissludpzone, "pqissludp::moretoread() EAGAIN/EINPROGRESS: cert " + PeerId().toStdString());
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ((err == ENETUNREACH) || (err == ETIMEDOUT))
|
else if ((err == ENETUNREACH) || (err == ETIMEDOUT))
|
||||||
{
|
{
|
||||||
rslog(RSL_WARNING, pqissludpzone, "pqissludp::moretoread() ENETUNREACH/ETIMEDOUT: cert " + PeerId());
|
rslog(RSL_WARNING, pqissludpzone, "pqissludp::moretoread() ENETUNREACH/ETIMEDOUT: cert " + PeerId().toStdString());
|
||||||
}
|
}
|
||||||
else if (err == EBADF)
|
else if (err == EBADF)
|
||||||
{
|
{
|
||||||
rslog(RSL_WARNING, pqissludpzone, "pqissludp::moretoread() EBADF: cert " + PeerId());
|
rslog(RSL_WARNING, pqissludpzone, "pqissludp::moretoread() EBADF: cert " + PeerId().toStdString());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::string out = "pqissludp::moretoread() ";
|
std::string out = "pqissludp::moretoread() ";
|
||||||
rs_sprintf_append(out, " Unknown ERROR: %d: cert ", err, PeerId().c_str());
|
rs_sprintf_append(out, " Unknown ERROR: %d: cert ", err, PeerId().toStdString().c_str());
|
||||||
rslog(RSL_WARNING, pqissludpzone, out);
|
rslog(RSL_WARNING, pqissludpzone, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,8 @@
|
||||||
|
|
||||||
const int pqistorezone = 9511;
|
const int pqistorezone = 9511;
|
||||||
|
|
||||||
pqistore::pqistore(RsSerialiser *rss, const std::string &srcId, BinInterface *bio_in, int bio_flags_in)
|
pqistore::pqistore(RsSerialiser *rss, const RsPeerId& srcId, BinInterface *bio_in, int bio_flags_in)
|
||||||
:PQInterface(""), rsSerialiser(rss), bio_flags(bio_flags_in),
|
:PQInterface(RsPeerId()), rsSerialiser(rss), bio_flags(bio_flags_in),
|
||||||
nextPkt(NULL), mSrcId(srcId), bio(bio_in)
|
nextPkt(NULL), mSrcId(srcId), bio(bio_in)
|
||||||
{
|
{
|
||||||
pqioutput(PQL_DEBUG_ALL, pqistorezone, "pqistore::pqistore() Initialisation!");
|
pqioutput(PQL_DEBUG_ALL, pqistorezone, "pqistore::pqistore() Initialisation!");
|
||||||
|
@ -368,7 +368,7 @@ std::string pqistore::gethash()
|
||||||
return bio->gethash();
|
return bio->gethash();
|
||||||
}
|
}
|
||||||
|
|
||||||
pqiSSLstore::pqiSSLstore(RsSerialiser *rss, std::string srcId, BinEncryptedFileInterface* bio_in, int bio_flagsin)
|
pqiSSLstore::pqiSSLstore(RsSerialiser *rss, const RsPeerId& srcId, BinEncryptedFileInterface* bio_in, int bio_flagsin)
|
||||||
: pqistore(rss, srcId, bio_in, bio_flagsin), enc_bio(bio_in)
|
: pqistore(rss, srcId, bio_in, bio_flagsin), enc_bio(bio_in)
|
||||||
{
|
{
|
||||||
bStopReading=false;
|
bStopReading=false;
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
class pqistore: public PQInterface
|
class pqistore: public PQInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
pqistore(RsSerialiser *rss, const std::string &srcId, BinInterface *bio_in, int bio_flagsin);
|
pqistore(RsSerialiser *rss, const RsPeerId&srcId, BinInterface *bio_in, int bio_flagsin);
|
||||||
virtual ~pqistore();
|
virtual ~pqistore();
|
||||||
|
|
||||||
// PQInterface
|
// PQInterface
|
||||||
|
@ -63,7 +63,7 @@ unsigned int bio_flags; // only BIN_NO_CLOSE at the moment.
|
||||||
|
|
||||||
// Temp Storage for transient data.....
|
// Temp Storage for transient data.....
|
||||||
RsItem *nextPkt;
|
RsItem *nextPkt;
|
||||||
std::string mSrcId;
|
RsPeerId mSrcId;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ class pqiSSLstore: public pqistore
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
pqiSSLstore(RsSerialiser *rss, std::string srcId, BinEncryptedFileInterface *bio_in, int bio_flagsin);
|
pqiSSLstore(RsSerialiser *rss, const RsPeerId& srcId, BinEncryptedFileInterface *bio_in, int bio_flagsin);
|
||||||
|
|
||||||
virtual ~pqiSSLstore();
|
virtual ~pqiSSLstore();
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#define DEFAULT_STREAMER_SLEEP 1000 // 1 ms.
|
#define DEFAULT_STREAMER_SLEEP 1000 // 1 ms.
|
||||||
#define DEFAULT_STREAMER_IDLE_SLEEP 1000000 // 1 sec
|
#define DEFAULT_STREAMER_IDLE_SLEEP 1000000 // 1 sec
|
||||||
|
|
||||||
pqithreadstreamer::pqithreadstreamer(PQInterface *parent, RsSerialiser *rss, std::string id, BinInterface *bio_in, int bio_flags_in)
|
pqithreadstreamer::pqithreadstreamer(PQInterface *parent, RsSerialiser *rss, const RsPeerId& id, BinInterface *bio_in, int bio_flags_in)
|
||||||
:pqistreamer(rss, id, bio_in, bio_flags_in), mParent(parent), mThreadMutex("pqithreadstreamer"), mTimeout(0)
|
:pqistreamer(rss, id, bio_in, bio_flags_in), mParent(parent), mThreadMutex("pqithreadstreamer"), mTimeout(0)
|
||||||
{
|
{
|
||||||
mTimeout = DEFAULT_STREAMER_TIMEOUT;
|
mTimeout = DEFAULT_STREAMER_TIMEOUT;
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
class pqithreadstreamer: public pqistreamer, public RsThread
|
class pqithreadstreamer: public pqistreamer, public RsThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
pqithreadstreamer(PQInterface *parent, RsSerialiser *rss, std::string peerid, BinInterface *bio_in, int bio_flagsin);
|
pqithreadstreamer(PQInterface *parent, RsSerialiser *rss, const RsPeerId& peerid, BinInterface *bio_in, int bio_flagsin);
|
||||||
|
|
||||||
virtual void run();
|
virtual void run();
|
||||||
virtual void start();
|
virtual void start();
|
||||||
|
|
|
@ -291,7 +291,7 @@ class RsPeers
|
||||||
virtual bool OthersChanged() = 0;
|
virtual bool OthersChanged() = 0;
|
||||||
|
|
||||||
/* Peer Details (Net & Auth) */
|
/* Peer Details (Net & Auth) */
|
||||||
virtual SSLIdType getOwnId() = 0;
|
virtual const RsPeerId& getOwnId() = 0;
|
||||||
|
|
||||||
virtual bool haveSecretKey(const PGPIdType& gpg_id) = 0 ;
|
virtual bool haveSecretKey(const PGPIdType& gpg_id) = 0 ;
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,7 @@ class RsServer: public RsControl, public RsThread
|
||||||
/****************************************/
|
/****************************************/
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool getPeerCryptoDetails(const std::string& ssl_id,RsPeerCryptoParams& params) { return pqih->getCryptoParams(ssl_id,params); }
|
virtual bool getPeerCryptoDetails(const RsPeerId& ssl_id,RsPeerCryptoParams& params) { return pqih->getCryptoParams(ssl_id,params); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,7 @@ bool p3Peers::OthersChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Peer Details (Net & Auth) */
|
/* Peer Details (Net & Auth) */
|
||||||
std::string p3Peers::getOwnId()
|
const RsPeerId& p3Peers::getOwnId()
|
||||||
{
|
{
|
||||||
#ifdef P3PEERS_DEBUG
|
#ifdef P3PEERS_DEBUG
|
||||||
std::cerr << "p3Peers::getOwnId()" << std::endl;
|
std::cerr << "p3Peers::getOwnId()" << std::endl;
|
||||||
|
|
|
@ -44,54 +44,54 @@ virtual bool FriendsChanged();
|
||||||
virtual bool OthersChanged();
|
virtual bool OthersChanged();
|
||||||
|
|
||||||
/* Peer Details (Net & Auth) */
|
/* Peer Details (Net & Auth) */
|
||||||
virtual std::string getOwnId();
|
virtual const RsPeerId& getOwnId();
|
||||||
|
|
||||||
virtual bool haveSecretKey(const std::string& gpg_id) ;
|
virtual bool haveSecretKey(const PGPIdType& gpg_id) ;
|
||||||
|
|
||||||
|
|
||||||
virtual bool getOnlineList(std::list<std::string> &ids);
|
virtual bool getOnlineList(std::list<RsPeerId> &ids);
|
||||||
virtual bool getFriendList(std::list<std::string> &ids);
|
virtual bool getFriendList(std::list<RsPeerId> &ids);
|
||||||
//virtual bool getOthersList(std::list<std::string> &ids);
|
//virtual bool getOthersList(std::list<std::string> &ids);
|
||||||
virtual bool getPeerCount (unsigned int *friendCount, unsigned int *onlineCount, bool ssl);
|
virtual bool getPeerCount (unsigned int *friendCount, unsigned int *onlineCount, bool ssl);
|
||||||
|
|
||||||
virtual bool isOnline(const std::string &id);
|
virtual bool isOnline(const RsPeerId &id);
|
||||||
virtual bool isFriend(const std::string &id);
|
virtual bool isFriend(const RsPeerId &id);
|
||||||
virtual bool isGPGAccepted(const std::string &gpg_id_is_friend); //
|
virtual bool isGPGAccepted(const PGPIdType &gpg_id_is_friend); //
|
||||||
virtual std::string getGPGName(const std::string &gpg_id);
|
virtual std::string getGPGName(const PGPIdType &gpg_id);
|
||||||
virtual std::string getPeerName(const std::string &ssl_or_gpg_id);
|
virtual std::string getPeerName(const RsPeerId& ssl_or_gpg_id);
|
||||||
virtual bool getPeerDetails(const std::string &ssl_or_gpg_id, RsPeerDetails &d);
|
virtual bool getPeerDetails(const RsPeerId& ssl_or_gpg_id, RsPeerDetails &d);
|
||||||
|
|
||||||
/* Using PGP Ids */
|
/* Using PGP Ids */
|
||||||
virtual std::string getGPGOwnId();
|
virtual PGPIdType getGPGOwnId();
|
||||||
virtual std::string getGPGId(const std::string &ssl_id);
|
virtual PGPIdType getGPGId(const RsPeerId &ssl_id);
|
||||||
virtual bool isKeySupported(const std::string& ids);
|
virtual bool isKeySupported(const PGPIdType& ids);
|
||||||
virtual bool getGPGAcceptedList(std::list<std::string> &ids);
|
virtual bool getGPGAcceptedList(std::list<PGPIdType> &ids);
|
||||||
virtual bool getGPGSignedList(std::list<std::string> &ids);
|
virtual bool getGPGSignedList(std::list<PGPIdType> &ids);
|
||||||
virtual bool getGPGValidList(std::list<std::string> &ids);
|
virtual bool getGPGValidList(std::list<PGPIdType> &ids);
|
||||||
virtual bool getGPGAllList(std::list<std::string> &ids);
|
virtual bool getGPGAllList(std::list<PGPIdType> &ids);
|
||||||
virtual bool getGPGDetails(const std::string &id, RsPeerDetails &d);
|
virtual bool getGPGDetails(const PGPIdType &id, RsPeerDetails &d);
|
||||||
virtual bool getAssociatedSSLIds(const std::string &gpg_id, std::list<std::string> &ids);
|
virtual bool getAssociatedSSLIds(const PGPIdType& gpg_id, std::list<RsPeerId> &ids);
|
||||||
virtual bool gpgSignData(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen) ;
|
virtual bool gpgSignData(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen) ;
|
||||||
|
|
||||||
/* Add/Remove Friends */
|
/* Add/Remove Friends */
|
||||||
virtual bool addFriend(const std::string &ssl_id, const std::string &gpg_id,ServicePermissionFlags flags = RS_SERVICE_PERM_ALL);
|
virtual bool addFriend(const RsPeerId &ssl_id, const PGPIdType &gpg_id,ServicePermissionFlags flags = RS_SERVICE_PERM_ALL);
|
||||||
virtual bool removeFriend(const std::string &ssl_or_gpgid);
|
virtual bool removeFriend(const RsPeerId &ssl_or_gpgid);
|
||||||
virtual bool removeFriendLocation(const std::string &sslId);
|
virtual bool removeFriendLocation(const RsPeerId &sslId);
|
||||||
|
|
||||||
/* keyring management */
|
/* keyring management */
|
||||||
virtual bool removeKeysFromPGPKeyring(const std::list<std::string>& pgp_ids,std::string& backup_file,uint32_t& error_code);
|
virtual bool removeKeysFromPGPKeyring(const std::list<PGPIdType>& pgp_ids,std::string& backup_file,uint32_t& error_code);
|
||||||
|
|
||||||
/* Network Stuff */
|
/* Network Stuff */
|
||||||
virtual bool connectAttempt(const std::string &id);
|
virtual bool connectAttempt(const RsPeerId &id);
|
||||||
virtual bool setLocation(const std::string &ssl_id, const std::string &location);//location is shown in the gui to differentiate ssl certs
|
virtual bool setLocation(const RsPeerId &ssl_id, const std::string &location);//location is shown in the gui to differentiate ssl certs
|
||||||
virtual bool setHiddenNode(const std::string &id, const std::string &hidden_node_address);
|
virtual bool setHiddenNode(const RsPeerId &id, const std::string &hidden_node_address);
|
||||||
virtual bool setHiddenNode(const std::string &id, const std::string &address, uint16_t port);
|
virtual bool setHiddenNode(const RsPeerId &id, const std::string &address, uint16_t port);
|
||||||
|
|
||||||
virtual bool setLocalAddress(const std::string &id, const std::string &addr, uint16_t port);
|
virtual bool setLocalAddress(const RsPeerId &id, const std::string &addr, uint16_t port);
|
||||||
virtual bool setExtAddress(const std::string &id, const std::string &addr, uint16_t port);
|
virtual bool setExtAddress(const RsPeerId &id, const std::string &addr, uint16_t port);
|
||||||
virtual bool setDynDNS(const std::string &id, const std::string &dyndns);
|
virtual bool setDynDNS(const RsPeerId &id, const std::string &dyndns);
|
||||||
virtual bool setNetworkMode(const std::string &id, uint32_t netMode);
|
virtual bool setNetworkMode(const RsPeerId &id, uint32_t netMode);
|
||||||
virtual bool setVisState(const std::string &id, uint16_t vs_disc, uint16_t vs_dht);
|
virtual bool setVisState(const RsPeerId &id, uint16_t vs_disc, uint16_t vs_dht);
|
||||||
|
|
||||||
virtual bool getProxyServer(std::string &addr, uint16_t &port);
|
virtual bool getProxyServer(std::string &addr, uint16_t &port);
|
||||||
virtual bool setProxyServer(const std::string &addr, const uint16_t port);
|
virtual bool setProxyServer(const std::string &addr, const uint16_t port);
|
||||||
|
@ -102,22 +102,22 @@ virtual bool getAllowServerIPDetermination() ;
|
||||||
|
|
||||||
/* Auth Stuff */
|
/* Auth Stuff */
|
||||||
// Get the invitation (GPG cert + local/ext address + SSL id for the given peer)
|
// Get the invitation (GPG cert + local/ext address + SSL id for the given peer)
|
||||||
virtual std::string GetRetroshareInvite(const std::string& ssl_id,bool include_signatures);
|
virtual std::string GetRetroshareInvite(const RsPeerId& ssl_id,bool include_signatures);
|
||||||
// same but for own id
|
// same but for own id
|
||||||
virtual std::string GetRetroshareInvite(bool include_signatures);
|
virtual std::string GetRetroshareInvite(bool include_signatures);
|
||||||
virtual bool GetPGPBase64StringAndCheckSum(const std::string& gpg_id,std::string& gpg_base64_string,std::string& gpg_base64_checksum) ;
|
virtual bool GetPGPBase64StringAndCheckSum(const PGPIdType& gpg_id,std::string& gpg_base64_string,std::string& gpg_base64_checksum) ;
|
||||||
|
|
||||||
virtual bool hasExportMinimal() ;
|
virtual bool hasExportMinimal() ;
|
||||||
|
|
||||||
virtual bool loadCertificateFromString(const std::string& cert, std::string& ssl_id,std::string& pgp_id, std::string& error_string);
|
virtual bool loadCertificateFromString(const std::string& cert, RsPeerId& ssl_id,PGPIdType& pgp_id, std::string& error_string);
|
||||||
virtual bool loadDetailsFromStringCert(const std::string &cert, RsPeerDetails &pd, uint32_t& error_code);
|
virtual bool loadDetailsFromStringCert(const std::string &cert, RsPeerDetails &pd, uint32_t& error_code);
|
||||||
|
|
||||||
virtual bool cleanCertificate(const std::string &certstr, std::string &cleanCert,int& error_code);
|
virtual bool cleanCertificate(const std::string &certstr, std::string &cleanCert,int& error_code);
|
||||||
virtual bool saveCertificateToFile(const std::string &id, const std::string &fname);
|
virtual bool saveCertificateToFile(const RsPeerId &id, const std::string &fname);
|
||||||
virtual std::string saveCertificateToString(const std::string &id);
|
virtual std::string saveCertificateToString(const RsPeerId &id);
|
||||||
|
|
||||||
virtual bool signGPGCertificate(const std::string &id);
|
virtual bool signGPGCertificate(const PGPIdType &id);
|
||||||
virtual bool trustGPGCertificate(const std::string &id, uint32_t trustlvl);
|
virtual bool trustGPGCertificate(const PGPIdType &id, uint32_t trustlvl);
|
||||||
|
|
||||||
/* Group Stuff */
|
/* Group Stuff */
|
||||||
virtual bool addGroup(RsGroupInfo &groupInfo);
|
virtual bool addGroup(RsGroupInfo &groupInfo);
|
||||||
|
@ -125,7 +125,7 @@ virtual bool editGroup(const std::string &groupId, RsGroupInfo &groupInfo);
|
||||||
virtual bool removeGroup(const std::string &groupId);
|
virtual bool removeGroup(const std::string &groupId);
|
||||||
virtual bool getGroupInfo(const std::string &groupId, RsGroupInfo &groupInfo);
|
virtual bool getGroupInfo(const std::string &groupId, RsGroupInfo &groupInfo);
|
||||||
virtual bool getGroupInfoList(std::list<RsGroupInfo> &groupInfoList);
|
virtual bool getGroupInfoList(std::list<RsGroupInfo> &groupInfoList);
|
||||||
virtual bool assignPeerToGroup(const std::string &groupId, const std::string &peerId, bool assign);
|
virtual bool assignPeerToGroup(const PGPIdType &groupId, const PGPIdType &peerId, bool assign);
|
||||||
virtual bool assignPeersToGroup(const std::string &groupId, const std::list<std::string> &peerIds, bool assign);
|
virtual bool assignPeersToGroup(const std::string &groupId, const std::list<std::string> &peerIds, bool assign);
|
||||||
|
|
||||||
virtual FileSearchFlags computePeerPermissionFlags(const std::string& peer_id,FileStorageFlags share_flags,const std::list<std::string>& parent_groups) ;
|
virtual FileSearchFlags computePeerPermissionFlags(const std::string& peer_id,FileStorageFlags share_flags,const std::list<std::string>& parent_groups) ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue