Merge branch 'master' into jsonapi

This commit is contained in:
Gioacchino Mazzurco 2018-07-23 13:44:01 +02:00
commit 130007b578
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
669 changed files with 18998 additions and 12720 deletions

View file

@ -1,31 +1,27 @@
/*******************************************************************************
* libretroshare/src/rsserver: p3face.h *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2004-2006 by Robert Fernie <retroshare@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef MRK_P3RS_INTERFACE_H
#define MRK_P3RS_INTERFACE_H
/*
* "$Id: p3face.h,v 1.9 2007-05-05 16:10:06 rmf24 Exp $"
*
* RetroShare C++ Interface.
*
* Copyright 2004-2006 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".
*
*/
//#include "server/filedexserver.h"
#include "ft/ftserver.h"
//#include "pqi/pqissl.h"

View file

@ -1,29 +1,24 @@
/*
* libretroshare/src/rsserver: p3history.h
*
* RetroShare C++ Interface.
*
* Copyright 2011 by Thunder.
*
* 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".
*
*/
/*******************************************************************************
* libretroshare/src/rsserver: p3history.cc *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2011 by Thunder. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "p3history.h"
#include "pqi/p3historymgr.h"

View file

@ -1,31 +1,27 @@
/*******************************************************************************
* libretroshare/src/rsserver: p3history.h *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2011 by Thunder. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef RS_P3HISTORY_INTERFACE_H
#define RS_P3HISTORY_INTERFACE_H
/*
* libretroshare/src/rsserver: p3history.h
*
* RetroShare C++ Interface.
*
* Copyright 2011 by Thunder.
*
* 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 "retroshare/rshistory.h"
class p3HistoryMgr;

View file

@ -1,31 +1,24 @@
/*
* "$Id: p3face-msgs.cc,v 1.7 2007-05-05 16:10:06 rmf24 Exp $"
*
* RetroShare C++ Interface.
*
* Copyright 2004-2006 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".
*
*/
/*******************************************************************************
* libretroshare/src/rsserver: p3msgs.cc *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2004-2006 by Robert Fernie <retroshare@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include <iostream>
#include "util/rsdir.h"

View file

@ -1,31 +1,27 @@
/*******************************************************************************
* libretroshare/src/rsserver: p3msgs.h *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2007-2008 by Robert Fernie <retroshare@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef RS_P3MSG_INTERFACE_H
#define RS_P3MSG_INTERFACE_H
/*
* libretroshare/src/rsserver: p3msgs.h
*
* RetroShare C++ Interface.
*
* Copyright 2007-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".
*
*/
#include "retroshare/rsmsgs.h"
#include "retroshare/rsgxsifacetypes.h"

View file

