mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
f4331da483
(Sorry for the ridiculously large check-in, wants to fix lots of stuff.) Other Changes: * Added SSL Test Harness. (authssltest) * Added GPG Test Harness. (authssltest) * Reworked SSL/GPG startup to enable test harnesses * pqiperson: added notify of FAIL if connection method unavailable. * added p3tunnel to pqissltunnel init. * pqimonitor: added ipHistory to connect callback. p3ConnectMgr Changes: * removed STUN system - wasn't operating correctly anyway without DHT. * switched to new IpAddress history data types. (removed lots of code) * Added Addr history for both Local and Ext addresses. * removed p3tunnel references in p3connmgr * fixed up mUseTunnelConnection flags (now used!) * fixed up mUseExtFinder flags (now used!) * added improved Net Status. * corrected UPNP / EXT / UDP startup. (was always UPNP). * fixed netReset() and netStartup(). * removed unnecessary DEBUG code. * added UPNP timeout code (600 secs - why does it take so long?) * added improved netExtCheck(). * removed wierd netConsistencyCheck() ... to rework. * corrected connect / reconnect code. * removed DHT notify code. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3247 b45a01b8-16f6-495d-af2f-9b41ad6348cc
88 lines
2.4 KiB
C++
88 lines
2.4 KiB
C++
/*
|
|
* libretroshare/src/pqi: pqimonitor.cc
|
|
*
|
|
* 3P/PQI network interface for RetroShare.
|
|
*
|
|
* Copyright 2007-2008 Robert Fernie.
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Library General Public
|
|
* License Version 2 as published by the Free Software Foundation.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Library General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Library General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
* USA.
|
|
*
|
|
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
|
*
|
|
*/
|
|
|
|
#include "pqi/pqimonitor.h"
|
|
#include "pqi/pqinetwork.h"
|
|
#include "pqi/pqiipset.h"
|
|
#include "util/rsprint.h"
|
|
|
|
/***** DUMMY Connect CB for testing *****/
|
|
|
|
#include <iostream>
|
|
|
|
|
|
pqiConnectCbDummy::pqiConnectCbDummy()
|
|
{
|
|
std::cerr << "pqiConnectCbDummy()" << std::endl;
|
|
return;
|
|
}
|
|
|
|
pqiConnectCbDummy::~pqiConnectCbDummy()
|
|
{
|
|
return;
|
|
}
|
|
|
|
void pqiConnectCbDummy::peerStatus(std::string id, const pqiIpAddrSet &addrs,
|
|
uint32_t type, uint32_t mode, uint32_t source)
|
|
{
|
|
std::cerr << "pqiConnectCbDummy::peerStatus()";
|
|
std::cerr << " id: " << id;
|
|
std::cerr << " type: " << type;
|
|
std::cerr << " mode: " << mode;
|
|
std::cerr << " source: " << source;
|
|
std::cerr << std::endl;
|
|
|
|
std::cerr << " addrs: ";
|
|
std::cerr << std::endl;
|
|
addrs.printAddrs(std::cerr);
|
|
std::cerr << std::endl;
|
|
}
|
|
|
|
void pqiConnectCbDummy::peerConnectRequest(std::string id,
|
|
struct sockaddr_in raddr, uint32_t source)
|
|
{
|
|
std::cerr << "pqiConnectCbDummy::peerConnectRequest()";
|
|
std::cerr << " id: " << id;
|
|
std::cerr << " raddr: " << inet_ntoa(raddr.sin_addr);
|
|
std::cerr << ":" << ntohs(raddr.sin_port);
|
|
std::cerr << " source: " << source;
|
|
std::cerr << std::endl;
|
|
}
|
|
|
|
#if 0
|
|
void pqiConnectCbDummy::stunStatus(std::string id, struct sockaddr_in raddr,
|
|
uint32_t type, uint32_t flags)
|
|
{
|
|
std::cerr << "pqiConnectCbDummy::stunStatus()";
|
|
std::cerr << " idhash: " << RsUtil::BinToHex(id) << " raddr: " << inet_ntoa(raddr.sin_addr);
|
|
std::cerr << ":" << ntohs(raddr.sin_port);
|
|
std::cerr << " type: " << type;
|
|
std::cerr << " flags: " << flags;
|
|
std::cerr << std::endl;
|
|
}
|
|
#endif
|
|
|
|
|