mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04:00
Add the tunneling connection. Warning, encryption is not implemented yet for tunnel connection, use only for testing.
Redesign the udp connection Remove the rsiface duplicates from retroshare-gui. Add some randomness in timings for connect manager Merge branch 'connectionTunneling' Conflicts: libretroshare/src/libretroshare.pro libretroshare/src/pqi/p3connmgr.cc retroshare-gui/src/RetroShare.pro retroshare-gui/src/rsiface/rsfiles.h retroshare-gui/src/rsiface/rstypes.h git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1867 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1d567a7faa
commit
fdb3673ce2
56 changed files with 2420 additions and 3394 deletions
82
libretroshare/src/services/p3tunnel.h
Normal file
82
libretroshare/src/services/p3tunnel.h
Normal file
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* libretroshare/src/services: p3tunnel.h
|
||||
*
|
||||
* Services for RetroShare.
|
||||
*
|
||||
* Copyright 2004-2008 by 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".
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MRK_PQI_TUNNEL_H
|
||||
#define MRK_PQI_TUNNEL_H
|
||||
|
||||
// The AutoDiscovery Class
|
||||
|
||||
#include "pqi/pqipersongrp.h"
|
||||
|
||||
// system specific network headers
|
||||
#include "pqi/pqi.h"
|
||||
|
||||
class p3ConnectMgr;
|
||||
class p3AuthMgr;
|
||||
|
||||
#include "pqi/pqimonitor.h"
|
||||
#include "services/p3service.h"
|
||||
#include "serialiser/rstunnelitems.h"
|
||||
|
||||
class p3tunnel: public p3Service, public pqiMonitor
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void statusChange(const std::list<pqipeer> &plist);
|
||||
|
||||
p3tunnel(p3AuthMgr *am, p3ConnectMgr *cm, pqipersongrp *persGrp);
|
||||
|
||||
int tick();
|
||||
|
||||
void sendTunnelData(std::string destPeerId, std::string relayPeerId, void *data, int data_length);
|
||||
|
||||
//to establish a connection, send a ping (just a empty data packet)
|
||||
void pingTunnelConnection(std::string relayPeerId, std::string destPeerId);
|
||||
|
||||
private:
|
||||
|
||||
void sendTunnelDataPrivate(int connection_accept, std::string to, std::string sourcePeerId, std::string relayPeerId, std::string destPeerId, void *data, int data_length);
|
||||
|
||||
void privateRecvTunnelDataRelaying(RsTunnelDataItem *item); //invoked when I am relaying
|
||||
void privateRecvTunnelDataDestination(RsTunnelDataItem *item); //invoked when I am the destination of the tunnel
|
||||
|
||||
/* Network Input */
|
||||
int handleIncoming();
|
||||
void recvTunnelData(RsTunnelDataItem *item);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
p3AuthMgr *mAuthMgr;
|
||||
p3ConnectMgr *mConnMgr;
|
||||
pqipersongrp *mPqiPersonGrp;
|
||||
std::string ownId;
|
||||
|
||||
|
||||
/* data */
|
||||
RsMutex mTunnelMtx;
|
||||
};
|
||||
|
||||
#endif // MRK_PQI_TUNNEL_H
|
Loading…
Add table
Add a link
Reference in a new issue