@ -1,29 +1,25 @@
/*
* libretroshare/src/rsserver: p3peers.cc
*
* RetroShare C++ Interface.
*
* Copyright 2004-2008 by Robert Fernie.
* Copyright (C) 2015-2018 Gioacchino Mazzurco <gio@eigenlab.org>
*
* 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".
*
*/
/*******************************************************************************
* libretroshare/src/rsserver: p3peers.cc *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2004-2008 by Robert Fernie <retroshare@lunamutt.com> *
* Copyright (C) 2015-2018 Gioacchino Mazzurco <gio@eigenlab.org> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "util/radix64.h"
#include "pgp/pgpkeyutil.h"
@ -904,6 +900,9 @@ bool p3Peers::setHiddenNode(const RsPeerId &id, const std::string &address, uin
return true;
}
bool p3Peers::addPeerLocator(const RsPeerId &ssl_id, const RsUrl& locator)
{ return mPeerMgr->addPeerLocator(ssl_id, locator); }
bool p3Peers::setLocalAddress(const RsPeerId &id,
const std::string &addr_str, uint16_t port)
{
@ -1045,9 +1044,11 @@ bool p3Peers::setProxyServer(const uint32_t type, const std::string &addr_str, c
//===========================================================================
/* Auth Stuff */
std::string p3Peers::GetRetroshareInvite(bool include_signatures)
std::string p3Peers::GetRetroshareInvite(
bool include_signatures, bool includeExtraLocators )
{
return GetRetroshareInvite(getOwnId(),include_signatures);
return GetRetroshareInvite(
getOwnId(), include_signatures, includeExtraLocators );
}
std::string p3Peers::getPGPKey(const RsPgpId& pgp_id,bool include_signatures)
{
@ -1098,37 +1099,42 @@ bool p3Peers::GetPGPBase64StringAndCheckSum( const RsPgpId& gpg_id,
return true ;
}
std::string p3Peers::GetRetroshareInvite(const RsPeerId& ssl_id,bool include_signatures)
std::string p3Peers::GetRetroshareInvite(
const RsPeerId& ssl_id, bool include_signatures,
bool includeExtraLocators )
{
#ifdef P3PEERS_DEBUG
std::cerr << "p3Peers::GetRetroshareInvite()" << std::endl;
std::cerr << __PRETTY_FUNCTION__ << std::endl;
#endif
//add the sslid, location, ip local and external address after the signature
RsPeerDetails Detail;
std::string invite ;
RsPeerDetails detail;
std::string invite;
if (getPeerDetails(ssl_id, Detail))
if (getPeerDetails(ssl_id, detail))
{
unsigned char *mem_block = NULL;
if(!includeExtraLocators) detail.ipAddressList.clear();
unsigned char *mem_block = nullptr;
size_t mem_block_size = 0;
if(!AuthGPG::getAuthGPG()->exportPublicKey(RsPgpId(Detail.gpg_id),mem_block,mem_block_size,false,include_signatures))
if(!AuthGPG::getAuthGPG()->exportPublicKey(
RsPgpId(detail.gpg_id), mem_block, mem_block_size, false,
include_signatures ))
{
std::cerr << "Cannot output certificate for id \"" << Detail.gpg_id << "\". Sorry." << std::endl;
return "" ;
std::cerr << "Cannot output certificate for id \"" << detail.gpg_id
<< "\". Sorry." << std::endl;
return "";
}
RsCertificate cert( Detail,mem_block,mem_block_size ) ;
delete[] mem_block ;
return cert.toStdString() ;
RsCertificate cert(detail, mem_block, mem_block_size);
delete[] mem_block;
return cert.toStdString();
}
#ifdef P3PEERS_DEBUG
std::cerr << "p3Peers::GetRetroshareInvite() returns : \n" << invite << std::endl;
std::cerr << __PRETTY_FUNCTION__ << " returns : \n" << invite << std::endl;
#endif
return invite;
}
@ -1148,11 +1154,12 @@ bool p3Peers::loadCertificateFromString(const std::string& cert, RsPeerId& ssl_
return res ;
}
bool p3Peers::loadDetailsFromStringCert(const std::string &certstr, RsPeerDetails &pd,uint32_t& error_code)
bool p3Peers::loadDetailsFromStringCert( const std::string &certstr,
RsPeerDetails &pd,
uint32_t& error_code )
{
#ifdef P3PEERS_DEBUG
std::cerr << "p3Peers::LoadCertificateFromString() ";
std::cerr << std::endl;
std::cerr << "p3Peers::LoadCertificateFromString() " << std::endl;
#endif
//parse the text to get ip address
try
@ -1192,9 +1199,11 @@ bool p3Peers::loadDetailsFromStringCert(const std::string &certstr, RsPeerDetai
pd.localPort = cert.loc_port_us();
pd.extAddr = cert.ext_ip_string();
pd.extPort = cert.ext_port_us();
pd.dyndns = cert.dns_string() ;
pd.dyndns = cert.dns_string();
for(const RsUrl& locator : cert.locators())
pd.ipAddressList.push_back(locator.toString());
}
}
}
catch(uint32_t e)
{
std::cerr << "ConnectFriendWizard : Parse ip address error :" << e << std::endl;

View file

@ -1,31 +1,26 @@
/*******************************************************************************
* libretroshare/src/rsserver: p3peers.h *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2004-2008 by Robert Fernie <retroshare@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef RETROSHARE_P3_PEER_INTERFACE_H
#define RETROSHARE_P3_PEER_INTERFACE_H
/*
* libretroshare/src/rsserver: p3peers.h
*
* RetroShare C++ Interface.
*
* 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".
*
*/
/* get OS-specific definitions for:
* struct sockaddr_storage
*/
@ -36,6 +31,7 @@
#endif
#include "retroshare/rspeers.h"
#include "util/rsurl.h"
class p3LinkMgr;
class p3PeerMgr;
@ -96,7 +92,8 @@ public:
virtual bool setHiddenNode(const RsPeerId &id, const std::string &address, uint16_t port);
virtual bool isHiddenNode(const RsPeerId &id);
virtual bool setLocalAddress(const RsPeerId &id, const std::string &addr, uint16_t port);
virtual bool addPeerLocator(const RsPeerId &ssl_id, const RsUrl& locator);
virtual bool setLocalAddress(const RsPeerId &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 RsPeerId &id, const std::string &dyndns);
virtual bool setNetworkMode(const RsPeerId &id, uint32_t netMode);
@ -113,11 +110,15 @@ public:
/* Auth Stuff */
// Get the invitation (GPG cert + local/ext address + SSL id for the given peer)
virtual std::string GetRetroshareInvite(const RsPeerId& ssl_id,bool include_signatures);
virtual std::string getPGPKey(const RsPgpId& pgp_id,bool include_signatures) ;
virtual std::string GetRetroshareInvite(
const RsPeerId& ssl_id, bool include_signatures = false,
bool includeExtraLocators = true );
virtual std::string getPGPKey(const RsPgpId& pgp_id,bool include_signatures);
// same but for own id
virtual std::string GetRetroshareInvite(bool include_signatures);
virtual std::string GetRetroshareInvite(
bool include_signatures = false,
bool includeExtraLocators = true );
virtual bool GetPGPBase64StringAndCheckSum(const RsPgpId& gpg_id,std::string& gpg_base64_string,std::string& gpg_base64_checksum);
virtual bool hasExportMinimal();

View file

@ -1,28 +1,24 @@
/*
* libretroshare/src/rsserver: p3serverconfig.h
*
* RetroShare C++ Interface.
*
* Copyright 2011-2011 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".
*
*/
/*******************************************************************************
* libretroshare/src/rsserver: p3serverconfig.cc *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2011-2011 by Robert Fernie <retroshare@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include <retroshare/rsturtle.h>
#include "rsserver/p3serverconfig.h"
#include "services/p3bwctrl.h"

View file

@ -1,32 +1,27 @@
/*******************************************************************************
* libretroshare/src/rsserver: p3serverconfig.h *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2011-2011 by Robert Fernie <retroshare@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef LIBRETROSHARE_CONFIG_IMPLEMENTATION_H
#define LIBRETROSHARE_CONFIG_IMPLEMENTATION_H
/*
* libretroshare/src/rsserver: p3serverconfig.h
*
* RetroShare C++ Interface.
*
* Copyright 2011-2011 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".
*
*/
#include "retroshare/rsconfig.h"
#include "pqi/p3peermgr.h"
#include "pqi/p3linkmgr.h"

View file

@ -1,29 +1,24 @@
/*
* libretroshare/src/rsserver: p3msgs.h
*
* RetroShare C++ Interface.
*
* Copyright 2007-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".
*
*/
/*******************************************************************************
* libretroshare/src/rsserver: p3status.cc *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2007-2008 by Chris Evi-Parker. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "p3status.h"
#include "services/p3statusservice.h"

View file

@ -1,31 +1,27 @@
/*******************************************************************************
* libretroshare/src/rsserver: p3status.h *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2007-2008 by Chris Evi-Parker. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef RS_P3STATUS_INTERFACE_H
#define RS_P3STATUS_INTERFACE_H
/*
* libretroshare/src/rsserver: p3status.h
*
* RetroShare C++ Interface.
*
* Copyright 2007-2008 by Chris Evi-Parker.
*
* 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 "retroshare/rsstatus.h"

View file

@ -1,28 +1,24 @@
/*
* libretroshare/src/rsserver/rsaccounts.cc
*
* RetroShare C++ Interface.
*
* Copyright 2013-2014 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.1 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".
*
*/
/*******************************************************************************
* libretroshare/src/rsserver: rsaccounts.cc *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2013-2014 by Robert Fernie <retroshare@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
/*********************************************************************
* Libretroshare interface declared in rsaccounts.h.

View file

@ -1,28 +1,24 @@
/*
* libretroshare/src/rsserver/rsaccounts.h
*
* RetroShare C++ Interface.
*
* Copyright 2013-2014 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.1 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".
*
*/
/*******************************************************************************
* libretroshare/src/rsserver: rsaccounts.h *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2013-2014 by Robert Fernie <retroshare@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
/*********************************************************************
* Header providing interface for libretroshare access to RsAccounts stuff.

View file

@ -1,27 +1,24 @@
/*
* libretroshare/src/reserver rsinit.cc
*
* RetroShare C++ Interface.
*
* Copyright 2004-2006 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".
*
*/
/*******************************************************************************
* libretroshare/src/retroshare: rsinit.cc *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2004-2006 by Robert Fernie <retroshare@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
/* This is an updated startup class. Class variables are hidden from
* the GUI / External via a hidden class */
@ -62,6 +59,7 @@
#include <fcntl.h>
#include "gxstunnel/p3gxstunnel.h"
#include "retroshare/rsgxsdistsync.h"
#include "file_sharing/p3filelists.h"
#define ENABLE_GROUTER
@ -1282,6 +1280,15 @@ int RsServer::StartupRetroShare()
RsNxsNetMgr* nxsMgr = new RsNxsNetMgrImpl(serviceCtrl);
/**** GXS Dist sync service ****/
#ifdef RS_USE_GXS_DISTANT_SYNC
RsGxsNetTunnelService *mGxsNetTunnel = new RsGxsNetTunnelService ;
rsGxsDistSync = mGxsNetTunnel ;
#else
RsGxsNetTunnelService *mGxsNetTunnel = NULL ;
#endif
/**** Identity service ****/
RsGeneralDataService* gxsid_ds = new RsDataService(currGxsDir + "/", "gxsid_db",
@ -1303,9 +1310,10 @@ int RsServer::StartupRetroShare()
RS_SERVICE_GXS_TYPE_GXSID, gxsid_ds, nxsMgr,
mGxsIdService, mGxsIdService->getServiceInfo(),
mReputations, mGxsCircles,mGxsIdService,
pgpAuxUtils,
false,false); // don't synchronise group automatic (need explicit group request)
pgpAuxUtils,mGxsNetTunnel,
false,false,true); // don't synchronise group automatic (need explicit group request)
// don't sync messages at all.
// allow distsync, so that we can grab GXS id requests for other services
// Normally we wouldn't need this (we do in other service):
// mGxsIdService->setNetworkExchangeService(gxsid_ns) ;
@ -1322,9 +1330,7 @@ int RsServer::StartupRetroShare()
RS_SERVICE_GXS_TYPE_GXSCIRCLE, gxscircles_ds, nxsMgr,
mGxsCircles, mGxsCircles->getServiceInfo(),
mReputations, mGxsCircles,mGxsIdService,
pgpAuxUtils,
true, // synchronise group automatic
true); // sync messages automatic, since they contain subscription requests.
pgpAuxUtils);
mGxsCircles->setNetworkExchangeService(gxscircles_ns) ;
@ -1376,7 +1382,7 @@ int RsServer::StartupRetroShare()
RS_SERVICE_GXS_TYPE_FORUMS, gxsforums_ds, nxsMgr,
mGxsForums, mGxsForums->getServiceInfo(),
mReputations, mGxsCircles,mGxsIdService,
pgpAuxUtils);
pgpAuxUtils);//,mGxsNetTunnel,true,true,true);
mGxsForums->setNetworkExchangeService(gxsforums_ns) ;
@ -1389,10 +1395,10 @@ int RsServer::StartupRetroShare()
// create GXS photo service
RsGxsNetService* gxschannels_ns = new RsGxsNetService(
RS_SERVICE_GXS_TYPE_CHANNELS, gxschannels_ds, nxsMgr,
mGxsChannels, mGxsChannels->getServiceInfo(),
mReputations, mGxsCircles,mGxsIdService,
pgpAuxUtils);
RS_SERVICE_GXS_TYPE_CHANNELS, gxschannels_ds, nxsMgr,
mGxsChannels, mGxsChannels->getServiceInfo(),
mReputations, mGxsCircles,mGxsIdService,
pgpAuxUtils,mGxsNetTunnel,true,true,true);
mGxsChannels->setNetworkExchangeService(gxschannels_ns) ;
@ -1447,7 +1453,7 @@ int RsServer::StartupRetroShare()
RsGxsNetService* gxstrans_ns = new RsGxsNetService(
RS_SERVICE_TYPE_GXS_TRANS, gxstrans_ds, nxsMgr, mGxsTrans,
mGxsTrans->getServiceInfo(), mReputations, mGxsCircles,
mGxsIdService, pgpAuxUtils,true,true,p3GxsTrans::GXS_STORAGE_PERIOD,p3GxsTrans::GXS_SYNC_PERIOD);
mGxsIdService, pgpAuxUtils,NULL,true,true,false,p3GxsTrans::GXS_STORAGE_PERIOD,p3GxsTrans::GXS_SYNC_PERIOD);
mGxsTrans->setNetworkExchangeService(gxstrans_ns);
pqih->addService(gxstrans_ns, true);
@ -1480,9 +1486,11 @@ int RsServer::StartupRetroShare()
pqih -> addService(fdb,true);
pqih -> addService(ftserver,true);
mGxsTunnels = new p3GxsTunnelService(mGxsIdService) ;
mGxsTunnels->connectToTurtleRouter(tr) ;
rsGxsTunnel = mGxsTunnels;
mGxsTunnels = new p3GxsTunnelService(mGxsIdService) ;
mGxsTunnels->connectToTurtleRouter(tr) ;
rsGxsTunnel = mGxsTunnels;
mGxsNetTunnel->connectToTurtleRouter(tr) ;
rsDisc = mDisc;
rsMsgs = new p3Msgs(msgSrv, chatSrv);
@ -1615,48 +1623,51 @@ int RsServer::StartupRetroShare()
serviceCtrl->registerServiceMonitor(mBwCtrl, mBwCtrl->getServiceInfo().mServiceType);
/**************************************************************************/
// Turtle search for GXS services
mGxsNetTunnel->registerSearchableService(gxschannels_ns) ;
/**************************************************************************/
//mConfigMgr->addConfiguration("ftserver.cfg", ftserver);
//
mConfigMgr->addConfiguration("gpg_prefs.cfg", AuthGPG::getAuthGPG());
mConfigMgr->loadConfiguration();
mConfigMgr->addConfiguration("peers.cfg", mPeerMgr);
mConfigMgr->addConfiguration("general.cfg", mGeneralConfig);
mConfigMgr->addConfiguration("msgs.cfg", msgSrv);
mConfigMgr->addConfiguration("chat.cfg", chatSrv);
mConfigMgr->addConfiguration("p3History.cfg", mHistoryMgr);
mConfigMgr->addConfiguration("p3Status.cfg", mStatusSrv);
mConfigMgr->addConfiguration("turtle.cfg", tr);
mConfigMgr->addConfiguration("gpg_prefs.cfg" , AuthGPG::getAuthGPG());
mConfigMgr->addConfiguration("gxsnettunnel.cfg", mGxsNetTunnel);
mConfigMgr->addConfiguration("peers.cfg" , mPeerMgr);
mConfigMgr->addConfiguration("general.cfg" , mGeneralConfig);
mConfigMgr->addConfiguration("msgs.cfg" , msgSrv);
mConfigMgr->addConfiguration("chat.cfg" , chatSrv);
mConfigMgr->addConfiguration("p3History.cfg" , mHistoryMgr);
mConfigMgr->addConfiguration("p3Status.cfg" , mStatusSrv);
mConfigMgr->addConfiguration("turtle.cfg" , tr);
#ifndef RETROTOR
mConfigMgr->addConfiguration("banlist.cfg", mBanList);
mConfigMgr->addConfiguration("banlist.cfg" , mBanList);
#endif
mConfigMgr->addConfiguration("servicecontrol.cfg", serviceCtrl);
mConfigMgr->addConfiguration("reputations.cfg", mReputations);
mConfigMgr->addConfiguration("reputations.cfg" , mReputations);
#ifdef ENABLE_GROUTER
mConfigMgr->addConfiguration("grouter.cfg", gr);
mConfigMgr->addConfiguration("grouter.cfg" , gr);
#endif
#ifdef RS_USE_BITDHT
mConfigMgr->addConfiguration("bitdht.cfg", mBitDht);
mConfigMgr->addConfiguration("bitdht.cfg" , mBitDht);
#endif
#ifdef RS_ENABLE_GXS
# ifdef RS_GXS_TRANS
mConfigMgr->addConfiguration("gxs_trans_ns.cfg", gxstrans_ns);
mConfigMgr->addConfiguration("gxs_trans.cfg", mGxsTrans);
mConfigMgr->addConfiguration("gxs_trans.cfg" , mGxsTrans);
# endif // RS_GXS_TRANS
mConfigMgr->addConfiguration("p3identity.cfg", mGxsIdService);
mConfigMgr->addConfiguration("identity.cfg", gxsid_ns);
mConfigMgr->addConfiguration("gxsforums.cfg", gxsforums_ns);
mConfigMgr->addConfiguration("p3identity.cfg" , mGxsIdService);
mConfigMgr->addConfiguration("identity.cfg" , gxsid_ns);
mConfigMgr->addConfiguration("gxsforums.cfg" , gxsforums_ns);
mConfigMgr->addConfiguration("gxsforums_srv.cfg", mGxsForums);
mConfigMgr->addConfiguration("gxschannels.cfg", gxschannels_ns);
mConfigMgr->addConfiguration("gxschannels.cfg" , gxschannels_ns);
mConfigMgr->addConfiguration("gxschannels_srv.cfg", mGxsChannels);
mConfigMgr->addConfiguration("gxscircles.cfg", gxscircles_ns);
mConfigMgr->addConfiguration("posted.cfg", posted_ns);
mConfigMgr->addConfiguration("gxscircles.cfg" , gxscircles_ns);
mConfigMgr->addConfiguration("posted.cfg" , posted_ns);
#ifdef RS_USE_WIKI
mConfigMgr->addConfiguration("wiki.cfg", wiki_ns);
#endif
@ -1827,6 +1838,8 @@ int RsServer::StartupRetroShare()
//rsWire = mWire;
/*** start up GXS core runner ***/
startServiceThread(mGxsNetTunnel, "gxs net tunnel");
startServiceThread(mGxsIdService, "gxs id");
startServiceThread(mGxsCircles, "gxs circle");
startServiceThread(mPosted, "gxs posted");