From b12f9323dc441efcac2e4a2034f8c73366152ac3 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 10 Dec 2017 15:57:01 +0100 Subject: [PATCH 001/138] added some text to describe the protocol for GXS distant sync --- libretroshare/src/gxs/rsgxsnetservice.cc | 49 +++++++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 88c7701d2..eba451bcd 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -166,8 +166,6 @@ // | | // (Only send if rand() < sendingProb()) +---comes from mClientMsgUpdateMap -----+ // -// -// // Suggestions // =========== // * handleRecvSyncGroup should use mit->second.mLastPost to limit the sending of already known data @@ -194,6 +192,53 @@ // Problem: without msg, we cannot know the grpId!! // // * mClientMsgUpdateMap[peerid][grpId] is only updated when new msgs are received. Up to date groups will keep asking for lists! +// +// Distant sync +// ============ +// +// Distant sync uses tunnels to sync subscribed GXS groups that are not supplied by friends. Peers can subscribe to a GXS group using a RS link +// which GXS uses to request updates through tunnels. +// * The whole exchange should be kept private and anonymous between the two distant peers, so we use the same trick than for FT: encrypt the data using the group ID. +// * The same node shouldn't be known as a common server for different GXS groups +// +// GXS net service: +// * talks to virtual peers, treated like normal peers +// * virtual peers only depend on the server ID, not on tunnel ID, and be kept constant accross time so that ClientGroupUpdateMap is kept consistent +// * does not use tunnels if friends can already supply the data (??) This causes issues with "islands". +// +// Tunnels: +// * a specific service named GxsSyncTunnelService handles the creation/management of sync tunnels: +// * tunnel data need to be encrypted. +// +// bool manageTunnels(const RsGxsGroupId&) ; // start managing tunnels for this group +// bool releaseTunnels(const RsGxsGroupId&) ; // stop managing tunnels for this group +// bool sendData(const unsigned char *data,uint32_t size,const RsPeerId& virtual_peer) ; // send data to this virtual peer +// bool getVirtualPeers(const RsGxsGroupId&, std::list& peers) ; // returns the virtual peers for this group +// +// Proposed protocol: +// * request tunnels based on H(GroupId) +// * encrypt tunnel data using chacha20+HMAC-SHA256 using AEAD( GroupId, 96bits IV, tunnel ID ) (similar to what FT does) +// * when tunnel is established, exchange virtual peer names: vpid = H( GroupID | Random bias ) +// * when vpid is known, notify the client (GXS net service) which can use the virtual peer to sync +// +// * only use a single tunnel per virtual peer ID +// +// Client ------------------ TR(H(GroupId)) --------------> Server +// +// Client <-------------------- T OK ---------------------- Server +// +// [Encrypted traffic using H(GroupId, 96bits IV, tunnel ID)] +// +// Client <--------- VPID = H( Random IV | GroupId ) ------ Server +// | | +// +--------------> Mark the virtual peer active <-----------+ +// +// Unsolved problems: +// * if we want to preserve anonymity, we cannot prevent GXS from duplicating the data from virtual/real peers that actually are the same peers. +// * ultimately we should only use tunnels to sync GXS. The mix between tunnels and real peers is not a problem but will cause unnecessary traffic. +// +// Notes: +// * given that GXS only talks to peers once every 2 mins, it's likely that keep-alive packets will be needed #include From a173f325a9198f70e8b9fad060ef928e7424792b Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 20 Dec 2017 00:09:34 +0100 Subject: [PATCH 002/138] added .h for RsGxsNetTunnel service --- libretroshare/src/gxs/rsgxsnettunnel.cc | 0 libretroshare/src/gxs/rsgxsnettunnel.h | 148 ++++++++++++++++++++++++ 2 files changed, 148 insertions(+) create mode 100644 libretroshare/src/gxs/rsgxsnettunnel.cc create mode 100644 libretroshare/src/gxs/rsgxsnettunnel.h diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc new file mode 100644 index 000000000..e69de29bb diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h new file mode 100644 index 000000000..b831e5bbc --- /dev/null +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -0,0 +1,148 @@ +/* + * libretroshare/src/gxs: rsgxsnettunnel.h + * + * General Data service, interface for RetroShare. + * + * Copyright 2011-2011 by Robert Fernie, Evi-Parker Christopher + * + * 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.project@gmail.com" + * + */ + +#include + +#include + +/*! + * \brief The RsGxsNetTunnelService class takes care of requesting tunnels to the turtle router, through which it is possible to sync + * a particular GXS group. For each group, a set of virtual peers, corresponding to active tunnels will be made available + * to RsGxsNetService. + * + * It is the responsibility of RsGxsNetService to activate/desactivate tunnels for each particular group, depending on wether the group + * is already available at friends or not. + */ + +// Proposed protocol: +// * request tunnels based on H(GroupId) +// * encrypt tunnel data using chacha20+HMAC-SHA256 using AEAD( GroupId, 96bits IV, tunnel ID ) (similar to what FT does) +// * when tunnel is established, exchange virtual peer names: vpid = H( GroupID | Random bias ) +// * when vpid is known, notify the client (GXS net service) which can use the virtual peer to sync +// +// * only use a single tunnel per virtual peer ID +// +// Client ------------------ TR(H(GroupId)) --------------> Server +// +// Client <-------------------- T OK ---------------------- Server +// +// Here, a turtle vpid is known +// +// [Encrypted traffic using H(GroupId, 96bits IV, tunnel ID)] +// +// Client <--------- VPID = H( Random IV | GroupId ) ------ Server +// | | +// +--------------> Mark the virtual peer active <-----------+ +// +// Here, a consistent virtual peer ID is known + +typedef RsPeerId RsGxsNetTunnelVirtualPeerId ; + +struct RsGxsNetTunnelVirtualPeerInfo +{ + enum { RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN = 0x00, // unknown status. + RS_GXS_NET_TUNNEL_VP_STATUS_TUNNEL_OK = 0x01, // tunnel has been established and we're waiting for virtual peer id + RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE = 0x02 // virtual peer id is known. Data can transfer. + }; + + uint8_t vpid_status ; + RsGxsNetTunnelVirtualPeerId net_service_virtual_peer ; + uint8_t side ; // client/server +}; + +struct RsGxsNetTunnelInfo +{ + enum { RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN = 0x00, // unknown status + RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED = 0x01, // waiting for turtle to send some virtual peers. + RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE = 0x02 // some virtual peers are available + }; + + uint8_t group_status ; + uint8_t encryption_master_key[16] ; // key from which the encryption key is derived for each virtual peer (using H(master_key | random IV)) + + std::map virtual_peers ; +}; + +class RsGxsNetTunnelService +{ +public: + RsGxsNetTunnelService() {} + + /*! + * \brief start managing tunnels for this group + * @param group_id group for which tunnels should be requested + */ + bool manageTunnels(const RsGxsGroupId&) ; + + /*! + * \brief Stop managing tunnels for this group + * @param group_id group for which tunnels should be released + */ + bool releaseTunnels(const RsGxsGroupId&) ; + + /*! + * sends data to this virtual peer ID + */ + bool sendData(const unsigned char *data,uint32_t size,const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; // send data to this virtual peer + + /*! + * \brief Get the list of active virtual peers for a given group. This implies that the tunnel is up and + * alive. + */ + bool getVirtualPeers(const RsGxsGroupId&, std::list& peers) ; // returns the virtual peers for this group + + /*! + * \brief dumps all information about monitored groups. + */ + void dump() const; + + // other methods are still missing. + // - derived from p3Config, to load/save data + // - method to respond to tunnel requests, probably using RsGxsNetService + // - method to encrypt/decrypt data and send/receive to/from turtle. + +private: + std::map mClientGroups ; // groups on the client side + std::map mServerGroups ; // groups on the server side + + std::map > mVirtualPeers ; + + /*! + * \brief Generates the hash to request tunnels for this group. This hash is only used by turtle, and is used to + * hide the real group id. + */ + + RsFileHash makeRequestHash(const RsGxsGroupId&) const ; + + /*! + * \brief makeVirtualPeerIdForGroup creates a virtual peer id that can be used and that will be constant accross time, whatever the + * tunnel ID and turtle virtual peer id. This allows RsGxsNetService to keep sync-ing the data consistently. + */ + + RsGxsNetTunnelVirtualPeerInfo makeVirtualPeerIdForGroup(const RsGxsGroupId&) const ; + + uint8_t mRandomBias[16] ; // constant accross reboots. Allows to disguise the real SSL id while providing a consistent value accross time. +}; + From 76ec079b40b622e4c8266742efdebfc90f023865 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 20 Dec 2017 22:14:58 +0100 Subject: [PATCH 003/138] added missing change in .pro --- libretroshare/src/libretroshare.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index 1521f5574..221fe5bd3 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -740,6 +740,7 @@ HEADERS += rsitems/rsnxsitems.h \ gxs/rsgxs.h \ gxs/rsdataservice.h \ gxs/rsgxsnetservice.h \ + gxs/rsgxsnettunnel.h \ retroshare/rsgxsflags.h \ retroshare/rsgxsifacetypes.h \ gxs/rsgenexchange.h \ @@ -765,6 +766,7 @@ SOURCES += rsitems/rsnxsitems.cc \ gxs/rsdataservice.cc \ gxs/rsgenexchange.cc \ gxs/rsgxsnetservice.cc \ + gxs/rsgxsnettunnel.cc \ gxs/rsgxsdata.cc \ rsitems/rsgxsitems.cc \ gxs/rsgxsdataaccess.cc \ From 923c383a1312735a9e73580acf4242ec2ba140fc Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Fri, 2 Mar 2018 19:20:56 +0100 Subject: [PATCH 004/138] Add naif URL manipulation class RsUrl Use RsUrl to convert sockaddre_storage from/to string --- libretroshare/src/libretroshare.pro | 6 +- libretroshare/src/util/rsnet.h | 1 + libretroshare/src/util/rsnet_ss.cc | 31 ++-- libretroshare/src/util/rsurl.cc | 258 ++++++++++++++++++++++++++++ libretroshare/src/util/rsurl.h | 101 +++++++++++ 5 files changed, 383 insertions(+), 14 deletions(-) create mode 100644 libretroshare/src/util/rsurl.cc create mode 100644 libretroshare/src/util/rsurl.h diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index c2604fa4a..5ec795d3d 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -550,7 +550,8 @@ HEADERS += util/folderiterator.h \ util/rstime.h \ util/stacktrace.h \ util/rsdeprecate.h \ - util/cxx11retrocompat.h + util/cxx11retrocompat.h \ + util/rsurl.h SOURCES += ft/ftchunkmap.cc \ ft/ftcontroller.cc \ @@ -695,7 +696,8 @@ SOURCES += util/folderiterator.cc \ util/rsrandom.cc \ util/rstickevent.cc \ util/rsrecogn.cc \ - util/rstime.cc + util/rstime.cc \ + util/rsurl.cc upnp_miniupnpc { diff --git a/libretroshare/src/util/rsnet.h b/libretroshare/src/util/rsnet.h index 1d028e991..95887e61a 100644 --- a/libretroshare/src/util/rsnet.h +++ b/libretroshare/src/util/rsnet.h @@ -133,6 +133,7 @@ bool sockaddr_storage_sameip(const struct sockaddr_storage &addr, const struct s // string, std::string sockaddr_storage_tostring(const struct sockaddr_storage &addr); +bool sockaddr_storage_fromString(const std::string& str, sockaddr_storage &addr); std::string sockaddr_storage_familytostring(const struct sockaddr_storage &addr); std::string sockaddr_storage_iptostring(const struct sockaddr_storage &addr); std::string sockaddr_storage_porttostring(const struct sockaddr_storage &addr); diff --git a/libretroshare/src/util/rsnet_ss.cc b/libretroshare/src/util/rsnet_ss.cc index 581fd06e9..65f2f3ee7 100644 --- a/libretroshare/src/util/rsnet_ss.cc +++ b/libretroshare/src/util/rsnet_ss.cc @@ -24,6 +24,8 @@ * */ +#include "util/rsurl.h" + #include #include #include @@ -491,27 +493,32 @@ bool sockaddr_storage_sameip(const struct sockaddr_storage &addr, const struct s std::string sockaddr_storage_tostring(const struct sockaddr_storage &addr) { - std::string output; - output += sockaddr_storage_familytostring(addr); + RsUrl url; switch(addr.ss_family) { case AF_INET: - output += "="; - output += sockaddr_storage_iptostring(addr); - output += ":"; - output += sockaddr_storage_porttostring(addr); + url.setScheme("ipv4"); break; case AF_INET6: - output += "=["; - output += sockaddr_storage_iptostring(addr); - output += "]:"; - output += sockaddr_storage_porttostring(addr); + url.setScheme("ipv6"); break; default: - break; + return "INVALID_IP"; } - return output; + + url.setHost(sockaddr_storage_iptostring(addr)) + .setPort(sockaddr_storage_port(addr)); + + return url.toString(); +} + +bool sockaddr_storage_fromString(const std::string& str, sockaddr_storage &addr) +{ + RsUrl url(str); + bool valid = sockaddr_storage_inet_pton(addr, url.host()); + if(url.hasPort()) sockaddr_storage_setport(addr, url.port()); + return valid; } void sockaddr_storage_dump(const sockaddr_storage & addr, std::string * outputString) diff --git a/libretroshare/src/util/rsurl.cc b/libretroshare/src/util/rsurl.cc new file mode 100644 index 000000000..31922abbf --- /dev/null +++ b/libretroshare/src/util/rsurl.cc @@ -0,0 +1,258 @@ +/* + * RetroShare + * Copyright (C) 2018 Gioacchino Mazzurco + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +//#include "util/rsurl.h" +#include "rsurl.h" + +#include +#include +#include +#include +#include + +using namespace std; + +RsUrl::RsUrl() : mPort(0), mHasPort(false) {} + +RsUrl::RsUrl(const std::string& urlStr) : mPort(0), mHasPort(false) +{ fromString(urlStr); } + +RsUrl& RsUrl::fromString(const std::string& urlStr) +{ + size_t urlSize = urlStr.size(); + + size_t schemeEndI = urlStr.find(schemeSeparator); + if(schemeEndI == string::npos) + { + mScheme = urlStr; + return *this; + } + + mScheme = urlStr.substr(0, schemeEndI); + + size_t hostBeginI = schemeEndI + 3; + if(hostBeginI >= urlSize) return *this; + + bool hasSquareBr = (urlStr[hostBeginI] == ipv6WrapOpen[0]); + size_t hostEndI; + if(hasSquareBr) + { + if(++hostBeginI >= urlSize) return *this; + hostEndI = urlStr.find(ipv6WrapClose, hostBeginI); + mHost = urlStr.substr(hostBeginI, hostEndI - hostBeginI - 1); + } + else + { + hostEndI = urlStr.find(pathSeparator, hostBeginI); + hostEndI = min(hostEndI, urlStr.find(portSeparator, hostBeginI)); + hostEndI = min(hostEndI, urlStr.find(querySeparator, hostBeginI)); + hostEndI = min(hostEndI, urlStr.find(fragmentSeparator, hostBeginI)); + + mHost = urlStr.substr(hostBeginI, hostEndI - hostBeginI); + if(hostEndI == string::npos) return *this; + } + + mHasPort = (sscanf(&urlStr[hostEndI], ":%hu", &mPort) == 1); + + size_t pathBeginI = urlStr.find(pathSeparator, hostEndI); + size_t pathEndI = string::npos; + if(pathBeginI != string::npos) + { + pathEndI = urlStr.find(querySeparator, pathBeginI); + pathEndI = min(pathEndI, urlStr.find(fragmentSeparator, pathBeginI)); + mPath = UrlDecode(urlStr.substr(pathBeginI, pathEndI - pathBeginI)); + if(pathEndI == string::npos) return *this; + } + + size_t queryBeginI = urlStr.find(querySeparator, schemeEndI); + size_t queryEndI = urlStr.find(fragmentSeparator, schemeEndI); + if(queryBeginI != string::npos) + { + string qStr = urlStr.substr(queryBeginI+1, queryEndI-queryBeginI-1); + + size_t kPos = 0; + size_t assPos = qStr.find(queryAssign); + do + { + size_t vEndPos = qStr.find(queryFieldSep, assPos); + mQuery.insert( std::make_pair( qStr.substr(kPos, assPos-kPos), + UrlDecode(qStr.substr(assPos+1, vEndPos-assPos-1)) + ) ); + kPos = vEndPos+1; + assPos = qStr.find(queryAssign, vEndPos); + } + while(assPos != string::npos); + + if(queryEndI == string::npos) return *this; + } + + size_t fragmentBeginI = urlStr.find(fragmentSeparator, schemeEndI); + if(fragmentBeginI != string::npos) + mFragment = UrlDecode(urlStr.substr(++fragmentBeginI)); +} + +std::string RsUrl::toString() const +{ + std::string urlStr(mScheme); + urlStr += schemeSeparator; + + if(!mHost.empty()) + { + if(mHost.find(ipv6Separator) != string::npos && + mHost[0] != ipv6WrapOpen[0] ) + urlStr += ipv6WrapOpen + mHost + ipv6WrapClose; + else urlStr += mHost; + } + + if(mHasPort) urlStr += portSeparator + std::to_string(mPort); + + urlStr += UrlEncode(mPath, pathSeparator); + + bool hasQuery = !mQuery.empty(); + if(hasQuery) urlStr += querySeparator; + for(auto&& kv : mQuery) + { + urlStr += kv.first; + urlStr += queryAssign; + urlStr += UrlEncode(kv.second); + urlStr += queryFieldSep; + } + if(hasQuery) urlStr.pop_back(); + + if(!mFragment.empty()) urlStr += fragmentSeparator + UrlEncode(mFragment); + + return urlStr; +} + +const std::string& RsUrl::scheme() const { return mScheme; } +RsUrl& RsUrl::setScheme(const std::string& scheme) +{ + mScheme = scheme; + return *this; +} + +const std::string& RsUrl::host() const { return mHost; } +RsUrl& RsUrl::setHost(const std::string& host) +{ + mHost = host; + return *this; +} + +bool RsUrl::hasPort() const { return mHasPort; } + +uint16_t RsUrl::port(uint16_t def) const +{ + if(mHasPort) return mPort; + return def; +} + +RsUrl& RsUrl::setPort(uint16_t port) +{ + mPort = port; + return *this; +} + +const std::string& RsUrl::path() const { return mPath; } +RsUrl& RsUrl::setPath(const std::string& path) +{ + mPath = path; + return *this; +} + +const std::map& RsUrl::query() const +{ return mQuery; } +RsUrl& RsUrl::setQuery(const std::map& query) +{ + mQuery = query; + return *this; +} +RsUrl& RsUrl::setQueryKV(const std::string& key, const std::string& value) +{ + mQuery.insert(std::make_pair(key, value)); + return *this; +} +RsUrl& RsUrl::delQueryK(const std::string& key) +{ + mQuery.erase(key); + return *this; +} + +const std::string& RsUrl::fragment() const { return mFragment; } +RsUrl& RsUrl::setFragment(const std::string& fragment) +{ + mFragment = fragment; + return *this; +} + +/*static*/ std::string RsUrl::UrlEncode( const std::string& str, + const std::string& ignore ) +{ + ostringstream escaped; + escaped.fill('0'); + escaped << hex; + + for (string::value_type c : str) + { + // Keep alphanumeric and other accepted characters intact + if ( isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~' + || ignore.find(c) != string::npos ) + { + escaped << c; + continue; + } + + // Any other characters are percent-encoded + escaped << uppercase; + escaped << '%' << setw(2) << int((unsigned char) c); + escaped << nouppercase; + } + + return escaped.str(); +} + +/*static*/ std::string RsUrl::UrlDecode(const std::string& str) +{ + ostringstream decoded; + + size_t len = str.size(); + size_t boundary = len-2; // % Encoded char must be at least 2 hex char + for (size_t i = 0; i < len; ++i) + { + + if(str[i] == '%' && i < boundary) + { + decoded << static_cast(stoi(str.substr(++i, 2), 0, 16)); + ++i; + } + else decoded << str[i]; + } + + return decoded.str(); +} + +/*static*/ const std::string RsUrl::schemeSeparator("://"); +/*static*/ const std::string RsUrl::ipv6WrapOpen("["); +/*static*/ const std::string RsUrl::ipv6Separator(":"); +/*static*/ const std::string RsUrl::ipv6WrapClose("]"); +/*static*/ const std::string RsUrl::portSeparator(":"); +/*static*/ const std::string RsUrl::pathSeparator("/"); +/*static*/ const std::string RsUrl::querySeparator("?"); +/*static*/ const std::string RsUrl::queryAssign("="); +/*static*/ const std::string RsUrl::queryFieldSep("&"); +/*static*/ const std::string RsUrl::fragmentSeparator("#"); + diff --git a/libretroshare/src/util/rsurl.h b/libretroshare/src/util/rsurl.h new file mode 100644 index 000000000..fc9d2992b --- /dev/null +++ b/libretroshare/src/util/rsurl.h @@ -0,0 +1,101 @@ +#pragma once +/* + * RetroShare + * Copyright (C) 2018 Gioacchino Mazzurco + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include + +/** + * Very simplistic and minimal URL helper class for RetroShare, after looking + * for a small and self-contained C/C++ URL parsing and manipulation library, + * haven't found nothing satisfactory except for implementation like QUrl that + * rely on bigger library. + * ATM this implementation is not standard compliant and doesn't aim to be. + * Improvements to this are welcome. + * + * Anyway this should support most common URLs of the form + * scheme://host[:port][/path][?query][#fragment] + */ +struct RsUrl +{ + RsUrl(); + RsUrl(const std::string& urlStr); + + RsUrl& fromString(const std::string& urlStr); + std::string toString() const; + + const std::string& scheme() const; + RsUrl& setScheme(const std::string& scheme); + + const std::string& host() const; + RsUrl& setHost(const std::string& host); + + bool hasPort() const; + uint16_t port(uint16_t def = 0) const; + RsUrl& setPort(uint16_t port); + + const std::string& path() const; + RsUrl& setPath(const std::string& path); + + const std::map& query() const; + RsUrl& setQuery(const std::map& query); + RsUrl& setQueryKV(const std::string& key, const std::string& value); + RsUrl& delQueryK(const std::string& key); + + const std::string& fragment() const; + RsUrl& setFragment(const std::string& fragment); + + static std::string UrlEncode(const std::string& str, + const std::string& ignoreChars = ""); + static std::string UrlDecode(const std::string& str); + + inline bool operator<(const RsUrl& rhs) + { return toString() < rhs.toString(); } + inline bool operator>(const RsUrl& rhs) + { return toString() > rhs.toString(); } + inline bool operator<=(const RsUrl& rhs) + { return toString() <= rhs.toString(); } + inline bool operator>=(const RsUrl& rhs) + { return toString() >= rhs.toString(); } + inline bool operator==(const RsUrl& rhs) + { return toString() == rhs.toString(); } + inline bool operator!=(const RsUrl& rhs) + { return toString() != rhs.toString(); } + + static const std::string schemeSeparator; + static const std::string ipv6WrapOpen; + static const std::string ipv6Separator; + static const std::string ipv6WrapClose; + static const std::string portSeparator; + static const std::string pathSeparator; + static const std::string querySeparator; + static const std::string queryAssign; + static const std::string queryFieldSep; + static const std::string fragmentSeparator; + +private: + + std::string mScheme; + std::string mHost; + uint16_t mPort; + bool mHasPort; + std::string mPath; + std::map mQuery; + std::string mFragment; +}; + From 8542abd4f09e0f63bee6a06ef0b4ad64f6e45b80 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Fri, 2 Mar 2018 20:08:50 +0100 Subject: [PATCH 005/138] Few fixes in RsUrl --- libretroshare/src/util/rsurl.cc | 9 +++++++-- libretroshare/src/util/rsurl.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/util/rsurl.cc b/libretroshare/src/util/rsurl.cc index 31922abbf..3f28a607d 100644 --- a/libretroshare/src/util/rsurl.cc +++ b/libretroshare/src/util/rsurl.cc @@ -154,16 +154,21 @@ RsUrl& RsUrl::setHost(const std::string& host) } bool RsUrl::hasPort() const { return mHasPort; } - uint16_t RsUrl::port(uint16_t def) const { if(mHasPort) return mPort; return def; } - RsUrl& RsUrl::setPort(uint16_t port) { mPort = port; + mHasPort = true; + return *this; +} +RsUrl& RsUrl::unsetPort() +{ + mPort = 0; + mHasPort = false; return *this; } diff --git a/libretroshare/src/util/rsurl.h b/libretroshare/src/util/rsurl.h index fc9d2992b..6125efba5 100644 --- a/libretroshare/src/util/rsurl.h +++ b/libretroshare/src/util/rsurl.h @@ -48,6 +48,7 @@ struct RsUrl bool hasPort() const; uint16_t port(uint16_t def = 0) const; RsUrl& setPort(uint16_t port); + RsUrl& unsetPort(); const std::string& path() const; RsUrl& setPath(const std::string& path); From bed856425fbfe83e0c3dc3e372d73dc3b32d6031 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sat, 3 Mar 2018 00:08:56 +0100 Subject: [PATCH 006/138] Share additional addresses via RsCertificate --- libresapi/src/api/PeersHandler.cpp | 5 + libretroshare/src/pgp/rscertificate.cc | 235 ++++++++++-------- libretroshare/src/pgp/rscertificate.h | 25 +- libretroshare/src/pqi/p3peermgr.cc | 62 ++++- libretroshare/src/pqi/p3peermgr.h | 2 + libretroshare/src/retroshare/rspeers.h | 2 + libretroshare/src/rsserver/p3peers.cc | 16 +- libretroshare/src/rsserver/p3peers.h | 4 +- libretroshare/src/util/rsnet_ss.cc | 11 +- libretroshare/src/util/rsurl.cc | 34 +-- libretroshare/src/util/rsurl.h | 12 +- retroshare-gui/src/gui/common/FriendList.cpp | 4 + .../src/gui/connect/ConnectFriendWizard.cpp | 4 + 13 files changed, 267 insertions(+), 149 deletions(-) diff --git a/libresapi/src/api/PeersHandler.cpp b/libresapi/src/api/PeersHandler.cpp index 66def7eab..f812a54f4 100644 --- a/libresapi/src/api/PeersHandler.cpp +++ b/libresapi/src/api/PeersHandler.cpp @@ -727,6 +727,11 @@ void PeersHandler::handleWildcard(Request &req, Response &resp) peerDetails.localPort ); if (!peerDetails.dyndns.empty()) mRsPeers->setDynDNS(peerDetails.id, peerDetails.dyndns); + for(auto&& ipr : peerDetails.ipAddressList) + mRsPeers->addPeerLocator( + peerDetails.id, + RsUrl(ipr.substr(0, ipr.find(' '))) ); + } } while(false); diff --git a/libretroshare/src/pgp/rscertificate.cc b/libretroshare/src/pgp/rscertificate.cc index 70a00328f..08ea78a31 100644 --- a/libretroshare/src/pgp/rscertificate.cc +++ b/libretroshare/src/pgp/rscertificate.cc @@ -1,3 +1,23 @@ +/* + * RetroShare + * + * Copyright (C) 2012-2014 Cyril Soler + * Copyright (C) 2018 Gioacchino Mazzurco + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + #include #include #include @@ -11,25 +31,21 @@ //#define DEBUG_RSCERTIFICATE -static const std::string PGP_CERTIFICATE_START ( "-----BEGIN PGP PUBLIC KEY BLOCK-----" ); -static const std::string PGP_CERTIFICATE_END ( "-----END PGP PUBLIC KEY BLOCK-----" ); -static const std::string EXTERNAL_IP_BEGIN_SECTION ( "--EXT--" ); -static const std::string LOCAL_IP_BEGIN_SECTION ( "--LOCAL--" ); -static const std::string SSLID_BEGIN_SECTION ( "--SSLID--" ); -static const std::string LOCATION_BEGIN_SECTION ( "--LOCATION--" ); -static const std::string HIDDEN_NODE_BEGIN_SECTION ( "--HIDDEN--" ); +static const uint8_t CERTIFICATE_VERSION_06 = 0x06; -static const uint8_t CERTIFICATE_PTAG_PGP_SECTION = 0x01 ; -static const uint8_t CERTIFICATE_PTAG_EXTIPANDPORT_SECTION = 0x02 ; -static const uint8_t CERTIFICATE_PTAG_LOCIPANDPORT_SECTION = 0x03 ; -static const uint8_t CERTIFICATE_PTAG_DNS_SECTION = 0x04 ; -static const uint8_t CERTIFICATE_PTAG_SSLID_SECTION = 0x05 ; -static const uint8_t CERTIFICATE_PTAG_NAME_SECTION = 0x06 ; -static const uint8_t CERTIFICATE_PTAG_CHECKSUM_SECTION = 0x07 ; -static const uint8_t CERTIFICATE_PTAG_HIDDENNODE_SECTION = 0x08 ; -static const uint8_t CERTIFICATE_PTAG_VERSION_SECTION = 0x09 ; - -static const uint8_t CERTIFICATE_VERSION_06 = 0x06 ; +enum CertificatePtag : uint8_t +{ + CERTIFICATE_PTAG_PGP_SECTION = 0x01, + CERTIFICATE_PTAG_EXTIPANDPORT_SECTION = 0x02, + CERTIFICATE_PTAG_LOCIPANDPORT_SECTION = 0x03, + CERTIFICATE_PTAG_DNS_SECTION = 0x04, + CERTIFICATE_PTAG_SSLID_SECTION = 0x05, + CERTIFICATE_PTAG_NAME_SECTION = 0x06, + CERTIFICATE_PTAG_CHECKSUM_SECTION = 0x07, + CERTIFICATE_PTAG_HIDDENNODE_SECTION = 0x08, + CERTIFICATE_PTAG_VERSION_SECTION = 0x09, + CERTIFICATE_PTAG_EXTRA_LOCATOR = 10 +}; static bool is_acceptable_radix64Char(char c) { @@ -95,6 +111,14 @@ std::string RsCertificate::toStdString() const addPacket( CERTIFICATE_PTAG_NAME_SECTION , (unsigned char *)location_name.c_str() ,location_name.length() , buf, p, BS ) ; addPacket( CERTIFICATE_PTAG_SSLID_SECTION , location_id.toByteArray() ,location_id.SIZE_IN_BYTES, buf, p, BS ) ; + + for (const RsUrl& locator : mLocators) + { + std::string urlStr(locator.toString()); + addPacket( CERTIFICATE_PTAG_EXTRA_LOCATOR, + (unsigned char *) urlStr.c_str(), urlStr.size(), + buf, p, BS ); + } } uint32_t computed_crc = PGPKeyManagement::compute24bitsCRC(buf,p) ; @@ -195,7 +219,10 @@ RsCertificate::RsCertificate(const RsPeerDetails& Detail, const unsigned char *b memset(ipv4_external_ip_and_port,0,6) ; } - dns_name = Detail.dyndns ; + dns_name = Detail.dyndns; + + for(auto&& ipr : Detail.ipAddressList) + mLocators.insert(RsUrl(ipr.substr(0, ipr.find(' ')))); } } else @@ -254,19 +281,19 @@ bool RsCertificate::initFromString(const std::string& instr,uint32_t& err_code) std::vector bf = Radix64::decode(str) ; size_t size = bf.size(); - bool checksum_check_passed = false ; - unsigned char *buf = bf.data() ; - size_t total_s = 0 ; - only_pgp = true ; - uint8_t certificate_version = 0x00 ; + bool checksum_check_passed = false; + unsigned char *buf = bf.data(); + size_t total_s = 0; + only_pgp = true; + uint8_t certificate_version = 0x00; while(total_s < size) { uint8_t ptag = buf[0]; - buf = &buf[1] ; + buf = &buf[1]; - unsigned char *buf2 = buf ; - uint32_t s = PGPKeyParser::read_125Size(buf) ; + unsigned char *buf2 = buf; + uint32_t s = PGPKeyParser::read_125Size(buf); total_s += 1 + ((unsigned long)buf-(unsigned long)buf2) ; @@ -281,90 +308,80 @@ bool RsCertificate::initFromString(const std::string& instr,uint32_t& err_code) #endif switch(ptag) { - case CERTIFICATE_PTAG_VERSION_SECTION: certificate_version = buf[0] ; - buf = &buf[s] ; - break ; - - - case CERTIFICATE_PTAG_PGP_SECTION: binary_pgp_key = new unsigned char[s] ; - memcpy(binary_pgp_key,buf,s) ; - binary_pgp_key_size = s ; - buf = &buf[s] ; - break ; - - case CERTIFICATE_PTAG_NAME_SECTION: location_name = std::string((char *)buf,s) ; - buf = &buf[s] ; - break ; - - case CERTIFICATE_PTAG_SSLID_SECTION: - if(s != location_id.SIZE_IN_BYTES) - { - err_code = CERTIFICATE_PARSING_ERROR_INVALID_LOCATION_ID ; - return false ; - } - - location_id = RsPeerId(buf) ; - buf = &buf[s] ; - only_pgp = false ; - break ; - - case CERTIFICATE_PTAG_DNS_SECTION: dns_name = std::string((char *)buf,s) ; - buf = &buf[s] ; - break ; - - case CERTIFICATE_PTAG_HIDDENNODE_SECTION: - hidden_node_address = std::string((char *)buf,s); - hidden_node = true; - buf = &buf[s]; - - break ; - - case CERTIFICATE_PTAG_LOCIPANDPORT_SECTION: - if(s != 6) - - { - err_code = CERTIFICATE_PARSING_ERROR_INVALID_LOCAL_IP; - return false ; - } - - memcpy(ipv4_internal_ip_and_port,buf,s) ; - buf = &buf[s] ; - break ; - case CERTIFICATE_PTAG_EXTIPANDPORT_SECTION: - if(s != 6) - { - err_code = CERTIFICATE_PARSING_ERROR_INVALID_EXTERNAL_IP; - return false ; - } - - memcpy(ipv4_external_ip_and_port,buf,s) ; - buf = &buf[s] ; - break ; - case CERTIFICATE_PTAG_CHECKSUM_SECTION: - { - if(s != 3 || total_s+3 != size) - { - err_code = CERTIFICATE_PARSING_ERROR_INVALID_CHECKSUM_SECTION ; - return false ; - } - uint32_t computed_crc = PGPKeyManagement::compute24bitsCRC(bf.data(),size-5) ; - uint32_t certificate_crc = buf[0] + (buf[1] << 8) + (buf[2] << 16) ; - - if(computed_crc != certificate_crc) - { - err_code = CERTIFICATE_PARSING_ERROR_CHECKSUM_ERROR ; - return false ; - } - else - checksum_check_passed = true ; - } - break ; - default: - std::cerr << "(WW) unknwown PTAG 0x" << std::hex << ptag << std::dec << " in certificate! Ignoring it." << std::endl; - buf = &buf[s] ; - break ; + case CERTIFICATE_PTAG_VERSION_SECTION: + certificate_version = buf[0]; + break; + case CERTIFICATE_PTAG_PGP_SECTION: + binary_pgp_key = new unsigned char[s]; + memcpy(binary_pgp_key,buf,s); + binary_pgp_key_size = s; + break; + case CERTIFICATE_PTAG_NAME_SECTION: + location_name = std::string((char *)buf,s); + break; + case CERTIFICATE_PTAG_SSLID_SECTION: + if(s != location_id.SIZE_IN_BYTES) + { + err_code = CERTIFICATE_PARSING_ERROR_INVALID_LOCATION_ID; + return false; + } + location_id = RsPeerId(buf); + only_pgp = false; + break; + case CERTIFICATE_PTAG_DNS_SECTION: + dns_name = std::string((char *)buf,s); + break; + case CERTIFICATE_PTAG_HIDDENNODE_SECTION: + hidden_node_address = std::string((char *)buf,s); + hidden_node = true; + break; + case CERTIFICATE_PTAG_LOCIPANDPORT_SECTION: + if(s != 6) + { + err_code = CERTIFICATE_PARSING_ERROR_INVALID_LOCAL_IP; + return false; + } + memcpy(ipv4_internal_ip_and_port,buf,s); + break; + case CERTIFICATE_PTAG_EXTIPANDPORT_SECTION: + if(s != 6) + { + err_code = CERTIFICATE_PARSING_ERROR_INVALID_EXTERNAL_IP; + return false; + } + memcpy(ipv4_external_ip_and_port,buf,s); + break; + case CERTIFICATE_PTAG_CHECKSUM_SECTION: + { + if(s != 3 || total_s+3 != size) + { + err_code = + CERTIFICATE_PARSING_ERROR_INVALID_CHECKSUM_SECTION; + return false; + } + uint32_t computed_crc = + PGPKeyManagement::compute24bitsCRC(bf.data(),size-5); + uint32_t certificate_crc = + buf[0] + (buf[1] << 8) + (buf[2] << 16); + if(computed_crc != certificate_crc) + { + err_code = CERTIFICATE_PARSING_ERROR_CHECKSUM_ERROR; + return false; + } + else checksum_check_passed = true; + break; + } + case CERTIFICATE_PTAG_EXTRA_LOCATOR: + mLocators.insert(RsUrl(std::string((char *)buf, s))); + break; + default: + std::cerr << "(WW) unknwown PTAG 0x" << std::hex << ptag + << std::dec << " in certificate! Ignoring it." + << std::endl; + break; } + buf = &buf[s]; total_s += s ; } diff --git a/libretroshare/src/pgp/rscertificate.h b/libretroshare/src/pgp/rscertificate.h index a70a1752f..131652d0a 100644 --- a/libretroshare/src/pgp/rscertificate.h +++ b/libretroshare/src/pgp/rscertificate.h @@ -1,7 +1,28 @@ #pragma once +/* + * RetroShare + * + * Copyright (C) 2012-2014 Cyril Soler + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +#include "retroshare/rstypes.h" +#include "util/rsurl.h" + +#include #include -#include class RsPeerDetails ; @@ -42,6 +63,7 @@ class RsCertificate size_t pgp_key_size() const { return binary_pgp_key_size ; } static bool cleanCertificate(const std::string& input, std::string& output, RsCertificate::Format& format, int& error_code, bool check_content) ; + const std::set& locators() const { return mLocators; } private: static bool cleanCertificate(const std::string& input,std::string& output,int&) ; // new radix format @@ -69,6 +91,7 @@ class RsCertificate std::string pgp_version ; std::string dns_name ; std::string hidden_node_address; + std::set mLocators; bool only_pgp ; // does the cert contain only pgp info? bool hidden_node; // IP or hidden Node Address. diff --git a/libretroshare/src/pqi/p3peermgr.cc b/libretroshare/src/pqi/p3peermgr.cc index 1927b457e..09758c266 100644 --- a/libretroshare/src/pqi/p3peermgr.cc +++ b/libretroshare/src/pqi/p3peermgr.cc @@ -1363,16 +1363,63 @@ bool p3PeerMgrIMPL::UpdateOwnAddress( const sockaddr_storage& pLocalAddr, } +bool p3PeerMgrIMPL::addPeerLocator(const RsPeerId &sslId, const RsUrl& locator) +{ + std::string host(locator.host()); + pqiIpAddress ip; + if(!locator.hasPort() || host.empty() || + !sockaddr_storage_inet_pton(ip.mAddr, host) || + !sockaddr_storage_setport(ip.mAddr, locator.port())) return false; + ip.mSeenTime = time(NULL); + bool changed = false; -bool p3PeerMgrIMPL::setLocalAddress(const RsPeerId &id, const struct sockaddr_storage &addr) + if (sslId == AuthSSL::getAuthSSL()->OwnId()) + { + RS_STACK_MUTEX(mPeerMtx); + changed = mOwnState.ipAddrs.updateLocalAddrs(ip); + } + else + { + RS_STACK_MUTEX(mPeerMtx); + auto it = mFriendList.find(sslId); + if (it == mFriendList.end()) + { + it = mOthersList.find(sslId); + if (it == mOthersList.end()) + { +#ifdef PEER_DEBUG + std::cerr << __PRETTY_FUNCTION__ << "cannot add address " + << "info, peer id: " << sslId << " not found in list" + << std::endl; +#endif + return false; + } + } + + changed = it->second.ipAddrs.updateLocalAddrs(ip); + } + + if (changed) + { +#ifdef PEER_DEBUG + std::cerr << __PRETTY_FUNCTION__ << " Added locator: " + << locator.toString() << std::endl; +#endif + IndicateConfigChanged(); + } + return changed; +} + +bool p3PeerMgrIMPL::setLocalAddress( const RsPeerId &id, + const sockaddr_storage &addr ) { bool changed = false; if (id == AuthSSL::getAuthSSL()->OwnId()) { { - RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ + RS_STACK_MUTEX(mPeerMtx); if (!sockaddr_storage_same(mOwnState.localaddr, addr)) { mOwnState.localaddr = addr; @@ -1390,7 +1437,7 @@ bool p3PeerMgrIMPL::setLocalAddress(const RsPeerId &id, const struct sockaddr return changed; } - RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ + RS_STACK_MUTEX(mPeerMtx); /* check if it is a friend */ std::map::iterator it; if (mFriendList.end() == (it = mFriendList.find(id))) @@ -1398,7 +1445,9 @@ bool p3PeerMgrIMPL::setLocalAddress(const RsPeerId &id, const struct sockaddr if (mOthersList.end() == (it = mOthersList.find(id))) { #ifdef PEER_DEBUG - std::cerr << "p3PeerMgrIMPL::setLocalAddress() cannot add addres info : peer id not found in friend list id: " << id << std::endl; + std::cerr << "p3PeerMgrIMPL::setLocalAddress() cannot add addres " + << "info : peer id not found in friend list id: " + << id << std::endl; #endif return false; } @@ -1419,10 +1468,7 @@ bool p3PeerMgrIMPL::setLocalAddress(const RsPeerId &id, const struct sockaddr it->second.updateIpAddressList(ipAddressTimed); #endif - if (changed) { - IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/ - } - + if (changed) IndicateConfigChanged(); return changed; } diff --git a/libretroshare/src/pqi/p3peermgr.h b/libretroshare/src/pqi/p3peermgr.h index 8a0ac5235..390030893 100644 --- a/libretroshare/src/pqi/p3peermgr.h +++ b/libretroshare/src/pqi/p3peermgr.h @@ -163,6 +163,7 @@ virtual bool assignPeersToGroup(const RsNodeGroupId &groupId, const std::list * 3) p3disc - reasonable */ + virtual bool addPeerLocator(const RsPeerId &ssl_id, const RsUrl& locator) = 0; virtual bool setLocalAddress(const RsPeerId &id, const struct sockaddr_storage &addr) = 0; virtual bool setExtAddress(const RsPeerId &id, const struct sockaddr_storage &addr) = 0; virtual bool setDynDNS(const RsPeerId &id, const std::string &dyndns) = 0; @@ -277,6 +278,7 @@ public: * 3) p3disc - reasonable */ + virtual bool addPeerLocator(const RsPeerId &ssl_id, const RsUrl& locator); virtual bool setLocalAddress(const RsPeerId &id, const struct sockaddr_storage &addr); virtual bool setExtAddress(const RsPeerId &id, const struct sockaddr_storage &addr); virtual bool setDynDNS(const RsPeerId &id, const std::string &dyndns); diff --git a/libretroshare/src/retroshare/rspeers.h b/libretroshare/src/retroshare/rspeers.h index f1b274d09..89131e8bf 100644 --- a/libretroshare/src/retroshare/rspeers.h +++ b/libretroshare/src/retroshare/rspeers.h @@ -33,6 +33,7 @@ #include #include #include +#include "util/rsurl.h" /* The Main Interface Class - for information about your Peers * A peer is another RS instance, means associated with an SSL certificate @@ -370,6 +371,7 @@ public: virtual bool setHiddenNode(const RsPeerId &id, const std::string &address, uint16_t port) = 0; virtual bool isHiddenNode(const RsPeerId &id) = 0; + virtual bool addPeerLocator(const RsPeerId &ssl_id, const RsUrl& locator) = 0; virtual bool setLocalAddress(const RsPeerId &ssl_id, const std::string &addr, uint16_t port) = 0; virtual bool setExtAddress( const RsPeerId &ssl_id, const std::string &addr, uint16_t port) = 0; virtual bool setDynDNS(const RsPeerId &id, const std::string &addr) = 0; diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index 52f6c3dba..10fa0e9e9 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -904,6 +904,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) { @@ -1148,11 +1151,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 +1196,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; diff --git a/libretroshare/src/rsserver/p3peers.h b/libretroshare/src/rsserver/p3peers.h index 4f9b661d7..43d45f8a7 100644 --- a/libretroshare/src/rsserver/p3peers.h +++ b/libretroshare/src/rsserver/p3peers.h @@ -36,6 +36,7 @@ #endif #include "retroshare/rspeers.h" +#include "util/rsurl.h" class p3LinkMgr; class p3PeerMgr; @@ -96,7 +97,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); diff --git a/libretroshare/src/util/rsnet_ss.cc b/libretroshare/src/util/rsnet_ss.cc index 65f2f3ee7..bc6d4bafb 100644 --- a/libretroshare/src/util/rsnet_ss.cc +++ b/libretroshare/src/util/rsnet_ss.cc @@ -192,8 +192,7 @@ bool sockaddr_storage_copyip(struct sockaddr_storage &dst, const struct sockaddr uint16_t sockaddr_storage_port(const struct sockaddr_storage &addr) { #ifdef SS_DEBUG - std::cerr << "sockaddr_storage_port()"; - std::cerr << std::endl; + std::cerr << "sockaddr_storage_port()" << std::endl; #endif switch(addr.ss_family) { @@ -203,8 +202,10 @@ uint16_t sockaddr_storage_port(const struct sockaddr_storage &addr) return sockaddr_storage_ipv6_port(addr); default: std::cerr << "sockaddr_storage_port() invalid addr.ss_family" << std::endl; +#ifdef SS_DEBUG sockaddr_storage_dump(addr); print_stacktrace(); +#endif break; } return 0; @@ -504,7 +505,7 @@ std::string sockaddr_storage_tostring(const struct sockaddr_storage &addr) url.setScheme("ipv6"); break; default: - return "INVALID_IP"; + return "AF_INVALID"; } url.setHost(sockaddr_storage_iptostring(addr)) @@ -613,9 +614,11 @@ std::string sockaddr_storage_iptostring(const struct sockaddr_storage &addr) break; default: output = "INVALID_IP"; - std::cerr << __PRETTY_FUNCTION__ << " Got invalid IP:" << std::endl; + std::cerr << __PRETTY_FUNCTION__ << " Got invalid IP!" << std::endl; +#ifdef SS_DEBUG sockaddr_storage_dump(addr); print_stacktrace(); +#endif break; } return output; diff --git a/libretroshare/src/util/rsurl.cc b/libretroshare/src/util/rsurl.cc index 3f28a607d..efaab9777 100644 --- a/libretroshare/src/util/rsurl.cc +++ b/libretroshare/src/util/rsurl.cc @@ -34,10 +34,10 @@ RsUrl::RsUrl(const std::string& urlStr) : mPort(0), mHasPort(false) RsUrl& RsUrl::fromString(const std::string& urlStr) { - size_t urlSize = urlStr.size(); + size_t endI = urlStr.size()-1; size_t schemeEndI = urlStr.find(schemeSeparator); - if(schemeEndI == string::npos) + if(schemeEndI >= endI) { mScheme = urlStr; return *this; @@ -46,15 +46,16 @@ RsUrl& RsUrl::fromString(const std::string& urlStr) mScheme = urlStr.substr(0, schemeEndI); size_t hostBeginI = schemeEndI + 3; - if(hostBeginI >= urlSize) return *this; + if(hostBeginI >= endI) return *this; bool hasSquareBr = (urlStr[hostBeginI] == ipv6WrapOpen[0]); size_t hostEndI; if(hasSquareBr) { - if(++hostBeginI >= urlSize) return *this; + if(++hostBeginI >= endI) return *this; hostEndI = urlStr.find(ipv6WrapClose, hostBeginI); mHost = urlStr.substr(hostBeginI, hostEndI - hostBeginI - 1); + ++hostEndI; } else { @@ -64,24 +65,25 @@ RsUrl& RsUrl::fromString(const std::string& urlStr) hostEndI = min(hostEndI, urlStr.find(fragmentSeparator, hostBeginI)); mHost = urlStr.substr(hostBeginI, hostEndI - hostBeginI); - if(hostEndI == string::npos) return *this; } + if( hostEndI >= endI ) return *this; + mHasPort = (sscanf(&urlStr[hostEndI], ":%hu", &mPort) == 1); - size_t pathBeginI = urlStr.find(pathSeparator, hostEndI); + size_t pathBeginI = urlStr.find(pathSeparator, hostBeginI); size_t pathEndI = string::npos; - if(pathBeginI != string::npos) + if(pathBeginI < endI) { pathEndI = urlStr.find(querySeparator, pathBeginI); pathEndI = min(pathEndI, urlStr.find(fragmentSeparator, pathBeginI)); mPath = UrlDecode(urlStr.substr(pathBeginI, pathEndI - pathBeginI)); - if(pathEndI == string::npos) return *this; + if(pathEndI >= endI) return *this; } - size_t queryBeginI = urlStr.find(querySeparator, schemeEndI); - size_t queryEndI = urlStr.find(fragmentSeparator, schemeEndI); - if(queryBeginI != string::npos) + size_t queryBeginI = urlStr.find(querySeparator, hostBeginI); + size_t queryEndI = urlStr.find(fragmentSeparator, hostBeginI); + if(queryBeginI < endI) { string qStr = urlStr.substr(queryBeginI+1, queryEndI-queryBeginI-1); @@ -96,14 +98,16 @@ RsUrl& RsUrl::fromString(const std::string& urlStr) kPos = vEndPos+1; assPos = qStr.find(queryAssign, vEndPos); } - while(assPos != string::npos); + while(assPos < endI); - if(queryEndI == string::npos) return *this; + if(queryEndI >= endI) return *this; } - size_t fragmentBeginI = urlStr.find(fragmentSeparator, schemeEndI); - if(fragmentBeginI != string::npos) + size_t fragmentBeginI = urlStr.find(fragmentSeparator, hostBeginI); + if(fragmentBeginI < endI) mFragment = UrlDecode(urlStr.substr(++fragmentBeginI)); + + return *this; } std::string RsUrl::toString() const diff --git a/libretroshare/src/util/rsurl.h b/libretroshare/src/util/rsurl.h index 6125efba5..49215ffa4 100644 --- a/libretroshare/src/util/rsurl.h +++ b/libretroshare/src/util/rsurl.h @@ -65,17 +65,17 @@ struct RsUrl const std::string& ignoreChars = ""); static std::string UrlDecode(const std::string& str); - inline bool operator<(const RsUrl& rhs) + inline bool operator<(const RsUrl& rhs) const { return toString() < rhs.toString(); } - inline bool operator>(const RsUrl& rhs) + inline bool operator>(const RsUrl& rhs) const { return toString() > rhs.toString(); } - inline bool operator<=(const RsUrl& rhs) + inline bool operator<=(const RsUrl& rhs) const { return toString() <= rhs.toString(); } - inline bool operator>=(const RsUrl& rhs) + inline bool operator>=(const RsUrl& rhs) const { return toString() >= rhs.toString(); } - inline bool operator==(const RsUrl& rhs) + inline bool operator==(const RsUrl& rhs) const { return toString() == rhs.toString(); } - inline bool operator!=(const RsUrl& rhs) + inline bool operator!=(const RsUrl& rhs) const { return toString() != rhs.toString(); } static const std::string schemeSeparator; diff --git a/retroshare-gui/src/gui/common/FriendList.cpp b/retroshare-gui/src/gui/common/FriendList.cpp index 726bf61ea..fb62ff010 100644 --- a/retroshare-gui/src/gui/common/FriendList.cpp +++ b/retroshare-gui/src/gui/common/FriendList.cpp @@ -2067,6 +2067,10 @@ bool FriendList::importFriendlist(QString &fileName, bool &errorPeers, bool &err rsPeers->setDynDNS(rsPeerDetails.id, rsPeerDetails.dyndns); if (!rsPeerDetails.location.empty()) rsPeers->setLocation(rsPeerDetails.id, rsPeerDetails.location); + for(auto&& ipr : rsPeerDetails.ipAddressList) + rsPeers->addPeerLocator( + rsPeerDetails.id, + RsUrl(ipr.substr(0, ipr.find(' '))) ); } } else if (!rsPeerDetails.gpg_id.isNull()) { // only pgp id is avaiable diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index 15b2f504f..2d994917c 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -974,6 +974,10 @@ void ConnectFriendWizard::accept() std::cerr << "ConnectFriendWizard::accept() : setting DynDNS." << std::endl; rsPeers->setDynDNS(peerDetails.id, peerDetails.dyndns); } + for(auto&& ipr : peerDetails.ipAddressList) + rsPeers->addPeerLocator( + peerDetails.id, + RsUrl(ipr.substr(0, ipr.find(' '))) ); } } From 9fbf56e592333d7cb364347ed0ae723ede09ace3 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sat, 3 Mar 2018 01:55:49 +0100 Subject: [PATCH 007/138] Remove outdated misleading comment --- libretroshare/src/pqi/p3netmgr.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libretroshare/src/pqi/p3netmgr.cc b/libretroshare/src/pqi/p3netmgr.cc index 7ca1713f7..1daf78e45 100644 --- a/libretroshare/src/pqi/p3netmgr.cc +++ b/libretroshare/src/pqi/p3netmgr.cc @@ -1119,12 +1119,7 @@ bool p3NetMgrIMPL::checkNetAddress() #ifdef NETMGR_DEBUG std::cerr << "p3NetMgrIMPL::checkNetAddress() Correcting Port to DEFAULT" << std::endl; #endif - // Generate a default port from SSL id. The port will always be the - // same, but appear random from peer to peer. - // Random port avoids clashes, improves anonymity. - // - - int new_port = htons(PQI_MIN_PORT_RNG + (RSRandom::random_u32() % (PQI_MAX_PORT - PQI_MIN_PORT_RNG))); + uint16_t new_port = htons(PQI_MIN_PORT_RNG + (RSRandom::random_u32() % (PQI_MAX_PORT - PQI_MIN_PORT_RNG))); sockaddr_storage_setport(mLocalAddr, new_port); addrChanged = true; From 076309133b5c0e5ddccce75d132a06f7c012d06d Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 15 Mar 2018 17:46:21 +0100 Subject: [PATCH 008/138] basic structure of GxsNetTunnelService --- libretroshare/src/gxs/rsgxsnettunnel.cc | 175 ++++++++++++++++++++++ libretroshare/src/gxs/rsgxsnettunnel.h | 85 +++++++---- libretroshare/src/gxstunnel/p3gxstunnel.h | 2 +- 3 files changed, 231 insertions(+), 31 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index e69de29bb..1e0e83cf7 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -0,0 +1,175 @@ +/* + * libretroshare/src/gxs: rsgxsnettunnel.cc + * + * General Data service, interface for RetroShare. + * + * Copyright 2018-2018 by Cyril Soler + * + * 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.project@gmail.com" + * + */ + +#include "rsgxsnettunnel.h" + +#define DEBUG_RSGXSNETTUNNEL 1 + +#define NOT_IMPLEMENTED() { std::cerr << __PRETTY_FUNCTION__ << ": not yet implemented." << std::endl; } + +RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") {} + +bool RsGxsNetTunnelService::manage(const RsGxsGroupId& group_id) +{ + RsFileHash hash = calculateGroupHash(group_id) ; + + RsStackMutex stack(mGxsNetTunnelMtx); /********** STACK LOCKED MTX ******/ + + RsGxsNetTunnelGroupInfo& info(mClientGroups[group_id]) ; + + time_t now = time(NULL) ; + + if(info.group_status == RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE) + return true; + + info.hash = hash ; + info.last_contact = now ; + info.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED; + +#ifdef DEBUG_GXS_TUNNEL + std::cerr << "Starting distant chat to " << to_gxs_id << ", hash = " << hash << ", from " << from_gxs_id << std::endl; + std::cerr << "Asking turtle router to monitor tunnels for hash " << hash << std::endl; +#endif + + // Now ask the turtle router to manage a tunnel for that hash. + + mTurtle->monitorTunnels(hash,this,false) ; + + return true; +} + +bool RsGxsNetTunnelService::release(const RsGxsGroupId& group_id) +{ + RsStackMutex stack(mGxsNetTunnelMtx); /********** STACK LOCKED MTX ******/ + + // Here we need to clean the stuff that was created by this group id. + + auto it = mClientGroups.find(group_id) ; + + if(it == mClientGroups.end()) + { + std::cerr << "RsGxsNetTunnelService::release(): Weird. Cannot release client group " << group_id << " that is not known." << std::endl; + return false ; + } + + mClientGroups.erase(it) ; + return true ; +} + +bool RsGxsNetTunnelService::sendData(const unsigned char *data,uint32_t size,const RsGxsNetTunnelVirtualPeerId& virtual_peer) +{ + // The data is encrypted using chacha20+SHA256 and sent to the turtle router. + + NOT_IMPLEMENTED(); + return false ; +} + +bool RsGxsNetTunnelService::getVirtualPeers(const RsGxsGroupId&, std::list& peers) +{ + // returns the virtual peers for this group + NOT_IMPLEMENTED(); + return false ; +} + +RsGxsNetTunnelVirtualPeerInfo RsGxsNetTunnelService::makeVirtualPeerIdForGroup(const RsGxsGroupId&) const +{ + NOT_IMPLEMENTED(); + return RsGxsNetTunnelVirtualPeerInfo(); +} +void RsGxsNetTunnelService::dump() const +{ + NOT_IMPLEMENTED(); +} + +//===========================================================================================================================================// +// Interaction with Turtle Router // +//===========================================================================================================================================// + +void RsGxsNetTunnelService::connectToTurtleRouter(p3turtle *tr) +{ + mTurtle = tr ; + mTurtle->registerTunnelService(this) ; +} + +bool RsGxsNetTunnelService::handleTunnelRequest(const RsFileHash &hash,const RsPeerId& peer_id) +{ + NOT_IMPLEMENTED(); + return false ; +} +void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) +{ + NOT_IMPLEMENTED(); +} +void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&,RsTurtleGenericTunnelItem::Direction dir) +{ + NOT_IMPLEMENTED(); +} +void RsGxsNetTunnelService::removeVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&) +{ + NOT_IMPLEMENTED(); +} + +RsFileHash RsGxsNetTunnelService::calculateGroupHash(const RsGxsGroupId&) const +{ + NOT_IMPLEMENTED(); + return RsFileHash() ; +} + +//===========================================================================================================================================// +// Service parts // +//===========================================================================================================================================// + +#ifdef TODO +void RsGxsNetTunnelService::handleIncomingItem(const RsGxsTunnelId& tunnel_id,RsGxsTunnelItem *item) +{ + if(item == NULL) + return ; + + // We have 3 things to do: + // + // 1 - if it's a data item, send an ACK + // 2 - if it's an ack item, mark the item as properly received, and remove it from the queue + // 3 - if it's a status item, act accordingly. + + switch(item->PacketSubType()) + { + + case RS_PKT_SUBTYPE_GXS_TUNNEL_DATA: handleRecvTunnelDataItem(tunnel_id,dynamic_cast(item)) ; + break ; + + case RS_PKT_SUBTYPE_GXS_TUNNEL_DATA_ACK: handleRecvTunnelDataAckItem(tunnel_id,dynamic_cast(item)) ; + break ; + + case RS_PKT_SUBTYPE_GXS_TUNNEL_STATUS: handleRecvStatusItem(tunnel_id,dynamic_cast(item)) ; + break ; + + default: + std::cerr << "(EE) impossible situation. DH items should be handled at the service level" << std::endl; + } + + delete item ; +} +#endif + diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index b831e5bbc..15c3b4f84 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -3,7 +3,7 @@ * * General Data service, interface for RetroShare. * - * Copyright 2011-2011 by Robert Fernie, Evi-Parker Christopher + * Copyright 2018-2018 by Cyril Soler * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -29,34 +29,40 @@ /*! * \brief The RsGxsNetTunnelService class takes care of requesting tunnels to the turtle router, through which it is possible to sync - * a particular GXS group. For each group, a set of virtual peers, corresponding to active tunnels will be made available - * to RsGxsNetService. + * a particular GXS group. For each group, a set of virtual peers, corresponding to active tunnels will be made available + * to RsGxsNetService. * - * It is the responsibility of RsGxsNetService to activate/desactivate tunnels for each particular group, depending on wether the group - * is already available at friends or not. + * It is the responsibility of RsGxsNetService to activate/desactivate tunnels for each particular group, depending on wether the group + * is already available at friends or not. */ -// Proposed protocol: +// Protocol: // * request tunnels based on H(GroupId) // * encrypt tunnel data using chacha20+HMAC-SHA256 using AEAD( GroupId, 96bits IV, tunnel ID ) (similar to what FT does) // * when tunnel is established, exchange virtual peer names: vpid = H( GroupID | Random bias ) // * when vpid is known, notify the client (GXS net service) which can use the virtual peer to sync // // * only use a single tunnel per virtual peer ID -// -// Client ------------------ TR(H(GroupId)) --------------> Server -// -// Client <-------------------- T OK ---------------------- Server -// -// Here, a turtle vpid is known -// -// [Encrypted traffic using H(GroupId, 96bits IV, tunnel ID)] -// -// Client <--------- VPID = H( Random IV | GroupId ) ------ Server -// | | -// +--------------> Mark the virtual peer active <-----------+ -// -// Here, a consistent virtual peer ID is known +// - +// Client ------------------ TR(H(GroupId)) --------------> Server | +// | Turtle +// Client <-------------------- T OK ---------------------- Server | +// - +// Here, a turtle vpid is known | [ addVirtualPeer() called by turtle ] +// - +// [Encrypted traffic using H(GroupId | Tunnel ID, 96bits IV)] | +// | +// Client <--------- VPID = H( Random IV | GroupId ) ------ Server | +// | | | +// +--------------> Mark the virtual peer active <-----------+ | Encrypted traffic decoded locally and sorted +// | +// Here, a consistent virtual peer ID is known | +// | +// Client <------------------- GXS Data ------------------> Server | +// - +// Notes: +// * tunnels are only used one-way. If a distant peers wants to sync the same group, he'll have to open his own tunnel, with a different ID. +// * each group will produced multiple tunnels, but each tunnel with have exactly one virtual peer ID typedef RsPeerId RsGxsNetTunnelVirtualPeerId ; @@ -67,40 +73,47 @@ struct RsGxsNetTunnelVirtualPeerInfo RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE = 0x02 // virtual peer id is known. Data can transfer. }; + RsGxsNetTunnelVirtualPeerInfo() : vpid_status(RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN) { memset(encryption_master_key,0,16) ; } + uint8_t vpid_status ; RsGxsNetTunnelVirtualPeerId net_service_virtual_peer ; uint8_t side ; // client/server + uint8_t encryption_master_key[16] ; // key from which the encryption key is derived for each virtual peer (using H(master_key | random IV)) + time_t last_contact ; // last time some data was sent/recvd }; -struct RsGxsNetTunnelInfo +struct RsGxsNetTunnelGroupInfo { enum { RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN = 0x00, // unknown status RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED = 0x01, // waiting for turtle to send some virtual peers. RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE = 0x02 // some virtual peers are available }; - uint8_t group_status ; - uint8_t encryption_master_key[16] ; // key from which the encryption key is derived for each virtual peer (using H(master_key | random IV)) + RsGxsNetTunnelGroupInfo() : group_status(RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN),last_contact(0) {} + + uint8_t group_status ; + time_t last_contact ; + TurtleFileHash hash ; std::map virtual_peers ; }; -class RsGxsNetTunnelService +class RsGxsNetTunnelService: public RsTurtleClientService { public: - RsGxsNetTunnelService() {} + RsGxsNetTunnelService() ; /*! * \brief start managing tunnels for this group * @param group_id group for which tunnels should be requested */ - bool manageTunnels(const RsGxsGroupId&) ; + bool manage(const RsGxsGroupId& group_id) ; /*! * \brief Stop managing tunnels for this group * @param group_id group for which tunnels should be released */ - bool releaseTunnels(const RsGxsGroupId&) ; + bool release(const RsGxsGroupId&group_id) ; /*! * sends data to this virtual peer ID @@ -123,9 +136,19 @@ public: // - method to respond to tunnel requests, probably using RsGxsNetService // - method to encrypt/decrypt data and send/receive to/from turtle. + virtual void connectToTurtleRouter(p3turtle *tr) ; +protected: + // interaction with turtle router + + virtual bool handleTunnelRequest(const RsFileHash &hash,const RsPeerId& peer_id) ; + virtual void receiveTurtleData(RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) ; + void addVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&,RsTurtleGenericTunnelItem::Direction dir) ; + void removeVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&) ; + + p3turtle *mTurtle ; private: - std::map mClientGroups ; // groups on the client side - std::map mServerGroups ; // groups on the server side + std::map mClientGroups ; // groups on the client side + std::map mServerGroups ; // groups on the server side std::map > mVirtualPeers ; @@ -134,7 +157,7 @@ private: * hide the real group id. */ - RsFileHash makeRequestHash(const RsGxsGroupId&) const ; + RsFileHash calculateGroupHash(const RsGxsGroupId&) const ; /*! * \brief makeVirtualPeerIdForGroup creates a virtual peer id that can be used and that will be constant accross time, whatever the @@ -144,5 +167,7 @@ private: RsGxsNetTunnelVirtualPeerInfo makeVirtualPeerIdForGroup(const RsGxsGroupId&) const ; uint8_t mRandomBias[16] ; // constant accross reboots. Allows to disguise the real SSL id while providing a consistent value accross time. + + RsMutex mGxsNetTunnelMtx; }; diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.h b/libretroshare/src/gxstunnel/p3gxstunnel.h index cabe520d4..32020e619 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.h +++ b/libretroshare/src/gxstunnel/p3gxstunnel.h @@ -95,7 +95,7 @@ // by a mix between our own GXS id and the GXS id we're talking to. That is what the TunnelVirtualPeer is. // // -// RequestTunnel(source_own_id,destination_id) - +// RequestTunnel(source_own_id,destination_id) - // | | // +---------------------------> p3Turtle::monitorTunnels( hash(destination_id) ) | // | | From 3407604a54e9704f6bf458c049a94475bd62715e Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 21 Mar 2018 22:09:40 +0100 Subject: [PATCH 009/138] added code to add/remove virtual peers in RsGxsNetTunnel --- libretroshare/src/gxs/rsgxsnettunnel.cc | 74 +++++++++++++++++++++---- libretroshare/src/gxs/rsgxsnettunnel.h | 11 ++-- 2 files changed, 70 insertions(+), 15 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 1e0e83cf7..2a960dd7a 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -23,6 +23,7 @@ * */ +#include "util/rsdir.h" #include "rsgxsnettunnel.h" #define DEBUG_RSGXSNETTUNNEL 1 @@ -31,6 +32,10 @@ RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") {} +//===========================================================================================================================================// +// Interface with rest of the software // +//===========================================================================================================================================// + bool RsGxsNetTunnelService::manage(const RsGxsGroupId& group_id) { RsFileHash hash = calculateGroupHash(group_id) ; @@ -48,6 +53,8 @@ bool RsGxsNetTunnelService::manage(const RsGxsGroupId& group_id) info.last_contact = now ; info.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED; + mHandledHashes[hash] = group_id ; + #ifdef DEBUG_GXS_TUNNEL std::cerr << "Starting distant chat to " << to_gxs_id << ", hash = " << hash << ", from " << from_gxs_id << std::endl; std::cerr << "Asking turtle router to monitor tunnels for hash " << hash << std::endl; @@ -75,6 +82,10 @@ bool RsGxsNetTunnelService::release(const RsGxsGroupId& group_id) } mClientGroups.erase(it) ; + + RsFileHash hash = calculateGroupHash(group_id) ; + + mHandledHashes.erase(hash) ; return true ; } @@ -93,7 +104,7 @@ bool RsGxsNetTunnelService::getVirtualPeers(const RsGxsGroupId&, std::listsecond) ; + + RsGxsNetTunnelGroupInfo& ginfo( mClientGroups[group_id] ) ; + ginfo.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE ; + + RsGxsNetTunnelVirtualPeerInfo& vpinfo( ginfo.virtual_peers[vpid] ) ; + + vpinfo.vpid_status = RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_TUNNEL_OK ; + vpinfo.net_service_virtual_peer.clear(); + vpinfo.side = dir ; + vpinfo.last_contact = time(NULL) ; + + generateEncryptionKey(group_id,vpid,vpinfo.encryption_key ); } -RsFileHash RsGxsNetTunnelService::calculateGroupHash(const RsGxsGroupId&) const +void RsGxsNetTunnelService::removeVirtualPeer(const TurtleFileHash& hash, const TurtleVirtualPeerId& vpid) { - NOT_IMPLEMENTED(); - return RsFileHash() ; + auto it = mHandledHashes.find(hash) ; + + if(it == mHandledHashes.end()) + { + std::cerr << "RsGxsNetTunnelService::removeVirtualPeer(): error! hash " << hash << " is not handled. Cannot remove vpid " << vpid << std::endl; + return ; + } + + const RsGxsGroupId group_id(it->second) ; + + RsGxsNetTunnelGroupInfo& ginfo( mClientGroups[group_id] ) ; + + ginfo.virtual_peers.erase(vpid); + + if(ginfo.virtual_peers.empty()) + ginfo.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED ; +} + +RsFileHash RsGxsNetTunnelService::calculateGroupHash(const RsGxsGroupId& group_id) const +{ + return RsDirUtil::sha1sum(group_id.toByteArray(),RsGxsGroupId::SIZE_IN_BYTES) ; } //===========================================================================================================================================// diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 15c3b4f84..03a676c07 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -77,7 +77,7 @@ struct RsGxsNetTunnelVirtualPeerInfo uint8_t vpid_status ; RsGxsNetTunnelVirtualPeerId net_service_virtual_peer ; - uint8_t side ; // client/server + uint8_t side ; // client/server uint8_t encryption_master_key[16] ; // key from which the encryption key is derived for each virtual peer (using H(master_key | random IV)) time_t last_contact ; // last time some data was sent/recvd }; @@ -150,21 +150,24 @@ private: std::map mClientGroups ; // groups on the client side std::map mServerGroups ; // groups on the server side - std::map > mVirtualPeers ; + std::map > mVirtualPeers ; // current virtual peers, with the (group,turtle vpid) they are for + std::map mHandledHashes ; // hashes asked to turtle /*! * \brief Generates the hash to request tunnels for this group. This hash is only used by turtle, and is used to * hide the real group id. */ - RsFileHash calculateGroupHash(const RsGxsGroupId&) const ; + RsFileHash calculateGroupHash(const RsGxsGroupId&group_id) const ; /*! * \brief makeVirtualPeerIdForGroup creates a virtual peer id that can be used and that will be constant accross time, whatever the * tunnel ID and turtle virtual peer id. This allows RsGxsNetService to keep sync-ing the data consistently. */ - RsGxsNetTunnelVirtualPeerInfo makeVirtualPeerIdForGroup(const RsGxsGroupId&) const ; + RsGxsNetTunnelVirtualPeerInfo makeVirtualPeerIdForGroup(const RsGxsGroupId&group_id) const ; + + void generateEncryptionKey(const RsGxsGroupId& group_id,const TurtleVirtualPeerId& vpid) const ; uint8_t mRandomBias[16] ; // constant accross reboots. Allows to disguise the real SSL id while providing a consistent value accross time. From 00a6bd5b73b0a7a76ad46e4f9535f4d69cd7e193 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 22 Mar 2018 14:41:50 +0100 Subject: [PATCH 010/138] started to move FT encryption into p3turtle --- libretroshare/src/gxs/rsgxsnettunnel.cc | 144 ++++++++++++++++++-- libretroshare/src/gxs/rsgxsnettunnel.h | 45 +++++-- libretroshare/src/turtle/p3turtle.cc | 172 ++++++++++++++++++++++++ libretroshare/src/turtle/p3turtle.h | 7 + 4 files changed, 342 insertions(+), 26 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 2a960dd7a..e9c389454 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -24,6 +24,7 @@ */ #include "util/rsdir.h" +#include "retroshare/rspeers.h" #include "rsgxsnettunnel.h" #define DEBUG_RSGXSNETTUNNEL 1 @@ -42,7 +43,7 @@ bool RsGxsNetTunnelService::manage(const RsGxsGroupId& group_id) RsStackMutex stack(mGxsNetTunnelMtx); /********** STACK LOCKED MTX ******/ - RsGxsNetTunnelGroupInfo& info(mClientGroups[group_id]) ; + RsGxsNetTunnelGroupInfo& info(mGroups[group_id]) ; time_t now = time(NULL) ; @@ -73,15 +74,15 @@ bool RsGxsNetTunnelService::release(const RsGxsGroupId& group_id) // Here we need to clean the stuff that was created by this group id. - auto it = mClientGroups.find(group_id) ; + auto it = mGroups.find(group_id) ; - if(it == mClientGroups.end()) + if(it == mGroups.end()) { std::cerr << "RsGxsNetTunnelService::release(): Weird. Cannot release client group " << group_id << " that is not known." << std::endl; return false ; } - mClientGroups.erase(it) ; + mGroups.erase(it) ; RsFileHash hash = calculateGroupHash(group_id) ; @@ -89,12 +90,66 @@ bool RsGxsNetTunnelService::release(const RsGxsGroupId& group_id) return true ; } -bool RsGxsNetTunnelService::sendData(const unsigned char *data,uint32_t size,const RsGxsNetTunnelVirtualPeerId& virtual_peer) +class ItemAutoDelete { - // The data is encrypted using chacha20+SHA256 and sent to the turtle router. +public: + ItemAutoDelete(RsItem *& item) : mItem(item) {} + ~ItemAutoDelete() { delete mItem; mItem=NULL ; } + RsItem *& mItem; +}; + +bool RsGxsNetTunnelService::sendItem(RsItem *& item,const RsGxsNetTunnelVirtualPeerId& virtual_peer) +{ + // The item is serialized and encrypted using chacha20+SHA256, using the generic turtle encryption, and then sent to the turtle router. + + ItemAutoDelete iad(item) ; // This ensures the item is deleted whatsoever when leaving + + // 1 - find the virtual peer and the proper master key to encrypt with, and check that all the info is known + + auto it = mVirtualPeers.find(virtual_peer) ; + + if(it == mVirtualPeers.end()) + { + std::cerr << "(EE) RsGxsNetTunnelService::sendData(): cannot find virtual peer " << virtual_peer << ". Data is dropped." << std::endl; + return false ; + } + + auto it2 = mGroups.find(it->second.first); + + if(it2 == mGroups.end()) + { + std::cerr << "(EE) RsGxsNetTunnelService::sendData(): cannot find virtual peer " << virtual_peer << ". Data is dropped." << std::endl; + return false ; + } + + auto it3 = it2->second.virtual_peers.find(it->second.second); + + if(it3 == it2->second.virtual_peers.end()) + { + std::cerr << "(EE) RsGxsNetTunnelService::sendData(): cannot find turtle virtual peer " << it->second.second << ". Data is dropped." << std::endl; + return false ; + } + + if(it3->second.vpid_status != RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE) + { + std::cerr << "(EE) RsGxsNetTunnelService::sendData(): virtual peer " << it->second.second << " is not active. Data is dropped." << std::endl; + return false ; + } + + // 2 - encrypt and send the item. + + RsTurtleGenericDataItem *encrypted_turtle_item = NULL ; NOT_IMPLEMENTED(); - return false ; + // if(!p3Turtle::encryptItem(item,it3->second.encryption_master_key,encrypted_turtle_item)) + // { + // std::cerr << "(EE) RsGxsNetTunnelService::sendData(): cannot encrypt. Something's wrong. Data is dropped." << std::endl; + // return false ; + // } + + mTurtle->sendTurtleData(it->second.second,encrypted_turtle_item) ; + + return true ; } bool RsGxsNetTunnelService::getVirtualPeers(const RsGxsGroupId&, std::list& peers) @@ -104,14 +159,60 @@ bool RsGxsNetTunnelService::getVirtualPeers(const RsGxsGroupId&, std::listgetOwnId() ; + + unsigned char mem[RsPeerId::SIZE_IN_BYTES + RsGxsGroupId::SIZE_IN_BYTES + RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE]; + + memcpy(mem ,ssl_id.toByteArray() ,RsPeerId::SIZE_IN_BYTES) ; + memcpy(mem+RsPeerId::SIZE_IN_BYTES ,group_id.toByteArray(),RsGxsGroupId::SIZE_IN_BYTES) ; + memcpy(mem+RsPeerId::SIZE_IN_BYTES+RsGxsGroupId::SIZE_IN_BYTES,mRandomBias ,RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE) ; + + return RsGxsNetTunnelVirtualPeerId(RsDirUtil::sha1sum(mem,RsPeerId::SIZE_IN_BYTES+RsGxsGroupId::SIZE_IN_BYTES+RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE).toByteArray()); } + void RsGxsNetTunnelService::dump() const { - NOT_IMPLEMENTED(); + RS_STACK_MUTEX(mGxsNetTunnelMtx); + + static std::string group_status_str[3] = { + std::string("[RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN ]"), + std::string("[RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED]"), + std::string("[RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE ]") + }; + + static std::string vpid_status_str[3] = { + std::string("[RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN ]"), + std::string("[RS_GXS_NET_TUNNEL_VP_STATUS_TUNNEL_OK ]"), + std::string("[RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE ]") + }; + + std::cerr << "GxsNetTunnelService dump: " << std::endl; + std::cerr << "Managed GXS groups: " << std::endl; + + for(auto it(mGroups.begin());it!=mGroups.end();++it) + { + std::cerr << " " << it->first << " hash: " << it->second.hash << " status: " << group_status_str[it->second.group_status] << "] Last contact: " << time(NULL) - it->second.last_contact << " secs ago" << std::endl; + + for(auto it2(it->second.virtual_peers.begin());it2!=it->second.virtual_peers.end();++it2) + std::cerr << " turtle:" << it2->first << " status: " << vpid_status_str[it2->second.vpid_status] << " s: " + << (int)it2->second.side << " last seen " << time(NULL)-it2->second.last_contact + << " ekey: " << RsUtil::BinToHex(it2->second.encryption_master_key,RS_GXS_TUNNEL_CONST_EKEY_SIZE) + << " pending (" << it2->second.incoming_items.size() << "," << it2->second.outgoing_items.size() << ")" << std::endl; + } + + std::cerr << "Virtual peers: " << std::endl; + for(auto it(mVirtualPeers.begin());it!=mVirtualPeers.end();++it) + std::cerr << " GXS Peer:" << it->first << " group_id: " << it->second.first << " Turtle:" << it->second.second << std::endl; + + std::cerr << "Hashes: " << std::endl; + for(auto it(mHandledHashes.begin());it!=mHandledHashes.end();++it) + std::cerr << " hash: " << it->first << " GroupId: " << it->second << std::endl; } //===========================================================================================================================================// @@ -151,7 +252,7 @@ void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const Tur const RsGxsGroupId group_id(it->second) ; - RsGxsNetTunnelGroupInfo& ginfo( mClientGroups[group_id] ) ; + RsGxsNetTunnelGroupInfo& ginfo( mGroups[group_id] ) ; ginfo.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE ; RsGxsNetTunnelVirtualPeerInfo& vpinfo( ginfo.virtual_peers[vpid] ) ; @@ -161,7 +262,7 @@ void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const Tur vpinfo.side = dir ; vpinfo.last_contact = time(NULL) ; - generateEncryptionKey(group_id,vpid,vpinfo.encryption_key ); + generateEncryptionKey(group_id,vpid,vpinfo.encryption_master_key ); } void RsGxsNetTunnelService::removeVirtualPeer(const TurtleFileHash& hash, const TurtleVirtualPeerId& vpid) @@ -176,7 +277,7 @@ void RsGxsNetTunnelService::removeVirtualPeer(const TurtleFileHash& hash, const const RsGxsGroupId group_id(it->second) ; - RsGxsNetTunnelGroupInfo& ginfo( mClientGroups[group_id] ) ; + RsGxsNetTunnelGroupInfo& ginfo( mGroups[group_id] ) ; ginfo.virtual_peers.erase(vpid); @@ -189,6 +290,21 @@ RsFileHash RsGxsNetTunnelService::calculateGroupHash(const RsGxsGroupId& group_i return RsDirUtil::sha1sum(group_id.toByteArray(),RsGxsGroupId::SIZE_IN_BYTES) ; } +void RsGxsNetTunnelService::generateEncryptionKey(const RsGxsGroupId& group_id,const TurtleVirtualPeerId& vpid,unsigned char key[RS_GXS_TUNNEL_CONST_EKEY_SIZE]) const +{ + // The key is generated as H(group_id | vpid) + // Because group_id is not known it shouldn't be possible to recover the key by observing the traffic. + + assert(Sha256CheckSum::SIZE_IN_BYTES == 32) ; + + unsigned char mem[RsGxsGroupId::SIZE_IN_BYTES + TurtleVirtualPeerId::SIZE_IN_BYTES] ; + + memcpy(mem ,group_id.toByteArray(),RsGxsGroupId::SIZE_IN_BYTES) ; + memcpy(mem+RsGxsGroupId::SIZE_IN_BYTES,vpid.toByteArray() ,TurtleVirtualPeerId::SIZE_IN_BYTES) ; + + memcpy( key, RsDirUtil::sha256sum(mem,RsGxsGroupId::SIZE_IN_BYTES+TurtleVirtualPeerId::SIZE_IN_BYTES).toByteArray(), RS_GXS_TUNNEL_CONST_EKEY_SIZE ) ; +} + //===========================================================================================================================================// // Service parts // //===========================================================================================================================================// diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 03a676c07..2f6cb0eae 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -75,11 +75,16 @@ struct RsGxsNetTunnelVirtualPeerInfo RsGxsNetTunnelVirtualPeerInfo() : vpid_status(RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN) { memset(encryption_master_key,0,16) ; } - uint8_t vpid_status ; - RsGxsNetTunnelVirtualPeerId net_service_virtual_peer ; + uint8_t vpid_status ; // status of the peer uint8_t side ; // client/server uint8_t encryption_master_key[16] ; // key from which the encryption key is derived for each virtual peer (using H(master_key | random IV)) time_t last_contact ; // last time some data was sent/recvd + + RsGxsNetTunnelVirtualPeerId net_service_virtual_peer ; // anonymised peer that is used to communicate with client services + RsGxsGroupId group_id ; // group id + + std::list incoming_items ; + std::list outgoing_items ; }; struct RsGxsNetTunnelGroupInfo @@ -115,10 +120,24 @@ public: */ bool release(const RsGxsGroupId&group_id) ; + /*! - * sends data to this virtual peer ID + * \brief sendItem + * send data to this virtual peer, and takes memory ownership (deletes the item) + * \param item item to send + * \param virtual_peer destination virtual peer + * \return + * true if succeeded. */ - bool sendData(const unsigned char *data,uint32_t size,const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; // send data to this virtual peer + bool sendItem(RsItem *& item, const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; + + /*! + * \brief receivedItem + * returns the next received item from the given virtual peer. + * \param virtual_peer + * \return + */ + RsItem *receivedItem(const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; /*! * \brief Get the list of active virtual peers for a given group. This implies that the tunnel is up and @@ -147,11 +166,13 @@ protected: p3turtle *mTurtle ; private: - std::map mClientGroups ; // groups on the client side - std::map mServerGroups ; // groups on the server side + static const uint32_t RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE = 16 ; + static const uint32_t RS_GXS_TUNNEL_CONST_EKEY_SIZE = 32 ; - std::map > mVirtualPeers ; // current virtual peers, with the (group,turtle vpid) they are for - std::map mHandledHashes ; // hashes asked to turtle + std::map mGroups ; // groups on the client and server side + + std::map > mVirtualPeers ; // current virtual peers, + std::map mHandledHashes ; // hashes asked to turtle /*! * \brief Generates the hash to request tunnels for this group. This hash is only used by turtle, and is used to @@ -165,12 +186,12 @@ private: * tunnel ID and turtle virtual peer id. This allows RsGxsNetService to keep sync-ing the data consistently. */ - RsGxsNetTunnelVirtualPeerInfo makeVirtualPeerIdForGroup(const RsGxsGroupId&group_id) const ; + RsGxsNetTunnelVirtualPeerId makeServerVirtualPeerIdForGroup(const RsGxsGroupId&group_id) const ; - void generateEncryptionKey(const RsGxsGroupId& group_id,const TurtleVirtualPeerId& vpid) const ; + void generateEncryptionKey(const RsGxsGroupId& group_id,const TurtleVirtualPeerId& vpid,unsigned char key[RS_GXS_TUNNEL_CONST_EKEY_SIZE]) const ; - uint8_t mRandomBias[16] ; // constant accross reboots. Allows to disguise the real SSL id while providing a consistent value accross time. + uint8_t mRandomBias[RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE] ; // constant accross reboots. Allows to disguise the real SSL id while providing a consistent value accross time. - RsMutex mGxsNetTunnelMtx; + mutable RsMutex mGxsNetTunnelMtx; }; diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 8217db2fa..f01f7390e 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -2080,6 +2080,178 @@ std::string p3turtle::getPeerNameForVirtualPeerId(const RsPeerId& virtual_peer_i return name; } +#ifdef TODO +static const uint32_t ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE = 12 ; +static const uint32_t ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE = 16 ; +static const uint32_t ENCRYPTED_FT_HEADER_SIZE = 4 ; +static const uint32_t ENCRYPTED_FT_EDATA_SIZE = 4 ; + +static const uint8_t ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_POLY1305 = 0x01 ; +static const uint8_t ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_SHA256 = 0x02 ; + +bool p3turtle::encryptItem(const RsItem *item,uint8_t *encryption_master_key,RsTurtleGenericDataItem *& encrypted_item) +{ + uint8_t initialization_vector[ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE] ; + + RSRandom::random_bytes(initialization_vector,ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE) ; + +#ifdef SERVER_DEBUG + FTSERVER_DEBUG() << "ftServer::Encrypting ft item." << std::endl; + FTSERVER_DEBUG() << " random nonce : " << RsUtil::BinToHex(initialization_vector,ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE) << std::endl; +#endif + + uint32_t item_serialized_size = RsGenericSerializer().size(clear_item) ; + uint32_t total_data_size = ENCRYPTED_FT_HEADER_SIZE + ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_FT_EDATA_SIZE + item_serialized_size + ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE ; + +#ifdef SERVER_DEBUG + FTSERVER_DEBUG() << " clear part size : " << size(clear_item) << std::endl; + FTSERVER_DEBUG() << " total item size : " << total_data_size << std::endl; +#endif + + encrypted_item = new RsTurtleGenericDataItem ; + encrypted_item->data_bytes = rs_malloc( total_data_size ) ; + encrypted_item->data_size = total_data_size ; + + if(encrypted_item->data_bytes == NULL) + return false ; + + uint8_t *edata = (uint8_t*)encrypted_item->data_bytes ; + uint32_t edata_size = item_serialized_size; + uint32_t offset = 0; + + edata[0] = 0xae ; + edata[1] = 0xad ; + edata[2] = ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_SHA256 ; // means AEAD_chacha20_sha256 + edata[3] = 0x01 ; + + offset += ENCRYPTED_FT_HEADER_SIZE; + uint32_t aad_offset = offset ; + uint32_t aad_size = ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_FT_EDATA_SIZE ; + + memcpy(&edata[offset], initialization_vector, ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE) ; + offset += ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE ; + + edata[offset+0] = (edata_size >> 0) & 0xff ; + edata[offset+1] = (edata_size >> 8) & 0xff ; + edata[offset+2] = (edata_size >> 16) & 0xff ; + edata[offset+3] = (edata_size >> 24) & 0xff ; + + offset += ENCRYPTED_FT_EDATA_SIZE ; + + uint32_t ser_size = (uint32_t)((int)total_data_size - (int)offset); + + serialise(clear_item,&edata[offset], &ser_size); + +#ifdef SERVER_DEBUG + FTSERVER_DEBUG() << " clear item : " << RsUtil::BinToHex(&edata[offset],std::min(50,(int)total_data_size-(int)offset)) << "(...)" << std::endl; +#endif + + uint32_t clear_item_offset = offset ; + offset += edata_size ; + + uint32_t authentication_tag_offset = offset ; + assert(ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE + offset == total_data_size) ; + + uint8_t encryption_key[32] ; + deriveEncryptionKey(hash,encryption_key) ; + + if(edata[2] == ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_POLY1305) + librs::crypto::AEAD_chacha20_poly1305(encryption_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],true) ; + else if(edata[2] == ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_SHA256) + librs::crypto::AEAD_chacha20_sha256 (encryption_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],true) ; + else + return false ; + +#ifdef SERVER_DEBUG + FTSERVER_DEBUG() << " encryption key : " << RsUtil::BinToHex(encryption_key,32) << std::endl; + FTSERVER_DEBUG() << " authen. tag : " << RsUtil::BinToHex(&edata[authentication_tag_offset],ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE) << std::endl; + FTSERVER_DEBUG() << " final item : " << RsUtil::BinToHex(&edata[0],std::min(50u,total_data_size)) << "(...)" << std::endl; +#endif + + return true ; +} + +// Decrypts the given item using aead-chacha20-poly1305 +bool p3turtle::decryptItem(RsTurtleGenericDataItem *item, uint8_t* encryption_master_key, RsItem *& decrypted_item) +{ + uint8_t encryption_key[32] ; + deriveEncryptionKey(hash,encryption_key) ; + + uint8_t *edata = (uint8_t*)encrypted_item->data_bytes ; + uint32_t offset = 0; + + if(encrypted_item->data_size < ENCRYPTED_FT_HEADER_SIZE + ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_FT_EDATA_SIZE) return false ; + + if(edata[0] != 0xae) return false ; + if(edata[1] != 0xad) return false ; + if(edata[2] != ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_POLY1305 && edata[2] != ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_SHA256) return false ; + if(edata[3] != 0x01) return false ; + + offset += ENCRYPTED_FT_HEADER_SIZE ; + uint32_t aad_offset = offset ; + uint32_t aad_size = ENCRYPTED_FT_EDATA_SIZE + ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE ; + + uint8_t *initialization_vector = &edata[offset] ; + +#ifdef SERVER_DEBUG + FTSERVER_DEBUG() << "ftServer::decrypting ft item." << std::endl; + FTSERVER_DEBUG() << " item data : " << RsUtil::BinToHex(edata,std::min(50u,encrypted_item->data_size)) << "(...)" << std::endl; + FTSERVER_DEBUG() << " hash : " << hash << std::endl; + FTSERVER_DEBUG() << " encryption key : " << RsUtil::BinToHex(encryption_key,32) << std::endl; + FTSERVER_DEBUG() << " random nonce : " << RsUtil::BinToHex(initialization_vector,ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE) << std::endl; +#endif + + offset += ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE ; + + uint32_t edata_size = 0 ; + edata_size += ((uint32_t)edata[offset+0]) << 0 ; + edata_size += ((uint32_t)edata[offset+1]) << 8 ; + edata_size += ((uint32_t)edata[offset+2]) << 16 ; + edata_size += ((uint32_t)edata[offset+3]) << 24 ; + + if(edata_size + ENCRYPTED_FT_EDATA_SIZE + ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE + ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_FT_HEADER_SIZE != encrypted_item->data_size) + { + FTSERVER_ERROR() << " ERROR: encrypted data size is " << edata_size << ", should be " << encrypted_item->data_size - (ENCRYPTED_FT_EDATA_SIZE + ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE + ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_FT_HEADER_SIZE ) << std::endl; + return false ; + } + + offset += ENCRYPTED_FT_EDATA_SIZE ; + uint32_t clear_item_offset = offset ; + + uint32_t authentication_tag_offset = offset + edata_size ; +#ifdef SERVER_DEBUG + FTSERVER_DEBUG() << " authen. tag : " << RsUtil::BinToHex(&edata[authentication_tag_offset],ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE) << std::endl; +#endif + + bool result ; + + if(edata[2] == ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_POLY1305) + result = librs::crypto::AEAD_chacha20_poly1305(encryption_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],false) ; + else if(edata[2] == ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_SHA256) + result = librs::crypto::AEAD_chacha20_sha256 (encryption_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],false) ; + else + return false ; + +#ifdef SERVER_DEBUG + FTSERVER_DEBUG() << " authen. result : " << result << std::endl; + FTSERVER_DEBUG() << " decrypted daya : " << RsUtil::BinToHex(&edata[clear_item_offset],std::min(50u,edata_size)) << "(...)" << std::endl; +#endif + + if(!result) + { + FTSERVER_ERROR() << "(EE) decryption/authentication went wrong." << std::endl; + return false ; + } + + decrypted_item = dynamic_cast(deserialise(&edata[clear_item_offset],&edata_size)) ; + + if(decrypted_item == NULL) + return false ; + + return true ; +} +#endif + void p3turtle::getInfo( std::vector >& hashes_info, std::vector >& tunnels_info, std::vector& search_reqs_info, diff --git a/libretroshare/src/turtle/p3turtle.h b/libretroshare/src/turtle/p3turtle.h index 0c230b88b..2f7512753 100644 --- a/libretroshare/src/turtle/p3turtle.h +++ b/libretroshare/src/turtle/p3turtle.h @@ -332,6 +332,13 @@ class p3turtle: public p3Service, public RsTurtle, public p3Config /// Send a data request into the correct tunnel for the given file hash void sendTurtleData(const RsPeerId& virtual_peer_id, RsTurtleGenericTunnelItem *item) ; +#ifdef TODO + /// Encrypts/decrypts an item, using a autenticated construction + chacha20, based on the given 32 bytes master key. + /// + static bool encryptItem(const RsItem *item, uint8_t* encryption_master_key, RsTurtleGenericDataItem *& encrypted_item) ; + static bool decryptItem(RsTurtleGenericDataItem *item,uint8_t *encryption_master_key,RsItem *& decrypted_item) ; +#endif + private: //--------------------------- Admin/Helper functions -------------------------// From 58aa2413b31b52e0d1106a4fd979226d1507ee71 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 23 Mar 2018 22:46:04 +0100 Subject: [PATCH 011/138] finished moving tunnel encryption into turtle --- libretroshare/src/ft/ftserver.cc | 38 ++++++++ libretroshare/src/turtle/p3turtle.cc | 131 ++++++++++++++------------- libretroshare/src/turtle/p3turtle.h | 7 +- 3 files changed, 109 insertions(+), 67 deletions(-) diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index f2200d7db..47718caaa 100644 --- a/libretroshare/src/ft/ftserver.cc +++ b/libretroshare/src/ft/ftserver.cc @@ -1219,6 +1219,21 @@ static const uint8_t ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_SHA256 = 0x02 ; bool ftServer::encryptItem(RsTurtleGenericTunnelItem *clear_item,const RsFileHash& hash,RsTurtleGenericDataItem *& encrypted_item) { +#ifndef USE_NEW_METHOD + uint32_t item_serialized_size = size(clear_item) ; + + RsTemporaryMemory data(item_serialized_size) ; + + if(data == NULL) + return false ; + + serialise(clear_item, data, &item_serialized_size); + + uint8_t encryption_key[32] ; + deriveEncryptionKey(hash,encryption_key) ; + + return p3turtle::encryptData(data,item_serialized_size,encryption_key,encrypted_item) ; +#else uint8_t initialization_vector[ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE] ; RSRandom::random_bytes(initialization_vector,ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE) ; @@ -1297,12 +1312,34 @@ bool ftServer::encryptItem(RsTurtleGenericTunnelItem *clear_item,const RsFileHas #endif return true ; +#endif } // Decrypts the given item using aead-chacha20-poly1305 bool ftServer::decryptItem(RsTurtleGenericDataItem *encrypted_item,const RsFileHash& hash,RsTurtleGenericTunnelItem *& decrypted_item) { +#ifndef USE_NEW_METHOD + unsigned char *data = NULL ; + uint32_t data_size = 0 ; + + uint8_t encryption_key[32] ; + deriveEncryptionKey(hash,encryption_key) ; + + if(!p3turtle::decryptItem(encrypted_item,encryption_key,data,data_size)) + { + FTSERVER_ERROR() << "Cannot decrypt data!" << std::endl; + + if(data) + free(data) ; + return false ; + } + decrypted_item = dynamic_cast(deserialise(data,&data_size)) ; + free(data); + + return (decrypted_item != NULL); + +#else uint8_t encryption_key[32] ; deriveEncryptionKey(hash,encryption_key) ; @@ -1378,6 +1415,7 @@ bool ftServer::decryptItem(RsTurtleGenericDataItem *encrypted_item,const RsFileH return false ; return true ; +#endif } bool ftServer::encryptHash(const RsFileHash& hash, RsFileHash& hash_of_hash) diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index f01f7390e..ca337f241 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -34,6 +34,7 @@ #endif #include "rsserver/p3face.h" +#include "crypto/chacha20.h" #include "pqi/authssl.h" #include "pqi/p3linkmgr.h" @@ -63,6 +64,9 @@ static std::map > TS_request_bounces void TS_dumpState() ; #endif +#define TURTLE_DEBUG() std::cerr << time(NULL) << " : TURTLE : " << __FUNCTION__ << " : " +#define TURTLE_ERROR() std::cerr << "(EE) TURTLE ERROR : " + // These number may be quite important. I setup them with sensible values, but // an in-depth test would be better to get an idea of what the ideal values // could ever be. @@ -2080,32 +2084,31 @@ std::string p3turtle::getPeerNameForVirtualPeerId(const RsPeerId& virtual_peer_i return name; } -#ifdef TODO -static const uint32_t ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE = 12 ; -static const uint32_t ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE = 16 ; -static const uint32_t ENCRYPTED_FT_HEADER_SIZE = 4 ; -static const uint32_t ENCRYPTED_FT_EDATA_SIZE = 4 ; +static const uint32_t ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE = 12 ; +static const uint32_t ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE = 16 ; +static const uint32_t ENCRYPTED_TURTLE_HEADER_SIZE = 4 ; +static const uint32_t ENCRYPTED_TURTLE_EDATA_SIZE = 4 ; -static const uint8_t ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_POLY1305 = 0x01 ; -static const uint8_t ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_SHA256 = 0x02 ; +static const uint8_t ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_POLY1305 = 0x01 ; +static const uint8_t ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_SHA256 = 0x02 ; -bool p3turtle::encryptItem(const RsItem *item,uint8_t *encryption_master_key,RsTurtleGenericDataItem *& encrypted_item) +bool p3turtle::encryptData(const unsigned char *clear_data,uint32_t clear_data_size,uint8_t *encryption_master_key,RsTurtleGenericDataItem *& encrypted_item) { - uint8_t initialization_vector[ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE] ; + uint8_t initialization_vector[ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE] ; - RSRandom::random_bytes(initialization_vector,ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE) ; + RSRandom::random_bytes(initialization_vector,ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE) ; #ifdef SERVER_DEBUG - FTSERVER_DEBUG() << "ftServer::Encrypting ft item." << std::endl; - FTSERVER_DEBUG() << " random nonce : " << RsUtil::BinToHex(initialization_vector,ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE) << std::endl; + TURTLE_DEBUG() << "ftServer::Encrypting ft item." << std::endl; + TURTLE_DEBUG() << " random nonce : " << RsUtil::BinToHex(initialization_vector,ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE) << std::endl; #endif - uint32_t item_serialized_size = RsGenericSerializer().size(clear_item) ; - uint32_t total_data_size = ENCRYPTED_FT_HEADER_SIZE + ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_FT_EDATA_SIZE + item_serialized_size + ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE ; + uint32_t item_serialized_size = clear_data_size;//RsGenericSerializer().size(clear_item) ; + uint32_t total_data_size = ENCRYPTED_TURTLE_HEADER_SIZE + ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_TURTLE_EDATA_SIZE + item_serialized_size + ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE ; #ifdef SERVER_DEBUG - FTSERVER_DEBUG() << " clear part size : " << size(clear_item) << std::endl; - FTSERVER_DEBUG() << " total item size : " << total_data_size << std::endl; + TURTLE_DEBUG() << " clear part size : " << size(clear_item) << std::endl; + TURTLE_DEBUG() << " total item size : " << total_data_size << std::endl; #endif encrypted_item = new RsTurtleGenericDataItem ; @@ -2121,87 +2124,85 @@ bool p3turtle::encryptItem(const RsItem *item,uint8_t *encryption_master_key,RsT edata[0] = 0xae ; edata[1] = 0xad ; - edata[2] = ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_SHA256 ; // means AEAD_chacha20_sha256 + edata[2] = ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_SHA256 ; // means AEAD_chacha20_sha256 edata[3] = 0x01 ; - offset += ENCRYPTED_FT_HEADER_SIZE; + offset += ENCRYPTED_TURTLE_HEADER_SIZE; uint32_t aad_offset = offset ; - uint32_t aad_size = ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_FT_EDATA_SIZE ; + uint32_t aad_size = ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_TURTLE_EDATA_SIZE ; - memcpy(&edata[offset], initialization_vector, ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE) ; - offset += ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE ; + memcpy(&edata[offset], initialization_vector, ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE) ; + offset += ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE ; edata[offset+0] = (edata_size >> 0) & 0xff ; edata[offset+1] = (edata_size >> 8) & 0xff ; edata[offset+2] = (edata_size >> 16) & 0xff ; edata[offset+3] = (edata_size >> 24) & 0xff ; - offset += ENCRYPTED_FT_EDATA_SIZE ; + offset += ENCRYPTED_TURTLE_EDATA_SIZE ; - uint32_t ser_size = (uint32_t)((int)total_data_size - (int)offset); - - serialise(clear_item,&edata[offset], &ser_size); + memcpy(&edata[offset],clear_data,clear_data_size); #ifdef SERVER_DEBUG - FTSERVER_DEBUG() << " clear item : " << RsUtil::BinToHex(&edata[offset],std::min(50,(int)total_data_size-(int)offset)) << "(...)" << std::endl; + TURTLE_DEBUG() << " clear item : " << RsUtil::BinToHex(&edata[offset],std::min(50,(int)total_data_size-(int)offset)) << "(...)" << std::endl; #endif uint32_t clear_item_offset = offset ; offset += edata_size ; uint32_t authentication_tag_offset = offset ; - assert(ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE + offset == total_data_size) ; + assert(ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE + offset == total_data_size) ; - uint8_t encryption_key[32] ; - deriveEncryptionKey(hash,encryption_key) ; + //uint8_t encryption_key[32] ; + //deriveEncryptionKey(hash,encryption_key) ; - if(edata[2] == ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_POLY1305) - librs::crypto::AEAD_chacha20_poly1305(encryption_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],true) ; - else if(edata[2] == ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_SHA256) - librs::crypto::AEAD_chacha20_sha256 (encryption_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],true) ; + if(edata[2] == ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_POLY1305) + librs::crypto::AEAD_chacha20_poly1305(encryption_master_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],true) ; + else if(edata[2] == ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_SHA256) + librs::crypto::AEAD_chacha20_sha256 (encryption_master_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],true) ; else return false ; #ifdef SERVER_DEBUG - FTSERVER_DEBUG() << " encryption key : " << RsUtil::BinToHex(encryption_key,32) << std::endl; - FTSERVER_DEBUG() << " authen. tag : " << RsUtil::BinToHex(&edata[authentication_tag_offset],ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE) << std::endl; - FTSERVER_DEBUG() << " final item : " << RsUtil::BinToHex(&edata[0],std::min(50u,total_data_size)) << "(...)" << std::endl; + TURTLE_DEBUG() << " encryption key : " << RsUtil::BinToHex(encryption_key,32) << std::endl; + TURTLE_DEBUG() << " authen. tag : " << RsUtil::BinToHex(&edata[authentication_tag_offset],ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE) << std::endl; + TURTLE_DEBUG() << " final item : " << RsUtil::BinToHex(&edata[0],std::min(50u,total_data_size)) << "(...)" << std::endl; #endif return true ; } // Decrypts the given item using aead-chacha20-poly1305 -bool p3turtle::decryptItem(RsTurtleGenericDataItem *item, uint8_t* encryption_master_key, RsItem *& decrypted_item) +bool p3turtle::decryptItem(const RsTurtleGenericDataItem* encrypted_item, uint8_t *encryption_master_key, unsigned char *& decrypted_data, uint32_t& decrypted_data_size) { - uint8_t encryption_key[32] ; - deriveEncryptionKey(hash,encryption_key) ; + //uint8_t encryption_key[32] ; + //deriveEncryptionKey(hash,encryption_key) ; uint8_t *edata = (uint8_t*)encrypted_item->data_bytes ; uint32_t offset = 0; - if(encrypted_item->data_size < ENCRYPTED_FT_HEADER_SIZE + ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_FT_EDATA_SIZE) return false ; + if(encrypted_item->data_size < ENCRYPTED_TURTLE_HEADER_SIZE + ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_TURTLE_EDATA_SIZE) return false ; if(edata[0] != 0xae) return false ; if(edata[1] != 0xad) return false ; - if(edata[2] != ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_POLY1305 && edata[2] != ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_SHA256) return false ; + if(edata[2] != ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_POLY1305 && edata[2] != ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_SHA256) return false ; if(edata[3] != 0x01) return false ; - offset += ENCRYPTED_FT_HEADER_SIZE ; + offset += ENCRYPTED_TURTLE_HEADER_SIZE ; uint32_t aad_offset = offset ; - uint32_t aad_size = ENCRYPTED_FT_EDATA_SIZE + ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE ; + uint32_t aad_size = ENCRYPTED_TURTLE_EDATA_SIZE + ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE ; uint8_t *initialization_vector = &edata[offset] ; #ifdef SERVER_DEBUG - FTSERVER_DEBUG() << "ftServer::decrypting ft item." << std::endl; - FTSERVER_DEBUG() << " item data : " << RsUtil::BinToHex(edata,std::min(50u,encrypted_item->data_size)) << "(...)" << std::endl; - FTSERVER_DEBUG() << " hash : " << hash << std::endl; - FTSERVER_DEBUG() << " encryption key : " << RsUtil::BinToHex(encryption_key,32) << std::endl; - FTSERVER_DEBUG() << " random nonce : " << RsUtil::BinToHex(initialization_vector,ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE) << std::endl; + TURTLE_DEBUG() << "ftServer::decrypting ft item." << std::endl; + TURTLE_DEBUG() << " item data : " << RsUtil::BinToHex(edata,std::min(50u,encrypted_item->data_size)) << "(...)" << std::endl; + TURTLE_DEBUG() << " hash : " << hash << std::endl; + TURTLE_DEBUG() << " encryption key : " << RsUtil::BinToHex(encryption_key,32) << std::endl; + TURTLE_DEBUG() << " random nonce : " << RsUtil::BinToHex(initialization_vector,ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE) << std::endl; #endif - offset += ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE ; + offset += ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE ; uint32_t edata_size = 0 ; edata_size += ((uint32_t)edata[offset+0]) << 0 ; @@ -2209,48 +2210,52 @@ bool p3turtle::decryptItem(RsTurtleGenericDataItem *item, uint8_t* encryption_ma edata_size += ((uint32_t)edata[offset+2]) << 16 ; edata_size += ((uint32_t)edata[offset+3]) << 24 ; - if(edata_size + ENCRYPTED_FT_EDATA_SIZE + ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE + ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_FT_HEADER_SIZE != encrypted_item->data_size) + if(edata_size + ENCRYPTED_TURTLE_EDATA_SIZE + ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE + ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_TURTLE_HEADER_SIZE != encrypted_item->data_size) { - FTSERVER_ERROR() << " ERROR: encrypted data size is " << edata_size << ", should be " << encrypted_item->data_size - (ENCRYPTED_FT_EDATA_SIZE + ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE + ENCRYPTED_FT_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_FT_HEADER_SIZE ) << std::endl; + TURTLE_ERROR() << " ERROR: encrypted data size is " << edata_size << ", should be " << encrypted_item->data_size - (ENCRYPTED_TURTLE_EDATA_SIZE + ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE + ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_TURTLE_HEADER_SIZE ) << std::endl; return false ; } - offset += ENCRYPTED_FT_EDATA_SIZE ; + offset += ENCRYPTED_TURTLE_EDATA_SIZE ; uint32_t clear_item_offset = offset ; uint32_t authentication_tag_offset = offset + edata_size ; #ifdef SERVER_DEBUG - FTSERVER_DEBUG() << " authen. tag : " << RsUtil::BinToHex(&edata[authentication_tag_offset],ENCRYPTED_FT_AUTHENTICATION_TAG_SIZE) << std::endl; + TURTLE_DEBUG() << " authen. tag : " << RsUtil::BinToHex(&edata[authentication_tag_offset],ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE) << std::endl; #endif bool result ; - if(edata[2] == ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_POLY1305) - result = librs::crypto::AEAD_chacha20_poly1305(encryption_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],false) ; - else if(edata[2] == ENCRYPTED_FT_FORMAT_AEAD_CHACHA20_SHA256) - result = librs::crypto::AEAD_chacha20_sha256 (encryption_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],false) ; + if(edata[2] == ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_POLY1305) + result = librs::crypto::AEAD_chacha20_poly1305(encryption_master_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],false) ; + else if(edata[2] == ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_SHA256) + result = librs::crypto::AEAD_chacha20_sha256 (encryption_master_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],false) ; else return false ; #ifdef SERVER_DEBUG - FTSERVER_DEBUG() << " authen. result : " << result << std::endl; - FTSERVER_DEBUG() << " decrypted daya : " << RsUtil::BinToHex(&edata[clear_item_offset],std::min(50u,edata_size)) << "(...)" << std::endl; + TURTLE_DEBUG() << " authen. result : " << result << std::endl; + TURTLE_DEBUG() << " decrypted daya : " << RsUtil::BinToHex(&edata[clear_item_offset],std::min(50u,edata_size)) << "(...)" << std::endl; #endif if(!result) { - FTSERVER_ERROR() << "(EE) decryption/authentication went wrong." << std::endl; + TURTLE_ERROR() << "(EE) decryption/authentication went wrong." << std::endl; return false ; } - decrypted_item = dynamic_cast(deserialise(&edata[clear_item_offset],&edata_size)) ; + decrypted_data_size = edata_size ; + decrypted_data = (unsigned char*)rs_malloc(edata_size) ; - if(decrypted_item == NULL) + if(decrypted_data == NULL) + { + std::cerr << "Failed to allocate memory for decrypted data chunk of size " << edata_size << std::endl; return false ; + } + memcpy(decrypted_data,&edata[clear_item_offset],edata_size) ; return true ; } -#endif void p3turtle::getInfo( std::vector >& hashes_info, std::vector >& tunnels_info, diff --git a/libretroshare/src/turtle/p3turtle.h b/libretroshare/src/turtle/p3turtle.h index 2f7512753..b3c4debe4 100644 --- a/libretroshare/src/turtle/p3turtle.h +++ b/libretroshare/src/turtle/p3turtle.h @@ -332,12 +332,11 @@ class p3turtle: public p3Service, public RsTurtle, public p3Config /// Send a data request into the correct tunnel for the given file hash void sendTurtleData(const RsPeerId& virtual_peer_id, RsTurtleGenericTunnelItem *item) ; -#ifdef TODO /// Encrypts/decrypts an item, using a autenticated construction + chacha20, based on the given 32 bytes master key. + /// Input values are not touched (memory is not released). Memory ownership of outputs is left to the client. /// - static bool encryptItem(const RsItem *item, uint8_t* encryption_master_key, RsTurtleGenericDataItem *& encrypted_item) ; - static bool decryptItem(RsTurtleGenericDataItem *item,uint8_t *encryption_master_key,RsItem *& decrypted_item) ; -#endif + static bool encryptData(const unsigned char *clear_data,uint32_t clear_data_size,uint8_t *encryption_master_key,RsTurtleGenericDataItem *& encrypted_item); + static bool decryptItem(const RsTurtleGenericDataItem *item, uint8_t* encryption_master_key, unsigned char *& decrypted_data,uint32_t& decrypted_data_size); private: //--------------------------- Admin/Helper functions -------------------------// From 2255bda0070f01444b0a8a74ae677115e860da8c Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 24 Mar 2018 16:41:51 +0100 Subject: [PATCH 012/138] improved documentation of TurtleClientService class with doxygen type --- .../src/turtle/turtleclientservice.h | 92 ++++++++++++------- 1 file changed, 59 insertions(+), 33 deletions(-) diff --git a/libretroshare/src/turtle/turtleclientservice.h b/libretroshare/src/turtle/turtleclientservice.h index d9552c662..962e57cf0 100644 --- a/libretroshare/src/turtle/turtleclientservice.h +++ b/libretroshare/src/turtle/turtleclientservice.h @@ -42,51 +42,77 @@ class p3turtle ; class RsTurtleClientService { public: - // Handling of tunnel request for the given hash. Most of the time, it's a search in a predefined list. - // The output info_string is used by the turtle router to display info about tunnels it manages. It is - // not passed to the tunnel. - virtual bool handleTunnelRequest(const RsFileHash& /*hash*/,const RsPeerId& /*peer_id*/) { return false ; } + /*! + * \brief handleTunnelRequest + Handling of tunnel request for the given hash. To be derived by the service in order to tell the turtle router + whether the service handles this hash or not. Most of the time, it's a search in a predefined list. + + * \return true if the service + */ + virtual bool handleTunnelRequest(const RsFileHash& /*hash*/,const RsPeerId& /*peer_id*/) { return false ; } - // This method is called by the turtle router to send data that comes out of a turtle tunnel. - // The turtle router stays responsible for the memory management of data. Most of the time the - // data chunk is a serialized item to be de-serialized by the client service. - // - // Parameters: - // virtual_peer_id : name of the tunnel that sent the data - // data : memory chunk for the data - // size : size of data - // item->direction : direction of travel: - // RsTurtleGenericTunnelItem::DIRECTION_CLIENT: the service is acting as a client - // RsTurtleGenericTunnelItem::DIRECTION_CLIENT: the service is acting as a server - // - // Most of the time this parameter is not used by services, except when some info (such as chunk maps, chat items, etc) go - // both ways, and their nature cannot suffice to determine where they should be handled. - // - // By default (if not overloaded), the method will just free the data, as any subclass should do as well. - // Note: p3turtle stays owner of the item, so the client should not delete it! - // + + /*! + * \brief receiveTurtleData + * This method is called by the turtle router to send data that comes out of a turtle tunnel, and should + * be overloaded by the client service. + * The turtle router stays responsible for the memory management of data. Most of the time the + * data chunk is a serialized item to be de-serialized by the client service. + * + * Parameters: + * virtual_peer_id : name of the tunnel that sent the data + * data : memory chunk for the data + * size : size of data + * item->direction : direction of travel: + * RsTurtleGenericTunnelItem::DIRECTION_CLIENT: the service is acting as a client + * RsTurtleGenericTunnelItem::DIRECTION_CLIENT: the service is acting as a server + * + * Most of the time this parameter is not used by services, except when some info (such as chunk maps, chat items, etc) go + * both ways, and their nature cannot suffice to determine where they should be handled. + * + * By default (if not overloaded), the method will just free the data, as any subclass should do as well. + * Note: p3turtle stays owner of the item, so the client should not delete it! + */ virtual void receiveTurtleData(RsTurtleGenericTunnelItem */*item*/,const RsFileHash& /*hash*/,const RsPeerId& /*virtual_peer_id*/,RsTurtleGenericTunnelItem::Direction /*direction*/) { std::cerr << "!!!!!! Received Data from turtle router, but the client service is not handling it !!!!!!!!!!" << std::endl ; } - // Method for creating specific items of the client service. The - // method has a default behavior of not doing anything, since most client - // services might only use the generic item already provided by the turtle - // router: RsTurtleGenericDataItem - + /*! + * \brief serializer + * Method for creating specific items of the client service. The + * method has a default behavior of not doing anything, since most client + * services might only use the generic item already provided by the turtle + * router: RsTurtleGenericDataItem + * + * \return the client's serializer is returned + */ virtual RsServiceSerializer *serializer() { return NULL ; } - // These methods are called by the turtle router to add/remove virtual peers when tunnels are created/deleted - // + /*! + * \brief addVirtualPeer + * These methods are called by the turtle router to notify the client in order to add/remove virtual peers when tunnels are created/deleted + * These methods must be overloaded, because a service which does not care about tunel being openned or closed is not supposed to need tunnels. + * + * \param hash hash that the tunnel responds to + * \param virtual_peer_id virtual peer id provided by turtle to allow the client to send data into this tunnel. This peer is related to the tunnel itself + * rather than to its destination. As such, multiple peer ids may actually send data to the same computer because multiple tunnels + * arrive at the same location. + * \param dir dir indicates which side the cient will be talking to: CLIENT means that the client is the server. SERVER means that the client acts + * as a client (and therefore actually requested the tunnel). + */ virtual void addVirtualPeer(const TurtleFileHash& hash,const TurtleVirtualPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction dir) = 0 ; virtual void removeVirtualPeer(const TurtleFileHash& hash,const TurtleVirtualPeerId& virtual_peer_id) = 0 ; - // This function is mandatory. It should do two things: - // 1 - keep a pointer to the turtle router, so as to be able to send data (e.g. copy pt into a local variable) - // 2 - call pt->registerTunnelService(this), so that the TR knows that service and can send back information to it. - // + /*! + * \brief connectToTurtleRouter + * This function must be overloaded by the client. It should do two things: + * 1 - keep a pointer to the turtle router, so as to be able to send data (e.g. store pt into a local variable) + * 2 - call pt->registerTunnelService(this), so that the TR knows that service and can send back information to it. + * + * \param pt A pointer to the turtle router. + */ virtual void connectToTurtleRouter(p3turtle *pt) = 0 ; }; From 5566d90f328d383a9136d38d86b80e5b33974352 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 24 Mar 2018 16:42:16 +0100 Subject: [PATCH 013/138] finished tunnel handling and data send/recv in GxsNetTunnel --- libretroshare/src/gxs/rsgxsnettunnel.cc | 187 +++++++++++++++++++++--- libretroshare/src/gxs/rsgxsnettunnel.h | 14 +- 2 files changed, 181 insertions(+), 20 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index e9c389454..5e7fe557d 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -25,14 +25,77 @@ #include "util/rsdir.h" #include "retroshare/rspeers.h" +#include "serialiser/rstypeserializer.h" #include "rsgxsnettunnel.h" #define DEBUG_RSGXSNETTUNNEL 1 -#define NOT_IMPLEMENTED() { std::cerr << __PRETTY_FUNCTION__ << ": not yet implemented." << std::endl; } +#define GXS_NET_TUNNEL_NOT_IMPLEMENTED() { std::cerr << __PRETTY_FUNCTION__ << ": not yet implemented." << std::endl; } +#define GXS_NET_TUNNEL_DEBUG() std::cerr << time(NULL) << " : GXS_NET_TUNNEL : " << __FUNCTION__ << " : " +#define GXS_NET_TUNNEL_ERROR() std::cerr << "(EE) GXS_NET_TUNNEL ERROR : " + RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") {} +//===========================================================================================================================================// +// Transport Items // +//===========================================================================================================================================// + +const uint16_t RS_SERVICE_TYPE_GXS_NET_TUNNEL = 0x2233 ; + +const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_VIRTUAL_PEER = 0x01 ; + +class RsGxsNetTunnelItem: public RsItem +{ +public: + explicit RsGxsNetTunnelItem(uint8_t item_subtype) : RsItem(RS_PKT_VERSION_SERVICE,RS_SERVICE_TYPE_GXS_NET_TUNNEL,item_subtype) + { + // no priority. All items are encapsulated into generic Turtle items anyway. + } + + virtual ~RsGxsNetTunnelItem() {} + virtual void clear() {} +}; + +class RsGxsNetTunnelVirtualPeerItem: public RsGxsNetTunnelItem +{ +public: + RsGxsNetTunnelVirtualPeerItem() :RsGxsNetTunnelItem(RS_PKT_SUBTYPE_GXS_NET_TUNNEL_VIRTUAL_PEER) {} + explicit RsGxsNetTunnelVirtualPeerItem(uint8_t subtype) :RsGxsNetTunnelItem(subtype) {} + + virtual ~RsGxsNetTunnelVirtualPeerItem() {} + + virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) + { + RsTypeSerializer::serial_process(j,ctx,virtual_peer_id,"virtual_peer_id") ; + } + + RsPeerId virtual_peer_id ; +}; + +class RsGxsNetTunnelSerializer: public RsServiceSerializer +{ +public: + RsGxsNetTunnelSerializer() :RsServiceSerializer(RS_SERVICE_TYPE_GXS_NET_TUNNEL) {} + + virtual RsItem *create_item(uint16_t service,uint8_t item_subtype) const + { + if(service != RS_SERVICE_TYPE_GXS_NET_TUNNEL) + { + GXS_NET_TUNNEL_ERROR() << "received item with wrong service ID " << std::hex << service << std::dec << std::endl; + return NULL ; + } + + switch(item_subtype) + { + case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_VIRTUAL_PEER: return new RsGxsNetTunnelVirtualPeerItem ; + default: + GXS_NET_TUNNEL_ERROR() << "type ID " << std::hex << item_subtype << std::dec << " is not handled!" << std::endl; + return NULL ; + } + } +}; + //===========================================================================================================================================// // Interface with rest of the software // //===========================================================================================================================================// @@ -57,8 +120,7 @@ bool RsGxsNetTunnelService::manage(const RsGxsGroupId& group_id) mHandledHashes[hash] = group_id ; #ifdef DEBUG_GXS_TUNNEL - std::cerr << "Starting distant chat to " << to_gxs_id << ", hash = " << hash << ", from " << from_gxs_id << std::endl; - std::cerr << "Asking turtle router to monitor tunnels for hash " << hash << std::endl; + GXS_NET_TUNNEL_DEBUG() << "Asking turtle router to monitor tunnels for hash " << hash << std::endl; #endif // Now ask the turtle router to manage a tunnel for that hash. @@ -78,7 +140,7 @@ bool RsGxsNetTunnelService::release(const RsGxsGroupId& group_id) if(it == mGroups.end()) { - std::cerr << "RsGxsNetTunnelService::release(): Weird. Cannot release client group " << group_id << " that is not known." << std::endl; + GXS_NET_TUNNEL_ERROR() << "RsGxsNetTunnelService::release(): Weird. Cannot release client group " << group_id << " that is not known." << std::endl; return false ; } @@ -110,7 +172,7 @@ bool RsGxsNetTunnelService::sendItem(RsItem *& item,const RsGxsNetTunnelVirtualP if(it == mVirtualPeers.end()) { - std::cerr << "(EE) RsGxsNetTunnelService::sendData(): cannot find virtual peer " << virtual_peer << ". Data is dropped." << std::endl; + GXS_NET_TUNNEL_ERROR() << "cannot find virtual peer " << virtual_peer << ". Data is dropped." << std::endl; return false ; } @@ -118,7 +180,7 @@ bool RsGxsNetTunnelService::sendItem(RsItem *& item,const RsGxsNetTunnelVirtualP if(it2 == mGroups.end()) { - std::cerr << "(EE) RsGxsNetTunnelService::sendData(): cannot find virtual peer " << virtual_peer << ". Data is dropped." << std::endl; + GXS_NET_TUNNEL_ERROR() << "cannot find virtual peer " << virtual_peer << ". Data is dropped." << std::endl; return false ; } @@ -126,13 +188,13 @@ bool RsGxsNetTunnelService::sendItem(RsItem *& item,const RsGxsNetTunnelVirtualP if(it3 == it2->second.virtual_peers.end()) { - std::cerr << "(EE) RsGxsNetTunnelService::sendData(): cannot find turtle virtual peer " << it->second.second << ". Data is dropped." << std::endl; + std::cerr << "cannot find turtle virtual peer " << it->second.second << ". Data is dropped." << std::endl; return false ; } if(it3->second.vpid_status != RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE) { - std::cerr << "(EE) RsGxsNetTunnelService::sendData(): virtual peer " << it->second.second << " is not active. Data is dropped." << std::endl; + GXS_NET_TUNNEL_ERROR() << "virtual peer " << it->second.second << " is not active. Data is dropped." << std::endl; return false ; } @@ -140,12 +202,14 @@ bool RsGxsNetTunnelService::sendItem(RsItem *& item,const RsGxsNetTunnelVirtualP RsTurtleGenericDataItem *encrypted_turtle_item = NULL ; - NOT_IMPLEMENTED(); - // if(!p3Turtle::encryptItem(item,it3->second.encryption_master_key,encrypted_turtle_item)) - // { - // std::cerr << "(EE) RsGxsNetTunnelService::sendData(): cannot encrypt. Something's wrong. Data is dropped." << std::endl; - // return false ; - // } + uint32_t serialized_size = 0; // TODO + RsTemporaryMemory data(serialized_size) ; + + if(!p3turtle::encryptData(data,serialized_size,it3->second.encryption_master_key,encrypted_turtle_item)) + { + GXS_NET_TUNNEL_ERROR() << "cannot encrypt. Something's wrong. Data is dropped." << std::endl; + return false ; + } mTurtle->sendTurtleData(it->second.second,encrypted_turtle_item) ; @@ -155,7 +219,7 @@ bool RsGxsNetTunnelService::sendItem(RsItem *& item,const RsGxsNetTunnelVirtualP bool RsGxsNetTunnelService::getVirtualPeers(const RsGxsGroupId&, std::list& peers) { // returns the virtual peers for this group - NOT_IMPLEMENTED(); + GXS_NET_TUNNEL_NOT_IMPLEMENTED(); return false ; } @@ -227,7 +291,7 @@ void RsGxsNetTunnelService::connectToTurtleRouter(p3turtle *tr) bool RsGxsNetTunnelService::handleTunnelRequest(const RsFileHash &hash,const RsPeerId& peer_id) { - NOT_IMPLEMENTED(); + GXS_NET_TUNNEL_NOT_IMPLEMENTED(); // at this point we need to talk to the client services // There's 2 ways to do that: @@ -236,10 +300,70 @@ bool RsGxsNetTunnelService::handleTunnelRequest(const RsFileHash &hash,const RsP return true ; } + void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) { - NOT_IMPLEMENTED(); + GXS_NET_TUNNEL_NOT_IMPLEMENTED(); + + if(item->PacketSubType() != RS_TURTLE_SUBTYPE_GENERIC_DATA) + { + GXS_NET_TUNNEL_ERROR() << "item with type " << std::hex << item->PacketSubType() << std::dec << " received by GxsNetTunnel, but is not handled!" << std::endl; + return; + } + + // (cyril) this is a bit complicated. We should store pointers to the encryption keys in another structure and access it directly. + + auto it = mHandledHashes.find(hash) ; + + if(it == mHandledHashes.end()) + { + GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for hash " << hash << " but this hash is unknown!" << std::endl; + return; + } + + RsGxsGroupId group_id = it->second; + + auto it2 = mGroups.find(group_id) ; + + if(it2 == mGroups.end()) + { + GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for hash " << hash << " and group " << group_id << " but this group id is unknown!" << std::endl; + return; + } + + RsGxsNetTunnelGroupInfo& g_info(it2->second) ; + + g_info.last_contact = time(NULL) ; + + auto it3 = g_info.virtual_peers.find(virtual_peer_id) ; + + if(it3 == g_info.virtual_peers.end()) + { + GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for hash " << hash << ", group " << group_id << " but the virtual peer id is missing!" << std::endl; + return; + } + + RsGxsNetTunnelVirtualPeerInfo& vp_info(it3->second) ; + + unsigned char *data = NULL ; + uint32_t data_size = 0 ; + + if(!p3turtle::decryptItem(static_cast(item),vp_info.encryption_master_key,data,data_size)) + { + GXS_NET_TUNNEL_ERROR() << "Cannot decrypt data!" << std::endl; + + if(data) + free(data) ; + + return ; + } + + RsGxsNetTunnelItem *decrypted_item = dynamic_cast(RsGxsNetTunnelSerializer().deserialise(data,&data_size)) ; + free(data); + + handleIncoming(decrypted_item); } + void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const TurtleVirtualPeerId& vpid,RsTurtleGenericTunnelItem::Direction dir) { auto it = mHandledHashes.find(hash) ; @@ -258,11 +382,25 @@ void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const Tur RsGxsNetTunnelVirtualPeerInfo& vpinfo( ginfo.virtual_peers[vpid] ) ; vpinfo.vpid_status = RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_TUNNEL_OK ; - vpinfo.net_service_virtual_peer.clear(); vpinfo.side = dir ; vpinfo.last_contact = time(NULL) ; generateEncryptionKey(group_id,vpid,vpinfo.encryption_master_key ); + + // If we're a server, we need to send our own virtual peer id to the client + + if(dir == RsTurtleGenericTunnelItem::DIRECTION_CLIENT) + { + vpinfo.net_service_virtual_peer = makeServerVirtualPeerIdForGroup(group_id); + + RsGxsNetTunnelVirtualPeerItem *pitem = new RsGxsNetTunnelVirtualPeerItem ; + + pitem->virtual_peer_id = vpinfo.net_service_virtual_peer ; + + vpinfo.outgoing_items.push_back(pitem) ; + } + else + vpinfo.net_service_virtual_peer.clear(); } void RsGxsNetTunnelService::removeVirtualPeer(const TurtleFileHash& hash, const TurtleVirtualPeerId& vpid) @@ -309,6 +447,19 @@ void RsGxsNetTunnelService::generateEncryptionKey(const RsGxsGroupId& group_id,c // Service parts // //===========================================================================================================================================// +void RsGxsNetTunnelService::data_tick() +{ + GXS_NET_TUNNEL_DEBUG() << std::endl; + + // cleanup + + autowash(); +} + +void RsGxsNetTunnelService::autowash() +{ +} + #ifdef TODO void RsGxsNetTunnelService::handleIncomingItem(const RsGxsTunnelId& tunnel_id,RsGxsTunnelItem *item) { diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 2f6cb0eae..16f00de4b 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -66,6 +66,8 @@ typedef RsPeerId RsGxsNetTunnelVirtualPeerId ; +class RsGxsNetTunnelItem ; + struct RsGxsNetTunnelVirtualPeerInfo { enum { RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN = 0x00, // unknown status. @@ -77,7 +79,7 @@ struct RsGxsNetTunnelVirtualPeerInfo uint8_t vpid_status ; // status of the peer uint8_t side ; // client/server - uint8_t encryption_master_key[16] ; // key from which the encryption key is derived for each virtual peer (using H(master_key | random IV)) + uint8_t encryption_master_key[32] ; // key from which the encryption key is derived for each virtual peer (using H(master_key | random IV)) time_t last_contact ; // last time some data was sent/recvd RsGxsNetTunnelVirtualPeerId net_service_virtual_peer ; // anonymised peer that is used to communicate with client services @@ -103,7 +105,7 @@ struct RsGxsNetTunnelGroupInfo std::map virtual_peers ; }; -class RsGxsNetTunnelService: public RsTurtleClientService +class RsGxsNetTunnelService: public RsTurtleClientService, public RsTickingThread { public: RsGxsNetTunnelService() ; @@ -156,6 +158,11 @@ public: // - method to encrypt/decrypt data and send/receive to/from turtle. virtual void connectToTurtleRouter(p3turtle *tr) ; + + // Overloaded from RsTickingThread + + void data_tick() ; + protected: // interaction with turtle router @@ -166,6 +173,9 @@ protected: p3turtle *mTurtle ; private: + void autowash() ; + void handleIncoming(RsGxsNetTunnelItem *item) ; + static const uint32_t RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE = 16 ; static const uint32_t RS_GXS_TUNNEL_CONST_EKEY_SIZE = 32 ; From b488760d7d8c858c970712cbc37a8a46c0453f80 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 26 Mar 2018 23:19:29 +0200 Subject: [PATCH 014/138] fixed data incoming/outgoing in GxsNetTunnel --- libretroshare/src/gxs/rsgxsnettunnel.cc | 144 ++++++++++++++++++------ libretroshare/src/gxs/rsgxsnettunnel.h | 3 +- 2 files changed, 110 insertions(+), 37 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 5e7fe557d..36ac81f47 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -37,6 +37,19 @@ RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") {} +//===========================================================================================================================================// +// Internal structures // +//===========================================================================================================================================// + +RsGxsNetTunnelVirtualPeerInfo::~RsGxsNetTunnelVirtualPeerInfo() +{ + for(auto it(outgoing_items.begin());it!=outgoing_items.end();++it) + delete *it ; + + for(auto it(incoming_data.begin());it!=incoming_data.end();++it) + delete *it ; +} + //===========================================================================================================================================// // Transport Items // //===========================================================================================================================================// @@ -267,7 +280,7 @@ void RsGxsNetTunnelService::dump() const std::cerr << " turtle:" << it2->first << " status: " << vpid_status_str[it2->second.vpid_status] << " s: " << (int)it2->second.side << " last seen " << time(NULL)-it2->second.last_contact << " ekey: " << RsUtil::BinToHex(it2->second.encryption_master_key,RS_GXS_TUNNEL_CONST_EKEY_SIZE) - << " pending (" << it2->second.incoming_items.size() << "," << it2->second.outgoing_items.size() << ")" << std::endl; + << " pending (" << it2->second.incoming_data.size() << "," << it2->second.outgoing_items.size() << ")" << std::endl; } std::cerr << "Virtual peers: " << std::endl; @@ -303,7 +316,9 @@ bool RsGxsNetTunnelService::handleTunnelRequest(const RsFileHash &hash,const RsP void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) { - GXS_NET_TUNNEL_NOT_IMPLEMENTED(); +#ifdef DEBUG_RSGXSNETTUNNEL + GXS_NET_TUNNEL_DEBUG() << " received turtle data for vpid " << virtual_peer_id << " for hash " << hash << " in direction " << (int)direction << std::endl; +#endif if(item->PacketSubType() != RS_TURTLE_SUBTYPE_GENERIC_DATA) { @@ -358,10 +373,42 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co return ; } - RsGxsNetTunnelItem *decrypted_item = dynamic_cast(RsGxsNetTunnelSerializer().deserialise(data,&data_size)) ; - free(data); + // Now we might get 2 kinds of items: GxsNetTunnel items, to be handled here, and Gxs data items, to be handled by the client service - handleIncoming(decrypted_item); + RsItem *decrypted_item = RsGxsNetTunnelSerializer().deserialise(data,&data_size); + + RsGxsNetTunnelVirtualPeerItem *pid_item = dynamic_cast(decrypted_item) ; + + if(pid_item) + { + if(direction == RsTurtleGenericTunnelItem::DIRECTION_SERVER) + { +#ifdef DEBUG_RSGXSNETTUNNEL + GXS_NET_TUNNEL_DEBUG() << " item is a virtual peer id item with vpid = "<< pid_item->virtual_peer_id << ". Setting virtual peer." << std::endl; +#endif + vp_info.net_service_virtual_peer = pid_item->virtual_peer_id; + vp_info.vpid_status = RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE ; + } + else + GXS_NET_TUNNEL_ERROR() << "Cannot decrypt data!" << std::endl; + + free(data); + return ; + } + else + { +#ifdef DEBUG_RSGXSNETTUNNEL + GXS_NET_TUNNEL_DEBUG() << " item is GXS data. Storing into incoming list." << std::endl; +#endif + // push the data into the service incoming data list + + RsTlvBinaryData *bind = new RsTlvBinaryData; + bind->tlvtype = 0; + bind->bin_len = data_size; + bind->bin_data = data; + + vp_info.incoming_data.push_back(bind) ; + } } void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const TurtleVirtualPeerId& vpid,RsTurtleGenericTunnelItem::Direction dir) @@ -374,6 +421,9 @@ void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const Tur return ; } +#ifdef DEBUG_RSGXSNETTUNNEL + GXS_NET_TUNNEL_DEBUG() << " adding virtual peer " << vpid << " for hash " << hash << " in direction " << dir << std::endl; +#endif const RsGxsGroupId group_id(it->second) ; RsGxsNetTunnelGroupInfo& ginfo( mGroups[group_id] ) ; @@ -393,6 +443,9 @@ void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const Tur { vpinfo.net_service_virtual_peer = makeServerVirtualPeerIdForGroup(group_id); +#ifdef DEBUG_RSGXSNETTUNNEL + GXS_NET_TUNNEL_DEBUG() << " peer is server side: sending back virtual peer name " << vpinfo.net_service_virtual_peer << std::endl; +#endif RsGxsNetTunnelVirtualPeerItem *pitem = new RsGxsNetTunnelVirtualPeerItem ; pitem->virtual_peer_id = vpinfo.net_service_virtual_peer ; @@ -405,6 +458,9 @@ void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const Tur void RsGxsNetTunnelService::removeVirtualPeer(const TurtleFileHash& hash, const TurtleVirtualPeerId& vpid) { +#ifdef DEBUG_RSGXSNETTUNNEL + GXS_NET_TUNNEL_DEBUG() << " removing virtual peer " << vpid << " for hash " << hash << std::endl; +#endif auto it = mHandledHashes.find(hash) ; if(it == mHandledHashes.end()) @@ -420,7 +476,13 @@ void RsGxsNetTunnelService::removeVirtualPeer(const TurtleFileHash& hash, const ginfo.virtual_peers.erase(vpid); if(ginfo.virtual_peers.empty()) + { ginfo.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED ; + +#ifdef DEBUG_RSGXSNETTUNNEL + GXS_NET_TUNNEL_DEBUG() << " no more virtual peers for group " << group_id << ": setting status to TUNNELS_REQUESTED" << std::endl; +#endif + } } RsFileHash RsGxsNetTunnelService::calculateGroupHash(const RsGxsGroupId& group_id) const @@ -454,41 +516,51 @@ void RsGxsNetTunnelService::data_tick() // cleanup autowash(); + + static time_t last_dump = time(NULL); + time_t now = time(NULL); + + if(last_dump + 10 > now) + { + last_dump = now; + dump(); + } } void RsGxsNetTunnelService::autowash() { } -#ifdef TODO -void RsGxsNetTunnelService::handleIncomingItem(const RsGxsTunnelId& tunnel_id,RsGxsTunnelItem *item) -{ - if(item == NULL) - return ; - - // We have 3 things to do: - // - // 1 - if it's a data item, send an ACK - // 2 - if it's an ack item, mark the item as properly received, and remove it from the queue - // 3 - if it's a status item, act accordingly. - - switch(item->PacketSubType()) - { - - case RS_PKT_SUBTYPE_GXS_TUNNEL_DATA: handleRecvTunnelDataItem(tunnel_id,dynamic_cast(item)) ; - break ; - - case RS_PKT_SUBTYPE_GXS_TUNNEL_DATA_ACK: handleRecvTunnelDataAckItem(tunnel_id,dynamic_cast(item)) ; - break ; - - case RS_PKT_SUBTYPE_GXS_TUNNEL_STATUS: handleRecvStatusItem(tunnel_id,dynamic_cast(item)) ; - break ; - - default: - std::cerr << "(EE) impossible situation. DH items should be handled at the service level" << std::endl; - } - - delete item ; -} -#endif +// void RsGxsNetTunnelService::handleIncoming(const RsGxsTunnelId& tunnel_id,RsGxsTunnelItem *item) +// { +// #ifdef DEBUG_RSGXSNETTUNNEL +// GXS_NET_TUNNEL_DEBUG() << " received turtle data for vpid " << virtual_peer_id << " for hash " << hash << " in direction " << dir << std::endl; +// #endif +// if(item == NULL) +// return ; +// +// // We have 3 things to do: +// // +// // 1 - if it's a data item, send an ACK +// // 2 - if it's an ack item, mark the item as properly received, and remove it from the queue +// // 3 - if it's a status item, act accordingly. +// +// switch(item->PacketSubType()) +// { +// +// case RS_PKT_SUBTYPE_GXS_TUNNEL_DATA: handleRecvTunnelDataItem(tunnel_id,dynamic_cast(item)) ; +// break ; +// +// case RS_PKT_SUBTYPE_GXS_TUNNEL_DATA_ACK: handleRecvTunnelDataAckItem(tunnel_id,dynamic_cast(item)) ; +// break ; +// +// case RS_PKT_SUBTYPE_GXS_TUNNEL_STATUS: handleRecvStatusItem(tunnel_id,dynamic_cast(item)) ; +// break ; +// +// default: +// std::cerr << "(EE) impossible situation. DH items should be handled at the service level" << std::endl; +// } +// +// delete item ; +// } diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 16f00de4b..798b49f1e 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -76,6 +76,7 @@ struct RsGxsNetTunnelVirtualPeerInfo }; RsGxsNetTunnelVirtualPeerInfo() : vpid_status(RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN) { memset(encryption_master_key,0,16) ; } + ~RsGxsNetTunnelVirtualPeerInfo() ; uint8_t vpid_status ; // status of the peer uint8_t side ; // client/server @@ -85,7 +86,7 @@ struct RsGxsNetTunnelVirtualPeerInfo RsGxsNetTunnelVirtualPeerId net_service_virtual_peer ; // anonymised peer that is used to communicate with client services RsGxsGroupId group_id ; // group id - std::list incoming_items ; + std::list incoming_data ; std::list outgoing_items ; }; From 73b04f3109b8df3769c5c8199ea99b11c3213144 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 29 Mar 2018 10:54:58 +0200 Subject: [PATCH 015/138] finished implementation of GxsNetTunnel service --- libretroshare/src/gxs/rsgxsnetservice.cc | 4 +- libretroshare/src/gxs/rsgxsnetservice.h | 3 +- libretroshare/src/gxs/rsgxsnettunnel.cc | 180 ++++++++++++----------- libretroshare/src/gxs/rsgxsnettunnel.h | 69 ++++++--- 4 files changed, 148 insertions(+), 108 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 5fc4427ad..914b6ce4e 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -359,7 +359,7 @@ RsGxsNetService::RsGxsNetService(uint16_t servType, RsGeneralDataService *gds, RsNxsNetMgr *netMgr, RsNxsObserver *nxsObs, const RsServiceInfo serviceInfo, RsGixsReputation* reputations, RsGcxs* circles, RsGixs *gixs, - PgpAuxUtils *pgpUtils, bool grpAutoSync, bool msgAutoSync, uint32_t default_store_period, uint32_t default_sync_period) + PgpAuxUtils *pgpUtils, bool grpAutoSync, bool msgAutoSync, bool distSync, uint32_t default_store_period, uint32_t default_sync_period) : p3ThreadedService(), p3Config(), mTransactionN(0), mObserver(nxsObs), mDataStore(gds), mServType(servType), mTransactionTimeOut(TRANSAC_TIMEOUT), @@ -368,7 +368,7 @@ RsGxsNetService::RsGxsNetService(uint16_t servType, RsGeneralDataService *gds, mLastCleanRejectedMessages(0), mSYNC_PERIOD(SYNC_PERIOD), mCircles(circles), mGixs(gixs), mReputations(reputations), mPgpUtils(pgpUtils), - mGrpAutoSync(grpAutoSync), mAllowMsgSync(msgAutoSync), + mGrpAutoSync(grpAutoSync), mAllowMsgSync(msgAutoSync),mAllowDistSync(distSync), mServiceInfo(serviceInfo), mDefaultMsgStorePeriod(default_store_period), mDefaultMsgSyncPeriod(default_sync_period) { diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index 00ba07953..49d44dab2 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -90,7 +90,7 @@ public: const RsServiceInfo serviceInfo, RsGixsReputation* reputations = NULL, RsGcxs* circles = NULL, RsGixs *gixs=NULL, PgpAuxUtils *pgpUtils = NULL, - bool grpAutoSync = true, bool msgAutoSync = true, + bool grpAutoSync = true, bool msgAutoSync = true,bool distSync=false, uint32_t default_store_period = RS_GXS_DEFAULT_MSG_STORE_PERIOD, uint32_t default_sync_period = RS_GXS_DEFAULT_MSG_REQ_PERIOD); @@ -543,6 +543,7 @@ private: PgpAuxUtils *mPgpUtils; bool mGrpAutoSync; bool mAllowMsgSync; + bool mAllowDistSync; // need to be verfied std::vector mPendingResp; diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 36ac81f47..6d763a092 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -57,6 +57,7 @@ RsGxsNetTunnelVirtualPeerInfo::~RsGxsNetTunnelVirtualPeerInfo() const uint16_t RS_SERVICE_TYPE_GXS_NET_TUNNEL = 0x2233 ; const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_VIRTUAL_PEER = 0x01 ; +const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_KEEP_ALIVE = 0x02 ; class RsGxsNetTunnelItem: public RsItem { @@ -74,7 +75,6 @@ class RsGxsNetTunnelVirtualPeerItem: public RsGxsNetTunnelItem { public: RsGxsNetTunnelVirtualPeerItem() :RsGxsNetTunnelItem(RS_PKT_SUBTYPE_GXS_NET_TUNNEL_VIRTUAL_PEER) {} - explicit RsGxsNetTunnelVirtualPeerItem(uint8_t subtype) :RsGxsNetTunnelItem(subtype) {} virtual ~RsGxsNetTunnelVirtualPeerItem() {} @@ -86,6 +86,15 @@ public: RsPeerId virtual_peer_id ; }; +class RsGxsNetTunnelKeepAliveItem: public RsGxsNetTunnelItem +{ +public: + RsGxsNetTunnelKeepAliveItem() :RsGxsNetTunnelItem(RS_PKT_SUBTYPE_GXS_NET_TUNNEL_KEEP_ALIVE) {} + + virtual ~RsGxsNetTunnelKeepAliveItem() {} + virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) {} +}; + class RsGxsNetTunnelSerializer: public RsServiceSerializer { public: @@ -102,6 +111,7 @@ public: switch(item_subtype) { case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_VIRTUAL_PEER: return new RsGxsNetTunnelVirtualPeerItem ; + case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_KEEP_ALIVE : return new RsGxsNetTunnelKeepAliveItem ; default: GXS_NET_TUNNEL_ERROR() << "type ID " << std::hex << item_subtype << std::dec << " is not handled!" << std::endl; return NULL ; @@ -113,71 +123,19 @@ public: // Interface with rest of the software // //===========================================================================================================================================// -bool RsGxsNetTunnelService::manage(const RsGxsGroupId& group_id) -{ - RsFileHash hash = calculateGroupHash(group_id) ; - - RsStackMutex stack(mGxsNetTunnelMtx); /********** STACK LOCKED MTX ******/ - - RsGxsNetTunnelGroupInfo& info(mGroups[group_id]) ; - - time_t now = time(NULL) ; - - if(info.group_status == RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE) - return true; - - info.hash = hash ; - info.last_contact = now ; - info.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED; - - mHandledHashes[hash] = group_id ; - -#ifdef DEBUG_GXS_TUNNEL - GXS_NET_TUNNEL_DEBUG() << "Asking turtle router to monitor tunnels for hash " << hash << std::endl; -#endif - - // Now ask the turtle router to manage a tunnel for that hash. - - mTurtle->monitorTunnels(hash,this,false) ; - - return true; -} - -bool RsGxsNetTunnelService::release(const RsGxsGroupId& group_id) -{ - RsStackMutex stack(mGxsNetTunnelMtx); /********** STACK LOCKED MTX ******/ - - // Here we need to clean the stuff that was created by this group id. - - auto it = mGroups.find(group_id) ; - - if(it == mGroups.end()) - { - GXS_NET_TUNNEL_ERROR() << "RsGxsNetTunnelService::release(): Weird. Cannot release client group " << group_id << " that is not known." << std::endl; - return false ; - } - - mGroups.erase(it) ; - - RsFileHash hash = calculateGroupHash(group_id) ; - - mHandledHashes.erase(hash) ; - return true ; -} - -class ItemAutoDelete +class DataAutoDelete { public: - ItemAutoDelete(RsItem *& item) : mItem(item) {} - ~ItemAutoDelete() { delete mItem; mItem=NULL ; } - RsItem *& mItem; + DataAutoDelete(unsigned char *& data) : mData(data) {} + ~DataAutoDelete() { free(mData); mData=NULL ; } + unsigned char *& mData; }; -bool RsGxsNetTunnelService::sendItem(RsItem *& item,const RsGxsNetTunnelVirtualPeerId& virtual_peer) +bool RsGxsNetTunnelService::sendData(unsigned char *& data,uint32_t data_len,const RsGxsNetTunnelVirtualPeerId& virtual_peer) { // The item is serialized and encrypted using chacha20+SHA256, using the generic turtle encryption, and then sent to the turtle router. - ItemAutoDelete iad(item) ; // This ensures the item is deleted whatsoever when leaving + DataAutoDelete iad(data) ; // This ensures the item is deleted whatsoever when leaving // 1 - find the virtual peer and the proper master key to encrypt with, and check that all the info is known @@ -215,10 +173,7 @@ bool RsGxsNetTunnelService::sendItem(RsItem *& item,const RsGxsNetTunnelVirtualP RsTurtleGenericDataItem *encrypted_turtle_item = NULL ; - uint32_t serialized_size = 0; // TODO - RsTemporaryMemory data(serialized_size) ; - - if(!p3turtle::encryptData(data,serialized_size,it3->second.encryption_master_key,encrypted_turtle_item)) + if(!p3turtle::encryptData(data,data_len,it3->second.encryption_master_key,encrypted_turtle_item)) { GXS_NET_TUNNEL_ERROR() << "cannot encrypt. Something's wrong. Data is dropped." << std::endl; return false ; @@ -229,11 +184,63 @@ bool RsGxsNetTunnelService::sendItem(RsItem *& item,const RsGxsNetTunnelVirtualP return true ; } -bool RsGxsNetTunnelService::getVirtualPeers(const RsGxsGroupId&, std::list& peers) +bool RsGxsNetTunnelService::getVirtualPeers(const RsGxsGroupId& group_id, std::list& peers) { - // returns the virtual peers for this group - GXS_NET_TUNNEL_NOT_IMPLEMENTED(); - return false ; + // This function has two effects: + // - return the virtual peers for this group + // - passively set the group as "managed", so that it we answer tunnel requests. + + RS_STACK_MUTEX(mGxsNetTunnelMtx); + + // update the hash entry if needed + + RsFileHash hash = calculateGroupHash(group_id); + mHandledHashes[hash] = group_id ; + + // Create the group entry, if needed, with passive mode. + + RsGxsNetTunnelGroupInfo& ginfo( mGroups[group_id] ) ; + + ginfo.hash = hash ; + + for(auto it2 = ginfo.virtual_peers.begin();it2 != ginfo.virtual_peers.end();++it2) + if(it2->second.vpid_status == RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE) + peers.push_back(it2->second.net_service_virtual_peer) ; + +#ifdef DEBUG_GXS_TUNNEL + GXS_NET_TUNNEL_DEBUG() << "returning " << peers.size() << " peers." << std::endl; +#endif + + return true ; +} + +bool RsGxsNetTunnelService::requestPeers(const RsGxsGroupId& group_id) +{ + RS_STACK_MUTEX(mGxsNetTunnelMtx); + + // Now ask the turtle router to manage a tunnel for that hash. + + RsGxsNetTunnelGroupInfo& ginfo( mGroups[group_id] ) ; + + ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE; + + // we dont set the group policy here. It will only be set if no peers, or too few peers are available. + + return true; +} + +bool RsGxsNetTunnelService::releasePeers(const RsGxsGroupId& group_id) +{ + RS_STACK_MUTEX(mGxsNetTunnelMtx); + + // Ask turtle router to stop requesting tunnels for that hash. + + RsGxsNetTunnelGroupInfo& ginfo( mGroups[group_id] ) ; + + ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE; + mTurtle->stopMonitoringTunnels(ginfo.hash) ; + + return true; } RsGxsNetTunnelVirtualPeerId RsGxsNetTunnelService::makeServerVirtualPeerIdForGroup(const RsGxsGroupId& group_id) const @@ -304,14 +311,9 @@ void RsGxsNetTunnelService::connectToTurtleRouter(p3turtle *tr) bool RsGxsNetTunnelService::handleTunnelRequest(const RsFileHash &hash,const RsPeerId& peer_id) { - GXS_NET_TUNNEL_NOT_IMPLEMENTED(); + // We simply check for wether a managed group has a hash that corresponds to the given hash. - // at this point we need to talk to the client services - // There's 2 ways to do that: - // 1 - client services "register" and we ask them one by one. - // 2 - client service derives from RsGxsNetTunnelService and the client is interrogated using an overloaded virtual method - - return true ; + return mHandledHashes.find(hash) != mHandledHashes.end(); } void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) @@ -437,23 +439,27 @@ void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const Tur generateEncryptionKey(group_id,vpid,vpinfo.encryption_master_key ); - // If we're a server, we need to send our own virtual peer id to the client + // We need to send our own virtual peer id to the other end of the tunnel - if(dir == RsTurtleGenericTunnelItem::DIRECTION_CLIENT) - { - vpinfo.net_service_virtual_peer = makeServerVirtualPeerIdForGroup(group_id); + vpinfo.net_service_virtual_peer = makeServerVirtualPeerIdForGroup(group_id); #ifdef DEBUG_RSGXSNETTUNNEL - GXS_NET_TUNNEL_DEBUG() << " peer is server side: sending back virtual peer name " << vpinfo.net_service_virtual_peer << std::endl; + GXS_NET_TUNNEL_DEBUG() << " sending back virtual peer name " << vpinfo.net_service_virtual_peer << " to end of tunnel" << std::endl; #endif - RsGxsNetTunnelVirtualPeerItem *pitem = new RsGxsNetTunnelVirtualPeerItem ; + RsGxsNetTunnelVirtualPeerItem pitem ; + pitem.virtual_peer_id = vpinfo.net_service_virtual_peer ; - pitem->virtual_peer_id = vpinfo.net_service_virtual_peer ; + RsTemporaryMemory tmpmem( RsGxsNetTunnelSerializer().size(&pitem) ) ; + uint32_t len = tmpmem.size(); - vpinfo.outgoing_items.push_back(pitem) ; - } + RsGxsNetTunnelSerializer().serialise(&pitem,tmpmem,&len); + + RsTurtleGenericDataItem *encrypted_turtle_item = NULL ; + + if(p3turtle::encryptData(tmpmem,len,vpinfo.encryption_master_key,encrypted_turtle_item)) + mTurtle->sendTurtleData(vpid,encrypted_turtle_item) ; else - vpinfo.net_service_virtual_peer.clear(); + GXS_NET_TUNNEL_ERROR() << "cannot encrypt. Something's wrong. Data is dropped." << std::endl; } void RsGxsNetTunnelService::removeVirtualPeer(const TurtleFileHash& hash, const TurtleVirtualPeerId& vpid) @@ -531,6 +537,12 @@ void RsGxsNetTunnelService::autowash() { } +// info.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED; +// +// mTurtle->monitorTunnels(hash,this,false) ; +// info.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED; + + // void RsGxsNetTunnelService::handleIncoming(const RsGxsTunnelId& tunnel_id,RsGxsTunnelItem *item) // { // #ifdef DEBUG_RSGXSNETTUNNEL diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 798b49f1e..901aba61d 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -34,6 +34,10 @@ * * It is the responsibility of RsGxsNetService to activate/desactivate tunnels for each particular group, depending on wether the group * is already available at friends or not. + * + * Tunnel management is done at the level of groups rather than services, because we would like to keep the possibility to not + * request tunnels for some groups which do not need it, and only request tunnels for specific groups that cannot be provided + * by direct connections. */ // Protocol: @@ -61,8 +65,23 @@ // Client <------------------- GXS Data ------------------> Server | // - // Notes: -// * tunnels are only used one-way. If a distant peers wants to sync the same group, he'll have to open his own tunnel, with a different ID. -// * each group will produced multiple tunnels, but each tunnel with have exactly one virtual peer ID +// * tunnels are established symetrically. If a distant peers wants to sync the same group, they'll have to open a single tunnel, with a different ID. +// Groups therefore have two states: +// - managed : the group can be used to answer tunnel requests. If server tunnels are established, the group will be synced with these peers +// - tunneled: the group will actively request tunnels. If tunnels are established both ways, the same virtual peers will be used so the tunnels are "merged". +// * In practice, that means one of the two tunnels will not be used and therefore die. +// * If a tunneled group already has enough virtual peers, it will not request for tunnels itself. +// +// Group policy | Request tunnels | SyncWithPeers | Item receipt +// --------------------+-------------------+-----------------------+---------------- +// Passive | no | If peers present | If peers present +// Active | yes, if no peers | If peers present | If peers present +// | | | +// +// * when a service has the DistSync flag set, groups to sync are communicated passively to the GxsNetTunnel service when requesting distant peers. +// However, a call should be made to set a particular group policy to "ACTIVE" for group that do not have peers and need some. +// +// * services also need to retrieve GXS data items that come out of tunnels. These will be available as (data,len) type, since they are not de-serialized. typedef RsPeerId RsGxsNetTunnelVirtualPeerId ; @@ -75,7 +94,7 @@ struct RsGxsNetTunnelVirtualPeerInfo RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE = 0x02 // virtual peer id is known. Data can transfer. }; - RsGxsNetTunnelVirtualPeerInfo() : vpid_status(RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN) { memset(encryption_master_key,0,16) ; } + RsGxsNetTunnelVirtualPeerInfo() : vpid_status(RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN) { memset(encryption_master_key,0,32) ; } ~RsGxsNetTunnelVirtualPeerInfo() ; uint8_t vpid_status ; // status of the peer @@ -92,14 +111,23 @@ struct RsGxsNetTunnelVirtualPeerInfo struct RsGxsNetTunnelGroupInfo { - enum { RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN = 0x00, // unknown status - RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED = 0x01, // waiting for turtle to send some virtual peers. - RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE = 0x02 // some virtual peers are available + enum GroupStatus { + RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN = 0x00, // unknown status + RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE = 0x01, // no virtual peers requested, just waiting + RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED = 0x02, // virtual peers requested, and waiting for turtle to answer + RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE = 0x03 // some virtual peers are available. Data can be read/written }; - RsGxsNetTunnelGroupInfo() : group_status(RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN),last_contact(0) {} + enum GroupPolicy { + RS_GXS_NET_TUNNEL_GRP_POLICY_UNKNOWN = 0x00, // nothing has been set + RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE = 0x01, // group is available for server side tunnels, but does not explicitely request tunnels + RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE = 0x02, // group explicitely request tunnels, if none available + }; - uint8_t group_status ; + RsGxsNetTunnelGroupInfo() : group_policy(RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE),group_status(RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE),last_contact(0) {} + + GroupPolicy group_policy ; + GroupStatus group_status ; time_t last_contact ; TurtleFileHash hash ; @@ -112,27 +140,32 @@ public: RsGxsNetTunnelService() ; /*! - * \brief start managing tunnels for this group - * @param group_id group for which tunnels should be requested + * \brief Manage tunnels for this group + * @param group_id group for which tunnels should be released */ - bool manage(const RsGxsGroupId& group_id) ; + bool requestPeers(const RsGxsGroupId&group_id) ; /*! * \brief Stop managing tunnels for this group * @param group_id group for which tunnels should be released */ - bool release(const RsGxsGroupId&group_id) ; - + bool releasePeers(const RsGxsGroupId&group_id) ; /*! - * \brief sendItem + * \brief Get the list of active virtual peers for a given group. This implies that a tunnel is up and + * alive. This function also "registers" the group which allows to handle tunnel requests in the server side. + */ + bool getVirtualPeers(const RsGxsGroupId& group_id, std::list& peers) ; // returns the virtual peers for this group + + /*! + * \brief sendData * send data to this virtual peer, and takes memory ownership (deletes the item) * \param item item to send * \param virtual_peer destination virtual peer * \return * true if succeeded. */ - bool sendItem(RsItem *& item, const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; + bool sendData(unsigned char *& data, uint32_t data_len, const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; /*! * \brief receivedItem @@ -142,12 +175,6 @@ public: */ RsItem *receivedItem(const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; - /*! - * \brief Get the list of active virtual peers for a given group. This implies that the tunnel is up and - * alive. - */ - bool getVirtualPeers(const RsGxsGroupId&, std::list& peers) ; // returns the virtual peers for this group - /*! * \brief dumps all information about monitored groups. */ From f0f69b8dd95d411aab8a7e7b892f3d36d5fe8c90 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 29 Mar 2018 16:26:36 +0200 Subject: [PATCH 016/138] shared virtual peers across services --- libretroshare/src/gxs/rsgxsnetservice.cc | 14 ++ libretroshare/src/gxs/rsgxsnettunnel.cc | 273 +++++++++++------------ libretroshare/src/gxs/rsgxsnettunnel.h | 37 ++- 3 files changed, 170 insertions(+), 154 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 914b6ce4e..7962f9bf3 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -565,6 +565,20 @@ void RsGxsNetService::syncWithPeers() std::set peers; mNetMgr->getOnlineList(mServiceInfo.mServiceType, peers); + +#ifdef TODO + if(mAllowDistSync) + { + // Grab all online virtual peers of distant tunnels for the current service. + + std::list vpids ; + mGxsNetTunnel->getVirtualPeers(mServType,vpids); + + for(auto it(vpids.begin());it!=vpids.end();++it) + peers.push_back(RsPeerId(*it)) ; + } +#endif + if (peers.empty()) { // nothing to do return; diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 6d763a092..d5628eed3 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -43,11 +43,9 @@ RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") RsGxsNetTunnelVirtualPeerInfo::~RsGxsNetTunnelVirtualPeerInfo() { - for(auto it(outgoing_items.begin());it!=outgoing_items.end();++it) - delete *it ; - - for(auto it(incoming_data.begin());it!=incoming_data.end();++it) - delete *it ; + for(auto it(providing_set.begin());it!=providing_set.end();++it) + for(auto it2(it->second.incoming_data.begin());it2!=it->second.incoming_data.end();++it2) + delete *it2 ; } //===========================================================================================================================================// @@ -131,8 +129,21 @@ public: unsigned char *& mData; }; +RsGxsNetTunnelService::~RsGxsNetTunnelService() +{ + RS_STACK_MUTEX(mGxsNetTunnelMtx); + + // This is needed because we need to clear these structure in a mutex protected environment + // Also this calls the destructor of the objects which calls the freeing of memory e.g. allocated in the incoming data list. + + mGroups.clear(); + mHandledHashes.clear(); + mVirtualPeers.clear(); +} + bool RsGxsNetTunnelService::sendData(unsigned char *& data,uint32_t data_len,const RsGxsNetTunnelVirtualPeerId& virtual_peer) { + RS_STACK_MUTEX(mGxsNetTunnelMtx); // The item is serialized and encrypted using chacha20+SHA256, using the generic turtle encryption, and then sent to the turtle router. DataAutoDelete iad(data) ; // This ensures the item is deleted whatsoever when leaving @@ -147,25 +158,9 @@ bool RsGxsNetTunnelService::sendData(unsigned char *& data,uint32_t data_len,con return false ; } - auto it2 = mGroups.find(it->second.first); - - if(it2 == mGroups.end()) + if(it->second.vpid_status != RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE) { - GXS_NET_TUNNEL_ERROR() << "cannot find virtual peer " << virtual_peer << ". Data is dropped." << std::endl; - return false ; - } - - auto it3 = it2->second.virtual_peers.find(it->second.second); - - if(it3 == it2->second.virtual_peers.end()) - { - std::cerr << "cannot find turtle virtual peer " << it->second.second << ". Data is dropped." << std::endl; - return false ; - } - - if(it3->second.vpid_status != RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE) - { - GXS_NET_TUNNEL_ERROR() << "virtual peer " << it->second.second << " is not active. Data is dropped." << std::endl; + GXS_NET_TUNNEL_ERROR() << "virtual peer " << virtual_peer << " is not active. Data is dropped." << std::endl; return false ; } @@ -173,18 +168,18 @@ bool RsGxsNetTunnelService::sendData(unsigned char *& data,uint32_t data_len,con RsTurtleGenericDataItem *encrypted_turtle_item = NULL ; - if(!p3turtle::encryptData(data,data_len,it3->second.encryption_master_key,encrypted_turtle_item)) + if(!p3turtle::encryptData(data,data_len,it->second.encryption_master_key,encrypted_turtle_item)) { GXS_NET_TUNNEL_ERROR() << "cannot encrypt. Something's wrong. Data is dropped." << std::endl; return false ; } - mTurtle->sendTurtleData(it->second.second,encrypted_turtle_item) ; + mTurtle->sendTurtleData(it->second.turtle_virtual_peer_id,encrypted_turtle_item) ; return true ; } -bool RsGxsNetTunnelService::getVirtualPeers(const RsGxsGroupId& group_id, std::list& peers) +bool RsGxsNetTunnelService::getVirtualPeers(uint16_t service_id, std::list& peers) { // This function has two effects: // - return the virtual peers for this group @@ -194,21 +189,12 @@ bool RsGxsNetTunnelService::getVirtualPeers(const RsGxsGroupId& group_id, std::l // update the hash entry if needed - RsFileHash hash = calculateGroupHash(group_id); - mHandledHashes[hash] = group_id ; - - // Create the group entry, if needed, with passive mode. - - RsGxsNetTunnelGroupInfo& ginfo( mGroups[group_id] ) ; - - ginfo.hash = hash ; - - for(auto it2 = ginfo.virtual_peers.begin();it2 != ginfo.virtual_peers.end();++it2) - if(it2->second.vpid_status == RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE) - peers.push_back(it2->second.net_service_virtual_peer) ; + for(auto it(mVirtualPeers.begin());it!=mVirtualPeers.end();++it) + if(it->second.providing_set.find(service_id) != it->second.providing_set.end()) + peers.push_back(it->first) ; #ifdef DEBUG_GXS_TUNNEL - GXS_NET_TUNNEL_DEBUG() << "returning " << peers.size() << " peers." << std::endl; + GXS_NET_TUNNEL_DEBUG() << " service " << std::hex << service_id << std::dec << " returning " << peers.size() << " peers." << std::endl; #endif return true ; @@ -243,19 +229,19 @@ bool RsGxsNetTunnelService::releasePeers(const RsGxsGroupId& group_id) return true; } -RsGxsNetTunnelVirtualPeerId RsGxsNetTunnelService::makeServerVirtualPeerIdForGroup(const RsGxsGroupId& group_id) const +RsGxsNetTunnelVirtualPeerId RsGxsNetTunnelService::locked_makeVirtualPeerId() const { assert(RsPeerId::SIZE_IN_BYTES <= Sha1CheckSum::SIZE_IN_BYTES) ; - // We compute sha1( SSL_id | group_id | mRandomBias ) and trunk it to 16 bytes in order to compute a RsPeerId + // We compute sha1( SSL_id | mRandomBias ) and trunk it to 16 bytes in order to compute a RsPeerId RsPeerId ssl_id = rsPeers->getOwnId() ; - unsigned char mem[RsPeerId::SIZE_IN_BYTES + RsGxsGroupId::SIZE_IN_BYTES + RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE]; + unsigned char mem[RsPeerId::SIZE_IN_BYTES /*+ RsGxsGroupId::SIZE_IN_BYTES */ + RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE]; memcpy(mem ,ssl_id.toByteArray() ,RsPeerId::SIZE_IN_BYTES) ; - memcpy(mem+RsPeerId::SIZE_IN_BYTES ,group_id.toByteArray(),RsGxsGroupId::SIZE_IN_BYTES) ; - memcpy(mem+RsPeerId::SIZE_IN_BYTES+RsGxsGroupId::SIZE_IN_BYTES,mRandomBias ,RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE) ; + //memcpy(mem+RsPeerId::SIZE_IN_BYTES ,group_id.toByteArray(),RsGxsGroupId::SIZE_IN_BYTES) ; + memcpy(mem+RsPeerId::SIZE_IN_BYTES /*+RsGxsGroupId::SIZE_IN_BYTES*/,mRandomBias ,RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE) ; return RsGxsNetTunnelVirtualPeerId(RsDirUtil::sha1sum(mem,RsPeerId::SIZE_IN_BYTES+RsGxsGroupId::SIZE_IN_BYTES+RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE).toByteArray()); } @@ -264,12 +250,18 @@ void RsGxsNetTunnelService::dump() const { RS_STACK_MUTEX(mGxsNetTunnelMtx); - static std::string group_status_str[3] = { + static std::string group_status_str[4] = { std::string("[RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN ]"), + std::string("[RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE ]"), std::string("[RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED]"), std::string("[RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE ]") }; + static std::string group_policy_str[3] = { + std::string("[RS_GXS_NET_TUNNEL_POLICY_UNKNOWN]"), + std::string("[RS_GXS_NET_TUNNEL_POLICY_PASSIVE]"), + std::string("[RS_GXS_NET_TUNNEL_POLICY_ACTIVE ]"), + }; static std::string vpid_status_str[3] = { std::string("[RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN ]"), std::string("[RS_GXS_NET_TUNNEL_VP_STATUS_TUNNEL_OK ]"), @@ -281,18 +273,23 @@ void RsGxsNetTunnelService::dump() const for(auto it(mGroups.begin());it!=mGroups.end();++it) { - std::cerr << " " << it->first << " hash: " << it->second.hash << " status: " << group_status_str[it->second.group_status] << "] Last contact: " << time(NULL) - it->second.last_contact << " secs ago" << std::endl; - + std::cerr << " " << it->first << " hash: " << it->second.hash << " policy: " << group_policy_str[it->second.group_policy] << " status: " << group_status_str[it->second.group_status] << "] Last contact: " << time(NULL) - it->second.last_contact << " secs ago" << std::endl; + std::cerr << " virtual peers:" << std::endl; for(auto it2(it->second.virtual_peers.begin());it2!=it->second.virtual_peers.end();++it2) - std::cerr << " turtle:" << it2->first << " status: " << vpid_status_str[it2->second.vpid_status] << " s: " - << (int)it2->second.side << " last seen " << time(NULL)-it2->second.last_contact - << " ekey: " << RsUtil::BinToHex(it2->second.encryption_master_key,RS_GXS_TUNNEL_CONST_EKEY_SIZE) - << " pending (" << it2->second.incoming_data.size() << "," << it2->second.outgoing_items.size() << ")" << std::endl; + std::cerr << " " << *it2 << std::endl; } std::cerr << "Virtual peers: " << std::endl; for(auto it(mVirtualPeers.begin());it!=mVirtualPeers.end();++it) - std::cerr << " GXS Peer:" << it->first << " group_id: " << it->second.first << " Turtle:" << it->second.second << std::endl; + { + std::cerr << " GXS Peer:" << it->first << " Turtle:" << it->second.turtle_virtual_peer_id + << " status: " << vpid_status_str[it->second.vpid_status] << " s: " + << (int)it->second.side << " last seen " << time(NULL)-it->second.last_contact + << " ekey: " << RsUtil::BinToHex(it->second.encryption_master_key,RS_GXS_TUNNEL_CONST_EKEY_SIZE) ; + + for(auto it2(it->second.providing_set.begin());it2!=it->second.providing_set.end();++it2) + std::cerr << " service " << std::hex << it2->first << std::dec << " " << it2->second.provided_groups.size() << " groups, " << it2->second.incoming_data.size() << " data" << std::endl; + } std::cerr << "Hashes: " << std::endl; for(auto it(mHandledHashes.begin());it!=mHandledHashes.end();++it) @@ -311,15 +308,18 @@ void RsGxsNetTunnelService::connectToTurtleRouter(p3turtle *tr) bool RsGxsNetTunnelService::handleTunnelRequest(const RsFileHash &hash,const RsPeerId& peer_id) { + RS_STACK_MUTEX(mGxsNetTunnelMtx); // We simply check for wether a managed group has a hash that corresponds to the given hash. return mHandledHashes.find(hash) != mHandledHashes.end(); } -void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) +void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& turtle_virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) { + RS_STACK_MUTEX(mGxsNetTunnelMtx); + #ifdef DEBUG_RSGXSNETTUNNEL - GXS_NET_TUNNEL_DEBUG() << " received turtle data for vpid " << virtual_peer_id << " for hash " << hash << " in direction " << (int)direction << std::endl; + GXS_NET_TUNNEL_DEBUG() << " received turtle data for vpid " << turtle_virtual_peer_id << " for hash " << hash << " in direction " << (int)direction << std::endl; #endif if(item->PacketSubType() != RS_TURTLE_SUBTYPE_GENERIC_DATA) @@ -327,45 +327,29 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co GXS_NET_TUNNEL_ERROR() << "item with type " << std::hex << item->PacketSubType() << std::dec << " received by GxsNetTunnel, but is not handled!" << std::endl; return; } - - // (cyril) this is a bit complicated. We should store pointers to the encryption keys in another structure and access it directly. + // find the group id auto it = mHandledHashes.find(hash) ; if(it == mHandledHashes.end()) { - GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for hash " << hash << " but this hash is unknown!" << std::endl; + GXS_NET_TUNNEL_ERROR() << "Cannot find hash " << hash << " to be handled by GxsNetTunnel" << std::endl; return; } - RsGxsGroupId group_id = it->second; - auto it2 = mGroups.find(group_id) ; - - if(it2 == mGroups.end()) - { - GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for hash " << hash << " and group " << group_id << " but this group id is unknown!" << std::endl; - return; - } - - RsGxsNetTunnelGroupInfo& g_info(it2->second) ; - - g_info.last_contact = time(NULL) ; - - auto it3 = g_info.virtual_peers.find(virtual_peer_id) ; - - if(it3 == g_info.virtual_peers.end()) - { - GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for hash " << hash << ", group " << group_id << " but the virtual peer id is missing!" << std::endl; - return; - } - - RsGxsNetTunnelVirtualPeerInfo& vp_info(it3->second) ; + // Now check if we got an item to advertise a virtual peer unsigned char *data = NULL ; uint32_t data_size = 0 ; - if(!p3turtle::decryptItem(static_cast(item),vp_info.encryption_master_key,data,data_size)) + // generate the decryption key based on virtual peer id and group id + + uint8_t encryption_master_key[RS_GXS_TUNNEL_CONST_EKEY_SIZE] ; + + generateEncryptionKey(group_id,turtle_virtual_peer_id,encryption_master_key); + + if(!p3turtle::decryptItem(static_cast(item),encryption_master_key,data,data_size)) { GXS_NET_TUNNEL_ERROR() << "Cannot decrypt data!" << std::endl; @@ -375,28 +359,45 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co return ; } - // Now we might get 2 kinds of items: GxsNetTunnel items, to be handled here, and Gxs data items, to be handled by the client service - RsItem *decrypted_item = RsGxsNetTunnelSerializer().deserialise(data,&data_size); - RsGxsNetTunnelVirtualPeerItem *pid_item = dynamic_cast(decrypted_item) ; if(pid_item) { - if(direction == RsTurtleGenericTunnelItem::DIRECTION_SERVER) - { #ifdef DEBUG_RSGXSNETTUNNEL - GXS_NET_TUNNEL_DEBUG() << " item is a virtual peer id item with vpid = "<< pid_item->virtual_peer_id << ". Setting virtual peer." << std::endl; + GXS_NET_TUNNEL_DEBUG() << " item is a virtual peer id item with vpid = "<< pid_item->virtual_peer_id << ". Setting virtual peer." << std::endl; +#endif +#ifdef TODO + vp_info.net_service_virtual_peer = pid_item->virtual_peer_id; + vp_info.vpid_status = RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE ; #endif - vp_info.net_service_virtual_peer = pid_item->virtual_peer_id; - vp_info.vpid_status = RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE ; - } - else - GXS_NET_TUNNEL_ERROR() << "Cannot decrypt data!" << std::endl; free(data); return ; } + +#ifdef TODO + auto it = mTurtle2GxsPeer.find(turtle_virtual_peer_id) ; + + if(it == mTurtle2GxsPeer.end()) + { + GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for vpid " << turtle_virtual_peer_id << " but this vpid is unknown!" << std::endl; + return; + } + + RsGxsNetTunnelVirtualPeerId gxs_vpid = it->second ; + + auto it2 = mVirtualPeers.find(gxs_vpid) ; + + if(it2 == mVirtualPeers.end()) + { + GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for GXS vpid " << gxs_vpid " but the virtual peer id is missing!" << std::endl; + return; + } + + RsGxsNetTunnelVirtualPeerInfo& vp_info(it2->second) ; + + else { #ifdef DEBUG_RSGXSNETTUNNEL @@ -411,10 +412,13 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co vp_info.incoming_data.push_back(bind) ; } +#endif } void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const TurtleVirtualPeerId& vpid,RsTurtleGenericTunnelItem::Direction dir) { + RS_STACK_MUTEX(mGxsNetTunnelMtx); + auto it = mHandledHashes.find(hash) ; if(it == mHandledHashes.end()) @@ -431,23 +435,19 @@ void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const Tur RsGxsNetTunnelGroupInfo& ginfo( mGroups[group_id] ) ; ginfo.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE ; - RsGxsNetTunnelVirtualPeerInfo& vpinfo( ginfo.virtual_peers[vpid] ) ; + uint8_t encryption_master_key[RS_GXS_TUNNEL_CONST_EKEY_SIZE]; - vpinfo.vpid_status = RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_TUNNEL_OK ; - vpinfo.side = dir ; - vpinfo.last_contact = time(NULL) ; - - generateEncryptionKey(group_id,vpid,vpinfo.encryption_master_key ); + generateEncryptionKey(group_id,vpid,encryption_master_key ); // We need to send our own virtual peer id to the other end of the tunnel - vpinfo.net_service_virtual_peer = makeServerVirtualPeerIdForGroup(group_id); + RsGxsNetTunnelVirtualPeerId net_service_virtual_peer = locked_makeVirtualPeerId(); #ifdef DEBUG_RSGXSNETTUNNEL - GXS_NET_TUNNEL_DEBUG() << " sending back virtual peer name " << vpinfo.net_service_virtual_peer << " to end of tunnel" << std::endl; + GXS_NET_TUNNEL_DEBUG() << " sending back virtual peer name " << net_service_virtual_peer << " to end of tunnel" << std::endl; #endif RsGxsNetTunnelVirtualPeerItem pitem ; - pitem.virtual_peer_id = vpinfo.net_service_virtual_peer ; + pitem.virtual_peer_id = net_service_virtual_peer ; RsTemporaryMemory tmpmem( RsGxsNetTunnelSerializer().size(&pitem) ) ; uint32_t len = tmpmem.size(); @@ -456,7 +456,7 @@ void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const Tur RsTurtleGenericDataItem *encrypted_turtle_item = NULL ; - if(p3turtle::encryptData(tmpmem,len,vpinfo.encryption_master_key,encrypted_turtle_item)) + if(p3turtle::encryptData(tmpmem,len,encryption_master_key,encrypted_turtle_item)) mTurtle->sendTurtleData(vpid,encrypted_turtle_item) ; else GXS_NET_TUNNEL_ERROR() << "cannot encrypt. Something's wrong. Data is dropped." << std::endl; @@ -464,6 +464,8 @@ void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const Tur void RsGxsNetTunnelService::removeVirtualPeer(const TurtleFileHash& hash, const TurtleVirtualPeerId& vpid) { + RS_STACK_MUTEX(mGxsNetTunnelMtx); + #ifdef DEBUG_RSGXSNETTUNNEL GXS_NET_TUNNEL_DEBUG() << " removing virtual peer " << vpid << " for hash " << hash << std::endl; #endif @@ -496,7 +498,7 @@ RsFileHash RsGxsNetTunnelService::calculateGroupHash(const RsGxsGroupId& group_i return RsDirUtil::sha1sum(group_id.toByteArray(),RsGxsGroupId::SIZE_IN_BYTES) ; } -void RsGxsNetTunnelService::generateEncryptionKey(const RsGxsGroupId& group_id,const TurtleVirtualPeerId& vpid,unsigned char key[RS_GXS_TUNNEL_CONST_EKEY_SIZE]) const +void RsGxsNetTunnelService::generateEncryptionKey(const RsGxsGroupId& group_id,const TurtleVirtualPeerId& vpid,unsigned char key[RS_GXS_TUNNEL_CONST_EKEY_SIZE]) { // The key is generated as H(group_id | vpid) // Because group_id is not known it shouldn't be possible to recover the key by observing the traffic. @@ -519,12 +521,19 @@ void RsGxsNetTunnelService::data_tick() { GXS_NET_TUNNEL_DEBUG() << std::endl; + time_t now = time(NULL); + // cleanup - autowash(); + static time_t last_autowash = time(NULL); + + if(last_autowash + 5 > now) + { + autowash(); + last_autowash = now; + } static time_t last_dump = time(NULL); - time_t now = time(NULL); if(last_dump + 10 > now) { @@ -535,44 +544,24 @@ void RsGxsNetTunnelService::data_tick() void RsGxsNetTunnelService::autowash() { + RS_STACK_MUTEX(mGxsNetTunnelMtx); + + for(auto it(mGroups.begin());it!=mGroups.end();++it) + { + // check if the group is in active or passive mode, in which case make sure that turtle manages tunnels or not. + // if active, then we check wether they are tunnels are not. If not, we ask turtle to monitor. + + RsGxsNetTunnelGroupInfo& ginfo(it->second) ; + + if(ginfo.group_policy == RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE && ginfo.virtual_peers.empty()) + { + mTurtle->monitorTunnels(ginfo.hash,this,false) ; + ginfo.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED; + } + + if(ginfo.group_policy == RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE) + mTurtle->stopMonitoringTunnels(ginfo.hash); + } } -// info.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED; -// -// mTurtle->monitorTunnels(hash,this,false) ; -// info.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED; - - -// void RsGxsNetTunnelService::handleIncoming(const RsGxsTunnelId& tunnel_id,RsGxsTunnelItem *item) -// { -// #ifdef DEBUG_RSGXSNETTUNNEL -// GXS_NET_TUNNEL_DEBUG() << " received turtle data for vpid " << virtual_peer_id << " for hash " << hash << " in direction " << dir << std::endl; -// #endif -// if(item == NULL) -// return ; -// -// // We have 3 things to do: -// // -// // 1 - if it's a data item, send an ACK -// // 2 - if it's an ack item, mark the item as properly received, and remove it from the queue -// // 3 - if it's a status item, act accordingly. -// -// switch(item->PacketSubType()) -// { -// -// case RS_PKT_SUBTYPE_GXS_TUNNEL_DATA: handleRecvTunnelDataItem(tunnel_id,dynamic_cast(item)) ; -// break ; -// -// case RS_PKT_SUBTYPE_GXS_TUNNEL_DATA_ACK: handleRecvTunnelDataAckItem(tunnel_id,dynamic_cast(item)) ; -// break ; -// -// case RS_PKT_SUBTYPE_GXS_TUNNEL_STATUS: handleRecvStatusItem(tunnel_id,dynamic_cast(item)) ; -// break ; -// -// default: -// std::cerr << "(EE) impossible situation. DH items should be handled at the service level" << std::endl; -// } -// -// delete item ; -// } diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 901aba61d..a8b9e701b 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -82,11 +82,22 @@ // However, a call should be made to set a particular group policy to "ACTIVE" for group that do not have peers and need some. // // * services also need to retrieve GXS data items that come out of tunnels. These will be available as (data,len) type, since they are not de-serialized. +// +// * GxsNetService stores data information (such as update maps) per peerId, so it makes sense to use the same PeerId for all groups of a given service +// Therefore, virtual peers are stored separately from groups, because each one can sync multiple groups. +// +// * virtual peers are also shared among services. This reduces the required amount of tunnels and tunnel requests to send. typedef RsPeerId RsGxsNetTunnelVirtualPeerId ; class RsGxsNetTunnelItem ; +struct RsGxsNetTunnelVirtualPeerProvidingSet +{ + std::set provided_groups ; + std::list incoming_data ; +}; + struct RsGxsNetTunnelVirtualPeerInfo { enum { RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN = 0x00, // unknown status. @@ -102,11 +113,10 @@ struct RsGxsNetTunnelVirtualPeerInfo uint8_t encryption_master_key[32] ; // key from which the encryption key is derived for each virtual peer (using H(master_key | random IV)) time_t last_contact ; // last time some data was sent/recvd - RsGxsNetTunnelVirtualPeerId net_service_virtual_peer ; // anonymised peer that is used to communicate with client services - RsGxsGroupId group_id ; // group id + TurtleVirtualPeerId turtle_virtual_peer_id ; // turtle peer to use when sending data to this vpid. + RsGxsGroupId group_id ; // group id - std::list incoming_data ; - std::list outgoing_items ; + std::map providing_set; // partial list of groups provided by this virtual peer id, based on tunnel results, for each service }; struct RsGxsNetTunnelGroupInfo @@ -124,20 +134,22 @@ struct RsGxsNetTunnelGroupInfo RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE = 0x02, // group explicitely request tunnels, if none available }; - RsGxsNetTunnelGroupInfo() : group_policy(RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE),group_status(RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE),last_contact(0) {} + RsGxsNetTunnelGroupInfo() : group_policy(RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE),group_status(RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE),last_contact(0),service_id(0) {} GroupPolicy group_policy ; GroupStatus group_status ; time_t last_contact ; TurtleFileHash hash ; + uint16_t service_id ; - std::map virtual_peers ; + std::set virtual_peers ; // list of which virtual peers provide this group. Can me more than 1. }; class RsGxsNetTunnelService: public RsTurtleClientService, public RsTickingThread { public: RsGxsNetTunnelService() ; + virtual ~RsGxsNetTunnelService() ; /*! * \brief Manage tunnels for this group @@ -155,7 +167,7 @@ public: * \brief Get the list of active virtual peers for a given group. This implies that a tunnel is up and * alive. This function also "registers" the group which allows to handle tunnel requests in the server side. */ - bool getVirtualPeers(const RsGxsGroupId& group_id, std::list& peers) ; // returns the virtual peers for this group + bool getVirtualPeers(uint16_t service_id, std::list& peers) ; // returns the virtual peers for this group /*! * \brief sendData @@ -204,13 +216,14 @@ private: void autowash() ; void handleIncoming(RsGxsNetTunnelItem *item) ; - static const uint32_t RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE = 16 ; + static const uint32_t RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE = 20 ; static const uint32_t RS_GXS_TUNNEL_CONST_EKEY_SIZE = 32 ; std::map mGroups ; // groups on the client and server side - std::map > mVirtualPeers ; // current virtual peers, - std::map mHandledHashes ; // hashes asked to turtle + std::map mVirtualPeers ; // current virtual peers, which group they provide, and how to talk to them through turtle + std::map mHandledHashes ; // hashes asked to turtle. Used to answer tunnel requests + std::map mTurtle2GxsPeer ; // convertion table to find GXS peer id from turtle /*! * \brief Generates the hash to request tunnels for this group. This hash is only used by turtle, and is used to @@ -224,9 +237,9 @@ private: * tunnel ID and turtle virtual peer id. This allows RsGxsNetService to keep sync-ing the data consistently. */ - RsGxsNetTunnelVirtualPeerId makeServerVirtualPeerIdForGroup(const RsGxsGroupId&group_id) const ; + RsGxsNetTunnelVirtualPeerId locked_makeVirtualPeerId() const ; - void generateEncryptionKey(const RsGxsGroupId& group_id,const TurtleVirtualPeerId& vpid,unsigned char key[RS_GXS_TUNNEL_CONST_EKEY_SIZE]) const ; + static void generateEncryptionKey(const RsGxsGroupId& group_id,const TurtleVirtualPeerId& vpid,unsigned char key[RS_GXS_TUNNEL_CONST_EKEY_SIZE]) ; uint8_t mRandomBias[RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE] ; // constant accross reboots. Allows to disguise the real SSL id while providing a consistent value accross time. From aa59694d881cdf7681ab8aa8379836a5f0317a4a Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 1 Apr 2018 22:04:16 +0200 Subject: [PATCH 017/138] added automatic detection for need to dist-sync groups --- libretroshare/src/gxs/rsgxsnetservice.cc | 118 +++++++++++++++++------ libretroshare/src/gxs/rsgxsnetservice.h | 4 + libretroshare/src/gxs/rsgxsnettunnel.cc | 63 +++++++----- libretroshare/src/gxs/rsgxsnettunnel.h | 18 ++-- libretroshare/src/rsserver/rsinit.cc | 8 +- 5 files changed, 148 insertions(+), 63 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 7962f9bf3..2a17b54d9 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -269,6 +269,7 @@ NXS_NET_DEBUG_5 summary of transactions (useful to just know what comes in/out) NXS_NET_DEBUG_6 group sync statistics (e.g. number of posts at nighbour nodes, etc) NXS_NET_DEBUG_7 encryption/decryption of transactions + NXS_NET_DEBUG_8 gxs distant sync ***/ //#define NXS_NET_DEBUG_0 1 @@ -279,6 +280,7 @@ //#define NXS_NET_DEBUG_5 1 //#define NXS_NET_DEBUG_6 1 //#define NXS_NET_DEBUG_7 1 +#define NXS_NET_DEBUG_8 1 //#define NXS_FRAG @@ -312,11 +314,12 @@ static const uint32_t RS_NXS_ITEM_ENCRYPTION_STATUS_GXS_KEY_MISSING = 0x05 ; // Debug system to allow to print only for some IDs (group, Peer, etc) #if defined(NXS_NET_DEBUG_0) || defined(NXS_NET_DEBUG_1) || defined(NXS_NET_DEBUG_2) || defined(NXS_NET_DEBUG_3) \ - || defined(NXS_NET_DEBUG_4) || defined(NXS_NET_DEBUG_5) || defined(NXS_NET_DEBUG_6) || defined(NXS_NET_DEBUG_7) + || defined(NXS_NET_DEBUG_4) || defined(NXS_NET_DEBUG_5) || defined(NXS_NET_DEBUG_6) || defined(NXS_NET_DEBUG_7) \ + || defined(NXS_NET_DEBUG_8) static const RsPeerId peer_to_print = RsPeerId(std::string("")) ; static const RsGxsGroupId group_id_to_print = RsGxsGroupId(std::string("")) ; // use this to allow to this group id only, or "" for all IDs -static const uint32_t service_to_print = RS_SERVICE_TYPE_GXS_TRANS ; // use this to allow to this service id only, or 0 for all services +static const uint32_t service_to_print = RS_SERVICE_GXS_TYPE_CHANNELS ; // use this to allow to this service id only, or 0 for all services // warning. Numbers should be SERVICE IDS (see serialiser/rsserviceids.h. E.g. 0x0215 for forums) class nullstream: public std::ostream {}; @@ -448,6 +451,7 @@ int RsGxsNetService::tick() { syncWithPeers(); syncGrpStatistics(); + checkDistantSyncState(); mSyncTs = now; } @@ -566,7 +570,6 @@ void RsGxsNetService::syncWithPeers() std::set peers; mNetMgr->getOnlineList(mServiceInfo.mServiceType, peers); -#ifdef TODO if(mAllowDistSync) { // Grab all online virtual peers of distant tunnels for the current service. @@ -575,9 +578,8 @@ void RsGxsNetService::syncWithPeers() mGxsNetTunnel->getVirtualPeers(mServType,vpids); for(auto it(vpids.begin());it!=vpids.end();++it) - peers.push_back(RsPeerId(*it)) ; + peers.insert(RsPeerId(*it)) ; } -#endif if (peers.empty()) { // nothing to do @@ -735,6 +737,62 @@ void RsGxsNetService::syncWithPeers() #endif } +void RsGxsNetService::checkDistantSyncState() +{ + if(!mAllowDistSync) + return ; + + RsGxsGrpMetaTemporaryMap grpMeta; + mDataStore->retrieveGxsGrpMetaData(grpMeta); + + // Go through group statistics and groups without information are re-requested to random peers selected + // among the ones who provided the group info. + +#ifdef NXS_NET_DEBUG_8 + GXSNETDEBUG___<< "Checking distant sync for all groups." << std::endl; +#endif + // get the list of online peers + + std::set online_peers; + mNetMgr->getOnlineList(mServiceInfo.mServiceType , online_peers); + + uint16_t service_id = ((mServiceInfo.mServiceType >> 8)& 0xffff); + + RS_STACK_MUTEX(mNxsMutex) ; + + for(auto it(grpMeta.begin());it!=grpMeta.end();++it) + if(it->second->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED) // we only consider subscribed groups here. + { +#warning (cyril) We might need to also remove peers for recently unsubscribed groups + const RsGxsGroupId& grpId(it->first); + const RsGxsGrpConfig& rec = locked_getGrpConfig(grpId) ; + +#ifdef NXS_NET_DEBUG_6 + GXSNETDEBUG__G(it->first) << " group " << grpId; +#endif + bool at_least_one_friend_is_supplier = false ; + + for(auto it2(rec.suppliers.ids.begin());it2!=rec.suppliers.ids.end() && !at_least_one_friend_is_supplier;++it2) + if(online_peers.find(*it2) != online_peers.end()) // check that the peer is online + at_least_one_friend_is_supplier = true ; + + if(at_least_one_friend_is_supplier) + { + mGxsNetTunnel->releasePeers(service_id,grpId); +#ifdef NXS_NET_DEBUG_8 + GXSNETDEBUG___<< " Group " << grpId << ": suppliers among friends. Releasing peers." << std::endl; +#endif + } + else + { + mGxsNetTunnel->requestPeers(service_id,grpId); +#ifdef NXS_NET_DEBUG_8 + GXSNETDEBUG___<< " Group " << grpId << ": no suppliers among friends. Requesting peers." << std::endl; +#endif + } + } +} + void RsGxsNetService::syncGrpStatistics() { RS_STACK_MUTEX(mNxsMutex) ; @@ -763,44 +821,44 @@ void RsGxsNetService::syncGrpStatistics() #endif if(rec.statistics_update_TS + GROUP_STATS_UPDATE_DELAY < now && rec.suppliers.ids.size() > 0) - { + { #ifdef NXS_NET_DEBUG_6 - GXSNETDEBUG__G(it->first) << " needs update. Randomly asking to some friends" << std::endl; + GXSNETDEBUG__G(it->first) << " needs update. Randomly asking to some friends" << std::endl; #endif - // randomly select GROUP_STATS_UPDATE_NB_PEERS friends among the suppliers of this group + // randomly select GROUP_STATS_UPDATE_NB_PEERS friends among the suppliers of this group - uint32_t n = RSRandom::random_u32() % rec.suppliers.ids.size() ; + uint32_t n = RSRandom::random_u32() % rec.suppliers.ids.size() ; - std::set::const_iterator rit = rec.suppliers.ids.begin(); - for(uint32_t i=0;i::const_iterator rit = rec.suppliers.ids.begin(); + for(uint32_t i=0;ifirst) << " asking friend " << peer_id << " for an update of stats for group " << it->first << std::endl; + GXSNETDEBUG_PG(peer_id,it->first) << " asking friend " << peer_id << " for an update of stats for group " << it->first << std::endl; #endif - RsNxsSyncGrpStatsItem *grs = new RsNxsSyncGrpStatsItem(mServType) ; + RsNxsSyncGrpStatsItem *grs = new RsNxsSyncGrpStatsItem(mServType) ; - grs->request_type = RsNxsSyncGrpStatsItem::GROUP_INFO_TYPE_REQUEST ; + grs->request_type = RsNxsSyncGrpStatsItem::GROUP_INFO_TYPE_REQUEST ; - grs->grpId = it->first ; - grs->PeerId(peer_id) ; + grs->grpId = it->first ; + grs->PeerId(peer_id) ; - sendItem(grs) ; + sendItem(grs) ; + } } - } - } + } #ifdef NXS_NET_DEBUG_6 else GXSNETDEBUG__G(it->first) << " up to date." << std::endl; diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index 49d44dab2..8142f2e74 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -35,6 +35,7 @@ #include "pqi/p3linkmgr.h" #include "rsitems/rsnxsitems.h" #include "rsitems/rsgxsupdateitems.h" +#include "rsgxsnettunnel.h" #include "rsgxsnetutils.h" #include "pqi/p3cfgmgr.h" #include "rsgixs.h" @@ -394,6 +395,7 @@ private: void locked_pushGrpRespFromList(std::list& respList, const RsPeerId& peer, const uint32_t& transN); void locked_pushMsgRespFromList(std::list& itemL, const RsPeerId& sslId, const RsGxsGroupId &grp_id, const uint32_t& transN); + void checkDistantSyncState(); void syncWithPeers(); void syncGrpStatistics(); void addGroupItemToList(NxsTransaction*& tr, @@ -582,6 +584,8 @@ private: uint32_t mDefaultMsgStorePeriod ; uint32_t mDefaultMsgSyncPeriod ; + + RsGxsNetTunnelService *mGxsNetTunnel; }; #endif // RSGXSNETSERVICE_H diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index d5628eed3..c502f2c6d 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -193,14 +193,14 @@ bool RsGxsNetTunnelService::getVirtualPeers(uint16_t service_id, std::listsecond.providing_set.find(service_id) != it->second.providing_set.end()) peers.push_back(it->first) ; -#ifdef DEBUG_GXS_TUNNEL +#ifdef DEBUG_RSGXSNETTUNNEL GXS_NET_TUNNEL_DEBUG() << " service " << std::hex << service_id << std::dec << " returning " << peers.size() << " peers." << std::endl; #endif return true ; } -bool RsGxsNetTunnelService::requestPeers(const RsGxsGroupId& group_id) +bool RsGxsNetTunnelService::requestPeers(uint16_t service_id,const RsGxsGroupId& group_id) { RS_STACK_MUTEX(mGxsNetTunnelMtx); @@ -211,11 +211,14 @@ bool RsGxsNetTunnelService::requestPeers(const RsGxsGroupId& group_id) ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE; // we dont set the group policy here. It will only be set if no peers, or too few peers are available. +#ifdef DEBUG_RSGXSNETTUNNEL + GXS_NET_TUNNEL_DEBUG() << " service " << std::hex << service_id << std::dec << " requesting peers for group " << group_id << std::endl; +#endif return true; } -bool RsGxsNetTunnelService::releasePeers(const RsGxsGroupId& group_id) +bool RsGxsNetTunnelService::releasePeers(uint16_t service_id, const RsGxsGroupId& group_id) { RS_STACK_MUTEX(mGxsNetTunnelMtx); @@ -226,6 +229,9 @@ bool RsGxsNetTunnelService::releasePeers(const RsGxsGroupId& group_id) ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE; mTurtle->stopMonitoringTunnels(ginfo.hash) ; +#ifdef DEBUG_RSGXSNETTUNNEL + GXS_NET_TUNNEL_DEBUG() << " service " << std::hex << service_id << std::dec << " releasing peers for group " << group_id << std::endl; +#endif return true; } @@ -329,14 +335,14 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co } // find the group id - auto it = mHandledHashes.find(hash) ; + auto it4 = mHandledHashes.find(hash) ; - if(it == mHandledHashes.end()) + if(it4 == mHandledHashes.end()) { GXS_NET_TUNNEL_ERROR() << "Cannot find hash " << hash << " to be handled by GxsNetTunnel" << std::endl; return; } - RsGxsGroupId group_id = it->second; + RsGxsGroupId group_id = it4->second; // Now check if we got an item to advertise a virtual peer @@ -367,21 +373,33 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co #ifdef DEBUG_RSGXSNETTUNNEL GXS_NET_TUNNEL_DEBUG() << " item is a virtual peer id item with vpid = "<< pid_item->virtual_peer_id << ". Setting virtual peer." << std::endl; #endif -#ifdef TODO - vp_info.net_service_virtual_peer = pid_item->virtual_peer_id; - vp_info.vpid_status = RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE ; -#endif + // we receive a virtual peer id, so we need to update the local information for this peer id + + mTurtle2GxsPeer[turtle_virtual_peer_id] = pid_item->virtual_peer_id ; + + RsGxsNetTunnelVirtualPeerInfo& vp_info(mVirtualPeers[pid_item->virtual_peer_id]) ; + + vp_info.vpid_status = RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE ; // status of the peer + vp_info.side = direction; // client/server + vp_info.last_contact = time(NULL); // last time some data was sent/recvd + + memcpy(vp_info.encryption_master_key,encryption_master_key,RS_GXS_TUNNEL_CONST_EKEY_SIZE); + + vp_info.turtle_virtual_peer_id = turtle_virtual_peer_id; // turtle peer to use when sending data to this vpid. free(data); return ; } + delete decrypted_item ; + + // item is a generic data item for the client. Let's store the data in the appropriate incoming data queue. -#ifdef TODO auto it = mTurtle2GxsPeer.find(turtle_virtual_peer_id) ; if(it == mTurtle2GxsPeer.end()) { GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for vpid " << turtle_virtual_peer_id << " but this vpid is unknown!" << std::endl; + free(data); return; } @@ -391,28 +409,27 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co if(it2 == mVirtualPeers.end()) { - GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for GXS vpid " << gxs_vpid " but the virtual peer id is missing!" << std::endl; + GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for GXS vpid " << gxs_vpid << " but the virtual peer id is missing!" << std::endl; + free(data); return; } RsGxsNetTunnelVirtualPeerInfo& vp_info(it2->second) ; + uint16_t service_id = getRsItemService(getRsItemId(data)) ; - else - { #ifdef DEBUG_RSGXSNETTUNNEL - GXS_NET_TUNNEL_DEBUG() << " item is GXS data. Storing into incoming list." << std::endl; + GXS_NET_TUNNEL_DEBUG() << "item contains generic data for service " << std::hex << service_id << std::dec << " for VPID " << gxs_vpid << ". Storing in incoming list" << std::endl; #endif - // push the data into the service incoming data list - RsTlvBinaryData *bind = new RsTlvBinaryData; - bind->tlvtype = 0; - bind->bin_len = data_size; - bind->bin_data = data; + // push the data into the service incoming data list - vp_info.incoming_data.push_back(bind) ; - } -#endif + RsTlvBinaryData *bind = new RsTlvBinaryData; + bind->tlvtype = 0; + bind->bin_len = data_size; + bind->bin_data = data; + + vp_info.providing_set[service_id].incoming_data.push_back(bind) ; } void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const TurtleVirtualPeerId& vpid,RsTurtleGenericTunnelItem::Direction dir) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index a8b9e701b..451f5fb9c 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -87,6 +87,13 @@ // Therefore, virtual peers are stored separately from groups, because each one can sync multiple groups. // // * virtual peers are also shared among services. This reduces the required amount of tunnels and tunnel requests to send. +// +// +// How do we know that a group needs distant sync? +// * look into GrpConfigMap for suppliers. Suppliers is cleared at load. +// * last_update_TS in GrpConfigMap is randomised so it cannot be used +// * we need a way to know that there's no suppliers for good reasons (not that we just started) +// * typedef RsPeerId RsGxsNetTunnelVirtualPeerId ; @@ -105,16 +112,15 @@ struct RsGxsNetTunnelVirtualPeerInfo RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE = 0x02 // virtual peer id is known. Data can transfer. }; - RsGxsNetTunnelVirtualPeerInfo() : vpid_status(RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN) { memset(encryption_master_key,0,32) ; } + RsGxsNetTunnelVirtualPeerInfo() : vpid_status(RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN), last_contact(0),side(0) { memset(encryption_master_key,0,32) ; } ~RsGxsNetTunnelVirtualPeerInfo() ; uint8_t vpid_status ; // status of the peer - uint8_t side ; // client/server - uint8_t encryption_master_key[32] ; // key from which the encryption key is derived for each virtual peer (using H(master_key | random IV)) time_t last_contact ; // last time some data was sent/recvd + uint8_t side ; // client/server + uint8_t encryption_master_key[32]; TurtleVirtualPeerId turtle_virtual_peer_id ; // turtle peer to use when sending data to this vpid. - RsGxsGroupId group_id ; // group id std::map providing_set; // partial list of groups provided by this virtual peer id, based on tunnel results, for each service }; @@ -155,13 +161,13 @@ public: * \brief Manage tunnels for this group * @param group_id group for which tunnels should be released */ - bool requestPeers(const RsGxsGroupId&group_id) ; + bool requestPeers(uint16_t service_id, const RsGxsGroupId&group_id) ; /*! * \brief Stop managing tunnels for this group * @param group_id group for which tunnels should be released */ - bool releasePeers(const RsGxsGroupId&group_id) ; + bool releasePeers(uint16_t service_id,const RsGxsGroupId&group_id) ; /*! * \brief Get the list of active virtual peers for a given group. This implies that a tunnel is up and diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 0d9300202..17314626e 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1386,10 +1386,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,true,true,true); mGxsChannels->setNetworkExchangeService(gxschannels_ns) ; From 8fe3eb711d6cae4b6be875dc5deef7e0cc9d8b7a Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 2 Apr 2018 17:07:32 +0200 Subject: [PATCH 018/138] fixed a few bugs in GXS dist sync tunneling --- libretroshare/src/gxs/rsgxsnetservice.cc | 5 ++- libretroshare/src/gxs/rsgxsnetservice.h | 6 +-- libretroshare/src/gxs/rsgxsnettunnel.cc | 51 ++++++++++++++++-------- libretroshare/src/gxs/rsgxsnettunnel.h | 3 ++ libretroshare/src/rsserver/rsinit.cc | 15 ++++--- 5 files changed, 53 insertions(+), 27 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 2a17b54d9..e86d325de 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -362,7 +362,8 @@ RsGxsNetService::RsGxsNetService(uint16_t servType, RsGeneralDataService *gds, RsNxsNetMgr *netMgr, RsNxsObserver *nxsObs, const RsServiceInfo serviceInfo, RsGixsReputation* reputations, RsGcxs* circles, RsGixs *gixs, - PgpAuxUtils *pgpUtils, bool grpAutoSync, bool msgAutoSync, bool distSync, uint32_t default_store_period, uint32_t default_sync_period) + PgpAuxUtils *pgpUtils, RsGxsNetTunnelService *mGxsNT, + bool grpAutoSync, bool msgAutoSync, bool distSync, uint32_t default_store_period, uint32_t default_sync_period) : p3ThreadedService(), p3Config(), mTransactionN(0), mObserver(nxsObs), mDataStore(gds), mServType(servType), mTransactionTimeOut(TRANSAC_TIMEOUT), @@ -370,7 +371,7 @@ RsGxsNetService::RsGxsNetService(uint16_t servType, RsGeneralDataService *gds, mSyncTs(0), mLastKeyPublishTs(0), mLastCleanRejectedMessages(0), mSYNC_PERIOD(SYNC_PERIOD), mCircles(circles), mGixs(gixs), - mReputations(reputations), mPgpUtils(pgpUtils), + mReputations(reputations), mPgpUtils(pgpUtils),mGxsNetTunnel(mGxsNT), mGrpAutoSync(grpAutoSync), mAllowMsgSync(msgAutoSync),mAllowDistSync(distSync), mServiceInfo(serviceInfo), mDefaultMsgStorePeriod(default_store_period), mDefaultMsgSyncPeriod(default_sync_period) diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index 8142f2e74..e798f8717 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -90,7 +90,7 @@ public: RsNxsObserver *nxsObs, // used to be = NULL. const RsServiceInfo serviceInfo, RsGixsReputation* reputations = NULL, RsGcxs* circles = NULL, RsGixs *gixs=NULL, - PgpAuxUtils *pgpUtils = NULL, + PgpAuxUtils *pgpUtils = NULL, RsGxsNetTunnelService *mGxsNT = NULL, bool grpAutoSync = true, bool msgAutoSync = true,bool distSync=false, uint32_t default_store_period = RS_GXS_DEFAULT_MSG_STORE_PERIOD, uint32_t default_sync_period = RS_GXS_DEFAULT_MSG_REQ_PERIOD); @@ -543,6 +543,8 @@ private: RsGixs *mGixs; RsGixsReputation* mReputations; PgpAuxUtils *mPgpUtils; + RsGxsNetTunnelService *mGxsNetTunnel; + bool mGrpAutoSync; bool mAllowMsgSync; bool mAllowDistSync; @@ -584,8 +586,6 @@ private: uint32_t mDefaultMsgStorePeriod ; uint32_t mDefaultMsgSyncPeriod ; - - RsGxsNetTunnelService *mGxsNetTunnel; }; #endif // RSGXSNETSERVICE_H diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index c502f2c6d..3d0f25a15 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -24,6 +24,7 @@ */ #include "util/rsdir.h" +#include "util/rstime.h" #include "retroshare/rspeers.h" #include "serialiser/rstypeserializer.h" #include "rsgxsnettunnel.h" @@ -209,6 +210,9 @@ bool RsGxsNetTunnelService::requestPeers(uint16_t service_id,const RsGxsGroupId& RsGxsNetTunnelGroupInfo& ginfo( mGroups[group_id] ) ; ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE; + ginfo.hash = calculateGroupHash(group_id) ; + + mHandledHashes[ginfo.hash] = group_id ; // we dont set the group policy here. It will only be set if no peers, or too few peers are available. #ifdef DEBUG_RSGXSNETTUNNEL @@ -227,6 +231,10 @@ bool RsGxsNetTunnelService::releasePeers(uint16_t service_id, const RsGxsGroupId RsGxsNetTunnelGroupInfo& ginfo( mGroups[group_id] ) ; ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE; + ginfo.hash = calculateGroupHash(group_id) ; + + mHandledHashes[ginfo.hash] = group_id ; // yes, we do not remove, because we're supposed to answer tunnel requests from other peers. + mTurtle->stopMonitoringTunnels(ginfo.hash) ; #ifdef DEBUG_RSGXSNETTUNNEL @@ -257,21 +265,21 @@ void RsGxsNetTunnelService::dump() const RS_STACK_MUTEX(mGxsNetTunnelMtx); static std::string group_status_str[4] = { - std::string("[RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN ]"), - std::string("[RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE ]"), - std::string("[RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED]"), - std::string("[RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE ]") + std::string("[UNKNOWN ]"), + std::string("[IDLE ]"), + std::string("[TUNNELS_REQUESTED]"), + std::string("[VPIDS_AVAILABLE ]") }; static std::string group_policy_str[3] = { - std::string("[RS_GXS_NET_TUNNEL_POLICY_UNKNOWN]"), - std::string("[RS_GXS_NET_TUNNEL_POLICY_PASSIVE]"), - std::string("[RS_GXS_NET_TUNNEL_POLICY_ACTIVE ]"), + std::string("[UNKNOWN]"), + std::string("[PASSIVE]"), + std::string("[ACTIVE ]"), }; static std::string vpid_status_str[3] = { - std::string("[RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN ]"), - std::string("[RS_GXS_NET_TUNNEL_VP_STATUS_TUNNEL_OK ]"), - std::string("[RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE ]") + std::string("[UNKNOWN ]"), + std::string("[TUNNEL_OK]"), + std::string("[ACTIVE ]") }; std::cerr << "GxsNetTunnelService dump: " << std::endl; @@ -279,7 +287,7 @@ void RsGxsNetTunnelService::dump() const for(auto it(mGroups.begin());it!=mGroups.end();++it) { - std::cerr << " " << it->first << " hash: " << it->second.hash << " policy: " << group_policy_str[it->second.group_policy] << " status: " << group_status_str[it->second.group_status] << "] Last contact: " << time(NULL) - it->second.last_contact << " secs ago" << std::endl; + std::cerr << " " << it->first << " hash: " << it->second.hash << " policy: " << group_policy_str[it->second.group_policy] << " status: " << group_status_str[it->second.group_status] << " Last contact: " << time(NULL) - it->second.last_contact << " secs ago" << std::endl; std::cerr << " virtual peers:" << std::endl; for(auto it2(it->second.virtual_peers.begin());it2!=it->second.virtual_peers.end();++it2) std::cerr << " " << *it2 << std::endl; @@ -291,7 +299,7 @@ void RsGxsNetTunnelService::dump() const std::cerr << " GXS Peer:" << it->first << " Turtle:" << it->second.turtle_virtual_peer_id << " status: " << vpid_status_str[it->second.vpid_status] << " s: " << (int)it->second.side << " last seen " << time(NULL)-it->second.last_contact - << " ekey: " << RsUtil::BinToHex(it->second.encryption_master_key,RS_GXS_TUNNEL_CONST_EKEY_SIZE) ; + << " ekey: " << RsUtil::BinToHex(it->second.encryption_master_key,RS_GXS_TUNNEL_CONST_EKEY_SIZE) << std::endl; for(auto it2(it->second.providing_set.begin());it2!=it->second.providing_set.end();++it2) std::cerr << " service " << std::hex << it2->first << std::dec << " " << it2->second.provided_groups.size() << " groups, " << it2->second.incoming_data.size() << " data" << std::endl; @@ -474,7 +482,7 @@ void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const Tur RsTurtleGenericDataItem *encrypted_turtle_item = NULL ; if(p3turtle::encryptData(tmpmem,len,encryption_master_key,encrypted_turtle_item)) - mTurtle->sendTurtleData(vpid,encrypted_turtle_item) ; + mPendingTurtleItems.push_back(std::make_pair(vpid,encrypted_turtle_item)) ; // we cannot send directly because of turtle mutex locked before calling addVirtualPeer. else GXS_NET_TUNNEL_ERROR() << "cannot encrypt. Something's wrong. Data is dropped." << std::endl; } @@ -536,7 +544,15 @@ void RsGxsNetTunnelService::generateEncryptionKey(const RsGxsGroupId& group_id,c void RsGxsNetTunnelService::data_tick() { - GXS_NET_TUNNEL_DEBUG() << std::endl; + while(!mPendingTurtleItems.empty()) + { + auto& it(mPendingTurtleItems.front()); + + mTurtle->sendTurtleData(it.first,it.second) ; + mPendingTurtleItems.pop_front(); + } + + rstime::rs_usleep(1*1000*1000); // 1 sec time_t now = time(NULL); @@ -544,7 +560,7 @@ void RsGxsNetTunnelService::data_tick() static time_t last_autowash = time(NULL); - if(last_autowash + 5 > now) + if(last_autowash + 5 < now) { autowash(); last_autowash = now; @@ -552,7 +568,7 @@ void RsGxsNetTunnelService::data_tick() static time_t last_dump = time(NULL); - if(last_dump + 10 > now) + if(last_dump + 10 < now) { last_dump = now; dump(); @@ -577,7 +593,10 @@ void RsGxsNetTunnelService::autowash() } if(ginfo.group_policy == RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE) + { mTurtle->stopMonitoringTunnels(ginfo.hash); + ginfo.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE; + } } } diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 451f5fb9c..3d6910d14 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -221,6 +221,7 @@ protected: private: void autowash() ; void handleIncoming(RsGxsNetTunnelItem *item) ; + void flush_pending_items(); static const uint32_t RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE = 20 ; static const uint32_t RS_GXS_TUNNEL_CONST_EKEY_SIZE = 32 ; @@ -231,6 +232,8 @@ private: std::map mHandledHashes ; // hashes asked to turtle. Used to answer tunnel requests std::map mTurtle2GxsPeer ; // convertion table to find GXS peer id from turtle + std::list > mPendingTurtleItems ; // items that need to be sent off-turtle Mutex. + /*! * \brief Generates the hash to request tunnels for this group. This hash is only used by turtle, and is used to * hide the real group id. diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 17314626e..c51abf01e 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1300,7 +1300,7 @@ int RsServer::StartupRetroShare() RS_SERVICE_GXS_TYPE_GXSID, gxsid_ds, nxsMgr, mGxsIdService, mGxsIdService->getServiceInfo(), mReputations, mGxsCircles,mGxsIdService, - pgpAuxUtils, + pgpAuxUtils,NULL, false,false); // don't synchronise group automatic (need explicit group request) // don't sync messages at all. @@ -1319,9 +1319,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) ; @@ -1379,6 +1377,8 @@ int RsServer::StartupRetroShare() /**** Channel GXS service ****/ + RsGxsNetTunnelService *mGxsNetTunnel = new RsGxsNetTunnelService ; + RsGeneralDataService* gxschannels_ds = new RsDataService(currGxsDir + "/", "gxschannels_db", RS_SERVICE_GXS_TYPE_CHANNELS, NULL, rsInitConfig->gxs_passwd); @@ -1389,7 +1389,7 @@ int RsServer::StartupRetroShare() RS_SERVICE_GXS_TYPE_CHANNELS, gxschannels_ds, nxsMgr, mGxsChannels, mGxsChannels->getServiceInfo(), mReputations, mGxsCircles,mGxsIdService, - pgpAuxUtils,true,true,true); + pgpAuxUtils,mGxsNetTunnel,true,true,true); mGxsChannels->setNetworkExchangeService(gxschannels_ns) ; @@ -1444,7 +1444,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); @@ -1486,6 +1486,7 @@ int RsServer::StartupRetroShare() // connect components to turtle router. + mGxsNetTunnel->connectToTurtleRouter(tr) ; ftserver->connectToTurtleRouter(tr) ; ftserver->connectToFileDatabase(fdb) ; chatSrv->connectToGxsTunnelService(mGxsTunnels) ; @@ -1824,6 +1825,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"); From 7d561bccebb56989842eb9bb923d939ea807c418 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 4 Apr 2018 21:41:21 +0200 Subject: [PATCH 019/138] added distant data access in GxsNetService --- libretroshare/src/gxs/rsgxsnetservice.cc | 80 +++++++++++++++++------- libretroshare/src/gxs/rsgxsnetservice.h | 3 + libretroshare/src/gxs/rsgxsnettunnel.cc | 56 ++++++++++++----- libretroshare/src/gxs/rsgxsnettunnel.h | 24 +++++-- 4 files changed, 120 insertions(+), 43 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index e86d325de..cd68ea6bf 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -336,7 +336,6 @@ static std::string nice_time_stamp(time_t now,time_t TS) } } - static std::ostream& gxsnetdebug(const RsPeerId& peer_id,const RsGxsGroupId& grp_id,uint32_t service_type) { static nullstream null ; @@ -611,7 +610,7 @@ void RsGxsNetService::syncWithPeers() #ifdef NXS_NET_DEBUG_5 GXSNETDEBUG_P_(*sit) << "Service "<< std::hex << ((mServiceInfo.mServiceType >> 8)& 0xffff) << std::dec << " sending global group TS of peer id: " << *sit << " ts=" << nice_time_stamp(time(NULL),updateTS) << " (secs ago) to himself" << std::endl; #endif - sendItem(grp); + generic_sendItem(grp); } if(!mAllowMsgSync) @@ -727,7 +726,7 @@ void RsGxsNetService::syncWithPeers() #ifdef NXS_NET_DEBUG_7 GXSNETDEBUG_PG(*sit,grpId) << " Service " << std::hex << ((mServiceInfo.mServiceType >> 8)& 0xffff) << std::dec << " sending message TS of peer id: " << *sit << " ts=" << nice_time_stamp(time(NULL),updateTS) << " (secs ago) for group " << grpId << " to himself - in clear " << std::endl; #endif - sendItem(msg); + generic_sendItem(msg); #ifdef NXS_NET_DEBUG_5 GXSNETDEBUG_PG(*sit,grpId) << "Service "<< std::hex << ((mServiceInfo.mServiceType >> 8)& 0xffff) << std::dec << " sending global message TS of peer id: " << *sit << " ts=" << nice_time_stamp(time(NULL),updateTS) << " (secs ago) for group " << grpId << " to himself" << std::endl; @@ -738,6 +737,28 @@ void RsGxsNetService::syncWithPeers() #endif } +void RsGxsNetService::generic_sendItem(RsNxsItem *si) +{ + // check if the item is to be sent to a distant peer or not + + if(mAllowDistSync && mGxsNetTunnel->isDistantPeer( static_cast(si->PeerId()))) + { + RsNxsSerialiser ser(mServType); + + uint32_t size = ser.size(si); + unsigned char *mem = (unsigned char *)rs_malloc(size) ; + + if(!mem) + return ; + + ser.serialise(si,mem,&size) ; + + mGxsNetTunnel->sendData(mem,size,static_cast(si->PeerId())); + } + else + sendItem(si) ; +} + void RsGxsNetService::checkDistantSyncState() { if(!mAllowDistSync) @@ -757,8 +778,6 @@ void RsGxsNetService::checkDistantSyncState() std::set online_peers; mNetMgr->getOnlineList(mServiceInfo.mServiceType , online_peers); - uint16_t service_id = ((mServiceInfo.mServiceType >> 8)& 0xffff); - RS_STACK_MUTEX(mNxsMutex) ; for(auto it(grpMeta.begin());it!=grpMeta.end();++it) @@ -779,14 +798,14 @@ void RsGxsNetService::checkDistantSyncState() if(at_least_one_friend_is_supplier) { - mGxsNetTunnel->releasePeers(service_id,grpId); + mGxsNetTunnel->releasePeers(mServType,grpId); #ifdef NXS_NET_DEBUG_8 GXSNETDEBUG___<< " Group " << grpId << ": suppliers among friends. Releasing peers." << std::endl; #endif } else { - mGxsNetTunnel->requestPeers(service_id,grpId); + mGxsNetTunnel->requestPeers(mServType,grpId); #ifdef NXS_NET_DEBUG_8 GXSNETDEBUG___<< " Group " << grpId << ": no suppliers among friends. Requesting peers." << std::endl; #endif @@ -856,7 +875,7 @@ void RsGxsNetService::syncGrpStatistics() grs->grpId = it->first ; grs->PeerId(peer_id) ; - sendItem(grs) ; + generic_sendItem(grs) ; } } } @@ -937,7 +956,7 @@ void RsGxsNetService::handleRecvSyncGrpStatistics(RsNxsSyncGrpStatsItem *grs) GXSNETDEBUG_PG(grs->PeerId(),grs->grpId) << " sending back statistics item with " << vec.size() << " elements." << std::endl; #endif - sendItem(grs_resp) ; + generic_sendItem(grs_resp) ; } else if(grs->request_type == RsNxsSyncGrpStatsItem::GROUP_INFO_TYPE_RESPONSE) { @@ -1638,11 +1657,30 @@ RsSerialiser *RsGxsNetService::setupSerialiser() return rss; } +RsItem *RsGxsNetService::generic_recvItem() +{ + { + RsItem *item ; + + if(NULL != (item=recvItem())) + return item ; + } + + unsigned char *data = NULL ; + uint32_t size = 0 ; + RsGxsNetTunnelVirtualPeerId virtual_peer_id ; + + if(mGxsNetTunnel->receiveData(mServType,data,size,virtual_peer_id)) + return dynamic_cast(RsNxsSerialiser(mServType).deserialise(data,&size)) ; + + return NULL ; +} + void RsGxsNetService::recvNxsItemQueue() { RsItem *item ; - while(NULL != (item=recvItem())) + while(NULL != (item=generic_recvItem())) { #ifdef NXS_NET_DEBUG_1 GXSNETDEBUG_P_(item->PeerId()) << "Received RsGxsNetService Item:" << (void*)item << " type=" << std::hex << item->PacketId() << std::dec << std::endl ; @@ -2243,7 +2281,7 @@ void RsGxsNetService::processTransactions() lit_end = tr->mItems.end(); for(; lit != lit_end; ++lit){ - sendItem(*lit); + generic_sendItem(*lit); } tr->mItems.clear(); // clear so they don't get deleted in trans cleaning @@ -2352,7 +2390,7 @@ void RsGxsNetService::processTransactions() trans->transactFlag = RsNxsTransacItem::FLAG_END_SUCCESS; trans->transactionNumber = transN; trans->PeerId(tr->mTransaction->PeerId()); - sendItem(trans); + generic_sendItem(trans); // move to completed transactions @@ -2395,7 +2433,7 @@ void RsGxsNetService::processTransactions() (tr->mTransaction->transactFlag & RsNxsTransacItem::FLAG_TYPE_MASK); trans->transactionNumber = transN; trans->PeerId(tr->mTransaction->PeerId()); - sendItem(trans); + generic_sendItem(trans); tr->mFlag = NxsTransaction::FLAG_STATE_RECEIVING; } @@ -2772,7 +2810,7 @@ void RsGxsNetService::locked_pushMsgTransactionFromList(std::list& r newTrans->mTransaction->PeerId(mOwnId); if (locked_addTransaction(newTrans)) - sendItem(transac); + generic_sendItem(transac); else { delete newTrans; @@ -3068,7 +3106,7 @@ void RsGxsNetService::locked_pushGrpTransactionFromList( std::list& newTrans->mTransaction->PeerId(mOwnId); if (locked_addTransaction(newTrans)) - sendItem(transac); + generic_sendItem(transac); else { delete newTrans; @@ -3272,8 +3310,8 @@ void RsGxsNetService::locked_genSendGrpsTransaction(NxsTransaction* tr) ntr->PeerId(tr->mTransaction->PeerId()); if(locked_addTransaction(newTr)) - sendItem(ntr); - else + generic_sendItem(ntr); + else { delete ntr ; delete newTr; @@ -3567,7 +3605,7 @@ void RsGxsNetService::locked_genSendMsgsTransaction(NxsTransaction* tr) ntr->PeerId(tr->mTransaction->PeerId()); if(locked_addTransaction(newTr)) - sendItem(ntr); + generic_sendItem(ntr); else { delete ntr ; @@ -3886,7 +3924,7 @@ void RsGxsNetService::locked_pushGrpRespFromList(std::list& respList << peer << " with " << respList.size() << " groups " << std::endl; #endif if(locked_addTransaction(tr)) - sendItem(trItem); + generic_sendItem(trItem); else { delete tr ; @@ -4411,7 +4449,7 @@ void RsGxsNetService::locked_pushMsgRespFromList(std::list& itemL, c #endif // signal peer to prepare for transaction if(locked_addTransaction(tr)) - sendItem(trItem); + generic_sendItem(trItem); else { delete tr ; @@ -4798,7 +4836,7 @@ void RsGxsNetService::sharePublishKeysPending() publishKeyItem->private_key = publishKey ; publishKeyItem->PeerId(*it); - sendItem(publishKeyItem); + generic_sendItem(publishKeyItem); #ifdef NXS_NET_DEBUG_3 GXSNETDEBUG_PG(*it,grpMeta->mGroupId) << " sent key item to " << *it << std::endl; #endif diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index e798f8717..aac6c474a 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -495,6 +495,9 @@ private: void cleanRejectedMessages(); void processObserverNotifications(); + void generic_sendItem(RsNxsItem *si); + RsItem *generic_recvItem(); + private: static void locked_checkDelay(uint32_t& time_in_secs); diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 3d0f25a15..65ae72111 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -38,17 +38,6 @@ RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") {} -//===========================================================================================================================================// -// Internal structures // -//===========================================================================================================================================// - -RsGxsNetTunnelVirtualPeerInfo::~RsGxsNetTunnelVirtualPeerInfo() -{ - for(auto it(providing_set.begin());it!=providing_set.end();++it) - for(auto it2(it->second.incoming_data.begin());it2!=it->second.incoming_data.end();++it2) - delete *it2 ; -} - //===========================================================================================================================================// // Transport Items // //===========================================================================================================================================// @@ -140,6 +129,40 @@ RsGxsNetTunnelService::~RsGxsNetTunnelService() mGroups.clear(); mHandledHashes.clear(); mVirtualPeers.clear(); + mIncomingData.clear(); +} + +bool RsGxsNetTunnelService::isDistantPeer(const RsGxsNetTunnelVirtualPeerId& virtual_peer) +{ + RS_STACK_MUTEX(mGxsNetTunnelMtx); + + return mVirtualPeers.find(virtual_peer) != mVirtualPeers.end(); +} + +bool RsGxsNetTunnelService::receiveData(uint16_t service_id,unsigned char *& data,uint32_t& data_len,RsGxsNetTunnelVirtualPeerId& virtual_peer) +{ + RS_STACK_MUTEX(mGxsNetTunnelMtx); + + std::list >& lst(mIncomingData[service_id]) ; + + if(lst.empty()) + { + data = NULL; + data_len = 0; + return false ; + } + + data = (unsigned char*)lst.front().second->bin_data ; + data_len = lst.front().second->bin_len ; + virtual_peer = lst.front().first; + + lst.front().second->bin_data = NULL ; // avoids deletion + lst.front().second->bin_len = 0 ; // avoids deletion + + delete lst.front().second; + lst.pop_front(); + + return true; } bool RsGxsNetTunnelService::sendData(unsigned char *& data,uint32_t data_len,const RsGxsNetTunnelVirtualPeerId& virtual_peer) @@ -297,12 +320,12 @@ void RsGxsNetTunnelService::dump() const for(auto it(mVirtualPeers.begin());it!=mVirtualPeers.end();++it) { std::cerr << " GXS Peer:" << it->first << " Turtle:" << it->second.turtle_virtual_peer_id - << " status: " << vpid_status_str[it->second.vpid_status] << " s: " + << " status: " << vpid_status_str[it->second.vpid_status] << " direction: " << (int)it->second.side << " last seen " << time(NULL)-it->second.last_contact - << " ekey: " << RsUtil::BinToHex(it->second.encryption_master_key,RS_GXS_TUNNEL_CONST_EKEY_SIZE) << std::endl; + << " ekey: " << RsUtil::BinToHex(it->second.encryption_master_key,RS_GXS_TUNNEL_CONST_EKEY_SIZE,10) << std::endl; for(auto it2(it->second.providing_set.begin());it2!=it->second.providing_set.end();++it2) - std::cerr << " service " << std::hex << it2->first << std::dec << " " << it2->second.provided_groups.size() << " groups, " << it2->second.incoming_data.size() << " data" << std::endl; + std::cerr << " service " << std::hex << it2->first << std::dec << " " << it2->second.provided_groups.size() << " groups" << std::endl; } std::cerr << "Hashes: " << std::endl; @@ -422,8 +445,6 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co return; } - RsGxsNetTunnelVirtualPeerInfo& vp_info(it2->second) ; - uint16_t service_id = getRsItemService(getRsItemId(data)) ; #ifdef DEBUG_RSGXSNETTUNNEL @@ -437,7 +458,7 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co bind->bin_len = data_size; bind->bin_data = data; - vp_info.providing_set[service_id].incoming_data.push_back(bind) ; + mIncomingData[service_id].push_back(std::make_pair(gxs_vpid,bind)) ; } void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const TurtleVirtualPeerId& vpid,RsTurtleGenericTunnelItem::Direction dir) @@ -459,6 +480,7 @@ void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const Tur RsGxsNetTunnelGroupInfo& ginfo( mGroups[group_id] ) ; ginfo.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE ; + ginfo.virtual_peers.insert(vpid); uint8_t encryption_master_key[RS_GXS_TUNNEL_CONST_EKEY_SIZE]; diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 3d6910d14..7543689a2 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -113,7 +113,7 @@ struct RsGxsNetTunnelVirtualPeerInfo }; RsGxsNetTunnelVirtualPeerInfo() : vpid_status(RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN), last_contact(0),side(0) { memset(encryption_master_key,0,32) ; } - ~RsGxsNetTunnelVirtualPeerInfo() ; + virtual ~RsGxsNetTunnelVirtualPeerInfo(){} uint8_t vpid_status ; // status of the peer time_t last_contact ; // last time some data was sent/recvd @@ -186,12 +186,24 @@ public: bool sendData(unsigned char *& data, uint32_t data_len, const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; /*! - * \brief receivedItem - * returns the next received item from the given virtual peer. - * \param virtual_peer + * \brief receiveData + * returns the next piece of data received fro the given service, and the virtual GXS peer that sended it. + * \param service_id service that provide the data + * \param data memory check containing the data. Memory ownership belongs to the client. + * \param data_len length of memory chunk + * \param virtual_peer peer who sent the data * \return + * true if something is returned. If not, data is set to NULL, data_len to 0. */ - RsItem *receivedItem(const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; + bool receiveData(uint16_t service_id,unsigned char *& data,uint32_t& data_len,RsGxsNetTunnelVirtualPeerId& virtual_peer) ; + + /*! + * \brief isDistantPeer + * returns wether the peer is in the list of available distant peers or not + * \return true if the peer is a distant GXS peer. + */ + + bool isDistantPeer(const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; /*! * \brief dumps all information about monitored groups. @@ -234,6 +246,8 @@ private: std::list > mPendingTurtleItems ; // items that need to be sent off-turtle Mutex. + std::map > > mIncomingData; // list of incoming data items, per service. + /*! * \brief Generates the hash to request tunnels for this group. This hash is only used by turtle, and is used to * hide the real group id. From 5775203b69bd11992ae0d4ff4dfbf5fb45cf243d Mon Sep 17 00:00:00 2001 From: RetroPooh Date: Thu, 5 Apr 2018 22:22:54 +0300 Subject: [PATCH 020/138] bring back open local file on link click --- retroshare-gui/src/gui/RetroShareLink.cpp | 184 +++++++++++----------- 1 file changed, 96 insertions(+), 88 deletions(-) diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp index 5b45ff584..ad149c15a 100644 --- a/retroshare-gui/src/gui/RetroShareLink.cpp +++ b/retroshare-gui/src/gui/RetroShareLink.cpp @@ -1388,11 +1388,104 @@ static void processList(const QStringList &list, const QString &textSingular, co case TYPE_FILE: { - col.merge_in(link.name(),link.size(),RsFileHash(link.hash().toStdString())) ; - fileLinkFound = true; + FileInfo fi1; + if(links.size()==1 && rsFiles->alreadyHaveFile(RsFileHash(link.hash().toStdString()), fi1)) + { + /* fallthrough */ + } + else + { + col.merge_in(link.name(),link.size(),RsFileHash(link.hash().toStdString())) ; + fileLinkFound = true; + break; + } + } + //break; + case TYPE_EXTRAFILE: + { +#ifdef DEBUG_RSLINK + std::cerr << " RetroShareLink::process FileRequest : fileName : " << link.name().toUtf8().constData() << ". fileHash : " << link.hash().toStdString() << ". fileSize : " << link.size() << std::endl; +#endif + + needNotifySuccess = true; + std::list srcIds; + + // Add the link built-in source. This is needed for EXTRA files, where the source is specified in the link. + + if(link.type() == TYPE_EXTRAFILE) + { +#ifdef DEBUG_RSLINK + std::cerr << " RetroShareLink::process Adding built-in source " << link.SSLId().toStdString() << std::endl; +#endif + srcIds.push_back(RsPeerId(link.SSLId().toStdString())) ; + } + + // Get a list of available direct sources, in case the file is browsable only. + // + FileInfo finfo ; + rsFiles->FileDetails(RsFileHash(link.hash().toStdString()), RS_FILE_HINTS_REMOTE, finfo) ; + + for(std::vector::const_iterator it(finfo.peers.begin());it!=finfo.peers.end();++it) + { +#ifdef DEBUG_RSLINK + std::cerr << " adding peerid " << (*it).peerId << std::endl ; +#endif + srcIds.push_back((*it).peerId) ; + } + + QString cleanname = link.name() ; + static const QString bad_chars_str = "/\\\"*:?<>|" ; + + for(int i=0;ialreadyHaveFile(RsFileHash(link.hash().toStdString()), fi)) { + /* make path for downloaded file */ + std::string path; + path = fi.path;//Shared files has path with filename included + + //Seems that all FileInfo get .path==filepath+filename + //if (fi.downloadStatus == FT_STATE_COMPLETE) + // path = fi.path + "/" + fi.fname; + + QFileInfo qinfo; + qinfo.setFile(QString::fromUtf8(path.c_str())); + if (qinfo.exists() && qinfo.isFile() && !dontOpenNextFile) { + QString question = ""; + question += QObject::tr("Warning: Retroshare is about to ask your system to open this file. "); + question += QObject::tr("Before you do so, please make sure that this file does not contain malicious executable code."); + question += "

" + cleanname + ""; + + QMessageBox mb(QObject::tr("Confirmation"), question, QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No, links.size()>1 ? QMessageBox::NoToAll : 0, 0); + int ret = mb.exec(); + if(ret == QMessageBox::Yes) { + ++countFileOpened; + bFileOpened = true; + /* open file with a suitable application */ + if (!RsUrlHandler::openUrl(QUrl::fromLocalFile(qinfo.absoluteFilePath()))) { + std::cerr << "RetroShareLink::process(): can't open file " << path << std::endl; + } + } else if (ret == QMessageBox::NoToAll) { + dontOpenNextFile = true; + } + } + } + + if (rsFiles->FileRequest(cleanname.toUtf8().constData(), RsFileHash(link.hash().toStdString()), link.size(), "", RS_FILE_REQ_ANONYMOUS_ROUTING, srcIds)) { + fileAdded.append(link.name()); + } else { + if (!bFileOpened) fileExist.append(link.name()); + } } break; - + case TYPE_PERSON: { #ifdef DEBUG_RSLINK @@ -1547,91 +1640,6 @@ static void processList(const QStringList &list, const QString &textSingular, co } break ; - case TYPE_EXTRAFILE: - { -#ifdef DEBUG_RSLINK - std::cerr << " RetroShareLink::process FileRequest : fileName : " << link.name().toUtf8().constData() << ". fileHash : " << link.hash().toStdString() << ". fileSize : " << link.size() << std::endl; -#endif - - needNotifySuccess = true; - std::list srcIds; - - // Add the link built-in source. This is needed for EXTRA files, where the source is specified in the link. - - if(link.type() == TYPE_EXTRAFILE) - { -#ifdef DEBUG_RSLINK - std::cerr << " RetroShareLink::process Adding built-in source " << link.SSLId().toStdString() << std::endl; -#endif - srcIds.push_back(RsPeerId(link.SSLId().toStdString())) ; - } - - // Get a list of available direct sources, in case the file is browsable only. - // - FileInfo finfo ; - rsFiles->FileDetails(RsFileHash(link.hash().toStdString()), RS_FILE_HINTS_REMOTE, finfo) ; - - for(std::vector::const_iterator it(finfo.peers.begin());it!=finfo.peers.end();++it) - { -#ifdef DEBUG_RSLINK - std::cerr << " adding peerid " << (*it).peerId << std::endl ; -#endif - srcIds.push_back((*it).peerId) ; - } - - QString cleanname = link.name() ; - static const QString bad_chars_str = "/\\\"*:?<>|" ; - - for(int i=0;ialreadyHaveFile(RsFileHash(link.hash().toStdString()), fi)) { - /* make path for downloaded file */ - std::string path; - path = fi.path;//Shared files has path with filename included - - //Seems that all FileInfo get .path==filepath+filename - //if (fi.downloadStatus == FT_STATE_COMPLETE) - // path = fi.path + "/" + fi.fname; - - QFileInfo qinfo; - qinfo.setFile(QString::fromUtf8(path.c_str())); - if (qinfo.exists() && qinfo.isFile() && !dontOpenNextFile) { - QString question = ""; - question += QObject::tr("Warning: Retroshare is about to ask your system to open this file. "); - question += QObject::tr("Before you do so, please make sure that this file does not contain malicious executable code."); - question += "

" + cleanname + ""; - - QMessageBox mb(QObject::tr("Confirmation"), question, QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No, links.size()>1 ? QMessageBox::NoToAll : 0, 0); - int ret = mb.exec(); - if(ret == QMessageBox::Yes) { - ++countFileOpened; - bFileOpened = true; - /* open file with a suitable application */ - if (!RsUrlHandler::openUrl(QUrl::fromLocalFile(qinfo.absoluteFilePath()))) { - std::cerr << "RetroShareLink::process(): can't open file " << path << std::endl; - } - } else if (ret == QMessageBox::NoToAll) { - dontOpenNextFile = true; - } - } - } - - if (rsFiles->FileRequest(cleanname.toUtf8().constData(), RsFileHash(link.hash().toStdString()), link.size(), "", RS_FILE_REQ_ANONYMOUS_ROUTING, srcIds)) { - fileAdded.append(link.name()); - } else { - if (!bFileOpened) fileExist.append(link.name()); - } - } - break; - //TYPE_PRIVATE_CHAT case TYPE_PUBLIC_MSG: From 154f089dd4b1325d72af91a4e61ff6852a7bd46b Mon Sep 17 00:00:00 2001 From: RetroPooh Date: Fri, 6 Apr 2018 12:50:10 +0300 Subject: [PATCH 021/138] fixes --- retroshare-gui/src/gui/RetroShareLink.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp index ad149c15a..a8c20c8af 100644 --- a/retroshare-gui/src/gui/RetroShareLink.cpp +++ b/retroshare-gui/src/gui/RetroShareLink.cpp @@ -1389,7 +1389,8 @@ static void processList(const QStringList &list, const QString &textSingular, co case TYPE_FILE: { FileInfo fi1; - if(links.size()==1 && rsFiles->alreadyHaveFile(RsFileHash(link.hash().toStdString()), fi1)) + if(links.size()==1 && rsFiles->alreadyHaveFile(RsFileHash(link.hash().toStdString()), fi1) + && !link.name().endsWith(RsCollection::ExtensionString)) { /* fallthrough */ } @@ -1475,14 +1476,14 @@ static void processList(const QStringList &list, const QString &textSingular, co } else if (ret == QMessageBox::NoToAll) { dontOpenNextFile = true; } + needNotifySuccess = false; } } if (rsFiles->FileRequest(cleanname.toUtf8().constData(), RsFileHash(link.hash().toStdString()), link.size(), "", RS_FILE_REQ_ANONYMOUS_ROUTING, srcIds)) { fileAdded.append(link.name()); } else { - if (!bFileOpened) fileExist.append(link.name()); - } + if (!bFileOpened && links.size()>1) fileExist.append(link.name());} } break; @@ -1780,6 +1781,8 @@ static void processList(const QStringList &list, const QString &textSingular, co QString result; + + if (flag & (RSLINK_PROCESS_NOTIFY_SUCCESS | RSLINK_PROCESS_NOTIFY_ERROR)) { result += (links.count() == 1 ? QObject::tr("%1 of %2 RetroShare link processed.") : QObject::tr("%1 of %2 RetroShare links processed.")).arg(countProcessed).arg(links.count()) + "

"; } From dceeab0e4df9cd3eb31ab45bc403649286843b6a Mon Sep 17 00:00:00 2001 From: RetroPooh Date: Fri, 6 Apr 2018 13:02:30 +0300 Subject: [PATCH 022/138] cleanup --- retroshare-gui/src/gui/RetroShareLink.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp index a8c20c8af..5a0f7c7ce 100644 --- a/retroshare-gui/src/gui/RetroShareLink.cpp +++ b/retroshare-gui/src/gui/RetroShareLink.cpp @@ -1781,8 +1781,6 @@ static void processList(const QStringList &list, const QString &textSingular, co QString result; - - if (flag & (RSLINK_PROCESS_NOTIFY_SUCCESS | RSLINK_PROCESS_NOTIFY_ERROR)) { result += (links.count() == 1 ? QObject::tr("%1 of %2 RetroShare link processed.") : QObject::tr("%1 of %2 RetroShare links processed.")).arg(countProcessed).arg(links.count()) + "

"; } From a14b1f60a2b62f693d1db75356fa20cc7acd9431 Mon Sep 17 00:00:00 2001 From: RetroPooh Date: Fri, 6 Apr 2018 14:01:52 +0300 Subject: [PATCH 023/138] tooltips improv --- retroshare-gui/src/gui/RetroShareLink.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp index 5a0f7c7ce..ed9484f08 100644 --- a/retroshare-gui/src/gui/RetroShareLink.cpp +++ b/retroshare-gui/src/gui/RetroShareLink.cpp @@ -860,17 +860,17 @@ QString RetroShareLink::title() const break; case TYPE_FILE: - return QString("%1 (%2)").arg(hash()).arg(misc::friendlyUnit(size())); + return QString("Size: %2 hash: %1").arg(hash()).arg(misc::friendlyUnit(size())); case TYPE_PERSON: return PeerDefs::rsidFromId(RsPgpId(hash().toStdString())); case TYPE_FORUM: - /* fallthrough */ + return QString("Forum id: %1").arg(hash()); case TYPE_CHANNEL: - /* fallthrough */ + return QString("Channel id: %1").arg(hash()); case TYPE_SEARCH: - break; + return QString("Search files"); case TYPE_MESSAGE: return PeerDefs::rsidFromId(RsPeerId(hash().toStdString())); From 2b9139bf85e26792f85a653bab12f82aeedcf728 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 6 Apr 2018 15:26:54 +0200 Subject: [PATCH 024/138] improved GXS dist sync item handling --- libretroshare/src/gxs/rsgxsnetservice.cc | 11 ++- libretroshare/src/gxs/rsgxsnettunnel.cc | 89 +++++++++++++++--------- libretroshare/src/gxs/rsgxsnettunnel.h | 1 - 3 files changed, 65 insertions(+), 36 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index cd68ea6bf..8ddb992fe 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -1670,8 +1670,15 @@ RsItem *RsGxsNetService::generic_recvItem() uint32_t size = 0 ; RsGxsNetTunnelVirtualPeerId virtual_peer_id ; - if(mGxsNetTunnel->receiveData(mServType,data,size,virtual_peer_id)) - return dynamic_cast(RsNxsSerialiser(mServType).deserialise(data,&size)) ; + if(mAllowDistSync && mGxsNetTunnel->receiveData(mServType,data,size,virtual_peer_id)) + { + RsItem *item = dynamic_cast(RsNxsSerialiser(mServType).deserialise(data,&size)) ; + item->PeerId(virtual_peer_id) ; + + free(data) ; + + return item ; + } return NULL ; } diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 65ae72111..068414099 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -129,6 +129,11 @@ RsGxsNetTunnelService::~RsGxsNetTunnelService() mGroups.clear(); mHandledHashes.clear(); mVirtualPeers.clear(); + + for(auto it(mIncomingData.begin());it!=mIncomingData.end();++it) + for(auto it2((*it).second.begin());it2!=(*it).second.end();++it2) + delete (*it2).second; + mIncomingData.clear(); } @@ -234,6 +239,7 @@ bool RsGxsNetTunnelService::requestPeers(uint16_t service_id,const RsGxsGroupId& ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE; ginfo.hash = calculateGroupHash(group_id) ; + ginfo.service_id = service_id; mHandledHashes[ginfo.hash] = group_id ; @@ -255,6 +261,7 @@ bool RsGxsNetTunnelService::releasePeers(uint16_t service_id, const RsGxsGroupId ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE; ginfo.hash = calculateGroupHash(group_id) ; + ginfo.service_id = service_id; mHandledHashes[ginfo.hash] = group_id ; // yes, we do not remove, because we're supposed to answer tunnel requests from other peers. @@ -331,6 +338,11 @@ void RsGxsNetTunnelService::dump() const std::cerr << "Hashes: " << std::endl; for(auto it(mHandledHashes.begin());it!=mHandledHashes.end();++it) std::cerr << " hash: " << it->first << " GroupId: " << it->second << std::endl; + + std::cerr << "Incoming data: " << std::endl; + for(auto it(mIncomingData.begin());it!=mIncomingData.end();++it) + for(auto it2(it->second.begin());it2!=it->second.end();++it2) + std::cerr << " service " << std::hex << it->first << std::dec << " peer id " << it2->first << " " << (void*)it2->second << std::endl; } //===========================================================================================================================================// @@ -396,13 +408,23 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co return ; } - RsItem *decrypted_item = RsGxsNetTunnelSerializer().deserialise(data,&data_size); - RsGxsNetTunnelVirtualPeerItem *pid_item = dynamic_cast(decrypted_item) ; - - if(pid_item) + if(getRsItemService(getRsItemId(data)) == RS_SERVICE_TYPE_GXS_NET_TUNNEL) { + RsItem *decrypted_item = RsGxsNetTunnelSerializer().deserialise(data,&data_size); + RsGxsNetTunnelVirtualPeerItem *pid_item = dynamic_cast(decrypted_item) ; + + if(!pid_item) + { + delete decrypted_item ; + return ; + } + + uint16_t service_id = mGroups[group_id].service_id ; + #ifdef DEBUG_RSGXSNETTUNNEL - GXS_NET_TUNNEL_DEBUG() << " item is a virtual peer id item with vpid = "<< pid_item->virtual_peer_id << ". Setting virtual peer." << std::endl; + GXS_NET_TUNNEL_DEBUG() << " item is a virtual peer id item with vpid = "<< pid_item->virtual_peer_id + << " for group " << group_id << " in service " << std::hex << service_id << std::dec + << ". Setting virtual peer." << std::endl; #endif // we receive a virtual peer id, so we need to update the local information for this peer id @@ -413,52 +435,53 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co vp_info.vpid_status = RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE ; // status of the peer vp_info.side = direction; // client/server vp_info.last_contact = time(NULL); // last time some data was sent/recvd + vp_info.providing_set[service_id].provided_groups.insert(group_id); memcpy(vp_info.encryption_master_key,encryption_master_key,RS_GXS_TUNNEL_CONST_EKEY_SIZE); vp_info.turtle_virtual_peer_id = turtle_virtual_peer_id; // turtle peer to use when sending data to this vpid. free(data); - return ; } - delete decrypted_item ; - - // item is a generic data item for the client. Let's store the data in the appropriate incoming data queue. - - auto it = mTurtle2GxsPeer.find(turtle_virtual_peer_id) ; - - if(it == mTurtle2GxsPeer.end()) + else { - GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for vpid " << turtle_virtual_peer_id << " but this vpid is unknown!" << std::endl; - free(data); - return; - } + // item is a generic data item for the client. Let's store the data in the appropriate incoming data queue. - RsGxsNetTunnelVirtualPeerId gxs_vpid = it->second ; + auto it = mTurtle2GxsPeer.find(turtle_virtual_peer_id) ; - auto it2 = mVirtualPeers.find(gxs_vpid) ; + if(it == mTurtle2GxsPeer.end()) + { + GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for vpid " << turtle_virtual_peer_id << " but this vpid is unknown!" << std::endl; + free(data); + return; + } - if(it2 == mVirtualPeers.end()) - { - GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for GXS vpid " << gxs_vpid << " but the virtual peer id is missing!" << std::endl; - free(data); - return; - } + RsGxsNetTunnelVirtualPeerId gxs_vpid = it->second ; - uint16_t service_id = getRsItemService(getRsItemId(data)) ; + auto it2 = mVirtualPeers.find(gxs_vpid) ; + + if(it2 == mVirtualPeers.end()) + { + GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for GXS vpid " << gxs_vpid << " but the virtual peer id is missing!" << std::endl; + free(data); + return; + } + + uint16_t service_id = getRsItemService(getRsItemId(data)) ; #ifdef DEBUG_RSGXSNETTUNNEL - GXS_NET_TUNNEL_DEBUG() << "item contains generic data for service " << std::hex << service_id << std::dec << " for VPID " << gxs_vpid << ". Storing in incoming list" << std::endl; + GXS_NET_TUNNEL_DEBUG() << "item contains generic data for service " << std::hex << service_id << std::dec << " for VPID " << gxs_vpid << ". Storing in incoming list" << std::endl; #endif - // push the data into the service incoming data list + // push the data into the service incoming data list - RsTlvBinaryData *bind = new RsTlvBinaryData; - bind->tlvtype = 0; - bind->bin_len = data_size; - bind->bin_data = data; + RsTlvBinaryData *bind = new RsTlvBinaryData; + bind->tlvtype = 0; + bind->bin_len = data_size; + bind->bin_data = data; - mIncomingData[service_id].push_back(std::make_pair(gxs_vpid,bind)) ; + mIncomingData[service_id].push_back(std::make_pair(gxs_vpid,bind)) ; + } } void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const TurtleVirtualPeerId& vpid,RsTurtleGenericTunnelItem::Direction dir) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 7543689a2..4341f9ce6 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -102,7 +102,6 @@ class RsGxsNetTunnelItem ; struct RsGxsNetTunnelVirtualPeerProvidingSet { std::set provided_groups ; - std::list incoming_data ; }; struct RsGxsNetTunnelVirtualPeerInfo From c0570ffef6a3582ec6285fbf39534250a94d879c Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 7 Apr 2018 00:56:07 +0200 Subject: [PATCH 025/138] fixed costly polling in RsGenExchange --- libretroshare/src/gxs/rsgenexchange.cc | 30 +++++++++++++++----------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 14a2471e1..11137f8b0 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -64,7 +64,7 @@ static const uint32_t INDEX_AUTHEN_ADMIN = 0x00000040; // admin key #define GXS_MASK "GXS_MASK_HACK" -//#define GEN_EXCH_DEBUG 1 +#define GEN_EXCH_DEBUG 1 static const uint32_t MSG_CLEANUP_PERIOD = 60*59; // 59 minutes static const uint32_t INTEGRITY_CHECK_PERIOD = 60*31; // 31 minutes @@ -2860,8 +2860,10 @@ void RsGenExchange::processRecvdMessages() time_t now = time(NULL); + if(mMsgPendingValidate.empty()) + return ; #ifdef GEN_EXCH_DEBUG - if(!mMsgPendingValidate.empty()) + else std::cerr << "processing received messages" << std::endl; #endif // 1 - First, make sure items metadata is deserialised, clean old failed items, and collect the groups Ids we have to check @@ -2904,9 +2906,11 @@ void RsGenExchange::processRecvdMessages() } } - // 2 - Retrieve the metadata for the associated groups. + // 2 - Retrieve the metadata for the associated groups. The test is here to avoid the default behavior to + // retrieve all groups when the list is empty - mDataStore->retrieveGxsGrpMetaData(grpMetas); + if(!grpMetas.empty()) + mDataStore->retrieveGxsGrpMetaData(grpMetas); GxsMsgReq msgIds; RsNxsMsgDataTemporaryList msgs_to_store; @@ -2934,7 +2938,7 @@ void RsGenExchange::processRecvdMessages() // } #ifdef GEN_EXCH_DEBUG - std::cerr << " deserialised info: grp id=" << meta->mGroupId << ", msg id=" << meta->mMsgId ; + std::cerr << " deserialised info: grp id=" << msg->grpId << ", msg id=" << msg->msgId ; #endif std::map::iterator mit = grpMetas.find(msg->grpId); @@ -2977,8 +2981,8 @@ void RsGenExchange::processRecvdMessages() msg->metaData->recvTS = time(NULL); #ifdef GEN_EXCH_DEBUG - std::cerr << " new status flags: " << meta->mMsgStatus << std::endl; - std::cerr << " computed hash: " << meta->mHash << std::endl; + std::cerr << " new status flags: " << msg->metaData->mMsgStatus << std::endl; + std::cerr << " computed hash: " << msg->metaData->mHash << std::endl; std::cerr << "Message received. Identity=" << msg->metaData->mAuthorId << ", from peer " << msg->PeerId() << std::endl; #endif @@ -3062,9 +3066,6 @@ void RsGenExchange::processRecvdGroups() GxsPendingItem& gpsi = vit->second; RsNxsGrp* grp = gpsi.mItem; -#ifdef GEN_EXCH_DEBUG - std::cerr << " processing validation for group " << meta->mGroupId << ", original attempt time: " << time(NULL) - gpsi.mFirstTryTS << " seconds ago" << std::endl; -#endif if(grp->metaData == NULL) { RsGxsGrpMetaData* meta = new RsGxsGrpMetaData(); @@ -3074,6 +3075,9 @@ void RsGenExchange::processRecvdGroups() else delete meta ; } +#ifdef GEN_EXCH_DEBUG + std::cerr << " processing validation for group " << grp->metaData->mGroupId << ", original attempt time: " << time(NULL) - gpsi.mFirstTryTS << " seconds ago" << std::endl; +#endif // early deletion of group from the pending list if it's malformed, not accepted, or has been tried unsuccessfully for too long @@ -3102,7 +3106,7 @@ void RsGenExchange::processRecvdGroups() if(!grp->metaData->mAuthorId.isNull()) { #ifdef GEN_EXCH_DEBUG - std::cerr << "Group routage info: Identity=" << meta->mAuthorId << " from " << grp->PeerId() << std::endl; + std::cerr << "Group routage info: Identity=" << grp->metaData->mAuthorId << " from " << grp->PeerId() << std::endl; #endif mRoutingClues[grp->metaData->mAuthorId].insert(grp->PeerId()) ; } @@ -3349,7 +3353,7 @@ void RsGenExchange::removeDeleteExistingMessages( std::list& msgs, Gx const RsGxsMessageId::std_vector& msgIds = msgIdReq[(*cit2)->metaData->mGroupId]; #ifdef GEN_EXCH_DEBUG - std::cerr << " grpid=" << cit2->second->mGroupId << ", msgid=" << cit2->second->mMsgId ; + std::cerr << " grpid=" << (*cit2)->grpId << ", msgid=" << (*cit2)->msgId ; #endif // Avoid storing messages that are already in the database, as well as messages that are too old (or generally do not pass the database storage test) @@ -3369,7 +3373,7 @@ void RsGenExchange::removeDeleteExistingMessages( std::list& msgs, Gx } } #ifdef GEN_EXCH_DEBUG - std::cerr << " discarding " << cit2->second->mMsgId << std::endl; + std::cerr << " discarding " << (*cit2)->msgId << std::endl; #endif delete *cit2; From 393ff75c90c4034f43513cd87d3b696e4691f5f3 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 7 Apr 2018 00:56:44 +0200 Subject: [PATCH 026/138] fixed polling strategy in RsGxsNetService causing some delay in distant post syncing --- libretroshare/src/gxs/rsgxsnetservice.cc | 28 ++++++++++++++++-------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 8ddb992fe..da9da520f 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -272,8 +272,8 @@ NXS_NET_DEBUG_8 gxs distant sync ***/ -//#define NXS_NET_DEBUG_0 1 -//#define NXS_NET_DEBUG_1 1 +#define NXS_NET_DEBUG_0 1 +#define NXS_NET_DEBUG_1 1 //#define NXS_NET_DEBUG_2 1 //#define NXS_NET_DEBUG_3 1 //#define NXS_NET_DEBUG_4 1 @@ -318,7 +318,7 @@ static const uint32_t RS_NXS_ITEM_ENCRYPTION_STATUS_GXS_KEY_MISSING = 0x05 ; || defined(NXS_NET_DEBUG_8) static const RsPeerId peer_to_print = RsPeerId(std::string("")) ; -static const RsGxsGroupId group_id_to_print = RsGxsGroupId(std::string("")) ; // use this to allow to this group id only, or "" for all IDs +static const RsGxsGroupId group_id_to_print = RsGxsGroupId(std::string("ff8d59ef38cad0429f34cc21749dda71")) ; // use this to allow to this group id only, or "" for all IDs static const uint32_t service_to_print = RS_SERVICE_GXS_TYPE_CHANNELS ; // use this to allow to this service id only, or 0 for all services // warning. Numbers should be SERVICE IDS (see serialiser/rsserviceids.h. E.g. 0x0215 for forums) @@ -427,8 +427,7 @@ int RsGxsNetService::tick() { // always check for new items arriving // from peers - if(receivedItems()) - recvNxsItemQueue(); + recvNxsItemQueue(); bool should_notify = false; @@ -751,6 +750,10 @@ void RsGxsNetService::generic_sendItem(RsNxsItem *si) if(!mem) return ; +#ifdef NXS_NET_DEBUG_8 + GXSNETDEBUG_P_(si->PeerId()) << "Sending RsGxsNetTunnelService Item:" << (void*)si << " of type: " << std::hex << si->PacketId() << std::dec + << " transaction " << si->transactionNumber << " to virtual peer " << si->PeerId() << std::endl ; +#endif ser.serialise(si,mem,&size) ; mGxsNetTunnel->sendData(mem,size,static_cast(si->PeerId())); @@ -1670,13 +1673,20 @@ RsItem *RsGxsNetService::generic_recvItem() uint32_t size = 0 ; RsGxsNetTunnelVirtualPeerId virtual_peer_id ; - if(mAllowDistSync && mGxsNetTunnel->receiveData(mServType,data,size,virtual_peer_id)) + while(mAllowDistSync && mGxsNetTunnel->receiveData(mServType,data,size,virtual_peer_id)) { - RsItem *item = dynamic_cast(RsNxsSerialiser(mServType).deserialise(data,&size)) ; + RsNxsItem *item = dynamic_cast(RsNxsSerialiser(mServType).deserialise(data,&size)) ; item->PeerId(virtual_peer_id) ; free(data) ; + if(!item) + continue ; + +#ifdef NXS_NET_DEBUG_8 + GXSNETDEBUG_P_(item->PeerId()) << "Received RsGxsNetTunnelService Item:" << (void*)item << " of type: " << std::hex << item->PacketId() << std::dec + << " transaction " << item->transactionNumber << " from virtual peer " << item->PeerId() << std::endl ; +#endif return item ; } @@ -1992,7 +2002,7 @@ void RsGxsNetService::debugDump() GXSNETDEBUG___<< "RsGxsNetService::debugDump():" << std::endl; - RsGxsMetaDataTemporaryMap grpMetas; + RsGxsGrpMetaTemporaryMap grpMetas; if(!group_id_to_print.isNull()) grpMetas[group_id_to_print] = NULL ; @@ -2005,7 +2015,7 @@ void RsGxsNetService::debugDump() for(ServerMsgMap::const_iterator it(mServerMsgUpdateMap.begin());it!=mServerMsgUpdateMap.end();++it) { - RsGxsMetaDataTemporaryMap::const_iterator it2 = grpMetas.find(it->first) ; + RsGxsGrpMetaTemporaryMap::const_iterator it2 = grpMetas.find(it->first) ; RsGxsGrpMetaData *grpMeta = (it2 != grpMetas.end())? it2->second : NULL; std::string subscribe_string = (grpMeta==NULL)?"Unknown" : ((grpMeta->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED)?" Subscribed":" NOT Subscribed") ; From 66df281f25f925df47dfbecd35e4ac0ce098c223 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 11 Apr 2018 23:14:10 +0200 Subject: [PATCH 027/138] added asymmetry in GXS tunnel management to reduce the number of tunnels --- libretroshare/src/gxs/rsgxsnetservice.cc | 3 + libretroshare/src/gxs/rsgxsnettunnel.cc | 118 ++++++++++++++++++++--- libretroshare/src/gxs/rsgxsnettunnel.h | 7 +- 3 files changed, 113 insertions(+), 15 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index da9da520f..c430449d2 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -799,6 +799,9 @@ void RsGxsNetService::checkDistantSyncState() if(online_peers.find(*it2) != online_peers.end()) // check that the peer is online at_least_one_friend_is_supplier = true ; + // That strategy is likely to create islands of friends connected to each other. There's no real way + // to decide what to do here, except maybe checking the last message TS remotely vs. locally. + if(at_least_one_friend_is_supplier) { mGxsNetTunnel->releasePeers(mServType,grpId); diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 068414099..4656b1292 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -36,7 +36,11 @@ #define GXS_NET_TUNNEL_ERROR() std::cerr << "(EE) GXS_NET_TUNNEL ERROR : " -RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") {} +RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") +{ +#warning this is for testing only. In the final version this needs to be initialized with some random content. + memset(mRandomBias,0,RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE) ; +} //===========================================================================================================================================// // Transport Items // @@ -287,7 +291,7 @@ RsGxsNetTunnelVirtualPeerId RsGxsNetTunnelService::locked_makeVirtualPeerId() co //memcpy(mem+RsPeerId::SIZE_IN_BYTES ,group_id.toByteArray(),RsGxsGroupId::SIZE_IN_BYTES) ; memcpy(mem+RsPeerId::SIZE_IN_BYTES /*+RsGxsGroupId::SIZE_IN_BYTES*/,mRandomBias ,RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE) ; - return RsGxsNetTunnelVirtualPeerId(RsDirUtil::sha1sum(mem,RsPeerId::SIZE_IN_BYTES+RsGxsGroupId::SIZE_IN_BYTES+RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE).toByteArray()); + return RsGxsNetTunnelVirtualPeerId(RsDirUtil::sha1sum(mem,RsPeerId::SIZE_IN_BYTES+/*RsGxsGroupId::SIZE_IN_BYTES+*/ RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE).toByteArray()); } void RsGxsNetTunnelService::dump() const @@ -318,7 +322,9 @@ void RsGxsNetTunnelService::dump() const for(auto it(mGroups.begin());it!=mGroups.end();++it) { std::cerr << " " << it->first << " hash: " << it->second.hash << " policy: " << group_policy_str[it->second.group_policy] << " status: " << group_status_str[it->second.group_status] << " Last contact: " << time(NULL) - it->second.last_contact << " secs ago" << std::endl; - std::cerr << " virtual peers:" << std::endl; + + if(!it->second.virtual_peers.empty()) + std::cerr << " virtual peers:" << std::endl; for(auto it2(it->second.virtual_peers.begin());it2!=it->second.virtual_peers.end();++it2) std::cerr << " " << *it2 << std::endl; } @@ -334,6 +340,9 @@ void RsGxsNetTunnelService::dump() const for(auto it2(it->second.providing_set.begin());it2!=it->second.providing_set.end();++it2) std::cerr << " service " << std::hex << it2->first << std::dec << " " << it2->second.provided_groups.size() << " groups" << std::endl; } + std::cerr << "Virtual peer turtle => GXS conversion table: " << std::endl; + for(auto it(mTurtle2GxsPeer.begin());it!=mTurtle2GxsPeer.end();++it) + std::cerr << " " << it->first << " => " << it->second << std::endl; std::cerr << "Hashes: " << std::endl; for(auto it(mHandledHashes.begin());it!=mHandledHashes.end();++it) @@ -413,7 +422,7 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co RsItem *decrypted_item = RsGxsNetTunnelSerializer().deserialise(data,&data_size); RsGxsNetTunnelVirtualPeerItem *pid_item = dynamic_cast(decrypted_item) ; - if(!pid_item) + if(!pid_item) // this handles the case of a KeepAlive packet. { delete decrypted_item ; return ; @@ -555,7 +564,7 @@ void RsGxsNetTunnelService::removeVirtualPeer(const TurtleFileHash& hash, const if(ginfo.virtual_peers.empty()) { - ginfo.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED ; + ginfo.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE ; #ifdef DEBUG_RSGXSNETTUNNEL GXS_NET_TUNNEL_DEBUG() << " no more virtual peers for group " << group_id << ": setting status to TUNNELS_REQUESTED" << std::endl; @@ -617,30 +626,115 @@ void RsGxsNetTunnelService::data_tick() { last_dump = now; dump(); + + sendKeepAlivePackets() ; } } +void RsGxsNetTunnelService::sendKeepAlivePackets() +{ + RS_STACK_MUTEX(mGxsNetTunnelMtx); + RsGxsNetTunnelVirtualPeerId own_gxs_vpid = locked_makeVirtualPeerId() ; + +#ifdef DEBUG_RSGXSNETTUNNEL + GXS_NET_TUNNEL_DEBUG() << " sending keep-alive packets. Own GXS peer ID is " << own_gxs_vpid << std::endl; +#endif + + // We send KA packets for each GXS virtual peer. The advantage is that unused tunnels will automatically die which eliminates duplicate tunnels + // automatically. We only send from the client side. + + for(auto it(mVirtualPeers.begin());it!=mVirtualPeers.end();++it) + if(own_gxs_vpid < it->first) + { +#ifdef DEBUG_RSGXSNETTUNNEL + GXS_NET_TUNNEL_DEBUG() << " sending to virtual peer " << it->first << " through tunnel " << it->second.turtle_virtual_peer_id << std::endl; +#endif + RsGxsNetTunnelKeepAliveItem pitem ; + RsTemporaryMemory tmpmem( RsGxsNetTunnelSerializer().size(&pitem) ) ; + uint32_t len = tmpmem.size(); + + RsGxsNetTunnelSerializer().serialise(&pitem,tmpmem,&len); + + RsTurtleGenericDataItem *encrypted_turtle_item = NULL ; + + if(p3turtle::encryptData(tmpmem,len,it->second.encryption_master_key,encrypted_turtle_item)) + mPendingTurtleItems.push_back(std::make_pair(it->second.turtle_virtual_peer_id,encrypted_turtle_item)) ; + } +#ifdef DEBUG_RSGXSNETTUNNEL + else + GXS_NET_TUNNEL_DEBUG() << " ignoring virtual peer " << it->first << std::endl; +#endif +} + void RsGxsNetTunnelService::autowash() { RS_STACK_MUTEX(mGxsNetTunnelMtx); +#ifdef DEBUG_RSGXSNETTUNNEL + GXS_NET_TUNNEL_DEBUG() << " performing per-group consistency test." << std::endl; +#endif + RsGxsNetTunnelVirtualPeerId own_gxs_vpid = locked_makeVirtualPeerId() ; + for(auto it(mGroups.begin());it!=mGroups.end();++it) { + RsGxsNetTunnelGroupInfo& ginfo(it->second) ; + bool should_monitor_tunnels = false ; + +#ifdef DEBUG_RSGXSNETTUNNEL + GXS_NET_TUNNEL_DEBUG() << " group " << it->first << ": " ; +#endif + // check whether the group already has GXS virtual peers with suppliers. If so, we can set the GRP policy as passive. + + if(ginfo.group_policy == RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE) + { + bool found = false ; + + // check wether one virtual peer provided by GXS has ID > own ID. In this case we leave the priority to it. + + for(auto it2(ginfo.virtual_peers.begin());!found && it2!=ginfo.virtual_peers.end();++it2) + { + auto it3 = mTurtle2GxsPeer.find(*it2) ; + + if( it3 != mTurtle2GxsPeer.end() && it3->second < own_gxs_vpid) + found = true ; + } + + if(found) + { +#ifdef DEBUG_RSGXSNETTUNNEL + std::cerr << " active, with client-side peers : "; +#endif + should_monitor_tunnels = true ; + } + else + { + should_monitor_tunnels = false ; +#ifdef DEBUG_RSGXSNETTUNNEL + std::cerr << " active, and no client-side peers available : " ; +#endif + } + } +#ifdef DEBUG_RSGXSNETTUNNEL + else + std::cerr << " passive : "; +#endif + // check if the group is in active or passive mode, in which case make sure that turtle manages tunnels or not. // if active, then we check wether they are tunnels are not. If not, we ask turtle to monitor. - RsGxsNetTunnelGroupInfo& ginfo(it->second) ; - - if(ginfo.group_policy == RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE && ginfo.virtual_peers.empty()) + if(should_monitor_tunnels) { +#ifdef DEBUG_RSGXSNETTUNNEL + std::cerr << " requesting tunnels" << std::endl; +#endif mTurtle->monitorTunnels(ginfo.hash,this,false) ; - ginfo.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED; } - - if(ginfo.group_policy == RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE) + else { +#ifdef DEBUG_RSGXSNETTUNNEL + std::cerr << " dropping tunnels" << std::endl; +#endif mTurtle->stopMonitoringTunnels(ginfo.hash); - ginfo.group_status = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE; } } } diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 4341f9ce6..7d5f6bd78 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -129,14 +129,14 @@ struct RsGxsNetTunnelGroupInfo enum GroupStatus { RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN = 0x00, // unknown status RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE = 0x01, // no virtual peers requested, just waiting - RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED = 0x02, // virtual peers requested, and waiting for turtle to answer +// RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED = 0x02, // virtual peers requested, and waiting for turtle to answer RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE = 0x03 // some virtual peers are available. Data can be read/written }; enum GroupPolicy { RS_GXS_NET_TUNNEL_GRP_POLICY_UNKNOWN = 0x00, // nothing has been set RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE = 0x01, // group is available for server side tunnels, but does not explicitely request tunnels - RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE = 0x02, // group explicitely request tunnels, if none available + RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE = 0x02, // group will explicitely request tunnels, if none available }; RsGxsNetTunnelGroupInfo() : group_policy(RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE),group_status(RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE),last_contact(0),service_id(0) {} @@ -147,7 +147,7 @@ struct RsGxsNetTunnelGroupInfo TurtleFileHash hash ; uint16_t service_id ; - std::set virtual_peers ; // list of which virtual peers provide this group. Can me more than 1. + std::set virtual_peers ; // list of which virtual peers provide this group. Can me more than 1. }; class RsGxsNetTunnelService: public RsTurtleClientService, public RsTickingThread @@ -231,6 +231,7 @@ protected: p3turtle *mTurtle ; private: void autowash() ; + void sendKeepAlivePackets() ; void handleIncoming(RsGxsNetTunnelItem *item) ; void flush_pending_items(); From 3c9af3d2e7e46fd42d34671a53327a096e25539a Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 14 Apr 2018 11:48:55 +0200 Subject: [PATCH 028/138] fixed bug in tunnel monitoring code --- libretroshare/src/gxs/rsgxsnettunnel.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 4656b1292..4de597285 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -704,11 +704,11 @@ void RsGxsNetTunnelService::autowash() #ifdef DEBUG_RSGXSNETTUNNEL std::cerr << " active, with client-side peers : "; #endif - should_monitor_tunnels = true ; + should_monitor_tunnels = false ; } else { - should_monitor_tunnels = false ; + should_monitor_tunnels = true ; #ifdef DEBUG_RSGXSNETTUNNEL std::cerr << " active, and no client-side peers available : " ; #endif @@ -719,8 +719,9 @@ void RsGxsNetTunnelService::autowash() std::cerr << " passive : "; #endif - // check if the group is in active or passive mode, in which case make sure that turtle manages tunnels or not. - // if active, then we check wether they are tunnels are not. If not, we ask turtle to monitor. + // We should also check whether the group is supplied using another tunnel. If so, no need to request tunnels. + // Otherwise the engine will keep requesting tunnels for all groups. +#warning CODE MISSING HERE if(should_monitor_tunnels) { From 38b39caf13d67e70b1bc3cf6aad1c0e14fddfcfa Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 25 Apr 2018 14:58:53 +0200 Subject: [PATCH 029/138] added compilation flag for GXS dist sync --- libretroshare/src/gxs/rsgxsnetservice.cc | 8 ++++---- libretroshare/src/rsserver/rsinit.cc | 12 +++++++++--- retroshare.pri | 3 +++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index c430449d2..cbd106c39 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -569,7 +569,7 @@ void RsGxsNetService::syncWithPeers() std::set peers; mNetMgr->getOnlineList(mServiceInfo.mServiceType, peers); - if(mAllowDistSync) + if(mAllowDistSync && mGxsNetTunnel != NULL) { // Grab all online virtual peers of distant tunnels for the current service. @@ -740,7 +740,7 @@ void RsGxsNetService::generic_sendItem(RsNxsItem *si) { // check if the item is to be sent to a distant peer or not - if(mAllowDistSync && mGxsNetTunnel->isDistantPeer( static_cast(si->PeerId()))) + if(mAllowDistSync && mGxsNetTunnel != NULL && mGxsNetTunnel->isDistantPeer( static_cast(si->PeerId()))) { RsNxsSerialiser ser(mServType); @@ -764,7 +764,7 @@ void RsGxsNetService::generic_sendItem(RsNxsItem *si) void RsGxsNetService::checkDistantSyncState() { - if(!mAllowDistSync) + if(!mAllowDistSync || mGxsNetTunnel==NULL) return ; RsGxsGrpMetaTemporaryMap grpMeta; @@ -1676,7 +1676,7 @@ RsItem *RsGxsNetService::generic_recvItem() uint32_t size = 0 ; RsGxsNetTunnelVirtualPeerId virtual_peer_id ; - while(mAllowDistSync && mGxsNetTunnel->receiveData(mServType,data,size,virtual_peer_id)) + while(mAllowDistSync && mGxsNetTunnel != NULL && mGxsNetTunnel->receiveData(mServType,data,size,virtual_peer_id)) { RsNxsItem *item = dynamic_cast(RsNxsSerialiser(mServType).deserialise(data,&size)) ; item->PeerId(virtual_peer_id) ; diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index c51abf01e..b8484ac8b 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1358,6 +1358,14 @@ int RsServer::StartupRetroShare() mWiki->setNetworkExchangeService(wiki_ns) ; #endif + /**** GXS Dist sync service ****/ +#ifdef RS_USE_GXS_DISTANT_SYNC + RsGxsNetTunnelService *mGxsNetTunnel = new RsGxsNetTunnelService ; +#else + RsGxsNetTunnelService *mGxsNetTunnel = NULL; +#endif + + /**** Forum GXS service ****/ RsGeneralDataService* gxsforums_ds = new RsDataService(currGxsDir + "/", "gxsforums_db", @@ -1371,14 +1379,12 @@ 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) ; /**** Channel GXS service ****/ - RsGxsNetTunnelService *mGxsNetTunnel = new RsGxsNetTunnelService ; - RsGeneralDataService* gxschannels_ds = new RsDataService(currGxsDir + "/", "gxschannels_db", RS_SERVICE_GXS_TYPE_CHANNELS, NULL, rsInitConfig->gxs_passwd); diff --git a/retroshare.pri b/retroshare.pri index 446c1bd61..21c469aa2 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -9,6 +9,8 @@ no_retroshare_gui:CONFIG -= retroshare_gui # CONFIG *= retrotor +CONFIG *= gxsdistsync + # To disable RetroShare-nogui append the following # assignation to qmake command line "CONFIG+=no_retroshare_nogui" CONFIG *= retroshare_nogui @@ -214,6 +216,7 @@ unfinished { CONFIG += wikipoos } +gxsdistsync:DEFINES *= RS_USE_GXS_DISTANT_SYNC wikipoos:DEFINES *= RS_USE_WIKI rs_gxs:DEFINES *= RS_ENABLE_GXS libresapilocalserver:DEFINES *= LIBRESAPI_LOCAL_SERVER From 1a9a7622a2e3cfb967de4c7511c5e2b062a1eeb3 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 25 Apr 2018 17:58:37 +0200 Subject: [PATCH 030/138] made GxsNetTunnelService a parent class of GxsNetService and renamed public methods appropriately. --- libretroshare/src/gxs/rsgxsnetservice.cc | 27 ++++++++++++++---------- libretroshare/src/gxs/rsgxsnetservice.h | 5 ++--- libretroshare/src/gxs/rsgxsnettunnel.cc | 12 +++++------ libretroshare/src/gxs/rsgxsnettunnel.h | 13 ++++++------ libretroshare/src/rsserver/rsinit.cc | 17 ++++----------- 5 files changed, 34 insertions(+), 40 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index cbd106c39..ad8fa4c73 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -361,7 +361,7 @@ RsGxsNetService::RsGxsNetService(uint16_t servType, RsGeneralDataService *gds, RsNxsNetMgr *netMgr, RsNxsObserver *nxsObs, const RsServiceInfo serviceInfo, RsGixsReputation* reputations, RsGcxs* circles, RsGixs *gixs, - PgpAuxUtils *pgpUtils, RsGxsNetTunnelService *mGxsNT, + PgpAuxUtils *pgpUtils, bool grpAutoSync, bool msgAutoSync, bool distSync, uint32_t default_store_period, uint32_t default_sync_period) : p3ThreadedService(), p3Config(), mTransactionN(0), mObserver(nxsObs), mDataStore(gds), @@ -370,7 +370,7 @@ RsGxsNetService::RsGxsNetService(uint16_t servType, RsGeneralDataService *gds, mSyncTs(0), mLastKeyPublishTs(0), mLastCleanRejectedMessages(0), mSYNC_PERIOD(SYNC_PERIOD), mCircles(circles), mGixs(gixs), - mReputations(reputations), mPgpUtils(pgpUtils),mGxsNetTunnel(mGxsNT), + mReputations(reputations), mPgpUtils(pgpUtils), mGrpAutoSync(grpAutoSync), mAllowMsgSync(msgAutoSync),mAllowDistSync(distSync), mServiceInfo(serviceInfo), mDefaultMsgStorePeriod(default_store_period), mDefaultMsgSyncPeriod(default_sync_period) @@ -569,12 +569,12 @@ void RsGxsNetService::syncWithPeers() std::set peers; mNetMgr->getOnlineList(mServiceInfo.mServiceType, peers); - if(mAllowDistSync && mGxsNetTunnel != NULL) + if(mAllowDistSync) { // Grab all online virtual peers of distant tunnels for the current service. std::list vpids ; - mGxsNetTunnel->getVirtualPeers(mServType,vpids); + getVirtualPeers(mServType,vpids); for(auto it(vpids.begin());it!=vpids.end();++it) peers.insert(RsPeerId(*it)) ; @@ -668,6 +668,7 @@ void RsGxsNetService::syncWithPeers() const RsGxsGroupId& grpId = mmit->first; RsGxsCircleId encrypt_to_this_circle_id ; +#warning we should use this call in order to determine wether the peer can be sent group information about a specific group, otherwise we leak which group we are subscribed to if(!checkCanRecvMsgFromPeer(peerId, *meta,encrypt_to_this_circle_id)) continue; @@ -725,7 +726,7 @@ void RsGxsNetService::syncWithPeers() #ifdef NXS_NET_DEBUG_7 GXSNETDEBUG_PG(*sit,grpId) << " Service " << std::hex << ((mServiceInfo.mServiceType >> 8)& 0xffff) << std::dec << " sending message TS of peer id: " << *sit << " ts=" << nice_time_stamp(time(NULL),updateTS) << " (secs ago) for group " << grpId << " to himself - in clear " << std::endl; #endif - generic_sendItem(msg); + generic_sendItem(msg); #ifdef NXS_NET_DEBUG_5 GXSNETDEBUG_PG(*sit,grpId) << "Service "<< std::hex << ((mServiceInfo.mServiceType >> 8)& 0xffff) << std::dec << " sending global message TS of peer id: " << *sit << " ts=" << nice_time_stamp(time(NULL),updateTS) << " (secs ago) for group " << grpId << " to himself" << std::endl; @@ -740,7 +741,7 @@ void RsGxsNetService::generic_sendItem(RsNxsItem *si) { // check if the item is to be sent to a distant peer or not - if(mAllowDistSync && mGxsNetTunnel != NULL && mGxsNetTunnel->isDistantPeer( static_cast(si->PeerId()))) + if(mAllowDistSync && isDistantPeer( static_cast(si->PeerId()))) { RsNxsSerialiser ser(mServType); @@ -756,7 +757,7 @@ void RsGxsNetService::generic_sendItem(RsNxsItem *si) #endif ser.serialise(si,mem,&size) ; - mGxsNetTunnel->sendData(mem,size,static_cast(si->PeerId())); + sendTunnelData(mem,size,static_cast(si->PeerId())); } else sendItem(si) ; @@ -764,7 +765,7 @@ void RsGxsNetService::generic_sendItem(RsNxsItem *si) void RsGxsNetService::checkDistantSyncState() { - if(!mAllowDistSync || mGxsNetTunnel==NULL) + if(!mAllowDistSync) return ; RsGxsGrpMetaTemporaryMap grpMeta; @@ -804,14 +805,14 @@ void RsGxsNetService::checkDistantSyncState() if(at_least_one_friend_is_supplier) { - mGxsNetTunnel->releasePeers(mServType,grpId); + releaseDistantPeers(mServType,grpId); #ifdef NXS_NET_DEBUG_8 GXSNETDEBUG___<< " Group " << grpId << ": suppliers among friends. Releasing peers." << std::endl; #endif } else { - mGxsNetTunnel->requestPeers(mServType,grpId); + requestDistantPeers(mServType,grpId); #ifdef NXS_NET_DEBUG_8 GXSNETDEBUG___<< " Group " << grpId << ": no suppliers among friends. Requesting peers." << std::endl; #endif @@ -1676,7 +1677,7 @@ RsItem *RsGxsNetService::generic_recvItem() uint32_t size = 0 ; RsGxsNetTunnelVirtualPeerId virtual_peer_id ; - while(mAllowDistSync && mGxsNetTunnel != NULL && mGxsNetTunnel->receiveData(mServType,data,size,virtual_peer_id)) + while(mAllowDistSync && receiveTunnelData(mServType,data,size,virtual_peer_id)) { RsNxsItem *item = dynamic_cast(RsNxsSerialiser(mServType).deserialise(data,&size)) ; item->PeerId(virtual_peer_id) ; @@ -1995,6 +1996,10 @@ void RsGxsNetService::data_tick() runVetting(); processExplicitGroupRequests(); + + // also tick distant traffic + + RsGxsNetTunnelService::data_tick(); } void RsGxsNetService::debugDump() diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index aac6c474a..04c0317a6 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -72,7 +72,7 @@ class RsGroupNetworkStatsRecord * Incoming transaction are in 3 different states * 1. START 2. RECEIVING 3. END */ -class RsGxsNetService : public RsNetworkExchangeService, public p3ThreadedService, public p3Config +class RsGxsNetService : public RsNetworkExchangeService, public RsGxsNetTunnelService, public p3ThreadedService, public p3Config { public: @@ -90,7 +90,7 @@ public: RsNxsObserver *nxsObs, // used to be = NULL. const RsServiceInfo serviceInfo, RsGixsReputation* reputations = NULL, RsGcxs* circles = NULL, RsGixs *gixs=NULL, - PgpAuxUtils *pgpUtils = NULL, RsGxsNetTunnelService *mGxsNT = NULL, + PgpAuxUtils *pgpUtils = NULL, bool grpAutoSync = true, bool msgAutoSync = true,bool distSync=false, uint32_t default_store_period = RS_GXS_DEFAULT_MSG_STORE_PERIOD, uint32_t default_sync_period = RS_GXS_DEFAULT_MSG_REQ_PERIOD); @@ -546,7 +546,6 @@ private: RsGixs *mGixs; RsGixsReputation* mReputations; PgpAuxUtils *mPgpUtils; - RsGxsNetTunnelService *mGxsNetTunnel; bool mGrpAutoSync; bool mAllowMsgSync; diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 4de597285..f37195936 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -38,7 +38,7 @@ RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") { -#warning this is for testing only. In the final version this needs to be initialized with some random content. +#warning this is for testing only. In the final version this needs to be initialized with some random content, saved and re-used for a while (e.g. 1 month) memset(mRandomBias,0,RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE) ; } @@ -148,7 +148,7 @@ bool RsGxsNetTunnelService::isDistantPeer(const RsGxsNetTunnelVirtualPeerId& vir return mVirtualPeers.find(virtual_peer) != mVirtualPeers.end(); } -bool RsGxsNetTunnelService::receiveData(uint16_t service_id,unsigned char *& data,uint32_t& data_len,RsGxsNetTunnelVirtualPeerId& virtual_peer) +bool RsGxsNetTunnelService::receiveTunnelData(uint16_t service_id,unsigned char *& data,uint32_t& data_len,RsGxsNetTunnelVirtualPeerId& virtual_peer) { RS_STACK_MUTEX(mGxsNetTunnelMtx); @@ -174,7 +174,7 @@ bool RsGxsNetTunnelService::receiveData(uint16_t service_id,unsigned char *& dat return true; } -bool RsGxsNetTunnelService::sendData(unsigned char *& data,uint32_t data_len,const RsGxsNetTunnelVirtualPeerId& virtual_peer) +bool RsGxsNetTunnelService::sendTunnelData(unsigned char *& data,uint32_t data_len,const RsGxsNetTunnelVirtualPeerId& virtual_peer) { RS_STACK_MUTEX(mGxsNetTunnelMtx); // The item is serialized and encrypted using chacha20+SHA256, using the generic turtle encryption, and then sent to the turtle router. @@ -233,7 +233,7 @@ bool RsGxsNetTunnelService::getVirtualPeers(uint16_t service_id, std::list virtual_peers ; // list of which virtual peers provide this group. Can me more than 1. }; -class RsGxsNetTunnelService: public RsTurtleClientService, public RsTickingThread +class RsGxsNetTunnelService: public RsTurtleClientService { public: RsGxsNetTunnelService() ; @@ -160,13 +161,13 @@ public: * \brief Manage tunnels for this group * @param group_id group for which tunnels should be released */ - bool requestPeers(uint16_t service_id, const RsGxsGroupId&group_id) ; + bool requestDistantPeers(uint16_t service_id, const RsGxsGroupId&group_id) ; /*! * \brief Stop managing tunnels for this group * @param group_id group for which tunnels should be released */ - bool releasePeers(uint16_t service_id,const RsGxsGroupId&group_id) ; + bool releaseDistantPeers(uint16_t service_id,const RsGxsGroupId&group_id) ; /*! * \brief Get the list of active virtual peers for a given group. This implies that a tunnel is up and @@ -182,7 +183,7 @@ public: * \return * true if succeeded. */ - bool sendData(unsigned char *& data, uint32_t data_len, const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; + bool sendTunnelData(unsigned char *& data, uint32_t data_len, const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; /*! * \brief receiveData @@ -194,7 +195,7 @@ public: * \return * true if something is returned. If not, data is set to NULL, data_len to 0. */ - bool receiveData(uint16_t service_id,unsigned char *& data,uint32_t& data_len,RsGxsNetTunnelVirtualPeerId& virtual_peer) ; + bool receiveTunnelData(uint16_t service_id,unsigned char *& data,uint32_t& data_len,RsGxsNetTunnelVirtualPeerId& virtual_peer) ; /*! * \brief isDistantPeer diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index b8484ac8b..12d60061e 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1358,14 +1358,6 @@ int RsServer::StartupRetroShare() mWiki->setNetworkExchangeService(wiki_ns) ; #endif - /**** GXS Dist sync service ****/ -#ifdef RS_USE_GXS_DISTANT_SYNC - RsGxsNetTunnelService *mGxsNetTunnel = new RsGxsNetTunnelService ; -#else - RsGxsNetTunnelService *mGxsNetTunnel = NULL; -#endif - - /**** Forum GXS service ****/ RsGeneralDataService* gxsforums_ds = new RsDataService(currGxsDir + "/", "gxsforums_db", @@ -1379,7 +1371,7 @@ int RsServer::StartupRetroShare() RS_SERVICE_GXS_TYPE_FORUMS, gxsforums_ds, nxsMgr, mGxsForums, mGxsForums->getServiceInfo(), mReputations, mGxsCircles,mGxsIdService, - pgpAuxUtils); //,mGxsNetTunnel,true,true,true); + pgpAuxUtils); mGxsForums->setNetworkExchangeService(gxsforums_ns) ; @@ -1395,7 +1387,7 @@ int RsServer::StartupRetroShare() RS_SERVICE_GXS_TYPE_CHANNELS, gxschannels_ds, nxsMgr, mGxsChannels, mGxsChannels->getServiceInfo(), mReputations, mGxsCircles,mGxsIdService, - pgpAuxUtils,mGxsNetTunnel,true,true,true); + pgpAuxUtils,true,true,true); mGxsChannels->setNetworkExchangeService(gxschannels_ns) ; @@ -1450,7 +1442,7 @@ int RsServer::StartupRetroShare() RsGxsNetService* gxstrans_ns = new RsGxsNetService( RS_SERVICE_TYPE_GXS_TRANS, gxstrans_ds, nxsMgr, mGxsTrans, mGxsTrans->getServiceInfo(), mReputations, mGxsCircles, - mGxsIdService, pgpAuxUtils,NULL,true,true,false,p3GxsTrans::GXS_STORAGE_PERIOD,p3GxsTrans::GXS_SYNC_PERIOD); + mGxsIdService, pgpAuxUtils,true,true,false,p3GxsTrans::GXS_STORAGE_PERIOD,p3GxsTrans::GXS_SYNC_PERIOD); mGxsTrans->setNetworkExchangeService(gxstrans_ns); pqih->addService(gxstrans_ns, true); @@ -1492,7 +1484,7 @@ int RsServer::StartupRetroShare() // connect components to turtle router. - mGxsNetTunnel->connectToTurtleRouter(tr) ; + gxschannels_ns->connectToTurtleRouter(tr) ; ftserver->connectToTurtleRouter(tr) ; ftserver->connectToFileDatabase(fdb) ; chatSrv->connectToGxsTunnelService(mGxsTunnels) ; @@ -1831,7 +1823,6 @@ int RsServer::StartupRetroShare() //rsWire = mWire; /*** start up GXS core runner ***/ - startServiceThread(mGxsNetTunnel, "gxs net tunnel"); startServiceThread(mGxsIdService, "gxs id"); startServiceThread(mGxsCircles, "gxs circle"); From da4b382edec3386e8a27c8255974c8a2becad3e2 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 25 Apr 2018 18:29:49 +0200 Subject: [PATCH 031/138] removed dependency on service in RsGxsNetTunnel --- libretroshare/src/gxs/rsgxsnetservice.cc | 8 +-- libretroshare/src/gxs/rsgxsnettunnel.cc | 76 ++++++++++-------------- libretroshare/src/gxs/rsgxsnettunnel.h | 27 ++++----- 3 files changed, 46 insertions(+), 65 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index ad8fa4c73..619adb5f7 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -574,7 +574,7 @@ void RsGxsNetService::syncWithPeers() // Grab all online virtual peers of distant tunnels for the current service. std::list vpids ; - getVirtualPeers(mServType,vpids); + getVirtualPeers(vpids); for(auto it(vpids.begin());it!=vpids.end();++it) peers.insert(RsPeerId(*it)) ; @@ -805,14 +805,14 @@ void RsGxsNetService::checkDistantSyncState() if(at_least_one_friend_is_supplier) { - releaseDistantPeers(mServType,grpId); + releaseDistantPeers(grpId); #ifdef NXS_NET_DEBUG_8 GXSNETDEBUG___<< " Group " << grpId << ": suppliers among friends. Releasing peers." << std::endl; #endif } else { - requestDistantPeers(mServType,grpId); + requestDistantPeers(grpId); #ifdef NXS_NET_DEBUG_8 GXSNETDEBUG___<< " Group " << grpId << ": no suppliers among friends. Requesting peers." << std::endl; #endif @@ -1677,7 +1677,7 @@ RsItem *RsGxsNetService::generic_recvItem() uint32_t size = 0 ; RsGxsNetTunnelVirtualPeerId virtual_peer_id ; - while(mAllowDistSync && receiveTunnelData(mServType,data,size,virtual_peer_id)) + while(mAllowDistSync && receiveTunnelData(data,size,virtual_peer_id)) { RsNxsItem *item = dynamic_cast(RsNxsSerialiser(mServType).deserialise(data,&size)) ; item->PeerId(virtual_peer_id) ; diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index f37195936..e3da0be70 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -135,8 +135,7 @@ RsGxsNetTunnelService::~RsGxsNetTunnelService() mVirtualPeers.clear(); for(auto it(mIncomingData.begin());it!=mIncomingData.end();++it) - for(auto it2((*it).second.begin());it2!=(*it).second.end();++it2) - delete (*it2).second; + delete (*it).second; mIncomingData.clear(); } @@ -148,11 +147,11 @@ bool RsGxsNetTunnelService::isDistantPeer(const RsGxsNetTunnelVirtualPeerId& vir return mVirtualPeers.find(virtual_peer) != mVirtualPeers.end(); } -bool RsGxsNetTunnelService::receiveTunnelData(uint16_t service_id,unsigned char *& data,uint32_t& data_len,RsGxsNetTunnelVirtualPeerId& virtual_peer) +bool RsGxsNetTunnelService::receiveTunnelData(unsigned char *& data,uint32_t& data_len,RsGxsNetTunnelVirtualPeerId& virtual_peer) { RS_STACK_MUTEX(mGxsNetTunnelMtx); - std::list >& lst(mIncomingData[service_id]) ; + std::list >& lst(mIncomingData); if(lst.empty()) { @@ -212,7 +211,7 @@ bool RsGxsNetTunnelService::sendTunnelData(unsigned char *& data,uint32_t data_l return true ; } -bool RsGxsNetTunnelService::getVirtualPeers(uint16_t service_id, std::list& peers) +bool RsGxsNetTunnelService::getVirtualPeers(std::list& peers) { // This function has two effects: // - return the virtual peers for this group @@ -223,17 +222,16 @@ bool RsGxsNetTunnelService::getVirtualPeers(uint16_t service_id, std::listsecond.providing_set.find(service_id) != it->second.providing_set.end()) - peers.push_back(it->first) ; + peers.push_back(it->first) ; #ifdef DEBUG_RSGXSNETTUNNEL - GXS_NET_TUNNEL_DEBUG() << " service " << std::hex << service_id << std::dec << " returning " << peers.size() << " peers." << std::endl; + GXS_NET_TUNNEL_DEBUG() << " returning " << peers.size() << " peers." << std::endl; #endif return true ; } -bool RsGxsNetTunnelService::requestDistantPeers(uint16_t service_id,const RsGxsGroupId& group_id) +bool RsGxsNetTunnelService::requestDistantPeers(const RsGxsGroupId& group_id) { RS_STACK_MUTEX(mGxsNetTunnelMtx); @@ -243,19 +241,18 @@ bool RsGxsNetTunnelService::requestDistantPeers(uint16_t service_id,const RsGxsG ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE; ginfo.hash = calculateGroupHash(group_id) ; - ginfo.service_id = service_id; mHandledHashes[ginfo.hash] = group_id ; // we dont set the group policy here. It will only be set if no peers, or too few peers are available. #ifdef DEBUG_RSGXSNETTUNNEL - GXS_NET_TUNNEL_DEBUG() << " service " << std::hex << service_id << std::dec << " requesting peers for group " << group_id << std::endl; + GXS_NET_TUNNEL_DEBUG() << " requesting peers for group " << group_id << std::endl; #endif return true; } -bool RsGxsNetTunnelService::releaseDistantPeers(uint16_t service_id, const RsGxsGroupId& group_id) +bool RsGxsNetTunnelService::releaseDistantPeers(const RsGxsGroupId& group_id) { RS_STACK_MUTEX(mGxsNetTunnelMtx); @@ -265,33 +262,31 @@ bool RsGxsNetTunnelService::releaseDistantPeers(uint16_t service_id, const RsGxs ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE; ginfo.hash = calculateGroupHash(group_id) ; - ginfo.service_id = service_id; mHandledHashes[ginfo.hash] = group_id ; // yes, we do not remove, because we're supposed to answer tunnel requests from other peers. mTurtle->stopMonitoringTunnels(ginfo.hash) ; #ifdef DEBUG_RSGXSNETTUNNEL - GXS_NET_TUNNEL_DEBUG() << " service " << std::hex << service_id << std::dec << " releasing peers for group " << group_id << std::endl; + GXS_NET_TUNNEL_DEBUG() << " releasing peers for group " << group_id << std::endl; #endif return true; } -RsGxsNetTunnelVirtualPeerId RsGxsNetTunnelService::locked_makeVirtualPeerId() const +RsGxsNetTunnelVirtualPeerId RsGxsNetTunnelService::locked_makeVirtualPeerId(const RsGxsGroupId& group_id) const { - assert(RsPeerId::SIZE_IN_BYTES <= Sha1CheckSum::SIZE_IN_BYTES) ; + assert(RsPeerId::SIZE_IN_BYTES <= Sha1CheckSum::SIZE_IN_BYTES) ;// so that we can build the virtual PeerId from a SHA1 sum. // We compute sha1( SSL_id | mRandomBias ) and trunk it to 16 bytes in order to compute a RsPeerId RsPeerId ssl_id = rsPeers->getOwnId() ; - unsigned char mem[RsPeerId::SIZE_IN_BYTES /*+ RsGxsGroupId::SIZE_IN_BYTES */ + RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE]; + unsigned char mem[RsGxsGroupId::SIZE_IN_BYTES + RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE]; - memcpy(mem ,ssl_id.toByteArray() ,RsPeerId::SIZE_IN_BYTES) ; - //memcpy(mem+RsPeerId::SIZE_IN_BYTES ,group_id.toByteArray(),RsGxsGroupId::SIZE_IN_BYTES) ; - memcpy(mem+RsPeerId::SIZE_IN_BYTES /*+RsGxsGroupId::SIZE_IN_BYTES*/,mRandomBias ,RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE) ; + memcpy(mem ,group_id.toByteArray(),RsGxsGroupId::SIZE_IN_BYTES) ; + memcpy(mem+RsGxsGroupId::SIZE_IN_BYTES,mRandomBias ,RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE) ; - return RsGxsNetTunnelVirtualPeerId(RsDirUtil::sha1sum(mem,RsPeerId::SIZE_IN_BYTES+/*RsGxsGroupId::SIZE_IN_BYTES+*/ RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE).toByteArray()); + return RsGxsNetTunnelVirtualPeerId(RsDirUtil::sha1sum(mem,RsGxsGroupId::SIZE_IN_BYTES+RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE).toByteArray()); } void RsGxsNetTunnelService::dump() const @@ -331,15 +326,13 @@ void RsGxsNetTunnelService::dump() const std::cerr << "Virtual peers: " << std::endl; for(auto it(mVirtualPeers.begin());it!=mVirtualPeers.end();++it) - { std::cerr << " GXS Peer:" << it->first << " Turtle:" << it->second.turtle_virtual_peer_id << " status: " << vpid_status_str[it->second.vpid_status] << " direction: " - << (int)it->second.side << " last seen " << time(NULL)-it->second.last_contact + << " group_id: " << it->second.group_id + << " direction: " << (int)it->second.side + << " last seen " << time(NULL)-it->second.last_contact << " ekey: " << RsUtil::BinToHex(it->second.encryption_master_key,RS_GXS_TUNNEL_CONST_EKEY_SIZE,10) << std::endl; - for(auto it2(it->second.providing_set.begin());it2!=it->second.providing_set.end();++it2) - std::cerr << " service " << std::hex << it2->first << std::dec << " " << it2->second.provided_groups.size() << " groups" << std::endl; - } std::cerr << "Virtual peer turtle => GXS conversion table: " << std::endl; for(auto it(mTurtle2GxsPeer.begin());it!=mTurtle2GxsPeer.end();++it) std::cerr << " " << it->first << " => " << it->second << std::endl; @@ -350,8 +343,7 @@ void RsGxsNetTunnelService::dump() const std::cerr << "Incoming data: " << std::endl; for(auto it(mIncomingData.begin());it!=mIncomingData.end();++it) - for(auto it2(it->second.begin());it2!=it->second.end();++it2) - std::cerr << " service " << std::hex << it->first << std::dec << " peer id " << it2->first << " " << (void*)it2->second << std::endl; + std::cerr << " peer id " << it->first << " " << (void*)it->second << std::endl; } //===========================================================================================================================================// @@ -428,12 +420,9 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co return ; } - uint16_t service_id = mGroups[group_id].service_id ; - #ifdef DEBUG_RSGXSNETTUNNEL GXS_NET_TUNNEL_DEBUG() << " item is a virtual peer id item with vpid = "<< pid_item->virtual_peer_id - << " for group " << group_id << " in service " << std::hex << service_id << std::dec - << ". Setting virtual peer." << std::endl; + << " for group " << group_id << ". Setting virtual peer." << std::endl; #endif // we receive a virtual peer id, so we need to update the local information for this peer id @@ -444,7 +433,7 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co vp_info.vpid_status = RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE ; // status of the peer vp_info.side = direction; // client/server vp_info.last_contact = time(NULL); // last time some data was sent/recvd - vp_info.providing_set[service_id].provided_groups.insert(group_id); + vp_info.group_id = group_id; memcpy(vp_info.encryption_master_key,encryption_master_key,RS_GXS_TUNNEL_CONST_EKEY_SIZE); @@ -476,20 +465,18 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co return; } - uint16_t service_id = getRsItemService(getRsItemId(data)) ; - #ifdef DEBUG_RSGXSNETTUNNEL - GXS_NET_TUNNEL_DEBUG() << "item contains generic data for service " << std::hex << service_id << std::dec << " for VPID " << gxs_vpid << ". Storing in incoming list" << std::endl; + GXS_NET_TUNNEL_DEBUG() << "item contains generic data for VPID " << gxs_vpid << ". Storing in incoming list" << std::endl; #endif - // push the data into the service incoming data list + // push the data into the incoming data list RsTlvBinaryData *bind = new RsTlvBinaryData; bind->tlvtype = 0; bind->bin_len = data_size; bind->bin_data = data; - mIncomingData[service_id].push_back(std::make_pair(gxs_vpid,bind)) ; + mIncomingData.push_back(std::make_pair(gxs_vpid,bind)) ; } } @@ -520,7 +507,7 @@ void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const Tur // We need to send our own virtual peer id to the other end of the tunnel - RsGxsNetTunnelVirtualPeerId net_service_virtual_peer = locked_makeVirtualPeerId(); + RsGxsNetTunnelVirtualPeerId net_service_virtual_peer = locked_makeVirtualPeerId(group_id); #ifdef DEBUG_RSGXSNETTUNNEL GXS_NET_TUNNEL_DEBUG() << " sending back virtual peer name " << net_service_virtual_peer << " to end of tunnel" << std::endl; @@ -632,16 +619,17 @@ void RsGxsNetTunnelService::data_tick() void RsGxsNetTunnelService::sendKeepAlivePackets() { RS_STACK_MUTEX(mGxsNetTunnelMtx); - RsGxsNetTunnelVirtualPeerId own_gxs_vpid = locked_makeVirtualPeerId() ; - #ifdef DEBUG_RSGXSNETTUNNEL - GXS_NET_TUNNEL_DEBUG() << " sending keep-alive packets. Own GXS peer ID is " << own_gxs_vpid << std::endl; + GXS_NET_TUNNEL_DEBUG() << " sending keep-alive packets. " << std::endl; #endif // We send KA packets for each GXS virtual peer. The advantage is that unused tunnels will automatically die which eliminates duplicate tunnels // automatically. We only send from the client side. for(auto it(mVirtualPeers.begin());it!=mVirtualPeers.end();++it) + { + RsGxsNetTunnelVirtualPeerId own_gxs_vpid = locked_makeVirtualPeerId(it->second.group_id) ; + if(own_gxs_vpid < it->first) { #ifdef DEBUG_RSGXSNETTUNNEL @@ -662,6 +650,7 @@ void RsGxsNetTunnelService::sendKeepAlivePackets() else GXS_NET_TUNNEL_DEBUG() << " ignoring virtual peer " << it->first << std::endl; #endif + } } void RsGxsNetTunnelService::autowash() @@ -671,10 +660,9 @@ void RsGxsNetTunnelService::autowash() #ifdef DEBUG_RSGXSNETTUNNEL GXS_NET_TUNNEL_DEBUG() << " performing per-group consistency test." << std::endl; #endif - RsGxsNetTunnelVirtualPeerId own_gxs_vpid = locked_makeVirtualPeerId() ; - for(auto it(mGroups.begin());it!=mGroups.end();++it) { + RsGxsNetTunnelVirtualPeerId own_gxs_vpid = locked_makeVirtualPeerId(it->first) ; RsGxsNetTunnelGroupInfo& ginfo(it->second) ; bool should_monitor_tunnels = false ; diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 4826729f6..c63ab0135 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -100,11 +100,6 @@ typedef RsPeerId RsGxsNetTunnelVirtualPeerId ; class RsGxsNetTunnelItem ; -struct RsGxsNetTunnelVirtualPeerProvidingSet -{ - std::set provided_groups ; -}; - struct RsGxsNetTunnelVirtualPeerInfo { enum { RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN = 0x00, // unknown status. @@ -120,9 +115,9 @@ struct RsGxsNetTunnelVirtualPeerInfo uint8_t side ; // client/server uint8_t encryption_master_key[32]; - TurtleVirtualPeerId turtle_virtual_peer_id ; // turtle peer to use when sending data to this vpid. + TurtleVirtualPeerId turtle_virtual_peer_id ; // turtle peer to use when sending data to this vpid. - std::map providing_set; // partial list of groups provided by this virtual peer id, based on tunnel results, for each service + RsGxsGroupId group_id ; // group that virtual peer is providing }; struct RsGxsNetTunnelGroupInfo @@ -140,13 +135,12 @@ struct RsGxsNetTunnelGroupInfo RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE = 0x02, // group will explicitely request tunnels, if none available }; - RsGxsNetTunnelGroupInfo() : group_policy(RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE),group_status(RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE),last_contact(0),service_id(0) {} + RsGxsNetTunnelGroupInfo() : group_policy(RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE),group_status(RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE),last_contact(0) {} GroupPolicy group_policy ; GroupStatus group_status ; time_t last_contact ; TurtleFileHash hash ; - uint16_t service_id ; std::set virtual_peers ; // list of which virtual peers provide this group. Can me more than 1. }; @@ -161,19 +155,19 @@ public: * \brief Manage tunnels for this group * @param group_id group for which tunnels should be released */ - bool requestDistantPeers(uint16_t service_id, const RsGxsGroupId&group_id) ; + bool requestDistantPeers(const RsGxsGroupId&group_id) ; /*! * \brief Stop managing tunnels for this group * @param group_id group for which tunnels should be released */ - bool releaseDistantPeers(uint16_t service_id,const RsGxsGroupId&group_id) ; + bool releaseDistantPeers(const RsGxsGroupId&group_id) ; /*! * \brief Get the list of active virtual peers for a given group. This implies that a tunnel is up and * alive. This function also "registers" the group which allows to handle tunnel requests in the server side. */ - bool getVirtualPeers(uint16_t service_id, std::list& peers) ; // returns the virtual peers for this group + bool getVirtualPeers(std::list& peers) ; // returns the virtual peers for this group /*! * \brief sendData @@ -187,15 +181,14 @@ public: /*! * \brief receiveData - * returns the next piece of data received fro the given service, and the virtual GXS peer that sended it. - * \param service_id service that provide the data + * returns the next piece of data received, and the virtual GXS peer that sended it. * \param data memory check containing the data. Memory ownership belongs to the client. * \param data_len length of memory chunk * \param virtual_peer peer who sent the data * \return * true if something is returned. If not, data is set to NULL, data_len to 0. */ - bool receiveTunnelData(uint16_t service_id,unsigned char *& data,uint32_t& data_len,RsGxsNetTunnelVirtualPeerId& virtual_peer) ; + bool receiveTunnelData(unsigned char *& data, uint32_t& data_len, RsGxsNetTunnelVirtualPeerId& virtual_peer) ; /*! * \brief isDistantPeer @@ -247,7 +240,7 @@ private: std::list > mPendingTurtleItems ; // items that need to be sent off-turtle Mutex. - std::map > > mIncomingData; // list of incoming data items, per service. + std::list > mIncomingData; // list of incoming data items /*! * \brief Generates the hash to request tunnels for this group. This hash is only used by turtle, and is used to @@ -261,7 +254,7 @@ private: * tunnel ID and turtle virtual peer id. This allows RsGxsNetService to keep sync-ing the data consistently. */ - RsGxsNetTunnelVirtualPeerId locked_makeVirtualPeerId() const ; + RsGxsNetTunnelVirtualPeerId locked_makeVirtualPeerId(const RsGxsGroupId& group_id) const ; static void generateEncryptionKey(const RsGxsGroupId& group_id,const TurtleVirtualPeerId& vpid,unsigned char key[RS_GXS_TUNNEL_CONST_EKEY_SIZE]) ; From 57bb31ece62fcbba4a18313fbad7c594e913d70d Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 25 Apr 2018 18:52:07 +0200 Subject: [PATCH 032/138] added new checks in canSend and canRecv Msg/Grp to work with distant peers --- libretroshare/src/gxs/rsgxsnetservice.cc | 37 ++++++++++++++++++++++-- libretroshare/src/gxs/rsgxsnettunnel.cc | 12 ++++++-- libretroshare/src/gxs/rsgxsnettunnel.h | 3 +- 3 files changed, 47 insertions(+), 5 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 619adb5f7..33081acd2 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -668,7 +668,6 @@ void RsGxsNetService::syncWithPeers() const RsGxsGroupId& grpId = mmit->first; RsGxsCircleId encrypt_to_this_circle_id ; -#warning we should use this call in order to determine wether the peer can be sent group information about a specific group, otherwise we leak which group we are subscribed to if(!checkCanRecvMsgFromPeer(peerId, *meta,encrypt_to_this_circle_id)) continue; @@ -741,7 +740,9 @@ void RsGxsNetService::generic_sendItem(RsNxsItem *si) { // check if the item is to be sent to a distant peer or not - if(mAllowDistSync && isDistantPeer( static_cast(si->PeerId()))) + RsGxsGroupId tmp_grpId; + + if(mAllowDistSync && isDistantPeer( static_cast(si->PeerId()),tmp_grpId)) { RsNxsSerialiser ser(mServType); @@ -4091,6 +4092,17 @@ bool RsGxsNetService::canSendGrpId(const RsPeerId& sslId, const RsGxsGrpMetaData #ifdef NXS_NET_DEBUG_4 GXSNETDEBUG_PG(sslId,grpMeta.mGroupId) << "RsGxsNetService::canSendGrpId()"<< std::endl; #endif + // check if that peer is a virtual peer id, in which case we only send/recv data to/from it items for the group it's requested for + + RsGxsGroupId peer_grp ; + if(isDistantPeer(RsGxsNetTunnelVirtualPeerId(sslId),peer_grp) && peer_grp != grpMeta.mGroupId) + { +#ifdef NXS_NET_DEBUG_4 + GXSNETDEBUG_PG(sslId,grpMeta.mGroupId) << " Distant peer designed for group " << peer_grp << ": cannot request sync for different group." << std::endl; +#endif + return false ; + } + // first do the simple checks uint8_t circleType = grpMeta.mCircleType; @@ -4144,6 +4156,17 @@ bool RsGxsNetService::checkCanRecvMsgFromPeer(const RsPeerId& sslId, const RsGxs GXSNETDEBUG_PG(sslId,grpMeta.mGroupId) << "RsGxsNetService::checkCanRecvMsgFromPeer()"; GXSNETDEBUG_PG(sslId,grpMeta.mGroupId) << " peer Id = " << sslId << ", grpId=" << grpMeta.mGroupId <& msgMetas, co #ifdef NXS_NET_DEBUG_4 GXSNETDEBUG_PG(sslId,grpMeta.mGroupId) << "RsGxsNetService::canSendMsgIds() CIRCLE VETTING" << std::endl; #endif + // check if that peer is a virtual peer id, in which case we only send/recv data to/from it items for the group it's requested for + + RsGxsGroupId peer_grp ; + if(isDistantPeer(RsGxsNetTunnelVirtualPeerId(sslId),peer_grp) && peer_grp != grpMeta.mGroupId) + { +#ifdef NXS_NET_DEBUG_4 + GXSNETDEBUG_PG(sslId,grpMeta.mGroupId) << " Distant peer designed for group " << peer_grp << ": cannot request sync for different group." << std::endl; +#endif + return false ; + } // first do the simple checks uint8_t circleType = grpMeta.mCircleType; diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index e3da0be70..00e3fd852 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -140,11 +140,19 @@ RsGxsNetTunnelService::~RsGxsNetTunnelService() mIncomingData.clear(); } -bool RsGxsNetTunnelService::isDistantPeer(const RsGxsNetTunnelVirtualPeerId& virtual_peer) +bool RsGxsNetTunnelService::isDistantPeer(const RsGxsNetTunnelVirtualPeerId& virtual_peer, RsGxsGroupId& group_id) { RS_STACK_MUTEX(mGxsNetTunnelMtx); - return mVirtualPeers.find(virtual_peer) != mVirtualPeers.end(); + auto it = mVirtualPeers.find(virtual_peer) ; + + if(it != mVirtualPeers.end()) + { + group_id = it->second.group_id ; + return true ; + } + else + return false ; } bool RsGxsNetTunnelService::receiveTunnelData(unsigned char *& data,uint32_t& data_len,RsGxsNetTunnelVirtualPeerId& virtual_peer) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index c63ab0135..9448b9508 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -193,10 +193,11 @@ public: /*! * \brief isDistantPeer * returns wether the peer is in the list of available distant peers or not + * \param group_id returned by the service to indicate which group this peer id is designed for. * \return true if the peer is a distant GXS peer. */ - bool isDistantPeer(const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; + bool isDistantPeer(const RsGxsNetTunnelVirtualPeerId& virtual_peer,RsGxsGroupId& group_id) ; /*! * \brief dumps all information about monitored groups. From 606537a0923fec8af3db0a83f1f78d661fa59b05 Mon Sep 17 00:00:00 2001 From: RetroPooh Date: Thu, 26 Apr 2018 23:28:14 +0300 Subject: [PATCH 033/138] reorder cases for nicer diff --- retroshare-gui/src/gui/RetroShareLink.cpp | 202 +++++++++++----------- 1 file changed, 101 insertions(+), 101 deletions(-) diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp index ed9484f08..744826bbb 100644 --- a/retroshare-gui/src/gui/RetroShareLink.cpp +++ b/retroshare-gui/src/gui/RetroShareLink.cpp @@ -1386,107 +1386,6 @@ static void processList(const QStringList &list, const QString &textSingular, co ++countUnknown; break; - case TYPE_FILE: - { - FileInfo fi1; - if(links.size()==1 && rsFiles->alreadyHaveFile(RsFileHash(link.hash().toStdString()), fi1) - && !link.name().endsWith(RsCollection::ExtensionString)) - { - /* fallthrough */ - } - else - { - col.merge_in(link.name(),link.size(),RsFileHash(link.hash().toStdString())) ; - fileLinkFound = true; - break; - } - } - //break; - case TYPE_EXTRAFILE: - { -#ifdef DEBUG_RSLINK - std::cerr << " RetroShareLink::process FileRequest : fileName : " << link.name().toUtf8().constData() << ". fileHash : " << link.hash().toStdString() << ". fileSize : " << link.size() << std::endl; -#endif - - needNotifySuccess = true; - std::list srcIds; - - // Add the link built-in source. This is needed for EXTRA files, where the source is specified in the link. - - if(link.type() == TYPE_EXTRAFILE) - { -#ifdef DEBUG_RSLINK - std::cerr << " RetroShareLink::process Adding built-in source " << link.SSLId().toStdString() << std::endl; -#endif - srcIds.push_back(RsPeerId(link.SSLId().toStdString())) ; - } - - // Get a list of available direct sources, in case the file is browsable only. - // - FileInfo finfo ; - rsFiles->FileDetails(RsFileHash(link.hash().toStdString()), RS_FILE_HINTS_REMOTE, finfo) ; - - for(std::vector::const_iterator it(finfo.peers.begin());it!=finfo.peers.end();++it) - { -#ifdef DEBUG_RSLINK - std::cerr << " adding peerid " << (*it).peerId << std::endl ; -#endif - srcIds.push_back((*it).peerId) ; - } - - QString cleanname = link.name() ; - static const QString bad_chars_str = "/\\\"*:?<>|" ; - - for(int i=0;ialreadyHaveFile(RsFileHash(link.hash().toStdString()), fi)) { - /* make path for downloaded file */ - std::string path; - path = fi.path;//Shared files has path with filename included - - //Seems that all FileInfo get .path==filepath+filename - //if (fi.downloadStatus == FT_STATE_COMPLETE) - // path = fi.path + "/" + fi.fname; - - QFileInfo qinfo; - qinfo.setFile(QString::fromUtf8(path.c_str())); - if (qinfo.exists() && qinfo.isFile() && !dontOpenNextFile) { - QString question = ""; - question += QObject::tr("Warning: Retroshare is about to ask your system to open this file. "); - question += QObject::tr("Before you do so, please make sure that this file does not contain malicious executable code."); - question += "

" + cleanname + ""; - - QMessageBox mb(QObject::tr("Confirmation"), question, QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No, links.size()>1 ? QMessageBox::NoToAll : 0, 0); - int ret = mb.exec(); - if(ret == QMessageBox::Yes) { - ++countFileOpened; - bFileOpened = true; - /* open file with a suitable application */ - if (!RsUrlHandler::openUrl(QUrl::fromLocalFile(qinfo.absoluteFilePath()))) { - std::cerr << "RetroShareLink::process(): can't open file " << path << std::endl; - } - } else if (ret == QMessageBox::NoToAll) { - dontOpenNextFile = true; - } - needNotifySuccess = false; - } - } - - if (rsFiles->FileRequest(cleanname.toUtf8().constData(), RsFileHash(link.hash().toStdString()), link.size(), "", RS_FILE_REQ_ANONYMOUS_ROUTING, srcIds)) { - fileAdded.append(link.name()); - } else { - if (!bFileOpened && links.size()>1) fileExist.append(link.name());} - } - break; - case TYPE_PERSON: { #ifdef DEBUG_RSLINK @@ -1641,6 +1540,107 @@ static void processList(const QStringList &list, const QString &textSingular, co } break ; + case TYPE_FILE: + { + FileInfo fi1; + if(links.size()==1 && rsFiles->alreadyHaveFile(RsFileHash(link.hash().toStdString()), fi1) + && !link.name().endsWith(RsCollection::ExtensionString)) + { + /* fallthrough */ + } + else + { + col.merge_in(link.name(),link.size(),RsFileHash(link.hash().toStdString())) ; + fileLinkFound = true; + break; + } + } + //break; + case TYPE_EXTRAFILE: + { +#ifdef DEBUG_RSLINK + std::cerr << " RetroShareLink::process FileRequest : fileName : " << link.name().toUtf8().constData() << ". fileHash : " << link.hash().toStdString() << ". fileSize : " << link.size() << std::endl; +#endif + + needNotifySuccess = true; + std::list srcIds; + + // Add the link built-in source. This is needed for EXTRA files, where the source is specified in the link. + + if(link.type() == TYPE_EXTRAFILE) + { +#ifdef DEBUG_RSLINK + std::cerr << " RetroShareLink::process Adding built-in source " << link.SSLId().toStdString() << std::endl; +#endif + srcIds.push_back(RsPeerId(link.SSLId().toStdString())) ; + } + + // Get a list of available direct sources, in case the file is browsable only. + // + FileInfo finfo ; + rsFiles->FileDetails(RsFileHash(link.hash().toStdString()), RS_FILE_HINTS_REMOTE, finfo) ; + + for(std::vector::const_iterator it(finfo.peers.begin());it!=finfo.peers.end();++it) + { +#ifdef DEBUG_RSLINK + std::cerr << " adding peerid " << (*it).peerId << std::endl ; +#endif + srcIds.push_back((*it).peerId) ; + } + + QString cleanname = link.name() ; + static const QString bad_chars_str = "/\\\"*:?<>|" ; + + for(int i=0;ialreadyHaveFile(RsFileHash(link.hash().toStdString()), fi)) { + /* make path for downloaded file */ + std::string path; + path = fi.path;//Shared files has path with filename included + + //Seems that all FileInfo get .path==filepath+filename + //if (fi.downloadStatus == FT_STATE_COMPLETE) + // path = fi.path + "/" + fi.fname; + + QFileInfo qinfo; + qinfo.setFile(QString::fromUtf8(path.c_str())); + if (qinfo.exists() && qinfo.isFile() && !dontOpenNextFile) { + QString question = ""; + question += QObject::tr("Warning: Retroshare is about to ask your system to open this file. "); + question += QObject::tr("Before you do so, please make sure that this file does not contain malicious executable code."); + question += "

" + cleanname + ""; + + QMessageBox mb(QObject::tr("Confirmation"), question, QMessageBox::Warning, QMessageBox::Yes, QMessageBox::No, links.size()>1 ? QMessageBox::NoToAll : 0, 0); + int ret = mb.exec(); + if(ret == QMessageBox::Yes) { + ++countFileOpened; + bFileOpened = true; + /* open file with a suitable application */ + if (!RsUrlHandler::openUrl(QUrl::fromLocalFile(qinfo.absoluteFilePath()))) { + std::cerr << "RetroShareLink::process(): can't open file " << path << std::endl; + } + } else if (ret == QMessageBox::NoToAll) { + dontOpenNextFile = true; + } + needNotifySuccess = false; + } + } + + if (rsFiles->FileRequest(cleanname.toUtf8().constData(), RsFileHash(link.hash().toStdString()), link.size(), "", RS_FILE_REQ_ANONYMOUS_ROUTING, srcIds)) { + fileAdded.append(link.name()); + } else { + if (!bFileOpened && links.size()>1) fileExist.append(link.name());} + } + break; + //TYPE_PRIVATE_CHAT case TYPE_PUBLIC_MSG: From 5be57046f1c88a4ca14196e6f9bad8c8cd5ada31 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 27 Apr 2018 00:00:29 +0200 Subject: [PATCH 034/138] added load/save of random bias in GxsNetTunnel service --- libretroshare/src/gxs/rsgxsnetservice.cc | 26 ++++++++++++------- libretroshare/src/gxs/rsgxsnettunnel.cc | 8 +++--- libretroshare/src/gxs/rsgxsnettunnel.h | 15 +++++++---- libretroshare/src/retroshare/rsids.h | 2 ++ libretroshare/src/rsitems/rsgxsupdateitems.cc | 11 +++++++- libretroshare/src/rsitems/rsgxsupdateitems.h | 13 ++++++++++ 6 files changed, 56 insertions(+), 19 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 33081acd2..bf396a42c 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -1522,8 +1522,8 @@ class StoreHere { public: - StoreHere(RsGxsNetService::ClientGrpMap& cgm, RsGxsNetService::ClientMsgMap& cmm, RsGxsNetService::ServerMsgMap& smm,RsGxsNetService::GrpConfigMap& gcm, RsGxsServerGrpUpdate& sgm) - : mClientGrpMap(cgm), mClientMsgMap(cmm), mServerMsgMap(smm), mGrpConfigMap(gcm), mServerGrpUpdate(sgm) + StoreHere(RsGxsNetService::ClientGrpMap& cgm, RsGxsNetService::ClientMsgMap& cmm, RsGxsNetService::ServerMsgMap& smm,RsGxsNetService::GrpConfigMap& gcm, RsGxsServerGrpUpdate& sgm,Bias20Bytes& mrb) + : mClientGrpMap(cgm), mClientMsgMap(cmm), mServerMsgMap(smm), mGrpConfigMap(gcm), mServerGrpUpdate(sgm), mRandomBias(mrb) {} template void check_store(ID_type id,UpdateMap& map,ItemClass& item) @@ -1536,11 +1536,12 @@ public: void operator() (RsItem* item) { - RsGxsMsgUpdateItem* mui; - RsGxsGrpUpdateItem* gui; - RsGxsServerGrpUpdateItem* gsui; - RsGxsServerMsgUpdateItem* msui; - RsGxsGrpConfigItem* mgci; + RsGxsMsgUpdateItem *mui; + RsGxsGrpUpdateItem *gui; + RsGxsServerGrpUpdateItem *gsui; + RsGxsServerMsgUpdateItem *msui; + RsGxsGrpConfigItem *mgci; + RsGxsTunnelRandomBiasItem *rbsi; if((mui = dynamic_cast(item)) != NULL) check_store(mui->peerID,mClientMsgMap,*mui); @@ -1552,6 +1553,8 @@ public: check_store(msui->grpId,mServerMsgMap, *msui); else if((gsui = dynamic_cast(item)) != NULL) mServerGrpUpdate = *gsui; + else if((rbsi = dynamic_cast(item))!=NULL) + mRandomBias = rbsi->mRandomBias; else std::cerr << "Type not expected!" << std::endl; @@ -1566,7 +1569,7 @@ private: RsGxsNetService::GrpConfigMap& mGrpConfigMap; RsGxsServerGrpUpdate& mServerGrpUpdate; - + Bias20Bytes& mRandomBias ; }; bool RsGxsNetService::loadList(std::list &load) @@ -1575,7 +1578,7 @@ bool RsGxsNetService::loadList(std::list &load) // The delete is done in StoreHere, if necessary - std::for_each(load.begin(), load.end(), StoreHere(mClientGrpUpdateMap, mClientMsgUpdateMap, mServerMsgUpdateMap, mServerGrpConfigMap, mGrpServerUpdate)); + std::for_each(load.begin(), load.end(), StoreHere(mClientGrpUpdateMap, mClientMsgUpdateMap, mServerMsgUpdateMap, mServerGrpConfigMap, mGrpServerUpdate,mRandomBias)); // We reset group statistics here. This is the best place since we know at this point which are all unsubscribed groups. @@ -1652,6 +1655,11 @@ bool RsGxsNetService::saveList(bool& cleanup, std::list& save) save.push_back(it); + RsGxsTunnelRandomBiasItem *it2 = new RsGxsTunnelRandomBiasItem(mServType) ; + it2->mRandomBias = mRandomBias; + + save.push_back(it2) ; + cleanup = true; return true; } diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 00e3fd852..7d4a0018f 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -39,7 +39,7 @@ RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") { #warning this is for testing only. In the final version this needs to be initialized with some random content, saved and re-used for a while (e.g. 1 month) - memset(mRandomBias,0,RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE) ; + mRandomBias.clear(); } //===========================================================================================================================================// @@ -289,12 +289,12 @@ RsGxsNetTunnelVirtualPeerId RsGxsNetTunnelService::locked_makeVirtualPeerId(cons RsPeerId ssl_id = rsPeers->getOwnId() ; - unsigned char mem[RsGxsGroupId::SIZE_IN_BYTES + RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE]; + unsigned char mem[RsGxsGroupId::SIZE_IN_BYTES + mRandomBias.SIZE_IN_BYTES]; memcpy(mem ,group_id.toByteArray(),RsGxsGroupId::SIZE_IN_BYTES) ; - memcpy(mem+RsGxsGroupId::SIZE_IN_BYTES,mRandomBias ,RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE) ; + memcpy(mem+RsGxsGroupId::SIZE_IN_BYTES,mRandomBias.toByteArray(),mRandomBias.SIZE_IN_BYTES) ; - return RsGxsNetTunnelVirtualPeerId(RsDirUtil::sha1sum(mem,RsGxsGroupId::SIZE_IN_BYTES+RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE).toByteArray()); + return RsGxsNetTunnelVirtualPeerId(RsDirUtil::sha1sum(mem,RsGxsGroupId::SIZE_IN_BYTES+mRandomBias.SIZE_IN_BYTES).toByteArray()); } void RsGxsNetTunnelService::dump() const diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 9448b9508..5d90d9fe3 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -23,6 +23,8 @@ * */ +#pragma once + #include #include @@ -224,15 +226,17 @@ protected: void removeVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&) ; p3turtle *mTurtle ; + + static const uint32_t RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE = 20 ; + static const uint32_t RS_GXS_TUNNEL_CONST_EKEY_SIZE = 32 ; + + Bias20Bytes mRandomBias ; // constant accross reboots. Allows to disguise the real SSL id while providing a consistent value accross time. private: void autowash() ; void sendKeepAlivePackets() ; void handleIncoming(RsGxsNetTunnelItem *item) ; void flush_pending_items(); - static const uint32_t RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE = 20 ; - static const uint32_t RS_GXS_TUNNEL_CONST_EKEY_SIZE = 32 ; - std::map mGroups ; // groups on the client and server side std::map mVirtualPeers ; // current virtual peers, which group they provide, and how to talk to them through turtle @@ -259,8 +263,9 @@ private: static void generateEncryptionKey(const RsGxsGroupId& group_id,const TurtleVirtualPeerId& vpid,unsigned char key[RS_GXS_TUNNEL_CONST_EKEY_SIZE]) ; - uint8_t mRandomBias[RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE] ; // constant accross reboots. Allows to disguise the real SSL id while providing a consistent value accross time. - mutable RsMutex mGxsNetTunnelMtx; + + friend class RsGxsTunnelRandomBiasItem ; + friend class StoreHere ; }; diff --git a/libretroshare/src/retroshare/rsids.h b/libretroshare/src/retroshare/rsids.h index 21a8fd754..828136dbc 100644 --- a/libretroshare/src/retroshare/rsids.h +++ b/libretroshare/src/retroshare/rsids.h @@ -238,12 +238,14 @@ static const uint32_t RS_GENERIC_ID_GXS_TUNNEL_ID_TYPE = 0x0010 ; static const uint32_t RS_GENERIC_ID_GXS_DISTANT_CHAT_ID_TYPE = 0x0011 ; static const uint32_t RS_GENERIC_ID_NODE_GROUP_ID_TYPE = 0x0012 ; static const uint32_t RS_GENERIC_ID_SHA256_ID_TYPE = 0x0013 ; +static const uint32_t RS_GENERIC_ID_20_BYTES_UNTYPED = 0x0014 ; typedef t_RsGenericIdType< SSL_ID_SIZE , false, RS_GENERIC_ID_SSL_ID_TYPE> SSLIdType ; typedef t_RsGenericIdType< PGP_KEY_ID_SIZE , true, RS_GENERIC_ID_PGP_ID_TYPE> PGPIdType ; typedef t_RsGenericIdType< SHA1_SIZE , false, RS_GENERIC_ID_SHA1_ID_TYPE> Sha1CheckSum ; typedef t_RsGenericIdType< SHA256_SIZE , false, RS_GENERIC_ID_SHA256_ID_TYPE> Sha256CheckSum ; typedef t_RsGenericIdType< PGP_KEY_FINGERPRINT_SIZE, true, RS_GENERIC_ID_PGP_FINGERPRINT_TYPE> PGPFingerprintType ; +typedef t_RsGenericIdType< SHA1_SIZE , true, RS_GENERIC_ID_20_BYTES_UNTYPED> Bias20Bytes ; typedef t_RsGenericIdType< CERT_SIGN_LEN , false, RS_GENERIC_ID_GXS_GROUP_ID_TYPE > GXSGroupId ; typedef t_RsGenericIdType< CERT_SIGN_LEN , false, RS_GENERIC_ID_GXS_ID_TYPE > GXSId ; diff --git a/libretroshare/src/rsitems/rsgxsupdateitems.cc b/libretroshare/src/rsitems/rsgxsupdateitems.cc index 50f154cb2..eee847704 100644 --- a/libretroshare/src/rsitems/rsgxsupdateitems.cc +++ b/libretroshare/src/rsitems/rsgxsupdateitems.cc @@ -44,6 +44,7 @@ RsItem* RsGxsUpdateSerialiser::create_item(uint16_t service,uint8_t item_subtype case RS_PKT_SUBTYPE_GXS_SERVER_GRP_UPDATE: return new RsGxsServerGrpUpdateItem(SERVICE_TYPE); case RS_PKT_SUBTYPE_GXS_SERVER_MSG_UPDATE: return new RsGxsServerMsgUpdateItem(SERVICE_TYPE); case RS_PKT_SUBTYPE_GXS_GRP_CONFIG: return new RsGxsGrpConfigItem(SERVICE_TYPE); + case RS_PKT_SUBTYPE_GXS_RANDOM_BIAS: return new RsGxsTunnelRandomBiasItem(SERVICE_TYPE); default: return NULL ; } @@ -76,6 +77,11 @@ void RsGxsServerGrpUpdateItem::clear() grpUpdateTS = 0; } +void RsGxsTunnelRandomBiasItem::clear() +{ + mRandomBias.clear() ; +} + /**********************************************************************************************/ /* SERIALISER */ /**********************************************************************************************/ @@ -134,5 +140,8 @@ void RsGxsGrpConfigItem::serial_process(RsGenericSerializer::SerializeJob j,RsGe RsTypeSerializer::serial_process(j,ctx,msg_send_delay,"msg_send_delay") ; RsTypeSerializer::serial_process(j,ctx,msg_req_delay,"msg_req_delay") ; } - +void RsGxsTunnelRandomBiasItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) +{ + RsTypeSerializer::serial_process(j,ctx,mRandomBias,"random bias") ; +} diff --git a/libretroshare/src/rsitems/rsgxsupdateitems.h b/libretroshare/src/rsitems/rsgxsupdateitems.h index c9725426c..e73dc2197 100644 --- a/libretroshare/src/rsitems/rsgxsupdateitems.h +++ b/libretroshare/src/rsitems/rsgxsupdateitems.h @@ -39,6 +39,7 @@ #include "gxs/rsgxs.h" #include "gxs/rsgxsdata.h" +#include "gxs/rsgxsnettunnel.h" #include "serialiser/rstlvidset.h" @@ -48,6 +49,7 @@ const uint8_t RS_PKT_SUBTYPE_GXS_MSG_UPDATE = 0x03; const uint8_t RS_PKT_SUBTYPE_GXS_SERVER_GRP_UPDATE = 0x04; const uint8_t RS_PKT_SUBTYPE_GXS_SERVER_MSG_UPDATE = 0x08; const uint8_t RS_PKT_SUBTYPE_GXS_GRP_CONFIG = 0x09; +const uint8_t RS_PKT_SUBTYPE_GXS_RANDOM_BIAS = 0x0a; class RsGxsNetServiceItem: public RsItem { @@ -186,6 +188,17 @@ public: RsGxsGroupId grpId; }; +class RsGxsTunnelRandomBiasItem: public RsGxsNetServiceItem +{ +public: + explicit RsGxsTunnelRandomBiasItem(uint16_t servType) : RsGxsNetServiceItem(servType, RS_PKT_SUBTYPE_GXS_RANDOM_BIAS) { clear();} + virtual ~RsGxsTunnelRandomBiasItem() {} + + virtual void clear(); + virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); + + Bias20Bytes mRandomBias; // Cannot be a simple char[] because of serialization. +}; class RsGxsUpdateSerialiser : public RsServiceSerializer { From 99739783503a05731916f66b2ae6715785b79a67 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 29 Apr 2018 16:19:45 +0200 Subject: [PATCH 035/138] improved management of tunnels and virtual peers --- libretroshare/src/gxs/rsgxsnetservice.cc | 7 ++- libretroshare/src/gxs/rsgxsnetservice.h | 2 + libretroshare/src/gxs/rsgxsnettunnel.cc | 73 +++++++++++++++--------- libretroshare/src/gxs/rsgxsnettunnel.h | 11 +++- 4 files changed, 61 insertions(+), 32 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index bf396a42c..50045b556 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -273,14 +273,14 @@ ***/ #define NXS_NET_DEBUG_0 1 -#define NXS_NET_DEBUG_1 1 +//#define NXS_NET_DEBUG_1 1 //#define NXS_NET_DEBUG_2 1 //#define NXS_NET_DEBUG_3 1 //#define NXS_NET_DEBUG_4 1 //#define NXS_NET_DEBUG_5 1 //#define NXS_NET_DEBUG_6 1 //#define NXS_NET_DEBUG_7 1 -#define NXS_NET_DEBUG_8 1 +//#define NXS_NET_DEBUG_8 1 //#define NXS_FRAG @@ -2008,7 +2008,8 @@ void RsGxsNetService::data_tick() // also tick distant traffic - RsGxsNetTunnelService::data_tick(); + if(mAllowDistSync) + RsGxsNetTunnelService::data_tick(); } void RsGxsNetService::debugDump() diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index 04c0317a6..d7fe23cc3 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -104,6 +104,8 @@ public: public: + virtual uint16_t serviceType() const { return mServType ; } + /*! * Use this to set how far back synchronisation and storage of messages should take place * @param age the max age a sync/storage item can to be allowed in a synchronisation diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 7d4a0018f..052dffacc 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -32,7 +32,7 @@ #define DEBUG_RSGXSNETTUNNEL 1 #define GXS_NET_TUNNEL_NOT_IMPLEMENTED() { std::cerr << __PRETTY_FUNCTION__ << ": not yet implemented." << std::endl; } -#define GXS_NET_TUNNEL_DEBUG() std::cerr << time(NULL) << " : GXS_NET_TUNNEL : " << __FUNCTION__ << " : " +#define GXS_NET_TUNNEL_DEBUG() std::cerr << time(NULL) << " : GXS_NET_TUNNEL(" << std::hex << serviceType() << std::dec << ") : " << __FUNCTION__ << " : " #define GXS_NET_TUNNEL_ERROR() std::cerr << "(EE) GXS_NET_TUNNEL ERROR : " @@ -204,6 +204,8 @@ bool RsGxsNetTunnelService::sendTunnelData(unsigned char *& data,uint32_t data_l return false ; } + it->second.last_contact = time(NULL) ; + // 2 - encrypt and send the item. RsTurtleGenericDataItem *encrypted_turtle_item = NULL ; @@ -247,7 +249,9 @@ bool RsGxsNetTunnelService::requestDistantPeers(const RsGxsGroupId& group_id) RsGxsNetTunnelGroupInfo& ginfo( mGroups[group_id] ) ; - ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE; + if(ginfo.group_policy < RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE) + ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE; + ginfo.hash = calculateGroupHash(group_id) ; mHandledHashes[ginfo.hash] = group_id ; @@ -287,14 +291,18 @@ RsGxsNetTunnelVirtualPeerId RsGxsNetTunnelService::locked_makeVirtualPeerId(cons // We compute sha1( SSL_id | mRandomBias ) and trunk it to 16 bytes in order to compute a RsPeerId +#ifdef DEBUG_RSGXSNETTUNNEL + // /!\ this is for testing only! Remove this when done! Can not be done at initialization when rsPeer is not started. RsPeerId ssl_id = rsPeers->getOwnId() ; + mRandomBias = Bias20Bytes(RsDirUtil::sha1sum(ssl_id.toByteArray(),ssl_id.SIZE_IN_BYTES)) ; +#endif - unsigned char mem[RsGxsGroupId::SIZE_IN_BYTES + mRandomBias.SIZE_IN_BYTES]; + unsigned char mem[group_id.SIZE_IN_BYTES + mRandomBias.SIZE_IN_BYTES]; - memcpy(mem ,group_id.toByteArray(),RsGxsGroupId::SIZE_IN_BYTES) ; - memcpy(mem+RsGxsGroupId::SIZE_IN_BYTES,mRandomBias.toByteArray(),mRandomBias.SIZE_IN_BYTES) ; + memcpy(mem ,group_id.toByteArray(),group_id.SIZE_IN_BYTES) ; + memcpy(mem+group_id.SIZE_IN_BYTES,mRandomBias.toByteArray(),mRandomBias.SIZE_IN_BYTES) ; - return RsGxsNetTunnelVirtualPeerId(RsDirUtil::sha1sum(mem,RsGxsGroupId::SIZE_IN_BYTES+mRandomBias.SIZE_IN_BYTES).toByteArray()); + return RsGxsNetTunnelVirtualPeerId(RsDirUtil::sha1sum(mem,group_id.SIZE_IN_BYTES+mRandomBias.SIZE_IN_BYTES).toByteArray()); } void RsGxsNetTunnelService::dump() const @@ -308,10 +316,11 @@ void RsGxsNetTunnelService::dump() const std::string("[VPIDS_AVAILABLE ]") }; - static std::string group_policy_str[3] = { - std::string("[UNKNOWN]"), - std::string("[PASSIVE]"), - std::string("[ACTIVE ]"), + static std::string group_policy_str[4] = { + std::string("[UNKNOWN ]"), + std::string("[PASSIVE ]"), + std::string("[ACTIVE ]"), + std::string("[REQUESTING]"), }; static std::string vpid_status_str[3] = { std::string("[UNKNOWN ]"), @@ -319,39 +328,39 @@ void RsGxsNetTunnelService::dump() const std::string("[ACTIVE ]") }; - std::cerr << "GxsNetTunnelService dump: " << std::endl; - std::cerr << "Managed GXS groups: " << std::endl; + std::cerr << "GxsNetTunnelService dump (this=" << (void*)this << ". serv=" << std::hex << serviceType() << std::dec <<") : " << std::endl; + std::cerr << " Managed GXS groups: " << std::endl; for(auto it(mGroups.begin());it!=mGroups.end();++it) { - std::cerr << " " << it->first << " hash: " << it->second.hash << " policy: " << group_policy_str[it->second.group_policy] << " status: " << group_status_str[it->second.group_status] << " Last contact: " << time(NULL) - it->second.last_contact << " secs ago" << std::endl; + std::cerr << " " << it->first << " hash: " << it->second.hash << " policy: " << group_policy_str[it->second.group_policy] << " status: " << group_status_str[it->second.group_status] << " Last contact: " << time(NULL) - it->second.last_contact << " secs ago" << std::endl; if(!it->second.virtual_peers.empty()) - std::cerr << " virtual peers:" << std::endl; + std::cerr << " virtual peers:" << std::endl; for(auto it2(it->second.virtual_peers.begin());it2!=it->second.virtual_peers.end();++it2) - std::cerr << " " << *it2 << std::endl; + std::cerr << " " << *it2 << std::endl; } - std::cerr << "Virtual peers: " << std::endl; + std::cerr << " Virtual peers: " << std::endl; for(auto it(mVirtualPeers.begin());it!=mVirtualPeers.end();++it) - std::cerr << " GXS Peer:" << it->first << " Turtle:" << it->second.turtle_virtual_peer_id + std::cerr << " GXS Peer:" << it->first << " Turtle:" << it->second.turtle_virtual_peer_id << " status: " << vpid_status_str[it->second.vpid_status] << " direction: " << " group_id: " << it->second.group_id << " direction: " << (int)it->second.side - << " last seen " << time(NULL)-it->second.last_contact + << " last seen " << time(NULL)-it->second.last_contact << " secs ago" << " ekey: " << RsUtil::BinToHex(it->second.encryption_master_key,RS_GXS_TUNNEL_CONST_EKEY_SIZE,10) << std::endl; - std::cerr << "Virtual peer turtle => GXS conversion table: " << std::endl; + std::cerr << " Virtual peer turtle => GXS conversion table: " << std::endl; for(auto it(mTurtle2GxsPeer.begin());it!=mTurtle2GxsPeer.end();++it) - std::cerr << " " << it->first << " => " << it->second << std::endl; + std::cerr << " " << it->first << " => " << it->second << std::endl; - std::cerr << "Hashes: " << std::endl; + std::cerr << " Hashes: " << std::endl; for(auto it(mHandledHashes.begin());it!=mHandledHashes.end();++it) - std::cerr << " hash: " << it->first << " GroupId: " << it->second << std::endl; + std::cerr << " hash: " << it->first << " GroupId: " << it->second << std::endl; - std::cerr << "Incoming data: " << std::endl; + std::cerr << " Incoming data: " << std::endl; for(auto it(mIncomingData.begin());it!=mIncomingData.end();++it) - std::cerr << " peer id " << it->first << " " << (void*)it->second << std::endl; + std::cerr << " peer id " << it->first << " " << (void*)it->second << std::endl; } //===========================================================================================================================================// @@ -472,6 +481,8 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co free(data); return; } + it2->second.vpid_status = RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE ; // status of the peer + it2->second.last_contact = time(NULL); // last time some data was sent/recvd #ifdef DEBUG_RSGXSNETTUNNEL GXS_NET_TUNNEL_DEBUG() << "item contains generic data for VPID " << gxs_vpid << ". Storing in incoming list" << std::endl; @@ -638,10 +649,14 @@ void RsGxsNetTunnelService::sendKeepAlivePackets() { RsGxsNetTunnelVirtualPeerId own_gxs_vpid = locked_makeVirtualPeerId(it->second.group_id) ; +#ifdef DEBUG_RSGXSNETTUNNEL + GXS_NET_TUNNEL_DEBUG() << " virtual peer " << it->first << " through tunnel " << it->second.turtle_virtual_peer_id << " for group " << it->second.group_id ; +#endif + if(own_gxs_vpid < it->first) { #ifdef DEBUG_RSGXSNETTUNNEL - GXS_NET_TUNNEL_DEBUG() << " sending to virtual peer " << it->first << " through tunnel " << it->second.turtle_virtual_peer_id << std::endl; + std::cerr << ": sent!" << std::endl; #endif RsGxsNetTunnelKeepAliveItem pitem ; RsTemporaryMemory tmpmem( RsGxsNetTunnelSerializer().size(&pitem) ) ; @@ -653,10 +668,12 @@ void RsGxsNetTunnelService::sendKeepAlivePackets() if(p3turtle::encryptData(tmpmem,len,it->second.encryption_master_key,encrypted_turtle_item)) mPendingTurtleItems.push_back(std::make_pair(it->second.turtle_virtual_peer_id,encrypted_turtle_item)) ; + + it->second.last_contact = time(NULL) ; } #ifdef DEBUG_RSGXSNETTUNNEL else - GXS_NET_TUNNEL_DEBUG() << " ignoring virtual peer " << it->first << std::endl; + std::cerr << ": ignored!" << std::endl; #endif } } @@ -679,7 +696,7 @@ void RsGxsNetTunnelService::autowash() #endif // check whether the group already has GXS virtual peers with suppliers. If so, we can set the GRP policy as passive. - if(ginfo.group_policy == RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE) + if(ginfo.group_policy >= RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE) { bool found = false ; @@ -699,10 +716,12 @@ void RsGxsNetTunnelService::autowash() std::cerr << " active, with client-side peers : "; #endif should_monitor_tunnels = false ; + ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE ; } else { should_monitor_tunnels = true ; + ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_REQUESTING ; #ifdef DEBUG_RSGXSNETTUNNEL std::cerr << " active, and no client-side peers available : " ; #endif diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 5d90d9fe3..825ff891c 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -134,7 +134,8 @@ struct RsGxsNetTunnelGroupInfo enum GroupPolicy { RS_GXS_NET_TUNNEL_GRP_POLICY_UNKNOWN = 0x00, // nothing has been set RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE = 0x01, // group is available for server side tunnels, but does not explicitely request tunnels - RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE = 0x02, // group will explicitely request tunnels, if none available + RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE = 0x02, // group will only explicitely request tunnels if none available + RS_GXS_NET_TUNNEL_GRP_POLICY_REQUESTING = 0x03, // group explicitely requests tunnels }; RsGxsNetTunnelGroupInfo() : group_policy(RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE),group_status(RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE),last_contact(0) {} @@ -153,6 +154,12 @@ public: RsGxsNetTunnelService() ; virtual ~RsGxsNetTunnelService() ; + /*! + * \brief serviceType + * \return returns the service that is currently using this as a subclass. + */ + virtual uint16_t serviceType() const = 0 ; + /*! * \brief Manage tunnels for this group * @param group_id group for which tunnels should be released @@ -230,7 +237,7 @@ protected: static const uint32_t RS_GXS_TUNNEL_CONST_RANDOM_BIAS_SIZE = 20 ; static const uint32_t RS_GXS_TUNNEL_CONST_EKEY_SIZE = 32 ; - Bias20Bytes mRandomBias ; // constant accross reboots. Allows to disguise the real SSL id while providing a consistent value accross time. + mutable Bias20Bytes mRandomBias ; // constant accross reboots. Allows to disguise the real SSL id while providing a consistent value accross time. private: void autowash() ; void sendKeepAlivePackets() ; From c5ba0e975fe78377eb628cb1ed6f15adc1512009 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 29 Apr 2018 19:20:14 +0200 Subject: [PATCH 036/138] fixed TS in tunnel management --- libretroshare/src/gxs/rsgxsnettunnel.cc | 26 +++++++++++++++---------- libretroshare/src/gxs/rsgxsnettunnel.h | 4 ++++ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 052dffacc..96232ad6f 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -40,6 +40,10 @@ RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") { #warning this is for testing only. In the final version this needs to be initialized with some random content, saved and re-used for a while (e.g. 1 month) mRandomBias.clear(); + + mLastKeepAlive = time(NULL) + (lrand48()%20); // adds some variance in order to avoid doing all this tasks at once across services + mLastAutoWash = time(NULL) + (lrand48()%20); + mLastDump = time(NULL) + (lrand48()%20); } //===========================================================================================================================================// @@ -554,6 +558,8 @@ void RsGxsNetTunnelService::removeVirtualPeer(const TurtleFileHash& hash, const #ifdef DEBUG_RSGXSNETTUNNEL GXS_NET_TUNNEL_DEBUG() << " removing virtual peer " << vpid << " for hash " << hash << std::endl; #endif + mTurtle2GxsPeer.erase(vpid); + auto it = mHandledHashes.find(hash) ; if(it == mHandledHashes.end()) @@ -616,23 +622,23 @@ void RsGxsNetTunnelService::data_tick() // cleanup - static time_t last_autowash = time(NULL); - - if(last_autowash + 5 < now) + if(mLastAutoWash + 5 < now) { autowash(); - last_autowash = now; + mLastAutoWash = now; } - static time_t last_dump = time(NULL); - - if(last_dump + 10 < now) + if(mLastKeepAlive + 20 < now) { - last_dump = now; - dump(); - + mLastKeepAlive = now ; sendKeepAlivePackets() ; } + + if(mLastDump + 10 < now) + { + mLastDump = now; + dump(); + } } void RsGxsNetTunnelService::sendKeepAlivePackets() diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 825ff891c..d0ab17c75 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -274,5 +274,9 @@ private: friend class RsGxsTunnelRandomBiasItem ; friend class StoreHere ; + + time_t mLastKeepAlive ; + time_t mLastAutoWash ; + time_t mLastDump ; }; From ba0819f8d0a4b4b3a699f51d29d6f8197b3c74ba Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 1 May 2018 15:17:41 +0200 Subject: [PATCH 037/138] added additional debug info to test proper distant request of GXS ids --- libretroshare/src/gxs/rsgxsnetservice.cc | 25 +++++++++++++++++------ libretroshare/src/gxs/rsgxsnettunnel.h | 2 +- libretroshare/src/services/p3idservice.cc | 3 ++- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 50045b556..7538a1604 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -273,14 +273,14 @@ ***/ #define NXS_NET_DEBUG_0 1 -//#define NXS_NET_DEBUG_1 1 +#define NXS_NET_DEBUG_1 1 //#define NXS_NET_DEBUG_2 1 //#define NXS_NET_DEBUG_3 1 //#define NXS_NET_DEBUG_4 1 -//#define NXS_NET_DEBUG_5 1 +#define NXS_NET_DEBUG_5 1 //#define NXS_NET_DEBUG_6 1 //#define NXS_NET_DEBUG_7 1 -//#define NXS_NET_DEBUG_8 1 +#define NXS_NET_DEBUG_8 1 //#define NXS_FRAG @@ -318,7 +318,7 @@ static const uint32_t RS_NXS_ITEM_ENCRYPTION_STATUS_GXS_KEY_MISSING = 0x05 ; || defined(NXS_NET_DEBUG_8) static const RsPeerId peer_to_print = RsPeerId(std::string("")) ; -static const RsGxsGroupId group_id_to_print = RsGxsGroupId(std::string("ff8d59ef38cad0429f34cc21749dda71")) ; // use this to allow to this group id only, or "" for all IDs +static const RsGxsGroupId group_id_to_print = RsGxsGroupId(std::string("")) ; // use this to allow to this group id only, or "" for all IDs static const uint32_t service_to_print = RS_SERVICE_GXS_TYPE_CHANNELS ; // use this to allow to this service id only, or 0 for all services // warning. Numbers should be SERVICE IDS (see serialiser/rsserviceids.h. E.g. 0x0215 for forums) @@ -3275,7 +3275,7 @@ void RsGxsNetService::locked_genSendGrpsTransaction(NxsTransaction* tr) { #ifdef NXS_NET_DEBUG_1 - GXSNETDEBUG_P_(tr->mTransaction->PeerId()) << "locked_genSendGrpsTransaction() Generating Grp data send fron TransN: " << tr->mTransaction->transactionNumber << std::endl; + GXSNETDEBUG_P_(tr->mTransaction->PeerId()) << "locked_genSendGrpsTransaction() Generating Grp data send from TransN: " << tr->mTransaction->transactionNumber << std::endl; #endif // go groups requested in transaction tr @@ -3288,7 +3288,12 @@ void RsGxsNetService::locked_genSendGrpsTransaction(NxsTransaction* tr) { RsNxsSyncGrpItem* item = dynamic_cast(*lit); if (item) + { +#ifdef NXS_NET_DEBUG_1 + GXSNETDEBUG_PG(tr->mTransaction->PeerId(),item->grpId) << "locked_genSendGrpsTransaction() retrieving data for group \"" << item->grpId << "\"" << std::endl; +#endif grps[item->grpId] = NULL; + } else { #ifdef NXS_NET_DEBUG_1 @@ -3300,7 +3305,12 @@ void RsGxsNetService::locked_genSendGrpsTransaction(NxsTransaction* tr) if(!grps.empty()) mDataStore->retrieveNxsGrps(grps, false, false); else + { +#ifdef NXS_NET_DEBUG_1 + GXSNETDEBUG_P_(tr->mTransaction->PeerId()) << "RsGxsNetService::locked_genSendGrpsTransaction(): no group to request! This is unexpected" << std::endl; +#endif return; + } NxsTransaction* newTr = new NxsTransaction(); newTr->mFlag = NxsTransaction::FLAG_STATE_WAITING_CONFIRM; @@ -3317,6 +3327,9 @@ void RsGxsNetService::locked_genSendGrpsTransaction(NxsTransaction* tr) mit->second->transactionNumber = transN; newTr->mItems.push_back(mit->second); mit->second = NULL ; // avoids deletion +#ifdef NXS_NET_DEBUG_1 + GXSNETDEBUG_PG(tr->mTransaction->PeerId(),mit->first) << "RsGxsNetService::locked_genSendGrpsTransaction(): adding grp data of group \"" << mit->first << "\" to transaction" << std::endl; +#endif } if(newTr->mItems.empty()){ @@ -4769,7 +4782,7 @@ void RsGxsNetService::processExplicitGroupRequests() for(; git != groupIdList.end(); ++git) { #ifdef NXS_NET_DEBUG_0 - GXSNETDEBUG_PG(peerId,*git) << " group request for grp ID " << *git << " to peer " << peerId << std::endl; + GXSNETDEBUG_P_(peerId) << " group request for grp ID " << *git << " to peer " << peerId << std::endl; #endif RsNxsSyncGrpItem* item = new RsNxsSyncGrpItem(mServType); item->grpId = *git; diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index d0ab17c75..4c776b9fa 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -176,7 +176,7 @@ public: * \brief Get the list of active virtual peers for a given group. This implies that a tunnel is up and * alive. This function also "registers" the group which allows to handle tunnel requests in the server side. */ - bool getVirtualPeers(std::list& peers) ; // returns the virtual peers for this group + bool getVirtualPeers(std::list& peers) ; // returns the virtual peers for this service /*! * \brief sendData diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index 71b0e2274..51bce5550 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -47,6 +47,7 @@ #include #include +#define DEBUG_IDS 1 /**** * #define DEBUG_IDS 1 * #define DEBUG_RECOGN 1 @@ -277,7 +278,7 @@ void p3IdService::timeStampKey(const RsGxsId& gxs_id, const RsIdentityUsage& rea return ; } #ifdef DEBUG_IDS - std::cerr << "(II) time stamping key " << gxs_id << " for the following reason: " << reason << std::endl; + std::cerr << "(II) time stamping key " << gxs_id << " for the following reason: " << reason.mUsageCode << std::endl; #endif RS_STACK_MUTEX(mIdMtx) ; From 4d6fed643a3fd92a12e1d2d55437c7495db7cec2 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 1 May 2018 20:10:56 +0200 Subject: [PATCH 038/138] reverted to single GxsTunnelService shared for all services --- libretroshare/src/gxs/rsgxsnetservice.cc | 51 +++----- libretroshare/src/gxs/rsgxsnetservice.h | 5 +- libretroshare/src/gxs/rsgxsnettunnel.cc | 121 +++++++++++++++--- libretroshare/src/gxs/rsgxsnettunnel.h | 27 ++-- libretroshare/src/rsitems/rsgxsupdateitems.cc | 10 -- libretroshare/src/rsitems/rsgxsupdateitems.h | 12 -- libretroshare/src/rsserver/rsinit.cc | 25 +++- 7 files changed, 157 insertions(+), 94 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 7538a1604..e18423c0d 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -361,7 +361,7 @@ RsGxsNetService::RsGxsNetService(uint16_t servType, RsGeneralDataService *gds, RsNxsNetMgr *netMgr, RsNxsObserver *nxsObs, const RsServiceInfo serviceInfo, RsGixsReputation* reputations, RsGcxs* circles, RsGixs *gixs, - PgpAuxUtils *pgpUtils, + PgpAuxUtils *pgpUtils, RsGxsNetTunnelService *mGxsNT, bool grpAutoSync, bool msgAutoSync, bool distSync, uint32_t default_store_period, uint32_t default_sync_period) : p3ThreadedService(), p3Config(), mTransactionN(0), mObserver(nxsObs), mDataStore(gds), @@ -370,7 +370,7 @@ RsGxsNetService::RsGxsNetService(uint16_t servType, RsGeneralDataService *gds, mSyncTs(0), mLastKeyPublishTs(0), mLastCleanRejectedMessages(0), mSYNC_PERIOD(SYNC_PERIOD), mCircles(circles), mGixs(gixs), - mReputations(reputations), mPgpUtils(pgpUtils), + mReputations(reputations), mPgpUtils(pgpUtils), mGxsNetTunnel(mGxsNT), mGrpAutoSync(grpAutoSync), mAllowMsgSync(msgAutoSync),mAllowDistSync(distSync), mServiceInfo(serviceInfo), mDefaultMsgStorePeriod(default_store_period), mDefaultMsgSyncPeriod(default_sync_period) @@ -569,12 +569,12 @@ void RsGxsNetService::syncWithPeers() std::set peers; mNetMgr->getOnlineList(mServiceInfo.mServiceType, peers); - if(mAllowDistSync) + if(mAllowDistSync && mGxsNetTunnel != NULL) { // Grab all online virtual peers of distant tunnels for the current service. std::list vpids ; - getVirtualPeers(vpids); + mGxsNetTunnel->getVirtualPeers(vpids); for(auto it(vpids.begin());it!=vpids.end();++it) peers.insert(RsPeerId(*it)) ; @@ -742,7 +742,7 @@ void RsGxsNetService::generic_sendItem(RsNxsItem *si) RsGxsGroupId tmp_grpId; - if(mAllowDistSync && isDistantPeer( static_cast(si->PeerId()),tmp_grpId)) + if(mAllowDistSync && mGxsNetTunnel != NULL && mGxsNetTunnel->isDistantPeer( static_cast(si->PeerId()),tmp_grpId)) { RsNxsSerialiser ser(mServType); @@ -758,7 +758,7 @@ void RsGxsNetService::generic_sendItem(RsNxsItem *si) #endif ser.serialise(si,mem,&size) ; - sendTunnelData(mem,size,static_cast(si->PeerId())); + mGxsNetTunnel->sendTunnelData(mServType,mem,size,static_cast(si->PeerId())); } else sendItem(si) ; @@ -766,7 +766,7 @@ void RsGxsNetService::generic_sendItem(RsNxsItem *si) void RsGxsNetService::checkDistantSyncState() { - if(!mAllowDistSync) + if(!mAllowDistSync || mGxsNetTunnel==NULL) return ; RsGxsGrpMetaTemporaryMap grpMeta; @@ -806,14 +806,14 @@ void RsGxsNetService::checkDistantSyncState() if(at_least_one_friend_is_supplier) { - releaseDistantPeers(grpId); + mGxsNetTunnel->releaseDistantPeers(mServType,grpId); #ifdef NXS_NET_DEBUG_8 GXSNETDEBUG___<< " Group " << grpId << ": suppliers among friends. Releasing peers." << std::endl; #endif } else { - requestDistantPeers(grpId); + mGxsNetTunnel->requestDistantPeers(mServType,grpId); #ifdef NXS_NET_DEBUG_8 GXSNETDEBUG___<< " Group " << grpId << ": no suppliers among friends. Requesting peers." << std::endl; #endif @@ -1522,8 +1522,8 @@ class StoreHere { public: - StoreHere(RsGxsNetService::ClientGrpMap& cgm, RsGxsNetService::ClientMsgMap& cmm, RsGxsNetService::ServerMsgMap& smm,RsGxsNetService::GrpConfigMap& gcm, RsGxsServerGrpUpdate& sgm,Bias20Bytes& mrb) - : mClientGrpMap(cgm), mClientMsgMap(cmm), mServerMsgMap(smm), mGrpConfigMap(gcm), mServerGrpUpdate(sgm), mRandomBias(mrb) + StoreHere(RsGxsNetService::ClientGrpMap& cgm, RsGxsNetService::ClientMsgMap& cmm, RsGxsNetService::ServerMsgMap& smm,RsGxsNetService::GrpConfigMap& gcm, RsGxsServerGrpUpdate& sgm) + : mClientGrpMap(cgm), mClientMsgMap(cmm), mServerMsgMap(smm), mGrpConfigMap(gcm), mServerGrpUpdate(sgm) {} template void check_store(ID_type id,UpdateMap& map,ItemClass& item) @@ -1541,7 +1541,6 @@ public: RsGxsServerGrpUpdateItem *gsui; RsGxsServerMsgUpdateItem *msui; RsGxsGrpConfigItem *mgci; - RsGxsTunnelRandomBiasItem *rbsi; if((mui = dynamic_cast(item)) != NULL) check_store(mui->peerID,mClientMsgMap,*mui); @@ -1553,8 +1552,6 @@ public: check_store(msui->grpId,mServerMsgMap, *msui); else if((gsui = dynamic_cast(item)) != NULL) mServerGrpUpdate = *gsui; - else if((rbsi = dynamic_cast(item))!=NULL) - mRandomBias = rbsi->mRandomBias; else std::cerr << "Type not expected!" << std::endl; @@ -1569,7 +1566,6 @@ private: RsGxsNetService::GrpConfigMap& mGrpConfigMap; RsGxsServerGrpUpdate& mServerGrpUpdate; - Bias20Bytes& mRandomBias ; }; bool RsGxsNetService::loadList(std::list &load) @@ -1578,12 +1574,11 @@ bool RsGxsNetService::loadList(std::list &load) // The delete is done in StoreHere, if necessary - std::for_each(load.begin(), load.end(), StoreHere(mClientGrpUpdateMap, mClientMsgUpdateMap, mServerMsgUpdateMap, mServerGrpConfigMap, mGrpServerUpdate,mRandomBias)); + std::for_each(load.begin(), load.end(), StoreHere(mClientGrpUpdateMap, mClientMsgUpdateMap, mServerMsgUpdateMap, mServerGrpConfigMap, mGrpServerUpdate)); + time_t now = time(NULL); // We reset group statistics here. This is the best place since we know at this point which are all unsubscribed groups. - time_t now = time(NULL); - for(GrpConfigMap::iterator it(mServerGrpConfigMap.begin());it!=mServerGrpConfigMap.end();++it) { // At each reload, we reset the count of visible messages. It will be rapidely restored to its real value from friends. @@ -1637,6 +1632,7 @@ struct get_second : public std::unary_function& save) { RS_STACK_MUTEX(mNxsMutex) ; @@ -1655,11 +1651,6 @@ bool RsGxsNetService::saveList(bool& cleanup, std::list& save) save.push_back(it); - RsGxsTunnelRandomBiasItem *it2 = new RsGxsTunnelRandomBiasItem(mServType) ; - it2->mRandomBias = mRandomBias; - - save.push_back(it2) ; - cleanup = true; return true; } @@ -1686,7 +1677,7 @@ RsItem *RsGxsNetService::generic_recvItem() uint32_t size = 0 ; RsGxsNetTunnelVirtualPeerId virtual_peer_id ; - while(mAllowDistSync && receiveTunnelData(data,size,virtual_peer_id)) + while(mAllowDistSync && mGxsNetTunnel!=NULL && mGxsNetTunnel->receiveTunnelData(mServType,data,size,virtual_peer_id)) { RsNxsItem *item = dynamic_cast(RsNxsSerialiser(mServType).deserialise(data,&size)) ; item->PeerId(virtual_peer_id) ; @@ -2005,11 +1996,6 @@ void RsGxsNetService::data_tick() runVetting(); processExplicitGroupRequests(); - - // also tick distant traffic - - if(mAllowDistSync) - RsGxsNetTunnelService::data_tick(); } void RsGxsNetService::debugDump() @@ -4117,8 +4103,9 @@ bool RsGxsNetService::canSendGrpId(const RsPeerId& sslId, const RsGxsGrpMetaData // check if that peer is a virtual peer id, in which case we only send/recv data to/from it items for the group it's requested for RsGxsGroupId peer_grp ; - if(isDistantPeer(RsGxsNetTunnelVirtualPeerId(sslId),peer_grp) && peer_grp != grpMeta.mGroupId) + if(mAllowDistSync && mGxsNetTunnel != NULL && mGxsNetTunnel->isDistantPeer(RsGxsNetTunnelVirtualPeerId(sslId),peer_grp) && peer_grp != grpMeta.mGroupId) { +#warning (cyril) make sure that this is not a problem for cross-service sending of items #ifdef NXS_NET_DEBUG_4 GXSNETDEBUG_PG(sslId,grpMeta.mGroupId) << " Distant peer designed for group " << peer_grp << ": cannot request sync for different group." << std::endl; #endif @@ -4181,7 +4168,7 @@ bool RsGxsNetService::checkCanRecvMsgFromPeer(const RsPeerId& sslId, const RsGxs // check if that peer is a virtual peer id, in which case we only send/recv data to/from it items for the group it's requested for RsGxsGroupId peer_grp ; - if(isDistantPeer(RsGxsNetTunnelVirtualPeerId(sslId),peer_grp) && peer_grp != grpMeta.mGroupId) + if(mGxsNetTunnel->isDistantPeer(RsGxsNetTunnelVirtualPeerId(sslId),peer_grp) && peer_grp != grpMeta.mGroupId) { #ifdef NXS_NET_DEBUG_4 GXSNETDEBUG_PG(sslId,grpMeta.mGroupId) << " Distant peer designed for group " << peer_grp << ": cannot request sync for different group." << std::endl; @@ -4535,7 +4522,7 @@ bool RsGxsNetService::canSendMsgIds(std::vector& msgMetas, co // check if that peer is a virtual peer id, in which case we only send/recv data to/from it items for the group it's requested for RsGxsGroupId peer_grp ; - if(isDistantPeer(RsGxsNetTunnelVirtualPeerId(sslId),peer_grp) && peer_grp != grpMeta.mGroupId) + if(mGxsNetTunnel->isDistantPeer(RsGxsNetTunnelVirtualPeerId(sslId),peer_grp) && peer_grp != grpMeta.mGroupId) { #ifdef NXS_NET_DEBUG_4 GXSNETDEBUG_PG(sslId,grpMeta.mGroupId) << " Distant peer designed for group " << peer_grp << ": cannot request sync for different group." << std::endl; diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index d7fe23cc3..6ead3f4c7 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -72,7 +72,7 @@ class RsGroupNetworkStatsRecord * Incoming transaction are in 3 different states * 1. START 2. RECEIVING 3. END */ -class RsGxsNetService : public RsNetworkExchangeService, public RsGxsNetTunnelService, public p3ThreadedService, public p3Config +class RsGxsNetService : public RsNetworkExchangeService, public p3ThreadedService, public p3Config { public: @@ -90,7 +90,7 @@ public: RsNxsObserver *nxsObs, // used to be = NULL. const RsServiceInfo serviceInfo, RsGixsReputation* reputations = NULL, RsGcxs* circles = NULL, RsGixs *gixs=NULL, - PgpAuxUtils *pgpUtils = NULL, + PgpAuxUtils *pgpUtils = NULL, RsGxsNetTunnelService *mGxsNT = NULL, bool grpAutoSync = true, bool msgAutoSync = true,bool distSync=false, uint32_t default_store_period = RS_GXS_DEFAULT_MSG_STORE_PERIOD, uint32_t default_sync_period = RS_GXS_DEFAULT_MSG_REQ_PERIOD); @@ -548,6 +548,7 @@ private: RsGixs *mGixs; RsGixsReputation* mReputations; PgpAuxUtils *mPgpUtils; + RsGxsNetTunnelService *mGxsNetTunnel; bool mGrpAutoSync; bool mAllowMsgSync; diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 96232ad6f..bb1abd6e1 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -32,7 +32,7 @@ #define DEBUG_RSGXSNETTUNNEL 1 #define GXS_NET_TUNNEL_NOT_IMPLEMENTED() { std::cerr << __PRETTY_FUNCTION__ << ": not yet implemented." << std::endl; } -#define GXS_NET_TUNNEL_DEBUG() std::cerr << time(NULL) << " : GXS_NET_TUNNEL(" << std::hex << serviceType() << std::dec << ") : " << __FUNCTION__ << " : " +#define GXS_NET_TUNNEL_DEBUG() std::cerr << time(NULL) << " : GXS_NET_TUNNEL: " << __FUNCTION__ << " : " #define GXS_NET_TUNNEL_ERROR() std::cerr << "(EE) GXS_NET_TUNNEL ERROR : " @@ -54,6 +54,7 @@ const uint16_t RS_SERVICE_TYPE_GXS_NET_TUNNEL = 0x2233 ; const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_VIRTUAL_PEER = 0x01 ; const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_KEEP_ALIVE = 0x02 ; +const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_RANDOM_BIAS = 0x03 ; class RsGxsNetTunnelItem: public RsItem { @@ -91,6 +92,21 @@ public: virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) {} }; +class RsGxsNetTunnelRandomBiasItem: public RsGxsNetTunnelItem +{ +public: + explicit RsGxsNetTunnelRandomBiasItem() : RsGxsNetTunnelItem(RS_PKT_SUBTYPE_GXS_NET_TUNNEL_RANDOM_BIAS) { clear();} + virtual ~RsGxsNetTunnelRandomBiasItem() {} + + virtual void clear() { mRandomBias.clear() ; } + virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) + { + RsTypeSerializer::serial_process(j,ctx,mRandomBias,"random bias") ; + } + + Bias20Bytes mRandomBias; // Cannot be a simple char[] because of serialization. +}; + class RsGxsNetTunnelSerializer: public RsServiceSerializer { public: @@ -108,6 +124,7 @@ public: { case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_VIRTUAL_PEER: return new RsGxsNetTunnelVirtualPeerItem ; case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_KEEP_ALIVE : return new RsGxsNetTunnelKeepAliveItem ; + case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_RANDOM_BIAS : return new RsGxsNetTunnelRandomBiasItem ; default: GXS_NET_TUNNEL_ERROR() << "type ID " << std::hex << item_subtype << std::dec << " is not handled!" << std::endl; return NULL ; @@ -139,7 +156,8 @@ RsGxsNetTunnelService::~RsGxsNetTunnelService() mVirtualPeers.clear(); for(auto it(mIncomingData.begin());it!=mIncomingData.end();++it) - delete (*it).second; + for(auto it2(it->second.begin());it2!=it->second.end();++it2) + delete it2->second; mIncomingData.clear(); } @@ -159,11 +177,11 @@ bool RsGxsNetTunnelService::isDistantPeer(const RsGxsNetTunnelVirtualPeerId& vir return false ; } -bool RsGxsNetTunnelService::receiveTunnelData(unsigned char *& data,uint32_t& data_len,RsGxsNetTunnelVirtualPeerId& virtual_peer) +bool RsGxsNetTunnelService::receiveTunnelData(uint16_t service_id, unsigned char *& data, uint32_t& data_len, RsGxsNetTunnelVirtualPeerId& virtual_peer) { RS_STACK_MUTEX(mGxsNetTunnelMtx); - std::list >& lst(mIncomingData); + std::list >& lst(mIncomingData[service_id]); if(lst.empty()) { @@ -185,7 +203,7 @@ bool RsGxsNetTunnelService::receiveTunnelData(unsigned char *& data,uint32_t& da return true; } -bool RsGxsNetTunnelService::sendTunnelData(unsigned char *& data,uint32_t data_len,const RsGxsNetTunnelVirtualPeerId& virtual_peer) +bool RsGxsNetTunnelService::sendTunnelData(uint16_t service_id,unsigned char *& data,uint32_t data_len,const RsGxsNetTunnelVirtualPeerId& virtual_peer) { RS_STACK_MUTEX(mGxsNetTunnelMtx); // The item is serialized and encrypted using chacha20+SHA256, using the generic turtle encryption, and then sent to the turtle router. @@ -245,7 +263,7 @@ bool RsGxsNetTunnelService::getVirtualPeers(std::listgetOwnId() ; + mRandomBias = Bias20Bytes(RsDirUtil::sha1sum(ssl_id.toByteArray(),ssl_id.SIZE_IN_BYTES)) ; +#else + mRandomBias = Bias20Bytes::random(); +#endif + IndicateConfigChanged(); + } + + return mRandomBias ; +} + +RsGxsNetTunnelVirtualPeerId RsGxsNetTunnelService::locked_makeVirtualPeerId(const RsGxsGroupId& group_id) { assert(RsPeerId::SIZE_IN_BYTES <= Sha1CheckSum::SIZE_IN_BYTES) ;// so that we can build the virtual PeerId from a SHA1 sum. // We compute sha1( SSL_id | mRandomBias ) and trunk it to 16 bytes in order to compute a RsPeerId -#ifdef DEBUG_RSGXSNETTUNNEL - // /!\ this is for testing only! Remove this when done! Can not be done at initialization when rsPeer is not started. - RsPeerId ssl_id = rsPeers->getOwnId() ; - mRandomBias = Bias20Bytes(RsDirUtil::sha1sum(ssl_id.toByteArray(),ssl_id.SIZE_IN_BYTES)) ; -#endif + Bias20Bytes rb(locked_randomBias()); - unsigned char mem[group_id.SIZE_IN_BYTES + mRandomBias.SIZE_IN_BYTES]; + unsigned char mem[group_id.SIZE_IN_BYTES + rb.SIZE_IN_BYTES]; memcpy(mem ,group_id.toByteArray(),group_id.SIZE_IN_BYTES) ; - memcpy(mem+group_id.SIZE_IN_BYTES,mRandomBias.toByteArray(),mRandomBias.SIZE_IN_BYTES) ; + memcpy(mem+group_id.SIZE_IN_BYTES,rb.toByteArray(),rb.SIZE_IN_BYTES) ; - return RsGxsNetTunnelVirtualPeerId(RsDirUtil::sha1sum(mem,group_id.SIZE_IN_BYTES+mRandomBias.SIZE_IN_BYTES).toByteArray()); + return RsGxsNetTunnelVirtualPeerId(RsDirUtil::sha1sum(mem,group_id.SIZE_IN_BYTES+rb.SIZE_IN_BYTES).toByteArray()); } void RsGxsNetTunnelService::dump() const @@ -332,7 +363,7 @@ void RsGxsNetTunnelService::dump() const std::string("[ACTIVE ]") }; - std::cerr << "GxsNetTunnelService dump (this=" << (void*)this << ". serv=" << std::hex << serviceType() << std::dec <<") : " << std::endl; + std::cerr << "GxsNetTunnelService dump (this=" << (void*)this << ": " << std::endl; std::cerr << " Managed GXS groups: " << std::endl; for(auto it(mGroups.begin());it!=mGroups.end();++it) @@ -364,7 +395,12 @@ void RsGxsNetTunnelService::dump() const std::cerr << " Incoming data: " << std::endl; for(auto it(mIncomingData.begin());it!=mIncomingData.end();++it) - std::cerr << " peer id " << it->first << " " << (void*)it->second << std::endl; + { + std::cerr << " service " << std::hex << it->first << std::dec << std::endl; + + for(auto it2(it->second.begin());it2!=it->second.end();++it2) + std::cerr << " peer id " << it2->first << " " << (void*)it2->second << std::endl; + } } //===========================================================================================================================================// @@ -639,6 +675,8 @@ void RsGxsNetTunnelService::data_tick() mLastDump = now; dump(); } + + rstime::rs_usleep(1*1000*1000) ; // 1 sec } void RsGxsNetTunnelService::sendKeepAlivePackets() @@ -759,4 +797,51 @@ void RsGxsNetTunnelService::autowash() } } +bool RsGxsNetTunnelService::saveList(bool& cleanup, std::list& save) +{ + RsGxsNetTunnelRandomBiasItem *it2 = new RsGxsNetTunnelRandomBiasItem() ; + { + RS_STACK_MUTEX(mGxsNetTunnelMtx); + it2->mRandomBias = mRandomBias; + } + + save.push_back(it2) ; + cleanup = true ; + + return true; +} + +bool RsGxsNetTunnelService::loadList(std::list &load) +{ + RsGxsNetTunnelRandomBiasItem *rbsi ; + + for(auto it(load.begin());it!=load.end();++it) + { + if((rbsi = dynamic_cast(*it))!=NULL) + { + RS_STACK_MUTEX(mGxsNetTunnelMtx); + mRandomBias = rbsi->mRandomBias; + } + else + GXS_NET_TUNNEL_ERROR() << " unknown item in config file: type=" << std::hex << (*it)->PacketId() << std::dec << std::endl; + + delete *it; + } + + return true; +} + +RsSerialiser *RsGxsNetTunnelService::setupSerialiser() +{ + RS_STACK_MUTEX(mGxsNetTunnelMtx); + static RsSerialiser *ser = NULL ; // this is not so nice, but this method is only called from p3Config, so there's no really need of a data race + + if(!ser) + { + ser = new RsSerialiser ; + ser->addSerialType(new RsGxsNetTunnelSerializer) ; + } + + return ser ; +} diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 4c776b9fa..a36883cbb 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -148,29 +148,23 @@ struct RsGxsNetTunnelGroupInfo std::set virtual_peers ; // list of which virtual peers provide this group. Can me more than 1. }; -class RsGxsNetTunnelService: public RsTurtleClientService +class RsGxsNetTunnelService: public RsTurtleClientService, public RsTickingThread, public p3Config { public: RsGxsNetTunnelService() ; virtual ~RsGxsNetTunnelService() ; - /*! - * \brief serviceType - * \return returns the service that is currently using this as a subclass. - */ - virtual uint16_t serviceType() const = 0 ; - /*! * \brief Manage tunnels for this group * @param group_id group for which tunnels should be released */ - bool requestDistantPeers(const RsGxsGroupId&group_id) ; + bool requestDistantPeers(uint16_t service_id,const RsGxsGroupId&group_id) ; /*! * \brief Stop managing tunnels for this group * @param group_id group for which tunnels should be released */ - bool releaseDistantPeers(const RsGxsGroupId&group_id) ; + bool releaseDistantPeers(uint16_t service_id, const RsGxsGroupId&group_id) ; /*! * \brief Get the list of active virtual peers for a given group. This implies that a tunnel is up and @@ -186,7 +180,7 @@ public: * \return * true if succeeded. */ - bool sendTunnelData(unsigned char *& data, uint32_t data_len, const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; + bool sendTunnelData(uint16_t service_id,unsigned char *& data, uint32_t data_len, const RsGxsNetTunnelVirtualPeerId& virtual_peer) ; /*! * \brief receiveData @@ -197,7 +191,7 @@ public: * \return * true if something is returned. If not, data is set to NULL, data_len to 0. */ - bool receiveTunnelData(unsigned char *& data, uint32_t& data_len, RsGxsNetTunnelVirtualPeerId& virtual_peer) ; + bool receiveTunnelData(uint16_t service_id, unsigned char *& data, uint32_t& data_len, RsGxsNetTunnelVirtualPeerId& virtual_peer) ; /*! * \brief isDistantPeer @@ -224,6 +218,12 @@ public: void data_tick() ; + // Overloads p3Config + + RsSerialiser *setupSerialiser(); + bool saveList(bool& cleanup, std::list& save); + bool loadList(std::list &load); + protected: // interaction with turtle router @@ -231,6 +231,7 @@ protected: virtual void receiveTurtleData(RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) ; void addVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&,RsTurtleGenericTunnelItem::Direction dir) ; void removeVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&) ; + const Bias20Bytes& locked_randomBias() ; p3turtle *mTurtle ; @@ -252,7 +253,7 @@ private: std::list > mPendingTurtleItems ; // items that need to be sent off-turtle Mutex. - std::list > mIncomingData; // list of incoming data items + std::map > > mIncomingData; // list of incoming data items /*! * \brief Generates the hash to request tunnels for this group. This hash is only used by turtle, and is used to @@ -266,7 +267,7 @@ private: * tunnel ID and turtle virtual peer id. This allows RsGxsNetService to keep sync-ing the data consistently. */ - RsGxsNetTunnelVirtualPeerId locked_makeVirtualPeerId(const RsGxsGroupId& group_id) const ; + RsGxsNetTunnelVirtualPeerId locked_makeVirtualPeerId(const RsGxsGroupId& group_id) ; static void generateEncryptionKey(const RsGxsGroupId& group_id,const TurtleVirtualPeerId& vpid,unsigned char key[RS_GXS_TUNNEL_CONST_EKEY_SIZE]) ; diff --git a/libretroshare/src/rsitems/rsgxsupdateitems.cc b/libretroshare/src/rsitems/rsgxsupdateitems.cc index eee847704..007407210 100644 --- a/libretroshare/src/rsitems/rsgxsupdateitems.cc +++ b/libretroshare/src/rsitems/rsgxsupdateitems.cc @@ -44,7 +44,6 @@ RsItem* RsGxsUpdateSerialiser::create_item(uint16_t service,uint8_t item_subtype case RS_PKT_SUBTYPE_GXS_SERVER_GRP_UPDATE: return new RsGxsServerGrpUpdateItem(SERVICE_TYPE); case RS_PKT_SUBTYPE_GXS_SERVER_MSG_UPDATE: return new RsGxsServerMsgUpdateItem(SERVICE_TYPE); case RS_PKT_SUBTYPE_GXS_GRP_CONFIG: return new RsGxsGrpConfigItem(SERVICE_TYPE); - case RS_PKT_SUBTYPE_GXS_RANDOM_BIAS: return new RsGxsTunnelRandomBiasItem(SERVICE_TYPE); default: return NULL ; } @@ -77,11 +76,6 @@ void RsGxsServerGrpUpdateItem::clear() grpUpdateTS = 0; } -void RsGxsTunnelRandomBiasItem::clear() -{ - mRandomBias.clear() ; -} - /**********************************************************************************************/ /* SERIALISER */ /**********************************************************************************************/ @@ -140,8 +134,4 @@ void RsGxsGrpConfigItem::serial_process(RsGenericSerializer::SerializeJob j,RsGe RsTypeSerializer::serial_process(j,ctx,msg_send_delay,"msg_send_delay") ; RsTypeSerializer::serial_process(j,ctx,msg_req_delay,"msg_req_delay") ; } -void RsGxsTunnelRandomBiasItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) -{ - RsTypeSerializer::serial_process(j,ctx,mRandomBias,"random bias") ; -} diff --git a/libretroshare/src/rsitems/rsgxsupdateitems.h b/libretroshare/src/rsitems/rsgxsupdateitems.h index e73dc2197..ec21a14c8 100644 --- a/libretroshare/src/rsitems/rsgxsupdateitems.h +++ b/libretroshare/src/rsitems/rsgxsupdateitems.h @@ -188,18 +188,6 @@ public: RsGxsGroupId grpId; }; -class RsGxsTunnelRandomBiasItem: public RsGxsNetServiceItem -{ -public: - explicit RsGxsTunnelRandomBiasItem(uint16_t servType) : RsGxsNetServiceItem(servType, RS_PKT_SUBTYPE_GXS_RANDOM_BIAS) { clear();} - virtual ~RsGxsTunnelRandomBiasItem() {} - - virtual void clear(); - virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); - - Bias20Bytes mRandomBias; // Cannot be a simple char[] because of serialization. -}; - class RsGxsUpdateSerialiser : public RsServiceSerializer { public: diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 12d60061e..4140eaa0a 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1358,6 +1358,14 @@ int RsServer::StartupRetroShare() mWiki->setNetworkExchangeService(wiki_ns) ; #endif + /**** GXS Dist sync service ****/ + +#ifdef RS_USE_GXS_DISTANT_SYNC + RsGxsNetTunnelService *mGxsNetTunnel = new RsGxsNetTunnelService ; +#else + RsGxsNetTunnelService *mGxsNetTunnel = NULL ; +#endif + /**** Forum GXS service ****/ RsGeneralDataService* gxsforums_ds = new RsDataService(currGxsDir + "/", "gxsforums_db", @@ -1371,7 +1379,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) ; @@ -1387,7 +1395,7 @@ int RsServer::StartupRetroShare() RS_SERVICE_GXS_TYPE_CHANNELS, gxschannels_ds, nxsMgr, mGxsChannels, mGxsChannels->getServiceInfo(), mReputations, mGxsCircles,mGxsIdService, - pgpAuxUtils,true,true,true); + pgpAuxUtils,mGxsNetTunnel,true,true,true); mGxsChannels->setNetworkExchangeService(gxschannels_ns) ; @@ -1442,7 +1450,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,false,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); @@ -1475,16 +1483,17 @@ 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); // connect components to turtle router. - gxschannels_ns->connectToTurtleRouter(tr) ; ftserver->connectToTurtleRouter(tr) ; ftserver->connectToFileDatabase(fdb) ; chatSrv->connectToGxsTunnelService(mGxsTunnels) ; @@ -1615,6 +1624,7 @@ int RsServer::StartupRetroShare() //mConfigMgr->addConfiguration("ftserver.cfg", ftserver); // mConfigMgr->addConfiguration("gpg_prefs.cfg", AuthGPG::getAuthGPG()); + mConfigMgr->addConfiguration("gxsnettunnel.cfg", mGxsNetTunnel); mConfigMgr->loadConfiguration(); mConfigMgr->addConfiguration("peers.cfg", mPeerMgr); @@ -1824,6 +1834,7 @@ int RsServer::StartupRetroShare() /*** start up GXS core runner ***/ + startServiceThread(mGxsNetTunnel, "gxs net tunnel"); startServiceThread(mGxsIdService, "gxs id"); startServiceThread(mGxsCircles, "gxs circle"); startServiceThread(mPosted, "gxs posted"); From 8d5c013a17b8cce4a4724234f95731f7d08bcfd5 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 3 May 2018 23:21:59 +0200 Subject: [PATCH 039/138] added proper synchronization of GxsIds through tunnels of another service --- libretroshare/src/gxs/rsgxsnetservice.cc | 29 ++++- libretroshare/src/gxs/rsgxsnetservice.h | 1 + libretroshare/src/gxs/rsgxsnettunnel.cc | 149 +++++++++++----------- libretroshare/src/gxs/rsgxsnettunnel.h | 2 + libretroshare/src/gxs/rsnxs.h | 8 ++ libretroshare/src/rsserver/rsinit.cc | 21 +-- libretroshare/src/services/p3idservice.cc | 2 +- 7 files changed, 127 insertions(+), 85 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index e18423c0d..8a46fc89e 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -766,7 +766,7 @@ void RsGxsNetService::generic_sendItem(RsNxsItem *si) void RsGxsNetService::checkDistantSyncState() { - if(!mAllowDistSync || mGxsNetTunnel==NULL) + if(!mAllowDistSync || mGxsNetTunnel==NULL || !mGrpAutoSync) return ; RsGxsGrpMetaTemporaryMap grpMeta; @@ -835,6 +835,17 @@ void RsGxsNetService::syncGrpStatistics() std::set online_peers; mNetMgr->getOnlineList(mServiceInfo.mServiceType, online_peers); + if(mAllowDistSync && mGxsNetTunnel != NULL) + { + // Grab all online virtual peers of distant tunnels for the current service. + + std::list vpids ; + mGxsNetTunnel->getVirtualPeers(vpids); + + for(auto it(vpids.begin());it!=vpids.end();++it) + online_peers.insert(RsPeerId(*it)) ; + } + // Go through group statistics and groups without information are re-requested to random peers selected // among the ones who provided the group info. @@ -4168,7 +4179,7 @@ bool RsGxsNetService::checkCanRecvMsgFromPeer(const RsPeerId& sslId, const RsGxs // check if that peer is a virtual peer id, in which case we only send/recv data to/from it items for the group it's requested for RsGxsGroupId peer_grp ; - if(mGxsNetTunnel->isDistantPeer(RsGxsNetTunnelVirtualPeerId(sslId),peer_grp) && peer_grp != grpMeta.mGroupId) + if(mAllowDistSync && mGxsNetTunnel != NULL && mGxsNetTunnel->isDistantPeer(RsGxsNetTunnelVirtualPeerId(sslId),peer_grp) && peer_grp != grpMeta.mGroupId) { #ifdef NXS_NET_DEBUG_4 GXSNETDEBUG_PG(sslId,grpMeta.mGroupId) << " Distant peer designed for group " << peer_grp << ": cannot request sync for different group." << std::endl; @@ -4522,7 +4533,7 @@ bool RsGxsNetService::canSendMsgIds(std::vector& msgMetas, co // check if that peer is a virtual peer id, in which case we only send/recv data to/from it items for the group it's requested for RsGxsGroupId peer_grp ; - if(mGxsNetTunnel->isDistantPeer(RsGxsNetTunnelVirtualPeerId(sslId),peer_grp) && peer_grp != grpMeta.mGroupId) + if(mAllowDistSync && mGxsNetTunnel != NULL && mGxsNetTunnel->isDistantPeer(RsGxsNetTunnelVirtualPeerId(sslId),peer_grp) && peer_grp != grpMeta.mGroupId) { #ifdef NXS_NET_DEBUG_4 GXSNETDEBUG_PG(sslId,grpMeta.mGroupId) << " Distant peer designed for group " << peer_grp << ": cannot request sync for different group." << std::endl; @@ -5064,6 +5075,18 @@ bool RsGxsNetService::removeGroups(const std::list& groups) return true ; } +bool RsGxsNetService::isDistantPeer(const RsPeerId& pid) +{ + RS_STACK_MUTEX(mNxsMutex) ; + + if(!mAllowDistSync || mGxsNetTunnel == NULL) + return false ; + + RsGxsGroupId group_id ; + + return mGxsNetTunnel->isDistantPeer(RsGxsNetTunnelVirtualPeerId(pid),group_id); +} + bool RsGxsNetService::stampMsgServerUpdateTS(const RsGxsGroupId& gid) { RS_STACK_MUTEX(mNxsMutex) ; diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index 6ead3f4c7..fe1c77010 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -170,6 +170,7 @@ public: virtual bool getGroupServerUpdateTS(const RsGxsGroupId& gid,time_t& grp_server_update_TS,time_t& msg_server_update_TS) ; virtual bool stampMsgServerUpdateTS(const RsGxsGroupId& gid) ; virtual bool removeGroups(const std::list& groups); + virtual bool isDistantPeer(const RsPeerId& pid); /* p3Config methods */ public: diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index bb1abd6e1..b81b6a7c0 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -275,6 +275,7 @@ bool RsGxsNetTunnelService::requestDistantPeers(uint16_t service_id, const RsGxs ginfo.group_policy = RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE; ginfo.hash = calculateGroupHash(group_id) ; + ginfo.service_id = service_id; mHandledHashes[ginfo.hash] = group_id ; @@ -307,39 +308,6 @@ bool RsGxsNetTunnelService::releaseDistantPeers(uint16_t service_id,const RsGxsG return true; } -const Bias20Bytes& RsGxsNetTunnelService::locked_randomBias() -{ - if(mRandomBias.isNull()) - { -#ifdef DEBUG_RSGXSNETTUNNEL -#warning /!\ this is for testing only! Remove this when done! Can not be done at initialization when rsPeer is not started. - RsPeerId ssl_id = rsPeers->getOwnId() ; - mRandomBias = Bias20Bytes(RsDirUtil::sha1sum(ssl_id.toByteArray(),ssl_id.SIZE_IN_BYTES)) ; -#else - mRandomBias = Bias20Bytes::random(); -#endif - IndicateConfigChanged(); - } - - return mRandomBias ; -} - -RsGxsNetTunnelVirtualPeerId RsGxsNetTunnelService::locked_makeVirtualPeerId(const RsGxsGroupId& group_id) -{ - assert(RsPeerId::SIZE_IN_BYTES <= Sha1CheckSum::SIZE_IN_BYTES) ;// so that we can build the virtual PeerId from a SHA1 sum. - - // We compute sha1( SSL_id | mRandomBias ) and trunk it to 16 bytes in order to compute a RsPeerId - - Bias20Bytes rb(locked_randomBias()); - - unsigned char mem[group_id.SIZE_IN_BYTES + rb.SIZE_IN_BYTES]; - - memcpy(mem ,group_id.toByteArray(),group_id.SIZE_IN_BYTES) ; - memcpy(mem+group_id.SIZE_IN_BYTES,rb.toByteArray(),rb.SIZE_IN_BYTES) ; - - return RsGxsNetTunnelVirtualPeerId(RsDirUtil::sha1sum(mem,group_id.SIZE_IN_BYTES+rb.SIZE_IN_BYTES).toByteArray()); -} - void RsGxsNetTunnelService::dump() const { RS_STACK_MUTEX(mGxsNetTunnelMtx); @@ -379,7 +347,7 @@ void RsGxsNetTunnelService::dump() const std::cerr << " Virtual peers: " << std::endl; for(auto it(mVirtualPeers.begin());it!=mVirtualPeers.end();++it) std::cerr << " GXS Peer:" << it->first << " Turtle:" << it->second.turtle_virtual_peer_id - << " status: " << vpid_status_str[it->second.vpid_status] << " direction: " + << " status: " << vpid_status_str[it->second.vpid_status] << " group_id: " << it->second.group_id << " direction: " << (int)it->second.side << " last seen " << time(NULL)-it->second.last_contact << " secs ago" @@ -466,7 +434,9 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co return ; } - if(getRsItemService(getRsItemId(data)) == RS_SERVICE_TYPE_GXS_NET_TUNNEL) + uint16_t service_id = getRsItemService(getRsItemId(data)); + + if(service_id == RS_SERVICE_TYPE_GXS_NET_TUNNEL) { RsItem *decrypted_item = RsGxsNetTunnelSerializer().deserialise(data,&data_size); RsGxsNetTunnelVirtualPeerItem *pid_item = dynamic_cast(decrypted_item) ; @@ -491,52 +461,61 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co vp_info.side = direction; // client/server vp_info.last_contact = time(NULL); // last time some data was sent/recvd vp_info.group_id = group_id; + vp_info.service_id = mGroups[group_id].service_id ; memcpy(vp_info.encryption_master_key,encryption_master_key,RS_GXS_TUNNEL_CONST_EKEY_SIZE); vp_info.turtle_virtual_peer_id = turtle_virtual_peer_id; // turtle peer to use when sending data to this vpid. free(data); + + return ; } - else + + + // item is a generic data item for the client. Let's store the data in the appropriate incoming data queue. + + auto it = mTurtle2GxsPeer.find(turtle_virtual_peer_id) ; + + if(it == mTurtle2GxsPeer.end()) { - // item is a generic data item for the client. Let's store the data in the appropriate incoming data queue. + GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for vpid " << turtle_virtual_peer_id << " but this vpid is unknown!" << std::endl; + free(data); + return; + } - auto it = mTurtle2GxsPeer.find(turtle_virtual_peer_id) ; + RsGxsNetTunnelVirtualPeerId gxs_vpid = it->second ; - if(it == mTurtle2GxsPeer.end()) - { - GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for vpid " << turtle_virtual_peer_id << " but this vpid is unknown!" << std::endl; - free(data); - return; - } + auto it2 = mVirtualPeers.find(gxs_vpid) ; - RsGxsNetTunnelVirtualPeerId gxs_vpid = it->second ; + if(it2 == mVirtualPeers.end()) + { + GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for GXS vpid " << gxs_vpid << " but the virtual peer id is missing!" << std::endl; + free(data); + return; + } + it2->second.vpid_status = RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE ; // status of the peer + it2->second.last_contact = time(NULL); // last time some data was sent/recvd - auto it2 = mVirtualPeers.find(gxs_vpid) ; - - if(it2 == mVirtualPeers.end()) - { - GXS_NET_TUNNEL_ERROR() << "item received by GxsNetTunnel for GXS vpid " << gxs_vpid << " but the virtual peer id is missing!" << std::endl; - free(data); - return; - } - it2->second.vpid_status = RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE ; // status of the peer - it2->second.last_contact = time(NULL); // last time some data was sent/recvd + if(service_id != it2->second.service_id && service_id != RS_SERVICE_GXS_TYPE_GXSID) + { + GXS_NET_TUNNEL_ERROR() << " received an item for VPID " << gxs_vpid << " openned for service " << it2->second.service_id << " that is not for that service nor for GXS Id service (service=" << std::hex << service_id << std::dec << ". Rejecting!" << std::endl; + free(data); + return ; + } #ifdef DEBUG_RSGXSNETTUNNEL - GXS_NET_TUNNEL_DEBUG() << "item contains generic data for VPID " << gxs_vpid << ". Storing in incoming list" << std::endl; + GXS_NET_TUNNEL_DEBUG() << "item contains generic data for VPID " << gxs_vpid << ". service_id = " << std::hex << service_id << std::dec << ". Storing in incoming list" << std::endl; #endif - // push the data into the incoming data list + // push the data into the incoming data list - RsTlvBinaryData *bind = new RsTlvBinaryData; - bind->tlvtype = 0; - bind->bin_len = data_size; - bind->bin_data = data; + RsTlvBinaryData *bind = new RsTlvBinaryData; + bind->tlvtype = 0; + bind->bin_len = data_size; + bind->bin_data = data; - mIncomingData.push_back(std::make_pair(gxs_vpid,bind)) ; - } + mIncomingData[service_id].push_back(std::make_pair(gxs_vpid,bind)) ; } void RsGxsNetTunnelService::addVirtualPeer(const TurtleFileHash& hash, const TurtleVirtualPeerId& vpid,RsTurtleGenericTunnelItem::Direction dir) @@ -679,6 +658,40 @@ void RsGxsNetTunnelService::data_tick() rstime::rs_usleep(1*1000*1000) ; // 1 sec } +const Bias20Bytes& RsGxsNetTunnelService::locked_randomBias() +{ + if(mRandomBias.isNull()) + { +#ifdef DEBUG_RSGXSNETTUNNEL +#warning /!\ this is for testing only! Remove this when done! Can not be done at initialization when rsPeer is not started. + RsPeerId ssl_id = rsPeers->getOwnId() ; + mRandomBias = Bias20Bytes(RsDirUtil::sha1sum(ssl_id.toByteArray(),ssl_id.SIZE_IN_BYTES)) ; +#else + mRandomBias = Bias20Bytes::random(); +#endif + IndicateConfigChanged(); + } + + return mRandomBias ; +} + +RsGxsNetTunnelVirtualPeerId RsGxsNetTunnelService::locked_makeVirtualPeerId(const RsGxsGroupId& group_id) +{ + assert(RsPeerId::SIZE_IN_BYTES <= Sha1CheckSum::SIZE_IN_BYTES) ;// so that we can build the virtual PeerId from a SHA1 sum. + + // We compute sha1( SSL_id | mRandomBias ) and trunk it to 16 bytes in order to compute a RsPeerId + + Bias20Bytes rb(locked_randomBias()); + + unsigned char mem[group_id.SIZE_IN_BYTES + rb.SIZE_IN_BYTES]; + + memcpy(mem ,group_id.toByteArray(),group_id.SIZE_IN_BYTES) ; + memcpy(mem+group_id.SIZE_IN_BYTES,rb.toByteArray(),rb.SIZE_IN_BYTES) ; + + return RsGxsNetTunnelVirtualPeerId(RsDirUtil::sha1sum(mem,group_id.SIZE_IN_BYTES+rb.SIZE_IN_BYTES).toByteArray()); +} + + void RsGxsNetTunnelService::sendKeepAlivePackets() { RS_STACK_MUTEX(mGxsNetTunnelMtx); @@ -834,14 +847,8 @@ bool RsGxsNetTunnelService::loadList(std::list &load) RsSerialiser *RsGxsNetTunnelService::setupSerialiser() { - RS_STACK_MUTEX(mGxsNetTunnelMtx); - static RsSerialiser *ser = NULL ; // this is not so nice, but this method is only called from p3Config, so there's no really need of a data race - - if(!ser) - { - ser = new RsSerialiser ; - ser->addSerialType(new RsGxsNetTunnelSerializer) ; - } + RsSerialiser *ser = new RsSerialiser ; + ser->addSerialType(new RsGxsNetTunnelSerializer) ; return ser ; } diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index a36883cbb..abe7aba1c 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -120,6 +120,7 @@ struct RsGxsNetTunnelVirtualPeerInfo TurtleVirtualPeerId turtle_virtual_peer_id ; // turtle peer to use when sending data to this vpid. RsGxsGroupId group_id ; // group that virtual peer is providing + uint16_t service_id ; // this is used for checkng consistency of the incoming data }; struct RsGxsNetTunnelGroupInfo @@ -144,6 +145,7 @@ struct RsGxsNetTunnelGroupInfo GroupStatus group_status ; time_t last_contact ; TurtleFileHash hash ; + uint16_t service_id ; std::set virtual_peers ; // list of which virtual peers provide this group. Can me more than 1. }; diff --git a/libretroshare/src/gxs/rsnxs.h b/libretroshare/src/gxs/rsnxs.h index 283c96e65..faec2577a 100644 --- a/libretroshare/src/gxs/rsnxs.h +++ b/libretroshare/src/gxs/rsnxs.h @@ -166,6 +166,14 @@ public: */ virtual bool stampMsgServerUpdateTS(const RsGxsGroupId& gid) =0; + /*! + * \brief isDistantPeer + * \param pid peer that is a virtual peer provided by GxsNetTunnel + * \return + * true if the peer exists (adn therefore is online) + */ + virtual bool isDistantPeer(const RsPeerId& pid)=0; + /*! * \brief removeGroups * Removes time stamp information from the list of groups. This allows to re-sync them if suppliers are present. diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 4140eaa0a..7fd67fa27 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1279,6 +1279,14 @@ int RsServer::StartupRetroShare() RsNxsNetMgr* nxsMgr = new RsNxsNetMgrImpl(serviceCtrl); + /**** GXS Dist sync service ****/ + +#ifdef RS_USE_GXS_DISTANT_SYNC + RsGxsNetTunnelService *mGxsNetTunnel = new RsGxsNetTunnelService ; +#else + RsGxsNetTunnelService *mGxsNetTunnel = NULL ; +#endif + /**** Identity service ****/ RsGeneralDataService* gxsid_ds = new RsDataService(currGxsDir + "/", "gxsid_db", @@ -1300,9 +1308,10 @@ int RsServer::StartupRetroShare() RS_SERVICE_GXS_TYPE_GXSID, gxsid_ds, nxsMgr, mGxsIdService, mGxsIdService->getServiceInfo(), mReputations, mGxsCircles,mGxsIdService, - pgpAuxUtils,NULL, - 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) ; @@ -1358,14 +1367,6 @@ int RsServer::StartupRetroShare() mWiki->setNetworkExchangeService(wiki_ns) ; #endif - /**** GXS Dist sync service ****/ - -#ifdef RS_USE_GXS_DISTANT_SYNC - RsGxsNetTunnelService *mGxsNetTunnel = new RsGxsNetTunnelService ; -#else - RsGxsNetTunnelService *mGxsNetTunnel = NULL ; -#endif - /**** Forum GXS service ****/ RsGeneralDataService* gxsforums_ds = new RsDataService(currGxsDir + "/", "gxsforums_db", diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index 51bce5550..5618568fa 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -2700,7 +2700,7 @@ void p3IdService::requestIdsFromNet() bool request_can_proceed = false ; for(cit2 = peers.begin(); cit2 != peers.end(); ++cit2) - if(rsPeers->isOnline(*cit2)) // make sure that the peer in online, so that we know that the request has some chance to succeed. + if(rsPeers->isOnline(*cit2) || mNes->isDistantPeer(*cit2)) // make sure that the peer in online, so that we know that the request has some chance to succeed. { requests[*cit2].push_back(cit->first); request_can_proceed = true ; From 0ada4d48958a4ee049046293969a005b8825c220 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 5 May 2018 18:08:27 +0200 Subject: [PATCH 040/138] improved GxsNetTunnel comment section --- libretroshare/src/gxs/rsgxsnettunnel.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index abe7aba1c..46314da6f 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -35,7 +35,7 @@ * to RsGxsNetService. * * It is the responsibility of RsGxsNetService to activate/desactivate tunnels for each particular group, depending on wether the group - * is already available at friends or not. + * is already available at regular friends or not. * * Tunnel management is done at the level of groups rather than services, because we would like to keep the possibility to not * request tunnels for some groups which do not need it, and only request tunnels for specific groups that cannot be provided @@ -47,7 +47,6 @@ // * encrypt tunnel data using chacha20+HMAC-SHA256 using AEAD( GroupId, 96bits IV, tunnel ID ) (similar to what FT does) // * when tunnel is established, exchange virtual peer names: vpid = H( GroupID | Random bias ) // * when vpid is known, notify the client (GXS net service) which can use the virtual peer to sync -// // * only use a single tunnel per virtual peer ID // - // Client ------------------ TR(H(GroupId)) --------------> Server | @@ -67,7 +66,7 @@ // Client <------------------- GXS Data ------------------> Server | // - // Notes: -// * tunnels are established symetrically. If a distant peers wants to sync the same group, they'll have to open a single tunnel, with a different ID. +// * tunnels are established symmetrically. If a distant peers wants to sync the same group, they'll have to open a single tunnel, with a different ID. // Groups therefore have two states: // - managed : the group can be used to answer tunnel requests. If server tunnels are established, the group will be synced with these peers // - tunneled: the group will actively request tunnels. If tunnels are established both ways, the same virtual peers will be used so the tunnels are "merged". @@ -90,13 +89,18 @@ // // * virtual peers are also shared among services. This reduces the required amount of tunnels and tunnel requests to send. // +// * tunnels for a given service may also be used by the net service of p3IdService in order to explicitely request missing GxsIds. +// So GxsNetTunnel somehow allows different services to use the same tunnel. However we make sure that this traffic is limited to only p3IdService. +// // How do we know that a group needs distant sync? // * look into GrpConfigMap for suppliers. Suppliers is cleared at load. // * last_update_TS in GrpConfigMap is randomised so it cannot be used // * we need a way to know that there's no suppliers for good reasons (not that we just started) // // Security -// * +// * the question of sync-ing with distant anonymous peers is a bit tricky because these peers can try to generate fake requests or change which messages are available +// and there is no way to prevent it. We therefore rely on GXS data integrity system to prevent this to happen. +// typedef RsPeerId RsGxsNetTunnelVirtualPeerId ; @@ -128,8 +132,7 @@ struct RsGxsNetTunnelGroupInfo enum GroupStatus { RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN = 0x00, // unknown status RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE = 0x01, // no virtual peers requested, just waiting -// RS_GXS_NET_TUNNEL_GRP_STATUS_TUNNELS_REQUESTED = 0x02, // virtual peers requested, and waiting for turtle to answer - RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE = 0x03 // some virtual peers are available. Data can be read/written + RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE = 0x02 // some virtual peers are available. Data can be read/written }; enum GroupPolicy { From e7182013bf18f848a42b3f270e9a6e5c0ac35574 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 5 May 2018 18:41:41 +0200 Subject: [PATCH 041/138] added items for generic search result items for GXS --- libretroshare/src/retroshare/rsturtle.h | 8 ++++++ libretroshare/src/turtle/rsturtleitem.h | 37 +++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/retroshare/rsturtle.h b/libretroshare/src/retroshare/rsturtle.h index 7cef4fd77..4609905bc 100644 --- a/libretroshare/src/retroshare/rsturtle.h +++ b/libretroshare/src/retroshare/rsturtle.h @@ -33,7 +33,9 @@ #include #include +#include "serialiser/rstlvbinary.h" #include "retroshare/rstypes.h" +#include "retroshare/rsgxsifacetypes.h" namespace RsRegularExpression { class LinearizedExpression ; } class RsTurtleClientService ; @@ -52,6 +54,12 @@ struct TurtleFileInfo std::string name ; uint64_t size ; }; +struct TurtleGxsInfo +{ + RsGxsGroupId group_id ; + std::string name ; + RsTlvBinaryData meta ; +}; struct TurtleTunnelRequestDisplayInfo { uint32_t request_id ; // Id of the request diff --git a/libretroshare/src/turtle/rsturtleitem.h b/libretroshare/src/turtle/rsturtleitem.h index 248082652..1eded28dd 100644 --- a/libretroshare/src/turtle/rsturtleitem.h +++ b/libretroshare/src/turtle/rsturtleitem.h @@ -16,7 +16,7 @@ #include "serialiser/rsserializer.h" const uint8_t RS_TURTLE_SUBTYPE_STRING_SEARCH_REQUEST = 0x01 ; -const uint8_t RS_TURTLE_SUBTYPE_SEARCH_RESULT = 0x02 ; +const uint8_t RS_TURTLE_SUBTYPE_FT_SEARCH_RESULT = 0x02 ; const uint8_t RS_TURTLE_SUBTYPE_OPEN_TUNNEL = 0x03 ; const uint8_t RS_TURTLE_SUBTYPE_TUNNEL_OK = 0x04 ; const uint8_t RS_TURTLE_SUBTYPE_FILE_REQUEST = 0x07 ; @@ -27,6 +27,7 @@ const uint8_t RS_TURTLE_SUBTYPE_FILE_MAP = 0x10 ; const uint8_t RS_TURTLE_SUBTYPE_FILE_MAP_REQUEST = 0x11 ; const uint8_t RS_TURTLE_SUBTYPE_CHUNK_CRC = 0x14 ; const uint8_t RS_TURTLE_SUBTYPE_CHUNK_CRC_REQUEST = 0x15 ; +const uint8_t RS_TURTLE_SUBTYPE_GXS_SEARCH_RESULT = 0x16 ; // const uint8_t RS_TURTLE_SUBTYPE_FILE_CRC = 0x12 ; // unused // const uint8_t RS_TURTLE_SUBTYPE_FILE_CRC_REQUEST = 0x13 ; @@ -49,7 +50,23 @@ class RsTurtleItem: public RsItem class RsTurtleSearchResultItem: public RsTurtleItem { public: - RsTurtleSearchResultItem() : RsTurtleItem(RS_TURTLE_SUBTYPE_SEARCH_RESULT), request_id(0), depth(0) { setPriorityLevel(QOS_PRIORITY_RS_TURTLE_SEARCH_RESULT) ;} + RsTurtleSearchResultItem(uint8_t subtype) : RsTurtleItem(subtype), request_id(0), depth(0) { setPriorityLevel(QOS_PRIORITY_RS_TURTLE_SEARCH_RESULT) ;} + + TurtleSearchRequestId request_id ; // Randomly generated request id. + + uint16_t depth ; // The depth of a search result is obfuscated in this way: + // If the actual depth is 1, this field will be 1. + // If the actual depth is > 1, this field is a larger arbitrary integer. + + virtual void clear() =0; + virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx)=0; + protected: +}; + +class RsTurtleFTSearchResultItem: public RsTurtleSearchResultItem +{ + public: + RsTurtleFTSearchResultItem() : RsTurtleSearchResultItem(RS_TURTLE_SUBTYPE_FT_SEARCH_RESULT){} TurtleSearchRequestId request_id ; // Randomly generated request id. @@ -61,7 +78,23 @@ class RsTurtleSearchResultItem: public RsTurtleItem void clear() { result.clear() ; } protected: void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); +}; +class RsTurtleGxsSearchResultItem: public RsTurtleSearchResultItem +{ + public: + RsTurtleGxsSearchResultItem() : RsTurtleSearchResultItem(RS_TURTLE_SUBTYPE_GXS_SEARCH_RESULT){} + + TurtleSearchRequestId request_id ; // Randomly generated request id. + + uint16_t depth ; // The depth of a search result is obfuscated in this way: + // If the actual depth is 1, this field will be 1. + // If the actual depth is > 1, this field is a larger arbitrary integer. + std::list result ; + + void clear() { result.clear() ; } + protected: + void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); }; class RsTurtleSearchRequestItem: public RsTurtleItem From 6551af3a472846b52a1a12c3579da8e10fe05bcf Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 16 May 2018 13:47:03 +0200 Subject: [PATCH 042/138] modified control file for debian packaging --- build_scripts/Debian+Ubuntu/debian/control | 10 ++--- .../Debian+Ubuntu/debian_release_howto.txt | 37 ++++++++++++++----- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/build_scripts/Debian+Ubuntu/debian/control b/build_scripts/Debian+Ubuntu/debian/control index 68b7e8a68..ccf757edb 100644 --- a/build_scripts/Debian+Ubuntu/debian/control +++ b/build_scripts/Debian+Ubuntu/debian/control @@ -1,6 +1,6 @@ Source: retroshare Section: devel -Priority: standard +Priority: optional Maintainer: Cyril Soler Build-Depends: debhelper (>= 9), libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev, libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qtbase5-dev, qt5-qmake, qtbase5-dev-tools Standards-Version: 4.1.4 @@ -8,7 +8,7 @@ Homepage: http://retroshare.sourceforge.net Package: retroshare-voip-plugin Architecture: any -Conflicts: retroshare06-voip-plugin +Conflicts: Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare, libspeex1, libspeexdsp1, libqt5multimedia5 Description: RetroShare VOIP plugin This package provides a plugin for RetroShare, a secured Friend-to-Friend communication @@ -17,7 +17,7 @@ Description: RetroShare VOIP plugin Package: retroshare-feedreader-plugin Architecture: any -Conflicts: retroshare06-feedreader-plugin +Conflicts: Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare Description: RetroShare FeedReader plugin Plugin for Retroshare, adding a RSS feed reader tab to retroshare. @@ -25,14 +25,14 @@ Description: RetroShare FeedReader plugin Package: retroshare-nogui Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring -Conflicts: retroshare,retroshare06-nogui +Conflicts: retroshare Description: headless version of Retroshare Headless version of the Retroshare platform. Package: retroshare Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring -Conflicts: retroshare-nogui,retroshare06 +Conflicts: retroshare-nogui Description: Secure communication with friends RetroShare is a Open Source, private and secure decentralised commmunication platform. It creates mesh of computers linked with TLS connections, diff --git a/build_scripts/Debian+Ubuntu/debian_release_howto.txt b/build_scripts/Debian+Ubuntu/debian_release_howto.txt index f77a9dd3e..db9f8d9bf 100644 --- a/build_scripts/Debian+Ubuntu/debian_release_howto.txt +++ b/build_scripts/Debian+Ubuntu/debian_release_howto.txt @@ -2,8 +2,8 @@ Creation of a new Debian changelog: dch --create --package retroshare --newversion 0.6.4-1 - Note: dch reads email in $DEBMAIL or $USER@$HOSTNAME, so it should be made correct in debian/changlog - If the email does not match the email in mentors, the package will be rejected. + Note: dch reads email in $DEBMAIL or $USER@$HOSTNAME, so it should be made correct in debian/changlog + If the email does not match the email in mentors, the package will be rejected. dget command to retrieve source package: @@ -16,17 +16,34 @@ When ready: dput mentors retroshare_0.6.4-1_source.changes -Checkign with lintian: - lintian --pedantic --profile debian retroshare_0.6.4-1_source.changes +Checking with lintian: + lintian -EI --pedantic --profile debian retroshare_0.6.4-1_source.changes + echo -e 'display-info=y\ndisplay-experimental=y\npedantic=y\ncolor=auto' > ~/.config/lintian/lintianrc + + Also apply lintian to binaries + * fix overlinking in voip plugin + +Turn the RFP bug into ITP + you have to send an e-mail to control@bugs.debian.org and use the "retitle" command + [05/13/2018] successfully retitled. The mail *body* (instead of subject) needs to contain the command in a single line. Todo - * make a sid binary package. - * test in sid using pbuilder chroot system (pbuilder login) - * upload to mentors - * request for sponsorship + x make a sid binary package. + * test in sid using pbuilder chroot system (pbuilder login) + x upload to mentors + x request for sponsorship + * Getting help: - https://webchat.oftc.net/ + https://webchat.oftc.net/ Bug creation/report - reportbug -B debian + reportbug -B debian + +Re-do debian/rules according to + https://sources.debian.org/src/sleepyhead/1.0.0-beta-2+dfsg-5/debian/rules/ + the proper way to use qtchooser in d/rules is exporting QT_SELECT in d/rules, see https://pkg-kde.alioth.debian.org/packagingqtbasedstuff.html + disable autologin + +Put the package on salsa: + salsa.debian.org From cfda3b8ac6779a1024d641268e683d219e29b839 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 16 May 2018 18:37:28 +0200 Subject: [PATCH 043/138] moved debian packaging files into a separate directory --- build_scripts/Debian/clean.sh | 11 ++ build_scripts/Debian/debian/README.Debian | 6 + build_scripts/Debian/debian/changelog | 5 + build_scripts/Debian/debian/compat | 1 + build_scripts/Debian/debian/control | 41 +++++ build_scripts/Debian/debian/copyright | 44 +++++ build_scripts/Debian/debian/docs | 0 .../retroshare-feedreader-plugin.install | 1 + .../Debian/debian/retroshare-nogui.install | 3 + .../debian/retroshare-voip-plugin.install | 1 + .../Debian/debian/retroshare.install | 6 + build_scripts/Debian/debian/retrotor.install | 5 + build_scripts/Debian/debian/rules | 81 ++++++++++ build_scripts/Debian/debian/source/format | 1 + build_scripts/Debian/debian_release_howto.txt | 49 ++++++ build_scripts/Debian/makeSourcePackage.sh | 151 ++++++++++++++++++ 16 files changed, 406 insertions(+) create mode 100755 build_scripts/Debian/clean.sh create mode 100644 build_scripts/Debian/debian/README.Debian create mode 100644 build_scripts/Debian/debian/changelog create mode 100644 build_scripts/Debian/debian/compat create mode 100644 build_scripts/Debian/debian/control create mode 100644 build_scripts/Debian/debian/copyright create mode 100644 build_scripts/Debian/debian/docs create mode 100644 build_scripts/Debian/debian/retroshare-feedreader-plugin.install create mode 100644 build_scripts/Debian/debian/retroshare-nogui.install create mode 100644 build_scripts/Debian/debian/retroshare-voip-plugin.install create mode 100644 build_scripts/Debian/debian/retroshare.install create mode 100644 build_scripts/Debian/debian/retrotor.install create mode 100755 build_scripts/Debian/debian/rules create mode 100644 build_scripts/Debian/debian/source/format create mode 100644 build_scripts/Debian/debian_release_howto.txt create mode 100755 build_scripts/Debian/makeSourcePackage.sh diff --git a/build_scripts/Debian/clean.sh b/build_scripts/Debian/clean.sh new file mode 100755 index 000000000..8750b8f46 --- /dev/null +++ b/build_scripts/Debian/clean.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +rm -f ./retroshare_0.?.?-1_source.build +rm -f ./retroshare_0.?.?-1_source.changes +rm -f ./retroshare_0.?.?-1.tar.gz +rm -f ./retroshare_0.?.?-1.diff.gz +rm -f ./retroshare_0.?.?-1.dsc + +rm -f *~ +find . -name "*~" -exec rm {} \; + diff --git a/build_scripts/Debian/debian/README.Debian b/build_scripts/Debian/debian/README.Debian new file mode 100644 index 000000000..1d60d62a6 --- /dev/null +++ b/build_scripts/Debian/debian/README.Debian @@ -0,0 +1,6 @@ +retroshare for Debian +--------------------- + + + + -- Cyril Soler Sat, 06 Feb 2010 07:15:46 +0100 diff --git a/build_scripts/Debian/debian/changelog b/build_scripts/Debian/debian/changelog new file mode 100644 index 000000000..c4dd0e732 --- /dev/null +++ b/build_scripts/Debian/debian/changelog @@ -0,0 +1,5 @@ +retroshare (0.6.4-1) UNRELEASED; urgency=medium + + * Initial release for Debian. (Closes: #659069) + + -- Cyril Soler Wed, 09 May 2018 10:11:31 +0200 diff --git a/build_scripts/Debian/debian/compat b/build_scripts/Debian/debian/compat new file mode 100644 index 000000000..f599e28b8 --- /dev/null +++ b/build_scripts/Debian/debian/compat @@ -0,0 +1 @@ +10 diff --git a/build_scripts/Debian/debian/control b/build_scripts/Debian/debian/control new file mode 100644 index 000000000..ccf757edb --- /dev/null +++ b/build_scripts/Debian/debian/control @@ -0,0 +1,41 @@ +Source: retroshare +Section: devel +Priority: optional +Maintainer: Cyril Soler +Build-Depends: debhelper (>= 9), libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev, libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qtbase5-dev, qt5-qmake, qtbase5-dev-tools +Standards-Version: 4.1.4 +Homepage: http://retroshare.sourceforge.net + +Package: retroshare-voip-plugin +Architecture: any +Conflicts: +Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare, libspeex1, libspeexdsp1, libqt5multimedia5 +Description: RetroShare VOIP plugin + This package provides a plugin for RetroShare, a secured Friend-to-Friend communication + plateform. The plugin adds voice-over-IP functionality to the private chat window. Both + friends chatting together need the plugin installed to be able to talk together. + +Package: retroshare-feedreader-plugin +Architecture: any +Conflicts: +Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare +Description: RetroShare FeedReader plugin + Plugin for Retroshare, adding a RSS feed reader tab to retroshare. + +Package: retroshare-nogui +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring +Conflicts: retroshare +Description: headless version of Retroshare + Headless version of the Retroshare platform. + +Package: retroshare +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring +Conflicts: retroshare-nogui +Description: Secure communication with friends + RetroShare is a Open Source, private and secure decentralised + commmunication platform. It creates mesh of computers linked with TLS connections, + on top of which it provides file transfer, asynchronous email, forums, channels and chat. + + diff --git a/build_scripts/Debian/debian/copyright b/build_scripts/Debian/debian/copyright new file mode 100644 index 000000000..84b7e4a7f --- /dev/null +++ b/build_scripts/Debian/debian/copyright @@ -0,0 +1,44 @@ +This package was debianized by: + + Cyril Soler on Sat, 06 Feb 2010 07:15:46 +0100 + +It was downloaded from: + + + +Upstream Author(s): + + + + +Copyright: + + + + +License: + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This package 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +On Debian systems, the complete text of the GNU General +Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +The Debian packaging is: + + Copyright (C) 2010 Cyril Soler + +and is licensed under the GPL version 3, see above. + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/build_scripts/Debian/debian/docs b/build_scripts/Debian/debian/docs new file mode 100644 index 000000000..e69de29bb diff --git a/build_scripts/Debian/debian/retroshare-feedreader-plugin.install b/build_scripts/Debian/debian/retroshare-feedreader-plugin.install new file mode 100644 index 000000000..5fc9c6571 --- /dev/null +++ b/build_scripts/Debian/debian/retroshare-feedreader-plugin.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/retroshare/extensions6/libFeedReader.so* diff --git a/build_scripts/Debian/debian/retroshare-nogui.install b/build_scripts/Debian/debian/retroshare-nogui.install new file mode 100644 index 000000000..5fb7e3c8d --- /dev/null +++ b/build_scripts/Debian/debian/retroshare-nogui.install @@ -0,0 +1,3 @@ +debian/tmp/usr/bin/retroshare-nogui +debian/tmp/usr/share/retroshare/bdboot.txt +debian/tmp/usr/share/retroshare/webui/* diff --git a/build_scripts/Debian/debian/retroshare-voip-plugin.install b/build_scripts/Debian/debian/retroshare-voip-plugin.install new file mode 100644 index 000000000..48f8bdbab --- /dev/null +++ b/build_scripts/Debian/debian/retroshare-voip-plugin.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/retroshare/extensions6/libVOIP.so* diff --git a/build_scripts/Debian/debian/retroshare.install b/build_scripts/Debian/debian/retroshare.install new file mode 100644 index 000000000..e8bfb8315 --- /dev/null +++ b/build_scripts/Debian/debian/retroshare.install @@ -0,0 +1,6 @@ +debian/tmp/usr/bin/retroshare +debian/tmp/usr/bin/retroshare-nogui +debian/tmp/usr/share/applications/retroshare.desktop +debian/tmp/usr/share/icons/hicolor/* +debian/tmp/usr/share/pixmaps/retroshare.xpm +debian/tmp/usr/share/retroshare/* diff --git a/build_scripts/Debian/debian/retrotor.install b/build_scripts/Debian/debian/retrotor.install new file mode 100644 index 000000000..2a81067cd --- /dev/null +++ b/build_scripts/Debian/debian/retrotor.install @@ -0,0 +1,5 @@ +debian/tmp/usr/bin/retroshare +debian/tmp/usr/share/applications/retroshare.desktop +debian/tmp/usr/share/icons/hicolor/* +debian/tmp/usr/share/pixmaps/retroshare.xpm +debian/tmp/usr/share/retroshare/* diff --git a/build_scripts/Debian/debian/rules b/build_scripts/Debian/debian/rules new file mode 100755 index 000000000..67b3e334e --- /dev/null +++ b/build_scripts/Debian/debian/rules @@ -0,0 +1,81 @@ +#!/usr/bin/make -f + +export DH_VERBOSE = 1 + +GPKG_EXPORT_BUILDFLAGS = 1 +export DEB_BUILD_MAINT_PTIONS = hardening=+all +export QT_SELECT = qt5 + +include /usr/share/dpkg/default.mk + +MY_BUILD_DIR = _build + +%: + dh $@ --buildsystem=qmake --builddirectory=$(MY_BUILD_DIR) + +# Override dh_auto_configure in order to call qmake on the parent dir. +# We call mkdir here because of #800738. +override_dh_auto_configure: + @mkdir -p $(MY_BUILDDIR) + dh_auto_configure -- .. + +# Upstream ships with a 'history' directory containing ancient code. +# We are not interested in installing this. +override_dh_installchangelogs: + dh_installchangelogs --exclude=history + + +# configure: configure-stamp +# configure-stamp: +# dh_testdir +# cd src && qmake "CONFIG-=debug" "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=retroshare_plugins" PREFIX=/usr LIB_DIR=/usr/lib RetroShare.pro +# touch $@ +# +# +# build: build-arch build-indep +# +# build-stamp: configure-stamp +# dh_testdir +# cd src && $(MAKE) +# touch $@ +# +# build-indep: build-stamp +# +# build-arch: build-stamp +# +# clean: +# dh_testdir +# dh_testroot +# rm -f configure-stamp build-stamp +# # Add here commands to clean up after the build process. +# [ ! -f src/Makefile ] || (cd src && $(MAKE) distclean) +# dh_prep +# dh_clean +# +# install: build +# dh_testdir +# dh_testroot +# dh_prep +# dh_clean +# cd src && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install +# +# # Build architecture-independent files here. +# binary-indep: build install +# +# # Build architecture-dependent files here. +# binary-arch: build install +# dh_testdir +# dh_testroot +# dh_install --list-missing +# dh_link +# dh_strip +# dh_compress +# dh_fixperms +# dh_installdeb +# dh_shlibdeps +# dh_gencontrol +# dh_md5sums +# dh_builddeb +# +# binary: binary-indep binary-arch +# .PHONY: build clean binary-indep binary-arch binary install configure diff --git a/build_scripts/Debian/debian/source/format b/build_scripts/Debian/debian/source/format new file mode 100644 index 000000000..d3827e75a --- /dev/null +++ b/build_scripts/Debian/debian/source/format @@ -0,0 +1 @@ +1.0 diff --git a/build_scripts/Debian/debian_release_howto.txt b/build_scripts/Debian/debian_release_howto.txt new file mode 100644 index 000000000..db9f8d9bf --- /dev/null +++ b/build_scripts/Debian/debian_release_howto.txt @@ -0,0 +1,49 @@ +Creation of a new Debian changelog: + + dch --create --package retroshare --newversion 0.6.4-1 + + Note: dch reads email in $DEBMAIL or $USER@$HOSTNAME, so it should be made correct in debian/changlog + If the email does not match the email in mentors, the package will be rejected. + +dget command to retrieve source package: + + dget -u https://launchpad.net/~retroshare/+archive/ubuntu/stable/+files/retroshare_0.6.4-1.20180313.0e6d27ad~xenial.dsc + + (-u means don't check PGP signature) + +When ready: + * updload the package in a place that can be used to dget the package on mentors.debian.net. + + dput mentors retroshare_0.6.4-1_source.changes + +Checking with lintian: + lintian -EI --pedantic --profile debian retroshare_0.6.4-1_source.changes + echo -e 'display-info=y\ndisplay-experimental=y\npedantic=y\ncolor=auto' > ~/.config/lintian/lintianrc + + Also apply lintian to binaries + * fix overlinking in voip plugin + +Turn the RFP bug into ITP + you have to send an e-mail to control@bugs.debian.org and use the "retitle" command + [05/13/2018] successfully retitled. The mail *body* (instead of subject) needs to contain the command in a single line. + +Todo + x make a sid binary package. + * test in sid using pbuilder chroot system (pbuilder login) + x upload to mentors + x request for sponsorship + * + +Getting help: + https://webchat.oftc.net/ + +Bug creation/report + reportbug -B debian + +Re-do debian/rules according to + https://sources.debian.org/src/sleepyhead/1.0.0-beta-2+dfsg-5/debian/rules/ + the proper way to use qtchooser in d/rules is exporting QT_SELECT in d/rules, see https://pkg-kde.alioth.debian.org/packagingqtbasedstuff.html + disable autologin + +Put the package on salsa: + salsa.debian.org diff --git a/build_scripts/Debian/makeSourcePackage.sh b/build_scripts/Debian/makeSourcePackage.sh new file mode 100755 index 000000000..2817cef07 --- /dev/null +++ b/build_scripts/Debian/makeSourcePackage.sh @@ -0,0 +1,151 @@ +#!/bin/sh + +###################### PARAMETERS #################### +gitpath="https://github.com/RetroShare/RetroShare.git" +#branch="master" +branch="v0.6.4-official_release" +#bubba3="Y" # comment out to compile for bubba3 +###################################################### + +RS_MAJOR_VERSION=`fgrep RS_MAJOR_VERSION ../../libretroshare/src/retroshare/rsversion.h | cut -d\\ -f3- | sed -e s\/\ \/\/g | cut -c1` +RS_MINOR_VERSION=`fgrep RS_MINOR_VERSION ../../libretroshare/src/retroshare/rsversion.h | cut -d\\ -f3- | sed -e s\/\ \/\/g | cut -c1` +RS_BUILD_NUMBER=`fgrep RS_BUILD_NUMBER ../../libretroshare/src/retroshare/rsversion.h | grep -v BUILD_NUMBER_ADD | cut -d\\ -f3- | sed -e s\/\ \/\/g | cut -c1` + +# echo "RS_MAJOR_VERSION="${RS_MAJOR_VERSION} +# echo "RS_MINOR_VERSION="${RS_MINOR_VERSION} +# echo "RS_BUILD_NUMBER="${RS_BUILD_NUMBER} + +version_number="${RS_MAJOR_VERSION}"'.'"${RS_MINOR_VERSION}"'.'"${RS_BUILD_NUMBER}" +workdir=retroshare-${version_number} + +echo This script is going to build the debian source package for RetroShare, from the Git repository. + +if test -d "${workdir}" ; then + echo Removing the ${workdir} directory... + rm -rf ${workdir} +fi + +# Parse options +rev="" +dist="" +# This is the key for "Cyril Soler " +gpgkey="0932399B" + +date=`git log --pretty=format:"%ai" | head -1 | cut -d\ -f1 | sed -e s/-//g` +time=`git log --pretty=format:"%aD" | head -1 | cut -d\ -f5 | sed -e s/://g` +hhsh=`git log --pretty=format:"%H" | head -1 | cut -c1-8` + +rev=${date}.${hhsh} +useretrotor="false" + +while [ ${#} -gt 0 ]; do + case ${1} in + "-rev") shift + rev=${1} + shift + ;; + "-key") shift + gpgkey=${1} + shift + ;; + "-makeorig") + makeorig=yes + shift + ;; + "-h") shift + echo Package building script for debian/ubuntu distributions + echo Usage: + echo " "${0} '-key [PGP key id] -rev [svn revision number] -distribution [distrib name list with quotes, in (wheezy, sid, precise, saucy, etc)]' + exit 1 + ;; + "*") echo "Unknown option" + exit 1 + ;; + esac +done + +echo Attempting to get revision number... +ccount=`git rev-list --count --all` +ccount=`expr $ccount + 8613 - 8267` + +echo " Workdir :"${workdir} +echo " Version :"${version_number} +echo " Using revision :"${rev} +echo " Commit count :"${ccount} +echo " Hash :"${hhsh} +echo " Date :"${date} +echo " Time :"${time} +echo " Using branch :"${branch} +echo " Using PGP key id :"${gpgkey} + +if test ${useretrotor} = "true"; then + echo " "Specific flags : retrotor +fi + +echo Done. +version="${version_number}"."${rev}" +echo Got version number ${version} +echo +echo Please check that the changelog is up to date. +echo Hit ENTER if this is correct. Otherwise hit Ctrl+C +read tmp + +echo Extracting base archive... + +if ! test "${makeorig}" = "yes" ; then + if ! test -f retroshare_${version}.orig.tar.gz; then + echo Error: no orig file found. Please call with -makeorig option first + exit + fi +fi + + +mkdir -p ${workdir}/src +echo Checking out latest snapshot... +cd ${workdir}/src +git clone --depth 1 ${gitpath} --single-branch --branch $branch . + +cd - + +if ! test -d ${workdir}/src/libretroshare/; then + echo Git clone failed. + exit +fi + +cp -r debian ${workdir}/debian + +# VOIP tweak +cp ${workdir}/src/retroshare-gui/src/gui/chat/PopupChatDialog.ui ${workdir}/src/plugins/VOIP/gui/PopupChatDialog.ui + +# remove unised qml code, only needed on Android + +rm -rf ${workdir}/src/retroshare-qml-app/ +rm -rf ${workdir}/src/build_scripts/ +rm ${workdir}/debian/*~ + +# Cloning sqlcipher +# git clone https://github.com/sqlcipher/sqlcipher.git + +cd ${workdir} +echo Setting version numbers... + +# setup version numbers +sed -e "s%RS_REVISION_NUMBER.*%RS_REVISION_NUMBER 0x${hhsh}%" src/libretroshare/src/retroshare/rsversion.in > src/libretroshare/src/retroshare/rsversion.h + +# Various cleaning +echo Cleaning... + +\rm -rf src/.git + +if test "${makeorig}" = "yes" ; then + echo making orig archive + cd - + tar zcvf retroshare_${version_number}.orig.tar.gz ${workdir} + exit +fi + +echo Calling debuild... +debuild -S -k${gpgkey} --lintian-opts +pedantic -EviIL +cd - + +exit 0 From 83e198260b41a7234ff79425c09020824a4a2ff4 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 16 May 2018 21:24:19 +0200 Subject: [PATCH 044/138] switch to dh for debian packaging --- build_scripts/Debian/debian/rules | 66 ++---------------- build_scripts/Debian/makeSourcePackage.sh | 85 +++++++++++++---------- 2 files changed, 53 insertions(+), 98 deletions(-) diff --git a/build_scripts/Debian/debian/rules b/build_scripts/Debian/debian/rules index 67b3e334e..1068923eb 100755 --- a/build_scripts/Debian/debian/rules +++ b/build_scripts/Debian/debian/rules @@ -2,22 +2,22 @@ export DH_VERBOSE = 1 -GPKG_EXPORT_BUILDFLAGS = 1 +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk + export DEB_BUILD_MAINT_PTIONS = hardening=+all export QT_SELECT = qt5 -include /usr/share/dpkg/default.mk - -MY_BUILD_DIR = _build +MY_BUILDDIR = _build %: - dh $@ --buildsystem=qmake --builddirectory=$(MY_BUILD_DIR) + dh $@ --buildsystem=qmake --builddirectory=$(MY_BUILDDIR) # Override dh_auto_configure in order to call qmake on the parent dir. # We call mkdir here because of #800738. override_dh_auto_configure: @mkdir -p $(MY_BUILDDIR) - dh_auto_configure -- .. + dh_auto_configure -- ../src # Upstream ships with a 'history' directory containing ancient code. # We are not interested in installing this. @@ -25,57 +25,3 @@ override_dh_installchangelogs: dh_installchangelogs --exclude=history -# configure: configure-stamp -# configure-stamp: -# dh_testdir -# cd src && qmake "CONFIG-=debug" "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=retroshare_plugins" PREFIX=/usr LIB_DIR=/usr/lib RetroShare.pro -# touch $@ -# -# -# build: build-arch build-indep -# -# build-stamp: configure-stamp -# dh_testdir -# cd src && $(MAKE) -# touch $@ -# -# build-indep: build-stamp -# -# build-arch: build-stamp -# -# clean: -# dh_testdir -# dh_testroot -# rm -f configure-stamp build-stamp -# # Add here commands to clean up after the build process. -# [ ! -f src/Makefile ] || (cd src && $(MAKE) distclean) -# dh_prep -# dh_clean -# -# install: build -# dh_testdir -# dh_testroot -# dh_prep -# dh_clean -# cd src && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install -# -# # Build architecture-independent files here. -# binary-indep: build install -# -# # Build architecture-dependent files here. -# binary-arch: build install -# dh_testdir -# dh_testroot -# dh_install --list-missing -# dh_link -# dh_strip -# dh_compress -# dh_fixperms -# dh_installdeb -# dh_shlibdeps -# dh_gencontrol -# dh_md5sums -# dh_builddeb -# -# binary: binary-indep binary-arch -# .PHONY: build clean binary-indep binary-arch binary install configure diff --git a/build_scripts/Debian/makeSourcePackage.sh b/build_scripts/Debian/makeSourcePackage.sh index 2817cef07..c62914cf5 100755 --- a/build_scripts/Debian/makeSourcePackage.sh +++ b/build_scripts/Debian/makeSourcePackage.sh @@ -48,6 +48,10 @@ while [ ${#} -gt 0 ]; do gpgkey=${1} shift ;; + "-nodl") + nodl=yes + shift + ;; "-makeorig") makeorig=yes shift @@ -93,58 +97,63 @@ read tmp echo Extracting base archive... if ! test "${makeorig}" = "yes" ; then - if ! test -f retroshare_${version}.orig.tar.gz; then + if ! test -f retroshare_${version_number}.orig.tar.gz; then echo Error: no orig file found. Please call with -makeorig option first exit fi fi +if ! test "${nodl}" = "yes"; then + mkdir -p ${workdir}/src + echo Checking out latest snapshot... + cd ${workdir}/src + git clone --depth 1 ${gitpath} --single-branch --branch $branch . + + cd - -mkdir -p ${workdir}/src -echo Checking out latest snapshot... -cd ${workdir}/src -git clone --depth 1 ${gitpath} --single-branch --branch $branch . + if ! test -d ${workdir}/src/libretroshare/; then + echo Git clone failed. + exit + fi -cd - + cp -r debian ${workdir}/debian -if ! test -d ${workdir}/src/libretroshare/; then - echo Git clone failed. - exit + # VOIP tweak + cp ${workdir}/src/retroshare-gui/src/gui/chat/PopupChatDialog.ui ${workdir}/src/plugins/VOIP/gui/PopupChatDialog.ui + + # remove unised qml code, only needed on Android + rm -rf ${workdir}/src/retroshare-qml-app/ + rm -rf ${workdir}/src/build_scripts/ + rm ${workdir}/debian/*~ + + cd ${workdir} + echo Setting version numbers... + + # setup version numbers + sed -e "s%RS_REVISION_NUMBER.*%RS_REVISION_NUMBER 0x${hhsh}%" src/libretroshare/src/retroshare/rsversion.in > src/libretroshare/src/retroshare/rsversion.h + + # Various cleaning + echo Cleaning... + + \rm -rf src/.git + + if test "${makeorig}" = "yes" ; then + echo making orig archive + cd - + tar zcvf retroshare_${version_number}.orig.tar.gz ${workdir} + exit + fi + + cd - +else + tar zxvf retroshare_${version_number}.orig.tar.gz fi -cp -r debian ${workdir}/debian - -# VOIP tweak -cp ${workdir}/src/retroshare-gui/src/gui/chat/PopupChatDialog.ui ${workdir}/src/plugins/VOIP/gui/PopupChatDialog.ui - -# remove unised qml code, only needed on Android - -rm -rf ${workdir}/src/retroshare-qml-app/ -rm -rf ${workdir}/src/build_scripts/ -rm ${workdir}/debian/*~ - # Cloning sqlcipher # git clone https://github.com/sqlcipher/sqlcipher.git -cd ${workdir} -echo Setting version numbers... - -# setup version numbers -sed -e "s%RS_REVISION_NUMBER.*%RS_REVISION_NUMBER 0x${hhsh}%" src/libretroshare/src/retroshare/rsversion.in > src/libretroshare/src/retroshare/rsversion.h - -# Various cleaning -echo Cleaning... - -\rm -rf src/.git - -if test "${makeorig}" = "yes" ; then - echo making orig archive - cd - - tar zcvf retroshare_${version_number}.orig.tar.gz ${workdir} - exit -fi - echo Calling debuild... +cd ${workdir} debuild -S -k${gpgkey} --lintian-opts +pedantic -EviIL cd - From ddf98a52ca7611bf7d0a397ed5da06195e9fa202 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 17 May 2018 22:43:49 +0200 Subject: [PATCH 045/138] fixed compilation in debian/rules --- build_scripts/Debian/debian/rules | 4 ++-- build_scripts/Debian/makeSourcePackage.sh | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build_scripts/Debian/debian/rules b/build_scripts/Debian/debian/rules index 1068923eb..cb95b1d68 100755 --- a/build_scripts/Debian/debian/rules +++ b/build_scripts/Debian/debian/rules @@ -5,7 +5,7 @@ export DH_VERBOSE = 1 DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/default.mk -export DEB_BUILD_MAINT_PTIONS = hardening=+all +#export DEB_BUILD_MAINT_PTIONS = hardening=+all export QT_SELECT = qt5 MY_BUILDDIR = _build @@ -17,7 +17,7 @@ MY_BUILDDIR = _build # We call mkdir here because of #800738. override_dh_auto_configure: @mkdir -p $(MY_BUILDDIR) - dh_auto_configure -- ../src + dh_auto_configure -- CONFIG="release retroshare_plugins rs_autologin" PREFIX=/usr LIB_DIR=/usr/lib ../src # Upstream ships with a 'history' directory containing ancient code. # We are not interested in installing this. diff --git a/build_scripts/Debian/makeSourcePackage.sh b/build_scripts/Debian/makeSourcePackage.sh index c62914cf5..87508924a 100755 --- a/build_scripts/Debian/makeSourcePackage.sh +++ b/build_scripts/Debian/makeSourcePackage.sh @@ -125,6 +125,7 @@ if ! test "${nodl}" = "yes"; then rm -rf ${workdir}/src/retroshare-qml-app/ rm -rf ${workdir}/src/build_scripts/ rm ${workdir}/debian/*~ + rm ${workdir}/debian/.*.sw? cd ${workdir} echo Setting version numbers... @@ -147,6 +148,10 @@ if ! test "${nodl}" = "yes"; then cd - else tar zxvf retroshare_${version_number}.orig.tar.gz + + cp -r debian/* ${workdir}/debian/ + rm ${workdir}/debian/*~ + rm ${workdir}/debian/.*.sw? fi # Cloning sqlcipher From 5fb6005ee41e8ae1d8b3fc85613fcc6fd50ff1c2 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 19 May 2018 11:32:16 +0200 Subject: [PATCH 046/138] fixed debian/rules file --- build_scripts/Debian/debian/rules | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/build_scripts/Debian/debian/rules b/build_scripts/Debian/debian/rules index cb95b1d68..8b4fe6b6d 100755 --- a/build_scripts/Debian/debian/rules +++ b/build_scripts/Debian/debian/rules @@ -3,6 +3,8 @@ export DH_VERBOSE = 1 DPKG_EXPORT_BUILDFLAGS = 1 +DEB_BUILD_OPTIONS=noddebs + include /usr/share/dpkg/default.mk #export DEB_BUILD_MAINT_PTIONS = hardening=+all @@ -11,17 +13,13 @@ export QT_SELECT = qt5 MY_BUILDDIR = _build %: - dh $@ --buildsystem=qmake --builddirectory=$(MY_BUILDDIR) + dh $@ --parallel --buildsystem=qmake --builddirectory=$(MY_BUILDDIR) + +# Override dh_auto_configure in order to call qmake on the parent dir. We call mkdir here because of #800738. -# Override dh_auto_configure in order to call qmake on the parent dir. -# We call mkdir here because of #800738. override_dh_auto_configure: @mkdir -p $(MY_BUILDDIR) - dh_auto_configure -- CONFIG="release retroshare_plugins rs_autologin" PREFIX=/usr LIB_DIR=/usr/lib ../src - -# Upstream ships with a 'history' directory containing ancient code. -# We are not interested in installing this. -override_dh_installchangelogs: - dh_installchangelogs --exclude=history + dh_auto_configure -- CONFIG="unix release retroshare_plugins rs_autologin" PREFIX=/usr LIB_DIR=/usr/lib ../src + From d7340fe400fc8e5645d49bdf0278d2d463548d89 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 19 May 2018 13:08:46 +0200 Subject: [PATCH 047/138] fixed copyright file --- build_scripts/Debian/debian/copyright | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/build_scripts/Debian/debian/copyright b/build_scripts/Debian/debian/copyright index 84b7e4a7f..86b489954 100644 --- a/build_scripts/Debian/debian/copyright +++ b/build_scripts/Debian/debian/copyright @@ -1,20 +1,19 @@ This package was debianized by: - Cyril Soler on Sat, 06 Feb 2010 07:15:46 +0100 + Cyril Soler on Sat, 19 May 2018 20:15:46 +0100 It was downloaded from: - + Upstream Author(s): - - + Cyril Soler + Robert Fernie Copyright: - - + Copyright (C) 2018 Retroshare Team License: @@ -36,9 +35,8 @@ Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'. The Debian packaging is: - Copyright (C) 2010 Cyril Soler + Cyril Soler on Sat, 19 May 2018 20:15:46 +0100 and is licensed under the GPL version 3, see above. -# Please also look if there are files or directories which have a -# different copyright/license attached and list them here. + From f10a24dbbd84cd1696f86ebdd78ab6ba1ef34cfa Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 19 May 2018 22:03:31 +0200 Subject: [PATCH 048/138] fixed bugs in control and copyright --- build_scripts/Debian/debian/control | 12 ++-- build_scripts/Debian/debian/copyright | 86 +++++++++++++---------- build_scripts/Debian/makeSourcePackage.sh | 20 ++++-- 3 files changed, 72 insertions(+), 46 deletions(-) diff --git a/build_scripts/Debian/debian/control b/build_scripts/Debian/debian/control index ccf757edb..78c1ad740 100644 --- a/build_scripts/Debian/debian/control +++ b/build_scripts/Debian/debian/control @@ -11,9 +11,10 @@ Architecture: any Conflicts: Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare, libspeex1, libspeexdsp1, libqt5multimedia5 Description: RetroShare VOIP plugin - This package provides a plugin for RetroShare, a secured Friend-to-Friend communication - plateform. The plugin adds voice-over-IP functionality to the private chat window. Both - friends chatting together need the plugin installed to be able to talk together. + This package provides a plugin for RetroShare, a secured Friend-to-Friend + communication plateform. The plugin adds voice-over-IP functionality to the + private chat window. Both friends chatting together need the plugin installed + to be able to talk together. Package: retroshare-feedreader-plugin Architecture: any @@ -35,7 +36,8 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring Conflicts: retroshare-nogui Description: Secure communication with friends RetroShare is a Open Source, private and secure decentralised - commmunication platform. It creates mesh of computers linked with TLS connections, - on top of which it provides file transfer, asynchronous email, forums, channels and chat. + commmunication platform. It creates mesh of computers linked with TLS + connections, on top of which it provides file transfer, asynchronous email, + forums, channels and chat. diff --git a/build_scripts/Debian/debian/copyright b/build_scripts/Debian/debian/copyright index 86b489954..4b89afc5e 100644 --- a/build_scripts/Debian/debian/copyright +++ b/build_scripts/Debian/debian/copyright @@ -1,42 +1,54 @@ -This package was debianized by: +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: retroshare +Source: https://github.com/retroshare/retroshare - Cyril Soler on Sat, 19 May 2018 20:15:46 +0100 +Files: * -It was downloaded from: +Upstream Author(s): + Cyril Soler + Robert Fernie - - -Upstream Author(s): - - Cyril Soler - Robert Fernie - -Copyright: - - Copyright (C) 2018 Retroshare Team - -License: - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This package 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -On Debian systems, the complete text of the GNU General -Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'. - -The Debian packaging is: - - Cyril Soler on Sat, 19 May 2018 20:15:46 +0100 - -and is licensed under the GPL version 3, see above. +Upstream-Contact: retroshare.team@gmail.com +Copyright: Copyright 2007-2018 Retroshare Team All rights reserved. +License: GPL-2+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + . + 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 General Public License for more details. + . + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + . + See /usr/share/common-licenses/GPL-2 on your Debian system. + . + In addition to these license terms, the author grants the following + additional rights: + . + If you modify this program, or any covered work, by linking or + combining it with the OpenSSL project's OpenSSL library (or a + modified version of that library), containing parts covered by the + terms of the OpenSSL or SSLeay licenses, the author + grants you additional permission to convey the resulting work. + Corresponding Source for a non-source form of such a combination + shall include the source code for the parts of OpenSSL used as well + as that of the covered work. + . + You may at your option choose to remove this additional permission from + the work, or from any part of it. + . + It is possible to build this program in a way that it loads OpenSSL + libraries at run-time. If doing so, the following notices are required + by the OpenSSL and SSLeay licenses: + . + This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/) + . + This product includes cryptographic software written by Eric Young + (eay@cryptsoft.com) diff --git a/build_scripts/Debian/makeSourcePackage.sh b/build_scripts/Debian/makeSourcePackage.sh index 87508924a..273030f48 100755 --- a/build_scripts/Debian/makeSourcePackage.sh +++ b/build_scripts/Debian/makeSourcePackage.sh @@ -124,8 +124,13 @@ if ! test "${nodl}" = "yes"; then # remove unised qml code, only needed on Android rm -rf ${workdir}/src/retroshare-qml-app/ rm -rf ${workdir}/src/build_scripts/ - rm ${workdir}/debian/*~ - rm ${workdir}/debian/.*.sw? + rm -f ${workdir}/debian/*~ + rm -f ${workdir}/debian/.*.sw? + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble_Compact/private/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/src/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/public/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/"history"/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/private/images.sh cd ${workdir} echo Setting version numbers... @@ -150,8 +155,15 @@ else tar zxvf retroshare_${version_number}.orig.tar.gz cp -r debian/* ${workdir}/debian/ - rm ${workdir}/debian/*~ - rm ${workdir}/debian/.*.sw? + rm -rf ${workdir}/src/retroshare-qml-app/ + rm -rf ${workdir}/src/build_scripts/ + rm -f ${workdir}/debian/*~ + rm -f ${workdir}/debian/.*.sw? + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble_Compact/private/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/src/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/public/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/"history"/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/private/images.sh fi # Cloning sqlcipher From 926200098e0caa12844597daa421deccd10efd4c Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 20 May 2018 00:46:39 +0200 Subject: [PATCH 049/138] fixed copyright --- build_scripts/Debian/debian/copyright | 4 ---- build_scripts/Debian/debian_release_howto.txt | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/build_scripts/Debian/debian/copyright b/build_scripts/Debian/debian/copyright index 4b89afc5e..3c6b5e98f 100644 --- a/build_scripts/Debian/debian/copyright +++ b/build_scripts/Debian/debian/copyright @@ -4,10 +4,6 @@ Source: https://github.com/retroshare/retroshare Files: * -Upstream Author(s): - Cyril Soler - Robert Fernie - Upstream-Contact: retroshare.team@gmail.com Copyright: Copyright 2007-2018 Retroshare Team All rights reserved. diff --git a/build_scripts/Debian/debian_release_howto.txt b/build_scripts/Debian/debian_release_howto.txt index db9f8d9bf..2bf578fb9 100644 --- a/build_scripts/Debian/debian_release_howto.txt +++ b/build_scripts/Debian/debian_release_howto.txt @@ -46,4 +46,18 @@ Re-do debian/rules according to disable autologin Put the package on salsa: - salsa.debian.org + salsa.debian.org + +Debian binary changes file signature: + gpg --clearsign -u 0932399B retroshare_0.6.4-1_amd64.changes + + Signature does only work when done with debsign: + debsign -k0932399B retroshare_0.6.4-1.dsc + debsign -k0932399B retroshare_0.6.4-1_source.changes + debsign -k0932399B retroshare_0.6.4-1_amd64.changes + +Uploading-to-mentors bug: + Apparently the system prevents you from uploading while a package is in the + queue. So the upload responds "403 forbidden" whene e.g. the previous + upload was cancelled by ^C. + From 1411a56ce999c8ddcebf512be97f859758b9a985 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 20 May 2018 09:59:33 +0200 Subject: [PATCH 050/138] fixed a few errors reported by lintian --- build_scripts/Debian/debian/control | 12 ++++-------- build_scripts/Debian/debian/copyright | 10 +++++----- build_scripts/Debian/debian/rules | 5 ++--- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/build_scripts/Debian/debian/control b/build_scripts/Debian/debian/control index 78c1ad740..42646702d 100644 --- a/build_scripts/Debian/debian/control +++ b/build_scripts/Debian/debian/control @@ -2,15 +2,14 @@ Source: retroshare Section: devel Priority: optional Maintainer: Cyril Soler -Build-Depends: debhelper (>= 9), libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev, libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qtbase5-dev, qt5-qmake, qtbase5-dev-tools +Build-Depends: debhelper (>= 10), libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev, libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qtbase5-dev, qt5-qmake, qtbase5-dev-tools Standards-Version: 4.1.4 Homepage: http://retroshare.sourceforge.net Package: retroshare-voip-plugin Architecture: any -Conflicts: Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare, libspeex1, libspeexdsp1, libqt5multimedia5 -Description: RetroShare VOIP plugin +Description: VOIP plugin for the Retroshare communication platform This package provides a plugin for RetroShare, a secured Friend-to-Friend communication plateform. The plugin adds voice-over-IP functionality to the private chat window. Both friends chatting together need the plugin installed @@ -18,16 +17,15 @@ Description: RetroShare VOIP plugin Package: retroshare-feedreader-plugin Architecture: any -Conflicts: Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare -Description: RetroShare FeedReader plugin +Description: FeedReader plugin for the Retroshare communication platform Plugin for Retroshare, adding a RSS feed reader tab to retroshare. Package: retroshare-nogui Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring Conflicts: retroshare -Description: headless version of Retroshare +Description: headless version of Retroshare software Headless version of the Retroshare platform. Package: retroshare @@ -39,5 +37,3 @@ Description: Secure communication with friends commmunication platform. It creates mesh of computers linked with TLS connections, on top of which it provides file transfer, asynchronous email, forums, channels and chat. - - diff --git a/build_scripts/Debian/debian/copyright b/build_scripts/Debian/debian/copyright index 3c6b5e98f..74eed3147 100644 --- a/build_scripts/Debian/debian/copyright +++ b/build_scripts/Debian/debian/copyright @@ -1,11 +1,7 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: retroshare -Source: https://github.com/retroshare/retroshare - -Files: * - Upstream-Contact: retroshare.team@gmail.com -Copyright: Copyright 2007-2018 Retroshare Team All rights reserved. +Source: https://github.com/retroshare/retroshare License: GPL-2+ This program is free software; you can redistribute it and/or modify @@ -48,3 +44,7 @@ License: GPL-2+ This product includes cryptographic software written by Eric Young (eay@cryptsoft.com) +Copyright: Copyright 2007-2018 Retroshare Team All rights reserved. + +Files: * + diff --git a/build_scripts/Debian/debian/rules b/build_scripts/Debian/debian/rules index 8b4fe6b6d..f40a23ed3 100755 --- a/build_scripts/Debian/debian/rules +++ b/build_scripts/Debian/debian/rules @@ -3,6 +3,8 @@ export DH_VERBOSE = 1 DPKG_EXPORT_BUILDFLAGS = 1 + +# skip *-dbgsym packages DEB_BUILD_OPTIONS=noddebs include /usr/share/dpkg/default.mk @@ -20,6 +22,3 @@ MY_BUILDDIR = _build override_dh_auto_configure: @mkdir -p $(MY_BUILDDIR) dh_auto_configure -- CONFIG="unix release retroshare_plugins rs_autologin" PREFIX=/usr LIB_DIR=/usr/lib ../src - - - From b34449bfab4075bff3e8c00cf73c641a05383d55 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 20 May 2018 14:39:29 +0200 Subject: [PATCH 051/138] fixed copyright + rules --- build_scripts/Debian/debian/copyright | 5 ++--- build_scripts/Debian/debian/rules | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build_scripts/Debian/debian/copyright b/build_scripts/Debian/debian/copyright index 74eed3147..e230e1ad4 100644 --- a/build_scripts/Debian/debian/copyright +++ b/build_scripts/Debian/debian/copyright @@ -3,6 +3,8 @@ Upstream-Name: retroshare Upstream-Contact: retroshare.team@gmail.com Source: https://github.com/retroshare/retroshare +Files: * +Copyright: Copyright 2007-2018, Retroshare Team License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as @@ -44,7 +46,4 @@ License: GPL-2+ This product includes cryptographic software written by Eric Young (eay@cryptsoft.com) -Copyright: Copyright 2007-2018 Retroshare Team All rights reserved. - -Files: * diff --git a/build_scripts/Debian/debian/rules b/build_scripts/Debian/debian/rules index f40a23ed3..28e804a5f 100755 --- a/build_scripts/Debian/debian/rules +++ b/build_scripts/Debian/debian/rules @@ -15,7 +15,7 @@ export QT_SELECT = qt5 MY_BUILDDIR = _build %: - dh $@ --parallel --buildsystem=qmake --builddirectory=$(MY_BUILDDIR) + dh $@ --buildsystem=qmake --builddirectory=$(MY_BUILDDIR) # Override dh_auto_configure in order to call qmake on the parent dir. We call mkdir here because of #800738. From ea76e577677c5b917bdc773ae7b496fa19535744 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 20 May 2018 22:34:54 +0200 Subject: [PATCH 052/138] notes about licenses --- build_scripts/Debian/debian_release_howto.txt | 79 ++++++++++++++++++- 1 file changed, 75 insertions(+), 4 deletions(-) diff --git a/build_scripts/Debian/debian_release_howto.txt b/build_scripts/Debian/debian_release_howto.txt index 2bf578fb9..28fd414bc 100644 --- a/build_scripts/Debian/debian_release_howto.txt +++ b/build_scripts/Debian/debian_release_howto.txt @@ -51,13 +51,84 @@ Put the package on salsa: Debian binary changes file signature: gpg --clearsign -u 0932399B retroshare_0.6.4-1_amd64.changes - Signature does only work when done with debsign: + Signature does only work when done with debsign: debsign -k0932399B retroshare_0.6.4-1.dsc debsign -k0932399B retroshare_0.6.4-1_source.changes debsign -k0932399B retroshare_0.6.4-1_amd64.changes Uploading-to-mentors bug: - Apparently the system prevents you from uploading while a package is in the - queue. So the upload responds "403 forbidden" whene e.g. the previous - upload was cancelled by ^C. + Apparently the system prevents you from uploading while a package is in the + queue. So the upload responds "403 forbidden" whene e.g. the previous + upload was cancelled by ^C. + +Licensing issues: + Various licenses involved: + + Code part | Licenses | Authors | Comment + --------------------------------+--------------------------+----------------------------------------------+------------------------------------------------- + libbitdht | GPLv3 | drbob, csoler, Retroshare team | + bitdht/bencode.h | Public domain | Mike Frysinger | + bitdht/bdrandom.h | GPLv2 | csoler | + --------------------------------+--------------------------+----------------------------------------------+------------------------------------------------- + libresapi | GPLv3 | G10H4ck, [], electron128 | Most files are unlicenced + libretroshare | GPLv2,GPLv3 | csoler,drbob,Mr-alice,Chris,Thunder | Some files unversionned. + plugins/dlfcn_win32.cc | GPLv2.1 | Ramiro Polla | + pqi/authgpg.h | GPLv2 | Raghu Dev R. | .cc is authed by drbob + upnp/UPnPBase.h | GPLv2 | Marcelo Roberto Jimenez, aMule Team | other code in upnp/ not copyrighted + util/pugiconfig.h | MIT | Arseny Kapoulkyne | [unused file!] + util/rsstring.h | GPLv2 | Thomas Kister | + util/rswin.h | GPLv2 | Thomas Kister | + util/rsversioninfo.h | [none] | Alexandrut | + util/stacktrace.h | GPLv2 | Timo Bingmann, G10H4ck | + librssimulator | [None] | No authors | + openpgpsdk | Apache | Rachell Wilmer, Ben Laurie | + pegmarkdown | All right reserved | Daniel Jalkut - Code currently unused | + plugins/feedreader | GPLv2 | Thunder | + plugins/VOIP | | | + AudioInputConfig.h+ | All right reserved | Thorvald Natvig | Code can be modified/re-used. Mumble's code. + SpeezProcessor.h | | Peter Zotov | + retroshare-android-notify-* | GPLv3 | G10H4ck | + retroshare-android-service | GPLv3 | G10H4ck | + retroshare-gui/src | | Thunder, csoler, drbob, crypton | + control/* | GPLv2 | Matt Edman, crypton, Justin Hiple | [Unused code] + common/ElideLabel.h | BSD | Qt Toolkit | + common/FlowLayout.h | BSD | Qt Toolkit | Is that really Qt code?? Qt examples can be used. + common/html.h | GPLv2 | Matt Edman, defnax, Justin Hiple | + common/rwindow.h | GPLv2 | Matt Edman, defnax, Justin Hiple | + common/vmessagebox.h | GPLv2 | Matt Edman, defnax, Justin Hiple | + common/PictureFlow | unclear | Ariya Hidayat (@kde.org) | [Unused code] + elastic/* | LGPL | Trolltech | + FileTransfer/FTIWidget | GPLv2 | defnax, lsn752 | + FileTransfer/xprogressb | GPLv2 | Xesc | + help/browser.h | GPLv2 | Matt Edman, defnax, Justin Hiple | + images/retroshare_win.rc.h | GPLv2 | crypton | [Unused code] + msgs/textformat.h | GPLv3 | Merdhah Momeny, Golnaz Nilieh | very simple .h. Can be re-implemented + settings/rsettings.h | GPLv2 | Matt Edman, defnax, Justin Hiple | + statistics/BandwidthGraphW.h| GPLv2 | Matt Edman, defnax, Justin Hiple | + statistics/dhtgraph.h | GPLv2 | Matt Edman, defnax, Justin Hiple | + toaster/MessageToaster.h | GPLv3 | Xesc | + toaster/DownloadToaster.h | GPLv3 | Xesc | + About{Widget,Dialog}.h | GPLv2 | Unipro, Russia | Very small file. + linetypes.h | GPLv2 | Merdhah Momeny, Golnaz Nilieh | very simple .h. Can be re-implemented + mainpagestack.h | GPLv2 | Matt Edman, crypton, Justin Hiple | + land/langagesupport.h | GPLv2 | Matt Edman, crypton, Justin Hiple | + util/log.h | GPLv2 | Matt Edman, crypton, Justin Hiple | + idle/idle.h | GPLv2 | Justin Karneges | May be re-implemented + TorControl/* |* Public domaine | John Brooks | Code from Ricochet.im + util/HandleRichText.h | GPLv2 | Thomas Kister | + util/misc.h | GPLv2 | defnax, Christophe Dumez | + util/printpreview.h | GPLv2 | Trolltech example | + util/retrosharewin32.h | GPLv2 | Matt Edman, crypton, Justin Hiple | + util/stringutil.h | GPLv2 | Matt Edman, crypton, Justin Hiple | + rshare.h | GPLv2 | Matt Edman, crypton, Justin Hiple | + retroshare-nogui/* | GPLv2 | drbob | + + + Plan: move to GPLv3 with OpenSSL exception + + Many files unversionned. + + Use a pointer to the top level licence file + + From 8b8eb6b597f82d2310e59bc2dd7879010c730efc Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 21 May 2018 18:23:52 +0200 Subject: [PATCH 053/138] re-licenced libbitdht to AGPLv3+ --- RetroShare.pro | 18 +++ build_scripts/Debian/debian_release_howto.txt | 121 +++++++++--------- libbitdht/src/bitdht/bdaccount.cc | 45 +++---- libbitdht/src/bitdht/bdaccount.h | 45 +++---- libbitdht/src/bitdht/bdconnection.cc | 45 +++---- libbitdht/src/bitdht/bdconnection.h | 48 ++++--- libbitdht/src/bitdht/bdfilter.cc | 47 +++---- libbitdht/src/bitdht/bdfilter.h | 52 ++++---- libbitdht/src/bitdht/bdfriendlist.cc | 46 +++---- libbitdht/src/bitdht/bdfriendlist.h | 47 ++++--- libbitdht/src/bitdht/bdhash.cc | 46 +++---- libbitdht/src/bitdht/bdhash.h | 47 ++++--- libbitdht/src/bitdht/bdhistory.cc | 21 +++ libbitdht/src/bitdht/bdhistory.h | 22 ++++ libbitdht/src/bitdht/bdiface.h | 46 +++---- libbitdht/src/bitdht/bdmanager.cc | 46 +++---- libbitdht/src/bitdht/bdmanager.h | 48 +++---- libbitdht/src/bitdht/bdmsgs.cc | 45 +++---- libbitdht/src/bitdht/bdmsgs.h | 47 +++---- libbitdht/src/bitdht/bdnode.cc | 45 +++---- libbitdht/src/bitdht/bdnode.h | 47 +++---- libbitdht/src/bitdht/bdobj.cc | 46 +++---- libbitdht/src/bitdht/bdobj.h | 47 +++---- libbitdht/src/bitdht/bdpeer.cc | 46 +++---- libbitdht/src/bitdht/bdpeer.h | 46 +++---- libbitdht/src/bitdht/bdquery.cc | 47 +++---- libbitdht/src/bitdht/bdquery.h | 47 +++---- libbitdht/src/bitdht/bdquerymgr.cc | 45 +++---- libbitdht/src/bitdht/bdquerymgr.h | 47 +++---- libbitdht/src/bitdht/bdstddht.cc | 46 +++---- libbitdht/src/bitdht/bdstddht.h | 47 +++---- libbitdht/src/bitdht/bdstore.cc | 46 +++---- libbitdht/src/bitdht/bdstore.h | 47 +++---- libbitdht/src/bitdht/bencode.c | 35 +++-- libbitdht/src/bitdht/bencode.h | 38 ++++-- libbitdht/src/libbitdht.pro | 18 +++ libbitdht/src/udp/udpbitdht.cc | 46 +++---- libbitdht/src/udp/udpbitdht.h | 47 +++---- libbitdht/src/udp/udplayer.cc | 45 +++---- libbitdht/src/udp/udplayer.h | 46 +++---- libbitdht/src/udp/udpstack.cc | 45 +++---- libbitdht/src/udp/udpstack.h | 47 +++---- libbitdht/src/use_libbitdht.pri | 18 +++ libbitdht/src/util/bdbloom.cc | 45 +++---- libbitdht/src/util/bdbloom.h | 47 +++---- libbitdht/src/util/bdfile.cc | 21 +++ libbitdht/src/util/bdfile.h | 21 +++ libbitdht/src/util/bdnet.cc | 46 +++---- libbitdht/src/util/bdnet.h | 46 +++---- libbitdht/src/util/bdrandom.cc | 21 +++ libbitdht/src/util/bdrandom.h | 46 ++++--- libbitdht/src/util/bdstring.cc | 41 +++--- libbitdht/src/util/bdstring.h | 42 +++--- libbitdht/src/util/bdthreads.cc | 47 +++---- libbitdht/src/util/bdthreads.h | 47 +++---- retroshare.pri | 18 +++ 56 files changed, 1216 insertions(+), 1188 deletions(-) diff --git a/RetroShare.pro b/RetroShare.pro index d124ce94d..d53d37a71 100644 --- a/RetroShare.pro +++ b/RetroShare.pro @@ -1,3 +1,21 @@ +################################################################################ +# Retroshare.pro # +# Copyright (C) 2018, Retroshare team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero 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 Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +################################################################################ + !include("retroshare.pri"): error("Could not include file retroshare.pri") TEMPLATE = subdirs diff --git a/build_scripts/Debian/debian_release_howto.txt b/build_scripts/Debian/debian_release_howto.txt index 28fd414bc..a9d06e16e 100644 --- a/build_scripts/Debian/debian_release_howto.txt +++ b/build_scripts/Debian/debian_release_howto.txt @@ -65,68 +65,73 @@ Uploading-to-mentors bug: Licensing issues: Various licenses involved: - Code part | Licenses | Authors | Comment - --------------------------------+--------------------------+----------------------------------------------+------------------------------------------------- - libbitdht | GPLv3 | drbob, csoler, Retroshare team | - bitdht/bencode.h | Public domain | Mike Frysinger | - bitdht/bdrandom.h | GPLv2 | csoler | - --------------------------------+--------------------------+----------------------------------------------+------------------------------------------------- - libresapi | GPLv3 | G10H4ck, [], electron128 | Most files are unlicenced - libretroshare | GPLv2,GPLv3 | csoler,drbob,Mr-alice,Chris,Thunder | Some files unversionned. - plugins/dlfcn_win32.cc | GPLv2.1 | Ramiro Polla | - pqi/authgpg.h | GPLv2 | Raghu Dev R. | .cc is authed by drbob - upnp/UPnPBase.h | GPLv2 | Marcelo Roberto Jimenez, aMule Team | other code in upnp/ not copyrighted - util/pugiconfig.h | MIT | Arseny Kapoulkyne | [unused file!] - util/rsstring.h | GPLv2 | Thomas Kister | - util/rswin.h | GPLv2 | Thomas Kister | - util/rsversioninfo.h | [none] | Alexandrut | - util/stacktrace.h | GPLv2 | Timo Bingmann, G10H4ck | - librssimulator | [None] | No authors | - openpgpsdk | Apache | Rachell Wilmer, Ben Laurie | - pegmarkdown | All right reserved | Daniel Jalkut - Code currently unused | - plugins/feedreader | GPLv2 | Thunder | - plugins/VOIP | | | - AudioInputConfig.h+ | All right reserved | Thorvald Natvig | Code can be modified/re-used. Mumble's code. - SpeezProcessor.h | | Peter Zotov | - retroshare-android-notify-* | GPLv3 | G10H4ck | - retroshare-android-service | GPLv3 | G10H4ck | - retroshare-gui/src | | Thunder, csoler, drbob, crypton | - control/* | GPLv2 | Matt Edman, crypton, Justin Hiple | [Unused code] - common/ElideLabel.h | BSD | Qt Toolkit | - common/FlowLayout.h | BSD | Qt Toolkit | Is that really Qt code?? Qt examples can be used. - common/html.h | GPLv2 | Matt Edman, defnax, Justin Hiple | - common/rwindow.h | GPLv2 | Matt Edman, defnax, Justin Hiple | - common/vmessagebox.h | GPLv2 | Matt Edman, defnax, Justin Hiple | - common/PictureFlow | unclear | Ariya Hidayat (@kde.org) | [Unused code] - elastic/* | LGPL | Trolltech | - FileTransfer/FTIWidget | GPLv2 | defnax, lsn752 | - FileTransfer/xprogressb | GPLv2 | Xesc | - help/browser.h | GPLv2 | Matt Edman, defnax, Justin Hiple | - images/retroshare_win.rc.h | GPLv2 | crypton | [Unused code] - msgs/textformat.h | GPLv3 | Merdhah Momeny, Golnaz Nilieh | very simple .h. Can be re-implemented - settings/rsettings.h | GPLv2 | Matt Edman, defnax, Justin Hiple | - statistics/BandwidthGraphW.h| GPLv2 | Matt Edman, defnax, Justin Hiple | - statistics/dhtgraph.h | GPLv2 | Matt Edman, defnax, Justin Hiple | - toaster/MessageToaster.h | GPLv3 | Xesc | - toaster/DownloadToaster.h | GPLv3 | Xesc | - About{Widget,Dialog}.h | GPLv2 | Unipro, Russia | Very small file. - linetypes.h | GPLv2 | Merdhah Momeny, Golnaz Nilieh | very simple .h. Can be re-implemented - mainpagestack.h | GPLv2 | Matt Edman, crypton, Justin Hiple | - land/langagesupport.h | GPLv2 | Matt Edman, crypton, Justin Hiple | - util/log.h | GPLv2 | Matt Edman, crypton, Justin Hiple | - idle/idle.h | GPLv2 | Justin Karneges | May be re-implemented - TorControl/* |* Public domaine | John Brooks | Code from Ricochet.im - util/HandleRichText.h | GPLv2 | Thomas Kister | - util/misc.h | GPLv2 | defnax, Christophe Dumez | - util/printpreview.h | GPLv2 | Trolltech example | - util/retrosharewin32.h | GPLv2 | Matt Edman, crypton, Justin Hiple | - util/stringutil.h | GPLv2 | Matt Edman, crypton, Justin Hiple | - rshare.h | GPLv2 | Matt Edman, crypton, Justin Hiple | - retroshare-nogui/* | GPLv2 | drbob | + R: re-licence to GPLv3 + D: delete + + Code part | Licenses |A| Authors | Comment + --------------------------------+------------------------+-+----------------------------------------------+------------------------------------------------- + libbitdht | GPLv3 | | drbob, csoler, Retroshare team | + bitdht/bencode.h | Public domain | | Mike Frysinger | + bitdht/bdrandom.h | GPLv2 |R| csoler | + --------------------------------+------------------------+-+----------------------------------------------+------------------------------------------------- + libresapi | GPLv3 | | G10H4ck, [], electron128 | Most files are unlicenced + libretroshare | GPLv2,GPLv3 | | csoler,drbob,Mr-alice,Chris,Thunder | Some files unversionned. + plugins/dlfcn_win32.cc | GPLv2.1 |R| Ramiro Polla | + pqi/authgpg.h | GPLv2 |R| Raghu Dev R. | .cc is authed by drbob + upnp/UPnPBase.h | GPLv2 | | Marcelo Roberto Jimenez, aMule Team | other code in upnp/ not copyrighted + util/pugiconfig.h | MIT | | Arseny Kapoulkyne | [unused file!] + util/rsstring.h | GPLv2 |R| Thomas Kister | + util/rswin.h | GPLv2 |R| Thomas Kister | + util/rsversioninfo.h | [none] | | Alexandrut | + util/stacktrace.h | GPLv2 |R| Timo Bingmann, G10H4ck | + librssimulator | [None] | | No authors | + openpgpsdk | Apache | | Rachell Wilmer, Ben Laurie | + pegmarkdown | All right reserved | | Daniel Jalkut - Code currently unused | + plugins/feedreader | GPLv2 | | Thunder | + plugins/VOIP | | | | + AudioInputConfig.h+ | All right reserved | | Thorvald Natvig | Code can be modified/re-used. Mumble's code. + SpeezProcessor.h | | | Peter Zotov | + retroshare-android-notify-* | GPLv3 | | G10H4ck | + retroshare-android-service | GPLv3 | | G10H4ck | + retroshare-gui/src | | | Thunder, csoler, drbob, crypton | + control/* | GPLv2 | | Matt Edman, crypton, Justin Hiple | [Unused code] + common/ElideLabel.h | BSD | | Qt Toolkit | + common/FlowLayout.h | BSD | | Qt Toolkit | Is that really Qt code?? Qt examples can be used. + common/html.h | GPLv2 | | Matt Edman, defnax, Justin Hiple | + common/rwindow.h | GPLv2 | | Matt Edman, defnax, Justin Hiple | + common/vmessagebox.h | GPLv2 | | Matt Edman, defnax, Justin Hiple | + common/PictureFlow | unclear | | Ariya Hidayat (@kde.org) | [Unused code] + elastic/* | LGPL | | Trolltech | + FileTransfer/FTIWidget | GPLv2 | | defnax, lsn752 | + FileTransfer/xprogressb | GPLv2 | | Xesc | + help/browser.h | GPLv2 | | Matt Edman, defnax, Justin Hiple | + images/retroshare_win.rc.h | GPLv2 | | crypton | [Unused code] + msgs/textformat.h | GPLv3 | | Merdhah Momeny, Golnaz Nilieh | very simple .h. Can be re-implemented + settings/rsettings.h | GPLv2 | | Matt Edman, defnax, Justin Hiple | + statistics/BandwidthGraphW.h| GPLv2 | | Matt Edman, defnax, Justin Hiple | + statistics/dhtgraph.h | GPLv2 | | Matt Edman, defnax, Justin Hiple | + toaster/MessageToaster.h | GPLv3 | | Xesc | + toaster/DownloadToaster.h | GPLv3 | | Xesc | + About{Widget,Dialog}.h | GPLv2 | | Unipro, Russia | Very small file. + linetypes.h | GPLv2 | | Merdhah Momeny, Golnaz Nilieh | very simple .h. Can be re-implemented + mainpagestack.h | GPLv2 | | Matt Edman, crypton, Justin Hiple | + land/langagesupport.h | GPLv2 | | Matt Edman, crypton, Justin Hiple | + util/log.h | GPLv2 | | Matt Edman, crypton, Justin Hiple | + idle/idle.h | GPLv2 | | Justin Karneges | May be re-implemented + TorControl/* |* Public domaine | | John Brooks | Code from Ricochet.im + util/HandleRichText.h | GPLv2 | | Thomas Kister | + util/misc.h | GPLv2 | | defnax, Christophe Dumez | + util/printpreview.h | GPLv2 | | Trolltech example | + util/retrosharewin32.h | GPLv2 | | Matt Edman, crypton, Justin Hiple | + util/stringutil.h | GPLv2 | | Matt Edman, crypton, Justin Hiple | + rshare.h | GPLv2 | | Matt Edman, crypton, Justin Hiple | + retroshare-nogui/* | GPLv2 | | drbob | Plan: move to GPLv3 with OpenSSL exception + - Appache is compatible with GPLv3 + Many files unversionned. Use a pointer to the top level licence file diff --git a/libbitdht/src/bitdht/bdaccount.cc b/libbitdht/src/bitdht/bdaccount.cc index 6246b0241..57de177f7 100644 --- a/libbitdht/src/bitdht/bdaccount.cc +++ b/libbitdht/src/bitdht/bdaccount.cc @@ -1,27 +1,24 @@ -/* - * bitdht/bdaccount.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 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 3 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 "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdaccount.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bitdht/bdaccount.h" diff --git a/libbitdht/src/bitdht/bdaccount.h b/libbitdht/src/bitdht/bdaccount.h index 5e9b6cc61..7116e3ced 100644 --- a/libbitdht/src/bitdht/bdaccount.h +++ b/libbitdht/src/bitdht/bdaccount.h @@ -1,30 +1,27 @@ #ifndef BITDHT_ACCOUNT_H #define BITDHT_ACCOUNT_H -/* - * bitdht/bdaccount.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 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 3 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 "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdaccount.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/libbitdht/src/bitdht/bdconnection.cc b/libbitdht/src/bitdht/bdconnection.cc index 90e6afa98..494e076f3 100644 --- a/libbitdht/src/bitdht/bdconnection.cc +++ b/libbitdht/src/bitdht/bdconnection.cc @@ -1,27 +1,24 @@ -/* - * bitdht/bdconnection.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 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 3 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 "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdconnection.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include "bitdht/bdiface.h" diff --git a/libbitdht/src/bitdht/bdconnection.h b/libbitdht/src/bitdht/bdconnection.h index 4453a0bf0..c55d95c09 100644 --- a/libbitdht/src/bitdht/bdconnection.h +++ b/libbitdht/src/bitdht/bdconnection.h @@ -1,32 +1,28 @@ +/******************************************************************************* + * bitdht/bdconnection.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef BITDHT_CONNECTION_H #define BITDHT_CONNECTION_H -/* - * bitdht/bdconnection.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 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 3 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 "bitdht@lunamutt.com". - * - */ - - #include "bitdht/bdiface.h" class bdQueryManager; diff --git a/libbitdht/src/bitdht/bdfilter.cc b/libbitdht/src/bitdht/bdfilter.cc index 5be9e1178..1ba7d3aca 100644 --- a/libbitdht/src/bitdht/bdfilter.cc +++ b/libbitdht/src/bitdht/bdfilter.cc @@ -1,29 +1,24 @@ - -/* - * bitdht/bdfilter.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/bdfilter.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bitdht/bdfilter.h" #include "bitdht/bdmanager.h" diff --git a/libbitdht/src/bitdht/bdfilter.h b/libbitdht/src/bitdht/bdfilter.h index 7c1d940d3..27d32a7d4 100644 --- a/libbitdht/src/bitdht/bdfilter.h +++ b/libbitdht/src/bitdht/bdfilter.h @@ -1,36 +1,28 @@ +/******************************************************************************* + * bitdht/bdfilter.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef BITDHT_FILTER_H #define BITDHT_FILTER_H -/* - * bitdht/bdfilter.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - -/* This class is used to detect bad and filter them peers - * - */ - - #include "bitdht/bdiface.h" #include diff --git a/libbitdht/src/bitdht/bdfriendlist.cc b/libbitdht/src/bitdht/bdfriendlist.cc index 3bb258c40..487f0a75c 100644 --- a/libbitdht/src/bitdht/bdfriendlist.cc +++ b/libbitdht/src/bitdht/bdfriendlist.cc @@ -1,28 +1,24 @@ - -/* - * bitdht/bdfriendlist.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 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 3 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 "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdfriendlist.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bitdht/bdfriendlist.h" #include "bitdht/bdstddht.h" diff --git a/libbitdht/src/bitdht/bdfriendlist.h b/libbitdht/src/bitdht/bdfriendlist.h index 35cad86bb..a58888ed8 100644 --- a/libbitdht/src/bitdht/bdfriendlist.h +++ b/libbitdht/src/bitdht/bdfriendlist.h @@ -1,31 +1,28 @@ +/******************************************************************************* + * bitdht/bdfriendlist.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef BITDHT_FRIEND_LIST_H #define BITDHT_FRIEND_LIST_H -/* - * bitdht/bdfriendlist.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 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 3 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 "bitdht@lunamutt.com". - * - */ - /* * This class maintains a list of current friends and friends-of-friends. * It should also be updated when a peer's address has been identified. diff --git a/libbitdht/src/bitdht/bdhash.cc b/libbitdht/src/bitdht/bdhash.cc index 762ca5e1b..5eabd3d95 100644 --- a/libbitdht/src/bitdht/bdhash.cc +++ b/libbitdht/src/bitdht/bdhash.cc @@ -1,28 +1,24 @@ -/* - * bitdht/bdhash.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/bdhash.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bitdht/bdhash.h" #include "bitdht/bdstddht.h" diff --git a/libbitdht/src/bitdht/bdhash.h b/libbitdht/src/bitdht/bdhash.h index 10c8fd6e2..680169665 100644 --- a/libbitdht/src/bitdht/bdhash.h +++ b/libbitdht/src/bitdht/bdhash.h @@ -1,31 +1,28 @@ +/******************************************************************************* + * bitdht/bdhash.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef BITDHT_HASH_SPACE_H #define BITDHT_HASH_SPACE_H -/* - * bitdht/bdhash.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - #include "bitdht/bdpeer.h" #include diff --git a/libbitdht/src/bitdht/bdhistory.cc b/libbitdht/src/bitdht/bdhistory.cc index 434ab3333..05bb73fa0 100644 --- a/libbitdht/src/bitdht/bdhistory.cc +++ b/libbitdht/src/bitdht/bdhistory.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * bitdht/bdhistory.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bitdht/bdhistory.h" diff --git a/libbitdht/src/bitdht/bdhistory.h b/libbitdht/src/bitdht/bdhistory.h index 656d91413..79e420d92 100644 --- a/libbitdht/src/bitdht/bdhistory.h +++ b/libbitdht/src/bitdht/bdhistory.h @@ -1,3 +1,25 @@ +/******************************************************************************* + * bitdht/bdhistory.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef BITDHT_HISTORY_H #define BITDHT_HISTORY_H diff --git a/libbitdht/src/bitdht/bdiface.h b/libbitdht/src/bitdht/bdiface.h index f6f47126c..4e571ccdb 100644 --- a/libbitdht/src/bitdht/bdiface.h +++ b/libbitdht/src/bitdht/bdiface.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * bitdht/bdiface.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BIT_DHT_INTERFACE_H #define BIT_DHT_INTERFACE_H -/* - * bitdht/bdiface.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - #include #include #include diff --git a/libbitdht/src/bitdht/bdmanager.cc b/libbitdht/src/bitdht/bdmanager.cc index 52ac66e9a..522b0629f 100644 --- a/libbitdht/src/bitdht/bdmanager.cc +++ b/libbitdht/src/bitdht/bdmanager.cc @@ -1,28 +1,24 @@ -/* - * bitdht/bdmanager.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/bdmanager.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /******* * Node Manager. diff --git a/libbitdht/src/bitdht/bdmanager.h b/libbitdht/src/bitdht/bdmanager.h index c494b2bef..1a6a2cebd 100644 --- a/libbitdht/src/bitdht/bdmanager.h +++ b/libbitdht/src/bitdht/bdmanager.h @@ -1,33 +1,27 @@ +/******************************************************************************* + * bitdht/bdmanager.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_MANAGER_H #define BITDHT_MANAGER_H -/* - * bitdht/bdmanager.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - - - /******* * Node Manager. ******/ diff --git a/libbitdht/src/bitdht/bdmsgs.cc b/libbitdht/src/bitdht/bdmsgs.cc index ebaccefcc..1af0c9814 100644 --- a/libbitdht/src/bitdht/bdmsgs.cc +++ b/libbitdht/src/bitdht/bdmsgs.cc @@ -1,27 +1,24 @@ -/* - * bitdht/bdmsgs.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdmsgs.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/libbitdht/src/bitdht/bdmsgs.h b/libbitdht/src/bitdht/bdmsgs.h index ea7b8a3a1..99a26d76a 100644 --- a/libbitdht/src/bitdht/bdmsgs.h +++ b/libbitdht/src/bitdht/bdmsgs.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * bitdht/bdmsgs.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_MSGS_H #define BITDHT_MSGS_H -/* - * bitdht/bdmsgs.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - - #include #include #include diff --git a/libbitdht/src/bitdht/bdnode.cc b/libbitdht/src/bitdht/bdnode.cc index f7ae5e220..f1a13f718 100644 --- a/libbitdht/src/bitdht/bdnode.cc +++ b/libbitdht/src/bitdht/bdnode.cc @@ -1,27 +1,24 @@ -/* - * bitdht/bdnode.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010-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 3 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 "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdnode.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bitdht/bdnode.h" diff --git a/libbitdht/src/bitdht/bdnode.h b/libbitdht/src/bitdht/bdnode.h index 5acb1255b..ad1ffe2fb 100644 --- a/libbitdht/src/bitdht/bdnode.h +++ b/libbitdht/src/bitdht/bdnode.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * bitdht/bdnode.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_NODE_H #define BITDHT_NODE_H -/* - * bitdht/bdnode.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - - #include "bitdht/bdpeer.h" #include "bitdht/bdquery.h" #include "bitdht/bdstore.h" diff --git a/libbitdht/src/bitdht/bdobj.cc b/libbitdht/src/bitdht/bdobj.cc index df22686cc..9832796d2 100644 --- a/libbitdht/src/bitdht/bdobj.cc +++ b/libbitdht/src/bitdht/bdobj.cc @@ -1,28 +1,24 @@ - -/* - * bitdht/bdobj.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdobj.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bitdht/bdobj.h" diff --git a/libbitdht/src/bitdht/bdobj.h b/libbitdht/src/bitdht/bdobj.h index dbc8b5385..d193c59a8 100644 --- a/libbitdht/src/bitdht/bdobj.h +++ b/libbitdht/src/bitdht/bdobj.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * bitdht/bdobj.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_OBJECTS_H #define BITDHT_OBJECTS_H -/* - * bitdht/bdobj.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - - #define BITDHT_TOKEN_MAX_LEN 20 #include diff --git a/libbitdht/src/bitdht/bdpeer.cc b/libbitdht/src/bitdht/bdpeer.cc index 295ca083d..65cfb31b5 100644 --- a/libbitdht/src/bitdht/bdpeer.cc +++ b/libbitdht/src/bitdht/bdpeer.cc @@ -1,28 +1,24 @@ -/* - * bitdht/bdpeer.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/bdpeer.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bitdht/bdpeer.h" #include "util/bdnet.h" diff --git a/libbitdht/src/bitdht/bdpeer.h b/libbitdht/src/bitdht/bdpeer.h index 59175c531..d663a7ecd 100644 --- a/libbitdht/src/bitdht/bdpeer.h +++ b/libbitdht/src/bitdht/bdpeer.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * bitdht/bdpeer.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_PEER_H #define BITDHT_PEER_H -/* - * bitdht/bdpeer.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - #include "bitdht/bdiface.h" #include diff --git a/libbitdht/src/bitdht/bdquery.cc b/libbitdht/src/bitdht/bdquery.cc index e93000a84..f9b77002d 100644 --- a/libbitdht/src/bitdht/bdquery.cc +++ b/libbitdht/src/bitdht/bdquery.cc @@ -1,29 +1,24 @@ - -/* - * bitdht/bdquery.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/bdquery.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bitdht/bdquery.h" #include "bitdht/bdstddht.h" diff --git a/libbitdht/src/bitdht/bdquery.h b/libbitdht/src/bitdht/bdquery.h index 2c17ae1d5..4cb08f165 100644 --- a/libbitdht/src/bitdht/bdquery.h +++ b/libbitdht/src/bitdht/bdquery.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * bitdht/bdquery.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_QUERY_H #define BITDHT_QUERY_H -/* - * bitdht/bdquery.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - - #include "bitdht/bdiface.h" #include "bitdht/bdpeer.h" #include "bitdht/bdobj.h" diff --git a/libbitdht/src/bitdht/bdquerymgr.cc b/libbitdht/src/bitdht/bdquerymgr.cc index d920d1283..70f58ce90 100644 --- a/libbitdht/src/bitdht/bdquerymgr.cc +++ b/libbitdht/src/bitdht/bdquerymgr.cc @@ -1,27 +1,24 @@ -/* - * bitdht/bdnode.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdquerymgr.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bitdht/bdquerymgr.h" #include "bitdht/bdnode.h" diff --git a/libbitdht/src/bitdht/bdquerymgr.h b/libbitdht/src/bitdht/bdquerymgr.h index 042fbec41..355781244 100644 --- a/libbitdht/src/bitdht/bdquerymgr.h +++ b/libbitdht/src/bitdht/bdquerymgr.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * bitdht/bdquerymgr.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_QUERY_MANAGER_H #define BITDHT_QUERY_MANAGER_H -/* - * bitdht/bdquerymgr.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 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 3 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 "bitdht@lunamutt.com". - * - */ - - #include "bitdht/bdquery.h" class bdNodePublisher; diff --git a/libbitdht/src/bitdht/bdstddht.cc b/libbitdht/src/bitdht/bdstddht.cc index 3faa85df2..eac5c148e 100644 --- a/libbitdht/src/bitdht/bdstddht.cc +++ b/libbitdht/src/bitdht/bdstddht.cc @@ -1,28 +1,24 @@ -/* - * bitdht/bdstddht.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/bdstddht.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bitdht/bdstddht.h" #include "bitdht/bdpeer.h" diff --git a/libbitdht/src/bitdht/bdstddht.h b/libbitdht/src/bitdht/bdstddht.h index 4637cc8f2..d38c19724 100644 --- a/libbitdht/src/bitdht/bdstddht.h +++ b/libbitdht/src/bitdht/bdstddht.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * bitdht/bdstddht.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_STANDARD_DHT_H #define BITDHT_STANDARD_DHT_H -/* - * bitdht/bdstddht.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - - #include "bitdht/bdiface.h" #define BITDHT_STANDARD_BUCKET_SIZE 10 // 20 too many per query? diff --git a/libbitdht/src/bitdht/bdstore.cc b/libbitdht/src/bitdht/bdstore.cc index 3465d71c6..40031abac 100644 --- a/libbitdht/src/bitdht/bdstore.cc +++ b/libbitdht/src/bitdht/bdstore.cc @@ -1,28 +1,24 @@ -/* - * bitdht/bdstore.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/bdstore.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bitdht/bdstore.h" #include "util/bdnet.h" diff --git a/libbitdht/src/bitdht/bdstore.h b/libbitdht/src/bitdht/bdstore.h index 627972716..a01f5aa2c 100644 --- a/libbitdht/src/bitdht/bdstore.h +++ b/libbitdht/src/bitdht/bdstore.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * bitdht/bdstore.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_STORE_H #define BITDHT_STORE_H -/* - * bitdht/bdstore.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - - #include #include "bitdht/bdiface.h" #include "bitdht/bdpeer.h" diff --git a/libbitdht/src/bitdht/bencode.c b/libbitdht/src/bitdht/bencode.c index b1f4c2eaf..a496f5bc3 100644 --- a/libbitdht/src/bitdht/bencode.c +++ b/libbitdht/src/bitdht/bencode.c @@ -1,16 +1,25 @@ -/* - * C implementation of a bencode decoder. - * This is the format defined by BitTorrent: - * http://wiki.theory.org/BitTorrentSpecification#bencoding - * - * The only external requirements are a few [standard] function calls and - * the long long type. Any sane system should provide all of these things. - * - * See the bencode.h header file for usage information. - * - * This is released into the public domain. - * Written by Mike Frysinger . - */ +/******************************************************************************* + * bitdht/bdencode.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * by Mike Frysinger * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /* * This implementation isn't optimized at all as I wrote it to support diff --git a/libbitdht/src/bitdht/bencode.h b/libbitdht/src/bitdht/bencode.h index 211c96542..4e733b66f 100644 --- a/libbitdht/src/bitdht/bencode.h +++ b/libbitdht/src/bitdht/bencode.h @@ -1,14 +1,27 @@ -/* - * C implementation of a bencode decoder. - * This is the format defined by BitTorrent: - * http://wiki.theory.org/BitTorrentSpecification#bencoding - * - * The only external requirements are a few [standard] function calls and - * the long long type. Any sane system should provide all of these things. - * - * This is released into the public domain. - * Written by Mike Frysinger . - */ +/******************************************************************************* + * bitdht/bdencode.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * by Mike Frysinger * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ +#ifndef _BENCODE_H +#define _BENCODE_H /* USAGE: * - pass the string full of the bencoded data to be_decode() @@ -16,9 +29,6 @@ * - call be_free() on the tree to release resources */ -#ifndef _BENCODE_H -#define _BENCODE_H - #ifdef __cplusplus extern "C" { #endif diff --git a/libbitdht/src/libbitdht.pro b/libbitdht/src/libbitdht.pro index d9e5816c4..e375c5b90 100644 --- a/libbitdht/src/libbitdht.pro +++ b/libbitdht/src/libbitdht.pro @@ -1,3 +1,21 @@ +################################################################################ +# libbitdht.pro # +# Copyright (C) 2018, Retroshare team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero 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 Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +################################################################################ + !include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri") TEMPLATE = lib diff --git a/libbitdht/src/udp/udpbitdht.cc b/libbitdht/src/udp/udpbitdht.cc index 39c13e182..72357c91f 100644 --- a/libbitdht/src/udp/udpbitdht.cc +++ b/libbitdht/src/udp/udpbitdht.cc @@ -1,28 +1,24 @@ -/* - * bitdht/udpbitdht.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/udpbitdht.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "udp/udpbitdht.h" #include "bitdht/bdpeer.h" diff --git a/libbitdht/src/udp/udpbitdht.h b/libbitdht/src/udp/udpbitdht.h index f1e167abf..5cbf0622d 100644 --- a/libbitdht/src/udp/udpbitdht.h +++ b/libbitdht/src/udp/udpbitdht.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * udp/udpbitdht.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef UDP_BIT_DHT_CLASS_H #define UDP_BIT_DHT_CLASS_H -/* - * bitdht/udpbitdht.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - - #include #include #include diff --git a/libbitdht/src/udp/udplayer.cc b/libbitdht/src/udp/udplayer.cc index a0cc2324e..1a82c3d81 100644 --- a/libbitdht/src/udp/udplayer.cc +++ b/libbitdht/src/udp/udplayer.cc @@ -1,27 +1,24 @@ -/* - * udp/udplayer.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2004-2010 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 3 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 "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * udp/udplayer.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2004-2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "udp/udplayer.h" #include "util/bdrandom.h" diff --git a/libbitdht/src/udp/udplayer.h b/libbitdht/src/udp/udplayer.h index 8f2551cb0..06e76c647 100644 --- a/libbitdht/src/udp/udplayer.h +++ b/libbitdht/src/udp/udplayer.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * udp/udplayer.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2004-2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_UDP_LAYER_H #define BITDHT_UDP_LAYER_H -/* - * udp/udplayer.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2004-2010 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 3 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 "bitdht@lunamutt.com". - * - */ - #include "util/bdthreads.h" #include "util/bdnet.h" diff --git a/libbitdht/src/udp/udpstack.cc b/libbitdht/src/udp/udpstack.cc index a66f4c6e2..fdf8eb9cf 100644 --- a/libbitdht/src/udp/udpstack.cc +++ b/libbitdht/src/udp/udpstack.cc @@ -1,27 +1,24 @@ -/* - * udp/udpstack.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * udp/udpstack.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "udp/udpstack.h" diff --git a/libbitdht/src/udp/udpstack.h b/libbitdht/src/udp/udpstack.h index 3f04f0d38..31b8ec324 100644 --- a/libbitdht/src/udp/udpstack.h +++ b/libbitdht/src/udp/udpstack.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * udp/udpstack.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_UDP_STACK_RECEIVER_H #define BITDHT_UDP_STACK_RECEIVER_H -/* - * udp/udpstack.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ - - #include "util/bdthreads.h" #include "util/bdnet.h" diff --git a/libbitdht/src/use_libbitdht.pri b/libbitdht/src/use_libbitdht.pri index bbaf1d4d5..086f16a89 100644 --- a/libbitdht/src/use_libbitdht.pri +++ b/libbitdht/src/use_libbitdht.pri @@ -1,3 +1,21 @@ +################################################################################ +# use_libbitdht.pri # +# Copyright (C) 2018, Retroshare team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero 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 Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +################################################################################ + DEPENDPATH *= $$system_path($$clean_path($${PWD}/../../libbitdht/src)) INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../libbitdht/src)) LIBS *= -L$$system_path($$clean_path($${OUT_PWD}/../../libbitdht/src/lib/)) -lbitdht diff --git a/libbitdht/src/util/bdbloom.cc b/libbitdht/src/util/bdbloom.cc index 016808ea4..739e2c793 100644 --- a/libbitdht/src/util/bdbloom.cc +++ b/libbitdht/src/util/bdbloom.cc @@ -1,27 +1,24 @@ -/* - * bitdht/bdbloom.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 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 3 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 "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * util/bdbloom.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "util/bdbloom.h" #include "util/bdstring.h" diff --git a/libbitdht/src/util/bdbloom.h b/libbitdht/src/util/bdbloom.h index 91257514e..8ffd13f1e 100644 --- a/libbitdht/src/util/bdbloom.h +++ b/libbitdht/src/util/bdbloom.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * util/bdbloom.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_BLOOM_H #define BITDHT_BLOOM_H -/* - * bitdht/bdbloom.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 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 3 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 "bitdht@lunamutt.com". - * - */ - - #include #include diff --git a/libbitdht/src/util/bdfile.cc b/libbitdht/src/util/bdfile.cc index 48db4a232..bcd2eb64b 100644 --- a/libbitdht/src/util/bdfile.cc +++ b/libbitdht/src/util/bdfile.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * util/bdfile.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifdef WIN32 #include #endif diff --git a/libbitdht/src/util/bdfile.h b/libbitdht/src/util/bdfile.h index c3d5444d7..5228f986a 100644 --- a/libbitdht/src/util/bdfile.h +++ b/libbitdht/src/util/bdfile.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * util/bdfile.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libbitdht/src/util/bdnet.cc b/libbitdht/src/util/bdnet.cc index 3bccf0d65..4c5f681a6 100644 --- a/libbitdht/src/util/bdnet.cc +++ b/libbitdht/src/util/bdnet.cc @@ -1,28 +1,24 @@ - -/* - * util/bdnet.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 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 3 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 "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * util/bdnet.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bdnet.h" #include "bdstring.h" diff --git a/libbitdht/src/util/bdnet.h b/libbitdht/src/util/bdnet.h index 7e3e24644..639a2ed1a 100644 --- a/libbitdht/src/util/bdnet.h +++ b/libbitdht/src/util/bdnet.h @@ -1,30 +1,26 @@ +/******************************************************************************* + * util/bdnet.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_UNIVERSAL_NETWORK_HEADER #define BITDHT_UNIVERSAL_NETWORK_HEADER -/* - * - * util/bdnet.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2004-2010 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 3 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 "bitdht@lunamutt.com". - * - */ #include #include diff --git a/libbitdht/src/util/bdrandom.cc b/libbitdht/src/util/bdrandom.cc index 6288f86b8..93a0352dd 100644 --- a/libbitdht/src/util/bdrandom.cc +++ b/libbitdht/src/util/bdrandom.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * util/bdrandom.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright (C) 2010 Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include #include diff --git a/libbitdht/src/util/bdrandom.h b/libbitdht/src/util/bdrandom.h index 95d70bf13..9ab3f22bd 100644 --- a/libbitdht/src/util/bdrandom.h +++ b/libbitdht/src/util/bdrandom.h @@ -1,39 +1,37 @@ +/******************************************************************************* + * util/bdrandom.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright (C) 2010 Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_UTILS_BDRANDOM_H #define BITDHT_UTILS_BDRANDOM_H - -/**************************************************************** - * libbitdht is distributed under the following license: - * - * Copyright (C) 2010 Cyril Soler - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - /* This Source Code is basically a direct copy of libretroshare's RsRandom. * the function names have just been renamed. drbob */ - // bdRandom contains a random number generator that is // - thread safe // - system independant // - fast // - NOT CRYPTOGRAPHICALLY SAFE -// - DO NOT USE FOR ANYTHING REQUIRING STRONG RANDOMNESS +// - DO NOT USE FOR ANYTHING REQUIRING STRONG UNPREDICTABLE RANDOMNESS // // The implementation is adapted from the Mersenne Twister page of Wikipedia. // diff --git a/libbitdht/src/util/bdstring.cc b/libbitdht/src/util/bdstring.cc index 07fd4632f..2b9b289f4 100644 --- a/libbitdht/src/util/bdstring.cc +++ b/libbitdht/src/util/bdstring.cc @@ -1,23 +1,24 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * util/bdstring.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright (C) 2010 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bdstring.h" diff --git a/libbitdht/src/util/bdstring.h b/libbitdht/src/util/bdstring.h index 9c4dc94aa..7bd76892d 100644 --- a/libbitdht/src/util/bdstring.h +++ b/libbitdht/src/util/bdstring.h @@ -1,27 +1,27 @@ +/******************************************************************************* + * util/bdstring.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright (C) 2010 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_UTILS_BDSTRING_H #define BITDHT_UTILS_BDSTRING_H -/**************************************************************** - * libbitdht is distributed under the following license: - * - * Copyright (C) 2012 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - #ifdef WIN32 // for proper handling of %ll #define bd_snprintf __mingw_snprintf diff --git a/libbitdht/src/util/bdthreads.cc b/libbitdht/src/util/bdthreads.cc index b52d152da..942df305f 100644 --- a/libbitdht/src/util/bdthreads.cc +++ b/libbitdht/src/util/bdthreads.cc @@ -1,29 +1,24 @@ -/* - * util/bdthreads.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2004-2010 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 3 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 "bitdht@lunamutt.com". - * - */ - - +/******************************************************************************* + * util/bdthread.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright (C) 2004-2010 Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "bdthreads.h" #include /* for usleep() */ diff --git a/libbitdht/src/util/bdthreads.h b/libbitdht/src/util/bdthreads.h index 23350af18..34c48b1bc 100644 --- a/libbitdht/src/util/bdthreads.h +++ b/libbitdht/src/util/bdthreads.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * util/bdthread.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright (C) 2004-2010 Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef BITDHT_THREADS_H #define BITDHT_THREADS_H -/* - * util/bdthreads.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2004-2010 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 3 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 "bitdht@lunamutt.com". - * - */ - - #include #include #include diff --git a/retroshare.pri b/retroshare.pri index 6b8fdd870..def629360 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -1,3 +1,21 @@ +################################################################################ +# retroshare.pri # +# Copyright (C) 2018, Retroshare team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero 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 Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +################################################################################ + ################################################################################ ## Documented build options (CONFIG) goes here as all the rest depend on them ## ## CONFIG must not be edited in other .pro files, aka if CONFIG need do be ##### From 50b360bf9dc0a5b02434a971f63fca590ae4aa26 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 21 May 2018 20:17:54 +0200 Subject: [PATCH 054/138] added missing license to some libresapi files --- build_scripts/Debian/debian_release_howto.txt | 4 ++ libresapi/src/api/ApiPluginHandler.cpp | 21 ++++++++++ libresapi/src/api/ApiPluginHandler.h | 21 ++++++++++ libresapi/src/api/ApiServer.cpp | 21 ++++++++++ libresapi/src/api/ApiServer.h | 21 ++++++++++ libresapi/src/api/ApiServerLocal.cpp | 38 +++++++++-------- libresapi/src/api/ApiServerLocal.h | 38 +++++++++-------- libresapi/src/api/ApiServerMHD.cpp | 21 ++++++++++ libresapi/src/api/ApiServerMHD.h | 21 ++++++++++ libresapi/src/api/ApiTypes.h | 21 ++++++++++ libresapi/src/api/ChannelsHandler.cpp | 38 +++++++++-------- libresapi/src/api/ChannelsHandler.h | 38 +++++++++-------- libresapi/src/api/ChatHandler.cpp | 40 ++++++++++-------- libresapi/src/api/ChatHandler.h | 22 ++++++++++ libresapi/src/api/FileSearchHandler.cpp | 21 ++++++++++ libresapi/src/api/FileSearchHandler.h | 21 ++++++++++ libresapi/src/api/FileSharingHandler.cpp | 39 ++++++++++-------- libresapi/src/api/FileSharingHandler.h | 39 ++++++++++-------- libresapi/src/api/ForumHandler.cpp | 21 ++++++++++ libresapi/src/api/ForumHandler.h | 21 ++++++++++ libresapi/src/api/GetPluginInterfaces.cpp | 21 ++++++++++ libresapi/src/api/GetPluginInterfaces.h | 21 ++++++++++ libresapi/src/api/GxsResponseTask.cpp | 21 ++++++++++ libresapi/src/api/GxsResponseTask.h | 21 ++++++++++ libresapi/src/api/IdentityHandler.cpp | 41 ++++++++++--------- libresapi/src/api/IdentityHandler.h | 41 ++++++++++--------- libresapi/src/api/JsonStream.cpp | 21 ++++++++++ libresapi/src/api/JsonStream.h | 21 ++++++++++ libresapi/src/api/LivereloadHandler.cpp | 21 ++++++++++ libresapi/src/api/LivereloadHandler.h | 21 ++++++++++ libresapi/src/api/Operators.cpp | 21 ++++++++++ libresapi/src/api/Operators.h | 21 ++++++++++ libresapi/src/api/PeersHandler.cpp | 41 ++++++++++--------- libresapi/src/api/PeersHandler.h | 41 ++++++++++--------- libresapi/src/api/ResourceRouter.cpp | 21 ++++++++++ libresapi/src/api/ResourceRouter.h | 21 ++++++++++ libresapi/src/api/RsControlModule.cpp | 21 ++++++++++ libresapi/src/api/RsControlModule.h | 21 ++++++++++ libresapi/src/api/ServiceControlHandler.cpp | 21 ++++++++++ libresapi/src/api/ServiceControlHandler.h | 21 ++++++++++ libresapi/src/api/SettingsHandler.cpp | 21 ++++++++++ libresapi/src/api/SettingsHandler.h | 21 ++++++++++ libresapi/src/api/StateTokenServer.cpp | 21 ++++++++++ libresapi/src/api/StateTokenServer.h | 21 ++++++++++ libresapi/src/api/StatsHandler.cpp | 21 ++++++++++ libresapi/src/api/StatsHandler.h | 21 ++++++++++ libresapi/src/api/TmpBlobStore.cpp | 21 ++++++++++ libresapi/src/api/TmpBlobStore.h | 21 ++++++++++ libresapi/src/api/TransfersHandler.cpp | 21 ++++++++++ libresapi/src/api/TransfersHandler.h | 21 ++++++++++ libresapi/src/api/json.cpp | 21 ++++++++++ libresapi/src/use_libresapi.pri | 17 ++++++++ libresapi/src/util/ContentTypes.cpp | 21 ++++++++++ libresapi/src/util/ContentTypes.h | 21 ++++++++++ libretroshare/src/use_libretroshare.pri | 21 ++++++++++ openpgpsdk/src/use_openpgpsdk.pri | 21 ++++++++++ 56 files changed, 1161 insertions(+), 198 deletions(-) diff --git a/build_scripts/Debian/debian_release_howto.txt b/build_scripts/Debian/debian_release_howto.txt index a9d06e16e..40415d544 100644 --- a/build_scripts/Debian/debian_release_howto.txt +++ b/build_scripts/Debian/debian_release_howto.txt @@ -137,3 +137,7 @@ Licensing issues: Use a pointer to the top level licence file +Files after switch: + + libresapi/api/json.h MIT license Copyright (c) 2013 Jeff Weinstein (jeff.weinstein at gmail) + diff --git a/libresapi/src/api/ApiPluginHandler.cpp b/libresapi/src/api/ApiPluginHandler.cpp index fe3211eac..304e8e805 100644 --- a/libresapi/src/api/ApiPluginHandler.cpp +++ b/libresapi/src/api/ApiPluginHandler.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/ApiPluginHandler.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "ApiPluginHandler.h" namespace resource_api diff --git a/libresapi/src/api/ApiPluginHandler.h b/libresapi/src/api/ApiPluginHandler.h index ad29922f6..5fa8c8098 100644 --- a/libresapi/src/api/ApiPluginHandler.h +++ b/libresapi/src/api/ApiPluginHandler.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/ApiPluginHandler.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include "ResourceRouter.h" diff --git a/libresapi/src/api/ApiServer.cpp b/libresapi/src/api/ApiServer.cpp index cc78f7eb8..420a8ef05 100644 --- a/libresapi/src/api/ApiServer.cpp +++ b/libresapi/src/api/ApiServer.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/ApiServer.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "ApiServer.h" #include diff --git a/libresapi/src/api/ApiServer.h b/libresapi/src/api/ApiServer.h index 807271eb5..6843d39e7 100644 --- a/libresapi/src/api/ApiServer.h +++ b/libresapi/src/api/ApiServer.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/ApiServer.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libresapi/src/api/ApiServerLocal.cpp b/libresapi/src/api/ApiServerLocal.cpp index e14f85520..e856f2db2 100644 --- a/libresapi/src/api/ApiServerLocal.cpp +++ b/libresapi/src/api/ApiServerLocal.cpp @@ -1,20 +1,24 @@ -/* - * libresapi local socket server - * Copyright (C) 2016 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ +/******************************************************************************* + * libresapi/api/ApiServer.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2016 by Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/libresapi/src/api/ApiServerLocal.h b/libresapi/src/api/ApiServerLocal.h index 1d6c87ae5..c9ef246b8 100644 --- a/libresapi/src/api/ApiServerLocal.h +++ b/libresapi/src/api/ApiServerLocal.h @@ -1,21 +1,25 @@ +/******************************************************************************* + * libresapi/api/ApiServer.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2016 by Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once -/* - * libresapi local socket server - * Copyright (C) 2016 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ #include #include diff --git a/libresapi/src/api/ApiServerMHD.cpp b/libresapi/src/api/ApiServerMHD.cpp index 6b77db59a..83861fe6c 100644 --- a/libresapi/src/api/ApiServerMHD.cpp +++ b/libresapi/src/api/ApiServerMHD.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/ApiServerMHD.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "ApiServerMHD.h" #include diff --git a/libresapi/src/api/ApiServerMHD.h b/libresapi/src/api/ApiServerMHD.h index ec0897c95..9046f0aa7 100644 --- a/libresapi/src/api/ApiServerMHD.h +++ b/libresapi/src/api/ApiServerMHD.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/ApiServerMHD.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libresapi/src/api/ApiTypes.h b/libresapi/src/api/ApiTypes.h index 6d6d5c746..21e1b2132 100644 --- a/libresapi/src/api/ApiTypes.h +++ b/libresapi/src/api/ApiTypes.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/ApiTypes.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libresapi/src/api/ChannelsHandler.cpp b/libresapi/src/api/ChannelsHandler.cpp index 52a3527ac..8b6a306f6 100644 --- a/libresapi/src/api/ChannelsHandler.cpp +++ b/libresapi/src/api/ChannelsHandler.cpp @@ -1,20 +1,24 @@ -/* - * RetroShare JSON API - * Copyright (C) 2018 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ +/******************************************************************************* + * libresapi/api/ChannelsHandler.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "ChannelsHandler.h" diff --git a/libresapi/src/api/ChannelsHandler.h b/libresapi/src/api/ChannelsHandler.h index b40f23b73..f5c027b82 100644 --- a/libresapi/src/api/ChannelsHandler.h +++ b/libresapi/src/api/ChannelsHandler.h @@ -1,21 +1,25 @@ +/******************************************************************************* + * libresapi/api/ChannelsHandler.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once -/* - * RetroShare JSON API - * Copyright (C) 2018 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ #include "ResourceRouter.h" diff --git a/libresapi/src/api/ChatHandler.cpp b/libresapi/src/api/ChatHandler.cpp index f03df69f9..b7917eb19 100644 --- a/libresapi/src/api/ChatHandler.cpp +++ b/libresapi/src/api/ChatHandler.cpp @@ -1,21 +1,25 @@ -/* - * libresapi - * Copyright (C) 2015 electron128 - * Copyright (C) 2017 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ +/******************************************************************************* + * libresapi/api/ChatHandler.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2015 by electron128 * + * Copyright 2017 by Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "ChatHandler.h" #include "Pagination.h" diff --git a/libresapi/src/api/ChatHandler.h b/libresapi/src/api/ChatHandler.h index 4d6104592..d635c02dc 100644 --- a/libresapi/src/api/ChatHandler.h +++ b/libresapi/src/api/ChatHandler.h @@ -1,3 +1,25 @@ +/******************************************************************************* + * libresapi/api/ChatHandler.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2015 by electron128 * + * Copyright 2017 by Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include "ResourceRouter.h" diff --git a/libresapi/src/api/FileSearchHandler.cpp b/libresapi/src/api/FileSearchHandler.cpp index 0382005df..6a322dc97 100644 --- a/libresapi/src/api/FileSearchHandler.cpp +++ b/libresapi/src/api/FileSearchHandler.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/FileSearchHandler.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include "FileSearchHandler.h" diff --git a/libresapi/src/api/FileSearchHandler.h b/libresapi/src/api/FileSearchHandler.h index 5832577b5..d4b3c31cf 100644 --- a/libresapi/src/api/FileSearchHandler.h +++ b/libresapi/src/api/FileSearchHandler.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/FileSearchHandler.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include "ResourceRouter.h" #include "StateTokenServer.h" diff --git a/libresapi/src/api/FileSharingHandler.cpp b/libresapi/src/api/FileSharingHandler.cpp index a6296973d..fbbd172d8 100644 --- a/libresapi/src/api/FileSharingHandler.cpp +++ b/libresapi/src/api/FileSharingHandler.cpp @@ -1,21 +1,24 @@ -/* - * libresapi - * - * Copyright (C) 2017, Konrad Dębiec - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ +/******************************************************************************* + * libresapi/api/FileSharingHandler.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright (C) 2017, Konrad Dębiec * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "FileSharingHandler.h" namespace resource_api diff --git a/libresapi/src/api/FileSharingHandler.h b/libresapi/src/api/FileSharingHandler.h index 0eb67764e..23eeb1f2e 100644 --- a/libresapi/src/api/FileSharingHandler.h +++ b/libresapi/src/api/FileSharingHandler.h @@ -1,21 +1,24 @@ -/* - * libresapi - * - * Copyright (C) 2017, Konrad Dębiec - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ +/******************************************************************************* + * libresapi/api/FileSharingHandler.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright (C) 2017, Konrad Dębiec * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include "ResourceRouter.h" diff --git a/libresapi/src/api/ForumHandler.cpp b/libresapi/src/api/ForumHandler.cpp index fa7562691..fcfe3d942 100644 --- a/libresapi/src/api/ForumHandler.cpp +++ b/libresapi/src/api/ForumHandler.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/ForumHandler.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "ForumHandler.h" #include diff --git a/libresapi/src/api/ForumHandler.h b/libresapi/src/api/ForumHandler.h index e44b19818..39fa0167f 100644 --- a/libresapi/src/api/ForumHandler.h +++ b/libresapi/src/api/ForumHandler.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/ForumHandler.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef FORUMHANDLER_H #define FORUMHANDLER_H diff --git a/libresapi/src/api/GetPluginInterfaces.cpp b/libresapi/src/api/GetPluginInterfaces.cpp index f2bac46b0..f2558a469 100644 --- a/libresapi/src/api/GetPluginInterfaces.cpp +++ b/libresapi/src/api/GetPluginInterfaces.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/GetPluginInterfaces.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GetPluginInterfaces.h" #include diff --git a/libresapi/src/api/GetPluginInterfaces.h b/libresapi/src/api/GetPluginInterfaces.h index 73cca040a..c7f92b263 100644 --- a/libresapi/src/api/GetPluginInterfaces.h +++ b/libresapi/src/api/GetPluginInterfaces.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/GetPluginInterfaces.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once class RsPlugInInterfaces; diff --git a/libresapi/src/api/GxsResponseTask.cpp b/libresapi/src/api/GxsResponseTask.cpp index dcb4ebb51..d1622b798 100644 --- a/libresapi/src/api/GxsResponseTask.cpp +++ b/libresapi/src/api/GxsResponseTask.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/GxsResponseTask.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsResponseTask.h" #include "Operators.h" diff --git a/libresapi/src/api/GxsResponseTask.h b/libresapi/src/api/GxsResponseTask.h index 8200b3eee..69e31d38d 100644 --- a/libresapi/src/api/GxsResponseTask.h +++ b/libresapi/src/api/GxsResponseTask.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/GxsResponseTask.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include "ApiTypes.h" diff --git a/libresapi/src/api/IdentityHandler.cpp b/libresapi/src/api/IdentityHandler.cpp index ff5e50a1e..854dfdb59 100644 --- a/libresapi/src/api/IdentityHandler.cpp +++ b/libresapi/src/api/IdentityHandler.cpp @@ -1,22 +1,25 @@ -/* - * libresapi - * - * Copyright (C) 2015 electron128 - * Copyright (C) 2017 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ +/******************************************************************************* + * libresapi/api/IdentityHandler.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright (C) 2015 electron128 * + * Copyright (C) 2017 Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "IdentityHandler.h" diff --git a/libresapi/src/api/IdentityHandler.h b/libresapi/src/api/IdentityHandler.h index dff974e73..08bc5fbed 100644 --- a/libresapi/src/api/IdentityHandler.h +++ b/libresapi/src/api/IdentityHandler.h @@ -1,23 +1,26 @@ +/******************************************************************************* + * libresapi/api/IdentityHandler.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright (C) 2015 electron128 * + * Copyright (C) 2017 Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once -/* - * libresapi - * - * Copyright (C) 2015 electron128 - * Copyright (C) 2017 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ #include #include diff --git a/libresapi/src/api/JsonStream.cpp b/libresapi/src/api/JsonStream.cpp index bbba2f2c8..9802efe2a 100644 --- a/libresapi/src/api/JsonStream.cpp +++ b/libresapi/src/api/JsonStream.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/jsonStream.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "JsonStream.h" #include diff --git a/libresapi/src/api/JsonStream.h b/libresapi/src/api/JsonStream.h index 25b7d8f93..720b239d2 100644 --- a/libresapi/src/api/JsonStream.h +++ b/libresapi/src/api/JsonStream.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/jsonStream.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include "ApiTypes.h" diff --git a/libresapi/src/api/LivereloadHandler.cpp b/libresapi/src/api/LivereloadHandler.cpp index 1f433754f..e67cc2327 100644 --- a/libresapi/src/api/LivereloadHandler.cpp +++ b/libresapi/src/api/LivereloadHandler.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/LivereloadHarder.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "LivereloadHandler.h" namespace resource_api diff --git a/libresapi/src/api/LivereloadHandler.h b/libresapi/src/api/LivereloadHandler.h index 9d85999e4..e32b206c9 100644 --- a/libresapi/src/api/LivereloadHandler.h +++ b/libresapi/src/api/LivereloadHandler.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/LivereloadHarder.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include "ResourceRouter.h" diff --git a/libresapi/src/api/Operators.cpp b/libresapi/src/api/Operators.cpp index 97dff652d..643b39c7a 100644 --- a/libresapi/src/api/Operators.cpp +++ b/libresapi/src/api/Operators.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/Operators.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "Operators.h" namespace resource_api diff --git a/libresapi/src/api/Operators.h b/libresapi/src/api/Operators.h index 06683cb94..92bed4c16 100644 --- a/libresapi/src/api/Operators.h +++ b/libresapi/src/api/Operators.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/Operators.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libresapi/src/api/PeersHandler.cpp b/libresapi/src/api/PeersHandler.cpp index 66def7eab..e1055dadd 100644 --- a/libresapi/src/api/PeersHandler.cpp +++ b/libresapi/src/api/PeersHandler.cpp @@ -1,22 +1,25 @@ -/* - * libresapi - * - * Copyright (C) 2015 electron128 - * Copyright (C) 2017 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ +/******************************************************************************* + * libresapi/api/PeersHandler.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright (C) 2015 electron128 * + * Copyright (C) 2017 Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "PeersHandler.h" diff --git a/libresapi/src/api/PeersHandler.h b/libresapi/src/api/PeersHandler.h index d15705602..60b92a797 100644 --- a/libresapi/src/api/PeersHandler.h +++ b/libresapi/src/api/PeersHandler.h @@ -1,23 +1,26 @@ +/******************************************************************************* + * libresapi/api/PeersHandler.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright (C) 2015 electron128 * + * Copyright (C) 2017 Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once -/* - * libresapi - * - * Copyright (C) 2015 electron128 - * Copyright (C) 2017 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ #include "ResourceRouter.h" #include "StateTokenServer.h" diff --git a/libresapi/src/api/ResourceRouter.cpp b/libresapi/src/api/ResourceRouter.cpp index 48050cdb6..2c780ec2b 100644 --- a/libresapi/src/api/ResourceRouter.cpp +++ b/libresapi/src/api/ResourceRouter.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/ResourceRouter.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "ResourceRouter.h" diff --git a/libresapi/src/api/ResourceRouter.h b/libresapi/src/api/ResourceRouter.h index 2bb5930a3..53222ac75 100644 --- a/libresapi/src/api/ResourceRouter.h +++ b/libresapi/src/api/ResourceRouter.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/ResourceRouter.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include "ApiTypes.h" diff --git a/libresapi/src/api/RsControlModule.cpp b/libresapi/src/api/RsControlModule.cpp index ebeadf986..1972cf4e1 100644 --- a/libresapi/src/api/RsControlModule.cpp +++ b/libresapi/src/api/RsControlModule.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/RsControlModule.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "RsControlModule.h" #include diff --git a/libresapi/src/api/RsControlModule.h b/libresapi/src/api/RsControlModule.h index e81bb66f1..cb3b7834d 100644 --- a/libresapi/src/api/RsControlModule.h +++ b/libresapi/src/api/RsControlModule.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/RsControlModule.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libresapi/src/api/ServiceControlHandler.cpp b/libresapi/src/api/ServiceControlHandler.cpp index f426f3378..6597d9d43 100644 --- a/libresapi/src/api/ServiceControlHandler.cpp +++ b/libresapi/src/api/ServiceControlHandler.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/ServiceControlHandler.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "ServiceControlHandler.h" #include "retroshare/rsservicecontrol.h" diff --git a/libresapi/src/api/ServiceControlHandler.h b/libresapi/src/api/ServiceControlHandler.h index da1db64e4..5ee9f6250 100644 --- a/libresapi/src/api/ServiceControlHandler.h +++ b/libresapi/src/api/ServiceControlHandler.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/ServiceControlHandler.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include "ApiTypes.h" diff --git a/libresapi/src/api/SettingsHandler.cpp b/libresapi/src/api/SettingsHandler.cpp index 6e1aa75da..64a4d4997 100644 --- a/libresapi/src/api/SettingsHandler.cpp +++ b/libresapi/src/api/SettingsHandler.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/SettingsHandler.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "SettingsHandler.h" #include diff --git a/libresapi/src/api/SettingsHandler.h b/libresapi/src/api/SettingsHandler.h index b4c21fae2..6d7b040e8 100644 --- a/libresapi/src/api/SettingsHandler.h +++ b/libresapi/src/api/SettingsHandler.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/SettingsHandler.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef SETTINGSHANDLER_H #define SETTINGSHANDLER_H diff --git a/libresapi/src/api/StateTokenServer.cpp b/libresapi/src/api/StateTokenServer.cpp index 6c113cdae..7bd77a41f 100644 --- a/libresapi/src/api/StateTokenServer.cpp +++ b/libresapi/src/api/StateTokenServer.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/StateTokenServer.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "StateTokenServer.h" #include diff --git a/libresapi/src/api/StateTokenServer.h b/libresapi/src/api/StateTokenServer.h index 8b80b9350..17900de8e 100644 --- a/libresapi/src/api/StateTokenServer.h +++ b/libresapi/src/api/StateTokenServer.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/StateTokenServer.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libresapi/src/api/StatsHandler.cpp b/libresapi/src/api/StatsHandler.cpp index 46bf600d4..49ce23487 100644 --- a/libresapi/src/api/StatsHandler.cpp +++ b/libresapi/src/api/StatsHandler.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/StatsHandler.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "StatsHandler.h" #include "Operators.h" diff --git a/libresapi/src/api/StatsHandler.h b/libresapi/src/api/StatsHandler.h index cbe8ae231..0b6d65009 100644 --- a/libresapi/src/api/StatsHandler.h +++ b/libresapi/src/api/StatsHandler.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/StatsHandler.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef STATSHANDLER_H #define STATSHANDLER_H diff --git a/libresapi/src/api/TmpBlobStore.cpp b/libresapi/src/api/TmpBlobStore.cpp index c179b6830..098f02e39 100644 --- a/libresapi/src/api/TmpBlobStore.cpp +++ b/libresapi/src/api/TmpBlobStore.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/TmpBLogStore.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "TmpBlobStore.h" #include diff --git a/libresapi/src/api/TmpBlobStore.h b/libresapi/src/api/TmpBlobStore.h index 1cf439b85..18ec6917b 100644 --- a/libresapi/src/api/TmpBlobStore.h +++ b/libresapi/src/api/TmpBlobStore.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/TmpBLogStore.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include "StateTokenServer.h" diff --git a/libresapi/src/api/TransfersHandler.cpp b/libresapi/src/api/TransfersHandler.cpp index c696411da..9ee4688df 100644 --- a/libresapi/src/api/TransfersHandler.cpp +++ b/libresapi/src/api/TransfersHandler.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/TransfersHandler.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "TransfersHandler.h" #include "Operators.h" #include diff --git a/libresapi/src/api/TransfersHandler.h b/libresapi/src/api/TransfersHandler.h index 7d07a7198..67deca276 100644 --- a/libresapi/src/api/TransfersHandler.h +++ b/libresapi/src/api/TransfersHandler.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/TransfersHandler.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include "ResourceRouter.h" diff --git a/libresapi/src/api/json.cpp b/libresapi/src/api/json.cpp index 2bcec7e81..103ad9b67 100644 --- a/libresapi/src/api/json.cpp +++ b/libresapi/src/api/json.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/api/json.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #define nullptr 0 #include "json.h" diff --git a/libresapi/src/use_libresapi.pri b/libresapi/src/use_libresapi.pri index e9b1753a2..963f5ceb4 100644 --- a/libresapi/src/use_libresapi.pri +++ b/libresapi/src/use_libresapi.pri @@ -1,3 +1,20 @@ +################################################################################ +# uselibresapi.pri # +# Copyright (C) 2018, Retroshare team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero 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 Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +################################################################################ DEPENDPATH *= $$system_path($$clean_path($$PWD/../../libresapi/src)) INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../libresapi/src)) LIBS *= -L$$system_path($$clean_path($${OUT_PWD}/../../libresapi/src/lib/)) -lresapi diff --git a/libresapi/src/util/ContentTypes.cpp b/libresapi/src/util/ContentTypes.cpp index 30434e093..3d026932b 100644 --- a/libresapi/src/util/ContentTypes.cpp +++ b/libresapi/src/util/ContentTypes.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/util/ContentTypes.cpp * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "ContentTypes.h" #include #include diff --git a/libresapi/src/util/ContentTypes.h b/libresapi/src/util/ContentTypes.h index 0e6b71e73..269383bae 100644 --- a/libresapi/src/util/ContentTypes.h +++ b/libresapi/src/util/ContentTypes.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libresapi/util/ContentTypes.h * + * * + * LibResAPI: API for local socket server * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef CONTENTTYPES_H #define CONTENTTYPES_H diff --git a/libretroshare/src/use_libretroshare.pri b/libretroshare/src/use_libretroshare.pri index d17e36739..4d4e00061 100644 --- a/libretroshare/src/use_libretroshare.pri +++ b/libretroshare/src/use_libretroshare.pri @@ -1,3 +1,24 @@ +################################################################################ +# uselibretroshare.pri # +# Copyright (C) 2018, Retroshare team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero 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 Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +################################################################################ +DEPENDPATH *= $$system_path($$clean_path($$PWD/../../libresapi/src)) +INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../libresapi/src)) +LIBS *= -L$$system_path($$clean_path($${OUT_PWD}/../../libresapi/src/lib/)) -lresapi + DEPENDPATH *= $$system_path($$clean_path($${PWD}/../../libretroshare/src/)) INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../libretroshare/src)) LIBS *= -L$$system_path($$clean_path($${OUT_PWD}/../../libretroshare/src/lib/)) -lretroshare diff --git a/openpgpsdk/src/use_openpgpsdk.pri b/openpgpsdk/src/use_openpgpsdk.pri index adf10f1ca..0e776f5b4 100644 --- a/openpgpsdk/src/use_openpgpsdk.pri +++ b/openpgpsdk/src/use_openpgpsdk.pri @@ -1,3 +1,24 @@ +################################################################################ +# use_openpgpsdk.pri # +# Copyright (C) 2018, Retroshare team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero 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 Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +################################################################################ +DEPENDPATH *= $$system_path($$clean_path($$PWD/../../libresapi/src)) +INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../libresapi/src)) +LIBS *= -L$$system_path($$clean_path($${OUT_PWD}/../../libresapi/src/lib/)) -lresapi + DEPENDPATH *= $$system_path($$clean_path($${PWD}/../../openpgpsdk/src)) INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../openpgpsdk/src)) LIBS *= -L$$system_path($$clean_path($${OUT_PWD}/../../openpgpsdk/src/lib/)) -lops From 544b4af4c23da1c73aaef3ad357975e30562a00f Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 21 May 2018 20:50:38 +0200 Subject: [PATCH 055/138] fixed license in chat, crypto, dht, file_sharing --- libresapi/src/libresapi.pro | 17 +++++++ libretroshare/src/chat/distantchat.cc | 46 ++++++++--------- libretroshare/src/chat/distantchat.h | 45 ++++++++--------- libretroshare/src/chat/distributedchat.cc | 45 ++++++++--------- libretroshare/src/chat/distributedchat.h | 45 ++++++++--------- libretroshare/src/chat/p3chatservice.cc | 46 +++++++++-------- libretroshare/src/chat/p3chatservice.h | 46 ++++++++--------- libretroshare/src/chat/rschatitems.cc | 46 ++++++++--------- libretroshare/src/chat/rschatitems.h | 45 ++++++++--------- libretroshare/src/crypto/chacha20.cpp | 45 ++++++++--------- libretroshare/src/crypto/chacha20.h | 45 ++++++++--------- libretroshare/src/crypto/hashstream.cc | 21 ++++++++ libretroshare/src/crypto/hashstream.h | 21 ++++++++ libretroshare/src/dht/connectstatebox.cc | 45 ++++++++--------- libretroshare/src/dht/connectstatebox.h | 46 ++++++++--------- libretroshare/src/dht/p3bitdht.cc | 45 ++++++++--------- libretroshare/src/dht/p3bitdht.h | 46 ++++++++--------- libretroshare/src/dht/p3bitdht_interface.cc | 45 ++++++++--------- libretroshare/src/dht/p3bitdht_peernet.cc | 21 ++++++++ libretroshare/src/dht/p3bitdht_peers.cc | 49 +++++++++---------- libretroshare/src/dht/p3bitdht_relay.cc | 45 ++++++++--------- libretroshare/src/dht/stunaddrassist.h | 46 ++++++++--------- .../src/file_sharing/dir_hierarchy.cc | 45 ++++++++--------- .../src/file_sharing/dir_hierarchy.h | 47 ++++++++---------- .../src/file_sharing/directory_storage.cc | 45 ++++++++--------- .../src/file_sharing/directory_storage.h | 46 ++++++++--------- .../src/file_sharing/directory_updater.cc | 45 ++++++++--------- .../src/file_sharing/directory_updater.h | 46 ++++++++--------- libretroshare/src/file_sharing/file_tree.cc | 21 ++++++++ libretroshare/src/file_sharing/file_tree.h | 46 ++++++++--------- libretroshare/src/file_sharing/filelist_io.cc | 46 ++++++++--------- libretroshare/src/file_sharing/filelist_io.h | 47 ++++++++---------- libretroshare/src/file_sharing/hash_cache.cc | 45 ++++++++--------- libretroshare/src/file_sharing/hash_cache.h | 45 ++++++++--------- libretroshare/src/file_sharing/p3filelists.cc | 45 ++++++++--------- libretroshare/src/file_sharing/p3filelists.h | 46 ++++++++--------- .../src/file_sharing/rsfilelistitems.cc | 45 ++++++++--------- .../src/file_sharing/rsfilelistitems.h | 45 ++++++++--------- libretroshare/src/libretroshare.pro | 21 ++++++++ 39 files changed, 817 insertions(+), 810 deletions(-) diff --git a/libresapi/src/libresapi.pro b/libresapi/src/libresapi.pro index 885d430f5..f75ffc2c4 100644 --- a/libresapi/src/libresapi.pro +++ b/libresapi/src/libresapi.pro @@ -1,3 +1,20 @@ +################################################################################ +# libresapi.pro # +# Copyright (C) 2018, Retroshare team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero 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 Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +################################################################################ !include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri") TEMPLATE = lib diff --git a/libretroshare/src/chat/distantchat.cc b/libretroshare/src/chat/distantchat.cc index c9999c56d..a6ba359e2 100644 --- a/libretroshare/src/chat/distantchat.cc +++ b/libretroshare/src/chat/distantchat.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/chat: distantchat.cc - * - * Services for RetroShare. - * - * Copyright 2014 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/chat: distantchat.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/libretroshare/src/chat/distantchat.h b/libretroshare/src/chat/distantchat.h index b177e6029..25896c4b8 100644 --- a/libretroshare/src/chat/distantchat.h +++ b/libretroshare/src/chat/distantchat.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/chat: distantchat.h - * - * Services for RetroShare. - * - * Copyright 2014 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ +/******************************************************************************* + * libretroshare/src/chat: distantchat.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once diff --git a/libretroshare/src/chat/distributedchat.cc b/libretroshare/src/chat/distributedchat.cc index 00fcd3a97..fce60a65a 100644 --- a/libretroshare/src/chat/distributedchat.cc +++ b/libretroshare/src/chat/distributedchat.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/chat: distributedchat.cc - * - * Services for RetroShare. - * - * Copyright 2014 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ +/******************************************************************************* + * libretroshare/src/chat: distributedchat.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/libretroshare/src/chat/distributedchat.h b/libretroshare/src/chat/distributedchat.h index ca7155dd2..69168ce01 100644 --- a/libretroshare/src/chat/distributedchat.h +++ b/libretroshare/src/chat/distributedchat.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/chat/distributedchat.h - * - * Services for RetroShare. - * - * Copyright 2014 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ +/******************************************************************************* + * libretroshare/src/chat: distributedchat.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/chat/p3chatservice.cc b/libretroshare/src/chat/p3chatservice.cc index 9b34460e7..71edc4898 100644 --- a/libretroshare/src/chat/p3chatservice.cc +++ b/libretroshare/src/chat/p3chatservice.cc @@ -1,27 +1,25 @@ -/* - * "$Id: p3ChatService.cc,v 1.24 2007-05-05 16:10:06 rmf24 Exp $" - * - * Other Bits for RetroShare. - * - * 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/chat: chatservice.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include #include diff --git a/libretroshare/src/chat/p3chatservice.h b/libretroshare/src/chat/p3chatservice.h index bcd0af977..e6b66ec35 100644 --- a/libretroshare/src/chat/p3chatservice.h +++ b/libretroshare/src/chat/p3chatservice.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services chatservice.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". - * - */ - +/******************************************************************************* + * libretroshare/src/chat: chatservice.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef SERVICE_CHAT_HEADER #define SERVICE_CHAT_HEADER diff --git a/libretroshare/src/chat/rschatitems.cc b/libretroshare/src/chat/rschatitems.cc index 7ae680105..17bfce1ec 100644 --- a/libretroshare/src/chat/rschatitems.cc +++ b/libretroshare/src/chat/rschatitems.cc @@ -1,28 +1,24 @@ - -/* - * libretroshare/src/serialiser: rsbaseitems.cc - * - * RetroShare Serialiser. - * - * 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/chat: rschatitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/libretroshare/src/chat/rschatitems.h b/libretroshare/src/chat/rschatitems.h index 8ea4189f4..064044f1a 100644 --- a/libretroshare/src/chat/rschatitems.h +++ b/libretroshare/src/chat/rschatitems.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/serialiser: rschatitems.h - * - * RetroShare Serialiser. - * - * 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/chat: rschatitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once diff --git a/libretroshare/src/crypto/chacha20.cpp b/libretroshare/src/crypto/chacha20.cpp index 3f12b2086..228162622 100644 --- a/libretroshare/src/crypto/chacha20.cpp +++ b/libretroshare/src/crypto/chacha20.cpp @@ -1,27 +1,24 @@ -/* - * RetroShare C++ File sharing default variables - * - * file_sharing/file_sharing_defaults.h - * - * Copyright 2016 by Mr.Alice - * - * 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.project@gmail.com". - * - */ +/******************************************************************************* + * libretroshare/src/crypto: chacha20.cpp * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include #include diff --git a/libretroshare/src/crypto/chacha20.h b/libretroshare/src/crypto/chacha20.h index ffce04605..1ecf05411 100644 --- a/libretroshare/src/crypto/chacha20.h +++ b/libretroshare/src/crypto/chacha20.h @@ -1,27 +1,24 @@ -/* - * RetroShare C++ File sharing default variables - * - * crypto/chacha20.h - * - * Copyright 2016 by Mr.Alice - * - * 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.project@gmail.com". - * - */ +/******************************************************************************* + * libretroshare/src/crypto: chacha20.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/libretroshare/src/crypto/hashstream.cc b/libretroshare/src/crypto/hashstream.cc index 3f97cef7b..22bb64059 100644 --- a/libretroshare/src/crypto/hashstream.cc +++ b/libretroshare/src/crypto/hashstream.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/crypto: hashstream.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "hashstream.h" #include diff --git a/libretroshare/src/crypto/hashstream.h b/libretroshare/src/crypto/hashstream.h index c73c7367c..5714b6816 100644 --- a/libretroshare/src/crypto/hashstream.h +++ b/libretroshare/src/crypto/hashstream.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/crypto: hashstream.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/dht/connectstatebox.cc b/libretroshare/src/dht/connectstatebox.cc index ca631687d..7ca107fa9 100644 --- a/libretroshare/src/dht/connectstatebox.cc +++ b/libretroshare/src/dht/connectstatebox.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/dht: connectstatebox.cc - * - * RetroShare DHT 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/dht: connectstatebox.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "dht/connectstatebox.h" #include "retroshare/rsconfig.h" diff --git a/libretroshare/src/dht/connectstatebox.h b/libretroshare/src/dht/connectstatebox.h index 178dcd00d..5eac8b6c8 100644 --- a/libretroshare/src/dht/connectstatebox.h +++ b/libretroshare/src/dht/connectstatebox.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/dht: connectstatebox.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef CONNECT_STATUS_BOX_H #define CONNECT_STATUS_BOX_H -/* - * libretroshare/src/dht: connectstatebox.h - * - * RetroShare DHT 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". - * - */ - /* a connect state box */ #define CSB_START 1 diff --git a/libretroshare/src/dht/p3bitdht.cc b/libretroshare/src/dht/p3bitdht.cc index 4cb4aa973..b7320c0ac 100644 --- a/libretroshare/src/dht/p3bitdht.cc +++ b/libretroshare/src/dht/p3bitdht.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/dht: p3bitdht.h - * - * BitDht interface for RetroShare. - * - * Copyright 2009-2010 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/dht: p3bitdht.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2009-2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/libretroshare/src/dht/p3bitdht.h b/libretroshare/src/dht/p3bitdht.h index 92c2e626d..09fcd7263 100644 --- a/libretroshare/src/dht/p3bitdht.h +++ b/libretroshare/src/dht/p3bitdht.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/dht: p3bitdht.h - * - * BitDht interface for RetroShare. - * - * Copyright 2009-2010 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/dht: p3bitdht.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2009-2010 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef MRK_P3_BITDHT_H #define MRK_P3_BITDHT_H diff --git a/libretroshare/src/dht/p3bitdht_interface.cc b/libretroshare/src/dht/p3bitdht_interface.cc index e82758964..1b7ff35f5 100644 --- a/libretroshare/src/dht/p3bitdht_interface.cc +++ b/libretroshare/src/dht/p3bitdht_interface.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/dht: p3bitdht.h - * - * BitDht interface for RetroShare. - * - * Copyright 2009-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/dht: p3bitdht_interface.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2009-2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "util/rsnet.h" #include "dht/p3bitdht.h" diff --git a/libretroshare/src/dht/p3bitdht_peernet.cc b/libretroshare/src/dht/p3bitdht_peernet.cc index 3f37f8793..4be52dfa5 100644 --- a/libretroshare/src/dht/p3bitdht_peernet.cc +++ b/libretroshare/src/dht/p3bitdht_peernet.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/dht: p3bitdht_peernet.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2009-2011 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "dht/p3bitdht.h" diff --git a/libretroshare/src/dht/p3bitdht_peers.cc b/libretroshare/src/dht/p3bitdht_peers.cc index cf2d2af97..950b1bfd8 100644 --- a/libretroshare/src/dht/p3bitdht_peers.cc +++ b/libretroshare/src/dht/p3bitdht_peers.cc @@ -1,30 +1,25 @@ -/* - * libretroshare/src/dht: p3bitdht.h - * - * BitDht interface for RetroShare. - * - * Copyright 2009-2010 by Robert Fernie. - * Copyright (C) 2015-2018 Gioacchino Mazzurco - * - * 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/dht: p3bitdht_peernet.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2009-2010 by Robert Fernie. * + * Copyright (C) 2015-2018 Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "dht/p3bitdht.h" #include "bitdht/bdstddht.h" diff --git a/libretroshare/src/dht/p3bitdht_relay.cc b/libretroshare/src/dht/p3bitdht_relay.cc index d846e7691..8939da5c7 100644 --- a/libretroshare/src/dht/p3bitdht_relay.cc +++ b/libretroshare/src/dht/p3bitdht_relay.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/dht: p3bitdht.h - * - * BitDht interface for RetroShare. - * - * Copyright 2009-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/dht: p3bitdht_relay.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2009-2011 by Robert Fernie. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #include "util/rsnet.h" #include "dht/p3bitdht.h" diff --git a/libretroshare/src/dht/stunaddrassist.h b/libretroshare/src/dht/stunaddrassist.h index 1df0bfabc..e12f64f73 100644 --- a/libretroshare/src/dht/stunaddrassist.h +++ b/libretroshare/src/dht/stunaddrassist.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/dht: stunaddrassist.h - * - * BitDht interface for RetroShare. - * - * 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/dht: stunaddrassist.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2011 by Robert Fernie. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #ifndef STUN_ADDR_ASSIST_H #define STUN_ADDR_ASSIST_H diff --git a/libretroshare/src/file_sharing/dir_hierarchy.cc b/libretroshare/src/file_sharing/dir_hierarchy.cc index c2b7baa44..46ddd0164 100644 --- a/libretroshare/src/file_sharing/dir_hierarchy.cc +++ b/libretroshare/src/file_sharing/dir_hierarchy.cc @@ -1,27 +1,24 @@ -/* - * RetroShare Internal directory storage class. - * - * file_sharing/dir_hierarchy.cc - * - * Copyright 2016 Mr.Alice - * - * 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.project@gmail.com". - * - */ +/******************************************************************************* + * libretroshare/src/file_sharing: dir_hierarchy.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #include #include #include diff --git a/libretroshare/src/file_sharing/dir_hierarchy.h b/libretroshare/src/file_sharing/dir_hierarchy.h index 0eeda5e6f..30b30760e 100644 --- a/libretroshare/src/file_sharing/dir_hierarchy.h +++ b/libretroshare/src/file_sharing/dir_hierarchy.h @@ -1,29 +1,24 @@ -/* - * RetroShare C++ Internal directory hierarchy class. - * - * file_sharing/dir_hierarchy.h - * - * Copyright 2016 by Mr.Alice - * - * 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.project@gmail.com". - * - */ - - +/******************************************************************************* + * libretroshare/src/file_sharing: dir_hierarchy.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/file_sharing/directory_storage.cc b/libretroshare/src/file_sharing/directory_storage.cc index d39401e06..abcd4cc00 100644 --- a/libretroshare/src/file_sharing/directory_storage.cc +++ b/libretroshare/src/file_sharing/directory_storage.cc @@ -1,27 +1,24 @@ -/* - * RetroShare File list storage system. - * - * file_sharing/directory_storage.cc - * - * Copyright 2016 Mr.Alice - * - * 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.project@gmail.com". - * - */ +/******************************************************************************* + * libretroshare/src/file_sharing: directory_storage.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #include #include #include "serialiser/rstlvbinary.h" diff --git a/libretroshare/src/file_sharing/directory_storage.h b/libretroshare/src/file_sharing/directory_storage.h index 22377bb0b..51f3edabe 100644 --- a/libretroshare/src/file_sharing/directory_storage.h +++ b/libretroshare/src/file_sharing/directory_storage.h @@ -1,28 +1,24 @@ -/* - * RetroShare C++ Directory Storage system. - * - * file_sharing/directory_storage.h - * - * Copyright 2016 by Mr.Alice - * - * 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.project@gmail.com". - * - */ - +/******************************************************************************* + * libretroshare/src/file_sharing: directory_storage.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/file_sharing/directory_updater.cc b/libretroshare/src/file_sharing/directory_updater.cc index dffef92c7..ba600224b 100644 --- a/libretroshare/src/file_sharing/directory_updater.cc +++ b/libretroshare/src/file_sharing/directory_updater.cc @@ -1,27 +1,24 @@ -/* - * RetroShare Directory watching system. - * - * file_sharing/directory_updater.cc - * - * Copyright 2016 Mr.Alice - * - * 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.project@gmail.com". - * - */ +/******************************************************************************* + * libretroshare/src/file_sharing: directory_updater.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #include "util/folderiterator.h" #include "util/rstime.h" #include "rsserver/p3face.h" diff --git a/libretroshare/src/file_sharing/directory_updater.h b/libretroshare/src/file_sharing/directory_updater.h index 4c6e05649..e518ee80c 100644 --- a/libretroshare/src/file_sharing/directory_updater.h +++ b/libretroshare/src/file_sharing/directory_updater.h @@ -1,28 +1,24 @@ -/* - * RetroShare C++ Directory parsing code. - * - * file_sharing/directory_updater.h - * - * Copyright 2016 by Mr.Alice - * - * 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.project@gmail.com". - * - */ - +/******************************************************************************* + * libretroshare/src/file_sharing: directory_updater.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ // This class crawls the given directry hierarchy and updates it. It does so by calling the // shared file list source. This source may be of two types: diff --git a/libretroshare/src/file_sharing/file_tree.cc b/libretroshare/src/file_sharing/file_tree.cc index 92ee6a362..76ce41651 100644 --- a/libretroshare/src/file_sharing/file_tree.cc +++ b/libretroshare/src/file_sharing/file_tree.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/file_sharing: file_tree.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #include #include #include diff --git a/libretroshare/src/file_sharing/file_tree.h b/libretroshare/src/file_sharing/file_tree.h index 0505ceed5..37f64c776 100644 --- a/libretroshare/src/file_sharing/file_tree.h +++ b/libretroshare/src/file_sharing/file_tree.h @@ -1,28 +1,24 @@ -/* - * RetroShare C++ File lists IO methods. - * - * file_sharing/file_tree.h - * - * Copyright 2017 by csoler - * - * 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.project@gmail.com". - * - */ - +/******************************************************************************* + * libretroshare/src/file_sharing: file_tree.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #include "retroshare/rsfiles.h" class FileTreeImpl: public FileTree diff --git a/libretroshare/src/file_sharing/filelist_io.cc b/libretroshare/src/file_sharing/filelist_io.cc index 15d4d1b53..51cec3c92 100644 --- a/libretroshare/src/file_sharing/filelist_io.cc +++ b/libretroshare/src/file_sharing/filelist_io.cc @@ -1,28 +1,24 @@ -/* - * RetroShare File lists IO methods. - * - * file_sharing/filelist_io.h - * - * Copyright 2016 Mr.Alice - * - * 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.project@gmail.com". - * - */ - +/******************************************************************************* + * libretroshare/src/file_sharing: filelist_io.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #include #include "retroshare/rsids.h" #include "pqi/authssl.h" diff --git a/libretroshare/src/file_sharing/filelist_io.h b/libretroshare/src/file_sharing/filelist_io.h index 8eccd6b27..bda8e089a 100644 --- a/libretroshare/src/file_sharing/filelist_io.h +++ b/libretroshare/src/file_sharing/filelist_io.h @@ -1,29 +1,24 @@ -/* - * RetroShare C++ File lists IO methods. - * - * file_sharing/filelist_io.h - * - * Copyright 2016 by Mr.Alice - * - * 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.project@gmail.com". - * - */ - - +/******************************************************************************* + * libretroshare/src/file_sharing: filelist_io.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/file_sharing/hash_cache.cc b/libretroshare/src/file_sharing/hash_cache.cc index f0db680cf..8db7b3ed4 100644 --- a/libretroshare/src/file_sharing/hash_cache.cc +++ b/libretroshare/src/file_sharing/hash_cache.cc @@ -1,27 +1,24 @@ -/* - * RetroShare Hash cache - * - * file_sharing/hash_cache.cc - * - * Copyright 2016 Mr.Alice - * - * 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.project@gmail.com". - * - */ +/******************************************************************************* + * libretroshare/src/file_sharing: hash_cache.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #include "util/rsdir.h" #include "util/rsprint.h" #include "util/rstime.h" diff --git a/libretroshare/src/file_sharing/hash_cache.h b/libretroshare/src/file_sharing/hash_cache.h index 05dcbd9c3..de4b32943 100644 --- a/libretroshare/src/file_sharing/hash_cache.h +++ b/libretroshare/src/file_sharing/hash_cache.h @@ -1,27 +1,24 @@ -/* - * RetroShare C++ Hash cache. - * - * file_sharing/hash_cache.h - * - * Copyright 2016 by Mr.Alice - * - * 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.project@gmail.com". - * - */ +/******************************************************************************* + * libretroshare/src/file_sharing: hash_cache.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #pragma once diff --git a/libretroshare/src/file_sharing/p3filelists.cc b/libretroshare/src/file_sharing/p3filelists.cc index 3eaaa9d03..01ae6034e 100644 --- a/libretroshare/src/file_sharing/p3filelists.cc +++ b/libretroshare/src/file_sharing/p3filelists.cc @@ -1,27 +1,24 @@ -/* - * RetroShare File lists service. - * - * file_sharing/p3filelists.cc - * - * Copyright 2016 Mr.Alice - * - * 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.project@gmail.com". - * - */ +/******************************************************************************* + * libretroshare/src/file_sharing: p3filelists.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #include "rsitems/rsserviceids.h" #include "file_sharing/p3filelists.h" diff --git a/libretroshare/src/file_sharing/p3filelists.h b/libretroshare/src/file_sharing/p3filelists.h index 4de5e24b3..e285a4e23 100644 --- a/libretroshare/src/file_sharing/p3filelists.h +++ b/libretroshare/src/file_sharing/p3filelists.h @@ -1,28 +1,24 @@ -/* - * RetroShare C++ File lists service. - * - * file_sharing/p3filelists.h - * - * Copyright 2016 by Mr.Alice - * - * 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.project@gmail.com". - * - */ - +/******************************************************************************* + * libretroshare/src/file_sharing: p3filelists.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ // // This class is responsible for diff --git a/libretroshare/src/file_sharing/rsfilelistitems.cc b/libretroshare/src/file_sharing/rsfilelistitems.cc index 7d91549d4..77628777c 100644 --- a/libretroshare/src/file_sharing/rsfilelistitems.cc +++ b/libretroshare/src/file_sharing/rsfilelistitems.cc @@ -1,27 +1,24 @@ -/* - * RetroShare File lists service items - * - * file_sharing/rsfilelistsitems.cc - * - * Copyright 2016 Mr.Alice - * - * 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.project@gmail.com". - * - */ +/******************************************************************************* + * libretroshare/src/file_sharing: rsfilelistsitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #include "serialiser/rsbaseserial.h" #include "serialiser/rstypeserializer.h" diff --git a/libretroshare/src/file_sharing/rsfilelistitems.h b/libretroshare/src/file_sharing/rsfilelistitems.h index 2f04a84a5..eaadaf7bd 100644 --- a/libretroshare/src/file_sharing/rsfilelistitems.h +++ b/libretroshare/src/file_sharing/rsfilelistitems.h @@ -1,27 +1,24 @@ -/* - * RetroShare File lists service items. - * - * file_sharing/rsfilelistitems.h - * - * Copyright 2016 Mr.Alice - * - * 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.project@gmail.com". - * - */ +/******************************************************************************* + * libretroshare/src/file_sharing: rsfilelistsitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 by Mr.Alice * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index e401ed8ee..3e5ead553 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -1,3 +1,24 @@ +################################################################################ +# libretroshare.pro # +# Copyright (C) 2018, Retroshare team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero 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 Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +################################################################################ +!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri") + +TEMPLATE = lib +CONFIG += staticlib !include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri") TEMPLATE = lib From d5627d4b22f406872186db5f521604b0c1057e61 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 22 May 2018 22:03:11 +0200 Subject: [PATCH 056/138] fixed license in ft, grouter, and gxs --- libretroshare/src/ft/ftchunkmap.cc | 45 ++++++++--------- libretroshare/src/ft/ftchunkmap.h | 22 +++++++++ libretroshare/src/ft/ftcontroller.cc | 45 ++++++++--------- libretroshare/src/ft/ftcontroller.h | 45 ++++++++--------- libretroshare/src/ft/ftdatamultiplex.cc | 45 ++++++++--------- libretroshare/src/ft/ftdatamultiplex.h | 45 ++++++++--------- libretroshare/src/ft/ftextralist.cc | 45 ++++++++--------- libretroshare/src/ft/ftextralist.h | 45 ++++++++--------- libretroshare/src/ft/ftfilecreator.cc | 21 ++++++++ libretroshare/src/ft/ftfilecreator.h | 45 ++++++++--------- libretroshare/src/ft/ftfileprovider.cc | 21 ++++++++ libretroshare/src/ft/ftfileprovider.h | 45 ++++++++--------- libretroshare/src/ft/ftfilesearch.cc | 46 ++++++++---------- libretroshare/src/ft/ftfilesearch.h | 45 ++++++++--------- libretroshare/src/ft/ftserver.cc | 45 ++++++++--------- libretroshare/src/ft/ftserver.h | 45 ++++++++--------- libretroshare/src/ft/fttransfermodule.cc | 46 ++++++++---------- libretroshare/src/ft/fttransfermodule.h | 44 ++++++++--------- .../src/ft/ftturtlefiletransferitem.cc | 46 ++++++++---------- .../src/ft/ftturtlefiletransferitem.h | 46 ++++++++---------- libretroshare/src/grouter/groutercache.h | 46 ++++++++---------- libretroshare/src/grouter/grouteritems.cc | 21 ++++++++ libretroshare/src/grouter/grouteritems.h | 46 ++++++++---------- libretroshare/src/grouter/groutertypes.h | 46 ++++++++---------- libretroshare/src/grouter/p3grouter.cc | 45 ++++++++--------- libretroshare/src/grouter/p3grouter.h | 46 ++++++++---------- libretroshare/src/gxs/gxssecurity.cc | 48 +++++++++---------- libretroshare/src/gxs/gxssecurity.h | 48 +++++++++---------- libretroshare/src/gxs/gxstokenqueue.cc | 46 ++++++++---------- libretroshare/src/gxs/gxstokenqueue.h | 45 ++++++++--------- libretroshare/src/gxs/rsdataservice.cc | 46 ++++++++---------- libretroshare/src/gxs/rsdataservice.h | 46 ++++++++---------- libretroshare/src/gxs/rsgds.h | 46 ++++++++---------- libretroshare/src/gxs/rsgenexchange.cc | 47 ++++++++---------- libretroshare/src/gxs/rsgenexchange.h | 46 ++++++++---------- libretroshare/src/gxs/rsgixs.h | 46 ++++++++---------- libretroshare/src/gxs/rsgxs.h | 45 ++++++++--------- libretroshare/src/gxs/rsgxsdata.cc | 46 ++++++++---------- libretroshare/src/gxs/rsgxsdata.h | 46 ++++++++---------- libretroshare/src/gxs/rsgxsdataaccess.cc | 45 ++++++++--------- libretroshare/src/gxs/rsgxsdataaccess.h | 46 ++++++++---------- libretroshare/src/gxs/rsgxsnetservice.cc | 45 ++++++++--------- libretroshare/src/gxs/rsgxsnetservice.h | 46 ++++++++---------- libretroshare/src/gxs/rsgxsnetutils.cc | 45 ++++++++--------- libretroshare/src/gxs/rsgxsnetutils.h | 45 ++++++++--------- libretroshare/src/gxs/rsgxsrequesttypes.cc | 45 ++++++++--------- libretroshare/src/gxs/rsgxsrequesttypes.h | 46 ++++++++---------- libretroshare/src/gxs/rsgxsutil.cc | 46 ++++++++---------- libretroshare/src/gxs/rsgxsutil.h | 45 ++++++++--------- libretroshare/src/gxs/rsnxsobserver.h | 46 ++++++++---------- 50 files changed, 1053 insertions(+), 1130 deletions(-) diff --git a/libretroshare/src/ft/ftchunkmap.cc b/libretroshare/src/ft/ftchunkmap.cc index 64411ac58..b7630ccb2 100644 --- a/libretroshare/src/ft/ftchunkmap.cc +++ b/libretroshare/src/ft/ftchunkmap.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/ft: ftdata.cc - * - * File Transfer for RetroShare. - * - * Copyright 2010 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ +/******************************************************************************* + * libretroshare/src/ft: ftchunkmap.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2010 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ /******** * #define DEBUG_FTCHUNK 1 diff --git a/libretroshare/src/ft/ftchunkmap.h b/libretroshare/src/ft/ftchunkmap.h index f7c696b9a..f6364596c 100644 --- a/libretroshare/src/ft/ftchunkmap.h +++ b/libretroshare/src/ft/ftchunkmap.h @@ -1,3 +1,25 @@ +/******************************************************************************* + * libretroshare/src/ft: ftchunkmap.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2010 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + ******************************************************************************/ + #pragma once #include diff --git a/libretroshare/src/ft/ftcontroller.cc b/libretroshare/src/ft/ftcontroller.cc index 9abec040f..c80712d23 100644 --- a/libretroshare/src/ft/ftcontroller.cc +++ b/libretroshare/src/ft/ftcontroller.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/ft: ftcontroller.cc - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: ftcontroller.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /* * ftController diff --git a/libretroshare/src/ft/ftcontroller.h b/libretroshare/src/ft/ftcontroller.h index 564660879..8499f1e5b 100644 --- a/libretroshare/src/ft/ftcontroller.h +++ b/libretroshare/src/ft/ftcontroller.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/ft: ftcontroller.h - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: ftcontroller.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef FT_CONTROLLER_HEADER #define FT_CONTROLLER_HEADER diff --git a/libretroshare/src/ft/ftdatamultiplex.cc b/libretroshare/src/ft/ftdatamultiplex.cc index ad16e0e4c..7800468d0 100644 --- a/libretroshare/src/ft/ftdatamultiplex.cc +++ b/libretroshare/src/ft/ftdatamultiplex.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/ft: ftdatamultiplex.h - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: ftdatamultiplex.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /* * ftDataMultiplexModule. diff --git a/libretroshare/src/ft/ftdatamultiplex.h b/libretroshare/src/ft/ftdatamultiplex.h index 1679e7832..4bb8c3109 100644 --- a/libretroshare/src/ft/ftdatamultiplex.h +++ b/libretroshare/src/ft/ftdatamultiplex.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/ft: ftdatamultiplex.h - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: ftdatamultiplex.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef FT_DATA_MULTIPLEX_HEADER #define FT_DATA_MULTIPLEX_HEADER diff --git a/libretroshare/src/ft/ftextralist.cc b/libretroshare/src/ft/ftextralist.cc index b6fec4076..d2c70b3d9 100644 --- a/libretroshare/src/ft/ftextralist.cc +++ b/libretroshare/src/ft/ftextralist.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/ft: ftextralist.cc - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: ftextralist.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifdef WINDOWS_SYS #include "util/rswin.h" diff --git a/libretroshare/src/ft/ftextralist.h b/libretroshare/src/ft/ftextralist.h index 211e66dc6..e148a505f 100644 --- a/libretroshare/src/ft/ftextralist.h +++ b/libretroshare/src/ft/ftextralist.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/ft: ftextralist.h - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: ftextralist.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef FT_FILE_EXTRA_LIST_HEADER #define FT_FILE_EXTRA_LIST_HEADER diff --git a/libretroshare/src/ft/ftfilecreator.cc b/libretroshare/src/ft/ftfilecreator.cc index 56bf78bf7..69e7b9cf8 100644 --- a/libretroshare/src/ft/ftfilecreator.cc +++ b/libretroshare/src/ft/ftfilecreator.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/ft: ftfilecreator.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifdef WINDOWS_SYS #include "util/rsstring.h" #include "util/rswin.h" diff --git a/libretroshare/src/ft/ftfilecreator.h b/libretroshare/src/ft/ftfilecreator.h index 68820c160..b0461524d 100644 --- a/libretroshare/src/ft/ftfilecreator.h +++ b/libretroshare/src/ft/ftfilecreator.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/ft/ ftfilecreator.h - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: ftfilecreator.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef FT_FILE_CREATOR_HEADER #define FT_FILE_CREATOR_HEADER diff --git a/libretroshare/src/ft/ftfileprovider.cc b/libretroshare/src/ft/ftfileprovider.cc index e613694c1..44fbe7945 100644 --- a/libretroshare/src/ft/ftfileprovider.cc +++ b/libretroshare/src/ft/ftfileprovider.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/ft: ftfileprovider.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifdef WINDOWS_SYS #include "util/rswin.h" #endif // WINDOWS_SYS diff --git a/libretroshare/src/ft/ftfileprovider.h b/libretroshare/src/ft/ftfileprovider.h index 8b6acf9f6..eedda8693 100644 --- a/libretroshare/src/ft/ftfileprovider.h +++ b/libretroshare/src/ft/ftfileprovider.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/ft ftFileProvider.h - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: ftfileprovider.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef FT_FILE_PROVIDER_HEADER #define FT_FILE_PROVIDER_HEADER diff --git a/libretroshare/src/ft/ftfilesearch.cc b/libretroshare/src/ft/ftfilesearch.cc index 4aae20e05..ed021e66d 100644 --- a/libretroshare/src/ft/ftfilesearch.cc +++ b/libretroshare/src/ft/ftfilesearch.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/ft: ftfilesearch.cc - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: ftfilesearch.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "ft/ftfilesearch.h" const uint32_t MAX_SEARCHS = 24; /* lower 24 bits of hint */ diff --git a/libretroshare/src/ft/ftfilesearch.h b/libretroshare/src/ft/ftfilesearch.h index ce714ff71..f4b4e8abe 100644 --- a/libretroshare/src/ft/ftfilesearch.h +++ b/libretroshare/src/ft/ftfilesearch.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/ft: ftfilesearch.h - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: ftfilesearch.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef FT_FILE_SEARCH_HEADER #define FT_FILE_SEARCH_HEADER diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index a3c344460..e24f75a2c 100644 --- a/libretroshare/src/ft/ftserver.cc +++ b/libretroshare/src/ft/ftserver.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/ft: ftserver.cc - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: ftserver.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "crypto/chacha20.h" //const int ftserverzone = 29539; diff --git a/libretroshare/src/ft/ftserver.h b/libretroshare/src/ft/ftserver.h index 440113d11..541db6e68 100644 --- a/libretroshare/src/ft/ftserver.h +++ b/libretroshare/src/ft/ftserver.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/ft: ftserver.h - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: ftserver.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef FT_SERVER_HEADER #define FT_SERVER_HEADER diff --git a/libretroshare/src/ft/fttransfermodule.cc b/libretroshare/src/ft/fttransfermodule.cc index 46d10c400..9559bcb0a 100644 --- a/libretroshare/src/ft/fttransfermodule.cc +++ b/libretroshare/src/ft/fttransfermodule.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/ft: fttransfermodule.cc - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: fttransfermodule.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /****** * #define FT_DEBUG 1 *****/ diff --git a/libretroshare/src/ft/fttransfermodule.h b/libretroshare/src/ft/fttransfermodule.h index 02cf0212d..52e015c90 100644 --- a/libretroshare/src/ft/fttransfermodule.h +++ b/libretroshare/src/ft/fttransfermodule.h @@ -1,26 +1,24 @@ -/* - * Retroshare file transfer module: ftTransferModule.h - * - * Copyright 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/ft: fttransfermodule.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef FT_TRANSFER_MODULE_HEADER #define FT_TRANSFER_MODULE_HEADER diff --git a/libretroshare/src/ft/ftturtlefiletransferitem.cc b/libretroshare/src/ft/ftturtlefiletransferitem.cc index 44722af4b..d3c4e7ac6 100644 --- a/libretroshare/src/ft/ftturtlefiletransferitem.cc +++ b/libretroshare/src/ft/ftturtlefiletransferitem.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: ftturtlefiletransferitem.cc - * - * Services for RetroShare. - * - * Copyright 2013 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/ft: ftturtlefiletransferitem.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/libretroshare/src/ft/ftturtlefiletransferitem.h b/libretroshare/src/ft/ftturtlefiletransferitem.h index a2aa18034..211884932 100644 --- a/libretroshare/src/ft/ftturtlefiletransferitem.h +++ b/libretroshare/src/ft/ftturtlefiletransferitem.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: ftturtlefiletransferitem.h - * - * Services for RetroShare. - * - * Copyright 2013 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/ft: ftturtlefiletransferitem.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/libretroshare/src/grouter/groutercache.h b/libretroshare/src/grouter/groutercache.h index b30362857..d969bfda9 100644 --- a/libretroshare/src/grouter/groutercache.h +++ b/libretroshare/src/grouter/groutercache.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: groutercache.h - * - * Services for RetroShare. - * - * Copyright 2013 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/grouter: groutercache.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include "retroshare/rsflags.h" diff --git a/libretroshare/src/grouter/grouteritems.cc b/libretroshare/src/grouter/grouteritems.cc index 5fc4813a7..7738a175d 100644 --- a/libretroshare/src/grouter/grouteritems.cc +++ b/libretroshare/src/grouter/grouteritems.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/grouter: grouteritems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "util/rsprint.h" #include "serialiser/rsbaseserial.h" #include "serialiser/rstlvbase.h" diff --git a/libretroshare/src/grouter/grouteritems.h b/libretroshare/src/grouter/grouteritems.h index 9777c074b..312dfad99 100644 --- a/libretroshare/src/grouter/grouteritems.h +++ b/libretroshare/src/grouter/grouteritems.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: rsgrouteritems.h - * - * Services for RetroShare. - * - * Copyright 2013 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/grouter: grouteritems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include "util/rsmemory.h" diff --git a/libretroshare/src/grouter/groutertypes.h b/libretroshare/src/grouter/groutertypes.h index df8c90d48..c19fa55ee 100644 --- a/libretroshare/src/grouter/groutertypes.h +++ b/libretroshare/src/grouter/groutertypes.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: groutermatrix.h - * - * Services for RetroShare. - * - * Copyright 2013 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/grouter: groutertypes.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/grouter/p3grouter.cc b/libretroshare/src/grouter/p3grouter.cc index d184b15f5..48966db2f 100644 --- a/libretroshare/src/grouter/p3grouter.cc +++ b/libretroshare/src/grouter/p3grouter.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/services: p3grouter.cc - * - * Services for RetroShare. - * - * Copyright 2013 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ +/******************************************************************************* + * libretroshare/src/grouter: p3grouter.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ //////////////////////////////////////////////////////////////////////////////////////////////////////////// // diff --git a/libretroshare/src/grouter/p3grouter.h b/libretroshare/src/grouter/p3grouter.h index 71b2fc138..7d20f522b 100644 --- a/libretroshare/src/grouter/p3grouter.h +++ b/libretroshare/src/grouter/p3grouter.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: p3grouter.h - * - * Services for RetroShare. - * - * Copyright 2013 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/grouter: p3grouter.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/gxs/gxssecurity.cc b/libretroshare/src/gxs/gxssecurity.cc index 7d200ab86..153431c56 100644 --- a/libretroshare/src/gxs/gxssecurity.cc +++ b/libretroshare/src/gxs/gxssecurity.cc @@ -1,29 +1,25 @@ - -/* - * libretroshare/src/gxs: gxssecurity.cc - * - * - * Copyright 2008-2010 by Robert Fernie - * 2011-2012 Christopher 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". - * - */ - +/******************************************************************************* + * libretroshare/src/gxs: gxssecurity.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2010 by Robert Fernie * + * 2011-2012 Christopher Evi-Parker * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "gxssecurity.h" #include "pqi/authgpg.h" #include "util/rsdir.h" diff --git a/libretroshare/src/gxs/gxssecurity.h b/libretroshare/src/gxs/gxssecurity.h index 57cffcd2a..ebbf3ba4c 100644 --- a/libretroshare/src/gxs/gxssecurity.h +++ b/libretroshare/src/gxs/gxssecurity.h @@ -1,32 +1,28 @@ +/******************************************************************************* + * libretroshare/src/gxs: gxssecurity.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2010 by Robert Fernie * + * 2011-2012 Christopher Evi-Parker * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef GXSSECURITY_H #define GXSSECURITY_H -/* - * libretroshare/src/gxs: gxssecurity.h - * - * Security functions for Gxs - * - * Copyright 2008-2010 by Robert Fernie - * 2011-2012 Christopher 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 "serialiser/rstlvkeys.h" #include "rsitems/rsnxsitems.h" diff --git a/libretroshare/src/gxs/gxstokenqueue.cc b/libretroshare/src/gxs/gxstokenqueue.cc index b857ee1a8..64d1ec9db 100644 --- a/libretroshare/src/gxs/gxstokenqueue.cc +++ b/libretroshare/src/gxs/gxstokenqueue.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/gxs gxstokenqueue.cc - * - * Gxs Support for RetroShare. - * - * Copyright 2012-2012 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/gxs: gxstokenqueue.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "gxs/gxstokenqueue.h" /******* diff --git a/libretroshare/src/gxs/gxstokenqueue.h b/libretroshare/src/gxs/gxstokenqueue.h index 1099cd338..0ea43d345 100644 --- a/libretroshare/src/gxs/gxstokenqueue.h +++ b/libretroshare/src/gxs/gxstokenqueue.h @@ -1,29 +1,26 @@ +/******************************************************************************* + * libretroshare/src/gxs: gxstokenqueue.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef R_GXS_TOKEN_QUEUE_H #define R_GXS_TOKEN_QUEUE_H -/* - * libretroshare/src/gxs gxstokenqueue.h - * - * Gxs Support for RetroShare. - * - * Copyright 2012-2012 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". - * - */ #include "gxs/rsgenexchange.h" #include "util/rsthreads.h" diff --git a/libretroshare/src/gxs/rsdataservice.cc b/libretroshare/src/gxs/rsdataservice.cc index bebcee21d..3c2e48021 100644 --- a/libretroshare/src/gxs/rsdataservice.cc +++ b/libretroshare/src/gxs/rsdataservice.cc @@ -1,28 +1,24 @@ - -/* - * libretroshare/src/gxs: rsdataservice.cc - * - * Data Access, interface for RetroShare. - * - * Copyright 2011-2011 by Evi-Parker Christopher - * - * 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/gxs: gxsdataservice.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2011 by Evi-Parker Christopher * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /***** * #define RS_DATA_SERVICE_DEBUG 1 diff --git a/libretroshare/src/gxs/rsdataservice.h b/libretroshare/src/gxs/rsdataservice.h index c669ee016..4fa5c866f 100644 --- a/libretroshare/src/gxs/rsdataservice.h +++ b/libretroshare/src/gxs/rsdataservice.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/gxs: gxsdataservice.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2012 by Evi-Parker Christopher * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSDATASERVICE_H #define RSDATASERVICE_H -/* - * libretroshare/src/gxs: rsdataservice.h - * - * General Data service, interface for RetroShare. - * - * Copyright 2011-2012 by Evi-Parker Christopher - * - * 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 "gxs/rsgds.h" #include "util/retrodb.h" diff --git a/libretroshare/src/gxs/rsgds.h b/libretroshare/src/gxs/rsgds.h index e20d0ed04..9c23d920e 100644 --- a/libretroshare/src/gxs/rsgds.h +++ b/libretroshare/src/gxs/rsgds.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/gxs: rsgds.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2011 by Robert Fernie, Evi-Parker Christopher * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSGDS_H #define RSGDS_H -/* - * libretroshare/src/gxp: gxp.h - * - * General Data service, interface for RetroShare. - * - * Copyright 2011-2011 by Robert Fernie, Evi-Parker Christopher - * - * 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 #include #include diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 15d0aa9e9..fe3781e85 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/gxs: rsgenexchange.cc - * - * RetroShare Gxs exchange interface. - * - * Copyright 2012-2012 by Christopher Evi-Parker, 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/gxs: rsgenexchange.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie, Evi-Parker Christopher * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include "pqi/pqihash.h" diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h index 491ff017b..8a8af9444 100644 --- a/libretroshare/src/gxs/rsgenexchange.h +++ b/libretroshare/src/gxs/rsgenexchange.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/gxs: rsgenexchange.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie, Evi-Parker Christopher * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSGENEXCHANGE_H #define RSGENEXCHANGE_H -/* - * libretroshare/src/gxs: rsgenexchange.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 by Christopher Evi-Parker, 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 #include diff --git a/libretroshare/src/gxs/rsgixs.h b/libretroshare/src/gxs/rsgixs.h index 3c7c5ae1b..21a4cf1c4 100644 --- a/libretroshare/src/gxs/rsgixs.h +++ b/libretroshare/src/gxs/rsgixs.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/gxs: rsgixs.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2011 by Robert Fernie, Evi-Parker Christopher * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSGIXS_H #define RSGIXS_H -/* - * libretroshare/src/gxs: gxs.h - * - * General Identity Exchange Service interface for RetroShare. - * - * Copyright 2011-2011 by Robert Fernie, Christopher Evi-Prker - * - * 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 "gxs/rsgxs.h" #include "gxs/rsgenexchange.h" diff --git a/libretroshare/src/gxs/rsgxs.h b/libretroshare/src/gxs/rsgxs.h index e8e64a098..0719d6109 100644 --- a/libretroshare/src/gxs/rsgxs.h +++ b/libretroshare/src/gxs/rsgxs.h @@ -1,30 +1,27 @@ +/******************************************************************************* + * libretroshare/src/gxs: rsgxs.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 Christopher Evi-Parker * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSGXS_H #define RSGXS_H -/* - * libretroshare/src/gxs : rsgxs.h - * - * Copyright 2012 Christopher 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 "gxs/rsgxsdata.h" #include diff --git a/libretroshare/src/gxs/rsgxsdata.cc b/libretroshare/src/gxs/rsgxsdata.cc index 48dfa9917..b69606f72 100644 --- a/libretroshare/src/gxs/rsgxsdata.cc +++ b/libretroshare/src/gxs/rsgxsdata.cc @@ -1,28 +1,24 @@ - -/* - * libretroshare/src/gxs: rsgxsdata.cc - * - * Gxs Data types used to specific services - * - * Copyright 2012-2012 by Christopher Evi-Parker, 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/gxs: rsgxsdata.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Christopher Evi-Parker, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "rsgxsdata.h" #include "serialiser/rsbaseserial.h" diff --git a/libretroshare/src/gxs/rsgxsdata.h b/libretroshare/src/gxs/rsgxsdata.h index 3cead4a11..c1d6becc4 100644 --- a/libretroshare/src/gxs/rsgxsdata.h +++ b/libretroshare/src/gxs/rsgxsdata.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/gxs: rsgxsdata.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Christopher Evi-Parker, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSGXSMETA_H #define RSGXSMETA_H -/* - * libretroshare/src/gxs: rsgxsdata.h - * - * Gxs Data types used to specific services - * - * Copyright 2012-2012 by Christopher Evi-Parker, 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 #include diff --git a/libretroshare/src/gxs/rsgxsdataaccess.cc b/libretroshare/src/gxs/rsgxsdataaccess.cc index 5d36bd909..383fcf840 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.cc +++ b/libretroshare/src/gxs/rsgxsdataaccess.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/retroshare: rsgxsdataaccess.cc - * - * RetroShare C++ Interface. - * - * Copyright 2012-2013 by Robert Fernie, Christopher 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". - * - */ +/******************************************************************************* + * libretroshare/src/gxs: rsgxsdataaccess.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2013 by Christopher Evi-Parker, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/libretroshare/src/gxs/rsgxsdataaccess.h b/libretroshare/src/gxs/rsgxsdataaccess.h index 77f94137e..741a3b78d 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.h +++ b/libretroshare/src/gxs/rsgxsdataaccess.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/gxs: rsgxsdataaccess.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Christopher Evi-Parker, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSGXSDATAACCESS_H #define RSGXSDATAACCESS_H -/* - * libretroshare/src/retroshare: rsgxsdataaccess.cc - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 by Robert Fernie, Christopher 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/rstokenservice.h" #include "rsgxsrequesttypes.h" #include "rsgds.h" diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 48a9e9234..eff91a417 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/gxs: rsgxnetservice.cc - * - * Access to rs network and synchronisation service implementation - * - * Copyright 2012-2012 by Christopher 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". - * - */ +/******************************************************************************* + * libretroshare/src/gxs: rsgxsnetservice.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Christopher Evi-Parker * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ // // RsNxsItem diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index 00ba07953..9ec6bdf9b 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/gxs: rsgxsnetservice.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Christopher Evi-Parker * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSGXSNETSERVICE_H #define RSGXSNETSERVICE_H -/* - * libretroshare/src/gxs: rsgxnetservice.h - * - * Access to rs network and synchronisation service implementation - * - * Copyright 2012-2012 by Christopher 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 #include diff --git a/libretroshare/src/gxs/rsgxsnetutils.cc b/libretroshare/src/gxs/rsgxsnetutils.cc index 7454ba58a..4796cffd6 100644 --- a/libretroshare/src/gxs/rsgxsnetutils.cc +++ b/libretroshare/src/gxs/rsgxsnetutils.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/gxs: rsgxnetutils.cc - * - * Helper objects for the operation rsgxsnetservice - * - * Copyright 2012-2013 by Christopher 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". - * - */ +/******************************************************************************* + * libretroshare/src/gxs: rsgxsnetutils.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2013 by Christopher Evi-Parker * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "rsgxsnetutils.h" #include "pqi/p3servicecontrol.h" diff --git a/libretroshare/src/gxs/rsgxsnetutils.h b/libretroshare/src/gxs/rsgxsnetutils.h index aae2be9f8..39d9a6112 100644 --- a/libretroshare/src/gxs/rsgxsnetutils.h +++ b/libretroshare/src/gxs/rsgxsnetutils.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/gxs: rsgxnetutils.h - * - * Helper objects for the operation rsgxsnetservice - * - * Copyright 2012-2013 by Christopher 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". - * - */ +/******************************************************************************* + * libretroshare/src/gxs: rsgxsnetutils.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2013 by Christopher Evi-Parker * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSGXSNETUTILS_H_ #define RSGXSNETUTILS_H_ diff --git a/libretroshare/src/gxs/rsgxsrequesttypes.cc b/libretroshare/src/gxs/rsgxsrequesttypes.cc index 81dec52ab..57fff5143 100644 --- a/libretroshare/src/gxs/rsgxsrequesttypes.cc +++ b/libretroshare/src/gxs/rsgxsrequesttypes.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/gxs: rgxsrequesttypes.cc - * - * Type introspect request types for data access request implementation - * - * Copyright 2012-2012 by Christopher 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". - * - */ +/******************************************************************************* + * libretroshare/src/gxs: rsgxsrequesttypes.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Christopher Evi-Parker * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "rsgxsrequesttypes.h" #include "util/rsstd.h" diff --git a/libretroshare/src/gxs/rsgxsrequesttypes.h b/libretroshare/src/gxs/rsgxsrequesttypes.h index 5c70c9d52..72138e801 100644 --- a/libretroshare/src/gxs/rsgxsrequesttypes.h +++ b/libretroshare/src/gxs/rsgxsrequesttypes.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/gxs: rsgxsrequesttypes.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Christopher Evi-Parker * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSGXSREQUESTTYPES_H_ #define RSGXSREQUESTTYPES_H_ -/* - * libretroshare/src/gxs: rgxsrequesttypes.h - * - * Type introspect request types for data access request implementation - * - * Copyright 2012-2012 by Christopher 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/rstokenservice.h" #include "gxs/rsgds.h" #include "util/rsdeprecate.h" diff --git a/libretroshare/src/gxs/rsgxsutil.cc b/libretroshare/src/gxs/rsgxsutil.cc index abf02aef2..b6e26e6e3 100644 --- a/libretroshare/src/gxs/rsgxsutil.cc +++ b/libretroshare/src/gxs/rsgxsutil.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/gxs: rsgxsutil.cc - * - * RetroShare C++ Interface. Generic routines that are useful in GXS - * - * Copyright 2013-2013 by Christopher 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". - * - */ - +/******************************************************************************* + * libretroshare/src/gxs: rsgxsutil.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013-2013 by Christopher Evi-Parker * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include "rsgxsutil.h" diff --git a/libretroshare/src/gxs/rsgxsutil.h b/libretroshare/src/gxs/rsgxsutil.h index b169e00b5..67c384cfc 100644 --- a/libretroshare/src/gxs/rsgxsutil.h +++ b/libretroshare/src/gxs/rsgxsutil.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/gxs: rsgxsutil.h - * - * RetroShare C++ Interface. Generic routines that are useful in GXS - * - * Copyright 2013-2013 by Christopher 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". - * - */ +/******************************************************************************* + * libretroshare/src/gxs: rsgxsutil.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013-2013 by Christopher Evi-Parker * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef GXSUTIL_H_ #define GXSUTIL_H_ diff --git a/libretroshare/src/gxs/rsnxsobserver.h b/libretroshare/src/gxs/rsnxsobserver.h index 087842ef0..90c306129 100644 --- a/libretroshare/src/gxs/rsnxsobserver.h +++ b/libretroshare/src/gxs/rsnxsobserver.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/gxs: rsgxsobserver.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2012 by Robert Fernie, Evi-Parker Christopher * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSNXSOBSERVER_H #define RSNXSOBSERVER_H -/* - * libretroshare/src/gxs: rsnxsobserver.h - * - * Observer interface used by nxs to transport new messages to clients - * - * Copyright 2011-2012 by Robert Fernie, Evi-Parker Christopher - * - * 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 #include "rsitems/rsnxsitems.h" From 8a07f2c8c446b020072c092775e5e79694376b4f Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 24 May 2018 19:50:07 +0200 Subject: [PATCH 057/138] fixed wrong commit with copy-pasted code --- libretroshare/src/use_libretroshare.pri | 4 ---- openpgpsdk/src/use_openpgpsdk.pri | 4 ---- 2 files changed, 8 deletions(-) diff --git a/libretroshare/src/use_libretroshare.pri b/libretroshare/src/use_libretroshare.pri index 4d4e00061..47b657222 100644 --- a/libretroshare/src/use_libretroshare.pri +++ b/libretroshare/src/use_libretroshare.pri @@ -15,10 +15,6 @@ # You should have received a copy of the GNU Affero General Public License # # along with this program. If not, see . # ################################################################################ -DEPENDPATH *= $$system_path($$clean_path($$PWD/../../libresapi/src)) -INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../libresapi/src)) -LIBS *= -L$$system_path($$clean_path($${OUT_PWD}/../../libresapi/src/lib/)) -lresapi - DEPENDPATH *= $$system_path($$clean_path($${PWD}/../../libretroshare/src/)) INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../libretroshare/src)) LIBS *= -L$$system_path($$clean_path($${OUT_PWD}/../../libretroshare/src/lib/)) -lretroshare diff --git a/openpgpsdk/src/use_openpgpsdk.pri b/openpgpsdk/src/use_openpgpsdk.pri index 0e776f5b4..115f88d67 100644 --- a/openpgpsdk/src/use_openpgpsdk.pri +++ b/openpgpsdk/src/use_openpgpsdk.pri @@ -15,10 +15,6 @@ # You should have received a copy of the GNU Affero General Public License # # along with this program. If not, see . # ################################################################################ -DEPENDPATH *= $$system_path($$clean_path($$PWD/../../libresapi/src)) -INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../libresapi/src)) -LIBS *= -L$$system_path($$clean_path($${OUT_PWD}/../../libresapi/src/lib/)) -lresapi - DEPENDPATH *= $$system_path($$clean_path($${PWD}/../../openpgpsdk/src)) INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../openpgpsdk/src)) LIBS *= -L$$system_path($$clean_path($${OUT_PWD}/../../openpgpsdk/src/lib/)) -lops From 1fee544db7b3c7c6357b979b91108e711535d1fc Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 26 May 2018 14:45:43 +0200 Subject: [PATCH 058/138] re-licensed gxstrans, gxstunnel, pgp, plugins and half pqi --- libretroshare/src/ft/ftdata.h | 46 ++++++++--------- libretroshare/src/gxstrans/p3gxstrans.cc | 39 +++++++------- libretroshare/src/gxstrans/p3gxstrans.h | 38 +++++++------- libretroshare/src/gxstrans/p3gxstransitems.cc | 39 +++++++------- libretroshare/src/gxstrans/p3gxstransitems.h | 38 +++++++------- libretroshare/src/gxstunnel/p3gxstunnel.cc | 47 ++++++++--------- libretroshare/src/gxstunnel/p3gxstunnel.h | 46 ++++++++--------- .../src/gxstunnel/rsgxstunnelitems.cc | 47 ++++++++--------- .../src/gxstunnel/rsgxstunnelitems.h | 46 ++++++++--------- libretroshare/src/pgp/pgpauxutils.cc | 46 ++++++++--------- libretroshare/src/pgp/pgpauxutils.h | 46 ++++++++--------- libretroshare/src/pgp/pgphandler.cc | 23 +++++++++ libretroshare/src/pgp/pgphandler.h | 23 +++++++++ libretroshare/src/pgp/pgpkeyutil.cc | 23 +++++++++ libretroshare/src/pgp/pgpkeyutil.h | 42 +++++++-------- libretroshare/src/pgp/rscertificate.cc | 23 +++++++++ libretroshare/src/pgp/rscertificate.h | 23 +++++++++ libretroshare/src/plugins/dlfcn_win32.cc | 40 ++++++++------- libretroshare/src/plugins/dlfcn_win32.h | 40 ++++++++------- libretroshare/src/plugins/pluginmanager.cc | 21 ++++++++ libretroshare/src/plugins/pluginmanager.h | 21 ++++++++ libretroshare/src/pqi/authgpg.cc | 47 ++++++++--------- libretroshare/src/pqi/authgpg.h | 49 ++++++++---------- libretroshare/src/pqi/authssl.cc | 51 ++++++++----------- libretroshare/src/pqi/authssl.h | 46 ++++++++--------- libretroshare/src/pqi/p3cfgmgr.cc | 46 ++++++++--------- libretroshare/src/pqi/p3cfgmgr.h | 21 ++++++++ 27 files changed, 582 insertions(+), 435 deletions(-) diff --git a/libretroshare/src/ft/ftdata.h b/libretroshare/src/ft/ftdata.h index 909195009..b66b32fc2 100644 --- a/libretroshare/src/ft/ftdata.h +++ b/libretroshare/src/ft/ftdata.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/ft: ftdata.h - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: ftdata.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef FT_DATA_INTERFACE_HEADER #define FT_DATA_INTERFACE_HEADER diff --git a/libretroshare/src/gxstrans/p3gxstrans.cc b/libretroshare/src/gxstrans/p3gxstrans.cc index d0dbb61b0..373f0bc1c 100644 --- a/libretroshare/src/gxstrans/p3gxstrans.cc +++ b/libretroshare/src/gxstrans/p3gxstrans.cc @@ -1,21 +1,24 @@ -/* - * GXS Mailing Service - * Copyright (C) 2016-2017 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - +/******************************************************************************* + * libretroshare/src/gxstrans: p3gxstrans.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2016-2017 Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "util/rsdir.h" #include "gxstrans/p3gxstrans.h" #include "util/stacktrace.h" diff --git a/libretroshare/src/gxstrans/p3gxstrans.h b/libretroshare/src/gxstrans/p3gxstrans.h index af79679d9..efddf9929 100644 --- a/libretroshare/src/gxstrans/p3gxstrans.h +++ b/libretroshare/src/gxstrans/p3gxstrans.h @@ -1,21 +1,25 @@ +/******************************************************************************* + * libretroshare/src/gxstrans: p3gxstrans.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2016-2017 Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once -/* - * GXS Mailing Service - * Copyright (C) 2016-2017 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ #include #include diff --git a/libretroshare/src/gxstrans/p3gxstransitems.cc b/libretroshare/src/gxstrans/p3gxstransitems.cc index 5d28ec582..20fc85540 100644 --- a/libretroshare/src/gxstrans/p3gxstransitems.cc +++ b/libretroshare/src/gxstrans/p3gxstransitems.cc @@ -1,21 +1,24 @@ -/* - * GXS Mailing Service - * Copyright (C) 2016-2018 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - +/******************************************************************************* + * libretroshare/src/gxstrans: p3gxstrans.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2016-2018 Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "gxstrans/p3gxstransitems.h" #include "serialiser/rstypeserializer.h" diff --git a/libretroshare/src/gxstrans/p3gxstransitems.h b/libretroshare/src/gxstrans/p3gxstransitems.h index bd13c9e71..63b4792a5 100644 --- a/libretroshare/src/gxstrans/p3gxstransitems.h +++ b/libretroshare/src/gxstrans/p3gxstransitems.h @@ -1,21 +1,25 @@ +/******************************************************************************* + * libretroshare/src/gxstrans: p3gxstrans.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2016-2017 Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once -/* - * GXS Mailing Service - * Copyright (C) 2016-2017 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ #include diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.cc b/libretroshare/src/gxstunnel/p3gxstunnel.cc index eef365230..d9b7afd97 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.cc +++ b/libretroshare/src/gxstunnel/p3gxstunnel.cc @@ -1,28 +1,25 @@ -/* - * libretroshare/src/chat: distantchat.cc - * - * Services for RetroShare. - * - * Copyright 2014 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/chat: distantchat.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2015 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ +#pragma once #include diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.h b/libretroshare/src/gxstunnel/p3gxstunnel.h index cabe520d4..4284ba64d 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.h +++ b/libretroshare/src/gxstunnel/p3gxstunnel.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/chat: distantchat.h - * - * Services for RetroShare. - * - * Copyright 2015 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/chat: distantchat.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2015 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once // Generic tunnel service diff --git a/libretroshare/src/gxstunnel/rsgxstunnelitems.cc b/libretroshare/src/gxstunnel/rsgxstunnelitems.cc index d653b03ea..0569337ac 100644 --- a/libretroshare/src/gxstunnel/rsgxstunnelitems.cc +++ b/libretroshare/src/gxstunnel/rsgxstunnelitems.cc @@ -1,28 +1,25 @@ - -/* - * libretroshare/src/serialiser: rsbaseitems.cc - * - * RetroShare Serialiser. - * - * 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/gxstunnel: rsgxstunnelitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2015 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ +#pragma once #include #include diff --git a/libretroshare/src/gxstunnel/rsgxstunnelitems.h b/libretroshare/src/gxstunnel/rsgxstunnelitems.h index 8c4e95ba4..eea267503 100644 --- a/libretroshare/src/gxstunnel/rsgxstunnelitems.h +++ b/libretroshare/src/gxstunnel/rsgxstunnelitems.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rschatitems.h - * - * RetroShare Serialiser. - * - * 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/chat: rsgxstunnelitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2015 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/pgp/pgpauxutils.cc b/libretroshare/src/pgp/pgpauxutils.cc index 6cd4ebf08..ff69f1a1a 100644 --- a/libretroshare/src/pgp/pgpauxutils.cc +++ b/libretroshare/src/pgp/pgpauxutils.cc @@ -1,27 +1,25 @@ -/* - * libretroshare/src/pgp: pgpauxutils.cc - * - * PGP interface for RetroShare. - * - * Copyright 2014-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/pgp: pgpauxutils.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014 Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ +#pragma once #include "pgp/pgpauxutils.h" diff --git a/libretroshare/src/pgp/pgpauxutils.h b/libretroshare/src/pgp/pgpauxutils.h index 2ead59db8..ff16caf92 100644 --- a/libretroshare/src/pgp/pgpauxutils.h +++ b/libretroshare/src/pgp/pgpauxutils.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pgp: pgpauxutils.h - * - * PGP interface for RetroShare. - * - * Copyright 2014-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/pgp: pgpauxutils.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014 Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include "retroshare/rsids.h" diff --git a/libretroshare/src/pgp/pgphandler.cc b/libretroshare/src/pgp/pgphandler.cc index df95fc7f9..5b8bddf43 100644 --- a/libretroshare/src/pgp/pgphandler.cc +++ b/libretroshare/src/pgp/pgphandler.cc @@ -1,3 +1,26 @@ +/******************************************************************************* + * libretroshare/src/pgp: pgphandler.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ +#pragma once + #include #include #include diff --git a/libretroshare/src/pgp/pgphandler.h b/libretroshare/src/pgp/pgphandler.h index 8b3d9a4fe..2210611fe 100644 --- a/libretroshare/src/pgp/pgphandler.h +++ b/libretroshare/src/pgp/pgphandler.h @@ -1,3 +1,26 @@ +/******************************************************************************* + * libretroshare/src/pgp: pgphandler.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ +#pragma once + #pragma once // This class implements an abstract pgp handler to be used in RetroShare. diff --git a/libretroshare/src/pgp/pgpkeyutil.cc b/libretroshare/src/pgp/pgpkeyutil.cc index ebd2ccf5b..ca02a4f14 100644 --- a/libretroshare/src/pgp/pgpkeyutil.cc +++ b/libretroshare/src/pgp/pgpkeyutil.cc @@ -1,3 +1,26 @@ +/******************************************************************************* + * libretroshare/src/pgp: pgpkeyutil.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ +#pragma once + #include #include #include "pgpkeyutil.h" diff --git a/libretroshare/src/pgp/pgpkeyutil.h b/libretroshare/src/pgp/pgpkeyutil.h index 672550b1b..d117b010c 100644 --- a/libretroshare/src/pgp/pgpkeyutil.h +++ b/libretroshare/src/pgp/pgpkeyutil.h @@ -1,24 +1,24 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012 Cyril Soler - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * libretroshare/src/pgp: pgpkeyutil.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once // refer to RFC4880 specif document for loading GPG public keys: diff --git a/libretroshare/src/pgp/rscertificate.cc b/libretroshare/src/pgp/rscertificate.cc index 70a00328f..5eaadfbea 100644 --- a/libretroshare/src/pgp/rscertificate.cc +++ b/libretroshare/src/pgp/rscertificate.cc @@ -1,3 +1,26 @@ +/******************************************************************************* + * libretroshare/src/pgp: rscertificate.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ +#pragma once + #include #include #include diff --git a/libretroshare/src/pgp/rscertificate.h b/libretroshare/src/pgp/rscertificate.h index a70a1752f..8b82b2cfa 100644 --- a/libretroshare/src/pgp/rscertificate.h +++ b/libretroshare/src/pgp/rscertificate.h @@ -1,3 +1,26 @@ +/******************************************************************************* + * libretroshare/src/pgp: rscertificate.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ +#pragma once + #pragma once #include diff --git a/libretroshare/src/plugins/dlfcn_win32.cc b/libretroshare/src/plugins/dlfcn_win32.cc index 1a6b107b5..3677a4706 100644 --- a/libretroshare/src/plugins/dlfcn_win32.cc +++ b/libretroshare/src/plugins/dlfcn_win32.cc @@ -1,21 +1,25 @@ -/* - * dlfcn-win32 - * Copyright (c) 2007 Ramiro Polla - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ +/******************************************************************************* + * libretroshare/src/plugins: dlfcn_win32.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007 Ramiro Polla * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ +#pragma once #ifdef WINDOWS_SYS diff --git a/libretroshare/src/plugins/dlfcn_win32.h b/libretroshare/src/plugins/dlfcn_win32.h index af33af443..0b21e9e53 100644 --- a/libretroshare/src/plugins/dlfcn_win32.h +++ b/libretroshare/src/plugins/dlfcn_win32.h @@ -1,21 +1,25 @@ -/* - * dlfcn-win32 - * Copyright (c) 2007 Ramiro Polla - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ +/******************************************************************************* + * libretroshare/src/plugins: dlfcn_win32.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007 Ramiro Polla * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ +#pragma once #ifdef WINDOWS_SYS #ifndef DLFCN_H diff --git a/libretroshare/src/plugins/pluginmanager.cc b/libretroshare/src/plugins/pluginmanager.cc index 61757f31d..b8f6fdcec 100644 --- a/libretroshare/src/plugins/pluginmanager.cc +++ b/libretroshare/src/plugins/pluginmanager.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/plugins: pluginmanager.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include "pluginmanager.h" diff --git a/libretroshare/src/plugins/pluginmanager.h b/libretroshare/src/plugins/pluginmanager.h index 09f05563b..540068428 100644 --- a/libretroshare/src/plugins/pluginmanager.h +++ b/libretroshare/src/plugins/pluginmanager.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/plugins: pluginmanager.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/pqi/authgpg.cc b/libretroshare/src/pqi/authgpg.cc index ccfb8a260..4d7d0f446 100644 --- a/libretroshare/src/pqi/authgpg.cc +++ b/libretroshare/src/pqi/authgpg.cc @@ -1,29 +1,24 @@ -/* - * libretroshare/src AuthGPG.cc - * - * GnuPG/GPGme interface for RetroShare. - * - * Copyright 2008-2009 by Robert Fernie, Retroshare Team. - * - * This library is free software; you can redistribute it and/or - * modify it under the termsf 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/pqi: authgpg.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2009 by Robert Fernie, Retroshare Team. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "authgpg.h" #include "retroshare/rsiface.h" // For rsicontrol. #include "retroshare/rspeers.h" // For RsPeerDetails. diff --git a/libretroshare/src/pqi/authgpg.h b/libretroshare/src/pqi/authgpg.h index 4ad48c42b..4f0149908 100644 --- a/libretroshare/src/pqi/authgpg.h +++ b/libretroshare/src/pqi/authgpg.h @@ -1,31 +1,24 @@ -/* - * libretroshare/src/ : gpgauthmgr.h - * - * GPG interface for RetroShare. - * - * Copyright 2008-2009 by Raghu Dev R. - * - * 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". - * - * This is *THE* auth manager. It provides the web-of-trust via - * gpgme, and authenticates the certificates that are managed - * by the sublayer AuthSSL. - * - */ +/******************************************************************************* + * libretroshare/src/pqi: authgpg.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2009 by Raghu Dev R. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /**** * Here's GPG policy : diff --git a/libretroshare/src/pqi/authssl.cc b/libretroshare/src/pqi/authssl.cc index 9956459d3..19201906c 100644 --- a/libretroshare/src/pqi/authssl.cc +++ b/libretroshare/src/pqi/authssl.cc @@ -1,33 +1,24 @@ -/* - * libretroshare/src/pqi: authssl.cc - * - * 3P/PQI network interface 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". - * - * - * This class is designed to provide authentication using ssl certificates - * only. It is intended to be wrapped by an gpgauthmgr to provide - * pgp + ssl web-of-trust authentication. - * - */ - +/******************************************************************************* + * libretroshare/src/pqi: authssl.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie, Retroshare Team. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifdef WINDOWS_SYS #include "util/rswin.h" #endif // WINDOWS_SYS diff --git a/libretroshare/src/pqi/authssl.h b/libretroshare/src/pqi/authssl.h index bdfd141c0..c0ea77449 100644 --- a/libretroshare/src/pqi/authssl.h +++ b/libretroshare/src/pqi/authssl.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi: authssl.h - * - * 3P/PQI network interface 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". - * - */ - +/******************************************************************************* + * libretroshare/src/pqi: authssl.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie, Retroshare Team. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef MRK_AUTH_SSL_HEADER #define MRK_AUTH_SSL_HEADER diff --git a/libretroshare/src/pqi/p3cfgmgr.cc b/libretroshare/src/pqi/p3cfgmgr.cc index 3266f68d4..0182303eb 100644 --- a/libretroshare/src/pqi/p3cfgmgr.cc +++ b/libretroshare/src/pqi/p3cfgmgr.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi: p3cfgmgr.cc - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: p3cfgmgr.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie, Retroshare Team. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "util/rsdir.h" //#include "retroshare/rspeers.h" #include "pqi/p3cfgmgr.h" diff --git a/libretroshare/src/pqi/p3cfgmgr.h b/libretroshare/src/pqi/p3cfgmgr.h index 43e19b66e..91de5136a 100644 --- a/libretroshare/src/pqi/p3cfgmgr.h +++ b/libretroshare/src/pqi/p3cfgmgr.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/pqi: p3cfgmgr.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie, Retroshare Team. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero 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 Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /* * libretroshare/src/pqi: p3cfgmgr.h * From b3277824ebe16d3f1d2de8370985fd9d78e57740 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 28 May 2018 22:03:39 +0200 Subject: [PATCH 059/138] license fix in pqi --- libbitdht/src/use_libbitdht.pri | 6 +-- libretroshare/src/chat/distantchat.cc | 6 +-- libretroshare/src/chat/distantchat.h | 6 +-- libretroshare/src/chat/distributedchat.cc | 6 +-- libretroshare/src/chat/distributedchat.h | 6 +-- libretroshare/src/chat/p3chatservice.cc | 6 +-- libretroshare/src/chat/p3chatservice.h | 6 +-- libretroshare/src/chat/rschatitems.cc | 6 +-- libretroshare/src/chat/rschatitems.h | 6 +-- libretroshare/src/crypto/chacha20.h | 6 +-- libretroshare/src/crypto/hashstream.cc | 6 +-- libretroshare/src/crypto/hashstream.h | 6 +-- libretroshare/src/dht/connectstatebox.cc | 6 +-- libretroshare/src/dht/connectstatebox.h | 6 +-- libretroshare/src/dht/p3bitdht.cc | 6 +-- libretroshare/src/dht/p3bitdht.h | 6 +-- libretroshare/src/dht/stunaddrassist.h | 6 +-- .../src/file_sharing/dir_hierarchy.cc | 6 +-- .../src/file_sharing/dir_hierarchy.h | 6 +-- .../src/file_sharing/directory_storage.cc | 6 +-- .../src/file_sharing/directory_storage.h | 6 +-- .../src/file_sharing/directory_updater.cc | 6 +-- .../src/file_sharing/directory_updater.h | 6 +-- .../src/file_sharing/file_sharing_defaults.h | 47 ++++++++--------- libretroshare/src/file_sharing/file_tree.cc | 6 +-- libretroshare/src/file_sharing/file_tree.h | 6 +-- libretroshare/src/file_sharing/filelist_io.cc | 6 +-- libretroshare/src/file_sharing/filelist_io.h | 6 +-- libretroshare/src/file_sharing/hash_cache.cc | 6 +-- libretroshare/src/file_sharing/hash_cache.h | 6 +-- libretroshare/src/file_sharing/p3filelists.cc | 6 +-- libretroshare/src/file_sharing/p3filelists.h | 6 +-- .../src/file_sharing/rsfilelistitems.cc | 6 +-- .../src/file_sharing/rsfilelistitems.h | 6 +-- libretroshare/src/ft/ftchunkmap.cc | 6 +-- libretroshare/src/ft/ftchunkmap.h | 6 +-- libretroshare/src/ft/ftcontroller.cc | 6 +-- libretroshare/src/ft/ftcontroller.h | 6 +-- libretroshare/src/ft/ftdata.h | 6 +-- libretroshare/src/ft/ftdatamultiplex.cc | 6 +-- libretroshare/src/ft/ftdatamultiplex.h | 6 +-- libretroshare/src/ft/ftextralist.cc | 6 +-- libretroshare/src/ft/ftextralist.h | 6 +-- libretroshare/src/ft/ftfilecreator.cc | 6 +-- libretroshare/src/ft/ftfilecreator.h | 6 +-- libretroshare/src/ft/ftfileprovider.cc | 6 +-- libretroshare/src/ft/ftfileprovider.h | 6 +-- libretroshare/src/ft/ftfilesearch.cc | 6 +-- libretroshare/src/ft/ftfilesearch.h | 6 +-- libretroshare/src/ft/ftsearch.h | 46 ++++++++--------- libretroshare/src/ft/ftserver.cc | 6 +-- libretroshare/src/ft/ftserver.h | 6 +-- libretroshare/src/ft/fttransfermodule.cc | 6 +-- libretroshare/src/ft/fttransfermodule.h | 6 +-- .../src/ft/ftturtlefiletransferitem.cc | 6 +-- .../src/ft/ftturtlefiletransferitem.h | 6 +-- libretroshare/src/grouter/groutercache.h | 6 +-- libretroshare/src/grouter/grouteritems.cc | 6 +-- libretroshare/src/grouter/grouteritems.h | 6 +-- libretroshare/src/grouter/groutertypes.h | 6 +-- libretroshare/src/grouter/p3grouter.cc | 6 +-- libretroshare/src/grouter/p3grouter.h | 6 +-- libretroshare/src/gxs/gxssecurity.cc | 6 +-- libretroshare/src/gxs/gxssecurity.h | 6 +-- libretroshare/src/gxs/gxstokenqueue.cc | 6 +-- libretroshare/src/gxs/gxstokenqueue.h | 6 +-- libretroshare/src/gxs/rsdataservice.cc | 6 +-- libretroshare/src/gxs/rsdataservice.h | 6 +-- libretroshare/src/gxs/rsgds.h | 6 +-- libretroshare/src/gxs/rsgenexchange.cc | 6 +-- libretroshare/src/gxs/rsgenexchange.h | 6 +-- libretroshare/src/gxs/rsgixs.h | 6 +-- libretroshare/src/gxs/rsgxs.h | 6 +-- libretroshare/src/gxs/rsgxsdata.cc | 6 +-- libretroshare/src/gxs/rsgxsdata.h | 6 +-- libretroshare/src/gxs/rsgxsdataaccess.cc | 6 +-- libretroshare/src/gxs/rsgxsdataaccess.h | 6 +-- libretroshare/src/gxs/rsgxsnetservice.cc | 6 +-- libretroshare/src/gxs/rsgxsnetservice.h | 6 +-- libretroshare/src/gxs/rsgxsnetutils.cc | 6 +-- libretroshare/src/gxs/rsgxsnetutils.h | 6 +-- libretroshare/src/gxs/rsgxsrequesttypes.cc | 6 +-- libretroshare/src/gxs/rsgxsrequesttypes.h | 6 +-- libretroshare/src/gxs/rsgxsutil.cc | 6 +-- libretroshare/src/gxs/rsgxsutil.h | 6 +-- libretroshare/src/gxs/rsnxsobserver.h | 6 +-- libretroshare/src/gxstrans/p3gxstrans.cc | 6 +-- libretroshare/src/gxstrans/p3gxstrans.h | 6 +-- libretroshare/src/gxstrans/p3gxstransitems.cc | 6 +-- libretroshare/src/gxstrans/p3gxstransitems.h | 6 +-- libretroshare/src/gxstunnel/p3gxstunnel.cc | 6 +-- libretroshare/src/gxstunnel/p3gxstunnel.h | 6 +-- .../src/gxstunnel/rsgxstunnelitems.cc | 6 +-- .../src/gxstunnel/rsgxstunnelitems.h | 6 +-- libretroshare/src/libretroshare.pro | 6 +-- libretroshare/src/pgp/pgpauxutils.cc | 6 +-- libretroshare/src/pgp/pgpauxutils.h | 6 +-- libretroshare/src/pgp/pgphandler.cc | 6 +-- libretroshare/src/pgp/pgphandler.h | 6 +-- libretroshare/src/pgp/pgpkeyutil.cc | 6 +-- libretroshare/src/pgp/pgpkeyutil.h | 6 +-- libretroshare/src/pgp/rscertificate.cc | 6 +-- libretroshare/src/pgp/rscertificate.h | 6 +-- libretroshare/src/plugins/dlfcn_win32.cc | 6 +-- libretroshare/src/plugins/dlfcn_win32.h | 6 +-- libretroshare/src/plugins/pluginmanager.cc | 6 +-- libretroshare/src/plugins/pluginmanager.h | 6 +-- libretroshare/src/pqi/authgpg.cc | 6 +-- libretroshare/src/pqi/authgpg.h | 6 +-- libretroshare/src/pqi/authssl.cc | 6 +-- libretroshare/src/pqi/authssl.h | 6 +-- libretroshare/src/pqi/p3cfgmgr.cc | 6 +-- libretroshare/src/pqi/p3cfgmgr.h | 35 ++----------- libretroshare/src/pqi/p3historymgr.cc | 46 ++++++++--------- libretroshare/src/pqi/p3historymgr.h | 46 ++++++++--------- libretroshare/src/pqi/p3linkmgr.cc | 48 ++++++++---------- libretroshare/src/pqi/p3linkmgr.h | 46 ++++++++--------- libretroshare/src/pqi/p3netmgr.cc | 48 ++++++++---------- libretroshare/src/pqi/p3netmgr.h | 46 ++++++++--------- libretroshare/src/pqi/p3notify.cc | 47 ++++++++--------- libretroshare/src/pqi/p3notify.h | 46 ++++++++--------- libretroshare/src/pqi/p3peermgr.cc | 48 ++++++++---------- libretroshare/src/pqi/p3peermgr.h | 46 ++++++++--------- libretroshare/src/pqi/p3servicecontrol.cc | 46 ++++++++--------- libretroshare/src/pqi/p3servicecontrol.h | 47 ++++++++--------- libretroshare/src/pqi/p3upnpmgr.h | 47 ++++++++--------- libretroshare/src/pqi/pqi.h | 47 ++++++++--------- libretroshare/src/pqi/pqi_base.h | 48 ++++++++---------- libretroshare/src/pqi/pqiarchive.cc | 45 ++++++++--------- libretroshare/src/pqi/pqiarchive.h | 46 ++++++++--------- libretroshare/src/pqi/pqiassist.h | 47 ++++++++--------- libretroshare/src/pqi/pqibin.cc | 46 ++++++++--------- libretroshare/src/pqi/pqibin.h | 48 ++++++++---------- libretroshare/src/pqi/pqihandler.cc | 46 ++++++++--------- libretroshare/src/pqi/pqihandler.h | 46 ++++++++--------- libretroshare/src/pqi/pqihash.h | 46 ++++++++--------- libretroshare/src/pqi/pqiindic.h | 48 ++++++++---------- libretroshare/src/pqi/pqiipset.cc | 46 ++++++++--------- libretroshare/src/pqi/pqiipset.h | 46 ++++++++--------- libretroshare/src/pqi/pqilistener.h | 46 ++++++++--------- libretroshare/src/pqi/pqiloopback.cc | 46 ++++++++--------- libretroshare/src/pqi/pqiloopback.h | 46 ++++++++--------- libretroshare/src/pqi/pqimonitor.cc | 46 ++++++++--------- libretroshare/src/pqi/pqimonitor.h | 45 ++++++++--------- libretroshare/src/pqi/pqinetstatebox.cc | 21 ++++++++ libretroshare/src/pqi/pqinetstatebox.h | 21 ++++++++ libretroshare/src/pqi/pqinetwork.cc | 48 ++++++++---------- libretroshare/src/pqi/pqinetwork.h | 49 ++++++++---------- libretroshare/src/pqi/pqiperson.cc | 46 ++++++++--------- libretroshare/src/pqi/pqiperson.h | 48 ++++++++---------- libretroshare/src/pqi/pqipersongrp.cc | 46 ++++++++--------- libretroshare/src/pqi/pqipersongrp.h | 47 ++++++++--------- libretroshare/src/pqi/pqiqos.cc | 21 ++++++++ libretroshare/src/pqi/pqiqos.h | 45 ++++++++--------- libretroshare/src/pqi/pqiqosstreamer.cc | 46 ++++++++--------- libretroshare/src/pqi/pqiqosstreamer.h | 46 ++++++++--------- libretroshare/src/pqi/pqiservice.cc | 46 ++++++++--------- libretroshare/src/pqi/pqiservice.h | 47 ++++++++--------- libretroshare/src/pqi/pqissl.cc | 48 ++++++++---------- libretroshare/src/pqi/pqissl.h | 50 ++++++++----------- libretroshare/src/pqi/pqissli2pbob.cpp | 21 ++++++++ libretroshare/src/pqi/pqissli2pbob.h | 21 ++++++++ libretroshare/src/pqi/pqissllistener.cc | 48 ++++++++---------- libretroshare/src/pqi/pqissllistener.h | 48 ++++++++---------- libretroshare/src/pqi/pqisslpersongrp.cc | 46 ++++++++--------- libretroshare/src/pqi/pqisslpersongrp.h | 48 ++++++++---------- libretroshare/src/pqi/pqisslproxy.cc | 48 ++++++++---------- libretroshare/src/pqi/pqisslproxy.h | 48 ++++++++---------- libretroshare/src/pqi/pqissludp.cc | 46 ++++++++--------- libretroshare/src/pqi/pqissludp.h | 48 ++++++++---------- libretroshare/src/pqi/pqistore.cc | 48 ++++++++---------- libretroshare/src/pqi/pqistore.h | 48 ++++++++---------- libretroshare/src/pqi/pqistreamer.cc | 47 ++++++++--------- libretroshare/src/pqi/pqistreamer.h | 47 ++++++++--------- libretroshare/src/pqi/pqithreadstreamer.cc | 47 ++++++++--------- libretroshare/src/pqi/pqithreadstreamer.h | 46 ++++++++--------- libretroshare/src/pqi/sslfns.cc | 45 ++++++++--------- libretroshare/src/pqi/sslfns.h | 48 ++++++++---------- libretroshare/src/use_libretroshare.pri | 6 +-- openpgpsdk/src/use_openpgpsdk.pri | 6 +-- retroshare.pri | 6 +-- 181 files changed, 1759 insertions(+), 1961 deletions(-) diff --git a/libbitdht/src/use_libbitdht.pri b/libbitdht/src/use_libbitdht.pri index 086f16a89..a31c0d452 100644 --- a/libbitdht/src/use_libbitdht.pri +++ b/libbitdht/src/use_libbitdht.pri @@ -3,16 +3,16 @@ # Copyright (C) 2018, Retroshare team # # # # This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # +# 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 Affero General Public License for more details. # +# GNU Lesser General Public License for more details. # # # -# You should have received a copy of the GNU Affero General Public License # +# You should have received a copy of the GNU Lesser General Public License # # along with this program. If not, see . # ################################################################################ diff --git a/libretroshare/src/chat/distantchat.cc b/libretroshare/src/chat/distantchat.cc index a6ba359e2..b6da39fe8 100644 --- a/libretroshare/src/chat/distantchat.cc +++ b/libretroshare/src/chat/distantchat.cc @@ -6,16 +6,16 @@ * Copyright 2014 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/chat/distantchat.h b/libretroshare/src/chat/distantchat.h index 25896c4b8..196c1079f 100644 --- a/libretroshare/src/chat/distantchat.h +++ b/libretroshare/src/chat/distantchat.h @@ -6,16 +6,16 @@ * Copyright 2014 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/chat/distributedchat.cc b/libretroshare/src/chat/distributedchat.cc index fce60a65a..0c7a765de 100644 --- a/libretroshare/src/chat/distributedchat.cc +++ b/libretroshare/src/chat/distributedchat.cc @@ -6,16 +6,16 @@ * Copyright 2014 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/chat/distributedchat.h b/libretroshare/src/chat/distributedchat.h index 69168ce01..f0db7f649 100644 --- a/libretroshare/src/chat/distributedchat.h +++ b/libretroshare/src/chat/distributedchat.h @@ -6,16 +6,16 @@ * Copyright 2014 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/chat/p3chatservice.cc b/libretroshare/src/chat/p3chatservice.cc index 71edc4898..77fb91bea 100644 --- a/libretroshare/src/chat/p3chatservice.cc +++ b/libretroshare/src/chat/p3chatservice.cc @@ -6,16 +6,16 @@ * Copyright 2004-2008 by Robert Fernie. * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/chat/p3chatservice.h b/libretroshare/src/chat/p3chatservice.h index e6b66ec35..3a5b08ab9 100644 --- a/libretroshare/src/chat/p3chatservice.h +++ b/libretroshare/src/chat/p3chatservice.h @@ -6,16 +6,16 @@ * Copyright 2004-2008 by Robert Fernie. * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/chat/rschatitems.cc b/libretroshare/src/chat/rschatitems.cc index 17bfce1ec..bd79f6821 100644 --- a/libretroshare/src/chat/rschatitems.cc +++ b/libretroshare/src/chat/rschatitems.cc @@ -6,16 +6,16 @@ * Copyright 2007-2008 by Robert Fernie. * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/chat/rschatitems.h b/libretroshare/src/chat/rschatitems.h index 064044f1a..f2ca0731d 100644 --- a/libretroshare/src/chat/rschatitems.h +++ b/libretroshare/src/chat/rschatitems.h @@ -6,16 +6,16 @@ * Copyright 2007-2008 by Robert Fernie. * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/crypto/chacha20.h b/libretroshare/src/crypto/chacha20.h index 1ecf05411..1b19a1402 100644 --- a/libretroshare/src/crypto/chacha20.h +++ b/libretroshare/src/crypto/chacha20.h @@ -6,16 +6,16 @@ * Copyright 2016 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/crypto/hashstream.cc b/libretroshare/src/crypto/hashstream.cc index 22bb64059..88709acfc 100644 --- a/libretroshare/src/crypto/hashstream.cc +++ b/libretroshare/src/crypto/hashstream.cc @@ -6,16 +6,16 @@ * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/crypto/hashstream.h b/libretroshare/src/crypto/hashstream.h index 5714b6816..fe276b6b4 100644 --- a/libretroshare/src/crypto/hashstream.h +++ b/libretroshare/src/crypto/hashstream.h @@ -6,16 +6,16 @@ * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/dht/connectstatebox.cc b/libretroshare/src/dht/connectstatebox.cc index 7ca107fa9..a5b0d44cb 100644 --- a/libretroshare/src/dht/connectstatebox.cc +++ b/libretroshare/src/dht/connectstatebox.cc @@ -6,16 +6,16 @@ * Copyright 2011-2011 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/dht/connectstatebox.h b/libretroshare/src/dht/connectstatebox.h index 5eac8b6c8..15334c284 100644 --- a/libretroshare/src/dht/connectstatebox.h +++ b/libretroshare/src/dht/connectstatebox.h @@ -6,16 +6,16 @@ * Copyright 2011-2011 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/dht/p3bitdht.cc b/libretroshare/src/dht/p3bitdht.cc index b7320c0ac..a1fed1824 100644 --- a/libretroshare/src/dht/p3bitdht.cc +++ b/libretroshare/src/dht/p3bitdht.cc @@ -6,16 +6,16 @@ * Copyright 2009-2010 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/dht/p3bitdht.h b/libretroshare/src/dht/p3bitdht.h index 09fcd7263..2935fcf16 100644 --- a/libretroshare/src/dht/p3bitdht.h +++ b/libretroshare/src/dht/p3bitdht.h @@ -6,16 +6,16 @@ * Copyright 2009-2010 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/dht/stunaddrassist.h b/libretroshare/src/dht/stunaddrassist.h index e12f64f73..195337b1a 100644 --- a/libretroshare/src/dht/stunaddrassist.h +++ b/libretroshare/src/dht/stunaddrassist.h @@ -6,16 +6,16 @@ * Copyright 2011-2011 by Robert Fernie. * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/dir_hierarchy.cc b/libretroshare/src/file_sharing/dir_hierarchy.cc index 46ddd0164..743176e38 100644 --- a/libretroshare/src/file_sharing/dir_hierarchy.cc +++ b/libretroshare/src/file_sharing/dir_hierarchy.cc @@ -6,16 +6,16 @@ * Copyright 2016 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/dir_hierarchy.h b/libretroshare/src/file_sharing/dir_hierarchy.h index 30b30760e..50b8217b0 100644 --- a/libretroshare/src/file_sharing/dir_hierarchy.h +++ b/libretroshare/src/file_sharing/dir_hierarchy.h @@ -6,16 +6,16 @@ * Copyright 2016 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/directory_storage.cc b/libretroshare/src/file_sharing/directory_storage.cc index abcd4cc00..a0164a94b 100644 --- a/libretroshare/src/file_sharing/directory_storage.cc +++ b/libretroshare/src/file_sharing/directory_storage.cc @@ -6,16 +6,16 @@ * Copyright 2016 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/directory_storage.h b/libretroshare/src/file_sharing/directory_storage.h index 51f3edabe..e7c4d14b7 100644 --- a/libretroshare/src/file_sharing/directory_storage.h +++ b/libretroshare/src/file_sharing/directory_storage.h @@ -6,16 +6,16 @@ * Copyright 2016 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/directory_updater.cc b/libretroshare/src/file_sharing/directory_updater.cc index ba600224b..3bf125839 100644 --- a/libretroshare/src/file_sharing/directory_updater.cc +++ b/libretroshare/src/file_sharing/directory_updater.cc @@ -6,16 +6,16 @@ * Copyright 2016 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/directory_updater.h b/libretroshare/src/file_sharing/directory_updater.h index e518ee80c..366e1330e 100644 --- a/libretroshare/src/file_sharing/directory_updater.h +++ b/libretroshare/src/file_sharing/directory_updater.h @@ -6,16 +6,16 @@ * Copyright 2016 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/file_sharing_defaults.h b/libretroshare/src/file_sharing/file_sharing_defaults.h index 8de4b31c8..09bf937d5 100644 --- a/libretroshare/src/file_sharing/file_sharing_defaults.h +++ b/libretroshare/src/file_sharing/file_sharing_defaults.h @@ -1,29 +1,24 @@ -/* - * RetroShare C++ File sharing default variables - * - * file_sharing/file_sharing_defaults.h - * - * Copyright 2016 by Mr.Alice - * - * 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.project@gmail.com". - * - */ - - +/******************************************************************************* + * libretroshare/src/file_sharing: file_sharing_defaults.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Mr.Alice * + * * + * 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 . * + * * + ******************************************************************************/ #pragma once static const uint32_t DELAY_BETWEEN_DIRECTORY_UPDATES = 600 ; // 10 minutes diff --git a/libretroshare/src/file_sharing/file_tree.cc b/libretroshare/src/file_sharing/file_tree.cc index 76ce41651..e96217804 100644 --- a/libretroshare/src/file_sharing/file_tree.cc +++ b/libretroshare/src/file_sharing/file_tree.cc @@ -6,16 +6,16 @@ * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/file_tree.h b/libretroshare/src/file_sharing/file_tree.h index 37f64c776..c5328a6df 100644 --- a/libretroshare/src/file_sharing/file_tree.h +++ b/libretroshare/src/file_sharing/file_tree.h @@ -6,16 +6,16 @@ * Copyright 2018 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/filelist_io.cc b/libretroshare/src/file_sharing/filelist_io.cc index 51cec3c92..a8bb35a9d 100644 --- a/libretroshare/src/file_sharing/filelist_io.cc +++ b/libretroshare/src/file_sharing/filelist_io.cc @@ -6,16 +6,16 @@ * Copyright 2018 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/filelist_io.h b/libretroshare/src/file_sharing/filelist_io.h index bda8e089a..65863ffd0 100644 --- a/libretroshare/src/file_sharing/filelist_io.h +++ b/libretroshare/src/file_sharing/filelist_io.h @@ -6,16 +6,16 @@ * Copyright 2018 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/hash_cache.cc b/libretroshare/src/file_sharing/hash_cache.cc index 8db7b3ed4..c67216e86 100644 --- a/libretroshare/src/file_sharing/hash_cache.cc +++ b/libretroshare/src/file_sharing/hash_cache.cc @@ -6,16 +6,16 @@ * Copyright 2018 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/hash_cache.h b/libretroshare/src/file_sharing/hash_cache.h index de4b32943..f9123b998 100644 --- a/libretroshare/src/file_sharing/hash_cache.h +++ b/libretroshare/src/file_sharing/hash_cache.h @@ -6,16 +6,16 @@ * Copyright 2018 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/p3filelists.cc b/libretroshare/src/file_sharing/p3filelists.cc index 01ae6034e..9458643f1 100644 --- a/libretroshare/src/file_sharing/p3filelists.cc +++ b/libretroshare/src/file_sharing/p3filelists.cc @@ -6,16 +6,16 @@ * Copyright 2018 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/p3filelists.h b/libretroshare/src/file_sharing/p3filelists.h index e285a4e23..44e5ec4b4 100644 --- a/libretroshare/src/file_sharing/p3filelists.h +++ b/libretroshare/src/file_sharing/p3filelists.h @@ -6,16 +6,16 @@ * Copyright 2018 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/rsfilelistitems.cc b/libretroshare/src/file_sharing/rsfilelistitems.cc index 77628777c..49aa4edff 100644 --- a/libretroshare/src/file_sharing/rsfilelistitems.cc +++ b/libretroshare/src/file_sharing/rsfilelistitems.cc @@ -6,16 +6,16 @@ * Copyright 2018 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/file_sharing/rsfilelistitems.h b/libretroshare/src/file_sharing/rsfilelistitems.h index eaadaf7bd..337bde15f 100644 --- a/libretroshare/src/file_sharing/rsfilelistitems.h +++ b/libretroshare/src/file_sharing/rsfilelistitems.h @@ -6,16 +6,16 @@ * Copyright 2018 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/ft/ftchunkmap.cc b/libretroshare/src/ft/ftchunkmap.cc index b7630ccb2..93a9a590c 100644 --- a/libretroshare/src/ft/ftchunkmap.cc +++ b/libretroshare/src/ft/ftchunkmap.cc @@ -6,16 +6,16 @@ * Copyright 2010 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/ft/ftchunkmap.h b/libretroshare/src/ft/ftchunkmap.h index f6364596c..a9307b966 100644 --- a/libretroshare/src/ft/ftchunkmap.h +++ b/libretroshare/src/ft/ftchunkmap.h @@ -6,16 +6,16 @@ * Copyright 2010 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * ******************************************************************************/ diff --git a/libretroshare/src/ft/ftcontroller.cc b/libretroshare/src/ft/ftcontroller.cc index c80712d23..bb0a56588 100644 --- a/libretroshare/src/ft/ftcontroller.cc +++ b/libretroshare/src/ft/ftcontroller.cc @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftcontroller.h b/libretroshare/src/ft/ftcontroller.h index 8499f1e5b..6564ae7be 100644 --- a/libretroshare/src/ft/ftcontroller.h +++ b/libretroshare/src/ft/ftcontroller.h @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftdata.h b/libretroshare/src/ft/ftdata.h index b66b32fc2..349dae521 100644 --- a/libretroshare/src/ft/ftdata.h +++ b/libretroshare/src/ft/ftdata.h @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftdatamultiplex.cc b/libretroshare/src/ft/ftdatamultiplex.cc index 7800468d0..56cdd9f52 100644 --- a/libretroshare/src/ft/ftdatamultiplex.cc +++ b/libretroshare/src/ft/ftdatamultiplex.cc @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftdatamultiplex.h b/libretroshare/src/ft/ftdatamultiplex.h index 4bb8c3109..57acda1f2 100644 --- a/libretroshare/src/ft/ftdatamultiplex.h +++ b/libretroshare/src/ft/ftdatamultiplex.h @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftextralist.cc b/libretroshare/src/ft/ftextralist.cc index d2c70b3d9..cf5a4f603 100644 --- a/libretroshare/src/ft/ftextralist.cc +++ b/libretroshare/src/ft/ftextralist.cc @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftextralist.h b/libretroshare/src/ft/ftextralist.h index e148a505f..5832b33fd 100644 --- a/libretroshare/src/ft/ftextralist.h +++ b/libretroshare/src/ft/ftextralist.h @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftfilecreator.cc b/libretroshare/src/ft/ftfilecreator.cc index 69e7b9cf8..fc25fe426 100644 --- a/libretroshare/src/ft/ftfilecreator.cc +++ b/libretroshare/src/ft/ftfilecreator.cc @@ -6,16 +6,16 @@ * Copyright 2008 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftfilecreator.h b/libretroshare/src/ft/ftfilecreator.h index b0461524d..004558307 100644 --- a/libretroshare/src/ft/ftfilecreator.h +++ b/libretroshare/src/ft/ftfilecreator.h @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftfileprovider.cc b/libretroshare/src/ft/ftfileprovider.cc index 44fbe7945..543464515 100644 --- a/libretroshare/src/ft/ftfileprovider.cc +++ b/libretroshare/src/ft/ftfileprovider.cc @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftfileprovider.h b/libretroshare/src/ft/ftfileprovider.h index eedda8693..f0d9d60d1 100644 --- a/libretroshare/src/ft/ftfileprovider.h +++ b/libretroshare/src/ft/ftfileprovider.h @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftfilesearch.cc b/libretroshare/src/ft/ftfilesearch.cc index ed021e66d..c9571f9a8 100644 --- a/libretroshare/src/ft/ftfilesearch.cc +++ b/libretroshare/src/ft/ftfilesearch.cc @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftfilesearch.h b/libretroshare/src/ft/ftfilesearch.h index f4b4e8abe..46c11d33c 100644 --- a/libretroshare/src/ft/ftfilesearch.h +++ b/libretroshare/src/ft/ftfilesearch.h @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftsearch.h b/libretroshare/src/ft/ftsearch.h index 710e3ee92..7906d275f 100644 --- a/libretroshare/src/ft/ftsearch.h +++ b/libretroshare/src/ft/ftsearch.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/ft: ftsearch.h - * - * File Transfer for RetroShare. - * - * Copyright 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/ft: ftsearch.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef FT_SEARCH_HEADER #define FT_SEARCH_HEADER diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index e24f75a2c..1a8b40c87 100644 --- a/libretroshare/src/ft/ftserver.cc +++ b/libretroshare/src/ft/ftserver.cc @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftserver.h b/libretroshare/src/ft/ftserver.h index 541db6e68..f21d154bc 100644 --- a/libretroshare/src/ft/ftserver.h +++ b/libretroshare/src/ft/ftserver.h @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/fttransfermodule.cc b/libretroshare/src/ft/fttransfermodule.cc index 9559bcb0a..136be4653 100644 --- a/libretroshare/src/ft/fttransfermodule.cc +++ b/libretroshare/src/ft/fttransfermodule.cc @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/fttransfermodule.h b/libretroshare/src/ft/fttransfermodule.h index 52e015c90..9999cbdc1 100644 --- a/libretroshare/src/ft/fttransfermodule.h +++ b/libretroshare/src/ft/fttransfermodule.h @@ -6,16 +6,16 @@ * Copyright 2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftturtlefiletransferitem.cc b/libretroshare/src/ft/ftturtlefiletransferitem.cc index d3c4e7ac6..14150e42d 100644 --- a/libretroshare/src/ft/ftturtlefiletransferitem.cc +++ b/libretroshare/src/ft/ftturtlefiletransferitem.cc @@ -6,16 +6,16 @@ * Copyright 2013 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/ft/ftturtlefiletransferitem.h b/libretroshare/src/ft/ftturtlefiletransferitem.h index 211884932..6bbc24aef 100644 --- a/libretroshare/src/ft/ftturtlefiletransferitem.h +++ b/libretroshare/src/ft/ftturtlefiletransferitem.h @@ -6,16 +6,16 @@ * Copyright 2013 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/grouter/groutercache.h b/libretroshare/src/grouter/groutercache.h index d969bfda9..e406976b8 100644 --- a/libretroshare/src/grouter/groutercache.h +++ b/libretroshare/src/grouter/groutercache.h @@ -6,16 +6,16 @@ * Copyright 2013 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/grouter/grouteritems.cc b/libretroshare/src/grouter/grouteritems.cc index 7738a175d..1e098de00 100644 --- a/libretroshare/src/grouter/grouteritems.cc +++ b/libretroshare/src/grouter/grouteritems.cc @@ -6,16 +6,16 @@ * Copyright 2013 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/grouter/grouteritems.h b/libretroshare/src/grouter/grouteritems.h index 312dfad99..43b69be7d 100644 --- a/libretroshare/src/grouter/grouteritems.h +++ b/libretroshare/src/grouter/grouteritems.h @@ -6,16 +6,16 @@ * Copyright 2013 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/grouter/groutertypes.h b/libretroshare/src/grouter/groutertypes.h index c19fa55ee..ee1bda7dc 100644 --- a/libretroshare/src/grouter/groutertypes.h +++ b/libretroshare/src/grouter/groutertypes.h @@ -6,16 +6,16 @@ * Copyright 2013 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/grouter/p3grouter.cc b/libretroshare/src/grouter/p3grouter.cc index 48966db2f..de5cd0d11 100644 --- a/libretroshare/src/grouter/p3grouter.cc +++ b/libretroshare/src/grouter/p3grouter.cc @@ -6,16 +6,16 @@ * Copyright 2013 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/grouter/p3grouter.h b/libretroshare/src/grouter/p3grouter.h index 7d20f522b..a981a8dbc 100644 --- a/libretroshare/src/grouter/p3grouter.h +++ b/libretroshare/src/grouter/p3grouter.h @@ -6,16 +6,16 @@ * Copyright 2013 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/gxssecurity.cc b/libretroshare/src/gxs/gxssecurity.cc index 153431c56..608e938fc 100644 --- a/libretroshare/src/gxs/gxssecurity.cc +++ b/libretroshare/src/gxs/gxssecurity.cc @@ -7,16 +7,16 @@ * 2011-2012 Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/gxssecurity.h b/libretroshare/src/gxs/gxssecurity.h index ebbf3ba4c..7b607c916 100644 --- a/libretroshare/src/gxs/gxssecurity.h +++ b/libretroshare/src/gxs/gxssecurity.h @@ -7,16 +7,16 @@ * 2011-2012 Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/gxstokenqueue.cc b/libretroshare/src/gxs/gxstokenqueue.cc index 64d1ec9db..568daf88a 100644 --- a/libretroshare/src/gxs/gxstokenqueue.cc +++ b/libretroshare/src/gxs/gxstokenqueue.cc @@ -6,16 +6,16 @@ * Copyright 2012-2012 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/gxstokenqueue.h b/libretroshare/src/gxs/gxstokenqueue.h index 0ea43d345..0b58f7c3d 100644 --- a/libretroshare/src/gxs/gxstokenqueue.h +++ b/libretroshare/src/gxs/gxstokenqueue.h @@ -6,16 +6,16 @@ * Copyright 2012-2012 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsdataservice.cc b/libretroshare/src/gxs/rsdataservice.cc index 3c2e48021..e618c91f2 100644 --- a/libretroshare/src/gxs/rsdataservice.cc +++ b/libretroshare/src/gxs/rsdataservice.cc @@ -6,16 +6,16 @@ * Copyright 2011-2011 by Evi-Parker Christopher * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsdataservice.h b/libretroshare/src/gxs/rsdataservice.h index 4fa5c866f..a99847304 100644 --- a/libretroshare/src/gxs/rsdataservice.h +++ b/libretroshare/src/gxs/rsdataservice.h @@ -6,16 +6,16 @@ * Copyright 2011-2012 by Evi-Parker Christopher * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgds.h b/libretroshare/src/gxs/rsgds.h index 9c23d920e..5c326f1cc 100644 --- a/libretroshare/src/gxs/rsgds.h +++ b/libretroshare/src/gxs/rsgds.h @@ -6,16 +6,16 @@ * Copyright 2011-2011 by Robert Fernie, Evi-Parker Christopher * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index fe3781e85..bf770e1ca 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -6,16 +6,16 @@ * Copyright 2012-2012 by Robert Fernie, Evi-Parker Christopher * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h index 8a8af9444..c841dc3d3 100644 --- a/libretroshare/src/gxs/rsgenexchange.h +++ b/libretroshare/src/gxs/rsgenexchange.h @@ -6,16 +6,16 @@ * Copyright 2012-2012 by Robert Fernie, Evi-Parker Christopher * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgixs.h b/libretroshare/src/gxs/rsgixs.h index 21a4cf1c4..98b99be54 100644 --- a/libretroshare/src/gxs/rsgixs.h +++ b/libretroshare/src/gxs/rsgixs.h @@ -6,16 +6,16 @@ * Copyright 2011-2011 by Robert Fernie, Evi-Parker Christopher * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgxs.h b/libretroshare/src/gxs/rsgxs.h index 0719d6109..3f25b087b 100644 --- a/libretroshare/src/gxs/rsgxs.h +++ b/libretroshare/src/gxs/rsgxs.h @@ -6,16 +6,16 @@ * Copyright 2012 Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgxsdata.cc b/libretroshare/src/gxs/rsgxsdata.cc index b69606f72..0ec61de8e 100644 --- a/libretroshare/src/gxs/rsgxsdata.cc +++ b/libretroshare/src/gxs/rsgxsdata.cc @@ -6,16 +6,16 @@ * Copyright 2012-2012 by Christopher Evi-Parker, Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgxsdata.h b/libretroshare/src/gxs/rsgxsdata.h index c1d6becc4..fffcfbe6a 100644 --- a/libretroshare/src/gxs/rsgxsdata.h +++ b/libretroshare/src/gxs/rsgxsdata.h @@ -6,16 +6,16 @@ * Copyright 2012-2012 by Christopher Evi-Parker, Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgxsdataaccess.cc b/libretroshare/src/gxs/rsgxsdataaccess.cc index 383fcf840..cb84b27b9 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.cc +++ b/libretroshare/src/gxs/rsgxsdataaccess.cc @@ -6,16 +6,16 @@ * Copyright 2012-2013 by Christopher Evi-Parker, Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgxsdataaccess.h b/libretroshare/src/gxs/rsgxsdataaccess.h index 741a3b78d..2849af07d 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.h +++ b/libretroshare/src/gxs/rsgxsdataaccess.h @@ -6,16 +6,16 @@ * Copyright 2012-2012 by Christopher Evi-Parker, Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index eff91a417..fe2ce1dd9 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -6,16 +6,16 @@ * Copyright 2012-2012 by Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index 9ec6bdf9b..509ce5cdc 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -6,16 +6,16 @@ * Copyright 2012-2012 by Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgxsnetutils.cc b/libretroshare/src/gxs/rsgxsnetutils.cc index 4796cffd6..7195ff519 100644 --- a/libretroshare/src/gxs/rsgxsnetutils.cc +++ b/libretroshare/src/gxs/rsgxsnetutils.cc @@ -6,16 +6,16 @@ * Copyright 2012-2013 by Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgxsnetutils.h b/libretroshare/src/gxs/rsgxsnetutils.h index 39d9a6112..90ab64cf9 100644 --- a/libretroshare/src/gxs/rsgxsnetutils.h +++ b/libretroshare/src/gxs/rsgxsnetutils.h @@ -6,16 +6,16 @@ * Copyright 2012-2013 by Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgxsrequesttypes.cc b/libretroshare/src/gxs/rsgxsrequesttypes.cc index 57fff5143..d57b4d353 100644 --- a/libretroshare/src/gxs/rsgxsrequesttypes.cc +++ b/libretroshare/src/gxs/rsgxsrequesttypes.cc @@ -6,16 +6,16 @@ * Copyright 2012-2012 by Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgxsrequesttypes.h b/libretroshare/src/gxs/rsgxsrequesttypes.h index 72138e801..aa485edbb 100644 --- a/libretroshare/src/gxs/rsgxsrequesttypes.h +++ b/libretroshare/src/gxs/rsgxsrequesttypes.h @@ -6,16 +6,16 @@ * Copyright 2012-2012 by Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgxsutil.cc b/libretroshare/src/gxs/rsgxsutil.cc index b6e26e6e3..149bd3128 100644 --- a/libretroshare/src/gxs/rsgxsutil.cc +++ b/libretroshare/src/gxs/rsgxsutil.cc @@ -6,16 +6,16 @@ * Copyright 2013-2013 by Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsgxsutil.h b/libretroshare/src/gxs/rsgxsutil.h index 67c384cfc..3fc7f8508 100644 --- a/libretroshare/src/gxs/rsgxsutil.h +++ b/libretroshare/src/gxs/rsgxsutil.h @@ -6,16 +6,16 @@ * Copyright 2013-2013 by Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxs/rsnxsobserver.h b/libretroshare/src/gxs/rsnxsobserver.h index 90c306129..4404ee806 100644 --- a/libretroshare/src/gxs/rsnxsobserver.h +++ b/libretroshare/src/gxs/rsnxsobserver.h @@ -6,16 +6,16 @@ * Copyright 2011-2012 by Robert Fernie, Evi-Parker Christopher * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxstrans/p3gxstrans.cc b/libretroshare/src/gxstrans/p3gxstrans.cc index 373f0bc1c..0efa7e578 100644 --- a/libretroshare/src/gxstrans/p3gxstrans.cc +++ b/libretroshare/src/gxstrans/p3gxstrans.cc @@ -6,16 +6,16 @@ * Copyright (C) 2016-2017 Gioacchino Mazzurco * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxstrans/p3gxstrans.h b/libretroshare/src/gxstrans/p3gxstrans.h index efddf9929..2b5abdead 100644 --- a/libretroshare/src/gxstrans/p3gxstrans.h +++ b/libretroshare/src/gxstrans/p3gxstrans.h @@ -6,16 +6,16 @@ * Copyright (C) 2016-2017 Gioacchino Mazzurco * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxstrans/p3gxstransitems.cc b/libretroshare/src/gxstrans/p3gxstransitems.cc index 20fc85540..733d40bec 100644 --- a/libretroshare/src/gxstrans/p3gxstransitems.cc +++ b/libretroshare/src/gxstrans/p3gxstransitems.cc @@ -6,16 +6,16 @@ * Copyright (C) 2016-2018 Gioacchino Mazzurco * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxstrans/p3gxstransitems.h b/libretroshare/src/gxstrans/p3gxstransitems.h index 63b4792a5..cc7322844 100644 --- a/libretroshare/src/gxstrans/p3gxstransitems.h +++ b/libretroshare/src/gxstrans/p3gxstransitems.h @@ -6,16 +6,16 @@ * Copyright (C) 2016-2017 Gioacchino Mazzurco * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.cc b/libretroshare/src/gxstunnel/p3gxstunnel.cc index d9b7afd97..7fd417549 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.cc +++ b/libretroshare/src/gxstunnel/p3gxstunnel.cc @@ -6,16 +6,16 @@ * Copyright 2015 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.h b/libretroshare/src/gxstunnel/p3gxstunnel.h index 4284ba64d..c5f709707 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.h +++ b/libretroshare/src/gxstunnel/p3gxstunnel.h @@ -6,16 +6,16 @@ * Copyright 2015 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxstunnel/rsgxstunnelitems.cc b/libretroshare/src/gxstunnel/rsgxstunnelitems.cc index 0569337ac..a86625f0f 100644 --- a/libretroshare/src/gxstunnel/rsgxstunnelitems.cc +++ b/libretroshare/src/gxstunnel/rsgxstunnelitems.cc @@ -6,16 +6,16 @@ * Copyright 2015 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/gxstunnel/rsgxstunnelitems.h b/libretroshare/src/gxstunnel/rsgxstunnelitems.h index eea267503..a098c8c05 100644 --- a/libretroshare/src/gxstunnel/rsgxstunnelitems.h +++ b/libretroshare/src/gxstunnel/rsgxstunnelitems.h @@ -6,16 +6,16 @@ * Copyright 2015 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index 3e5ead553..f2ef3e4fc 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -3,16 +3,16 @@ # Copyright (C) 2018, Retroshare team # # # # This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # +# 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 Affero General Public License for more details. # +# GNU Lesser General Public License for more details. # # # -# You should have received a copy of the GNU Affero General Public License # +# You should have received a copy of the GNU Lesser General Public License # # along with this program. If not, see . # ################################################################################ !include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri") diff --git a/libretroshare/src/pgp/pgpauxutils.cc b/libretroshare/src/pgp/pgpauxutils.cc index ff69f1a1a..abf92e5ac 100644 --- a/libretroshare/src/pgp/pgpauxutils.cc +++ b/libretroshare/src/pgp/pgpauxutils.cc @@ -6,16 +6,16 @@ * Copyright 2014 Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/pgp/pgpauxutils.h b/libretroshare/src/pgp/pgpauxutils.h index ff16caf92..6ead67a2d 100644 --- a/libretroshare/src/pgp/pgpauxutils.h +++ b/libretroshare/src/pgp/pgpauxutils.h @@ -6,16 +6,16 @@ * Copyright 2014 Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/pgp/pgphandler.cc b/libretroshare/src/pgp/pgphandler.cc index 5b8bddf43..709231f20 100644 --- a/libretroshare/src/pgp/pgphandler.cc +++ b/libretroshare/src/pgp/pgphandler.cc @@ -6,16 +6,16 @@ * Copyright 2018 Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/pgp/pgphandler.h b/libretroshare/src/pgp/pgphandler.h index 2210611fe..9fe4abfbb 100644 --- a/libretroshare/src/pgp/pgphandler.h +++ b/libretroshare/src/pgp/pgphandler.h @@ -6,16 +6,16 @@ * Copyright 2018 Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/pgp/pgpkeyutil.cc b/libretroshare/src/pgp/pgpkeyutil.cc index ca02a4f14..e8f1f1d5b 100644 --- a/libretroshare/src/pgp/pgpkeyutil.cc +++ b/libretroshare/src/pgp/pgpkeyutil.cc @@ -6,16 +6,16 @@ * Copyright 2018 Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/pgp/pgpkeyutil.h b/libretroshare/src/pgp/pgpkeyutil.h index d117b010c..38a02dedf 100644 --- a/libretroshare/src/pgp/pgpkeyutil.h +++ b/libretroshare/src/pgp/pgpkeyutil.h @@ -6,16 +6,16 @@ * Copyright 2012 Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/pgp/rscertificate.cc b/libretroshare/src/pgp/rscertificate.cc index 5eaadfbea..88424fa29 100644 --- a/libretroshare/src/pgp/rscertificate.cc +++ b/libretroshare/src/pgp/rscertificate.cc @@ -6,16 +6,16 @@ * Copyright 2016 Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/pgp/rscertificate.h b/libretroshare/src/pgp/rscertificate.h index 8b82b2cfa..4dda06789 100644 --- a/libretroshare/src/pgp/rscertificate.h +++ b/libretroshare/src/pgp/rscertificate.h @@ -6,16 +6,16 @@ * Copyright 2016 Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/plugins/dlfcn_win32.cc b/libretroshare/src/plugins/dlfcn_win32.cc index 3677a4706..83404e965 100644 --- a/libretroshare/src/plugins/dlfcn_win32.cc +++ b/libretroshare/src/plugins/dlfcn_win32.cc @@ -6,16 +6,16 @@ * Copyright 2007 Ramiro Polla * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/plugins/dlfcn_win32.h b/libretroshare/src/plugins/dlfcn_win32.h index 0b21e9e53..3298777dd 100644 --- a/libretroshare/src/plugins/dlfcn_win32.h +++ b/libretroshare/src/plugins/dlfcn_win32.h @@ -6,16 +6,16 @@ * Copyright 2007 Ramiro Polla * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/plugins/pluginmanager.cc b/libretroshare/src/plugins/pluginmanager.cc index b8f6fdcec..ea3a72932 100644 --- a/libretroshare/src/plugins/pluginmanager.cc +++ b/libretroshare/src/plugins/pluginmanager.cc @@ -6,16 +6,16 @@ * Copyright 2012 Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/plugins/pluginmanager.h b/libretroshare/src/plugins/pluginmanager.h index 540068428..021a80463 100644 --- a/libretroshare/src/plugins/pluginmanager.h +++ b/libretroshare/src/plugins/pluginmanager.h @@ -6,16 +6,16 @@ * Copyright 2012 Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/pqi/authgpg.cc b/libretroshare/src/pqi/authgpg.cc index 4d7d0f446..2da8275c3 100644 --- a/libretroshare/src/pqi/authgpg.cc +++ b/libretroshare/src/pqi/authgpg.cc @@ -6,16 +6,16 @@ * Copyright 2008-2009 by Robert Fernie, Retroshare Team. * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/pqi/authgpg.h b/libretroshare/src/pqi/authgpg.h index 4f0149908..588148e86 100644 --- a/libretroshare/src/pqi/authgpg.h +++ b/libretroshare/src/pqi/authgpg.h @@ -6,16 +6,16 @@ * Copyright 2008-2009 by Raghu Dev R. * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/pqi/authssl.cc b/libretroshare/src/pqi/authssl.cc index 19201906c..a885c3318 100644 --- a/libretroshare/src/pqi/authssl.cc +++ b/libretroshare/src/pqi/authssl.cc @@ -6,16 +6,16 @@ * Copyright 2004-2008 by Robert Fernie, Retroshare Team. * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/pqi/authssl.h b/libretroshare/src/pqi/authssl.h index c0ea77449..e6dd33078 100644 --- a/libretroshare/src/pqi/authssl.h +++ b/libretroshare/src/pqi/authssl.h @@ -6,16 +6,16 @@ * Copyright 2004-2008 by Robert Fernie, Retroshare Team. * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/pqi/p3cfgmgr.cc b/libretroshare/src/pqi/p3cfgmgr.cc index 0182303eb..d601c460e 100644 --- a/libretroshare/src/pqi/p3cfgmgr.cc +++ b/libretroshare/src/pqi/p3cfgmgr.cc @@ -6,16 +6,16 @@ * Copyright 2007-2008 by Robert Fernie, Retroshare Team. * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ diff --git a/libretroshare/src/pqi/p3cfgmgr.h b/libretroshare/src/pqi/p3cfgmgr.h index 91de5136a..b1e554c98 100644 --- a/libretroshare/src/pqi/p3cfgmgr.h +++ b/libretroshare/src/pqi/p3cfgmgr.h @@ -3,49 +3,22 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2004-2008 by Robert Fernie, Retroshare Team. * + * Copyright 2004-2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * + * 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 Affero General Public License for more details. * + * GNU Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Affero General Public License * + * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * * * *******************************************************************************/ -/* - * libretroshare/src/pqi: p3cfgmgr.h - * - * 3P/PQI network interface for RetroShare. - * - * 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". - * - */ - - - #ifndef P3_CONFIG_MGR_HEADER #define P3_CONFIG_MGR_HEADER diff --git a/libretroshare/src/pqi/p3historymgr.cc b/libretroshare/src/pqi/p3historymgr.cc index e1acb0888..00b36a505 100644 --- a/libretroshare/src/pqi/p3historymgr.cc +++ b/libretroshare/src/pqi/p3historymgr.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: p3HistoryMgr.cc - * - * RetroShare C++ . - * - * 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/pqi: p3historymgr.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 . * + * * + *******************************************************************************/ #include #include "p3historymgr.h" diff --git a/libretroshare/src/pqi/p3historymgr.h b/libretroshare/src/pqi/p3historymgr.h index 3f3c9a6f1..897688fa8 100644 --- a/libretroshare/src/pqi/p3historymgr.h +++ b/libretroshare/src/pqi/p3historymgr.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/pqi: p3historymgr.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 . * + * * + *******************************************************************************/ #ifndef RS_P3_HISTORY_MGR_H #define RS_P3_HISTORY_MGR_H -/* - * libretroshare/src/services: p3historymgr.h - * - * RetroShare C++ - * - * 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 #include diff --git a/libretroshare/src/pqi/p3linkmgr.cc b/libretroshare/src/pqi/p3linkmgr.cc index 302efd255..c380c205b 100644 --- a/libretroshare/src/pqi/p3linkmgr.cc +++ b/libretroshare/src/pqi/p3linkmgr.cc @@ -1,29 +1,25 @@ -/* - * libretroshare/src/pqi: p3linkmgr.cc - * - * 3P/PQI network interface for RetroShare. - * - * Copyright (C) 2007-2011 Robert Fernie. - * Copyright (C) 2015-2018 Gioacchino Mazzurco - * - * 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/pqi: p3linkmgr.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2011 by Robert Fernie. * + * Copyright (C) 2015-2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/p3linkmgr.h" #include "pqi/p3peermgr.h" diff --git a/libretroshare/src/pqi/p3linkmgr.h b/libretroshare/src/pqi/p3linkmgr.h index 1fee7d6f2..57638c174 100644 --- a/libretroshare/src/pqi/p3linkmgr.h +++ b/libretroshare/src/pqi/p3linkmgr.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi: p3linkmgr.h - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2007-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/pqi: p3linkmgr.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_LINK_MANAGER_HEADER #define MRK_PQI_LINK_MANAGER_HEADER diff --git a/libretroshare/src/pqi/p3netmgr.cc b/libretroshare/src/pqi/p3netmgr.cc index 7ca1713f7..8a98aacb1 100644 --- a/libretroshare/src/pqi/p3netmgr.cc +++ b/libretroshare/src/pqi/p3netmgr.cc @@ -1,29 +1,25 @@ -/* - * libretroshare/src/pqi: p3netmgr.cc - * - * 3P/PQI network interface for RetroShare. - * - * Copyright (C) 2007-2011 Robert Fernie - * Copyright (C) 2015-2018 Gioacchino Mazzurco - * - * 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/pqi: p3netmgr.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2011 by Robert Fernie. * + * Copyright (C) 2015-2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #include #include diff --git a/libretroshare/src/pqi/p3netmgr.h b/libretroshare/src/pqi/p3netmgr.h index 1b379afec..56e9b1778 100644 --- a/libretroshare/src/pqi/p3netmgr.h +++ b/libretroshare/src/pqi/p3netmgr.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi: p3netmgr.h - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: p3netmgr.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_NET_MANAGER_HEADER #define MRK_PQI_NET_MANAGER_HEADER diff --git a/libretroshare/src/pqi/p3notify.cc b/libretroshare/src/pqi/p3notify.cc index 43caf9758..d86233c68 100644 --- a/libretroshare/src/pqi/p3notify.cc +++ b/libretroshare/src/pqi/p3notify.cc @@ -1,29 +1,24 @@ -/* - * libretroshare/src/rsserver: p3notify.cc - * - * 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/pqi: p3notify.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2007-2008 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/p3notify.h" #include #include diff --git a/libretroshare/src/pqi/p3notify.h b/libretroshare/src/pqi/p3notify.h index 820c4a6bb..e89481fb9 100644 --- a/libretroshare/src/pqi/p3notify.h +++ b/libretroshare/src/pqi/p3notify.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/pqi: p3notify.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_P3_NOTIFY_INTERFACE_H #define RS_P3_NOTIFY_INTERFACE_H -/* - * libretroshare/src/rsserver: p3notify.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/rsnotify.h" #include "retroshare/rsturtle.h" diff --git a/libretroshare/src/pqi/p3peermgr.cc b/libretroshare/src/pqi/p3peermgr.cc index ba3ecbf84..d67e320f1 100644 --- a/libretroshare/src/pqi/p3peermgr.cc +++ b/libretroshare/src/pqi/p3peermgr.cc @@ -1,29 +1,25 @@ -/* - * libretroshare/src/pqi: p3peermgr.cc - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2007-2011 by Robert Fernie. - * Copyright (C) 2015-2018 Gioacchino Mazzurco - * - * 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/pqi: p3peermgr.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2007-2011 Robert Fernie * + * Copyright (C) 2015-2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #include // for std::vector #include // for std::random_shuffle diff --git a/libretroshare/src/pqi/p3peermgr.h b/libretroshare/src/pqi/p3peermgr.h index 8a0ac5235..dc8a8f41b 100644 --- a/libretroshare/src/pqi/p3peermgr.h +++ b/libretroshare/src/pqi/p3peermgr.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi: p3peermgr.h - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2007-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/pqi: p3peermgr.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_PEER_MANAGER_HEADER #define MRK_PQI_PEER_MANAGER_HEADER diff --git a/libretroshare/src/pqi/p3servicecontrol.cc b/libretroshare/src/pqi/p3servicecontrol.cc index 251777e70..bfcb09031 100644 --- a/libretroshare/src/pqi/p3servicecontrol.cc +++ b/libretroshare/src/pqi/p3servicecontrol.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi: p3servicecontrol.cc - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 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/pqi: p3servicecontrol.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2014-2014 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "p3servicecontrol.h" diff --git a/libretroshare/src/pqi/p3servicecontrol.h b/libretroshare/src/pqi/p3servicecontrol.h index e7f4e5959..6cabf1193 100644 --- a/libretroshare/src/pqi/p3servicecontrol.h +++ b/libretroshare/src/pqi/p3servicecontrol.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/pqi: p3servicecontrol.h - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 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/pqi: p3servicecontrol.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014-2014 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef P3_SERVICE_CONTROL_HEADER #define P3_SERVICE_CONTROL_HEADER diff --git a/libretroshare/src/pqi/p3upnpmgr.h b/libretroshare/src/pqi/p3upnpmgr.h index 47b95d5cc..6f58aa8ae 100644 --- a/libretroshare/src/pqi/p3upnpmgr.h +++ b/libretroshare/src/pqi/p3upnpmgr.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/pqi: p3upnpmgr.h - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2004-2007 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/pqi: p3upnpmgr.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2007 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_P3_UPNP_MANAGER_H #define MRK_P3_UPNP_MANAGER_H diff --git a/libretroshare/src/pqi/pqi.h b/libretroshare/src/pqi/pqi.h index 07cf00f9d..1bf581ff1 100644 --- a/libretroshare/src/pqi/pqi.h +++ b/libretroshare/src/pqi/pqi.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/pqi pqi.h - * - * 3P/PQI network interface 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". - * - */ - - +/******************************************************************************* + * libretroshare/src/pqi: pqi.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef PQI_TOP_HEADER #define PQI_TOP_HEADER diff --git a/libretroshare/src/pqi/pqi_base.h b/libretroshare/src/pqi/pqi_base.h index a7d06c644..0741df1c5 100644 --- a/libretroshare/src/pqi/pqi_base.h +++ b/libretroshare/src/pqi/pqi_base.h @@ -1,30 +1,24 @@ -/* - * "$Id: pqi_base.h,v 1.18 2007-05-05 16:10:05 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqi_base.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef PQI_BASE_ITEM_HEADER #define PQI_BASE_ITEM_HEADER diff --git a/libretroshare/src/pqi/pqiarchive.cc b/libretroshare/src/pqi/pqiarchive.cc index e6d3d65e1..195d560ae 100644 --- a/libretroshare/src/pqi/pqiarchive.cc +++ b/libretroshare/src/pqi/pqiarchive.cc @@ -1,27 +1,24 @@ -/* - * "$Id: pqiarchive.cc,v 1.5 2007-03-21 18:45:41 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqiarchive.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2004-2006 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ /* This is dependent on the sslroot at the moment. * -> as we need to create/restore references to the Person. diff --git a/libretroshare/src/pqi/pqiarchive.h b/libretroshare/src/pqi/pqiarchive.h index e80d634b0..4c2a82a96 100644 --- a/libretroshare/src/pqi/pqiarchive.h +++ b/libretroshare/src/pqi/pqiarchive.h @@ -1,28 +1,24 @@ -/* - * "$Id: pqiarchive.h,v 1.3 2007-02-18 21:46:49 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqiarchive.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifdef SUSPENDED_UNUSED_CODE #ifndef MRK_PQI_ARCHIVE_STREAMER_HEADER diff --git a/libretroshare/src/pqi/pqiassist.h b/libretroshare/src/pqi/pqiassist.h index 9f93b07df..1bc00fbe9 100644 --- a/libretroshare/src/pqi/pqiassist.h +++ b/libretroshare/src/pqi/pqiassist.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/pqi: pqiassist.h - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2004-2007 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/pqi: pqiassist.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2007 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_ASSIST_H #define MRK_PQI_ASSIST_H diff --git a/libretroshare/src/pqi/pqibin.cc b/libretroshare/src/pqi/pqibin.cc index 172a23b14..75e0b4b39 100644 --- a/libretroshare/src/pqi/pqibin.cc +++ b/libretroshare/src/pqi/pqibin.cc @@ -1,28 +1,24 @@ -/* - * "$Id: pqibin.cc,v 1.4 2007-02-18 21:46:49 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqibin.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2004-2006 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/pqibin.h" #include "pqi/authssl.h" #include "util/rsnet.h" diff --git a/libretroshare/src/pqi/pqibin.h b/libretroshare/src/pqi/pqibin.h index 706a0a04f..b8cbb1c58 100644 --- a/libretroshare/src/pqi/pqibin.h +++ b/libretroshare/src/pqi/pqibin.h @@ -1,30 +1,24 @@ -/* - * "$Id: pqibin.h,v 1.2 2007-02-18 21:46:49 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqibin.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef PQI_BIN_INTERFACE_HEADER #define PQI_BIN_INTERFACE_HEADER diff --git a/libretroshare/src/pqi/pqihandler.cc b/libretroshare/src/pqi/pqihandler.cc index a589f7e26..cb7d9f4a2 100644 --- a/libretroshare/src/pqi/pqihandler.cc +++ b/libretroshare/src/pqi/pqihandler.cc @@ -1,28 +1,24 @@ -/* - * "$Id: pqihandler.cc,v 1.12 2007-03-31 09:41:32 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqihandler.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2004-2006 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/pqihandler.h" #include // for NULL diff --git a/libretroshare/src/pqi/pqihandler.h b/libretroshare/src/pqi/pqihandler.h index c285c4ef7..755b13cfd 100644 --- a/libretroshare/src/pqi/pqihandler.h +++ b/libretroshare/src/pqi/pqihandler.h @@ -1,28 +1,24 @@ -/* - * "$Id: pqihandler.h,v 1.10 2007-03-31 09:41:32 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqihandler.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_HANDLER_HEADER #define MRK_PQI_HANDLER_HEADER diff --git a/libretroshare/src/pqi/pqihash.h b/libretroshare/src/pqi/pqihash.h index 5c1ecd986..9a36cb89c 100644 --- a/libretroshare/src/pqi/pqihash.h +++ b/libretroshare/src/pqi/pqihash.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi: pqihash.h - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 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/pqi: pqihash.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef PQI_HASH_ #define PQI_HASH_ diff --git a/libretroshare/src/pqi/pqiindic.h b/libretroshare/src/pqi/pqiindic.h index 391f4791a..28f619b16 100644 --- a/libretroshare/src/pqi/pqiindic.h +++ b/libretroshare/src/pqi/pqiindic.h @@ -1,30 +1,24 @@ -/* - * "$Id: pqiindic.h,v 1.3 2007-02-18 21:46:49 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqiindic.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_INDICATOR_HEADER #define MRK_PQI_INDICATOR_HEADER diff --git a/libretroshare/src/pqi/pqiipset.cc b/libretroshare/src/pqi/pqiipset.cc index 8fa686844..8d9017442 100644 --- a/libretroshare/src/pqi/pqiipset.cc +++ b/libretroshare/src/pqi/pqiipset.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi: pqiipset.cc - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqiipset.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "pqi/pqiipset.h" #include "util/rsstring.h" diff --git a/libretroshare/src/pqi/pqiipset.h b/libretroshare/src/pqi/pqiipset.h index 6da862b08..ef2d8a09a 100644 --- a/libretroshare/src/pqi/pqiipset.h +++ b/libretroshare/src/pqi/pqiipset.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/pqi: pqiipset.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2009-2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef PQI_IP_SET_H #define PQI_IP_SET_H -/* - * libretroshare/src/pqi: pqiipset.h - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2009-2010 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 "util/rsnet.h" #include "serialiser/rstlvaddrs.h" diff --git a/libretroshare/src/pqi/pqilistener.h b/libretroshare/src/pqi/pqilistener.h index 6d02db294..5f748dc8f 100644 --- a/libretroshare/src/pqi/pqilistener.h +++ b/libretroshare/src/pqi/pqilistener.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi: pqilistener.h - * - * 3P/PQI network interface 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". - * - */ - +/******************************************************************************* + * libretroshare/src/pqi: pqilistener.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_GENERIC_LISTEN_HEADER #define MRK_PQI_GENERIC_LISTEN_HEADER diff --git a/libretroshare/src/pqi/pqiloopback.cc b/libretroshare/src/pqi/pqiloopback.cc index 8a8ba342b..69e70488b 100644 --- a/libretroshare/src/pqi/pqiloopback.cc +++ b/libretroshare/src/pqi/pqiloopback.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi: pqiloopback.cc - * - * 3P/PQI network interface 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". - * - */ - +/******************************************************************************* + * libretroshare/src/pqi: pqiloopback.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/pqiloopback.h" #include // for NULL diff --git a/libretroshare/src/pqi/pqiloopback.h b/libretroshare/src/pqi/pqiloopback.h index 82c3923d8..f8d40e667 100644 --- a/libretroshare/src/pqi/pqiloopback.h +++ b/libretroshare/src/pqi/pqiloopback.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi: pqiloopback.h - * - * 3P/PQI network interface 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". - * - */ - +/******************************************************************************* + * libretroshare/src/pqi: pqiloopback.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_LOOPBACK_HEADER #define MRK_PQI_LOOPBACK_HEADER diff --git a/libretroshare/src/pqi/pqimonitor.cc b/libretroshare/src/pqi/pqimonitor.cc index fac7a50f9..550cd7b5a 100644 --- a/libretroshare/src/pqi/pqimonitor.cc +++ b/libretroshare/src/pqi/pqimonitor.cc @@ -1,28 +1,24 @@ -/* - * 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". - * - */ - +/******************************************************************************* + * libretroshare/src/pqi: pqimonitor.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie. * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/pqimonitor.h" #include "pqi/pqinetwork.h" #include "pqi/pqiipset.h" diff --git a/libretroshare/src/pqi/pqimonitor.h b/libretroshare/src/pqi/pqimonitor.h index 94e9bdf05..eaba16b73 100644 --- a/libretroshare/src/pqi/pqimonitor.h +++ b/libretroshare/src/pqi/pqimonitor.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/pqi: pqimonitor.h - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqimonitor.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie. * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef PQI_MONITOR_H #define PQI_MONITOR_H diff --git a/libretroshare/src/pqi/pqinetstatebox.cc b/libretroshare/src/pqi/pqinetstatebox.cc index 128c4d9e5..c10e5ed6d 100644 --- a/libretroshare/src/pqi/pqinetstatebox.cc +++ b/libretroshare/src/pqi/pqinetstatebox.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/pqi: pqinetstatebox.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #include "retroshare/rsconfig.h" #include "util/rsnet.h" diff --git a/libretroshare/src/pqi/pqinetstatebox.h b/libretroshare/src/pqi/pqinetstatebox.h index 6b266b627..615099864 100644 --- a/libretroshare/src/pqi/pqinetstatebox.h +++ b/libretroshare/src/pqi/pqinetstatebox.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/pqi: pqinetstatebox.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef PQI_NET_STATUS_BOX_H #define PQI_NET_STATUS_BOX_H diff --git a/libretroshare/src/pqi/pqinetwork.cc b/libretroshare/src/pqi/pqinetwork.cc index 8f843cfeb..a3f4ac47f 100644 --- a/libretroshare/src/pqi/pqinetwork.cc +++ b/libretroshare/src/pqi/pqinetwork.cc @@ -1,29 +1,25 @@ -/* - * "$Id: pqinetwork.cc,v 1.18 2007-04-15 18:45:18 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * Copyright (C) 2004-2006 Robert Fernie. - * Copyright (C) 2015-2018 Gioacchino Mazzurco - * - * 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/pqi: pqinetwork.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2004-2006 Robert Fernie * + * Copyright (C) 2015-2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #ifdef WINDOWS_SYS # include "util/rswin.h" # include "util/rsmemory.h" diff --git a/libretroshare/src/pqi/pqinetwork.h b/libretroshare/src/pqi/pqinetwork.h index e974f68cf..e4238ee5e 100644 --- a/libretroshare/src/pqi/pqinetwork.h +++ b/libretroshare/src/pqi/pqinetwork.h @@ -1,30 +1,25 @@ -/* - * "$Id: pqinetwork.h,v 1.15 2007-04-15 18:45:18 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * Copyright (C) 2004-2006 Robert Fernie. - * Copyright (C) 2015-2018 Gioacchino Mazzurco - * - * 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/pqi: pqinetwork.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2004-2006 Robert Fernie * + * Copyright (C) 2015-2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_NETWORKING_HEADER #define MRK_PQI_NETWORKING_HEADER diff --git a/libretroshare/src/pqi/pqiperson.cc b/libretroshare/src/pqi/pqiperson.cc index 7f33a3e1b..30f7d37d3 100644 --- a/libretroshare/src/pqi/pqiperson.cc +++ b/libretroshare/src/pqi/pqiperson.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi pqiperson.cc - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqiperson.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2004-2006 Robert Fernie. * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/pqi.h" #include "pqi/pqiperson.h" #include "pqi/pqipersongrp.h" diff --git a/libretroshare/src/pqi/pqiperson.h b/libretroshare/src/pqi/pqiperson.h index 69faec48c..895af2925 100644 --- a/libretroshare/src/pqi/pqiperson.h +++ b/libretroshare/src/pqi/pqiperson.h @@ -1,30 +1,24 @@ -/* - * libretroshare/src/pqi pqiperson.h - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqiperson.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2004-2006 Robert Fernie. * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_PERSON_HEADER #define MRK_PQI_PERSON_HEADER diff --git a/libretroshare/src/pqi/pqipersongrp.cc b/libretroshare/src/pqi/pqipersongrp.cc index 3df48fdb3..7146be7de 100644 --- a/libretroshare/src/pqi/pqipersongrp.cc +++ b/libretroshare/src/pqi/pqipersongrp.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi: pqipersongrp.cc - * - * 3P/PQI network interface 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". - * - */ - +/******************************************************************************* + * libretroshare/src/pqi: pqipersongrp.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2004-2008 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/pqipersongrp.h" #include "pqi/p3linkmgr.h" #include "util/rsdebug.h" diff --git a/libretroshare/src/pqi/pqipersongrp.h b/libretroshare/src/pqi/pqipersongrp.h index 18c124968..0afd00a78 100644 --- a/libretroshare/src/pqi/pqipersongrp.h +++ b/libretroshare/src/pqi/pqipersongrp.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/pqi: pqipersongrp.h - * - * 3P/PQI network interface 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". - * - */ - - +/******************************************************************************* + * libretroshare/src/pqi: pqipersongrp.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2004-2008 Robert Fernie. * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_PERSON_HANDLER_HEADER #define MRK_PQI_PERSON_HANDLER_HEADER diff --git a/libretroshare/src/pqi/pqiqos.cc b/libretroshare/src/pqi/pqiqos.cc index 9fc62aa8c..0b2b484fa 100644 --- a/libretroshare/src/pqi/pqiqos.cc +++ b/libretroshare/src/pqi/pqiqos.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/pqi: pqiqos.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2004-2008 Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #include #include #include diff --git a/libretroshare/src/pqi/pqiqos.h b/libretroshare/src/pqi/pqiqos.h index 3a006b5a0..15e42b803 100644 --- a/libretroshare/src/pqi/pqiqos.h +++ b/libretroshare/src/pqi/pqiqos.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/pqi: pqiqos.h - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2004-2008 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net" - * - */ +/******************************************************************************* + * libretroshare/src/pqi: pqiqos.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2004-2008 Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ // This class handles the prioritisation of RsItem, based on the // priority level. The QoS algorithm must ensure that: diff --git a/libretroshare/src/pqi/pqiqosstreamer.cc b/libretroshare/src/pqi/pqiqosstreamer.cc index 2b4d02681..2818b3ee7 100644 --- a/libretroshare/src/pqi/pqiqosstreamer.cc +++ b/libretroshare/src/pqi/pqiqosstreamer.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi pqistreamer.h - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2012-2012 by Cyril Soler - * - * 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/pqi: pqiqosstreamer.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2012-2012 Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqiqosstreamer.h" //#define DEBUG_PQIQOSSTREAMER 1 diff --git a/libretroshare/src/pqi/pqiqosstreamer.h b/libretroshare/src/pqi/pqiqosstreamer.h index 0144cbdb8..5964b6cbe 100644 --- a/libretroshare/src/pqi/pqiqosstreamer.h +++ b/libretroshare/src/pqi/pqiqosstreamer.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi pqistreamer.h - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2012-2012 by Cyril Soler - * - * 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/pqi: pqiqosstreamer.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2012-2012 Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include "pqiqos.h" diff --git a/libretroshare/src/pqi/pqiservice.cc b/libretroshare/src/pqi/pqiservice.cc index dbe20279a..3d28f9164 100644 --- a/libretroshare/src/pqi/pqiservice.cc +++ b/libretroshare/src/pqi/pqiservice.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi pqiservice.cc - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2004-2013 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/pqi: pqiservice.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2013 by Robert Fernie. * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/pqiservice.h" #include "util/rsdebug.h" #include "util/rsstring.h" diff --git a/libretroshare/src/pqi/pqiservice.h b/libretroshare/src/pqi/pqiservice.h index 41c540d4c..ad983266e 100644 --- a/libretroshare/src/pqi/pqiservice.h +++ b/libretroshare/src/pqi/pqiservice.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/pqi pqiservice.h - * - * 3P/PQI network interface 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". - * - */ - - +/******************************************************************************* + * libretroshare/src/pqi: pqiservice.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie. * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef PQI_SERVICE_HEADER #define PQI_SERVICE_HEADER diff --git a/libretroshare/src/pqi/pqissl.cc b/libretroshare/src/pqi/pqissl.cc index 47da19b93..c1ea271a3 100644 --- a/libretroshare/src/pqi/pqissl.cc +++ b/libretroshare/src/pqi/pqissl.cc @@ -1,29 +1,25 @@ -/* - * "$Id: pqissl.cc,v 1.28 2007-03-17 19:32:59 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2004-2006 by Robert Fernie. - * Copyright (C) 2015-2018 Gioacchino Mazzurco - * - * 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/pqi: pqissl.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * Copyright (C) 2015-2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/pqissl.h" #include "pqi/pqinetwork.h" #include "pqi/sslfns.h" diff --git a/libretroshare/src/pqi/pqissl.h b/libretroshare/src/pqi/pqissl.h index e14e3928d..712e06a11 100644 --- a/libretroshare/src/pqi/pqissl.h +++ b/libretroshare/src/pqi/pqissl.h @@ -1,31 +1,25 @@ -/* - * "$Id: pqissl.h,v 1.18 2007-03-11 14:54:22 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2004-2006 by Robert Fernie. - * Copyright (C) 2015-2018 Gioacchino Mazzurco - * - * 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/pqi: pqissl.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * Copyright (C) 2015-2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_SSL_HEADER #define MRK_PQI_SSL_HEADER diff --git a/libretroshare/src/pqi/pqissli2pbob.cpp b/libretroshare/src/pqi/pqissli2pbob.cpp index 4b1b05dc6..5551ce788 100644 --- a/libretroshare/src/pqi/pqissli2pbob.cpp +++ b/libretroshare/src/pqi/pqissli2pbob.cpp @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/pqi: pqissli2pbob.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Sehraf * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqissli2pbob.h" bool pqissli2pbob::connect_parameter(uint32_t type, const std::string &value) diff --git a/libretroshare/src/pqi/pqissli2pbob.h b/libretroshare/src/pqi/pqissli2pbob.h index e36112c08..b1a643a75 100644 --- a/libretroshare/src/pqi/pqissli2pbob.h +++ b/libretroshare/src/pqi/pqissli2pbob.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/pqi: pqissli2pbob.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Sehraf * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef PQISSLI2PBOB_H #define PQISSLI2PBOB_H diff --git a/libretroshare/src/pqi/pqissllistener.cc b/libretroshare/src/pqi/pqissllistener.cc index c81c96cd2..676ac8226 100644 --- a/libretroshare/src/pqi/pqissllistener.cc +++ b/libretroshare/src/pqi/pqissllistener.cc @@ -1,29 +1,25 @@ -/* - * "$Id: pqissllistener.cc,v 1.3 2007-02-18 21:46:49 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2004-2006 by Robert Fernie. - * Copyright (C) 2015-2018 Gioacchino Mazzurco - * - * 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/pqi: pqissllistener.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * Copyright (C) 2015-2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/pqissl.h" #include "pqi/pqissllistener.h" #include "pqi/pqinetwork.h" diff --git a/libretroshare/src/pqi/pqissllistener.h b/libretroshare/src/pqi/pqissllistener.h index b5de39069..98e3a77e2 100644 --- a/libretroshare/src/pqi/pqissllistener.h +++ b/libretroshare/src/pqi/pqissllistener.h @@ -1,30 +1,24 @@ -/* - * "$Id: pqissllistener.h,v 1.2 2007-02-18 21:46:49 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqissllistener.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie. * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_SSL_LISTEN_HEADER #define MRK_PQI_SSL_LISTEN_HEADER diff --git a/libretroshare/src/pqi/pqisslpersongrp.cc b/libretroshare/src/pqi/pqisslpersongrp.cc index 20fe314d4..e907feb28 100644 --- a/libretroshare/src/pqi/pqisslpersongrp.cc +++ b/libretroshare/src/pqi/pqisslpersongrp.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi: pqisslpersongrp.cc - * - * 3P/PQI network interface 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". - * - */ - +/******************************************************************************* + * libretroshare/src/pqi: pqisslpersongrp.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie. * + * * + * 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 . * + * * + *******************************************************************************/ #include "serialiser/rsserializer.h" #include "services/autoproxy/rsautoproxymonitor.h" #include "util/rsdebug.h" diff --git a/libretroshare/src/pqi/pqisslpersongrp.h b/libretroshare/src/pqi/pqisslpersongrp.h index 5027abd66..aa574e617 100644 --- a/libretroshare/src/pqi/pqisslpersongrp.h +++ b/libretroshare/src/pqi/pqisslpersongrp.h @@ -1,30 +1,24 @@ -/* - * libretroshare/src/pqi: pqisslpersongrp.h - * - * 3P/PQI network interface 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". - * - */ - - - +/******************************************************************************* + * libretroshare/src/pqi: pqisslpersongrp.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie. * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_SSL_PERSON_HANDLER_HEADER #define MRK_PQI_SSL_PERSON_HANDLER_HEADER diff --git a/libretroshare/src/pqi/pqisslproxy.cc b/libretroshare/src/pqi/pqisslproxy.cc index 500c6a7d8..1c61bef78 100644 --- a/libretroshare/src/pqi/pqisslproxy.cc +++ b/libretroshare/src/pqi/pqisslproxy.cc @@ -1,30 +1,24 @@ -/* - * pqisslproxy.cc - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2004-2013 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/pqi: pqisslproxy.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2013 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/pqisslproxy.h" #include "pqi/pqinetwork.h" diff --git a/libretroshare/src/pqi/pqisslproxy.h b/libretroshare/src/pqi/pqisslproxy.h index 347a9fa7f..d643ccb2e 100644 --- a/libretroshare/src/pqi/pqisslproxy.h +++ b/libretroshare/src/pqi/pqisslproxy.h @@ -1,30 +1,24 @@ -/* - * pqisslproxy.h - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2004-2013 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/pqi: pqisslproxy.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2013 by Robert Fernie. * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_SSL_PROXY_HEADER #define MRK_PQI_SSL_PROXY_HEADER diff --git a/libretroshare/src/pqi/pqissludp.cc b/libretroshare/src/pqi/pqissludp.cc index 8d7e45fd1..aec5f1dae 100644 --- a/libretroshare/src/pqi/pqissludp.cc +++ b/libretroshare/src/pqi/pqissludp.cc @@ -1,28 +1,24 @@ -/* - * "$Id: pqissludp.cc,v 1.16 2007-02-18 21:46:49 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqissludp.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/pqissludp.h" #include "pqi/pqinetwork.h" diff --git a/libretroshare/src/pqi/pqissludp.h b/libretroshare/src/pqi/pqissludp.h index 195e9e604..9cc5e3b23 100644 --- a/libretroshare/src/pqi/pqissludp.h +++ b/libretroshare/src/pqi/pqissludp.h @@ -1,30 +1,24 @@ -/* - * "$Id: pqissludp.h,v 1.8 2007-02-18 21:46:49 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqissludp.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie. * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_SSL_UDP_HEADER #define MRK_PQI_SSL_UDP_HEADER diff --git a/libretroshare/src/pqi/pqistore.cc b/libretroshare/src/pqi/pqistore.cc index 09932a029..090a6a794 100644 --- a/libretroshare/src/pqi/pqistore.cc +++ b/libretroshare/src/pqi/pqistore.cc @@ -1,30 +1,24 @@ -/* - * "$Id: pqistore.cc,v 1.5 2007-03-21 18:45:41 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqistore.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie. * + * * + * 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 . * + * * + *******************************************************************************/ /* This is dependent on the sslroot at the moment. * -> as we need to create/restore references to the Person. diff --git a/libretroshare/src/pqi/pqistore.h b/libretroshare/src/pqi/pqistore.h index 7870c39b3..f8a586c67 100644 --- a/libretroshare/src/pqi/pqistore.h +++ b/libretroshare/src/pqi/pqistore.h @@ -1,30 +1,24 @@ -/* - * pqistore.h - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqistore.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie. * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_STORE_STREAMER_HEADER #define MRK_PQI_STORE_STREAMER_HEADER diff --git a/libretroshare/src/pqi/pqistreamer.cc b/libretroshare/src/pqi/pqistreamer.cc index 839a5364e..9015492a3 100644 --- a/libretroshare/src/pqi/pqistreamer.cc +++ b/libretroshare/src/pqi/pqistreamer.cc @@ -1,29 +1,24 @@ -/* - * "$Id: pqistreamer.cc,v 1.19 2007-02-18 21:46:50 rmf24 Exp $" - * - * 3P/PQI network interface for RetroShare. - * - * 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/pqi: pqistreamer.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/pqistreamer.h" #include // for gettimeofday diff --git a/libretroshare/src/pqi/pqistreamer.h b/libretroshare/src/pqi/pqistreamer.h index 9908651b2..c9ab558cd 100644 --- a/libretroshare/src/pqi/pqistreamer.h +++ b/libretroshare/src/pqi/pqistreamer.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/pqi pqistreamer.h - * - * 3P/PQI network interface 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". - * - */ - - +/******************************************************************************* + * libretroshare/src/pqi: pqistreamer.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_STREAMER_HEADER #define MRK_PQI_STREAMER_HEADER diff --git a/libretroshare/src/pqi/pqithreadstreamer.cc b/libretroshare/src/pqi/pqithreadstreamer.cc index 54ab925e1..8f2bd47c3 100644 --- a/libretroshare/src/pqi/pqithreadstreamer.cc +++ b/libretroshare/src/pqi/pqithreadstreamer.cc @@ -1,29 +1,24 @@ -/* - * pqithreadstreamer.cc - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2004-2013 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/pqi: pqithreadstreamer.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2013 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "util/rstime.h" #include "pqi/pqithreadstreamer.h" #include diff --git a/libretroshare/src/pqi/pqithreadstreamer.h b/libretroshare/src/pqi/pqithreadstreamer.h index 65cfabdfe..cfa3c12d4 100644 --- a/libretroshare/src/pqi/pqithreadstreamer.h +++ b/libretroshare/src/pqi/pqithreadstreamer.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/pqi pqithreadstreamer.h - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2004-2013 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/pqi: pqithreadstreamer.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2013 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_PQI_THREAD_STREAMER_HEADER #define MRK_PQI_THREAD_STREAMER_HEADER diff --git a/libretroshare/src/pqi/sslfns.cc b/libretroshare/src/pqi/sslfns.cc index ff964c45c..59bdc884a 100644 --- a/libretroshare/src/pqi/sslfns.cc +++ b/libretroshare/src/pqi/sslfns.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/pqi: sslfns.cc - * - * 3P/PQI network interface 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". - * - */ +/******************************************************************************* + * libretroshare/src/pqi: sslfns.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ /* Functions in this file are SSL only, * and have no dependence on SSLRoot() etc. diff --git a/libretroshare/src/pqi/sslfns.h b/libretroshare/src/pqi/sslfns.h index 4682810b5..0a19904e1 100644 --- a/libretroshare/src/pqi/sslfns.h +++ b/libretroshare/src/pqi/sslfns.h @@ -1,31 +1,27 @@ -#ifndef RS_PQI_SSL_HELPER_H +/******************************************************************************* + * libretroshare/src/pqi: sslfns.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ +#ifndef RS_PQI_SSL_HELPER_H #define RS_PQI_SSL_HELPER_H -/* - * libretroshare/src/pqi: sslfns.cc - * - * 3P/PQI network interface 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". - * - */ - /* Functions in this file are SSL only, * and have no dependence on SSLRoot() etc. * might need SSL_Init() to be called - thats it! diff --git a/libretroshare/src/use_libretroshare.pri b/libretroshare/src/use_libretroshare.pri index 47b657222..84319b8ff 100644 --- a/libretroshare/src/use_libretroshare.pri +++ b/libretroshare/src/use_libretroshare.pri @@ -3,16 +3,16 @@ # Copyright (C) 2018, Retroshare team # # # # This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # +# 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 Affero General Public License for more details. # +# GNU Lesser General Public License for more details. # # # -# You should have received a copy of the GNU Affero General Public License # +# You should have received a copy of the GNU Lesser General Public License # # along with this program. If not, see . # ################################################################################ DEPENDPATH *= $$system_path($$clean_path($${PWD}/../../libretroshare/src/)) diff --git a/openpgpsdk/src/use_openpgpsdk.pri b/openpgpsdk/src/use_openpgpsdk.pri index 115f88d67..800781a3c 100644 --- a/openpgpsdk/src/use_openpgpsdk.pri +++ b/openpgpsdk/src/use_openpgpsdk.pri @@ -3,16 +3,16 @@ # Copyright (C) 2018, Retroshare team # # # # This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # +# 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 Affero General Public License for more details. # +# GNU Lesser General Public License for more details. # # # -# You should have received a copy of the GNU Affero General Public License # +# You should have received a copy of the GNU Lesser General Public License # # along with this program. If not, see . # ################################################################################ DEPENDPATH *= $$system_path($$clean_path($${PWD}/../../openpgpsdk/src)) diff --git a/retroshare.pri b/retroshare.pri index def629360..8f57cf618 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -3,16 +3,16 @@ # Copyright (C) 2018, Retroshare team # # # # This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # +# 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 Affero General Public License for more details. # +# GNU Lesser General Public License for more details. # # # -# You should have received a copy of the GNU Affero General Public License # +# You should have received a copy of the GNU Lesser General Public License # # along with this program. If not, see . # ################################################################################ From ff8c37f169fd0534dc1755c6473bea9751335d29 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 28 May 2018 22:28:51 +0200 Subject: [PATCH 060/138] fixed license in retroshare/ --- libretroshare/src/gxstunnel/p3gxstunnel.cc | 2 - libretroshare/src/pgp/pgpauxutils.cc | 2 - libretroshare/src/retroshare/rsbanlist.h | 46 ++++++++--------- libretroshare/src/retroshare/rsconfig.h | 46 ++++++++--------- libretroshare/src/retroshare/rsdht.h | 46 ++++++++--------- libretroshare/src/retroshare/rsdisc.h | 46 ++++++++--------- libretroshare/src/retroshare/rsexpr.h | 46 ++++++++--------- libretroshare/src/retroshare/rsfiles.h | 47 ++++++++--------- libretroshare/src/retroshare/rsgxschannels.h | 46 ++++++++--------- libretroshare/src/retroshare/rsgxscircles.h | 46 ++++++++--------- libretroshare/src/retroshare/rsgxsflags.h | 21 ++++++++ libretroshare/src/retroshare/rsgxsforums.h | 46 ++++++++--------- .../src/retroshare/rsgxsifacetypes.h | 49 ++++++++---------- libretroshare/src/retroshare/rsgxsservice.h | 21 ++++++++ libretroshare/src/retroshare/rsgxstunnel.h | 46 ++++++++--------- libretroshare/src/retroshare/rshistory.h | 46 ++++++++--------- libretroshare/src/retroshare/rsidentity.h | 48 ++++++++--------- libretroshare/src/retroshare/rsids.h | 22 ++++++++ libretroshare/src/retroshare/rsiface.h | 47 ++++++++--------- libretroshare/src/retroshare/rsinit.h | 46 ++++++++--------- libretroshare/src/retroshare/rsmsgs.h | 47 ++++++++--------- libretroshare/src/retroshare/rsnotify.h | 47 ++++++++--------- libretroshare/src/retroshare/rspeers.h | 46 ++++++++--------- libretroshare/src/retroshare/rsphoto.h | 46 ++++++++--------- libretroshare/src/retroshare/rsplugin.h | 46 ++++++++--------- libretroshare/src/retroshare/rsposted.h | 46 ++++++++--------- libretroshare/src/retroshare/rsrtt.h | 46 ++++++++--------- .../src/retroshare/rsservicecontrol.h | 46 ++++++++--------- libretroshare/src/retroshare/rsstatus.h | 46 ++++++++--------- libretroshare/src/retroshare/rstokenservice.h | 46 ++++++++--------- libretroshare/src/retroshare/rsturtle.h | 51 ++++++++----------- libretroshare/src/retroshare/rstypes.h | 47 ++++++++--------- libretroshare/src/retroshare/rsversion.h | 21 ++++++++ libretroshare/src/retroshare/rswiki.h | 46 ++++++++--------- libretroshare/src/retroshare/rswire.h | 46 ++++++++--------- libretroshare/src/rsserver/rsinit.cc | 45 ++++++++-------- 36 files changed, 717 insertions(+), 766 deletions(-) diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.cc b/libretroshare/src/gxstunnel/p3gxstunnel.cc index 7fd417549..89beb2b8b 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.cc +++ b/libretroshare/src/gxstunnel/p3gxstunnel.cc @@ -19,8 +19,6 @@ * along with this program. If not, see . * * * *******************************************************************************/ -#pragma once - #include #include "openssl/rand.h" diff --git a/libretroshare/src/pgp/pgpauxutils.cc b/libretroshare/src/pgp/pgpauxutils.cc index abf92e5ac..a6a592c2c 100644 --- a/libretroshare/src/pgp/pgpauxutils.cc +++ b/libretroshare/src/pgp/pgpauxutils.cc @@ -19,8 +19,6 @@ * along with this program. If not, see . * * * *******************************************************************************/ -#pragma once - #include "pgp/pgpauxutils.h" #include "pqi/authgpg.h" diff --git a/libretroshare/src/retroshare/rsbanlist.h b/libretroshare/src/retroshare/rsbanlist.h index b6778f0e3..f60b129f9 100644 --- a/libretroshare/src/retroshare/rsbanlist.h +++ b/libretroshare/src/retroshare/rsbanlist.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services/p3banlist.h - * - * Exchange list of Peers for Banning / Whitelisting. - * - * Copyright 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/retroshare: rsbanlist.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include "util/rsnet.h" diff --git a/libretroshare/src/retroshare/rsconfig.h b/libretroshare/src/retroshare/rsconfig.h index e3b74aa4b..962519ad9 100644 --- a/libretroshare/src/retroshare/rsconfig.h +++ b/libretroshare/src/retroshare/rsconfig.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsconfig.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_CONFIG_GUI_INTERFACE_H #define RETROSHARE_CONFIG_GUI_INTERFACE_H -/* - * libretroshare/src/retroshare: rsconfig.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 #include #include diff --git a/libretroshare/src/retroshare/rsdht.h b/libretroshare/src/retroshare/rsdht.h index 35dee0354..022fb421b 100644 --- a/libretroshare/src/retroshare/rsdht.h +++ b/libretroshare/src/retroshare/rsdht.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsdht.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_DHT_GUI_INTERFACE_H #define RETROSHARE_DHT_GUI_INTERFACE_H -/* - * libretroshare/src/rsiface: rsdht.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 #include #include diff --git a/libretroshare/src/retroshare/rsdisc.h b/libretroshare/src/retroshare/rsdisc.h index e97f19571..b81e03c3c 100644 --- a/libretroshare/src/retroshare/rsdisc.h +++ b/libretroshare/src/retroshare/rsdisc.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsdht.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_DISC_GUI_INTERFACE_H #define RETROSHARE_DISC_GUI_INTERFACE_H -/* - * libretroshare/src/rsiface: rsdisc.h - * - * RetroShare C++ Interface. - * - * Copyright 2008-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 #include #include diff --git a/libretroshare/src/retroshare/rsexpr.h b/libretroshare/src/retroshare/rsexpr.h index 72c63d463..628e3f3c4 100644 --- a/libretroshare/src/retroshare/rsexpr.h +++ b/libretroshare/src/retroshare/rsexpr.h @@ -1,28 +1,24 @@ -/* - * rs-core/src/rsiface: rsexpr.h - * - * RetroShare C++ Interface. - * - * Copyright 2007-2008 by Kashif Kaleem. - * - * 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: rsexpr.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Kashif Kaleem * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/retroshare/rsfiles.h b/libretroshare/src/retroshare/rsfiles.h index ccd4428be..8fc17874a 100644 --- a/libretroshare/src/retroshare/rsfiles.h +++ b/libretroshare/src/retroshare/rsfiles.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsfiles.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_FILES_GUI_INTERFACE_H #define RS_FILES_GUI_INTERFACE_H -/* - * libretroshare/src/rsiface: rsfiles.h - * - * RetroShare C++ Interface. - * - * Copyright 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 #include #include diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index c75235f0e..e61a0f131 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsgxschannels.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_GXS_CHANNEL_GUI_INTERFACE_H #define RETROSHARE_GXS_CHANNEL_GUI_INTERFACE_H -/* - * libretroshare/src/retroshare: rsgxschannel.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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". - * - */ - #include #include #include diff --git a/libretroshare/src/retroshare/rsgxscircles.h b/libretroshare/src/retroshare/rsgxscircles.h index 8ce446200..32d21fb14 100644 --- a/libretroshare/src/retroshare/rsgxscircles.h +++ b/libretroshare/src/retroshare/rsgxscircles.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsgxscircles.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_GXSCIRCLES_INTERFACE_H #define RETROSHARE_GXSCIRCLES_INTERFACE_H -/* - * libretroshare/src/retroshare: rsgxscircles.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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". - * - */ - #include #include #include diff --git a/libretroshare/src/retroshare/rsgxsflags.h b/libretroshare/src/retroshare/rsgxsflags.h index 921c843fa..b2645aaab 100644 --- a/libretroshare/src/retroshare/rsgxsflags.h +++ b/libretroshare/src/retroshare/rsgxsflags.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsgxsflags.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2018 by Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RSGXSFLAGS_H #define RSGXSFLAGS_H diff --git a/libretroshare/src/retroshare/rsgxsforums.h b/libretroshare/src/retroshare/rsgxsforums.h index 28558d4ce..9d0296e4b 100644 --- a/libretroshare/src/retroshare/rsgxsforums.h +++ b/libretroshare/src/retroshare/rsgxsforums.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsgxsforums.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_GXS_FORUM_GUI_INTERFACE_H #define RETROSHARE_GXS_FORUM_GUI_INTERFACE_H -/* - * libretroshare/src/retroshare: rsgxsforum.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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". - * - */ - #include #include #include diff --git a/libretroshare/src/retroshare/rsgxsifacetypes.h b/libretroshare/src/retroshare/rsgxsifacetypes.h index 18637f1b1..6ad3ceb05 100644 --- a/libretroshare/src/retroshare/rsgxsifacetypes.h +++ b/libretroshare/src/retroshare/rsgxsifacetypes.h @@ -1,30 +1,25 @@ -/* - * rsgxsifacetypes.h - * - * Copyright (C) 2013 crispy - * Copyright (C) 2018 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* - * rsgxsifacetypes.h - * - * Created on: 28 Feb 2013 - * Author: crispy - */ - +/******************************************************************************* + * libretroshare/src/retroshare: rsgxsifacetypes.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2013 crispy * + * Copyright (C) 2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RSGXSIFACETYPES_H_ #define RSGXSIFACETYPES_H_ diff --git a/libretroshare/src/retroshare/rsgxsservice.h b/libretroshare/src/retroshare/rsgxsservice.h index 6afed31c6..4bb299408 100644 --- a/libretroshare/src/retroshare/rsgxsservice.h +++ b/libretroshare/src/retroshare/rsgxsservice.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsgxsservice.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2015 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RSGXSSERVICE_H #define RSGXSSERVICE_H diff --git a/libretroshare/src/retroshare/rsgxstunnel.h b/libretroshare/src/retroshare/rsgxstunnel.h index 4d3588c9f..ce7798300 100644 --- a/libretroshare/src/retroshare/rsgxstunnel.h +++ b/libretroshare/src/retroshare/rsgxstunnel.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: rsgrouter.h - * - * Services for RetroShare. - * - * Copyright 2013 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/retroshare: rsgxstunnel.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include "util/rsdir.h" diff --git a/libretroshare/src/retroshare/rshistory.h b/libretroshare/src/retroshare/rshistory.h index 77e30b35d..eff72e237 100644 --- a/libretroshare/src/retroshare/rshistory.h +++ b/libretroshare/src/retroshare/rshistory.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rshistory.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 . * + * * + *******************************************************************************/ #ifndef RS_HISTORY_INTERFACE_H #define RS_HISTORY_INTERFACE_H -/* - * libretroshare/src/retroshare: rshistory.h - * - * RetroShare C++ . - * - * 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". - * - */ - class RsHistory; class ChatId; diff --git a/libretroshare/src/retroshare/rsidentity.h b/libretroshare/src/retroshare/rsidentity.h index 47da42de4..610df360f 100644 --- a/libretroshare/src/retroshare/rsidentity.h +++ b/libretroshare/src/retroshare/rsidentity.h @@ -1,32 +1,28 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsidentity.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2012 Robert Fernie * + * Copyright (C) 2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_IDENTITY_GUI_INTERFACE_H #define RETROSHARE_IDENTITY_GUI_INTERFACE_H -/* - * libretroshare/src/retroshare: rsidentity.h - * - * RetroShare C++ Interface. - * - * Copyright (C) 2012 Robert Fernie. - * Copyright (C) 2018 Gioacchino Mazzurco - * - * 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". - * - */ - #include #include #include diff --git a/libretroshare/src/retroshare/rsids.h b/libretroshare/src/retroshare/rsids.h index 21a8fd754..fee615d90 100644 --- a/libretroshare/src/retroshare/rsids.h +++ b/libretroshare/src/retroshare/rsids.h @@ -1,3 +1,25 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsids.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ + // This class aims at defining a generic ID type that is a list of bytes. It // can be converted into a hexadecial string for printing, mainly) or for // compatibility with old methods. diff --git a/libretroshare/src/retroshare/rsiface.h b/libretroshare/src/retroshare/rsiface.h index 2eb905e3a..643e404c0 100644 --- a/libretroshare/src/retroshare/rsiface.h +++ b/libretroshare/src/retroshare/rsiface.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsiface.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_GUI_INTERFACE_H #define RETROSHARE_GUI_INTERFACE_H -/* - * "$Id: rsiface.h,v 1.9 2007-04-21 19:08:51 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 "retroshare/rsnotify.h" #include "rstypes.h" diff --git a/libretroshare/src/retroshare/rsinit.h b/libretroshare/src/retroshare/rsinit.h index 18326d3a1..aeb487fb2 100644 --- a/libretroshare/src/retroshare/rsinit.h +++ b/libretroshare/src/retroshare/rsinit.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsinit.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_INIT_INTERFACE_H #define RETROSHARE_INIT_INTERFACE_H -/* - * "$Id: rsiface.h,v 1.9 2007-04-21 19:08:51 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". - * - */ - // Initialize ok, result >= 0 #define RS_INIT_OK 0 // Initialize ok #define RS_INIT_HAVE_ACCOUNT 1 // Initialize ok, have account diff --git a/libretroshare/src/retroshare/rsmsgs.h b/libretroshare/src/retroshare/rsmsgs.h index bf36100b3..340606bb8 100644 --- a/libretroshare/src/retroshare/rsmsgs.h +++ b/libretroshare/src/retroshare/rsmsgs.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsmsgs.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_MSG_GUI_INTERFACE_H #define RS_MSG_GUI_INTERFACE_H -/* - * libretroshare/src/rsiface: rsmsgs.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 #include #include diff --git a/libretroshare/src/retroshare/rsnotify.h b/libretroshare/src/retroshare/rsnotify.h index b73c577e9..5ad23507c 100644 --- a/libretroshare/src/retroshare/rsnotify.h +++ b/libretroshare/src/retroshare/rsnotify.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsnotify.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_NOTIFY_GUI_INTERFACE_H #define RS_NOTIFY_GUI_INTERFACE_H -/* - * libretroshare/src/rsiface: rsnotify.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 #include #include diff --git a/libretroshare/src/retroshare/rspeers.h b/libretroshare/src/retroshare/rspeers.h index f1b274d09..df63d8112 100644 --- a/libretroshare/src/retroshare/rspeers.h +++ b/libretroshare/src/retroshare/rspeers.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rspeers.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_PEER_GUI_INTERFACE_H #define RETROSHARE_PEER_GUI_INTERFACE_H -/* - * libretroshare/src/rsiface: rspeer.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". - * - */ - #include #include #include diff --git a/libretroshare/src/retroshare/rsphoto.h b/libretroshare/src/retroshare/rsphoto.h index 1e782d2ef..7e5b6ea99 100644 --- a/libretroshare/src/retroshare/rsphoto.h +++ b/libretroshare/src/retroshare/rsphoto.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsphoto.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RSPHOTOV2_H #define RSPHOTOV2_H -/* - * libretroshare/src/retroshare: rsphoto.h - * - * RetroShare C++ Interface. - * - * Copyright 2008-2012 by Robert Fernie, Christopher 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 #include #include diff --git a/libretroshare/src/retroshare/rsplugin.h b/libretroshare/src/retroshare/rsplugin.h index 6b8363c37..557f9a61d 100644 --- a/libretroshare/src/retroshare/rsplugin.h +++ b/libretroshare/src/retroshare/rsplugin.h @@ -1,28 +1,24 @@ -/* - * "$Id: rsiface.h,v 1.9 2007-04-21 19:08:51 rmf24 Exp $" - * - * RetroShare C++ Interface. - * - * Copyright 2011-2011 by Cyril Soler - * - * 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: rsplugin.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2011 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/retroshare/rsposted.h b/libretroshare/src/retroshare/rsposted.h index 586449a47..eb089383c 100644 --- a/libretroshare/src/retroshare/rsposted.h +++ b/libretroshare/src/retroshare/rsposted.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsposted.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2012 by Robert Fernie, Christopher 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_GXS_RSPOSTED_GUI_INTERFACE_H #define RETROSHARE_GXS_RSPOSTED_GUI_INTERFACE_H -/* - * libretroshare/src/retroshare: rsposted.h - * - * RetroShare C++ Interface. - * - * Copyright 2008-2012 by Robert Fernie, Christopher 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.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". - * - */ - #include #include #include diff --git a/libretroshare/src/retroshare/rsrtt.h b/libretroshare/src/retroshare/rsrtt.h index 6d9422562..e55220307 100644 --- a/libretroshare/src/retroshare/rsrtt.h +++ b/libretroshare/src/retroshare/rsrtt.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsposted.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_RTT_INTERFACE_H #define RETROSHARE_RTT_INTERFACE_H -/* - * libretroshare/src/retroshare: rsrtt.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 #include #include diff --git a/libretroshare/src/retroshare/rsservicecontrol.h b/libretroshare/src/retroshare/rsservicecontrol.h index 12d9dc5d2..b081e3305 100644 --- a/libretroshare/src/retroshare/rsservicecontrol.h +++ b/libretroshare/src/retroshare/rsservicecontrol.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsservicecontrol.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014-2014 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_SERVICE_CONTROL_GUI_INTERFACE_H #define RETROSHARE_SERVICE_CONTROL_GUI_INTERFACE_H -/* - * libretroshare/src/rsiface: rsservicecontrol.h - * - * RetroShare C++ Interface. - * - * Copyright 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". - * - */ - #include #include #include diff --git a/libretroshare/src/retroshare/rsstatus.h b/libretroshare/src/retroshare/rsstatus.h index 00b82eab7..4698cd8b5 100644 --- a/libretroshare/src/retroshare/rsstatus.h +++ b/libretroshare/src/retroshare/rsstatus.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsstatus.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Vinny Do, 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 . * + * * + *******************************************************************************/ #ifndef RS_STATUS_INTERFACE_H #define RS_STATUS_INTERFACE_H -/* - * libretroshare/src/rsiface: rsstatus.h - * - * RetroShare C++ . - * - * Copyright 2007-2008 by Vinny Do, 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". - * - */ - class RsStatus; extern RsStatus *rsStatus; diff --git a/libretroshare/src/retroshare/rstokenservice.h b/libretroshare/src/retroshare/rstokenservice.h index bcb273dd5..fedf54f9d 100644 --- a/libretroshare/src/retroshare/rstokenservice.h +++ b/libretroshare/src/retroshare/rstokenservice.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rstokenservice.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie, 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 . * + * * + *******************************************************************************/ #ifndef RSTOKENSERVICE_H #define RSTOKENSERVICE_H -/* - * libretroshare/src/retroshare: rstokenservice.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 by Robert Fernie, Christopher 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 #include #include diff --git a/libretroshare/src/retroshare/rsturtle.h b/libretroshare/src/retroshare/rsturtle.h index 7cef4fd77..f845f06db 100644 --- a/libretroshare/src/retroshare/rsturtle.h +++ b/libretroshare/src/retroshare/rsturtle.h @@ -1,31 +1,24 @@ -#ifndef RETROSHARE_TURTLE_GUI_INTERFACE_H -#define RETROSHARE_TURTLE_GUI_INTERFACE_H - -/* - * libretroshare/src/rsiface: rsturtle.h - * - * RetroShare C++ Interface. - * - * Copyright 2009 by Cyril Soler. - * - * 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 "csoler@users.sourceforge.net" - * - */ - +/******************************************************************************* + * libretroshare/src/retroshare: rsturtle.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2009-2018 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include @@ -155,5 +148,3 @@ class RsTurtle virtual void setMaxTRForwardRate(int max_tr_up_rate) = 0 ; virtual int getMaxTRForwardRate() const = 0 ; }; - -#endif diff --git a/libretroshare/src/retroshare/rstypes.h b/libretroshare/src/retroshare/rstypes.h index dcad22795..443f2e2b3 100644 --- a/libretroshare/src/retroshare/rstypes.h +++ b/libretroshare/src/retroshare/rstypes.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsturtle.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_TYPES_GUI_INTERFACE_H #define RS_TYPES_GUI_INTERFACE_H -/* - * "$Id: rstypes.h,v 1.7 2007-05-05 16:10:05 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 #include #include diff --git a/libretroshare/src/retroshare/rsversion.h b/libretroshare/src/retroshare/rsversion.h index d194024d7..110d622fa 100644 --- a/libretroshare/src/retroshare/rsversion.h +++ b/libretroshare/src/retroshare/rsversion.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsversion.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2018 by Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #define RS_MAJOR_VERSION 0 #define RS_MINOR_VERSION 6 #define RS_BUILD_NUMBER 4 diff --git a/libretroshare/src/retroshare/rswiki.h b/libretroshare/src/retroshare/rswiki.h index 9db3ff7e6..ab3bcfd85 100644 --- a/libretroshare/src/retroshare/rswiki.h +++ b/libretroshare/src/retroshare/rswiki.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsturtle.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_WIKI_GUI_INTERFACE_H #define RETROSHARE_WIKI_GUI_INTERFACE_H -/* - * libretroshare/src/retroshare: rswiki.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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 #include #include diff --git a/libretroshare/src/retroshare/rswire.h b/libretroshare/src/retroshare/rswire.h index d9cdb7832..6052c7291 100644 --- a/libretroshare/src/retroshare/rswire.h +++ b/libretroshare/src/retroshare/rswire.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/retroshare: rsturtle.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_WIRE_GUI_INTERFACE_H #define RETROSHARE_WIRE_GUI_INTERFACE_H -/* - * libretroshare/src/retroshare: rswire.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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". - * - */ - #include #include #include diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 0d9300202..e1501141f 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -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 * + * * + * 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 . * + * * + *******************************************************************************/ /* This is an updated startup class. Class variables are hidden from * the GUI / External via a hidden class */ From 05e2f684a9a50dced65bc020cfb5bc6d6d1324cd Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 29 May 2018 21:08:17 +0200 Subject: [PATCH 061/138] re-licensed rsitems and rsserver --- libretroshare/src/rsitems/itempriorities.h | 46 ++++++++--------- libretroshare/src/rsitems/rsbanlistitems.cc | 46 ++++++++--------- libretroshare/src/rsitems/rsbanlistitems.h | 46 ++++++++--------- libretroshare/src/rsitems/rsbwctrlitems.cc | 46 ++++++++--------- libretroshare/src/rsitems/rsbwctrlitems.h | 46 ++++++++--------- libretroshare/src/rsitems/rsconfigitems.cc | 47 ++++++++---------- libretroshare/src/rsitems/rsconfigitems.h | 46 ++++++++--------- .../src/rsitems/rsdiscovery2items.cc | 47 ++++++++---------- libretroshare/src/rsitems/rsdiscovery2items.h | 48 ++++++++---------- .../src/rsitems/rsfiletransferitems.cc | 47 ++++++++---------- .../src/rsitems/rsfiletransferitems.h | 46 ++++++++--------- .../src/rsitems/rsgxschannelitems.cc | 46 ++++++++--------- libretroshare/src/rsitems/rsgxschannelitems.h | 46 ++++++++--------- libretroshare/src/rsitems/rsgxscircleitems.cc | 46 ++++++++--------- libretroshare/src/rsitems/rsgxscircleitems.h | 46 ++++++++--------- .../src/rsitems/rsgxscommentitems.cc | 46 ++++++++--------- libretroshare/src/rsitems/rsgxscommentitems.h | 46 ++++++++--------- libretroshare/src/rsitems/rsgxsforumitems.cc | 46 ++++++++--------- libretroshare/src/rsitems/rsgxsforumitems.h | 46 ++++++++--------- libretroshare/src/rsitems/rsgxsiditems.cc | 46 ++++++++--------- libretroshare/src/rsitems/rsgxsiditems.h | 46 ++++++++--------- libretroshare/src/rsitems/rsgxsitems.cc | 30 +++++++++--- libretroshare/src/rsitems/rsgxsitems.h | 47 +++++++++--------- libretroshare/src/rsitems/rsgxsrecognitems.cc | 46 ++++++++--------- libretroshare/src/rsitems/rsgxsrecognitems.h | 46 ++++++++--------- .../src/rsitems/rsgxsreputationitems.cc | 46 ++++++++--------- .../src/rsitems/rsgxsreputationitems.h | 46 ++++++++--------- libretroshare/src/rsitems/rsgxsupdateitems.cc | 46 ++++++++--------- libretroshare/src/rsitems/rsgxsupdateitems.h | 48 ++++++++---------- libretroshare/src/rsitems/rsheartbeatitems.h | 48 ++++++++---------- libretroshare/src/rsitems/rshistoryitems.cc | 46 ++++++++--------- libretroshare/src/rsitems/rshistoryitems.h | 46 ++++++++--------- libretroshare/src/rsitems/rsitem.h | 38 +++++++------- libretroshare/src/rsitems/rsmsgitems.cc | 47 ++++++++---------- libretroshare/src/rsitems/rsmsgitems.h | 46 ++++++++--------- libretroshare/src/rsitems/rsnxsitems.cc | 21 ++++++++ libretroshare/src/rsitems/rsnxsitems.h | 47 ++++++++---------- libretroshare/src/rsitems/rsphotoitems.cc | 46 ++++++++--------- libretroshare/src/rsitems/rsphotoitems.h | 46 ++++++++--------- libretroshare/src/rsitems/rspluginitems.h | 47 ++++++++---------- libretroshare/src/rsitems/rsposteditems.cc | 47 ++++++++---------- libretroshare/src/rsitems/rsposteditems.h | 21 ++++++++ libretroshare/src/rsitems/rsrttitems.cc | 47 ++++++++---------- libretroshare/src/rsitems/rsrttitems.h | 46 ++++++++--------- libretroshare/src/rsitems/rsserviceids.h | 46 ++++++++--------- .../src/rsitems/rsserviceinfoitems.cc | 46 ++++++++--------- .../src/rsitems/rsserviceinfoitems.h | 46 ++++++++--------- libretroshare/src/rsitems/rsstatusitems.h | 46 ++++++++--------- libretroshare/src/rsitems/rswikiitems.cc | 46 ++++++++--------- libretroshare/src/rsitems/rswikiitems.h | 45 ++++++++--------- libretroshare/src/rsitems/rswireitems.cc | 47 ++++++++---------- libretroshare/src/rsitems/rswireitems.h | 45 ++++++++--------- libretroshare/src/rsserver/p3face.h | 46 ++++++++--------- libretroshare/src/rsserver/p3history.cc | 47 ++++++++---------- libretroshare/src/rsserver/p3history.h | 46 ++++++++--------- libretroshare/src/rsserver/p3msgs.cc | 49 ++++++++----------- libretroshare/src/rsserver/p3msgs.h | 46 ++++++++--------- libretroshare/src/rsserver/p3peers.cc | 48 +++++++++--------- libretroshare/src/rsserver/p3peers.h | 47 ++++++++---------- libretroshare/src/rsserver/p3serverconfig.cc | 46 ++++++++--------- libretroshare/src/rsserver/p3serverconfig.h | 47 ++++++++---------- libretroshare/src/rsserver/p3status.cc | 47 ++++++++---------- libretroshare/src/rsserver/p3status.h | 46 ++++++++--------- libretroshare/src/rsserver/rsaccounts.cc | 46 ++++++++--------- libretroshare/src/rsserver/rsaccounts.h | 46 ++++++++--------- 65 files changed, 1368 insertions(+), 1571 deletions(-) diff --git a/libretroshare/src/rsitems/itempriorities.h b/libretroshare/src/rsitems/itempriorities.h index f5008eef0..dc346b7c3 100644 --- a/libretroshare/src/rsitems/itempriorities.h +++ b/libretroshare/src/rsitems/itempriorities.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: itempriorities.h - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2011-2011 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net" - * - */ - +/******************************************************************************* + * libretroshare/src/rsitems: rsitempriorities.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2011 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/rsitems/rsbanlistitems.cc b/libretroshare/src/rsitems/rsbanlistitems.cc index 44f908dee..f5dd9fca8 100644 --- a/libretroshare/src/rsitems/rsbanlistitems.cc +++ b/libretroshare/src/rsitems/rsbanlistitems.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsbanlist.cc - * - * RetroShare Serialiser. - * - * Copyright 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/rsitems: rsbanlistitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "serialiser/rsbaseserial.h" #include "rsitems/rsbanlistitems.h" diff --git a/libretroshare/src/rsitems/rsbanlistitems.h b/libretroshare/src/rsitems/rsbanlistitems.h index 6aec4b115..2f22a199e 100644 --- a/libretroshare/src/rsitems/rsbanlistitems.h +++ b/libretroshare/src/rsitems/rsbanlistitems.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsbanlistitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_BANLIST_ITEMS_H #define RS_BANLIST_ITEMS_H -/* - * libretroshare/src/serialiser: rsbanlistitems.h - * - * RetroShare Serialiser. - * - * Copyright 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 #include "rsitems/rsserviceids.h" diff --git a/libretroshare/src/rsitems/rsbwctrlitems.cc b/libretroshare/src/rsitems/rsbwctrlitems.cc index bfa172b45..759264aa0 100644 --- a/libretroshare/src/rsitems/rsbwctrlitems.cc +++ b/libretroshare/src/rsitems/rsbwctrlitems.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsbwctrlitems.cc - * - * RetroShare Serialiser. - * - * Copyright 2012 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/rsitems: rsbwctrlitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "serialiser/rsbaseserial.h" #include "rsitems/rsbwctrlitems.h" diff --git a/libretroshare/src/rsitems/rsbwctrlitems.h b/libretroshare/src/rsitems/rsbwctrlitems.h index 71ec641e1..300bd6f54 100644 --- a/libretroshare/src/rsitems/rsbwctrlitems.h +++ b/libretroshare/src/rsitems/rsbwctrlitems.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsbwctrlitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_BANDWIDTH_CONTROL_ITEMS_H #define RS_BANDWIDTH_CONTROL_ITEMS_H -/* - * libretroshare/src/serialiser: rsbwctrlitems.h - * - * RetroShare Serialiser. - * - * Copyright 2012 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". - * - */ - #include #include "rsitems/rsitem.h" diff --git a/libretroshare/src/rsitems/rsconfigitems.cc b/libretroshare/src/rsitems/rsconfigitems.cc index 17edb7962..654d1a7f6 100644 --- a/libretroshare/src/rsitems/rsconfigitems.cc +++ b/libretroshare/src/rsitems/rsconfigitems.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rsconfigitems.cc - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - +/******************************************************************************* + * libretroshare/src/rsitems: rsconfigitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "serialiser/rsbaseserial.h" #include "rsitems/rsconfigitems.h" #include "retroshare/rspeers.h" // Needed for RsGroupInfo. diff --git a/libretroshare/src/rsitems/rsconfigitems.h b/libretroshare/src/rsitems/rsconfigitems.h index a22f907d6..376bebb78 100644 --- a/libretroshare/src/rsitems/rsconfigitems.h +++ b/libretroshare/src/rsitems/rsconfigitems.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsconfigitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_CONFIG_ITEMS_SERIALISER_H #define RS_CONFIG_ITEMS_SERIALISER_H -/* - * libretroshare/src/serialiser: rsconfigitems.h - * - * RetroShare Serialiser. - * - * 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 #include diff --git a/libretroshare/src/rsitems/rsdiscovery2items.cc b/libretroshare/src/rsitems/rsdiscovery2items.cc index 0d1d3a493..1a23583db 100644 --- a/libretroshare/src/rsitems/rsdiscovery2items.cc +++ b/libretroshare/src/rsitems/rsdiscovery2items.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rsdiscitems.cc - * - * RetroShare Serialiser. - * - * 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/rsitems: rsdiscitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "rsitems/rsdiscovery2items.h" #include "serialiser/rsbaseserial.h" diff --git a/libretroshare/src/rsitems/rsdiscovery2items.h b/libretroshare/src/rsitems/rsdiscovery2items.h index 012ebe1b5..85f30b995 100644 --- a/libretroshare/src/rsitems/rsdiscovery2items.h +++ b/libretroshare/src/rsitems/rsdiscovery2items.h @@ -1,30 +1,24 @@ -/* - * libretroshare/src/serialiser: rsdiscitems.h - * - * Serialiser 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". - * - */ - - - +/******************************************************************************* + * libretroshare/src/rsitems: rsdiscitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_DISC_ITEMS_H #define RS_DISC_ITEMS_H diff --git a/libretroshare/src/rsitems/rsfiletransferitems.cc b/libretroshare/src/rsitems/rsfiletransferitems.cc index 4241081a7..3c34acf6a 100644 --- a/libretroshare/src/rsitems/rsfiletransferitems.cc +++ b/libretroshare/src/rsitems/rsfiletransferitems.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rsbaseitems.cc - * - * RetroShare Serialiser. - * - * 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/rsitems: rsfiletransferitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "serialiser/rsbaseserial.h" #include "serialiser/rstlvbase.h" #include "rsitems/rsfiletransferitems.h" diff --git a/libretroshare/src/rsitems/rsfiletransferitems.h b/libretroshare/src/rsitems/rsfiletransferitems.h index 85f6d5eab..60514e41f 100644 --- a/libretroshare/src/rsitems/rsfiletransferitems.h +++ b/libretroshare/src/rsitems/rsfiletransferitems.h @@ -1,30 +1,26 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsfiletransferitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once -/* - * libretroshare/src/serialiser: rsbaseitems.h - * - * RetroShare Serialiser. - * - * 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 #include "retroshare/rstypes.h" diff --git a/libretroshare/src/rsitems/rsgxschannelitems.cc b/libretroshare/src/rsitems/rsgxschannelitems.cc index a8cc067b1..123e85c17 100644 --- a/libretroshare/src/rsitems/rsgxschannelitems.cc +++ b/libretroshare/src/rsitems/rsgxschannelitems.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsgxschannelitems.cc - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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/rsitems: rsgxschannelitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "rsgxschannelitems.h" diff --git a/libretroshare/src/rsitems/rsgxschannelitems.h b/libretroshare/src/rsitems/rsgxschannelitems.h index b0fc67987..fa52c8cfc 100644 --- a/libretroshare/src/rsitems/rsgxschannelitems.h +++ b/libretroshare/src/rsitems/rsgxschannelitems.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsgxschannelitems.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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/rsitems: rsgxschannelitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_GXS_CHANNEL_ITEMS_H #define RS_GXS_CHANNEL_ITEMS_H diff --git a/libretroshare/src/rsitems/rsgxscircleitems.cc b/libretroshare/src/rsitems/rsgxscircleitems.cc index a468f483f..0acdd03de 100644 --- a/libretroshare/src/rsitems/rsgxscircleitems.cc +++ b/libretroshare/src/rsitems/rsgxscircleitems.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rswikiitems.cc - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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/rsitems: rsgxscircleitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "rsgxscircleitems.h" diff --git a/libretroshare/src/rsitems/rsgxscircleitems.h b/libretroshare/src/rsitems/rsgxscircleitems.h index 8e57b478c..6338fb368 100644 --- a/libretroshare/src/rsitems/rsgxscircleitems.h +++ b/libretroshare/src/rsitems/rsgxscircleitems.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsgxscircleitems.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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/rsitems: rsgxscircleitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_GXSCIRCLE_ITEMS_H #define RS_GXSCIRCLE_ITEMS_H diff --git a/libretroshare/src/rsitems/rsgxscommentitems.cc b/libretroshare/src/rsitems/rsgxscommentitems.cc index 8c175a1bd..2386fb069 100644 --- a/libretroshare/src/rsitems/rsgxscommentitems.cc +++ b/libretroshare/src/rsitems/rsgxscommentitems.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsgxscommentitems.cc - * - * RetroShare C++ Interface. - * - * Copyright 2012-2013 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/rsitems: rsgxscommentitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "rsgxscommentitems.h" diff --git a/libretroshare/src/rsitems/rsgxscommentitems.h b/libretroshare/src/rsitems/rsgxscommentitems.h index ec5d6ae2c..c35c6c2aa 100644 --- a/libretroshare/src/rsitems/rsgxscommentitems.h +++ b/libretroshare/src/rsitems/rsgxscommentitems.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsgxscommentitems.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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/rsitems: rsgxscommentitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_GXS_COMMENT_ITEMS_H #define RS_GXS_COMMENT_ITEMS_H diff --git a/libretroshare/src/rsitems/rsgxsforumitems.cc b/libretroshare/src/rsitems/rsgxsforumitems.cc index fb5b8f632..64356e1ed 100644 --- a/libretroshare/src/rsitems/rsgxsforumitems.cc +++ b/libretroshare/src/rsitems/rsgxsforumitems.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsgxsforumitems.cc - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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/rsitems: rsgxsforumitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "rsgxsforumitems.h" diff --git a/libretroshare/src/rsitems/rsgxsforumitems.h b/libretroshare/src/rsitems/rsgxsforumitems.h index 5ce8a84ee..30c6c4e08 100644 --- a/libretroshare/src/rsitems/rsgxsforumitems.h +++ b/libretroshare/src/rsitems/rsgxsforumitems.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsgxsforumitems.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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/rsitems: rsgxsforumitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_GXS_FORUM_ITEMS_H #define RS_GXS_FORUM_ITEMS_H diff --git a/libretroshare/src/rsitems/rsgxsiditems.cc b/libretroshare/src/rsitems/rsgxsiditems.cc index 1a4eac4e8..ee94d3682 100644 --- a/libretroshare/src/rsitems/rsgxsiditems.cc +++ b/libretroshare/src/rsitems/rsgxsiditems.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsgxsiditems.cc - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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/rsitems: rsgxsiditems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "rsgxsiditems.h" diff --git a/libretroshare/src/rsitems/rsgxsiditems.h b/libretroshare/src/rsitems/rsgxsiditems.h index 19802a9a1..61c7500f3 100644 --- a/libretroshare/src/rsitems/rsgxsiditems.h +++ b/libretroshare/src/rsitems/rsgxsiditems.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsgxsiditems.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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/rsitems: rsgxsiditems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_GXS_IDENTITY_ITEMS_H #define RS_GXS_IDENTITY_ITEMS_H diff --git a/libretroshare/src/rsitems/rsgxsitems.cc b/libretroshare/src/rsitems/rsgxsitems.cc index 9971514ec..90dc30462 100644 --- a/libretroshare/src/rsitems/rsgxsitems.cc +++ b/libretroshare/src/rsitems/rsgxsitems.cc @@ -1,11 +1,25 @@ -/* - * rsgxsitems.cc - * - * Created on: 26 Jul 2012 - * Author: crispy - */ - - +/******************************************************************************* + * libretroshare/src/rsitems: rsgxsitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * Copyright 2012-2012 by Christopher 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 . * + * * + *******************************************************************************/ #include "rsgxsitems.h" #include "gxs/rsgxsdata.h" #include diff --git a/libretroshare/src/rsitems/rsgxsitems.h b/libretroshare/src/rsitems/rsgxsitems.h index fa461a0e8..026f179e5 100644 --- a/libretroshare/src/rsitems/rsgxsitems.h +++ b/libretroshare/src/rsitems/rsgxsitems.h @@ -1,31 +1,28 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsgxsitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * Copyright 2012-2012 by Christopher 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 . * + * * + *******************************************************************************/ #ifndef RSGXSITEMS_H #define RSGXSITEMS_H -/* - * libretroshare/src/serialiser: rsgxsitems.h - * - * RetroShare Serialiser. - * - * Copyright 2012 Christopher Evi-Parker, 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 "rsitems/rsitem.h" #include "rsitems/rsserviceids.h" diff --git a/libretroshare/src/rsitems/rsgxsrecognitems.cc b/libretroshare/src/rsitems/rsgxsrecognitems.cc index bb6a40ca8..4113a051c 100644 --- a/libretroshare/src/rsitems/rsgxsrecognitems.cc +++ b/libretroshare/src/rsitems/rsgxsrecognitems.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsgxsrecogitems.cc - * - * RetroShare Serialiser. - * - * Copyright 2013-2013 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/rsitems: rsgxsrecogitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013-2013 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "rsitems/rsgxsrecognitems.h" #include "serialiser/rstypeserializer.h" diff --git a/libretroshare/src/rsitems/rsgxsrecognitems.h b/libretroshare/src/rsitems/rsgxsrecognitems.h index 68a9aa174..3e049f0c2 100644 --- a/libretroshare/src/rsitems/rsgxsrecognitems.h +++ b/libretroshare/src/rsitems/rsgxsrecognitems.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsgxsrecogitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013-2013 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_GXS_RECOG_ITEMS_H #define RS_GXS_RECOG_ITEMS_H -/* - * libretroshare/src/serialiser: rsgxsrecogitems.h - * - * RetroShare Serialiser. - * - * Copyright 2013-2013 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". - * - */ - #include #include "rsitems/rsitem.h" diff --git a/libretroshare/src/rsitems/rsgxsreputationitems.cc b/libretroshare/src/rsitems/rsgxsreputationitems.cc index 7b558131a..9aa8c6e9c 100644 --- a/libretroshare/src/rsitems/rsgxsreputationitems.cc +++ b/libretroshare/src/rsitems/rsgxsreputationitems.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsbanlist.cc - * - * RetroShare Serialiser. - * - * Copyright 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/rsitems: rsgxsreputationitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include #include "serialiser/rsbaseserial.h" diff --git a/libretroshare/src/rsitems/rsgxsreputationitems.h b/libretroshare/src/rsitems/rsgxsreputationitems.h index d4134f745..6bcd77451 100644 --- a/libretroshare/src/rsitems/rsgxsreputationitems.h +++ b/libretroshare/src/rsitems/rsgxsreputationitems.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsgxsreputationitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014-2014 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_GXSREPUTATION_ITEMS_H #define RS_GXSREPUTATION_ITEMS_H -/* - * libretroshare/src/serialiser: rsgxsreputationitems.h - * - * RetroShare Serialiser. - * - * Copyright 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". - * - */ - #include #include "rsitems/rsserviceids.h" diff --git a/libretroshare/src/rsitems/rsgxsupdateitems.cc b/libretroshare/src/rsitems/rsgxsupdateitems.cc index a5f3ecf02..5fb7c94fb 100644 --- a/libretroshare/src/rsitems/rsgxsupdateitems.cc +++ b/libretroshare/src/rsitems/rsgxsupdateitems.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsgxsupdateitems.h - * - * RetroShare Serialiser. - * - * Copyright 2012 Christopher 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". - * - */ - +/******************************************************************************* + * libretroshare/src/rsitems: rsgxsupdateitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 Christopher 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 . * + * * + *******************************************************************************/ #include "serialiser/rstypeserializer.h" #include "serialiser/rsbaseserial.h" diff --git a/libretroshare/src/rsitems/rsgxsupdateitems.h b/libretroshare/src/rsitems/rsgxsupdateitems.h index 5d13028ff..d1ca0eecd 100644 --- a/libretroshare/src/rsitems/rsgxsupdateitems.h +++ b/libretroshare/src/rsitems/rsgxsupdateitems.h @@ -1,33 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsgxsupdateitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 Christopher 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 . * + * * + *******************************************************************************/ #ifndef RSGXSUPDATEITEMS_H_ #define RSGXSUPDATEITEMS_H_ -/* - * libretroshare/src/serialiser: rsgxsupdateitems.h - * - * RetroShare Serialiser. - * - * Copyright 2012 Christopher 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 "gxs/rsgxs.h" #include "gxs/rsgxsdata.h" #include "serialiser/rstlvidset.h" diff --git a/libretroshare/src/rsitems/rsheartbeatitems.h b/libretroshare/src/rsitems/rsheartbeatitems.h index 87d480b3e..b7e4f27c6 100644 --- a/libretroshare/src/rsitems/rsheartbeatitems.h +++ b/libretroshare/src/rsitems/rsheartbeatitems.h @@ -1,30 +1,24 @@ -/* - * libretroshare/src/serialiser: rsheartbeatitems.h - * - * Serialiser for RetroShare. - * - * Copyright 2004-2013 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/rsitems: rsheartbeatitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2013 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_HEARTBEAT_ITEMS_H #define RS_HEARTBEAT_ITEMS_H diff --git a/libretroshare/src/rsitems/rshistoryitems.cc b/libretroshare/src/rsitems/rshistoryitems.cc index 1f16e976f..4cfb04945 100644 --- a/libretroshare/src/rsitems/rshistoryitems.cc +++ b/libretroshare/src/rsitems/rshistoryitems.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rshistoryitems.cc - * - * RetroShare Serialiser. - * - * 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/rsitems: rshistoryitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 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 . * + * * + *******************************************************************************/ #include "rsitems/rshistoryitems.h" #include "rsitems/rsconfigitems.h" diff --git a/libretroshare/src/rsitems/rshistoryitems.h b/libretroshare/src/rsitems/rshistoryitems.h index 7f65f3d19..693817757 100644 --- a/libretroshare/src/rsitems/rshistoryitems.h +++ b/libretroshare/src/rsitems/rshistoryitems.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rshistoryitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 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 . * + * * + *******************************************************************************/ #ifndef RS_HISTORY_ITEMS_H #define RS_HISTORY_ITEMS_H -/* - * libretroshare/src/serialiser: rshistoryitems.h - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 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 "rsitems/rsserviceids.h" #include "serialiser/rsserial.h" #include "rsitems/rsconfigitems.h" diff --git a/libretroshare/src/rsitems/rsitem.h b/libretroshare/src/rsitems/rsitem.h index 545870631..c7cdccf5b 100644 --- a/libretroshare/src/rsitems/rsitem.h +++ b/libretroshare/src/rsitems/rsitem.h @@ -1,21 +1,25 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsitem.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once -/* - * RetroShare Serialiser. - * Copyright (C) 2018 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ #include // for typeid diff --git a/libretroshare/src/rsitems/rsmsgitems.cc b/libretroshare/src/rsitems/rsmsgitems.cc index e9668cc9f..32d32dd06 100644 --- a/libretroshare/src/rsitems/rsmsgitems.cc +++ b/libretroshare/src/rsitems/rsmsgitems.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rsbaseitems.cc - * - * RetroShare Serialiser. - * - * 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/rsitems: rsmsgitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include #include "serialiser/rsbaseserial.h" diff --git a/libretroshare/src/rsitems/rsmsgitems.h b/libretroshare/src/rsitems/rsmsgitems.h index 71f546683..ad84ec3ba 100644 --- a/libretroshare/src/rsitems/rsmsgitems.h +++ b/libretroshare/src/rsitems/rsmsgitems.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsmsgitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_MSG_ITEMS_H #define RS_MSG_ITEMS_H -/* - * libretroshare/src/serialiser: rsmsgitems.h - * - * RetroShare Serialiser. - * - * 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 #include "retroshare/rstypes.h" diff --git a/libretroshare/src/rsitems/rsnxsitems.cc b/libretroshare/src/rsitems/rsnxsitems.cc index 8c6775275..ab596a99b 100644 --- a/libretroshare/src/rsitems/rsnxsitems.cc +++ b/libretroshare/src/rsitems/rsnxsitems.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsnxsitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 Christopher Evi-Parker,Robert Fernie* + * * + * 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 . * + * * + *******************************************************************************/ #include "rsnxsitems.h" #include "util/rsprint.h" #include diff --git a/libretroshare/src/rsitems/rsnxsitems.h b/libretroshare/src/rsitems/rsnxsitems.h index f717a3d09..ea4dbea06 100644 --- a/libretroshare/src/rsitems/rsnxsitems.h +++ b/libretroshare/src/rsitems/rsnxsitems.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsnxsitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 Christopher Evi-Parker,Robert Fernie* + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RSNXSITEMS_H #define RSNXSITEMS_H -/* - * libretroshare/src/serialiser: rsnxssitems.h - * - * RetroShare Serialiser. - * - * Copyright 2012 Christopher Evi-Parker, 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 #include diff --git a/libretroshare/src/rsitems/rsphotoitems.cc b/libretroshare/src/rsitems/rsphotoitems.cc index 9c9ff2d02..7d137a29a 100644 --- a/libretroshare/src/rsitems/rsphotoitems.cc +++ b/libretroshare/src/rsitems/rsphotoitems.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/retroshare: rsphoto.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 by Christopher Evi-Parker, 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/rsitems: rsphotoitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 Christopher Evi-Parker,Robert Fernie* + * * + * 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 . * + * * + *******************************************************************************/ #include #include "rsitems/rsphotoitems.h" diff --git a/libretroshare/src/rsitems/rsphotoitems.h b/libretroshare/src/rsitems/rsphotoitems.h index 3819edb88..2aa041597 100644 --- a/libretroshare/src/rsitems/rsphotoitems.h +++ b/libretroshare/src/rsitems/rsphotoitems.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/retroshare: rsphoto.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 by Christopher Evi-Parker, 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/rsitems: rsphotoitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 Christopher Evi-Parker,Robert Fernie* + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RSPHOTOV2ITEMS_H_ #define RSPHOTOV2ITEMS_H_ diff --git a/libretroshare/src/rsitems/rspluginitems.h b/libretroshare/src/rsitems/rspluginitems.h index c21567cd1..29069815d 100644 --- a/libretroshare/src/rsitems/rspluginitems.h +++ b/libretroshare/src/rsitems/rspluginitems.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/services: p3turtle.h - * - * Services for RetroShare. - * - * Copyright 2009 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - - +/******************************************************************************* + * libretroshare/src/rsitems: rspluginitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2009 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include "rsitems/rsitem.h" diff --git a/libretroshare/src/rsitems/rsposteditems.cc b/libretroshare/src/rsitems/rsposteditems.cc index 378153df3..67a5a9873 100644 --- a/libretroshare/src/rsitems/rsposteditems.cc +++ b/libretroshare/src/rsitems/rsposteditems.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/gxs: rsopsteditems.cc - * - * RetroShare Serialiser. - * - * Copyright 2012-2013 by Robert Fernie, Christopher 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.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/rsitems: rsposteditems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "rsitems/rsposteditems.h" #include "serialiser/rstypeserializer.h" diff --git a/libretroshare/src/rsitems/rsposteditems.h b/libretroshare/src/rsitems/rsposteditems.h index b78835451..62ab7a6af 100644 --- a/libretroshare/src/rsitems/rsposteditems.h +++ b/libretroshare/src/rsitems/rsposteditems.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsposteditems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RSPOSTEDITEMS_H #define RSPOSTEDITEMS_H diff --git a/libretroshare/src/rsitems/rsrttitems.cc b/libretroshare/src/rsitems/rsrttitems.cc index 033975a3b..739f1c06d 100644 --- a/libretroshare/src/rsitems/rsrttitems.cc +++ b/libretroshare/src/rsitems/rsrttitems.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rsrttitems.cc - * - * RetroShare Serialiser. - * - * Copyright 2011-2013 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/rsitems: rsrttitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2013 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "rsitems/rsrttitems.h" /*** diff --git a/libretroshare/src/rsitems/rsrttitems.h b/libretroshare/src/rsitems/rsrttitems.h index 90b2e385e..54f612ee6 100644 --- a/libretroshare/src/rsitems/rsrttitems.h +++ b/libretroshare/src/rsitems/rsrttitems.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsrttitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2013 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_RTT_ITEMS_H #define RS_RTT_ITEMS_H -/* - * libretroshare/src/serialiser: rsrttitems.h - * - * RetroShare Serialiser. - * - * Copyright 2011-2013 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". - * - */ - #include #include "rsitems/rsitem.h" diff --git a/libretroshare/src/rsitems/rsserviceids.h b/libretroshare/src/rsitems/rsserviceids.h index 557bc54d7..4c7f26fd8 100644 --- a/libretroshare/src/rsitems/rsserviceids.h +++ b/libretroshare/src/rsitems/rsserviceids.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsserviceids.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_SERVICE_IDS_H #define RS_SERVICE_IDS_H -/* - * libretroshare/src/serialiser: rsserviceids.h - * - * RetroShare Serialiser. - * - * 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 /* Single place for Cache/Service Ids (uint16_t) diff --git a/libretroshare/src/rsitems/rsserviceinfoitems.cc b/libretroshare/src/rsitems/rsserviceinfoitems.cc index d0d2070ab..8d007941d 100644 --- a/libretroshare/src/rsitems/rsserviceinfoitems.cc +++ b/libretroshare/src/rsitems/rsserviceinfoitems.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsserviceinfoitems.cc - * - * RetroShare Serialiser. - * - * Copyright 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/rsitems: rsserviceinfoitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "serialiser/rsbaseserial.h" #include "serialiser/rstypeserializer.h" #include "rsitems/rsserviceinfoitems.h" diff --git a/libretroshare/src/rsitems/rsserviceinfoitems.h b/libretroshare/src/rsitems/rsserviceinfoitems.h index 04a524331..e3d04b3c8 100644 --- a/libretroshare/src/rsitems/rsserviceinfoitems.h +++ b/libretroshare/src/rsitems/rsserviceinfoitems.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsserviceinfoitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_SERVICE_INFO_ITEMS_H #define RS_SERVICE_INFO_ITEMS_H -/* - * libretroshare/src/serialiser: rsserviceinfoitems.h - * - * RetroShare Serialiser. - * - * Copyright 2012 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". - * - */ - // Provides serialiser for p3ServiceControl & p3ServiceInfo. #include diff --git a/libretroshare/src/rsitems/rsstatusitems.h b/libretroshare/src/rsitems/rsstatusitems.h index 8a8a946b7..e92db7816 100644 --- a/libretroshare/src/rsitems/rsstatusitems.h +++ b/libretroshare/src/rsitems/rsstatusitems.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsitems: rsstatusitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Vinny Do. * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_STATUS_ITEMS_H #define RS_STATUS_ITEMS_H -/* - * libretroshare/src/serialiser: rsstatusitems.h - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Vinny Do. - * - * 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 "rsitems/rsserviceids.h" #include "rsitems/itempriorities.h" #include "rsitems/rsitem.h" diff --git a/libretroshare/src/rsitems/rswikiitems.cc b/libretroshare/src/rsitems/rswikiitems.cc index 96f9e2768..e7ffa8508 100644 --- a/libretroshare/src/rsitems/rswikiitems.cc +++ b/libretroshare/src/rsitems/rswikiitems.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rswikiitems.cc - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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/rsitems: rswikiitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "rsitems/rswikiitems.h" diff --git a/libretroshare/src/rsitems/rswikiitems.h b/libretroshare/src/rsitems/rswikiitems.h index 378b77e5a..fa5cf1533 100644 --- a/libretroshare/src/rsitems/rswikiitems.h +++ b/libretroshare/src/rsitems/rswikiitems.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/serialiser: rswikiitems.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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/rsitems: rswikiitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_WIKI_ITEMS_H #define RS_WIKI_ITEMS_H diff --git a/libretroshare/src/rsitems/rswireitems.cc b/libretroshare/src/rsitems/rswireitems.cc index 7a8008ff8..eb3896f17 100644 --- a/libretroshare/src/rsitems/rswireitems.cc +++ b/libretroshare/src/rsitems/rswireitems.cc @@ -1,32 +1,27 @@ -/* - * libretroshare/src/serialiser: rswikiitems.cc - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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/rsitems: rswireitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "rswireitems.h" - #include "serialiser/rstypeserializer.h" #define WIRE_DEBUG 1 diff --git a/libretroshare/src/rsitems/rswireitems.h b/libretroshare/src/rsitems/rswireitems.h index 137619aa6..4db5f3d25 100644 --- a/libretroshare/src/rsitems/rswireitems.h +++ b/libretroshare/src/rsitems/rswireitems.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/serialiser: rswireitems.h - * - * RetroShare C++ Interface. - * - * Copyright 2012-2012 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/rsitems: rswireitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_WIRE_ITEMS_H #define RS_WIRE_ITEMS_H diff --git a/libretroshare/src/rsserver/p3face.h b/libretroshare/src/rsserver/p3face.h index 8e1ffac56..6a9d7b2ea 100644 --- a/libretroshare/src/rsserver/p3face.h +++ b/libretroshare/src/rsserver/p3face.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsserver: p3face.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #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" diff --git a/libretroshare/src/rsserver/p3history.cc b/libretroshare/src/rsserver/p3history.cc index 6c631ef43..9492a09f0 100644 --- a/libretroshare/src/rsserver/p3history.cc +++ b/libretroshare/src/rsserver/p3history.cc @@ -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 . * + * * + *******************************************************************************/ #include "p3history.h" #include "pqi/p3historymgr.h" diff --git a/libretroshare/src/rsserver/p3history.h b/libretroshare/src/rsserver/p3history.h index 70b7c701b..73d009657 100644 --- a/libretroshare/src/rsserver/p3history.h +++ b/libretroshare/src/rsserver/p3history.h @@ -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 . * + * * + *******************************************************************************/ #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; diff --git a/libretroshare/src/rsserver/p3msgs.cc b/libretroshare/src/rsserver/p3msgs.cc index 0e058cac9..da2220912 100644 --- a/libretroshare/src/rsserver/p3msgs.cc +++ b/libretroshare/src/rsserver/p3msgs.cc @@ -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 * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "util/rsdir.h" diff --git a/libretroshare/src/rsserver/p3msgs.h b/libretroshare/src/rsserver/p3msgs.h index 7c242680f..edd5911a8 100644 --- a/libretroshare/src/rsserver/p3msgs.h +++ b/libretroshare/src/rsserver/p3msgs.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsserver: p3msgs.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #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" diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index 52f6c3dba..9d3b8f60c 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -1,29 +1,25 @@ -/* - * libretroshare/src/rsserver: p3peers.cc - * - * RetroShare C++ Interface. - * - * Copyright 2004-2008 by Robert Fernie. - * Copyright (C) 2015-2018 Gioacchino Mazzurco - * - * 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 * + * Copyright (C) 2015-2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #include "util/radix64.h" #include "pgp/pgpkeyutil.h" diff --git a/libretroshare/src/rsserver/p3peers.h b/libretroshare/src/rsserver/p3peers.h index 4f9b661d7..b30fc8eb6 100644 --- a/libretroshare/src/rsserver/p3peers.h +++ b/libretroshare/src/rsserver/p3peers.h @@ -1,31 +1,26 @@ +/******************************************************************************* + * libretroshare/src/rsserver: p3peers.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #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 */ diff --git a/libretroshare/src/rsserver/p3serverconfig.cc b/libretroshare/src/rsserver/p3serverconfig.cc index eab0f5722..21d43cbae 100644 --- a/libretroshare/src/rsserver/p3serverconfig.cc +++ b/libretroshare/src/rsserver/p3serverconfig.cc @@ -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 * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "rsserver/p3serverconfig.h" #include "services/p3bwctrl.h" diff --git a/libretroshare/src/rsserver/p3serverconfig.h b/libretroshare/src/rsserver/p3serverconfig.h index 134558049..1a806d713 100644 --- a/libretroshare/src/rsserver/p3serverconfig.h +++ b/libretroshare/src/rsserver/p3serverconfig.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * libretroshare/src/rsserver: p3serverconfig.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #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" diff --git a/libretroshare/src/rsserver/p3status.cc b/libretroshare/src/rsserver/p3status.cc index a1733a86c..4185e6802 100644 --- a/libretroshare/src/rsserver/p3status.cc +++ b/libretroshare/src/rsserver/p3status.cc @@ -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 . * + * * + *******************************************************************************/ #include "p3status.h" #include "services/p3statusservice.h" diff --git a/libretroshare/src/rsserver/p3status.h b/libretroshare/src/rsserver/p3status.h index bec3d4822..a6ae941f0 100644 --- a/libretroshare/src/rsserver/p3status.h +++ b/libretroshare/src/rsserver/p3status.h @@ -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 . * + * * + *******************************************************************************/ #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" diff --git a/libretroshare/src/rsserver/rsaccounts.cc b/libretroshare/src/rsserver/rsaccounts.cc index 6136a2a87..f9965cee4 100644 --- a/libretroshare/src/rsserver/rsaccounts.cc +++ b/libretroshare/src/rsserver/rsaccounts.cc @@ -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 * + * * + * 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 . * + * * + *******************************************************************************/ /********************************************************************* * Libretroshare interface declared in rsaccounts.h. diff --git a/libretroshare/src/rsserver/rsaccounts.h b/libretroshare/src/rsserver/rsaccounts.h index 8ff253587..2ec87b3e6 100644 --- a/libretroshare/src/rsserver/rsaccounts.h +++ b/libretroshare/src/rsserver/rsaccounts.h @@ -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 * + * * + * 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 . * + * * + *******************************************************************************/ /********************************************************************* * Header providing interface for libretroshare access to RsAccounts stuff. From 70f09b654c4f7a7eaefc521817c08ff5a7babc52 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 29 May 2018 21:27:12 +0200 Subject: [PATCH 062/138] re-licensed serialiser/ --- libretroshare/src/serialiser/rsbaseserial.cc | 46 +++++++-------- libretroshare/src/serialiser/rsbaseserial.h | 46 +++++++-------- libretroshare/src/serialiser/rsserial.cc | 46 +++++++-------- libretroshare/src/serialiser/rsserial.h | 46 +++++++-------- libretroshare/src/serialiser/rsserializable.h | 39 +++++++------ libretroshare/src/serialiser/rsserializer.cc | 46 +++++++-------- libretroshare/src/serialiser/rsserializer.h | 47 +++++++-------- libretroshare/src/serialiser/rstlvaddrs.cc | 47 +++++++-------- libretroshare/src/serialiser/rstlvaddrs.h | 46 +++++++-------- libretroshare/src/serialiser/rstlvbanlist.cc | 47 +++++++-------- libretroshare/src/serialiser/rstlvbanlist.h | 46 +++++++-------- libretroshare/src/serialiser/rstlvbase.cc | 47 +++++++-------- libretroshare/src/serialiser/rstlvbase.h | 47 +++++++-------- libretroshare/src/serialiser/rstlvbinary.cc | 47 +++++++-------- libretroshare/src/serialiser/rstlvbinary.h | 46 +++++++-------- libretroshare/src/serialiser/rstlvfileitem.cc | 47 +++++++-------- libretroshare/src/serialiser/rstlvfileitem.h | 46 +++++++-------- .../src/serialiser/rstlvgenericmap.h | 46 +++++++-------- .../src/serialiser/rstlvgenericmap.inl | 46 +++++++-------- .../src/serialiser/rstlvgenericparam.cc | 47 +++++++-------- .../src/serialiser/rstlvgenericparam.h | 46 +++++++-------- libretroshare/src/serialiser/rstlvidset.cc | 57 +++++++------------ libretroshare/src/serialiser/rstlvidset.h | 46 +++++++-------- libretroshare/src/serialiser/rstlvimage.cc | 47 +++++++-------- libretroshare/src/serialiser/rstlvimage.h | 46 +++++++-------- libretroshare/src/serialiser/rstlvitem.cc | 47 +++++++-------- libretroshare/src/serialiser/rstlvitem.h | 45 +++++++-------- libretroshare/src/serialiser/rstlvkeys.cc | 47 +++++++-------- libretroshare/src/serialiser/rstlvkeys.h | 46 +++++++-------- libretroshare/src/serialiser/rstlvkeyvalue.cc | 47 +++++++-------- libretroshare/src/serialiser/rstlvkeyvalue.h | 46 +++++++-------- libretroshare/src/serialiser/rstlvlist.h | 46 +++++++-------- libretroshare/src/serialiser/rstlvmaps.h | 52 +++++++---------- libretroshare/src/serialiser/rstlvstring.cc | 47 +++++++-------- libretroshare/src/serialiser/rstlvstring.h | 46 +++++++-------- .../src/serialiser/rstypeserializer.cc | 47 +++++++-------- .../src/serialiser/rstypeserializer.h | 47 +++++++-------- 37 files changed, 780 insertions(+), 946 deletions(-) diff --git a/libretroshare/src/serialiser/rsbaseserial.cc b/libretroshare/src/serialiser/rsbaseserial.cc index ef862db5c..a5b84518f 100644 --- a/libretroshare/src/serialiser/rsbaseserial.cc +++ b/libretroshare/src/serialiser/rsbaseserial.cc @@ -1,28 +1,24 @@ - -/* - * libretroshare/src/serialiser: rsbaseserial.cc - * - * RetroShare Serialiser. - * - * 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/serialiser: rsbaseserial.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include /* Included because GCC4.4 wants it */ #include /* Included because GCC4.4 wants it */ diff --git a/libretroshare/src/serialiser/rsbaseserial.h b/libretroshare/src/serialiser/rsbaseserial.h index 650fc9e6d..512feb393 100644 --- a/libretroshare/src/serialiser/rsbaseserial.h +++ b/libretroshare/src/serialiser/rsbaseserial.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rsbaseserial.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_BASE_PACKING_H #define RS_BASE_PACKING_H -/* - * libretroshare/src/serialiser: rsbaseserial.h - * - * RetroShare Serialiser. - * - * 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 #include #include diff --git a/libretroshare/src/serialiser/rsserial.cc b/libretroshare/src/serialiser/rsserial.cc index 230501ea8..0a1a7503f 100644 --- a/libretroshare/src/serialiser/rsserial.cc +++ b/libretroshare/src/serialiser/rsserial.cc @@ -1,28 +1,24 @@ - -/* - * libretroshare/src/serialiser: rsserial.cc - * - * RetroShare Serialiser. - * - * 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/serialiser: rsserial.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "serialiser/rsbaseserial.h" diff --git a/libretroshare/src/serialiser/rsserial.h b/libretroshare/src/serialiser/rsserial.h index ee3a79537..3ce56a424 100644 --- a/libretroshare/src/serialiser/rsserial.h +++ b/libretroshare/src/serialiser/rsserial.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rsserial.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_BASE_SERIALISER_H #define RS_BASE_SERIALISER_H -/* - * libretroshare/src/serialiser: rsserial.h - * - * RetroShare Serialiser. - * - * 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 #include #include diff --git a/libretroshare/src/serialiser/rsserializable.h b/libretroshare/src/serialiser/rsserializable.h index c717afc4b..fc6d73662 100644 --- a/libretroshare/src/serialiser/rsserializable.h +++ b/libretroshare/src/serialiser/rsserializable.h @@ -1,22 +1,25 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rsserializable.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2016-2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once -/* - * RetroShare Serialiser. - * Copyright (C) 2016-2018 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - #include "serialiser/rsserializer.h" diff --git a/libretroshare/src/serialiser/rsserializer.cc b/libretroshare/src/serialiser/rsserializer.cc index 164f31342..4a07da014 100644 --- a/libretroshare/src/serialiser/rsserializer.cc +++ b/libretroshare/src/serialiser/rsserializer.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/serialiser: rsserializer.cc - * - * RetroShare Serialiser. - * - * Copyright 2016 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/serialiser: rsserializer.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2016 Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "rsitems/rsitem.h" diff --git a/libretroshare/src/serialiser/rsserializer.h b/libretroshare/src/serialiser/rsserializer.h index aa12feeef..7045218df 100644 --- a/libretroshare/src/serialiser/rsserializer.h +++ b/libretroshare/src/serialiser/rsserializer.h @@ -1,28 +1,25 @@ -/* - * libretroshare/src/serialiser: rsserializer.h - * - * RetroShare Serialiser. - * - * Copyright (C) 2016 Cyril Soler - * Copyright (C) 2018 Gioacchino Mazzurco - * - * 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 "csoler@users.sourceforge.net". - * - */ +/******************************************************************************* + * libretroshare/src/serialiser: rsserializer.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2016 Cyril Soler * + * Copyright (C) 2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once /////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/libretroshare/src/serialiser/rstlvaddrs.cc b/libretroshare/src/serialiser/rstlvaddrs.cc index d3f7da87f..5f9a06390 100644 --- a/libretroshare/src/serialiser/rstlvaddrs.cc +++ b/libretroshare/src/serialiser/rstlvaddrs.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rstlvtypes.cc - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - +/******************************************************************************* + * libretroshare/src/serialiser: rstlvaddr.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "serialiser/rstlvbase.h" #include "serialiser/rstlvaddrs.h" #include "serialiser/rsbaseserial.h" diff --git a/libretroshare/src/serialiser/rstlvaddrs.h b/libretroshare/src/serialiser/rstlvaddrs.h index eebda4b31..07b668559 100644 --- a/libretroshare/src/serialiser/rstlvaddrs.h +++ b/libretroshare/src/serialiser/rstlvaddrs.h @@ -1,30 +1,26 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvaddr.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once -/* - * libretroshare/src/serialiser: rstlvaddrs.h - * - * RetroShare Serialiser. - * - * Copyright 2010 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". - * - */ - /******************************************************************* * These are the Compound TLV structures that must be (un)packed. ******************************************************************/ diff --git a/libretroshare/src/serialiser/rstlvbanlist.cc b/libretroshare/src/serialiser/rstlvbanlist.cc index 16cef67dc..92bd3a6d2 100644 --- a/libretroshare/src/serialiser/rstlvbanlist.cc +++ b/libretroshare/src/serialiser/rstlvbanlist.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rstlvtypes.cc - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - +/******************************************************************************* + * libretroshare/src/serialiser: rstlvbanlist.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "serialiser/rstlvbanlist.h" #include "serialiser/rstlvbase.h" diff --git a/libretroshare/src/serialiser/rstlvbanlist.h b/libretroshare/src/serialiser/rstlvbanlist.h index f4cbf54c4..a08f92a7a 100644 --- a/libretroshare/src/serialiser/rstlvbanlist.h +++ b/libretroshare/src/serialiser/rstlvbanlist.h @@ -1,30 +1,26 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvbanlist.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once -/* - * libretroshare/src/serialiser: rstlvbanlist.h - * - * RetroShare Serialiser. - * - * Copyright 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". - * - */ - /******************************************************************* * These are the Compound TLV structures that must be (un)packed. ******************************************************************/ diff --git a/libretroshare/src/serialiser/rstlvbase.cc b/libretroshare/src/serialiser/rstlvbase.cc index f92dae4d9..9cf713193 100644 --- a/libretroshare/src/serialiser/rstlvbase.cc +++ b/libretroshare/src/serialiser/rstlvbase.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rstlvbase.cc - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Horatio, Chris 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". - * - */ - +/******************************************************************************* + * libretroshare/src/serialiser: rstlvbase.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie, Horatio, Chris 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 . * + * * + *******************************************************************************/ #include #include "serialiser/rstlvbase.h" diff --git a/libretroshare/src/serialiser/rstlvbase.h b/libretroshare/src/serialiser/rstlvbase.h index 3f6ac1102..fa685b11e 100644 --- a/libretroshare/src/serialiser/rstlvbase.h +++ b/libretroshare/src/serialiser/rstlvbase.h @@ -1,31 +1,26 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvbase.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie, Horatio, Chris 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 . * + * * + *******************************************************************************/ #pragma once -/* - * libretroshare/src/serialiser: rstlvbase.h - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Horatio, Chris 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". - * - */ - - /******************************************************************* * These are the general TLV (un)packing routines. * diff --git a/libretroshare/src/serialiser/rstlvbinary.cc b/libretroshare/src/serialiser/rstlvbinary.cc index 9c84f6ec2..daa35c56d 100644 --- a/libretroshare/src/serialiser/rstlvbinary.cc +++ b/libretroshare/src/serialiser/rstlvbinary.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rstlvbinary.cc - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - +/******************************************************************************* + * libretroshare/src/serialiser: rstlvbinary.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie,Chris 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 . * + * * + *******************************************************************************/ #include "util/rsmemory.h" #include "serialiser/rstlvbinary.h" diff --git a/libretroshare/src/serialiser/rstlvbinary.h b/libretroshare/src/serialiser/rstlvbinary.h index a22269e0f..3d41d5402 100644 --- a/libretroshare/src/serialiser/rstlvbinary.h +++ b/libretroshare/src/serialiser/rstlvbinary.h @@ -1,30 +1,26 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvbinary.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie,Chris 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 . * + * * + *******************************************************************************/ #pragma once -/* - * libretroshare/src/serialiser: rstlvbinary.h - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - /******************************************************************* * These are the Compound TLV structures that must be (un)packed. * diff --git a/libretroshare/src/serialiser/rstlvfileitem.cc b/libretroshare/src/serialiser/rstlvfileitem.cc index dfc90672c..098b8de6f 100644 --- a/libretroshare/src/serialiser/rstlvfileitem.cc +++ b/libretroshare/src/serialiser/rstlvfileitem.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rstlvfileitem.cc - * - * RetroShare Serialiser. - * - * 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/serialiser: rstlvfileitem.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie,Chris 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 . * + * * + *******************************************************************************/ #include "serialiser/rstlvfileitem.h" #include "serialiser/rsbaseserial.h" diff --git a/libretroshare/src/serialiser/rstlvfileitem.h b/libretroshare/src/serialiser/rstlvfileitem.h index 1a474e60c..174753364 100644 --- a/libretroshare/src/serialiser/rstlvfileitem.h +++ b/libretroshare/src/serialiser/rstlvfileitem.h @@ -1,30 +1,26 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvfileitem.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie,Chris 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 . * + * * + *******************************************************************************/ #pragma once -/* - * libretroshare/src/serialiser: rstlvfileitem.h - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - /******************************************************************* * These are the Compound TLV structures that must be (un)packed. * diff --git a/libretroshare/src/serialiser/rstlvgenericmap.h b/libretroshare/src/serialiser/rstlvgenericmap.h index baccae90f..0cc4a3a88 100644 --- a/libretroshare/src/serialiser/rstlvgenericmap.h +++ b/libretroshare/src/serialiser/rstlvgenericmap.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvgenericmap.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_TLV_GENERIC_MAP_H #define RS_TLV_GENERIC_MAP_H -/* - * libretroshare/src/serialiser: rstlvgenericmap.h - * - * RetroShare Serialiser. - * - * Copyright 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". - * - */ - #include "serialiser/rstlvitem.h" #include "serialiser/rstlvgenericparam.h" diff --git a/libretroshare/src/serialiser/rstlvgenericmap.inl b/libretroshare/src/serialiser/rstlvgenericmap.inl index 540ee5d2e..b5239d2f7 100644 --- a/libretroshare/src/serialiser/rstlvgenericmap.inl +++ b/libretroshare/src/serialiser/rstlvgenericmap.inl @@ -1,28 +1,24 @@ - -/* - * libretroshare/src/serialiser: rstlvgenericmap.inl - * - * RetroShare Serialiser. - * - * Copyright 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/serialiser: rstlvgenericmap.inl * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "serialiser/rstlvbase.h" diff --git a/libretroshare/src/serialiser/rstlvgenericparam.cc b/libretroshare/src/serialiser/rstlvgenericparam.cc index 483bae0fb..941fd6883 100644 --- a/libretroshare/src/serialiser/rstlvgenericparam.cc +++ b/libretroshare/src/serialiser/rstlvgenericparam.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rstlvgenericparam.cc - * - * RetroShare Serialiser. - * - * Copyright 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/serialiser: rstlvgenericparam.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "serialiser/rstlvgenericparam.h" #include "serialiser/rstlvbase.h" #include diff --git a/libretroshare/src/serialiser/rstlvgenericparam.h b/libretroshare/src/serialiser/rstlvgenericparam.h index 31da8e275..b1b6417a7 100644 --- a/libretroshare/src/serialiser/rstlvgenericparam.h +++ b/libretroshare/src/serialiser/rstlvgenericparam.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvgenericparam.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_TLV_GENERIC_PARAM_H #define RS_TLV_GENERIC_PARAM_H -/* - * libretroshare/src/serialiser: rstlvgenericparam.h - * - * RetroShare Serialiser. - * - * Copyright 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". - * - */ - #include "serialiser/rstlvitem.h" #if 0 diff --git a/libretroshare/src/serialiser/rstlvidset.cc b/libretroshare/src/serialiser/rstlvidset.cc index 918d98526..c3d6ac3d7 100644 --- a/libretroshare/src/serialiser/rstlvidset.cc +++ b/libretroshare/src/serialiser/rstlvidset.cc @@ -1,41 +1,26 @@ - -/* - * libretroshare/src/serialiser: rstlvtypes.cc - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - +/******************************************************************************* + * libretroshare/src/serialiser: rstlvidset.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie,Chris 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 . * + * * + *******************************************************************************/ #include "rstlvidset.h" -#if 0 -#include "rstlvbase.h" -#include "rsbaseserial.h" -#include "util/rsprint.h" -#include -#include -#include -#include -#endif - #define TLV_DEBUG 1 /************************************* Service Id Set ************************************/ diff --git a/libretroshare/src/serialiser/rstlvidset.h b/libretroshare/src/serialiser/rstlvidset.h index b1d0ee51f..26c5c7ce7 100644 --- a/libretroshare/src/serialiser/rstlvidset.h +++ b/libretroshare/src/serialiser/rstlvidset.h @@ -1,30 +1,26 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvidset.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie,Chris 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 . * + * * + *******************************************************************************/ #pragma once -/* - * libretroshare/src/serialiser: rstlvidset.h - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - /******************************************************************* * These are the Compound TLV structures that must be (un)packed. * diff --git a/libretroshare/src/serialiser/rstlvimage.cc b/libretroshare/src/serialiser/rstlvimage.cc index 4083f9e54..ce8ea5d6c 100644 --- a/libretroshare/src/serialiser/rstlvimage.cc +++ b/libretroshare/src/serialiser/rstlvimage.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rstlvimage.cc - * - * RetroShare Serialiser. - * - * 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/serialiser: rstlvimage.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie,Chris 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 . * + * * + *******************************************************************************/ #include "serialiser/rstlvimage.h" #if 0 diff --git a/libretroshare/src/serialiser/rstlvimage.h b/libretroshare/src/serialiser/rstlvimage.h index 51c18288c..b5602096f 100644 --- a/libretroshare/src/serialiser/rstlvimage.h +++ b/libretroshare/src/serialiser/rstlvimage.h @@ -1,30 +1,26 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvimage.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie,Chris 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 . * + * * + *******************************************************************************/ #pragma once -/* - * libretroshare/src/serialiser: rstlvimage.h - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - /******************************************************************* * These are the Compound TLV structures that must be (un)packed. * diff --git a/libretroshare/src/serialiser/rstlvitem.cc b/libretroshare/src/serialiser/rstlvitem.cc index 02a1f8c63..16ca002db 100644 --- a/libretroshare/src/serialiser/rstlvitem.cc +++ b/libretroshare/src/serialiser/rstlvitem.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rstlvtypes.cc - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - +/******************************************************************************* + * libretroshare/src/serialiser: rstlvitem.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie,Chris 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 . * + * * + *******************************************************************************/ #include "rstlvitem.h" #include "rstlvbase.h" #include diff --git a/libretroshare/src/serialiser/rstlvitem.h b/libretroshare/src/serialiser/rstlvitem.h index 0cd0d42d7..1623a8224 100644 --- a/libretroshare/src/serialiser/rstlvitem.h +++ b/libretroshare/src/serialiser/rstlvitem.h @@ -1,28 +1,25 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvitem.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie,Chris 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 . * + * * + *******************************************************************************/ #pragma once -/* - * libretroshare/src/serialiser: rstlvitem.h - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ /******************************************************************* * These are the Compound TLV structures that must be (un)packed. diff --git a/libretroshare/src/serialiser/rstlvkeys.cc b/libretroshare/src/serialiser/rstlvkeys.cc index 538862320..b13250479 100644 --- a/libretroshare/src/serialiser/rstlvkeys.cc +++ b/libretroshare/src/serialiser/rstlvkeys.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rstlvtypes.cc - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - +/******************************************************************************* + * libretroshare/src/serialiser: rstlvkeys.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "rstlvkeys.h" #include "rstlvbase.h" #include "rsbaseserial.h" diff --git a/libretroshare/src/serialiser/rstlvkeys.h b/libretroshare/src/serialiser/rstlvkeys.h index 632a7fb09..5f82e51f0 100644 --- a/libretroshare/src/serialiser/rstlvkeys.h +++ b/libretroshare/src/serialiser/rstlvkeys.h @@ -1,30 +1,26 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvkeys.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once -/* - * libretroshare/src/serialiser: rstlvkeys.h - * - * RetroShare Serialiser. - * - * Copyright 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". - * - */ - /******************************************************************* * These are the Compound TLV structures that must be (un)packed. ******************************************************************/ diff --git a/libretroshare/src/serialiser/rstlvkeyvalue.cc b/libretroshare/src/serialiser/rstlvkeyvalue.cc index 6bef23277..2e1a9dd16 100644 --- a/libretroshare/src/serialiser/rstlvkeyvalue.cc +++ b/libretroshare/src/serialiser/rstlvkeyvalue.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rstlvtypes.cc - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - +/******************************************************************************* + * libretroshare/src/serialiser: rstlvkeyvalue.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie,Chris 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 . * + * * + *******************************************************************************/ #include "rstlvkeyvalue.h" #include "rstlvbase.h" diff --git a/libretroshare/src/serialiser/rstlvkeyvalue.h b/libretroshare/src/serialiser/rstlvkeyvalue.h index 2e288a15b..63cf3091f 100644 --- a/libretroshare/src/serialiser/rstlvkeyvalue.h +++ b/libretroshare/src/serialiser/rstlvkeyvalue.h @@ -1,30 +1,26 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvkeyvalue.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie,Chris 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 . * + * * + *******************************************************************************/ #pragma once -/* - * libretroshare/src/serialiser: rstlvkeyvalue.h - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - /******************************************************************* * These are the Compound TLV structures that must be (un)packed. * diff --git a/libretroshare/src/serialiser/rstlvlist.h b/libretroshare/src/serialiser/rstlvlist.h index decd2bc6b..099868179 100644 --- a/libretroshare/src/serialiser/rstlvlist.h +++ b/libretroshare/src/serialiser/rstlvlist.h @@ -1,30 +1,26 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvlist.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once -/* - * libretroshare/src/serialiser: rstlvlist.h - * - * RetroShare Serialiser. - * - * Copyright 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 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 "serialiser/rstlvbase.h" #include "serialiser/rstlvitem.h" diff --git a/libretroshare/src/serialiser/rstlvmaps.h b/libretroshare/src/serialiser/rstlvmaps.h index 06a3fd6d5..49b05e382 100644 --- a/libretroshare/src/serialiser/rstlvmaps.h +++ b/libretroshare/src/serialiser/rstlvmaps.h @@ -1,37 +1,27 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvmaps.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_TLV_MAPS_H #define RS_TLV_MAPS_H -/* - * libretroshare/src/serialiser: rstlvmaps.h - * - * RetroShare Serialiser. - * - * Copyright 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". - * - */ - -#if 0 -#include "serialiser/rstlvgenericmaps.h" - -#endif - - class RsTlvOpinionMapRef: public RsTlvGenericMapRef { public: diff --git a/libretroshare/src/serialiser/rstlvstring.cc b/libretroshare/src/serialiser/rstlvstring.cc index 43344c118..8f800b73c 100644 --- a/libretroshare/src/serialiser/rstlvstring.cc +++ b/libretroshare/src/serialiser/rstlvstring.cc @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/serialiser: rstlvstring.cc - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - +/******************************************************************************* + * libretroshare/src/serialiser: rstlvstring.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie,Chris 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 . * + * * + *******************************************************************************/ #include "serialiser/rstlvstring.h" #include "serialiser/rstlvbase.h" diff --git a/libretroshare/src/serialiser/rstlvstring.h b/libretroshare/src/serialiser/rstlvstring.h index 9c22ee939..5e0c2f276 100644 --- a/libretroshare/src/serialiser/rstlvstring.h +++ b/libretroshare/src/serialiser/rstlvstring.h @@ -1,30 +1,26 @@ +/******************************************************************************* + * libretroshare/src/serialiser: rstlvstring.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2008 by Robert Fernie,Chris 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 . * + * * + *******************************************************************************/ #pragma once -/* - * libretroshare/src/serialiser: rstlvstring.h - * - * RetroShare Serialiser. - * - * Copyright 2007-2008 by Robert Fernie, Chris 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". - * - */ - /******************************************************************* * These are the Compound TLV structures that must be (un)packed. * diff --git a/libretroshare/src/serialiser/rstypeserializer.cc b/libretroshare/src/serialiser/rstypeserializer.cc index e7faa5b52..5c91c9da2 100644 --- a/libretroshare/src/serialiser/rstypeserializer.cc +++ b/libretroshare/src/serialiser/rstypeserializer.cc @@ -1,28 +1,25 @@ -/* - * libretroshare/src/serialiser: rstypeserializer.cc - * - * RetroShare Serialiser. - * - * Copyright (C) 2017 Cyril Soler - * Copyright (C) 2018 Gioacchino Mazzurco - * - * 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 "csoler@users.sourceforge.net". - * - */ +/******************************************************************************* + * libretroshare/src/serialiser: rstypeserializer.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2017 Cyril Soler * + * Copyright (C) 2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #include "serialiser/rsserializer.h" #include "serialiser/rstypeserializer.h" #include "serialiser/rsbaseserial.h" diff --git a/libretroshare/src/serialiser/rstypeserializer.h b/libretroshare/src/serialiser/rstypeserializer.h index 3e3c0b251..5c20f3f9f 100644 --- a/libretroshare/src/serialiser/rstypeserializer.h +++ b/libretroshare/src/serialiser/rstypeserializer.h @@ -1,28 +1,25 @@ -/* - * libretroshare/src/serialiser: rstypeserializer.h - * - * RetroShare Serialiser. - * - * Copyright (C) 2017 Cyril Soler - * Copyright (C) 2018 Gioacchino Mazzurco - * - * 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 "csoler@users.sourceforge.net". - * - */ +/******************************************************************************* + * libretroshare/src/serialiser: rstypeserializer.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2017 Cyril Soler * + * Copyright (C) 2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include "serialiser/rsserial.h" From b3853156cea6cf302b2dd928fcf976908507885d Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 29 May 2018 21:54:27 +0200 Subject: [PATCH 063/138] re-licensed services/ --- libretroshare/src/libretroshare.pro | 2 +- .../src/services/autoproxy/p3i2pbob.cc | 21 ++++++++ .../src/services/autoproxy/p3i2pbob.h | 21 ++++++++ .../services/autoproxy/rsautoproxymonitor.cc | 21 ++++++++ .../services/autoproxy/rsautoproxymonitor.h | 21 ++++++++ libretroshare/src/services/p3banlist.cc | 46 ++++++++---------- libretroshare/src/services/p3banlist.h | 47 ++++++++---------- libretroshare/src/services/p3bwctrl.cc | 46 ++++++++---------- libretroshare/src/services/p3bwctrl.h | 47 ++++++++---------- libretroshare/src/services/p3discovery2.cc | 48 +++++++++---------- libretroshare/src/services/p3discovery2.h | 46 ++++++++---------- libretroshare/src/services/p3gxschannels.cc | 46 ++++++++---------- libretroshare/src/services/p3gxschannels.h | 46 ++++++++---------- libretroshare/src/services/p3gxscircles.cc | 46 ++++++++---------- libretroshare/src/services/p3gxscircles.h | 46 ++++++++---------- libretroshare/src/services/p3gxscommon.cc | 46 ++++++++---------- libretroshare/src/services/p3gxscommon.h | 45 ++++++++--------- libretroshare/src/services/p3gxsforums.cc | 46 ++++++++---------- libretroshare/src/services/p3gxsforums.h | 46 ++++++++---------- libretroshare/src/services/p3gxsreputation.cc | 46 ++++++++---------- libretroshare/src/services/p3gxsreputation.h | 47 ++++++++---------- libretroshare/src/services/p3heartbeat.cc | 46 ++++++++---------- libretroshare/src/services/p3heartbeat.h | 46 ++++++++---------- libretroshare/src/services/p3idservice.cc | 48 +++++++++---------- libretroshare/src/services/p3idservice.h | 46 ++++++++---------- libretroshare/src/services/p3msgservice.cc | 47 ++++++++---------- libretroshare/src/services/p3msgservice.h | 47 ++++++++---------- libretroshare/src/services/p3photoservice.cc | 21 ++++++++ libretroshare/src/services/p3photoservice.h | 46 ++++++++---------- libretroshare/src/services/p3postbase.cc | 46 ++++++++---------- libretroshare/src/services/p3postbase.h | 46 ++++++++---------- libretroshare/src/services/p3posted.cc | 46 ++++++++---------- libretroshare/src/services/p3posted.h | 45 ++++++++--------- libretroshare/src/services/p3rtt.cc | 46 ++++++++---------- libretroshare/src/services/p3rtt.h | 47 ++++++++---------- libretroshare/src/services/p3service.cc | 46 ++++++++---------- libretroshare/src/services/p3service.h | 46 ++++++++---------- libretroshare/src/services/p3serviceinfo.cc | 46 ++++++++---------- libretroshare/src/services/p3serviceinfo.h | 47 ++++++++---------- libretroshare/src/services/p3statusservice.cc | 46 ++++++++---------- libretroshare/src/services/p3statusservice.h | 46 ++++++++---------- libretroshare/src/services/p3wiki.cc | 46 ++++++++---------- libretroshare/src/services/p3wiki.h | 46 ++++++++---------- libretroshare/src/services/p3wire.cc | 46 ++++++++---------- libretroshare/src/services/p3wire.h | 46 ++++++++---------- 45 files changed, 927 insertions(+), 983 deletions(-) diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index f2ef3e4fc..396a87eef 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -510,7 +510,7 @@ HEADERS += services/autoproxy/p3i2pbob.h \ services/p3discovery2.h \ services/p3heartbeat.h \ services/p3rtt.h \ - services/p3serviceinfo.cc \ + services/p3serviceinfo.h \ HEADERS += turtle/p3turtle.h \ turtle/rsturtleitem.h \ diff --git a/libretroshare/src/services/autoproxy/p3i2pbob.cc b/libretroshare/src/services/autoproxy/p3i2pbob.cc index 36e5604c7..390477127 100644 --- a/libretroshare/src/services/autoproxy/p3i2pbob.cc +++ b/libretroshare/src/services/autoproxy/p3i2pbob.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/services/autoproxy: p3i2pbob.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Sehraf * + * * + * 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 . * + * * + *******************************************************************************/ #include #include /* for usleep() */ diff --git a/libretroshare/src/services/autoproxy/p3i2pbob.h b/libretroshare/src/services/autoproxy/p3i2pbob.h index 5fd44bc85..27b911262 100644 --- a/libretroshare/src/services/autoproxy/p3i2pbob.h +++ b/libretroshare/src/services/autoproxy/p3i2pbob.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/services/autoproxy: p3i2pbob.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Sehraf * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef P3I2PBOB_H #define P3I2PBOB_H diff --git a/libretroshare/src/services/autoproxy/rsautoproxymonitor.cc b/libretroshare/src/services/autoproxy/rsautoproxymonitor.cc index d4d3f87ce..aef160590 100644 --- a/libretroshare/src/services/autoproxy/rsautoproxymonitor.cc +++ b/libretroshare/src/services/autoproxy/rsautoproxymonitor.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/services/autoproxy: rsautoproximonitor.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Sehraf * + * * + * 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 . * + * * + *******************************************************************************/ #include "rsautoproxymonitor.h" #include /* for usleep() */ diff --git a/libretroshare/src/services/autoproxy/rsautoproxymonitor.h b/libretroshare/src/services/autoproxy/rsautoproxymonitor.h index 21ea95c3b..d9a4c16aa 100644 --- a/libretroshare/src/services/autoproxy/rsautoproxymonitor.h +++ b/libretroshare/src/services/autoproxy/rsautoproxymonitor.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/services/autoproxy: rsautoproximonitor.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2016 by Sehraf * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RSAUTOPROXYMONITOR_H #define RSAUTOPROXYMONITOR_H diff --git a/libretroshare/src/services/p3banlist.cc b/libretroshare/src/services/p3banlist.cc index b1fc07113..cda290268 100644 --- a/libretroshare/src/services/p3banlist.cc +++ b/libretroshare/src/services/p3banlist.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3banlist.cc - * - * Ban List Service for RetroShare. - * - * 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/services: p3banlist.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/p3servicecontrol.h" #include "pqi/p3netmgr.h" #include "pqi/p3cfgmgr.h" diff --git a/libretroshare/src/services/p3banlist.h b/libretroshare/src/services/p3banlist.h index 34d4bc50c..ac22996a9 100644 --- a/libretroshare/src/services/p3banlist.h +++ b/libretroshare/src/services/p3banlist.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/services/p3banlist.h - * - * Exchange list of Peers for Banning / Whitelisting. - * - * Copyright 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/services: p3banlist.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef SERVICE_RSBANLIST_HEADER #define SERVICE_RSBANLIST_HEADER diff --git a/libretroshare/src/services/p3bwctrl.cc b/libretroshare/src/services/p3bwctrl.cc index aa9106e47..7597c7fc9 100644 --- a/libretroshare/src/services/p3bwctrl.cc +++ b/libretroshare/src/services/p3bwctrl.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3bwctrl.cc - * - * Bandwidth Control Service for RetroShare. - * - * 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.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/services: p3bwctrl.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/p3linkmgr.h" #include "pqi/p3netmgr.h" #include "pqi/pqipersongrp.h" diff --git a/libretroshare/src/services/p3bwctrl.h b/libretroshare/src/services/p3bwctrl.h index 67e6f97fd..9b53f2d0d 100644 --- a/libretroshare/src/services/p3bwctrl.h +++ b/libretroshare/src/services/p3bwctrl.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/services/p3bwctrl.h - * - * Bandwidth Control. - * - * Copyright 2012 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/services: p3bwctrl.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef SERVICE_RSBANDWIDTH_CONTROL_HEADER #define SERVICE_RSBANDWIDTH_CONTROL_HEADER diff --git a/libretroshare/src/services/p3discovery2.cc b/libretroshare/src/services/p3discovery2.cc index 3eacf2548..cf4bc28dd 100644 --- a/libretroshare/src/services/p3discovery2.cc +++ b/libretroshare/src/services/p3discovery2.cc @@ -1,29 +1,25 @@ -/* - * libretroshare/src/services: p3discovery2.cc - * - * Services for RetroShare. - * - * Copyright (C) 2004-2013 Robert Fernie. - * Copyright (C) 2018 Gioacchino Mazzurco - * - * 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/services: p3discovery2.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2013 Robert Fernie * + * Copyright (C) 2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #include "services/p3discovery2.h" #include "pqi/p3peermgr.h" #include "util/rsversioninfo.h" diff --git a/libretroshare/src/services/p3discovery2.h b/libretroshare/src/services/p3discovery2.h index 79ac13135..a4b127553 100644 --- a/libretroshare/src/services/p3discovery2.h +++ b/libretroshare/src/services/p3discovery2.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: p3discovery2.h - * - * Services for RetroShare. - * - * Copyright 2004-2013 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/services: p3discovery2.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2013 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_SERVICES_DISCOVERY2_H #define MRK_SERVICES_DISCOVERY2_H diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index e70769c7a..564088cee 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3gxschannels.cc - * - * GxsChannels interface for RetroShare. - * - * Copyright 2012-2012 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/services: p3gxschannels.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "services/p3gxschannels.h" #include "rsitems/rsgxschannelitems.h" #include "util/radix64.h" diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index 0e6156f48..16833ba75 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: p3gxschannels.h - * - * GxsChannel interface for RetroShare. - * - * Copyright 2012-2012 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/services: p3gxschannels.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef P3_GXSCHANNELS_SERVICE_HEADER #define P3_GXSCHANNELS_SERVICE_HEADER diff --git a/libretroshare/src/services/p3gxscircles.cc b/libretroshare/src/services/p3gxscircles.cc index 5e27e378d..a6e8d1501 100644 --- a/libretroshare/src/services/p3gxscircles.cc +++ b/libretroshare/src/services/p3gxscircles.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3gxscircles.cc - * - * Circles Interface for RetroShare. - * - * Copyright 2012-2012 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/services: p3gxscircles.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "rsitems/rsgxscircleitems.h" #include "services/p3gxscircles.h" diff --git a/libretroshare/src/services/p3gxscircles.h b/libretroshare/src/services/p3gxscircles.h index 4e011eea0..a5a56efc0 100644 --- a/libretroshare/src/services/p3gxscircles.h +++ b/libretroshare/src/services/p3gxscircles.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: p3circles.h - * - * Identity interface for RetroShare. - * - * Copyright 2012-2012 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/services: p3gxscircles.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef P3_CIRCLES_SERVICE_HEADER #define P3_CIRCLES_SERVICE_HEADER diff --git a/libretroshare/src/services/p3gxscommon.cc b/libretroshare/src/services/p3gxscommon.cc index 5793e58ff..be38085e6 100644 --- a/libretroshare/src/services/p3gxscommon.cc +++ b/libretroshare/src/services/p3gxscommon.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3gxscommon.cc - * - * GxsChannels interface for RetroShare. - * - * Copyright 2012-2013 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/services: p3gxscommon.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2013 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "retroshare/rsgxscommon.h" #include "services/p3gxscommon.h" #include "rsitems/rsgxscommentitems.h" diff --git a/libretroshare/src/services/p3gxscommon.h b/libretroshare/src/services/p3gxscommon.h index af7e0983c..469fa3426 100644 --- a/libretroshare/src/services/p3gxscommon.h +++ b/libretroshare/src/services/p3gxscommon.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/services p3gxscommon.cc - * - * GxsChannels interface for RetroShare. - * - * Copyright 2012-2013 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/services: p3gxscommon.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2013 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef P3_GXSCOMMON_SERVICE_HEADER #define P3_GXSCOMMON_SERVICE_HEADER diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index 7f1e8dfcf..3cb4f1d0a 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3gxsforums.cc - * - * GxsForums interface for RetroShare. - * - * Copyright 2012-2012 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/services: p3gxsforums.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "services/p3gxsforums.h" #include "rsitems/rsgxsforumitems.h" diff --git a/libretroshare/src/services/p3gxsforums.h b/libretroshare/src/services/p3gxsforums.h index a4e0ebf47..c6341c333 100644 --- a/libretroshare/src/services/p3gxsforums.h +++ b/libretroshare/src/services/p3gxsforums.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: p3gxsforums.h - * - * GxsForum interface for RetroShare. - * - * Copyright 2012-2012 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/services: p3gxsforums.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef P3_GXSFORUMS_SERVICE_HEADER #define P3_GXSFORUMS_SERVICE_HEADER diff --git a/libretroshare/src/services/p3gxsreputation.cc b/libretroshare/src/services/p3gxsreputation.cc index 118d404e5..01e022c8e 100644 --- a/libretroshare/src/services/p3gxsreputation.cc +++ b/libretroshare/src/services/p3gxsreputation.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3gxsreputation.cc - * - * Gxs Reputation Service for RetroShare. - * - * Copyright 2011-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/services: p3gxsreputation.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014-2014 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "pqi/p3linkmgr.h" diff --git a/libretroshare/src/services/p3gxsreputation.h b/libretroshare/src/services/p3gxsreputation.h index ad45e2298..75d5d628c 100644 --- a/libretroshare/src/services/p3gxsreputation.h +++ b/libretroshare/src/services/p3gxsreputation.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/services/p3gxsreputation.h - * - * Exchange list of Peers Reputations. - * - * Copyright 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/services: p3gxsreputation.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014-2014 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef SERVICE_RSGXSREPUTATION_HEADER #define SERVICE_RSGXSREPUTATION_HEADER diff --git a/libretroshare/src/services/p3heartbeat.cc b/libretroshare/src/services/p3heartbeat.cc index 498a88cfa..e74787812 100644 --- a/libretroshare/src/services/p3heartbeat.cc +++ b/libretroshare/src/services/p3heartbeat.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: p3heartbeat.cc - * - * Services for RetroShare. - * - * Copyright 2004-2013 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/services: p3heartbeat.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2013 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "services/p3heartbeat.h" diff --git a/libretroshare/src/services/p3heartbeat.h b/libretroshare/src/services/p3heartbeat.h index da7c8b1df..21dd9b6b7 100644 --- a/libretroshare/src/services/p3heartbeat.h +++ b/libretroshare/src/services/p3heartbeat.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: p3heartbeat.h - * - * Services for RetroShare. - * - * Copyright 2004-2013 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/services: p3heartbeat.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2013 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_SERVICES_HEARTBEAT_H #define MRK_SERVICES_HEARTBEAT_H diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index 5ea8f898e..084edadb2 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -1,29 +1,25 @@ -/* - * libretroshare/src/services p3idservice.cc - * - * Id interface for RetroShare. - * - * Copyright (C) 2012 Robert Fernie - * Copyright (C) 2018 Gioacchino Mazzurco - * - * 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/services: p3idservice.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 Robert Fernie * + * Copyright (C) 2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "services/p3idservice.h" diff --git a/libretroshare/src/services/p3idservice.h b/libretroshare/src/services/p3idservice.h index f97192e72..6a5ec640f 100644 --- a/libretroshare/src/services/p3idservice.h +++ b/libretroshare/src/services/p3idservice.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: p3idservice.h - * - * Identity interface for RetroShare. - * - * Copyright 2012-2012 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/services: p3idservice.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef P3_IDENTITY_SERVICE_HEADER #define P3_IDENTITY_SERVICE_HEADER diff --git a/libretroshare/src/services/p3msgservice.cc b/libretroshare/src/services/p3msgservice.cc index e56d2fb5a..54fdc710e 100644 --- a/libretroshare/src/services/p3msgservice.cc +++ b/libretroshare/src/services/p3msgservice.cc @@ -1,29 +1,24 @@ -/* - * libretroshare/src/services msgservice.cc - * - * 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". - * - */ - - +/******************************************************************************* + * libretroshare/src/services: p3msgservice.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "retroshare/rsiface.h" #include "retroshare/rspeers.h" #include "retroshare/rsidentity.h" diff --git a/libretroshare/src/services/p3msgservice.h b/libretroshare/src/services/p3msgservice.h index 7027e470b..32f087ad0 100644 --- a/libretroshare/src/services/p3msgservice.h +++ b/libretroshare/src/services/p3msgservice.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/services msgservice.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". - * - */ - - +/******************************************************************************* + * libretroshare/src/services: p3msgservice.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MESSAGE_SERVICE_HEADER #define MESSAGE_SERVICE_HEADER diff --git a/libretroshare/src/services/p3photoservice.cc b/libretroshare/src/services/p3photoservice.cc index 519f10c68..fa42224d7 100644 --- a/libretroshare/src/services/p3photoservice.cc +++ b/libretroshare/src/services/p3photoservice.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/services: p3photoservice.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2012 Robert Fernie,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 . * + * * + *******************************************************************************/ #include "p3photoservice.h" #include "rsitems/rsphotoitems.h" #include "retroshare/rsgxsflags.h" diff --git a/libretroshare/src/services/p3photoservice.h b/libretroshare/src/services/p3photoservice.h index 236687301..3d26ea739 100644 --- a/libretroshare/src/services/p3photoservice.h +++ b/libretroshare/src/services/p3photoservice.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/services: p3photoservice.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2012 Robert Fernie,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 . * + * * + *******************************************************************************/ #ifndef P3PHOTOSERVICEV2_H #define P3PHOTOSERVICEV2_H -/* - * libretroshare/src/retroshare: rsphoto.h - * - * RetroShare C++ Interface. - * - * Copyright 2008-2012 by Robert Fernie, Christopher 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 "gxs/rsgenexchange.h" #include "retroshare/rsphoto.h" diff --git a/libretroshare/src/services/p3postbase.cc b/libretroshare/src/services/p3postbase.cc index 0c37db1f1..a294737c5 100644 --- a/libretroshare/src/services/p3postbase.cc +++ b/libretroshare/src/services/p3postbase.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3posted.cc - * - * Posted interface for RetroShare. - * - * Copyright 2012-2012 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/services: p3postbase.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2012 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "retroshare/rsgxsflags.h" diff --git a/libretroshare/src/services/p3postbase.h b/libretroshare/src/services/p3postbase.h index b5ce1d895..1e63b0dcd 100644 --- a/libretroshare/src/services/p3postbase.h +++ b/libretroshare/src/services/p3postbase.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: p3postbase.h - * - * GxsChannel interface for RetroShare. - * - * Copyright 2012-2013 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/services: p3postbase.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2012 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef P3_POSTBASE_SERVICE_HEADER #define P3_POSTBASE_SERVICE_HEADER diff --git a/libretroshare/src/services/p3posted.cc b/libretroshare/src/services/p3posted.cc index 555f2147f..c83a6f241 100644 --- a/libretroshare/src/services/p3posted.cc +++ b/libretroshare/src/services/p3posted.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3posted.cc - * - * Posted interface for RetroShare. - * - * Copyright 2012-2012 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/services: p3posted.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2013 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "services/p3posted.h" #include "rsitems/rsposteditems.h" diff --git a/libretroshare/src/services/p3posted.h b/libretroshare/src/services/p3posted.h index aa4bbc8ee..4a032b49b 100644 --- a/libretroshare/src/services/p3posted.h +++ b/libretroshare/src/services/p3posted.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/services: p3posted.h - * - * GxsChannel interface for RetroShare. - * - * Copyright 2012-2013 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/services: p3posted.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2013 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef P3_POSTED_SERVICE_HEADER #define P3_POSTED_SERVICE_HEADER diff --git a/libretroshare/src/services/p3rtt.cc b/libretroshare/src/services/p3rtt.cc index 2fc991227..d7fee261d 100644 --- a/libretroshare/src/services/p3rtt.cc +++ b/libretroshare/src/services/p3rtt.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3rtt.cc - * - * Round Trip Time Measurement for RetroShare. - * - * Copyright 2011-2013 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/services: p3rtt.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2013 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "util/rsdir.h" diff --git a/libretroshare/src/services/p3rtt.h b/libretroshare/src/services/p3rtt.h index 067feca0c..3bc99eacc 100644 --- a/libretroshare/src/services/p3rtt.h +++ b/libretroshare/src/services/p3rtt.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/services/p3rtt.h - * - * Round Trip Time Measurement for RetroShare. - * - * Copyright 2011-2013 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/services: p3rtt.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2013 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef SERVICE_RSRTT_HEADER #define SERVICE_RSRTT_HEADER diff --git a/libretroshare/src/services/p3service.cc b/libretroshare/src/services/p3service.cc index bb15831d7..a2b7755c8 100644 --- a/libretroshare/src/services/p3service.cc +++ b/libretroshare/src/services/p3service.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3service.cc - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2004-2013 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/services: p3service.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2013 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "rsitems/itempriorities.h" #include "pqi/pqi.h" diff --git a/libretroshare/src/services/p3service.h b/libretroshare/src/services/p3service.h index daba663c7..4eb66c470 100644 --- a/libretroshare/src/services/p3service.h +++ b/libretroshare/src/services/p3service.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3service.h - * - * 3P/PQI network interface 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". - * - */ - +/******************************************************************************* + * libretroshare/src/services: p3service.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef P3_GENERIC_SERVICE_HEADER #define P3_GENERIC_SERVICE_HEADER diff --git a/libretroshare/src/services/p3serviceinfo.cc b/libretroshare/src/services/p3serviceinfo.cc index 0782016a1..f05604021 100644 --- a/libretroshare/src/services/p3serviceinfo.cc +++ b/libretroshare/src/services/p3serviceinfo.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3serviceinfo.cc - * - * ServiceInfo Service for RetroShare. - * - * Copyright 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/services: p3serviceinfo.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/p3linkmgr.h" #include "pqi/p3netmgr.h" diff --git a/libretroshare/src/services/p3serviceinfo.h b/libretroshare/src/services/p3serviceinfo.h index 210731af1..2d8f8a8af 100644 --- a/libretroshare/src/services/p3serviceinfo.h +++ b/libretroshare/src/services/p3serviceinfo.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/services/p3serviceinfo.h - * - * Exchange list of Service Information. - * - * Copyright 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/services: p3serviceinfo.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2014 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef SERVICE_RSSERVICEINFO_HEADER #define SERVICE_RSSERVICEINFO_HEADER diff --git a/libretroshare/src/services/p3statusservice.cc b/libretroshare/src/services/p3statusservice.cc index 54184f4db..7ff736d7b 100644 --- a/libretroshare/src/services/p3statusservice.cc +++ b/libretroshare/src/services/p3statusservice.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: p3statusservice.cc - * - * RetroShare C++ . - * - * Copyright 2008 by Vinny Do, 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". - * - */ - +/******************************************************************************* + * libretroshare/src/services: p3statusservice.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Vinny Do, 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 . * + * * + *******************************************************************************/ #include "services/p3statusservice.h" #include "rsitems/rsstatusitems.h" #include "rsserver/p3face.h" diff --git a/libretroshare/src/services/p3statusservice.h b/libretroshare/src/services/p3statusservice.h index c4f730b0d..ac0b70653 100644 --- a/libretroshare/src/services/p3statusservice.h +++ b/libretroshare/src/services/p3statusservice.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/services: p3statusservice.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008 by Vinny Do, 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 . * + * * + *******************************************************************************/ #ifndef RS_P3_STATUS_INTERFACE_H #define RS_P3_STATUS_INTERFACE_H -/* - * libretroshare/src/services: p3statusService.h - * - * RetroShare C++ - * - * Copyright 2008 by Vinny Do, 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 #include diff --git a/libretroshare/src/services/p3wiki.cc b/libretroshare/src/services/p3wiki.cc index a707596c1..0d7a2a450 100644 --- a/libretroshare/src/services/p3wiki.cc +++ b/libretroshare/src/services/p3wiki.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3wiki.cc - * - * Wiki interface for RetroShare. - * - * Copyright 2012-2012 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/services: p3wiki.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "services/p3wiki.h" #include "retroshare/rsgxsflags.h" #include "rsitems/rswikiitems.h" diff --git a/libretroshare/src/services/p3wiki.h b/libretroshare/src/services/p3wiki.h index bd53fd6b7..f6f446920 100644 --- a/libretroshare/src/services/p3wiki.h +++ b/libretroshare/src/services/p3wiki.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: p3wikiservice.h - * - * Wiki interface for RetroShare. - * - * Copyright 2012-2012 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/services: p3wiki.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef P3_WIKI_SERVICE_HEADER #define P3_WIKI_SERVICE_HEADER diff --git a/libretroshare/src/services/p3wire.cc b/libretroshare/src/services/p3wire.cc index 7edce4a4d..23d31198f 100644 --- a/libretroshare/src/services/p3wire.cc +++ b/libretroshare/src/services/p3wire.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services p3wire.cc - * - * Wire interface for RetroShare. - * - * Copyright 2012-2012 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/services: p3wire.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "services/p3wire.h" #include "rsitems/rswireitems.h" diff --git a/libretroshare/src/services/p3wire.h b/libretroshare/src/services/p3wire.h index 24c0f26e7..3858d158e 100644 --- a/libretroshare/src/services/p3wire.h +++ b/libretroshare/src/services/p3wire.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services: p3wire.h - * - * Wiki interface for RetroShare. - * - * Copyright 2012-2012 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/services: p3wire.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef P3_WIRE_SERVICE_HEADER #define P3_WIRE_SERVICE_HEADER From 6cf2090149487a1f29607029bc8df10db254a618 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 30 May 2018 21:19:13 +0200 Subject: [PATCH 064/138] relicensed tcponudp, turtle, unused, upnp, and part of util/ --- build_scripts/Debian/debian_release_howto.txt | 4 +- libretroshare/src/libretroshare.pro | 3 - libretroshare/src/tcponudp/bio_tou.h | 45 +++++++------- libretroshare/src/tcponudp/tcppacket.cc | 49 +++++++-------- libretroshare/src/tcponudp/tcppacket.h | 48 +++++++------- libretroshare/src/tcponudp/tcpstream.cc | 47 +++++++------- libretroshare/src/tcponudp/tcpstream.h | 48 +++++++------- libretroshare/src/tcponudp/tou.cc | 49 +++++++-------- libretroshare/src/tcponudp/tou.h | 48 +++++++------- libretroshare/src/tcponudp/udppeer.cc | 46 +++++++------- libretroshare/src/tcponudp/udppeer.h | 46 +++++++------- libretroshare/src/tcponudp/udprelay.cc | 46 +++++++------- libretroshare/src/tcponudp/udprelay.h | 46 +++++++------- libretroshare/src/tcponudp/udpstunner.cc | 46 +++++++------- libretroshare/src/tcponudp/udpstunner.h | 45 +++++++------- libretroshare/src/turtle/p3turtle.cc | 45 +++++++------- libretroshare/src/turtle/p3turtle.h | 45 +++++++------- libretroshare/src/turtle/rsturtleitem.cc | 21 +++++++ libretroshare/src/turtle/rsturtleitem.h | 21 +++++++ .../src/turtle/turtleclientservice.h | 45 +++++++------- libretroshare/src/turtle/turtletypes.h | 21 +++++++ libretroshare/src/unused/p3dsdv.cc | 46 +++++++------- libretroshare/src/unused/p3dsdv.h | 47 +++++++------- .../src/{util => unused}/rscompress.cc | 46 +++++++------- libretroshare/src/unused/rscompress.h | 30 +++++++++ libretroshare/src/unused/rsdsdv.h | 46 +++++++------- libretroshare/src/unused/rsdsdvitems.cc | 45 +++++++------- libretroshare/src/unused/rsdsdvitems.h | 46 +++++++------- libretroshare/src/upnp/upnphandler_linux.cc | 24 ++++++- libretroshare/src/upnp/upnphandler_linux.h | 21 +++++++ .../src/upnp/upnphandler_miniupnp.cc | 21 +++++++ libretroshare/src/upnp/upnphandler_miniupnp.h | 21 +++++++ libretroshare/src/upnp/upnputil.c | 19 ++++++ libretroshare/src/upnp/upnputil.h | 26 +++++--- libretroshare/src/util/androiddebug.h | 38 +++++++----- libretroshare/src/util/contentvalue.cc | 45 +++++++------- libretroshare/src/util/contentvalue.h | 44 +++++++------ libretroshare/src/util/cxx11retrocompat.h | 38 +++++++----- libretroshare/src/util/dnsresolver.cc | 21 +++++++ libretroshare/src/util/dnsresolver.h | 21 +++++++ libretroshare/src/util/extaddrfinder.cc | 21 +++++++ libretroshare/src/util/extaddrfinder.h | 21 +++++++ libretroshare/src/util/folderiterator.cc | 21 +++++++ libretroshare/src/util/folderiterator.h | 21 +++++++ libretroshare/src/util/pugiconfig.h | 62 ------------------- libretroshare/src/util/radix32.h | 21 +++++++ libretroshare/src/util/radix64.h | 21 +++++++ libretroshare/src/util/retrodb.cc | 44 +++++++------ libretroshare/src/util/retrodb.h | 44 +++++++------ libretroshare/src/util/rscompress.h | 34 ---------- libretroshare/src/util/rsdbbind.cc | 44 +++++++------ libretroshare/src/util/rsdbbind.h | 44 +++++++------ libretroshare/src/util/rsdebug.cc | 45 +++++++------- libretroshare/src/util/rsdebug.h | 47 +++++++------- libretroshare/src/util/rsdeprecate.h | 38 +++++++----- libretroshare/src/util/rsdir.cc | 46 +++++++------- libretroshare/src/util/rsdir.h | 47 +++++++------- libretroshare/src/util/rsdiscspace.cc | 46 +++++++------- libretroshare/src/util/rsdiscspace.h | 46 +++++++------- libretroshare/src/util/rsinitedptr.h | 22 +++++++ libretroshare/src/util/rsmemcache.h | 45 +++++++------- libretroshare/src/util/rsmemory.cc | 21 +++++++ libretroshare/src/util/rsmemory.h | 21 +++++++ libretroshare/src/util/rsnet.cc | 47 +++++++------- libretroshare/src/util/rsnet.h | 48 +++++++------- libretroshare/src/util/rsprint.cc | 46 +++++++------- libretroshare/src/util/rsprint.h | 48 +++++++------- 67 files changed, 1334 insertions(+), 1136 deletions(-) rename libretroshare/src/{util => unused}/rscompress.cc (72%) create mode 100644 libretroshare/src/unused/rscompress.h delete mode 100644 libretroshare/src/util/pugiconfig.h delete mode 100644 libretroshare/src/util/rscompress.h diff --git a/build_scripts/Debian/debian_release_howto.txt b/build_scripts/Debian/debian_release_howto.txt index 40415d544..8d669d311 100644 --- a/build_scripts/Debian/debian_release_howto.txt +++ b/build_scripts/Debian/debian_release_howto.txt @@ -139,5 +139,7 @@ Licensing issues: Files after switch: - libresapi/api/json.h MIT license Copyright (c) 2013 Jeff Weinstein (jeff.weinstein at gmail) + libresapi/api/json.h MIT license Copyright (c) 2013 Jeff Weinstein (jeff.weinstein at gmail) + libretroshare/src/tcponudp/bss_tou.cc SSL Licence Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + libretroshare/src/upnp/UPnPBase.{h,cpp} GPL Licence Copyright (c) 2004-2009 Marcelo Roberto Jimenez ( phoenix@amule.org ) diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index 396a87eef..d11012de6 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -520,7 +520,6 @@ HEADERS += turtle/p3turtle.h \ HEADERS += util/folderiterator.h \ util/rsdebug.h \ util/rsmemory.h \ - util/rscompress.h \ util/smallobject.h \ util/rsdir.h \ util/rsdiscspace.h \ @@ -537,7 +536,6 @@ HEADERS += util/folderiterator.h \ util/rsversioninfo.h \ util/rswin.h \ util/rsrandom.h \ - util/pugiconfig.h \ util/rsmemcache.h \ util/rstickevent.h \ util/rsrecogn.h \ @@ -672,7 +670,6 @@ SOURCES += turtle/p3turtle.cc \ SOURCES += util/folderiterator.cc \ util/rsdebug.cc \ util/rsexpr.cc \ - util/rscompress.cc \ util/smallobject.cc \ util/rsdir.cc \ util/rsmemory.cc \ diff --git a/libretroshare/src/tcponudp/bio_tou.h b/libretroshare/src/tcponudp/bio_tou.h index cf02825e1..a82444ccc 100644 --- a/libretroshare/src/tcponudp/bio_tou.h +++ b/libretroshare/src/tcponudp/bio_tou.h @@ -1,27 +1,24 @@ -/* - * "$Id: bio_tou.h,v 1.2 2007-02-18 21:46:50 rmf24 Exp $" - * - * TCP-on-UDP (tou) network interface for RetroShare. - * - * 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/tcponudp: bio_tou.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BIO_TCPONUDP_H #define BIO_TCPONUDP_H diff --git a/libretroshare/src/tcponudp/tcppacket.cc b/libretroshare/src/tcponudp/tcppacket.cc index 3351cf168..2da199288 100644 --- a/libretroshare/src/tcponudp/tcppacket.cc +++ b/libretroshare/src/tcponudp/tcppacket.cc @@ -1,31 +1,24 @@ -/* - * "$Id: tcppacket.cc,v 1.3 2007-02-18 21:46:50 rmf24 Exp $" - * - * TCP-on-UDP (tou) network interface for RetroShare. - * - * 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/tcponudp: tcppacket.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "tcppacket.h" /* diff --git a/libretroshare/src/tcponudp/tcppacket.h b/libretroshare/src/tcponudp/tcppacket.h index 3b0fe4371..e87c3e394 100644 --- a/libretroshare/src/tcponudp/tcppacket.h +++ b/libretroshare/src/tcponudp/tcppacket.h @@ -1,30 +1,24 @@ -/* - * "$Id: tcppacket.h,v 1.3 2007-02-18 21:46:50 rmf24 Exp $" - * - * TCP-on-UDP (tou) network interface for RetroShare. - * - * 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/tcponudp: tcppacket.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef TOU_TCP_PACKET_H #define TOU_TCP_PACKET_H diff --git a/libretroshare/src/tcponudp/tcpstream.cc b/libretroshare/src/tcponudp/tcpstream.cc index d789def44..5af0f505d 100644 --- a/libretroshare/src/tcponudp/tcpstream.cc +++ b/libretroshare/src/tcponudp/tcpstream.cc @@ -1,29 +1,24 @@ -/* - * "$Id: tcpstream.cc,v 1.11 2007-03-01 01:09:39 rmf24 Exp $" - * - * TCP-on-UDP (tou) network interface for RetroShare. - * - * 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/tcponudp: tcpstream.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include diff --git a/libretroshare/src/tcponudp/tcpstream.h b/libretroshare/src/tcponudp/tcpstream.h index eb79620cd..87ed693d0 100644 --- a/libretroshare/src/tcponudp/tcpstream.h +++ b/libretroshare/src/tcponudp/tcpstream.h @@ -1,30 +1,24 @@ -/* - * "$Id: tcpstream.h,v 1.5 2007-02-18 21:46:50 rmf24 Exp $" - * - * TCP-on-UDP (tou) network interface for RetroShare. - * - * 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/tcponudp: tcpstream.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef TOU_TCP_PROTO_H #define TOU_TCP_PROTO_H diff --git a/libretroshare/src/tcponudp/tou.cc b/libretroshare/src/tcponudp/tou.cc index e6fb7f480..4121c6985 100644 --- a/libretroshare/src/tcponudp/tou.cc +++ b/libretroshare/src/tcponudp/tou.cc @@ -1,31 +1,24 @@ -/* - * "$Id: tou.cc,v 1.7 2007-02-18 21:46:50 rmf24 Exp $" - * - * TCP-on-UDP (tou) network interface for RetroShare. - * - * 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/tcponudp: tou.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "tou.h" static const int kInitStreamTable = 5; diff --git a/libretroshare/src/tcponudp/tou.h b/libretroshare/src/tcponudp/tou.h index da72bb85d..0c09ce159 100644 --- a/libretroshare/src/tcponudp/tou.h +++ b/libretroshare/src/tcponudp/tou.h @@ -1,30 +1,24 @@ -/* - * "$Id: tou.h,v 1.4 2007-02-18 21:46:50 rmf24 Exp $" - * - * TCP-on-UDP (tou) network interface for RetroShare. - * - * 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/tcponudp: tou.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef TOU_C_HEADER_H #define TOU_C_HEADER_H diff --git a/libretroshare/src/tcponudp/udppeer.cc b/libretroshare/src/tcponudp/udppeer.cc index d7b904c9a..b3cf10913 100644 --- a/libretroshare/src/tcponudp/udppeer.cc +++ b/libretroshare/src/tcponudp/udppeer.cc @@ -1,28 +1,24 @@ -/* - * tcponudp/udppeer.cc - * - * libretroshare. - * - * Copyright 2010 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 3 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/tcponudp: udppeer.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2010-2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "udppeer.h" #include diff --git a/libretroshare/src/tcponudp/udppeer.h b/libretroshare/src/tcponudp/udppeer.h index f25d1cffc..9ecf23419 100644 --- a/libretroshare/src/tcponudp/udppeer.h +++ b/libretroshare/src/tcponudp/udppeer.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/tcponudp: udppeer.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2010-2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_UDP_PEER_RECV_H #define RS_UDP_PEER_RECV_H -/* - * tcponudp/udppeer.h - * - * libretroshare. - * - * Copyright 2010 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 3 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 WINDOWS_SYS #include #endif diff --git a/libretroshare/src/tcponudp/udprelay.cc b/libretroshare/src/tcponudp/udprelay.cc index 2f837feec..8793eb636 100644 --- a/libretroshare/src/tcponudp/udprelay.cc +++ b/libretroshare/src/tcponudp/udprelay.cc @@ -1,28 +1,24 @@ -/* - * tcponudp/udprelay.cc - * - * libretroshare. - * - * Copyright 2010 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 3 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/tcponudp: udprelay.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2010-2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "udprelay.h" #include #include diff --git a/libretroshare/src/tcponudp/udprelay.h b/libretroshare/src/tcponudp/udprelay.h index e04710f2f..fda6958d3 100644 --- a/libretroshare/src/tcponudp/udprelay.h +++ b/libretroshare/src/tcponudp/udprelay.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/tcponudp: udprelay.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2010-2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_UDP_RELAY_H #define RS_UDP_RELAY_H -/* - * tcponudp/udprelay.h - * - * libretroshare. - * - * Copyright 2010 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 3 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 "tcponudp/udppeer.h" #include #include diff --git a/libretroshare/src/tcponudp/udpstunner.cc b/libretroshare/src/tcponudp/udpstunner.cc index 421ad8f17..8fd1dfd46 100644 --- a/libretroshare/src/tcponudp/udpstunner.cc +++ b/libretroshare/src/tcponudp/udpstunner.cc @@ -1,28 +1,24 @@ -/* - * tcponudp/udpstunner.cc - * - * libretroshare. - * - * Copyright 2010 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 3 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/tcponudp: udpstunner.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2010-2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "tcponudp/udpstunner.h" #include #include diff --git a/libretroshare/src/tcponudp/udpstunner.h b/libretroshare/src/tcponudp/udpstunner.h index 1f55f241b..1abc48d6e 100644 --- a/libretroshare/src/tcponudp/udpstunner.h +++ b/libretroshare/src/tcponudp/udpstunner.h @@ -1,29 +1,26 @@ +/******************************************************************************* + * libretroshare/src/tcponudp: udpstunner.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2010-2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_UDP_STUN_H #define RS_UDP_STUN_H -/* - * tcponudp/udpstunner.h - * - * libretroshare. - * - * Copyright 2010 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 3 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 WINDOWS_SYS #include diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 8217db2fa..933188345 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/services: p3turtle.cc - * - * Services for RetroShare. - * - * Copyright 2009 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ +/******************************************************************************* + * libretroshare/src/turtle: p3turtle.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2009-2018 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ //#define P3TURTLE_DEBUG diff --git a/libretroshare/src/turtle/p3turtle.h b/libretroshare/src/turtle/p3turtle.h index 0c230b88b..9d648508b 100644 --- a/libretroshare/src/turtle/p3turtle.h +++ b/libretroshare/src/turtle/p3turtle.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/services: p3turtle.h - * - * Services for RetroShare. - * - * Copyright 2009 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ +/******************************************************************************* + * libretroshare/src/turtle: p3turtle.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2009-2018 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ //====================================== General setup of the router ===================================// // diff --git a/libretroshare/src/turtle/rsturtleitem.cc b/libretroshare/src/turtle/rsturtleitem.cc index cf206a153..56b07ccca 100644 --- a/libretroshare/src/turtle/rsturtleitem.cc +++ b/libretroshare/src/turtle/rsturtleitem.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/turtle: rsturtleitem.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2009-2018 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef WINDOWS_SYS #include #endif diff --git a/libretroshare/src/turtle/rsturtleitem.h b/libretroshare/src/turtle/rsturtleitem.h index 248082652..46cb87fd7 100644 --- a/libretroshare/src/turtle/rsturtleitem.h +++ b/libretroshare/src/turtle/rsturtleitem.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/turtle: rsturtleitem.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2009-2018 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include "rsitems/rsserviceids.h" diff --git a/libretroshare/src/turtle/turtleclientservice.h b/libretroshare/src/turtle/turtleclientservice.h index 51a9dbdc3..fe7db2fdd 100644 --- a/libretroshare/src/turtle/turtleclientservice.h +++ b/libretroshare/src/turtle/turtleclientservice.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/services: turtleclientservice.h - * - * Services for RetroShare. - * - * Copyright 2013 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ +/******************************************************************************* + * libretroshare/src/turtle: rsturtleclientservice.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013-2018 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ // This class is the parent class for any service that will use the turtle router to distribute its packets. // Typical representative clients include: diff --git a/libretroshare/src/turtle/turtletypes.h b/libretroshare/src/turtle/turtletypes.h index 840dda1d0..56fd78f8b 100644 --- a/libretroshare/src/turtle/turtletypes.h +++ b/libretroshare/src/turtle/turtletypes.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/turtle: rsturtletypes.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013-2018 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include "retroshare/rsturtle.h" diff --git a/libretroshare/src/unused/p3dsdv.cc b/libretroshare/src/unused/p3dsdv.cc index 6373dea8e..b6a3cf057 100644 --- a/libretroshare/src/unused/p3dsdv.cc +++ b/libretroshare/src/unused/p3dsdv.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/services/p3dsdv.h - * - * Network-Wide Routing Service. - * - * Copyright 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/unused: p3dsdv.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include #include diff --git a/libretroshare/src/unused/p3dsdv.h b/libretroshare/src/unused/p3dsdv.h index 4b95fdba3..72327fd22 100644 --- a/libretroshare/src/unused/p3dsdv.h +++ b/libretroshare/src/unused/p3dsdv.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/services/p3dsdv.h - * - * Network-Wide Routing Service. - * - * Copyright 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/unused: p3dsdv.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef SERVICE_RSDSDV_HEADER #define SERVICE_RSDSDV_HEADER diff --git a/libretroshare/src/util/rscompress.cc b/libretroshare/src/unused/rscompress.cc similarity index 72% rename from libretroshare/src/util/rscompress.cc rename to libretroshare/src/unused/rscompress.cc index 1942e4feb..e3aa0f849 100644 --- a/libretroshare/src/util/rscompress.cc +++ b/libretroshare/src/unused/rscompress.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/utils: rscompress.cc - * - * Basic memory chunk compression, based on openpgp-sdk - * - * Copyright 2013 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/util: rscompress.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013 Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #include #include #include diff --git a/libretroshare/src/unused/rscompress.h b/libretroshare/src/unused/rscompress.h new file mode 100644 index 000000000..96b9e2092 --- /dev/null +++ b/libretroshare/src/unused/rscompress.h @@ -0,0 +1,30 @@ +/******************************************************************************* + * libretroshare/src/util: rscompress.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013 Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ +#pragma once + +class RsCompress +{ + public: + static bool compress_memory_chunk(const uint8_t *input_mem,const uint32_t input_size,uint8_t *& output_mem,uint32_t& output_size) ; + static bool uncompress_memory_chunk(const uint8_t *input_mem,const uint32_t input_size,uint8_t *& output_mem,uint32_t& output_size) ; +}; + diff --git a/libretroshare/src/unused/rsdsdv.h b/libretroshare/src/unused/rsdsdv.h index dd7eb03c0..e2d634a10 100644 --- a/libretroshare/src/unused/rsdsdv.h +++ b/libretroshare/src/unused/rsdsdv.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/unused: rsdsdv.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RETROSHARE_DSDV_INTERFACE_H #define RETROSHARE_DSDV_INTERFACE_H -/* - * libretroshare/src/rsiface: rsdsdv.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 #include #include diff --git a/libretroshare/src/unused/rsdsdvitems.cc b/libretroshare/src/unused/rsdsdvitems.cc index 4731d1814..073ebe669 100644 --- a/libretroshare/src/unused/rsdsdvitems.cc +++ b/libretroshare/src/unused/rsdsdvitems.cc @@ -1,27 +1,24 @@ -/* - * libretroshare/src/serialiser: rsgameitems.cc - * - * RetroShare Serialiser. - * - * 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/unused: rsdsdvitems.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "serialiser/rsbaseserial.h" #include "serialiser/rsdsdvitems.h" diff --git a/libretroshare/src/unused/rsdsdvitems.h b/libretroshare/src/unused/rsdsdvitems.h index fd03be486..856a06b92 100644 --- a/libretroshare/src/unused/rsdsdvitems.h +++ b/libretroshare/src/unused/rsdsdvitems.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * libretroshare/src/unused: rsdsdvitems.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_DSDV_ITEMS_H #define RS_DSDV_ITEMS_H -/* - * libretroshare/src/serialiser: rsdsdvitems.h - * - * RetroShare Serialiser. - * - * 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 #include "rsitems/rsserviceids.h" diff --git a/libretroshare/src/upnp/upnphandler_linux.cc b/libretroshare/src/upnp/upnphandler_linux.cc index 13f70f041..4e6c344fb 100644 --- a/libretroshare/src/upnp/upnphandler_linux.cc +++ b/libretroshare/src/upnp/upnphandler_linux.cc @@ -1,6 +1,24 @@ -//Linux only -/* This stuff is actually C */ - +/******************************************************************************* + * libretroshare/src/upnp: upnphandler_linux.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2018 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #ifdef __cplusplus extern "C" { #endif diff --git a/libretroshare/src/upnp/upnphandler_linux.h b/libretroshare/src/upnp/upnphandler_linux.h index b22a9a9e2..741adfc47 100644 --- a/libretroshare/src/upnp/upnphandler_linux.h +++ b/libretroshare/src/upnp/upnphandler_linux.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/upnp: upnphandler_linux.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2018 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef _RS_UPNP_IFACE_H #define _RS_UPNP_IFACE_H diff --git a/libretroshare/src/upnp/upnphandler_miniupnp.cc b/libretroshare/src/upnp/upnphandler_miniupnp.cc index 24a3395f4..f264d80a7 100644 --- a/libretroshare/src/upnp/upnphandler_miniupnp.cc +++ b/libretroshare/src/upnp/upnphandler_miniupnp.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/upnp: upnphandler_miniupnp.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2018 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ // Windows / Mac version. /* This stuff is actually C */ diff --git a/libretroshare/src/upnp/upnphandler_miniupnp.h b/libretroshare/src/upnp/upnphandler_miniupnp.h index 6b4660e32..1f3c33378 100644 --- a/libretroshare/src/upnp/upnphandler_miniupnp.h +++ b/libretroshare/src/upnp/upnphandler_miniupnp.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/upnp: upnphandler_miniupnp.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2007-2018 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ //windows/osx (miniupnpc) implementation #ifndef _RS_UPNP_IFACE_H #define _RS_UPNP_IFACE_H diff --git a/libretroshare/src/upnp/upnputil.c b/libretroshare/src/upnp/upnputil.c index 525878bf6..6d5bf326c 100644 --- a/libretroshare/src/upnp/upnputil.c +++ b/libretroshare/src/upnp/upnputil.c @@ -1,3 +1,22 @@ +/************************************************************************************** + * MiniUPnPc * + * Copyright (c) 2005-2016, Thomas BERNARD * + * All rights reserved. * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions are met: * + * * + * * Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * * Redistributions in binary form must reproduce the above copyright notice, * + * this list of conditions and the following disclaimer in the documentation * + * and/or other materials provided with the distribution. * + * * The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * This software is subject to the conditions detailed in the * + * LICENCE file provided in this distribution. * + * * + **************************************************************************************/ //this file uses miniupnp //From https://github.com/miniupnp/miniupnp/blob/master/miniupnpc/upnpc.c diff --git a/libretroshare/src/upnp/upnputil.h b/libretroshare/src/upnp/upnputil.h index 99ec61f4f..20339bb72 100644 --- a/libretroshare/src/upnp/upnputil.h +++ b/libretroshare/src/upnp/upnputil.h @@ -1,15 +1,27 @@ +/************************************************************************************** + * MiniUPnPc * + * Copyright (c) 2005-2016, Thomas BERNARD * + * All rights reserved. * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions are met: * + * * + * * Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * * Redistributions in binary form must reproduce the above copyright notice, * + * this list of conditions and the following disclaimer in the documentation * + * and/or other materials provided with the distribution. * + * * The name of the author may not be used to endorse or promote products * + * derived from this software without specific prior written permission. * + * This software is subject to the conditions detailed in the * + * LICENCE file provided in this distribution. * + * * + **************************************************************************************/ //this file uses miniupnp #ifndef MINIUPNP_UTIL_H_ #define MINIUPNP_UTIL_H_ -/* $Id: upnpc.c,v 1.50 2007/04/26 19:00:10 nanard Exp $ */ -/* Project : miniupnp - * Author : Thomas Bernard - * Copyright (c) 2005 Thomas Bernard - * This software is subject to the conditions detailed in the - * LICENCE file provided in this distribution. - * */ #include #include #include diff --git a/libretroshare/src/util/androiddebug.h b/libretroshare/src/util/androiddebug.h index 2e429b99f..c358be553 100644 --- a/libretroshare/src/util/androiddebug.h +++ b/libretroshare/src/util/androiddebug.h @@ -1,21 +1,25 @@ +/******************************************************************************* + * libretroshare/src/util: androiddebug.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2016 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once -/* - * Redirect plain stdout and stderr to Android debug - * Copyright (C) 2016 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ // Inspired by: https://codelab.wordpress.com/2014/11/03/how-to-use-standard-output-streams-for-logging-in-android-apps/ diff --git a/libretroshare/src/util/contentvalue.cc b/libretroshare/src/util/contentvalue.cc index 1ab962120..e2eee943c 100644 --- a/libretroshare/src/util/contentvalue.cc +++ b/libretroshare/src/util/contentvalue.cc @@ -1,27 +1,24 @@ - -/* - * util/contentvalue.cc, key val container - * - * Copyright 2012 Christopher 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". - * - */ - +/******************************************************************************* + * libretroshare/src/util: contentvalue.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 Christopher 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 . * + * * + *******************************************************************************/ #include #include diff --git a/libretroshare/src/util/contentvalue.h b/libretroshare/src/util/contentvalue.h index d81deb662..23ee55eca 100644 --- a/libretroshare/src/util/contentvalue.h +++ b/libretroshare/src/util/contentvalue.h @@ -1,29 +1,27 @@ +/******************************************************************************* + * libretroshare/src/util: contentvalue.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 Christopher 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 . * + * * + *******************************************************************************/ #ifndef CONTENTVALUE_H #define CONTENTVALUE_H -/* - * util/contentvalue.h, key val container - * - * Copyright 2012 Christopher 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 #include #include diff --git a/libretroshare/src/util/cxx11retrocompat.h b/libretroshare/src/util/cxx11retrocompat.h index 587b1374d..98dd998db 100644 --- a/libretroshare/src/util/cxx11retrocompat.h +++ b/libretroshare/src/util/cxx11retrocompat.h @@ -1,21 +1,25 @@ +/******************************************************************************* + * libretroshare/src/util: cxx11retrocompat.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2017 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once -/* - * RetroShare - * Copyright (C) 2017 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ #ifdef __GNUC__ # define GCC_VERSION (__GNUC__*10000+__GNUC_MINOR__*100+__GNUC_PATCHLEVEL__) diff --git a/libretroshare/src/util/dnsresolver.cc b/libretroshare/src/util/dnsresolver.cc index e57d5864f..4807b1322 100644 --- a/libretroshare/src/util/dnsresolver.cc +++ b/libretroshare/src/util/dnsresolver.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/util: dnsresolver.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2017 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #include "dnsresolver.h" #include "pqi/pqinetwork.h" diff --git a/libretroshare/src/util/dnsresolver.h b/libretroshare/src/util/dnsresolver.h index 1f9581d1e..9db589825 100644 --- a/libretroshare/src/util/dnsresolver.h +++ b/libretroshare/src/util/dnsresolver.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/util: dnsresolver.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2017 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include "pqi/pqinetwork.h" diff --git a/libretroshare/src/util/extaddrfinder.cc b/libretroshare/src/util/extaddrfinder.cc index 308a8ea48..d0395c710 100644 --- a/libretroshare/src/util/extaddrfinder.cc +++ b/libretroshare/src/util/extaddrfinder.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/util: extaddrfinder.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2017 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #include "extaddrfinder.h" #include "pqi/pqinetwork.h" diff --git a/libretroshare/src/util/extaddrfinder.h b/libretroshare/src/util/extaddrfinder.h index 203e1ff9e..2b4bd4da3 100644 --- a/libretroshare/src/util/extaddrfinder.h +++ b/libretroshare/src/util/extaddrfinder.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/util: extaddrfinder.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2017 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/util/folderiterator.cc b/libretroshare/src/util/folderiterator.cc index eb70ab791..73afebeab 100644 --- a/libretroshare/src/util/folderiterator.cc +++ b/libretroshare/src/util/folderiterator.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/util: folderiterator.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2017 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #include #include #include diff --git a/libretroshare/src/util/folderiterator.h b/libretroshare/src/util/folderiterator.h index 79a011ace..3232a4b47 100644 --- a/libretroshare/src/util/folderiterator.h +++ b/libretroshare/src/util/folderiterator.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/util: folderiterator.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2017 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef FOLDERITERATOR_H #define FOLDERITERATOR_H diff --git a/libretroshare/src/util/pugiconfig.h b/libretroshare/src/util/pugiconfig.h deleted file mode 100644 index 6b553ae04..000000000 --- a/libretroshare/src/util/pugiconfig.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * pugixml parser - version 1.0 - * -------------------------------------------------------- - * Copyright (C) 2006-2010, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) - * Report bugs and download new versions at http://pugixml.org/ - * - * This library is distributed under the MIT License. See notice at the end - * of this file. - * - * This work is based on the pugxml parser, which is: - * Copyright (C) 2003, by Kristen Wegner (kristen@tima.net) - */ - -#ifndef HEADER_PUGICONFIG_HPP -#define HEADER_PUGICONFIG_HPP - -// Uncomment this to enable wchar_t mode -// #define PUGIXML_WCHAR_MODE - -// Uncomment this to disable XPath -// #define PUGIXML_NO_XPATH - -// Uncomment this to disable STL -// Note: you can't use XPath with PUGIXML_NO_STL -// #define PUGIXML_NO_STL - -// Uncomment this to disable exceptions -// Note: you can't use XPath with PUGIXML_NO_EXCEPTIONS -// #define PUGIXML_NO_EXCEPTIONS - -// Set this to control attributes for public classes/functions, i.e.: -// #define PUGIXML_API __declspec(dllexport) // to export all public symbols from DLL -// #define PUGIXML_CLASS __declspec(dllimport) // to import all classes from DLL -// #define PUGIXML_FUNCTION __fastcall // to set calling conventions to all public functions to fastcall -// In absence of PUGIXML_CLASS/PUGIXML_FUNCTION definitions PUGIXML_API is used instead - -#endif - -/** - * Copyright (c) 2006-2010 Arseny Kapoulkine - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ diff --git a/libretroshare/src/util/radix32.h b/libretroshare/src/util/radix32.h index 008aa3e9f..af5fef3ec 100644 --- a/libretroshare/src/util/radix32.h +++ b/libretroshare/src/util/radix32.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/util: radix32.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2015 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RADIX32_H #define RADIX32_H diff --git a/libretroshare/src/util/radix64.h b/libretroshare/src/util/radix64.h index 7776995f9..470186a02 100644 --- a/libretroshare/src/util/radix64.h +++ b/libretroshare/src/util/radix64.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/util: radix64.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2015 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/util/retrodb.cc b/libretroshare/src/util/retrodb.cc index 9924bbf9d..5a903dd62 100644 --- a/libretroshare/src/util/retrodb.cc +++ b/libretroshare/src/util/retrodb.cc @@ -1,26 +1,24 @@ - -/* - * RetroShare : RetroDb functionality - * - * Copyright 2012-2013 Christopher 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". - * - */ +/******************************************************************************* + * libretroshare/src/util: retrodb.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 Christopher 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 . * + * * + *******************************************************************************/ #include #include diff --git a/libretroshare/src/util/retrodb.h b/libretroshare/src/util/retrodb.h index 435b6e466..8cf772c44 100644 --- a/libretroshare/src/util/retrodb.h +++ b/libretroshare/src/util/retrodb.h @@ -1,29 +1,27 @@ +/******************************************************************************* + * libretroshare/src/util: retrodb.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012 Christopher 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 . * + * * + *******************************************************************************/ #ifndef RSSQLITE_H #define RSSQLITE_H -/* - * RetroShare : RetroDb functionality - * - * Copyright 2012 Christopher 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". - * - */ - #ifdef NO_SQLCIPHER #include #else diff --git a/libretroshare/src/util/rscompress.h b/libretroshare/src/util/rscompress.h deleted file mode 100644 index 0d11c3f47..000000000 --- a/libretroshare/src/util/rscompress.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * libretroshare/src/utils: rscompress.h - * - * Basic memory chunk compression, based on openpgp-sdk - * - * Copyright 2013 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - -#pragma once - -class RsCompress -{ - public: - static bool compress_memory_chunk(const uint8_t *input_mem,const uint32_t input_size,uint8_t *& output_mem,uint32_t& output_size) ; - static bool uncompress_memory_chunk(const uint8_t *input_mem,const uint32_t input_size,uint8_t *& output_mem,uint32_t& output_size) ; -}; - diff --git a/libretroshare/src/util/rsdbbind.cc b/libretroshare/src/util/rsdbbind.cc index 31e548ebd..db5233ba8 100644 --- a/libretroshare/src/util/rsdbbind.cc +++ b/libretroshare/src/util/rsdbbind.cc @@ -1,26 +1,24 @@ -/* - * RetroShare : RetroDb functionality - * - * Copyright 2013 Christopher 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". - * - */ - +/******************************************************************************* + * libretroshare/src/util: rsbdbind.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013 Christopher 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 . * + * * + *******************************************************************************/ #include "rsdbbind.h" RsDoubleBind::RsDoubleBind(double value, int index) diff --git a/libretroshare/src/util/rsdbbind.h b/libretroshare/src/util/rsdbbind.h index 44c701157..aa41e5b3e 100644 --- a/libretroshare/src/util/rsdbbind.h +++ b/libretroshare/src/util/rsdbbind.h @@ -1,29 +1,27 @@ +/******************************************************************************* + * libretroshare/src/util: rsbdbind.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013 Christopher 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 . * + * * + *******************************************************************************/ #ifndef RSDBBIND_H_ #define RSDBBIND_H_ -/* - * RetroShare : RetroDb functionality - * - * Copyright 2013 Christopher 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 #include diff --git a/libretroshare/src/util/rsdebug.cc b/libretroshare/src/util/rsdebug.cc index ab40c3035..aade16282 100644 --- a/libretroshare/src/util/rsdebug.cc +++ b/libretroshare/src/util/rsdebug.cc @@ -1,27 +1,24 @@ -/* - * "$Id: pqidebug.cc,v 1.6 2007-02-18 21:46:49 rmf24 Exp $" - * - * 3P/RS network interface for RetroShare. - * - * 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/util: rsdebug.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "util/rsdebug.h" #include "util/rsthreads.h" diff --git a/libretroshare/src/util/rsdebug.h b/libretroshare/src/util/rsdebug.h index abf39e4b0..dd054822c 100644 --- a/libretroshare/src/util/rsdebug.h +++ b/libretroshare/src/util/rsdebug.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/util: rsdebug.h - * - * Debug interface 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". - * - */ - - +/******************************************************************************* + * libretroshare/src/util: rsdebug.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2008 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ /* Moved from pqi/ to util/ so it can be used more generally. */ diff --git a/libretroshare/src/util/rsdeprecate.h b/libretroshare/src/util/rsdeprecate.h index 4d44e208e..560f91c44 100644 --- a/libretroshare/src/util/rsdeprecate.h +++ b/libretroshare/src/util/rsdeprecate.h @@ -1,21 +1,25 @@ +/******************************************************************************* + * libretroshare/src/util: rsdebug.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2016 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once -/* - * RetroShare deprecation macros - * Copyright (C) 2016 Gioacchino Mazzurco - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) # define RS_DEPRECATED __attribute__((__deprecated__)) diff --git a/libretroshare/src/util/rsdir.cc b/libretroshare/src/util/rsdir.cc index e1c1cf4ab..a890ed8f1 100644 --- a/libretroshare/src/util/rsdir.cc +++ b/libretroshare/src/util/rsdir.cc @@ -1,28 +1,24 @@ - -/* - * "$Id: rsdir.cc,v 1.1 2007-02-19 20:08:30 rmf24 Exp $" - * - * RetroShare C++ Interface. - * - * Copyright 2004-2007 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/util: rsdir.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2007 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ // Includes for directory creation. #include diff --git a/libretroshare/src/util/rsdir.h b/libretroshare/src/util/rsdir.h index ef95e100e..b6ef4891d 100644 --- a/libretroshare/src/util/rsdir.h +++ b/libretroshare/src/util/rsdir.h @@ -1,29 +1,24 @@ - -/* - * "$Id: rsdir.h,v 1.1 2007-02-19 20:08:30 rmf24 Exp $" - * - * RetroShare C++ Interface. - * - * Copyright 2004-2007 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/util: rsdir.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2007 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RSUTIL_DIRFNS_H #define RSUTIL_DIRFNS_H diff --git a/libretroshare/src/util/rsdiscspace.cc b/libretroshare/src/util/rsdiscspace.cc index 25a764b14..9e325ea7b 100644 --- a/libretroshare/src/util/rsdiscspace.cc +++ b/libretroshare/src/util/rsdiscspace.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/util: rsdiscspace.cc - * - * Universal Networking Header for RetroShare. - * - * Copyright 2010-2010 by Cyril Soler. - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/util: rsdiscspace.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2010-2010 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #include #include #include diff --git a/libretroshare/src/util/rsdiscspace.h b/libretroshare/src/util/rsdiscspace.h index 1e01ebe3f..1262fd5e4 100644 --- a/libretroshare/src/util/rsdiscspace.h +++ b/libretroshare/src/util/rsdiscspace.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/util: rsdiscspace.h - * - * Universal Networking Header for RetroShare. - * - * Copyright 2010-2010 by Cyril Soler. - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/util: rsdiscspace.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2010-2010 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/util/rsinitedptr.h b/libretroshare/src/util/rsinitedptr.h index a1d346ba0..333a8af87 100644 --- a/libretroshare/src/util/rsinitedptr.h +++ b/libretroshare/src/util/rsinitedptr.h @@ -1,3 +1,25 @@ +/******************************************************************************* + * libretroshare/src/util: rsinitedptr.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2010-2010 by Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ + #pragma once /** helper class to store a pointer diff --git a/libretroshare/src/util/rsmemcache.h b/libretroshare/src/util/rsmemcache.h index 03ce9f44a..a0d188295 100644 --- a/libretroshare/src/util/rsmemcache.h +++ b/libretroshare/src/util/rsmemcache.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/util: rsmemcache.h - * - * Identity interface for RetroShare. - * - * Copyright 2012-2012 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/util: rsmemcache.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_UTIL_MEM_CACHE #define RS_UTIL_MEM_CACHE diff --git a/libretroshare/src/util/rsmemory.cc b/libretroshare/src/util/rsmemory.cc index 6aab9dfef..2b162c77d 100644 --- a/libretroshare/src/util/rsmemory.cc +++ b/libretroshare/src/util/rsmemory.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/util: rsmemory.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #include "util/rsmemory.h" void *rs_malloc(size_t size) diff --git a/libretroshare/src/util/rsmemory.h b/libretroshare/src/util/rsmemory.h index 7da4245c4..b46e12ad1 100644 --- a/libretroshare/src/util/rsmemory.h +++ b/libretroshare/src/util/rsmemory.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/util: rsmemory.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/util/rsnet.cc b/libretroshare/src/util/rsnet.cc index 565185edc..d7d60241a 100644 --- a/libretroshare/src/util/rsnet.cc +++ b/libretroshare/src/util/rsnet.cc @@ -1,28 +1,25 @@ -/* - * libretroshare/src/util: rsnet.cc - * - * Universal Networking Header for RetroShare. - * - * Copyright 2007-2008 by Robert Fernie. - * Copyright (C) 2015-2018 Gioacchino Mazzurco - * - * 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/util: rsnet.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 Robert Fernie * + * Copyright 2015-2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #include "util/rsnet.h" #include "util/rsthreads.h" diff --git a/libretroshare/src/util/rsnet.h b/libretroshare/src/util/rsnet.h index a5381702c..5807d40a7 100644 --- a/libretroshare/src/util/rsnet.h +++ b/libretroshare/src/util/rsnet.h @@ -1,29 +1,25 @@ -/* - * libretroshare/src/util: rsnet.h - * - * Universal Networking Header for RetroShare. - * - * Copyright 2004-2006 by Robert Fernie. - * Copyright (C) 2015-2018 Gioacchino Mazzurco - * - * 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/util: rsnet.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 Robert Fernie * + * Copyright 2015-2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_UNIVERSAL_NETWORK_HEADER #define RS_UNIVERSAL_NETWORK_HEADER diff --git a/libretroshare/src/util/rsprint.cc b/libretroshare/src/util/rsprint.cc index c87fc02f7..dca3d925c 100644 --- a/libretroshare/src/util/rsprint.cc +++ b/libretroshare/src/util/rsprint.cc @@ -1,28 +1,24 @@ - -/* - * libretroshare/src/util: rsprint.cc - * - * RetroShare Utilities - * - * Copyright 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/util: rsprint.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2008 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "util/rsprint.h" #include "util/rsstring.h" diff --git a/libretroshare/src/util/rsprint.h b/libretroshare/src/util/rsprint.h index 3ab70a411..58a0b7f89 100644 --- a/libretroshare/src/util/rsprint.h +++ b/libretroshare/src/util/rsprint.h @@ -1,30 +1,24 @@ - -/* - * libretroshare/src/util: rsprint.h - * - * RetroShare Utilities - * - * Copyright 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/util: rsprint.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2008-2008 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RSUTIL_PRINTFNS_H #define RSUTIL_PRINTFNS_H From 858dcfc14cb816dbf91a3c1e18177912adb7cc72 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 30 May 2018 21:19:53 +0200 Subject: [PATCH 065/138] removed unused tempering in random number generator, added comments and license text --- libretroshare/src/util/rsrandom.cc | 27 +++++++++++++++ libretroshare/src/util/rsrandom.h | 53 ++++++++++++++---------------- 2 files changed, 51 insertions(+), 29 deletions(-) diff --git a/libretroshare/src/util/rsrandom.cc b/libretroshare/src/util/rsrandom.cc index 03c8a95d9..86f93bf5f 100644 --- a/libretroshare/src/util/rsrandom.cc +++ b/libretroshare/src/util/rsrandom.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/util: rsrandom.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2010 Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #include #include #include @@ -35,6 +56,10 @@ bool RSRandom::seed(uint32_t s) for (j=1; j> 30)) + j) & 0xffffffffUL ; + // This *does not* replace the internal seed state of RAND_bytes(), but only *adds* entropy to the random pool + // So calling this method with the same value twice does not guarranty that the output of the random bytes + // will be the same. + RAND_seed((unsigned char *)&MT[0],N*sizeof(uint32_t)) ; locked_next_state() ; @@ -66,11 +91,13 @@ uint32_t RSRandom::random_u32() y = MT[index] ; } +#ifdef UNNECESSARY_CODE // Tempering y ^= (y >> 11); y ^= (y << 7 ) & 0x9d2c5680UL; y ^= (y << 15) & 0xefc60000UL; y ^= (y >> 18); +#endif return y; } diff --git a/libretroshare/src/util/rsrandom.h b/libretroshare/src/util/rsrandom.h index 8cd66f7f6..59c488909 100644 --- a/libretroshare/src/util/rsrandom.h +++ b/libretroshare/src/util/rsrandom.h @@ -1,36 +1,31 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2010 Cyril Soler - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * libretroshare/src/util: rsrandom.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2010 Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once // RSRandom contains a random number generator that is // - thread safe // - system independant // - fast -// - NOT CRYPTOGRAPHICALLY SAFE -// - DO NOT USE FOR ANYTHING REQUIRING STRONG RANDOMNESS -// -// The implementation is adapted from the Mersenne Twister page of Wikipedia. -// -// http://en.wikipedia.org/wiki/Mersenne_twister +// - CRYPTOGRAPHICALLY SAFE, because it is based on openssl random number generator #include #include @@ -40,8 +35,8 @@ class RSRandom public: static uint32_t random_u32() ; static uint64_t random_u64() ; - static float random_f32() ; - static double random_f64() ; + static float random_f32() ; + static double random_f64() ; static bool seed(uint32_t s) ; From 8641da189c05a5008a3b32d3368841e2c721e757 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 30 May 2018 21:34:38 +0200 Subject: [PATCH 066/138] relicensed util/ and moved rsaes to crypto/ --- libretroshare/src/{util => crypto}/rsaes.cc | 46 +++++++++----------- libretroshare/src/crypto/rsaes.h | 43 +++++++++++++++++++ libretroshare/src/libretroshare.pro | 9 ++-- libretroshare/src/util/rsaes.h | 47 --------------------- libretroshare/src/util/rsnet_ss.cc | 47 ++++++++++----------- libretroshare/src/util/rsrecogn.cc | 46 +++++++++----------- libretroshare/src/util/rsrecogn.h | 47 +++++++++------------ libretroshare/src/util/rsstd.h | 42 +++++++++--------- libretroshare/src/util/rsstring.cc | 42 +++++++++--------- libretroshare/src/util/rsstring.h | 42 +++++++++--------- libretroshare/src/util/rsthreads.cc | 46 +++++++++----------- libretroshare/src/util/rsthreads.h | 46 +++++++++----------- libretroshare/src/util/rstickevent.cc | 46 +++++++++----------- libretroshare/src/util/rstickevent.h | 45 +++++++++----------- libretroshare/src/util/rstime.cc | 46 +++++++++----------- libretroshare/src/util/rstime.h | 46 +++++++++----------- libretroshare/src/util/rsversioninfo.cc | 28 +++++++++--- libretroshare/src/util/rsversioninfo.h | 28 +++++++++--- libretroshare/src/util/rswin.cc | 1 - libretroshare/src/util/rswin.h | 42 +++++++++--------- libretroshare/src/util/smallobject.cc | 21 +++++++++ libretroshare/src/util/smallobject.h | 46 +++++++++----------- libretroshare/src/util/stacktrace.h | 44 +++++++++---------- 23 files changed, 448 insertions(+), 448 deletions(-) rename libretroshare/src/{util => crypto}/rsaes.cc (68%) create mode 100644 libretroshare/src/crypto/rsaes.h delete mode 100644 libretroshare/src/util/rsaes.h delete mode 100644 libretroshare/src/util/rswin.cc diff --git a/libretroshare/src/util/rsaes.cc b/libretroshare/src/crypto/rsaes.cc similarity index 68% rename from libretroshare/src/util/rsaes.cc rename to libretroshare/src/crypto/rsaes.cc index 7be5175f9..d5ad2c7a0 100644 --- a/libretroshare/src/util/rsaes.cc +++ b/libretroshare/src/crypto/rsaes.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/utils: rsaes.cc - * - * AES crptography for RetroShare. - * - * Copyright 2013 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/util: rsaes.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013-2013 Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #include #include #include diff --git a/libretroshare/src/crypto/rsaes.h b/libretroshare/src/crypto/rsaes.h new file mode 100644 index 000000000..d4592793d --- /dev/null +++ b/libretroshare/src/crypto/rsaes.h @@ -0,0 +1,43 @@ +/******************************************************************************* + * libretroshare/src/util: rsaes.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013-2013 Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ +#include + +class RsAES +{ + public: + // Crypt/decrypt data using a 16 bytes key and a 8 bytes salt. + // + // output_data allocation is left to the client. The size should be at least RsAES::get_buffer_size(input_data_length) + // + // Return value: + // true: encryption/decryption ok + // + // false: encryption/decryption went bad. Check buffer size. + // + static bool aes_crypt_8_16(const uint8_t *input_data,uint32_t input_data_length,uint8_t key[16],uint8_t salt[8],uint8_t *output_data,uint32_t& output_data_length) ; + static bool aes_decrypt_8_16(const uint8_t *input_data,uint32_t input_data_length,uint8_t key[16],uint8_t salt[8],uint8_t *output_data,uint32_t& output_data_length) ; + + // computes the safe buffer size to store encrypted/decrypted data for the given input stream size + // + static uint32_t get_buffer_size(uint32_t size) ; +}; + diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index d11012de6..6c8620617 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -391,7 +391,8 @@ HEADERS += ft/ftchunkmap.h \ ft/ftturtlefiletransferitem.h HEADERS += crypto/chacha20.h \ - crypto/hashstream.h + crypto/rsaes.h \ + crypto/hashstream.h HEADERS += directory_updater.h \ directory_list.h \ @@ -406,7 +407,6 @@ HEADERS += pqi/authssl.h \ pqi/authgpg.h \ pgp/pgphandler.h \ pgp/pgpkeyutil.h \ - pgp/rsaes.h \ pgp/rscertificate.h \ pgp/pgpauxutils.h \ pqi/p3cfgmgr.h \ @@ -556,7 +556,8 @@ SOURCES += ft/ftchunkmap.cc \ ft/ftturtlefiletransferitem.cc SOURCES += crypto/chacha20.cpp \ - crypto/hashstream.cc + crypto/rsaes.cc \ + crypto/hashstream.cc SOURCES += chat/distantchat.cc \ chat/p3chatservice.cc \ @@ -682,8 +683,6 @@ SOURCES += util/folderiterator.cc \ util/rsstring.cc \ util/rsthreads.cc \ util/rsversioninfo.cc \ - util/rswin.cc \ - util/rsaes.cc \ util/rsrandom.cc \ util/rstickevent.cc \ util/rsrecogn.cc \ diff --git a/libretroshare/src/util/rsaes.h b/libretroshare/src/util/rsaes.h deleted file mode 100644 index 21a8c701c..000000000 --- a/libretroshare/src/util/rsaes.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * libretroshare/src/utils: rsaescrypt.h - * - * AES crptography for RetroShare. - * - * Copyright 2013 by Cyril Soler - * - * 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 "csoler@users.sourceforge.net". - * - */ - -#include - -class RsAES -{ - public: - // Crypt/decrypt data using a 16 bytes key and a 8 bytes salt. - // - // output_data allocation is left to the client. The size should be at least RsAES::get_buffer_size(input_data_length) - // - // Return value: - // true: encryption/decryption ok - // - // false: encryption/decryption went bad. Check buffer size. - // - static bool aes_crypt_8_16(const uint8_t *input_data,uint32_t input_data_length,uint8_t key[16],uint8_t salt[8],uint8_t *output_data,uint32_t& output_data_length) ; - static bool aes_decrypt_8_16(const uint8_t *input_data,uint32_t input_data_length,uint8_t key[16],uint8_t salt[8],uint8_t *output_data,uint32_t& output_data_length) ; - - // computes the safe buffer size to store encrypted/decrypted data for the given input stream size - // - static uint32_t get_buffer_size(uint32_t size) ; -}; - diff --git a/libretroshare/src/util/rsnet_ss.cc b/libretroshare/src/util/rsnet_ss.cc index 581fd06e9..985282cc2 100644 --- a/libretroshare/src/util/rsnet_ss.cc +++ b/libretroshare/src/util/rsnet_ss.cc @@ -1,28 +1,25 @@ -/* - * libretroshare/src/util: rsnet_ss.cc - * - * sockaddr_storage functions for RetroShare. - * - * Copyright 2013-2013 by Robert Fernie. - * Copyright (C) 2015-2018 Gioacchino Mazzurco - * - * 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/util: rsnet_ss.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 Robert Fernie * + * Copyright 2015-2018 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ #include #include diff --git a/libretroshare/src/util/rsrecogn.cc b/libretroshare/src/util/rsrecogn.cc index 2b6e51caa..581ec9268 100644 --- a/libretroshare/src/util/rsrecogn.cc +++ b/libretroshare/src/util/rsrecogn.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/util: rsrecogn.cc - * - * RetroShare Utilities - * - * Copyright 2013 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/util: rsrandom.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2013 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "pqi/pqi_base.h" #include "util/rsrecogn.h" diff --git a/libretroshare/src/util/rsrecogn.h b/libretroshare/src/util/rsrecogn.h index 4f7b7cd2e..7cc33ec76 100644 --- a/libretroshare/src/util/rsrecogn.h +++ b/libretroshare/src/util/rsrecogn.h @@ -1,29 +1,24 @@ - -/* - * libretroshare/src/util: rsrecogn.h - * - * RetroShare Utilities - * - * Copyright 2013 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/util: rsrandom.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2013 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RSUTIL_RECOGN_H #define RSUTIL_RECOGN_H diff --git a/libretroshare/src/util/rsstd.h b/libretroshare/src/util/rsstd.h index b2ff78887..8a41a3270 100644 --- a/libretroshare/src/util/rsstd.h +++ b/libretroshare/src/util/rsstd.h @@ -1,24 +1,24 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2015, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * libretroshare/src/util: rsstd.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2015 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RSSTD_H_ #define RSSTD_H_ diff --git a/libretroshare/src/util/rsstring.cc b/libretroshare/src/util/rsstring.cc index fe29bca92..db7000cec 100644 --- a/libretroshare/src/util/rsstring.cc +++ b/libretroshare/src/util/rsstring.cc @@ -1,24 +1,24 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, Thomas Kister - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * libretroshare/src/util: rsstd.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (c) 2010, Thomas Kister * + * * + * 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 . * + * * + *******************************************************************************/ #include "rsstring.h" #ifdef WINDOWS_SYS diff --git a/libretroshare/src/util/rsstring.h b/libretroshare/src/util/rsstring.h index 0e9df964f..93553885e 100644 --- a/libretroshare/src/util/rsstring.h +++ b/libretroshare/src/util/rsstring.h @@ -1,24 +1,24 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, Thomas Kister - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * libretroshare/src/util: rsstd.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (c) 2010, Thomas Kister * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RSSTRING_H_ #define RSSTRING_H_ diff --git a/libretroshare/src/util/rsthreads.cc b/libretroshare/src/util/rsthreads.cc index 65fcad4b7..755134817 100644 --- a/libretroshare/src/util/rsthreads.cc +++ b/libretroshare/src/util/rsthreads.cc @@ -1,28 +1,24 @@ - -/* - * "$Id: rsthreads.cc,v 1.1 2007-02-19 20:08:30 rmf24 Exp $" - * - * RetroShare C++ Interface. - * - * Copyright 2004-2007 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/util: rsthreads.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2007 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "rsthreads.h" #include // for usleep() diff --git a/libretroshare/src/util/rsthreads.h b/libretroshare/src/util/rsthreads.h index 0dfbc4c44..dfad45e2c 100644 --- a/libretroshare/src/util/rsthreads.h +++ b/libretroshare/src/util/rsthreads.h @@ -1,28 +1,24 @@ -/* - * "$Id: rsthreads.h,v 1.1 2007-02-19 20:08:30 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/util: rsthreads.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2004-2006 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/util/rstickevent.cc b/libretroshare/src/util/rstickevent.cc index 0da21cf4d..4c9cdc37b 100644 --- a/libretroshare/src/util/rstickevent.cc +++ b/libretroshare/src/util/rstickevent.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/util: rstickevent.cc - * - * Identity interface for RetroShare. - * - * Copyright 2012-2012 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/util: rstickevent.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "util/rstickevent.h" #include diff --git a/libretroshare/src/util/rstickevent.h b/libretroshare/src/util/rstickevent.h index 1b26c6b43..4b08d9139 100644 --- a/libretroshare/src/util/rstickevent.h +++ b/libretroshare/src/util/rstickevent.h @@ -1,27 +1,24 @@ -/* - * libretroshare/src/util: rstickevent.h - * - * Identity interface for RetroShare. - * - * Copyright 2012-2012 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/util: rstickevent.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef RS_UTIL_TICK_EVENT #define RS_UTIL_TICK_EVENT diff --git a/libretroshare/src/util/rstime.cc b/libretroshare/src/util/rstime.cc index 9733ac55d..d2180775e 100644 --- a/libretroshare/src/util/rstime.cc +++ b/libretroshare/src/util/rstime.cc @@ -1,28 +1,24 @@ -/* - * libretroshare/src/util: rsscopetimer.cc - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2013- by Cyril Soler - * - * 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/util: rstime.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013-2013 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #include #include #include diff --git a/libretroshare/src/util/rstime.h b/libretroshare/src/util/rstime.h index 4359a28ff..a9b3dfd5b 100644 --- a/libretroshare/src/util/rstime.h +++ b/libretroshare/src/util/rstime.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/util: rsscopetimer.h - * - * 3P/PQI network interface for RetroShare. - * - * Copyright 2013- by Cyril Soler - * - * 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/util: rstime.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013-2013 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #include namespace rstime { diff --git a/libretroshare/src/util/rsversioninfo.cc b/libretroshare/src/util/rsversioninfo.cc index 04f03322f..6e48d3939 100644 --- a/libretroshare/src/util/rsversioninfo.cc +++ b/libretroshare/src/util/rsversioninfo.cc @@ -1,10 +1,24 @@ -/* - * rsversion.cc - * - * Created on: Jun 23, 2009 - * Author: alexandrut - */ - +/******************************************************************************* + * libretroshare/src/util: rsversioninfo.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013-2013 by Alexandrut * + * * + * 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 . * + * * + *******************************************************************************/ #include "rsversioninfo.h" #include "retroshare/rsversion.h" #include "rsstring.h" diff --git a/libretroshare/src/util/rsversioninfo.h b/libretroshare/src/util/rsversioninfo.h index 3cc331aca..041839b21 100644 --- a/libretroshare/src/util/rsversioninfo.h +++ b/libretroshare/src/util/rsversioninfo.h @@ -1,10 +1,24 @@ -/* - * rsversion.h - * - * Created on: Jun 23, 2009 - * Author: alexandrut - */ - +/******************************************************************************* + * libretroshare/src/util: rsversioninfo.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2013-2013 by Alexandrut * + * * + * 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 . * + * * + *******************************************************************************/ #include #include diff --git a/libretroshare/src/util/rswin.cc b/libretroshare/src/util/rswin.cc deleted file mode 100644 index 6476c6faf..000000000 --- a/libretroshare/src/util/rswin.cc +++ /dev/null @@ -1 +0,0 @@ -#include "util/rswin.h" diff --git a/libretroshare/src/util/rswin.h b/libretroshare/src/util/rswin.h index eba97f428..22e2ead96 100644 --- a/libretroshare/src/util/rswin.h +++ b/libretroshare/src/util/rswin.h @@ -1,24 +1,24 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, Thomas Kister - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * libretroshare/src/util: rswin.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (c) 2010, Thomas Kister * + * * + * 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 . * + * * + *******************************************************************************/ /** * This file provides helper functions for the windows environment diff --git a/libretroshare/src/util/smallobject.cc b/libretroshare/src/util/smallobject.cc index baf8ee357..3e1759fed 100644 --- a/libretroshare/src/util/smallobject.cc +++ b/libretroshare/src/util/smallobject.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * libretroshare/src/util: smallobject.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright (c) 2011, Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "smallobject.h" #include "util/rsthreads.h" diff --git a/libretroshare/src/util/smallobject.h b/libretroshare/src/util/smallobject.h index a5b11bcc9..2f3ac592c 100644 --- a/libretroshare/src/util/smallobject.h +++ b/libretroshare/src/util/smallobject.h @@ -1,28 +1,24 @@ -/* - * libretroshare/src/util: smallobject.h - * - * Universal Networking Header for RetroShare. - * - * Copyright 2011 by Cyril Soler - * - * 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 "cyril.soler@users.sourceforge.net". - * - */ - +/******************************************************************************* + * libretroshare/src/util: smallobject.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (c) 2011, Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libretroshare/src/util/stacktrace.h b/libretroshare/src/util/stacktrace.h index 48ab2527d..f7284e7f9 100644 --- a/libretroshare/src/util/stacktrace.h +++ b/libretroshare/src/util/stacktrace.h @@ -1,25 +1,25 @@ -/* - * stacktrace.h - * - * Copyright (C) 2016 Gioacchino Mazzurco - * Copyright (C) 2008 Timo Bingmann http://idlebox.net/ - * - * 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. - * - */ - +/******************************************************************************* + * libretroshare/src/util: smallobject.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright (C) 2016 Gioacchino Mazzurco * + * Copyright (C) 2008 Timo Bingmann http://idlebox.net/ * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef _STACKTRACE_H_ #define _STACKTRACE_H_ From bc63726c4c606ff5d410907709fe6309305e5221 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 30 May 2018 21:35:29 +0200 Subject: [PATCH 067/138] fixed compilation --- libretroshare/src/chat/distantchat.cc | 2 +- libretroshare/src/chat/p3chatservice.cc | 2 +- libretroshare/src/gxstunnel/p3gxstunnel.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libretroshare/src/chat/distantchat.cc b/libretroshare/src/chat/distantchat.cc index b6da39fe8..60b11b0b3 100644 --- a/libretroshare/src/chat/distantchat.cc +++ b/libretroshare/src/chat/distantchat.cc @@ -27,7 +27,7 @@ #include "openssl/dh.h" #include "openssl/err.h" -#include "util/rsaes.h" +#include "crypto/rsaes.h" #include "util/rsmemory.h" #include "util/rsprint.h" diff --git a/libretroshare/src/chat/p3chatservice.cc b/libretroshare/src/chat/p3chatservice.cc index 77fb91bea..08267f6be 100644 --- a/libretroshare/src/chat/p3chatservice.cc +++ b/libretroshare/src/chat/p3chatservice.cc @@ -26,7 +26,7 @@ #include "util/rsdir.h" #include "util/radix64.h" -#include "util/rsaes.h" +#include "crypto/rsaes.h" #include "util/rsrandom.h" #include "util/rsstring.h" #include "retroshare/rsiface.h" diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.cc b/libretroshare/src/gxstunnel/p3gxstunnel.cc index 89beb2b8b..bb51caaeb 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.cc +++ b/libretroshare/src/gxstunnel/p3gxstunnel.cc @@ -25,7 +25,7 @@ #include "openssl/dh.h" #include "openssl/err.h" -#include "util/rsaes.h" +#include "crypto/rsaes.h" #include "util/rsprint.h" #include "util/rsmemory.h" From b0f391d66f823f63b4ede44c76df100534310f04 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 30 May 2018 21:45:18 +0200 Subject: [PATCH 068/138] fixed compilation and re-licensed zeroconf/ --- libretroshare/src/libretroshare.pro | 2 - libretroshare/src/pgp/pgphandler.cc | 2 - libretroshare/src/pgp/pgpkeyutil.cc | 2 - libretroshare/src/pgp/rscertificate.cc | 2 - libretroshare/src/pqi/p3cfgmgr.cc | 1 - libretroshare/src/services/p3msgservice.cc | 1 - .../src/{pqi => unused}/pqiarchive.cc | 0 .../src/{pqi => unused}/pqiarchive.h | 0 libretroshare/src/zeroconf/p3zcnatassist.cc | 47 +++++++++---------- libretroshare/src/zeroconf/p3zcnatassist.h | 47 +++++++++---------- libretroshare/src/zeroconf/p3zeroconf.cc | 47 +++++++++---------- libretroshare/src/zeroconf/p3zeroconf.h | 47 +++++++++---------- 12 files changed, 84 insertions(+), 114 deletions(-) rename libretroshare/src/{pqi => unused}/pqiarchive.cc (100%) rename libretroshare/src/{pqi => unused}/pqiarchive.h (100%) diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index 6c8620617..36db181aa 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -418,7 +418,6 @@ HEADERS += pqi/authssl.h \ pqi/pqiqos.h \ pqi/pqi.h \ pqi/pqi_base.h \ - pqi/pqiarchive.h \ pqi/pqiassist.h \ pqi/pqibin.h \ pqi/pqihandler.h \ @@ -576,7 +575,6 @@ SOURCES += pqi/authgpg.cc \ pqi/p3netmgr.cc \ pqi/p3notify.cc \ pqi/pqiqos.cc \ - pqi/pqiarchive.cc \ pqi/pqibin.cc \ pqi/pqihandler.cc \ pqi/p3historymgr.cc \ diff --git a/libretroshare/src/pgp/pgphandler.cc b/libretroshare/src/pgp/pgphandler.cc index 709231f20..f5ca9fa1e 100644 --- a/libretroshare/src/pgp/pgphandler.cc +++ b/libretroshare/src/pgp/pgphandler.cc @@ -19,8 +19,6 @@ * along with this program. If not, see . * * * *******************************************************************************/ -#pragma once - #include #include #include diff --git a/libretroshare/src/pgp/pgpkeyutil.cc b/libretroshare/src/pgp/pgpkeyutil.cc index e8f1f1d5b..76b332edf 100644 --- a/libretroshare/src/pgp/pgpkeyutil.cc +++ b/libretroshare/src/pgp/pgpkeyutil.cc @@ -19,8 +19,6 @@ * along with this program. If not, see . * * * *******************************************************************************/ -#pragma once - #include #include #include "pgpkeyutil.h" diff --git a/libretroshare/src/pgp/rscertificate.cc b/libretroshare/src/pgp/rscertificate.cc index 88424fa29..a72a589bf 100644 --- a/libretroshare/src/pgp/rscertificate.cc +++ b/libretroshare/src/pgp/rscertificate.cc @@ -19,8 +19,6 @@ * along with this program. If not, see . * * * *******************************************************************************/ -#pragma once - #include #include #include diff --git a/libretroshare/src/pqi/p3cfgmgr.cc b/libretroshare/src/pqi/p3cfgmgr.cc index d601c460e..7f9f03547 100644 --- a/libretroshare/src/pqi/p3cfgmgr.cc +++ b/libretroshare/src/pqi/p3cfgmgr.cc @@ -25,7 +25,6 @@ #include "pqi/authssl.h" #include "pqi/pqibin.h" #include "pqi/pqistore.h" -#include "pqi/pqiarchive.h" #include #include #include diff --git a/libretroshare/src/services/p3msgservice.cc b/libretroshare/src/services/p3msgservice.cc index 54fdc710e..5b270749b 100644 --- a/libretroshare/src/services/p3msgservice.cc +++ b/libretroshare/src/services/p3msgservice.cc @@ -24,7 +24,6 @@ #include "retroshare/rsidentity.h" #include "pqi/pqibin.h" -#include "pqi/pqiarchive.h" #include "pqi/p3linkmgr.h" #include "pqi/authgpg.h" #include "pqi/p3cfgmgr.h" diff --git a/libretroshare/src/pqi/pqiarchive.cc b/libretroshare/src/unused/pqiarchive.cc similarity index 100% rename from libretroshare/src/pqi/pqiarchive.cc rename to libretroshare/src/unused/pqiarchive.cc diff --git a/libretroshare/src/pqi/pqiarchive.h b/libretroshare/src/unused/pqiarchive.h similarity index 100% rename from libretroshare/src/pqi/pqiarchive.h rename to libretroshare/src/unused/pqiarchive.h diff --git a/libretroshare/src/zeroconf/p3zcnatassist.cc b/libretroshare/src/zeroconf/p3zcnatassist.cc index 1e35de50b..9e3ed5e58 100644 --- a/libretroshare/src/zeroconf/p3zcnatassist.cc +++ b/libretroshare/src/zeroconf/p3zcnatassist.cc @@ -1,29 +1,24 @@ -/* - * libretroshare/src/zeroconf: p3zeroconf.cc - * - * ZeroConf interface for RetroShare. - * - * 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/zeroconf: p3zcnatassist.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "zeroconf/p3zeroconf.h" #include "zeroconf/p3zcnatassist.h" diff --git a/libretroshare/src/zeroconf/p3zcnatassist.h b/libretroshare/src/zeroconf/p3zcnatassist.h index ad92d9a2a..9e5bcc313 100644 --- a/libretroshare/src/zeroconf/p3zcnatassist.h +++ b/libretroshare/src/zeroconf/p3zcnatassist.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/zeroconf: p3zcnatassist.h - * - * ZeroConf interface for RetroShare. - * - * Copyright 2011-2012 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/zeroconf: p3zcnatassist.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_P3_ZC_NAT_ASSIST_H #define MRK_P3_ZC_NAT_ASSIST_H diff --git a/libretroshare/src/zeroconf/p3zeroconf.cc b/libretroshare/src/zeroconf/p3zeroconf.cc index b4417ddbd..65aedc7f6 100644 --- a/libretroshare/src/zeroconf/p3zeroconf.cc +++ b/libretroshare/src/zeroconf/p3zeroconf.cc @@ -1,29 +1,24 @@ -/* - * libretroshare/src/zeroconf: p3zeroconf.cc - * - * ZeroConf interface for RetroShare. - * - * 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/zeroconf: p3zeroconf.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "zeroconf/p3zeroconf.h" #include #include diff --git a/libretroshare/src/zeroconf/p3zeroconf.h b/libretroshare/src/zeroconf/p3zeroconf.h index 46365633b..9b7e21b5c 100644 --- a/libretroshare/src/zeroconf/p3zeroconf.h +++ b/libretroshare/src/zeroconf/p3zeroconf.h @@ -1,29 +1,24 @@ -/* - * libretroshare/src/zeroconf: p3zeroconf.h - * - * ZeroConf interface for RetroShare. - * - * 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/zeroconf: p3zeroconf.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2011-2012 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef MRK_P3_ZEROCONF_H #define MRK_P3_ZEROCONF_H From 8ceb597310b160be5cf72e1aceb5cf86e70446dd Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 30 May 2018 21:57:13 +0200 Subject: [PATCH 069/138] removed non relevent directories from debian archive --- build_scripts/Debian/makeSourcePackage.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build_scripts/Debian/makeSourcePackage.sh b/build_scripts/Debian/makeSourcePackage.sh index 273030f48..30e6aa736 100755 --- a/build_scripts/Debian/makeSourcePackage.sh +++ b/build_scripts/Debian/makeSourcePackage.sh @@ -123,6 +123,12 @@ if ! test "${nodl}" = "yes"; then # remove unised qml code, only needed on Android rm -rf ${workdir}/src/retroshare-qml-app/ + rm -rf ${workdir}/src/librssimulator/ + rm -rf ${workdir}/src/retroshare-android-notify-service/ + rm -rf ${workdir}/src/retroshare-android-service/ + rm -rf ${workdir}/src/libretroshare/src/unused/ + rm -rf ${workdir}/src/pegmarkdown/ + rm -rf ${workdir}/src/unittests/ rm -rf ${workdir}/src/build_scripts/ rm -f ${workdir}/debian/*~ rm -f ${workdir}/debian/.*.sw? @@ -156,6 +162,12 @@ else cp -r debian/* ${workdir}/debian/ rm -rf ${workdir}/src/retroshare-qml-app/ + rm -rf ${workdir}/src/retroshare-android-notify-service/ + rm -rf ${workdir}/src/retroshare-android-service/ + rm -rf ${workdir}/src/librssimulator/ + rm -rf ${workdir}/src/unittests/ + rm -rf ${workdir}/src/libretroshare/src/unused/ + rm -rf ${workdir}/src/pegmarkdown/ rm -rf ${workdir}/src/build_scripts/ rm -f ${workdir}/debian/*~ rm -f ${workdir}/debian/.*.sw? From 90d7f55c404cca1829f8b978d084f5dbfd271bc3 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 31 May 2018 15:41:54 +0200 Subject: [PATCH 070/138] finished implementing GXS search items --- libretroshare/src/pqi/p3notify.cc | 3 +- libretroshare/src/pqi/p3notify.h | 1 + libretroshare/src/retroshare/rsnotify.h | 1 + libretroshare/src/retroshare/rsturtle.h | 3 +- libretroshare/src/turtle/p3turtle.cc | 206 +++++++++++++---------- libretroshare/src/turtle/rsturtleitem.cc | 67 +++++++- libretroshare/src/turtle/rsturtleitem.h | 195 +++++++++++++-------- retroshare-gui/src/gui/notifyqt.cpp | 5 + retroshare-gui/src/gui/notifyqt.h | 1 + 9 files changed, 322 insertions(+), 160 deletions(-) diff --git a/libretroshare/src/pqi/p3notify.cc b/libretroshare/src/pqi/p3notify.cc index 43caf9758..2461d5f1c 100644 --- a/libretroshare/src/pqi/p3notify.cc +++ b/libretroshare/src/pqi/p3notify.cc @@ -231,7 +231,8 @@ void p3Notify::notifyChatLobbyTimeShift (int time_shift) void p3Notify::notifyCustomState (const std::string& peer_id , const std::string& status_string ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyCustomState (peer_id,status_string) ; } void p3Notify::notifyHashingInfo (uint32_t type , const std::string& fileinfo ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyHashingInfo (type,fileinfo) ; } void p3Notify::notifyTurtleSearchResult (uint32_t search_id , const std::list& files ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyTurtleSearchResult(search_id,files) ; } -void p3Notify::notifyPeerHasNewAvatar (std::string peer_id ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyPeerHasNewAvatar(peer_id) ; } +void p3Notify::notifyTurtleSearchResult (uint32_t search_id , const std::list& groups ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyTurtleSearchResult(search_id,groups) ; } +void p3Notify::notifyPeerHasNewAvatar (std::string peer_id ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyPeerHasNewAvatar(peer_id) ; } void p3Notify::notifyOwnAvatarChanged () { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyOwnAvatarChanged() ; } void p3Notify::notifyOwnStatusMessageChanged() { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyOwnStatusMessageChanged() ; } void p3Notify::notifyDiskFull (uint32_t location , uint32_t size_limit_in_MB ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyDiskFull (location,size_limit_in_MB) ; } diff --git a/libretroshare/src/pqi/p3notify.h b/libretroshare/src/pqi/p3notify.h index 820c4a6bb..22e1f143d 100644 --- a/libretroshare/src/pqi/p3notify.h +++ b/libretroshare/src/pqi/p3notify.h @@ -106,6 +106,7 @@ class p3Notify: public RsNotify void notifyCustomState (const std::string& /* peer_id */, const std::string& /* status_string */) ; void notifyHashingInfo (uint32_t /* type */, const std::string& /* fileinfo */) ; void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list& /* files */) ; + void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list& /* groups */) ; void notifyPeerHasNewAvatar (std::string /* peer_id */) ; void notifyOwnAvatarChanged () ; void notifyOwnStatusMessageChanged () ; diff --git a/libretroshare/src/retroshare/rsnotify.h b/libretroshare/src/retroshare/rsnotify.h index b73c577e9..6d9db3ef7 100644 --- a/libretroshare/src/retroshare/rsnotify.h +++ b/libretroshare/src/retroshare/rsnotify.h @@ -228,6 +228,7 @@ class NotifyClient virtual void notifyCustomState (const std::string& /* peer_id */, const std::string& /* status_string */) {} virtual void notifyHashingInfo (uint32_t /* type */, const std::string& /* fileinfo */) {} virtual void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list& /* files */) {} + virtual void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list& /* groups */) {} virtual void notifyPeerHasNewAvatar (std::string /* peer_id */) {} virtual void notifyOwnAvatarChanged () {} virtual void notifyOwnStatusMessageChanged () {} diff --git a/libretroshare/src/retroshare/rsturtle.h b/libretroshare/src/retroshare/rsturtle.h index 4609905bc..0467b452d 100644 --- a/libretroshare/src/retroshare/rsturtle.h +++ b/libretroshare/src/retroshare/rsturtle.h @@ -57,8 +57,9 @@ struct TurtleFileInfo struct TurtleGxsInfo { RsGxsGroupId group_id ; + uint16_t service_id ; std::string name ; - RsTlvBinaryData meta ; + //RsTlvBinaryData meta ;// is that actually needed? Not sure. Better if it's not. }; struct TurtleTunnelRequestDisplayInfo { diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index ca337f241..11cb8017a 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -71,7 +71,7 @@ void TS_dumpState() ; // an in-depth test would be better to get an idea of what the ideal values // could ever be. // -// update of 14-03-11: +// update of 14-03-11: // - I raised the cache time for tunnel requests. This avoids inconsistencies such as: // * tunnel requests bouncing back while the original request is not in the cache anymore // * special case of this for own file transfer: an outgoing tunnel is built with no end. @@ -155,13 +155,15 @@ void p3turtle::getItemNames(std::map& names) const { names.clear(); - names[RS_TURTLE_SUBTYPE_STRING_SEARCH_REQUEST ] = "Search request"; - names[RS_TURTLE_SUBTYPE_SEARCH_RESULT ] = "Search result"; + names[RS_TURTLE_SUBTYPE_STRING_SEARCH_REQUEST ] = "Filename substring search request"; + names[RS_TURTLE_SUBTYPE_GXS_SEARCH_REQUEST ] = "GXS search request"; + names[RS_TURTLE_SUBTYPE_FT_SEARCH_RESULT ] = "File search result"; + names[RS_TURTLE_SUBTYPE_GXS_SEARCH_RESULT ] = "GXS search result"; names[RS_TURTLE_SUBTYPE_OPEN_TUNNEL ] = "Tunnel request"; names[RS_TURTLE_SUBTYPE_TUNNEL_OK ] = "Tunnel response"; names[RS_TURTLE_SUBTYPE_FILE_REQUEST ] = "Data request"; names[RS_TURTLE_SUBTYPE_FILE_DATA ] = "Data chunk"; - names[RS_TURTLE_SUBTYPE_REGEXP_SEARCH_REQUEST ] = "RegExp search"; + names[RS_TURTLE_SUBTYPE_REGEXP_SEARCH_REQUEST ] = "Filename RegExp search request"; names[RS_TURTLE_SUBTYPE_GENERIC_DATA ] = "Generic data"; names[RS_TURTLE_SUBTYPE_FILE_MAP ] = "Chunk map"; names[RS_TURTLE_SUBTYPE_FILE_MAP_REQUEST ] = "Chunk map request"; @@ -169,7 +171,7 @@ void p3turtle::getItemNames(std::map& names) const names[RS_TURTLE_SUBTYPE_CHUNK_CRC_REQUEST ] = "Chunk CRC request"; } -void p3turtle::setEnabled(bool b) +void p3turtle::setEnabled(bool b) { RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ _turtle_routing_enabled = b; @@ -188,7 +190,7 @@ bool p3turtle::enabled() const } -void p3turtle::setSessionEnabled(bool b) +void p3turtle::setSessionEnabled(bool b) { RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ _turtle_routing_session_enabled = b; @@ -246,7 +248,7 @@ int p3turtle::tick() RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ _last_tunnel_management_time = now ; - // Update traffic statistics. The constants are important: they allow a smooth variation of the + // Update traffic statistics. The constants are important: they allow a smooth variation of the // traffic speed, which is used to moderate tunnel requests statistics. // _traffic_info = _traffic_info*0.9 + _traffic_info_buffer* (0.1 / (float)TIME_BETWEEN_TUNNEL_MANAGEMENT_CALLS) ; @@ -374,8 +376,8 @@ void p3turtle::manageTunnels() // - the hash hasn't been tunneled for more than REGULAR_TUNNEL_DIGGING_TIME seconds, even if downloading. // // Candidate hashes are sorted, by olderness. The older gets tunneled first. At most MAX_TUNNEL_REQS_PER_SECOND are - // treated at once, as this method is called every second. - // Note: Because REGULAR_TUNNEL_DIGGING_TIME is larger than EMPTY_TUNNELS_DIGGING_TIME, files being downloaded get + // treated at once, as this method is called every second. + // Note: Because REGULAR_TUNNEL_DIGGING_TIME is larger than EMPTY_TUNNELS_DIGGING_TIME, files being downloaded get // re-tunneled in priority. As this happens less, they don't obliterate tunneling for files that have no tunnels yet. std::vector > hashes_to_digg ; @@ -556,7 +558,7 @@ void p3turtle::autoWash() // Now remove all the virtual peers ids at the client services. Off mutex! // - + for(uint32_t i=0;i::iterator it(_incoming_file_hashes.find(hash)) ; @@ -663,7 +665,7 @@ void p3turtle::locked_closeTunnel(TurtleTunnelId tid,std::vector& load) RsConfigKeyValueSet *vitem = dynamic_cast(*it) ; if(vitem != NULL) - for(std::list::const_iterator kit = vitem->tlvkvs.pairs.begin(); kit != vitem->tlvkvs.pairs.end(); ++kit) + for(std::list::const_iterator kit = vitem->tlvkvs.pairs.begin(); kit != vitem->tlvkvs.pairs.end(); ++kit) { if(kit->key == "TURTLE_CONFIG_MAX_TR_RATE") { @@ -828,7 +830,7 @@ int p3turtle::handleIncoming() RsTurtleGenericTunnelItem *gti = dynamic_cast(item) ; if(gti != NULL) - routeGenericTunnelItem(gti) ; /// Generic packets, that travel through established tunnels. + routeGenericTunnelItem(gti) ; /// Generic packets, that travel through established tunnels. else /// These packets should be destroyed by the client. { /// Special packets that require specific treatment, because tunnels do not exist for these packets. @@ -840,7 +842,8 @@ int p3turtle::handleIncoming() case RS_TURTLE_SUBTYPE_REGEXP_SEARCH_REQUEST: handleSearchRequest(dynamic_cast(item)) ; break ; - case RS_TURTLE_SUBTYPE_SEARCH_RESULT : handleSearchResult(dynamic_cast(item)) ; + case RS_TURTLE_SUBTYPE_GXS_SEARCH_RESULT : + case RS_TURTLE_SUBTYPE_FT_SEARCH_RESULT : handleSearchResult(dynamic_cast(item)) ; break ; case RS_TURTLE_SUBTYPE_OPEN_TUNNEL : handleTunnelRequest(dynamic_cast(item)) ; @@ -867,7 +870,7 @@ int p3turtle::handleIncoming() void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) { RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ - + // take a look at the item and test against inconsistent values // - If the item destimation is @@ -875,7 +878,7 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) std::cerr << "Received search request from peer " << item->PeerId() << ": " << std::endl ; item->print(std::cerr,0) ; #endif - + uint32_t item_size = RsTurtleSerialiser().size(item); if(item_size > TURTLE_MAX_SEARCH_REQ_ACCEPTED_SERIAL_SIZE) @@ -886,7 +889,7 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) std::cerr << " Caught a turtle search item with arbitrary large size from " << item->PeerId() << " of size " << item_size << " and depth " << item->depth << ". This is not allowed => dropping." << std::endl; return ; } - + if(_search_requests_origins.size() > MAX_ALLOWED_SR_IN_CACHE) { #ifdef P3TURTLE_DEBUG @@ -924,49 +927,12 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) #ifdef P3TURTLE_DEBUG std::cerr << " Request not from us. Performing local search" << std::endl ; #endif + std::list search_results ; - std::list result ; + item->performLocalSearch(req,search_results) ; - item->performLocalSearch(result) ; - - RsTurtleSearchResultItem *res_item = NULL ; - uint32_t item_size = 0 ; - -#ifdef P3TURTLE_DEBUG - if(!result.empty()) - std::cerr << " " << result.size() << " matches found. Sending back to origin (" << item->PeerId() << ")." << std::endl ; -#endif - while(!result.empty() && req.result_count < TURTLE_SEARCH_RESULT_MAX_HITS) - { - // Let's chop search results items into several chunks of finite size to avoid exceeding streamer's capacity. - // - static const uint32_t RSTURTLE_MAX_SEARCH_RESPONSE_SIZE = 10000 ; - - if(res_item == NULL) - { - res_item = new RsTurtleSearchResultItem ; - item_size = 0 ; - - res_item->depth = 0 ; - res_item->request_id = item->request_id ; - res_item->PeerId(item->PeerId()) ; // send back to the same guy - } - res_item->result.push_back(result.front()) ; - - ++req.result_count ; // increase hit number for this particular search request. - - item_size += 8 /* size */ + result.front().hash.serial_size() + result.front().name.size() ; - result.pop_front() ; - - if(item_size > RSTURTLE_MAX_SEARCH_RESPONSE_SIZE || result.empty() || req.result_count >= TURTLE_SEARCH_RESULT_MAX_HITS) - { -#ifdef P3TURTLE_DEBUG - std::cerr << " Sending back chunk of size " << item_size << ", for " << res_item->result.size() << " elements." << std::endl ; -#endif - sendItem(res_item) ; - res_item = NULL ; - } - } + for(auto it(search_results.begin());it!=search_results.end();++it) + sendItem(*it) ; } // if enough has been sent back already, do not sarch further @@ -1011,14 +977,14 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) // Copy current item and modify it. RsTurtleSearchRequestItem *fwd_item = item->clone() ; - // increase search depth, except in some rare cases, to prevent correlation between + // increase search depth, except in some rare cases, to prevent correlation between // TR sniffing and friend names. The strategy is to not increase depth if the depth // is 1: // If B receives a TR of depth 1 from A, B cannot deduice that A is downloading the // file, since A might have shifted the depth. // if(!random_dshift) - ++(fwd_item->depth) ; + ++(fwd_item->depth) ; fwd_item->PeerId(*it) ; @@ -1055,7 +1021,7 @@ void p3turtle::handleSearchResult(RsTurtleSearchResultItem *item) if(it->second.origin == _own_id) { - it->second.result_count += item->result.size() ; + it->second.result_count += item->count() ; returnSearchResult(item) ; // Yes, so send upward. } else @@ -1065,7 +1031,7 @@ void p3turtle::handleSearchResult(RsTurtleSearchResultItem *item) #endif // We update the total count forwarded back, and chop it to TURTLE_SEARCH_RESULT_MAX_HITS. - uint32_t n = item->result.size(); // not so good! + uint32_t n = item->count(); // not so good! if(it->second.result_count >= TURTLE_SEARCH_RESULT_MAX_HITS) { @@ -1076,14 +1042,14 @@ void p3turtle::handleSearchResult(RsTurtleSearchResultItem *item) if(it->second.result_count + n > TURTLE_SEARCH_RESULT_MAX_HITS) { for(uint32_t i=it->second.result_count + n; i>TURTLE_SEARCH_RESULT_MAX_HITS;--i) - item->result.pop_back() ; + item->pop() ; it->second.result_count = TURTLE_SEARCH_RESULT_MAX_HITS ; } else it->second.result_count += n ; - RsTurtleSearchResultItem *fwd_item = new RsTurtleSearchResultItem(*item) ; // copy the item + RsTurtleSearchResultItem *fwd_item = item->duplicate(); // Normally here, we should setup the forward adress, so that the owner's // of the files found can be further reached by a tunnel. @@ -1154,8 +1120,8 @@ void p3turtle::routeGenericTunnelItem(RsTurtleGenericTunnelItem *item) // Let's figure out whether this packet is for us or not. - if(item->PeerId() == tunnel.local_dst && tunnel.local_src != _own_id) //direction == RsTurtleGenericTunnelItem::DIRECTION_CLIENT && - { + if(item->PeerId() == tunnel.local_dst && tunnel.local_src != _own_id) //direction == RsTurtleGenericTunnelItem::DIRECTION_CLIENT && + { #ifdef P3TURTLE_DEBUG std::cerr << " Forwarding generic item to peer " << tunnel.local_src << std::endl ; #endif @@ -1193,7 +1159,7 @@ void p3turtle::routeGenericTunnelItem(RsTurtleGenericTunnelItem *item) // The packet was not forwarded, so it is for us. Let's treat it. // This is done off-mutex, to avoid various deadlocks // - + handleRecvGenericTunnelItem(item) ; delete item ; @@ -1316,13 +1282,13 @@ void p3turtle::sendTurtleData(const RsPeerId& virtual_peer_id,RsTurtleGenericTun if(tunnel.local_src == _own_id) { - item->setTravelingDirection(RsTurtleGenericTunnelItem::DIRECTION_SERVER) ; + item->setTravelingDirection(RsTurtleGenericTunnelItem::DIRECTION_SERVER) ; item->PeerId(tunnel.local_dst) ; _traffic_info_buffer.data_dn_Bps += ss ; } else if(tunnel.local_dst == _own_id) { - item->setTravelingDirection(RsTurtleGenericTunnelItem::DIRECTION_CLIENT) ; + item->setTravelingDirection(RsTurtleGenericTunnelItem::DIRECTION_CLIENT) ; item->PeerId(tunnel.local_src) ; _traffic_info_buffer.data_up_Bps += ss ; } @@ -1460,7 +1426,7 @@ void p3turtle::handleTunnelRequest(RsTurtleOpenTunnelItem *item) RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ std::map::iterator it = _tunnel_requests_origins.find(item->request_id) ; - + if(it != _tunnel_requests_origins.end()) { #ifdef P3TURTLE_DEBUG @@ -1563,7 +1529,7 @@ void p3turtle::handleTunnelRequest(RsTurtleOpenTunnelItem *item) // - the tunnel id will now be unique for a given route // - allows a better balance of bandwidth for a given transfer // - avoid the waste of items that get lost when re-routing a tunnel - + #ifdef P3TURTLE_DEBUG std::cerr << "Perturbating partial tunnel id. Original=" << std::hex << item->partial_tunnel_id ; #endif @@ -1594,7 +1560,7 @@ void p3turtle::handleTunnelRequest(RsTurtleOpenTunnelItem *item) forward_probability = 1.0f / nb_online_ids ; // Setting forward_probability to 1/nb_online_ids forces at most one TR up per TR dn. But if we are overflooded by - // TR dn, we still need to control them to avoid flooding the pqiHandler outqueue. So we additionally moderate the + // TR dn, we still need to control them to avoid flooding the pqiHandler outqueue. So we additionally moderate the // forward probability so as to reduct the output rate accordingly. // if(_traffic_info.tr_dn_Bps / (float)TUNNEL_REQUEST_PACKET_SIZE > _max_tr_up_rate) @@ -1620,7 +1586,7 @@ void p3turtle::handleTunnelRequest(RsTurtleOpenTunnelItem *item) // Copy current item and modify it. RsTurtleOpenTunnelItem *fwd_item = new RsTurtleOpenTunnelItem(*item) ; - // increase search depth, except in some rare cases, to prevent correlation between + // increase search depth, except in some rare cases, to prevent correlation between // TR sniffing and friend names. The strategy is to not increase depth if the depth // is 1: // If B receives a TR of depth 1 from A, B cannot deduice that A is downloading the @@ -1777,7 +1743,61 @@ void p3turtle::handleTunnelResult(RsTurtleTunnelOkItem *item) // ------------------------------ IO with libretroshare ----------------------------// // -----------------------------------------------------------------------------------// // -void RsTurtleStringSearchRequestItem::performLocalSearch(std::list& result) const +void RsTurtleFileSearchRequestItem::performLocalSearch(TurtleSearchRequestInfo &req, std::list& result) const +{ +#ifdef P3TURTLE_DEBUG + std::cerr << "Performing rsFiles->search()" << std::endl ; +#endif + // now, search! + std::list initialResults ; + search(initialResults) ; + +#ifdef P3TURTLE_DEBUG + std::cerr << initialResults.size() << " matches found." << std::endl ; +#endif + result.clear() ; + RsTurtleFTSearchResultItem *res_item = NULL ; + uint32_t item_size = 0 ; + + static const uint32_t RSTURTLE_MAX_SEARCH_RESPONSE_SIZE = 10000 ; + + for(auto it(initialResults.begin());it!=initialResults.end();++it) + { + if(res_item == NULL) + { + res_item = new RsTurtleFTSearchResultItem ; + item_size = 0 ; + + res_item->depth = 0 ; + res_item->request_id = request_id ; + res_item->PeerId(PeerId()) ; // send back to the same guy + + result.push_back(res_item) ; + } + res_item->result.push_back(*it); + + // Let's chop search results items into several chunks of finite size to avoid exceeding streamer's capacity. + // + ++req.result_count ; // increase hit number for this particular search request. + + item_size += 8 /* size */ + it->hash.serial_size() + it->name.size() ; + + if(item_size > RSTURTLE_MAX_SEARCH_RESPONSE_SIZE || req.result_count >= TURTLE_SEARCH_RESULT_MAX_HITS) + { +#ifdef P3TURTLE_DEBUG + std::cerr << " Sending back chunk of size " << item_size << ", for " << res_item->result.size() << " elements." << std::endl ; +#endif + res_item = NULL ; // forces creation of a new item. + } + } +} + +void RsTurtleGxsSearchRequestItem::performLocalSearch(TurtleSearchRequestInfo &req, std::list& result) const +{ + std::cerr << "(EE) Missing code to perform actual GXS search" << std::endl; +} + +void RsTurtleStringSearchRequestItem::search(std::list& result) const { /* call to core */ std::list initialResults; @@ -1800,7 +1820,7 @@ void RsTurtleStringSearchRequestItem::performLocalSearch(std::list::const_iterator it(initialResults.begin());it!=initialResults.end();++it) { // retain only file type - if (it->type == DIR_TYPE_DIR) + if (it->type == DIR_TYPE_DIR) { #ifdef P3TURTLE_DEBUG std::cerr << " Skipping directory " << it->name << std::endl ; @@ -1816,7 +1836,7 @@ void RsTurtleStringSearchRequestItem::performLocalSearch(std::list& result) const +void RsTurtleRegExpSearchRequestItem::search(std::list& result) const { /* call to core */ std::list initialResults; @@ -1839,7 +1859,7 @@ void RsTurtleRegExpSearchRequestItem::performLocalSearch(std::list::const_iterator it(initialResults.begin());it!=initialResults.end();++it) { // retain only file type - if (it->type == DIR_TYPE_DIR) + if (it->type == DIR_TYPE_DIR) { #ifdef P3TURTLE_DEBUG std::cerr << " Skipping directory " << it->name << std::endl ; @@ -1953,13 +1973,25 @@ void p3turtle::monitorTunnels(const RsFileHash& hash,RsTurtleClientService *clie void p3turtle::returnSearchResult(RsTurtleSearchResultItem *item) { - // just cout for now, but it should be notified to the gui - #ifdef P3TURTLE_DEBUG std::cerr << " Returning result for search request " << HEX_PRINT(item->request_id) << " upwards." << std::endl ; #endif - RsServer::notify()->notifyTurtleSearchResult(item->request_id,item->result) ; + RsTurtleFTSearchResultItem *ft_sr = dynamic_cast(item) ; + + if(ft_sr != NULL) + { + RsServer::notify()->notifyTurtleSearchResult(ft_sr->request_id,ft_sr->result) ; + return ; + } + + RsTurtleGxsSearchResultItem *gxs_sr = dynamic_cast(item) ; + + if(gxs_sr != NULL) + { + RsServer::notify()->notifyTurtleSearchResult(gxs_sr->request_id,gxs_sr->result) ; + return ; + } } /// Warning: this function should never be called while the turtle mutex is locked. @@ -2072,7 +2104,7 @@ std::string p3turtle::getPeerNameForVirtualPeerId(const RsPeerId& virtual_peer_i std::map::const_iterator it(_virtual_peers.find(virtual_peer_id)) ; if(it != _virtual_peers.end()) { - std::map::iterator it2( _local_tunnels.find(it->second) ) ; + std::map::iterator it2( _local_tunnels.find(it->second) ) ; if(it2 != _local_tunnels.end()) { if(it2->second.local_src == _own_id) @@ -2103,7 +2135,7 @@ bool p3turtle::encryptData(const unsigned char *clear_data,uint32_t clear_data_s TURTLE_DEBUG() << " random nonce : " << RsUtil::BinToHex(initialization_vector,ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE) << std::endl; #endif - uint32_t item_serialized_size = clear_data_size;//RsGenericSerializer().size(clear_item) ; + uint32_t item_serialized_size = clear_data_size;//RsGenericSerializer().size(clear_item) ; uint32_t total_data_size = ENCRYPTED_TURTLE_HEADER_SIZE + ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_TURTLE_EDATA_SIZE + item_serialized_size + ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE ; #ifdef SERVER_DEBUG @@ -2124,7 +2156,7 @@ bool p3turtle::encryptData(const unsigned char *clear_data,uint32_t clear_data_s edata[0] = 0xae ; edata[1] = 0xad ; - edata[2] = ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_SHA256 ; // means AEAD_chacha20_sha256 + edata[2] = ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_SHA256 ; // means AEAD_chacha20_sha256 edata[3] = 0x01 ; offset += ENCRYPTED_TURTLE_HEADER_SIZE; @@ -2141,7 +2173,7 @@ bool p3turtle::encryptData(const unsigned char *clear_data,uint32_t clear_data_s offset += ENCRYPTED_TURTLE_EDATA_SIZE ; - memcpy(&edata[offset],clear_data,clear_data_size); + memcpy(&edata[offset],clear_data,clear_data_size); #ifdef SERVER_DEBUG TURTLE_DEBUG() << " clear item : " << RsUtil::BinToHex(&edata[offset],std::min(50,(int)total_data_size-(int)offset)) << "(...)" << std::endl; @@ -2291,12 +2323,12 @@ void p3turtle::getInfo( std::vector >& hashes_info, tunnel.push_back(printNumber(it->first,true)) ; std::string name; - if(mLinkMgr->getPeerName(it->second.local_src,name)) + if(mLinkMgr->getPeerName(it->second.local_src,name)) tunnel.push_back(name) ; else tunnel.push_back(it->second.local_src.toStdString()) ; - if(mLinkMgr->getPeerName(it->second.local_dst,name)) + if(mLinkMgr->getPeerName(it->second.local_dst,name)) tunnel.push_back(name) ; else tunnel.push_back(it->second.local_dst.toStdString()); diff --git a/libretroshare/src/turtle/rsturtleitem.cc b/libretroshare/src/turtle/rsturtleitem.cc index 35b250117..ca99b24d4 100644 --- a/libretroshare/src/turtle/rsturtleitem.cc +++ b/libretroshare/src/turtle/rsturtleitem.cc @@ -28,7 +28,9 @@ RsItem *RsTurtleSerialiser::create_item(uint16_t service,uint8_t item_subtype) c { case RS_TURTLE_SUBTYPE_STRING_SEARCH_REQUEST : return new RsTurtleStringSearchRequestItem(); case RS_TURTLE_SUBTYPE_REGEXP_SEARCH_REQUEST : return new RsTurtleRegExpSearchRequestItem(); - case RS_TURTLE_SUBTYPE_SEARCH_RESULT : return new RsTurtleSearchResultItem(); + case RS_TURTLE_SUBTYPE_GXS_SEARCH_REQUEST : return new RsTurtleGxsSearchRequestItem(); + case RS_TURTLE_SUBTYPE_FT_SEARCH_RESULT : return new RsTurtleFTSearchResultItem(); + case RS_TURTLE_SUBTYPE_GXS_SEARCH_RESULT : return new RsTurtleGxsSearchResultItem(); case RS_TURTLE_SUBTYPE_OPEN_TUNNEL : return new RsTurtleOpenTunnelItem(); case RS_TURTLE_SUBTYPE_TUNNEL_OK : return new RsTurtleTunnelOkItem(); case RS_TURTLE_SUBTYPE_GENERIC_DATA : return new RsTurtleGenericDataItem(); @@ -61,7 +63,13 @@ void RsTurtleRegExpSearchRequestItem::serial_process(RsGenericSerializer::Serial RsTypeSerializer::serial_process(j,ctx,depth,"depth") ; RsTypeSerializer::serial_process(j,ctx,expr,"expr") ; } - +void RsTurtleGxsSearchRequestItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) +{ + RsTypeSerializer::serial_process(j,ctx,request_id,"request_id") ; + RsTypeSerializer::serial_process(j,ctx,depth,"depth") ; + RsTypeSerializer::serial_process(j,ctx,service_id,"service_id") ; + RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_VALUE,match_string,"match_string") ; +} template<> uint32_t RsTypeSerializer::serial_size(const RsRegularExpression::LinearizedExpression& r) { uint32_t s = 0 ; @@ -140,13 +148,18 @@ template<> void RsTypeSerializer::print_data(const std::string& n, const RsRegul std::cerr << " [RegExpr ] " << n << ", tokens=" << expr._tokens.size() << " ints=" << expr._ints.size() << " strings=" << expr._strings.size() << std::endl; } -void RsTurtleSearchResultItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) +void RsTurtleFTSearchResultItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) +{ + RsTypeSerializer::serial_process(j,ctx,request_id,"request_id") ; + RsTypeSerializer::serial_process(j,ctx,depth ,"depth") ; + RsTypeSerializer::serial_process (j,ctx,result ,"result") ; +} +void RsTurtleGxsSearchResultItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) { RsTypeSerializer::serial_process(j,ctx,request_id,"request_id") ; RsTypeSerializer::serial_process(j,ctx,depth ,"depth") ; RsTypeSerializer::serial_process (j,ctx,result ,"result") ; } - template<> uint32_t RsTypeSerializer::serial_size(const TurtleFileInfo& i) { uint32_t s = 0 ; @@ -193,6 +206,52 @@ template<> void RsTypeSerializer::print_data(const std::string& n, const TurtleF std::cerr << " [FileInfo ] " << n << " size=" << i.size << " hash=" << i.hash << ", name=" << i.name << std::endl; } +template<> uint32_t RsTypeSerializer::serial_size(const TurtleGxsInfo& i) +{ + uint32_t s = 0 ; + + s += 2 ; // service_id + s += i.group_id.SIZE_IN_BYTES ; + s += GetTlvStringSize(i.name) ; + + return s; +} + +template<> bool RsTypeSerializer::deserialize(const uint8_t data[],uint32_t size,uint32_t& offset,TurtleGxsInfo& i) +{ + uint32_t saved_offset = offset ; + bool ok = true ; + + ok &= getRawUInt16(data, size, &offset, &i.service_id); // service_id + ok &= i.group_id.deserialise(data, size, offset); // group_id + ok &= GetTlvString(data, size, &offset, TLV_TYPE_STR_NAME, i.name); // group name + + if(!ok) + offset = saved_offset ; + + return ok; +} + +template<> bool RsTypeSerializer::serialize(uint8_t data[],uint32_t size,uint32_t& offset,const TurtleGxsInfo& i) +{ + uint32_t saved_offset = offset ; + bool ok = true ; + + ok &= setRawUInt16(data, size, &offset, i.service_id); // service_id + ok &= i.group_id.serialise(data, size, offset); // group_id + ok &= SetTlvString(data, size, &offset, TLV_TYPE_STR_NAME, i.name); // group name + + if(!ok) + offset = saved_offset ; + + return ok; +} + +template<> void RsTypeSerializer::print_data(const std::string& n, const TurtleGxsInfo& i) +{ + std::cerr << " [GXS Info ] " << n << " group_id=" << i.group_id << " service=" << std::hex << i.service_id << std::dec << ", name=" << i.name << std::endl; +} + void RsTurtleOpenTunnelItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) { RsTypeSerializer::serial_process (j,ctx,file_hash ,"file_hash") ; diff --git a/libretroshare/src/turtle/rsturtleitem.h b/libretroshare/src/turtle/rsturtleitem.h index 1eded28dd..1353a77c5 100644 --- a/libretroshare/src/turtle/rsturtleitem.h +++ b/libretroshare/src/turtle/rsturtleitem.h @@ -23,6 +23,7 @@ const uint8_t RS_TURTLE_SUBTYPE_FILE_REQUEST = 0x07 ; const uint8_t RS_TURTLE_SUBTYPE_FILE_DATA = 0x08 ; const uint8_t RS_TURTLE_SUBTYPE_REGEXP_SEARCH_REQUEST = 0x09 ; const uint8_t RS_TURTLE_SUBTYPE_GENERIC_DATA = 0x0a ; +const uint8_t RS_TURTLE_SUBTYPE_GXS_SEARCH_REQUEST = 0x0b ; const uint8_t RS_TURTLE_SUBTYPE_FILE_MAP = 0x10 ; const uint8_t RS_TURTLE_SUBTYPE_FILE_MAP_REQUEST = 0x11 ; const uint8_t RS_TURTLE_SUBTYPE_CHUNK_CRC = 0x14 ; @@ -32,6 +33,8 @@ const uint8_t RS_TURTLE_SUBTYPE_GXS_SEARCH_RESULT = 0x16 ; // const uint8_t RS_TURTLE_SUBTYPE_FILE_CRC = 0x12 ; // unused // const uint8_t RS_TURTLE_SUBTYPE_FILE_CRC_REQUEST = 0x13 ; +class TurtleSearchRequestInfo ; + /***********************************************************************************/ /* Basic Turtle Item Class */ /***********************************************************************************/ @@ -47,92 +50,81 @@ class RsTurtleItem: public RsItem /* Specific packets */ /***********************************************************************************/ -class RsTurtleSearchResultItem: public RsTurtleItem -{ - public: - RsTurtleSearchResultItem(uint8_t subtype) : RsTurtleItem(subtype), request_id(0), depth(0) { setPriorityLevel(QOS_PRIORITY_RS_TURTLE_SEARCH_RESULT) ;} +// Class hierarchy is +// +// RsTurtleItem +// | +// +---- RsTurtleSearchRequestItem +// | | +// | +---- RsTurtleFileSearchRequestItem +// | | | +// | | +---- RsTurtleFileSearchRequestItem +// | | | +// | | +---- RsTurtleStringSearchRequestItem +// | | | +// | | +---- RsTurtleReqExpSearchRequestItem +// | | +// | +---- RsTurtleGxsSearchRequestItem +// | +// +---- RsTurtleSearchResultItem +// | +// +---- RsTurtleFTSearchResultItem +// | +// +---- RsTurtleGxsSearchResultItem +// - TurtleSearchRequestId request_id ; // Randomly generated request id. - - uint16_t depth ; // The depth of a search result is obfuscated in this way: - // If the actual depth is 1, this field will be 1. - // If the actual depth is > 1, this field is a larger arbitrary integer. - - virtual void clear() =0; - virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx)=0; - protected: -}; - -class RsTurtleFTSearchResultItem: public RsTurtleSearchResultItem -{ - public: - RsTurtleFTSearchResultItem() : RsTurtleSearchResultItem(RS_TURTLE_SUBTYPE_FT_SEARCH_RESULT){} - - TurtleSearchRequestId request_id ; // Randomly generated request id. - - uint16_t depth ; // The depth of a search result is obfuscated in this way: - // If the actual depth is 1, this field will be 1. - // If the actual depth is > 1, this field is a larger arbitrary integer. - std::list result ; - - void clear() { result.clear() ; } - protected: - void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); -}; - -class RsTurtleGxsSearchResultItem: public RsTurtleSearchResultItem -{ - public: - RsTurtleGxsSearchResultItem() : RsTurtleSearchResultItem(RS_TURTLE_SUBTYPE_GXS_SEARCH_RESULT){} - - TurtleSearchRequestId request_id ; // Randomly generated request id. - - uint16_t depth ; // The depth of a search result is obfuscated in this way: - // If the actual depth is 1, this field will be 1. - // If the actual depth is > 1, this field is a larger arbitrary integer. - std::list result ; - - void clear() { result.clear() ; } - protected: - void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); -}; +class RsTurtleSearchResultItem ; class RsTurtleSearchRequestItem: public RsTurtleItem { public: RsTurtleSearchRequestItem(uint32_t subtype) : RsTurtleItem(subtype), request_id(0), depth(0) { setPriorityLevel(QOS_PRIORITY_RS_TURTLE_SEARCH_REQUEST) ;} + virtual ~RsTurtleSearchRequestItem() {} + virtual RsTurtleSearchRequestItem *clone() const = 0 ; // used for cloning in routing methods - virtual void performLocalSearch(std::list&) const = 0 ; // abstracts the search method - + virtual void performLocalSearch(TurtleSearchRequestInfo& req,std::list&) const = 0 ; // abstracts the search method + virtual std::string GetKeywords() = 0; - + uint32_t request_id ; // randomly generated request id. uint16_t depth ; // Used for limiting search depth. }; -class RsTurtleStringSearchRequestItem: public RsTurtleSearchRequestItem +class RsTurtleFileSearchRequestItem: public RsTurtleSearchRequestItem { public: - RsTurtleStringSearchRequestItem() : RsTurtleSearchRequestItem(RS_TURTLE_SUBTYPE_STRING_SEARCH_REQUEST) {} - + RsTurtleFileSearchRequestItem(uint32_t subtype) : RsTurtleSearchRequestItem(subtype) {} + virtual ~RsTurtleFileSearchRequestItem() {} + + virtual void performLocalSearch(TurtleSearchRequestInfo& req,std::list&) const ; // abstracts the search method + virtual void search(std::list &) const =0; +}; + +class RsTurtleStringSearchRequestItem: public RsTurtleFileSearchRequestItem +{ + public: + RsTurtleStringSearchRequestItem() : RsTurtleFileSearchRequestItem(RS_TURTLE_SUBTYPE_STRING_SEARCH_REQUEST) {} + virtual ~RsTurtleStringSearchRequestItem() {} + std::string match_string ; // string to match - + std::string GetKeywords() { return match_string; } - + virtual RsTurtleSearchRequestItem *clone() const { return new RsTurtleStringSearchRequestItem(*this) ; } - virtual void performLocalSearch(std::list&) const ; void clear() { match_string.clear() ; } protected: + virtual void search(std::list &) const ; void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); }; -class RsTurtleRegExpSearchRequestItem: public RsTurtleSearchRequestItem +class RsTurtleRegExpSearchRequestItem: public RsTurtleFileSearchRequestItem { public: - RsTurtleRegExpSearchRequestItem() : RsTurtleSearchRequestItem(RS_TURTLE_SUBTYPE_REGEXP_SEARCH_REQUEST) {} + RsTurtleRegExpSearchRequestItem() : RsTurtleFileSearchRequestItem(RS_TURTLE_SUBTYPE_REGEXP_SEARCH_REQUEST) {} + virtual ~RsTurtleRegExpSearchRequestItem() {} RsRegularExpression::LinearizedExpression expr ; // Reg Exp in linearised mode @@ -143,15 +135,84 @@ class RsTurtleRegExpSearchRequestItem: public RsTurtleSearchRequestItem delete ex; return exs; } - - virtual RsTurtleSearchRequestItem *clone() const { return new RsTurtleRegExpSearchRequestItem(*this) ; } - virtual void performLocalSearch(std::list&) const ; + virtual RsTurtleSearchRequestItem *clone() const { return new RsTurtleRegExpSearchRequestItem(*this) ; } void clear() { expr = RsRegularExpression::LinearizedExpression(); } + protected: + virtual void search(std::list &) const ; + void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); +}; + +class RsTurtleGxsSearchRequestItem: public RsTurtleSearchRequestItem +{ + public: + RsTurtleGxsSearchRequestItem() : RsTurtleSearchRequestItem(RS_TURTLE_SUBTYPE_GXS_SEARCH_REQUEST) {} + virtual ~RsTurtleGxsSearchRequestItem() {} + + virtual void performLocalSearch(TurtleSearchRequestInfo& req,std::list&) const ; // abstracts the search method + + std::string match_string ; // string to match + uint16_t service_id ; // searvice to search + + std::string GetKeywords() { return match_string; } + + virtual RsTurtleSearchRequestItem *clone() const { return new RsTurtleGxsSearchRequestItem(*this) ; } + + void clear() { match_string.clear() ; } + protected: void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); }; +class RsTurtleSearchResultItem: public RsTurtleItem +{ + public: + RsTurtleSearchResultItem(uint8_t subtype) : RsTurtleItem(subtype), request_id(0), depth(0) { setPriorityLevel(QOS_PRIORITY_RS_TURTLE_SEARCH_RESULT) ;} + + TurtleSearchRequestId request_id ; // Randomly generated request id. + uint16_t depth ; // The depth of a search result is obfuscated in this way: + // If the actual depth is 1, this field will be 1. + // If the actual depth is > 1, this field is a larger arbitrary integer. + + virtual void clear() =0; + virtual uint32_t count() const =0; + virtual void pop() =0; + + virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx)=0; + virtual RsTurtleSearchResultItem *duplicate() const =0; +}; + +class RsTurtleFTSearchResultItem: public RsTurtleSearchResultItem +{ + public: + RsTurtleFTSearchResultItem() : RsTurtleSearchResultItem(RS_TURTLE_SUBTYPE_FT_SEARCH_RESULT){} + + std::list result ; + + void clear() { result.clear() ; } + uint32_t count() const { return result.size() ; } + virtual void pop() { result.pop_back() ;} + virtual RsTurtleSearchResultItem *duplicate() const { return new RsTurtleFTSearchResultItem(*this) ; } + protected: + void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); +}; + +class RsTurtleGxsSearchResultItem: public RsTurtleSearchResultItem +{ + public: + RsTurtleGxsSearchResultItem() : RsTurtleSearchResultItem(RS_TURTLE_SUBTYPE_GXS_SEARCH_RESULT){} + + std::list result ; + + void clear() { result.clear() ; } + uint32_t count() const { return result.size() ; } + virtual void pop() { result.pop_back() ;} + virtual RsTurtleSearchResultItem *duplicate() const { return new RsTurtleGxsSearchResultItem(*this) ; } + protected: + void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); +}; + + /***********************************************************************************/ /* Turtle Tunnel Item classes */ /***********************************************************************************/ @@ -200,24 +261,24 @@ class RsTurtleGenericTunnelItem: public RsTurtleItem /// Does this packet stamps tunnels when it passes through ? /// This is used for keeping trace weither tunnels are active or not. - + virtual bool shouldStampTunnel() const = 0 ; - /// All tunnels derived from RsTurtleGenericTunnelItem should have a tunnel id to + /// All tunnels derived from RsTurtleGenericTunnelItem should have a tunnel id to /// indicate which tunnel they are travelling through. - + virtual TurtleTunnelId tunnelId() const { return tunnel_id ; } /// Indicate weither the packet is a client packet (goign back to the /// client) or a server packet (going to the server. Typically file /// requests are server packets, whereas file data are client packets. - + virtual Direction travelingDirection() const { return direction ; } virtual void setTravelingDirection(Direction d) { direction = d; } Direction direction ; // This does not need to be serialised. It's only used by the client services, optionnally, // and is set by the turtle router according to which direction the item travels. - + uint32_t tunnel_id ; // Id of the tunnel to travel through }; diff --git a/retroshare-gui/src/gui/notifyqt.cpp b/retroshare-gui/src/gui/notifyqt.cpp index 3810fefc3..da8dac48d 100644 --- a/retroshare-gui/src/gui/notifyqt.cpp +++ b/retroshare-gui/src/gui/notifyqt.cpp @@ -563,6 +563,11 @@ void NotifyQt::notifyChatCleared(const ChatId& chat_id) emit chatCleared(chat_id); } +void NotifyQt::notifyTurtleSearchResult(uint32_t search_id,const std::list& found_groups) +{ + std::cerr << "(EE) missing code to handle GXS turtle search result." << std::endl; +} + void NotifyQt::notifyTurtleSearchResult(uint32_t search_id,const std::list& files) { { diff --git a/retroshare-gui/src/gui/notifyqt.h b/retroshare-gui/src/gui/notifyqt.h index b179d9999..597231703 100644 --- a/retroshare-gui/src/gui/notifyqt.h +++ b/retroshare-gui/src/gui/notifyqt.h @@ -47,6 +47,7 @@ class NotifyQt: public QObject, public NotifyClient virtual void notifyCustomState(const std::string& peer_id, const std::string& status_string); virtual void notifyHashingInfo(uint32_t type, const std::string& fileinfo); virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list& found_files); + virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list& found_groups); virtual void notifyPeerHasNewAvatar(std::string peer_id) ; virtual void notifyOwnAvatarChanged() ; virtual void notifyChatLobbyEvent(uint64_t /* lobby id */, uint32_t /* event type */, const RsGxsId & /*nickname*/, const std::string& /* any string */) ; From b5c1b8210be58db6a4416599fccc9dcab54ca453 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 2 Jun 2018 18:12:27 +0200 Subject: [PATCH 071/138] added classes for both group data and group summary results in turtle search --- libretroshare/src/turtle/p3turtle.cc | 28 +++++++++--- libretroshare/src/turtle/rsturtleitem.cc | 24 +++++++++-- libretroshare/src/turtle/rsturtleitem.h | 54 +++++++++++++++++++++--- 3 files changed, 89 insertions(+), 17 deletions(-) diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 11cb8017a..5208b32d8 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -158,7 +158,8 @@ void p3turtle::getItemNames(std::map& names) const names[RS_TURTLE_SUBTYPE_STRING_SEARCH_REQUEST ] = "Filename substring search request"; names[RS_TURTLE_SUBTYPE_GXS_SEARCH_REQUEST ] = "GXS search request"; names[RS_TURTLE_SUBTYPE_FT_SEARCH_RESULT ] = "File search result"; - names[RS_TURTLE_SUBTYPE_GXS_SEARCH_RESULT ] = "GXS search result"; + names[RS_TURTLE_SUBTYPE_GXS_GROUP_SUMMARY ] = "GXS group summary"; + names[RS_TURTLE_SUBTYPE_GXS_GROUP_DATA ] = "GXS group data"; names[RS_TURTLE_SUBTYPE_OPEN_TUNNEL ] = "Tunnel request"; names[RS_TURTLE_SUBTYPE_TUNNEL_OK ] = "Tunnel response"; names[RS_TURTLE_SUBTYPE_FILE_REQUEST ] = "Data request"; @@ -842,7 +843,8 @@ int p3turtle::handleIncoming() case RS_TURTLE_SUBTYPE_REGEXP_SEARCH_REQUEST: handleSearchRequest(dynamic_cast(item)) ; break ; - case RS_TURTLE_SUBTYPE_GXS_SEARCH_RESULT : + case RS_TURTLE_SUBTYPE_GXS_GROUP_DATA : + case RS_TURTLE_SUBTYPE_GXS_GROUP_SUMMARY : case RS_TURTLE_SUBTYPE_FT_SEARCH_RESULT : handleSearchResult(dynamic_cast(item)) ; break ; @@ -1794,9 +1796,15 @@ void RsTurtleFileSearchRequestItem::performLocalSearch(TurtleSearchRequestInfo & void RsTurtleGxsSearchRequestItem::performLocalSearch(TurtleSearchRequestInfo &req, std::list& result) const { - std::cerr << "(EE) Missing code to perform actual GXS search" << std::endl; + std::cerr << "(EE) p3turtle: Missing code to perform actual GXS search" << std::endl; } +void RsTurtleGxsGroupRequestItem::performLocalSearch(TurtleSearchRequestInfo &req, std::list& result) const +{ + std::cerr << "(EE) p3turtle: Missing code to perform actual retrieval of GXS group" << std::endl; +} + + void RsTurtleStringSearchRequestItem::search(std::list& result) const { /* call to core */ @@ -1985,11 +1993,19 @@ void p3turtle::returnSearchResult(RsTurtleSearchResultItem *item) return ; } - RsTurtleGxsSearchResultItem *gxs_sr = dynamic_cast(item) ; + RsTurtleGxsSearchResultGroupSummaryItem *gxs_sr_gs = dynamic_cast(item) ; - if(gxs_sr != NULL) + if(gxs_sr_gs != NULL) { - RsServer::notify()->notifyTurtleSearchResult(gxs_sr->request_id,gxs_sr->result) ; + RsServer::notify()->notifyTurtleSearchResult(gxs_sr_gs->request_id,gxs_sr_gs->result) ; + return ; + } + RsTurtleGxsSearchResultGroupDataItem *gxs_sr_gd = dynamic_cast(item) ; + + if(gxs_sr_gd != NULL) + { +#warning MISSING CODE HERE TO HANDLE ENCRYPTED INCOMING GROUP DATA. + //RsServer::notify()->notifyTurtleSearchResult(gxs_sr_gd->request_id,gxs_sr_gd->encrypted_nxs_group) ; return ; } } diff --git a/libretroshare/src/turtle/rsturtleitem.cc b/libretroshare/src/turtle/rsturtleitem.cc index ca99b24d4..175996575 100644 --- a/libretroshare/src/turtle/rsturtleitem.cc +++ b/libretroshare/src/turtle/rsturtleitem.cc @@ -28,13 +28,16 @@ RsItem *RsTurtleSerialiser::create_item(uint16_t service,uint8_t item_subtype) c { case RS_TURTLE_SUBTYPE_STRING_SEARCH_REQUEST : return new RsTurtleStringSearchRequestItem(); case RS_TURTLE_SUBTYPE_REGEXP_SEARCH_REQUEST : return new RsTurtleRegExpSearchRequestItem(); - case RS_TURTLE_SUBTYPE_GXS_SEARCH_REQUEST : return new RsTurtleGxsSearchRequestItem(); case RS_TURTLE_SUBTYPE_FT_SEARCH_RESULT : return new RsTurtleFTSearchResultItem(); - case RS_TURTLE_SUBTYPE_GXS_SEARCH_RESULT : return new RsTurtleGxsSearchResultItem(); case RS_TURTLE_SUBTYPE_OPEN_TUNNEL : return new RsTurtleOpenTunnelItem(); case RS_TURTLE_SUBTYPE_TUNNEL_OK : return new RsTurtleTunnelOkItem(); case RS_TURTLE_SUBTYPE_GENERIC_DATA : return new RsTurtleGenericDataItem(); + case RS_TURTLE_SUBTYPE_GXS_SEARCH_REQUEST : return new RsTurtleGxsSearchRequestItem(); + case RS_TURTLE_SUBTYPE_GXS_GROUP_REQUEST : return new RsTurtleGxsGroupRequestItem(); + case RS_TURTLE_SUBTYPE_GXS_GROUP_SUMMARY : return new RsTurtleGxsSearchResultGroupSummaryItem(); + case RS_TURTLE_SUBTYPE_GXS_GROUP_DATA : return new RsTurtleGxsSearchResultGroupDataItem(); + default: break ; } @@ -56,7 +59,6 @@ void RsTurtleStringSearchRequestItem::serial_process(RsGenericSerializer::Serial RsTypeSerializer::serial_process(j,ctx,request_id,"request_id") ; RsTypeSerializer::serial_process(j,ctx,depth ,"depth") ; } - void RsTurtleRegExpSearchRequestItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) { RsTypeSerializer::serial_process(j,ctx,request_id,"request_id") ; @@ -70,6 +72,14 @@ void RsTurtleGxsSearchRequestItem::serial_process(RsGenericSerializer::Serialize RsTypeSerializer::serial_process(j,ctx,service_id,"service_id") ; RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_VALUE,match_string,"match_string") ; } +void RsTurtleGxsGroupRequestItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) +{ + RsTypeSerializer::serial_process(j,ctx,request_id,"request_id") ; + RsTypeSerializer::serial_process(j,ctx,depth,"depth") ; + RsTypeSerializer::serial_process(j,ctx,service_id,"service_id") ; + RsTypeSerializer::serial_process(j,ctx,hashed_group_id,"hashed_group_id") ; +} + template<> uint32_t RsTypeSerializer::serial_size(const RsRegularExpression::LinearizedExpression& r) { uint32_t s = 0 ; @@ -154,12 +164,18 @@ void RsTurtleFTSearchResultItem::serial_process(RsGenericSerializer::SerializeJo RsTypeSerializer::serial_process(j,ctx,depth ,"depth") ; RsTypeSerializer::serial_process (j,ctx,result ,"result") ; } -void RsTurtleGxsSearchResultItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) +void RsTurtleGxsSearchResultGroupSummaryItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) { RsTypeSerializer::serial_process(j,ctx,request_id,"request_id") ; RsTypeSerializer::serial_process(j,ctx,depth ,"depth") ; RsTypeSerializer::serial_process (j,ctx,result ,"result") ; } +void RsTurtleGxsSearchResultGroupDataItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) +{ + RsTypeSerializer::serial_process (j,ctx,request_id,"request_id") ; + RsTypeSerializer::serial_process (j,ctx,depth ,"depth") ; + RsTypeSerializer::serial_process(j,ctx,encrypted_nxs_group,"encrypted_nxs_group") ; +} template<> uint32_t RsTypeSerializer::serial_size(const TurtleFileInfo& i) { uint32_t s = 0 ; diff --git a/libretroshare/src/turtle/rsturtleitem.h b/libretroshare/src/turtle/rsturtleitem.h index 1353a77c5..885ab04de 100644 --- a/libretroshare/src/turtle/rsturtleitem.h +++ b/libretroshare/src/turtle/rsturtleitem.h @@ -24,11 +24,13 @@ const uint8_t RS_TURTLE_SUBTYPE_FILE_DATA = 0x08 ; const uint8_t RS_TURTLE_SUBTYPE_REGEXP_SEARCH_REQUEST = 0x09 ; const uint8_t RS_TURTLE_SUBTYPE_GENERIC_DATA = 0x0a ; const uint8_t RS_TURTLE_SUBTYPE_GXS_SEARCH_REQUEST = 0x0b ; +const uint8_t RS_TURTLE_SUBTYPE_GXS_GROUP_REQUEST = 0x0c ; const uint8_t RS_TURTLE_SUBTYPE_FILE_MAP = 0x10 ; const uint8_t RS_TURTLE_SUBTYPE_FILE_MAP_REQUEST = 0x11 ; const uint8_t RS_TURTLE_SUBTYPE_CHUNK_CRC = 0x14 ; const uint8_t RS_TURTLE_SUBTYPE_CHUNK_CRC_REQUEST = 0x15 ; -const uint8_t RS_TURTLE_SUBTYPE_GXS_SEARCH_RESULT = 0x16 ; +const uint8_t RS_TURTLE_SUBTYPE_GXS_GROUP_SUMMARY = 0x16 ; +const uint8_t RS_TURTLE_SUBTYPE_GXS_GROUP_DATA = 0x17 ; // const uint8_t RS_TURTLE_SUBTYPE_FILE_CRC = 0x12 ; // unused // const uint8_t RS_TURTLE_SUBTYPE_FILE_CRC_REQUEST = 0x13 ; @@ -65,12 +67,18 @@ class RsTurtleItem: public RsItem // | | +---- RsTurtleReqExpSearchRequestItem // | | // | +---- RsTurtleGxsSearchRequestItem +// | | +// | +---- RsTurtleGxsGroupRequestItem // | // +---- RsTurtleSearchResultItem // | // +---- RsTurtleFTSearchResultItem // | // +---- RsTurtleGxsSearchResultItem +// | +// +---- RsTurtleGxsSearchResultGroupSummaryItem +// | +// +---- RsTurtleGxsSearchResultGroupDataItem // class RsTurtleSearchResultItem ; @@ -149,21 +157,38 @@ class RsTurtleGxsSearchRequestItem: public RsTurtleSearchRequestItem RsTurtleGxsSearchRequestItem() : RsTurtleSearchRequestItem(RS_TURTLE_SUBTYPE_GXS_SEARCH_REQUEST) {} virtual ~RsTurtleGxsSearchRequestItem() {} - virtual void performLocalSearch(TurtleSearchRequestInfo& req,std::list&) const ; // abstracts the search method - std::string match_string ; // string to match uint16_t service_id ; // searvice to search std::string GetKeywords() { return match_string; } + virtual void performLocalSearch(TurtleSearchRequestInfo& req,std::list&) const ; // abstracts the search method virtual RsTurtleSearchRequestItem *clone() const { return new RsTurtleGxsSearchRequestItem(*this) ; } - void clear() { match_string.clear() ; } protected: void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); }; +class RsTurtleGxsGroupRequestItem: public RsTurtleSearchRequestItem +{ + public: + RsTurtleGxsGroupRequestItem() : RsTurtleSearchRequestItem(RS_TURTLE_SUBTYPE_GXS_GROUP_REQUEST) {} + virtual ~RsTurtleGxsGroupRequestItem() {} + + uint16_t service_id ; // searvice to search + Sha1CheckSum hashed_group_id ; // the group ID is hashed in order to keep it private. + + virtual RsTurtleSearchRequestItem *clone() const { return new RsTurtleGxsGroupRequestItem(*this) ; } + + virtual void performLocalSearch(TurtleSearchRequestInfo& req,std::list&) const ; // abstracts the search method + void clear() { hashed_group_id.clear() ; } + std::string GetKeywords() { return hashed_group_id.toStdString(); } + + protected: + void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); +}; + class RsTurtleSearchResultItem: public RsTurtleItem { public: @@ -197,21 +222,36 @@ class RsTurtleFTSearchResultItem: public RsTurtleSearchResultItem void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); }; -class RsTurtleGxsSearchResultItem: public RsTurtleSearchResultItem +class RsTurtleGxsSearchResultGroupSummaryItem: public RsTurtleSearchResultItem { public: - RsTurtleGxsSearchResultItem() : RsTurtleSearchResultItem(RS_TURTLE_SUBTYPE_GXS_SEARCH_RESULT){} + RsTurtleGxsSearchResultGroupSummaryItem() : RsTurtleSearchResultItem(RS_TURTLE_SUBTYPE_GXS_GROUP_SUMMARY){} + virtual ~RsTurtleGxsSearchResultGroupSummaryItem() {} std::list result ; void clear() { result.clear() ; } uint32_t count() const { return result.size() ; } virtual void pop() { result.pop_back() ;} - virtual RsTurtleSearchResultItem *duplicate() const { return new RsTurtleGxsSearchResultItem(*this) ; } + virtual RsTurtleSearchResultItem *duplicate() const { return new RsTurtleGxsSearchResultGroupSummaryItem(*this) ; } protected: void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); }; +class RsTurtleGxsSearchResultGroupDataItem: public RsTurtleSearchResultItem +{ + public: + RsTurtleGxsSearchResultGroupDataItem() : RsTurtleSearchResultItem(RS_TURTLE_SUBTYPE_GXS_GROUP_DATA){} + virtual ~RsTurtleGxsSearchResultGroupDataItem() {} + RsTlvBinaryData encrypted_nxs_group; // data is encrypted with group ID. + + uint32_t count() const { return 1 ; } + virtual void pop() { clear(); } + void clear() { encrypted_nxs_group.TlvClear() ; } + virtual RsTurtleSearchResultItem *duplicate() const { return new RsTurtleGxsSearchResultGroupDataItem(*this) ; } + protected: + void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); +}; /***********************************************************************************/ /* Turtle Tunnel Item classes */ From 9a64f80182f8c03fe65586f4bc098f65decdd268 Mon Sep 17 00:00:00 2001 From: sehraf Date: Sun, 3 Jun 2018 17:11:11 +0200 Subject: [PATCH 072/138] handle backspace when entering password --- retroshare-nogui/src/TerminalApiClient.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/retroshare-nogui/src/TerminalApiClient.cpp b/retroshare-nogui/src/TerminalApiClient.cpp index f4ffa4af1..b90ed7dbc 100644 --- a/retroshare-nogui/src/TerminalApiClient.cpp +++ b/retroshare-nogui/src/TerminalApiClient.cpp @@ -103,6 +103,15 @@ static std::string readStringFromKeyboard(bool passwd_mode) while((c=getchar()) != '\n') { + // handle backspace + if (c == 127) { + if(s.length()!=0) { + std::cout << "\b \b"; + s.resize(s.length()-1); + } + continue; + } + if(passwd_mode) putchar('*') ; else From 7caf06b57d69e834f234909d75ff8cef8d761b3b Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 6 Jun 2018 23:15:29 +0200 Subject: [PATCH 073/138] added structures for generic turtle search and access functions in Gxs objects --- libresapi/src/api/FileSearchHandler.cpp | 4 +- libretroshare/src/ft/ftserver.cc | 43 +++- libretroshare/src/ft/ftserver.h | 8 +- libretroshare/src/grouter/p3grouter.cc | 7 +- libretroshare/src/grouter/p3grouter.h | 2 +- libretroshare/src/gxs/rsgenexchange.cc | 8 + libretroshare/src/gxs/rsgenexchange.h | 9 + libretroshare/src/gxs/rsgxsnetservice.cc | 9 + libretroshare/src/gxs/rsgxsnetservice.h | 2 + libretroshare/src/gxs/rsgxsnettunnel.cc | 24 ++- libretroshare/src/gxs/rsgxsnettunnel.h | 22 +- libretroshare/src/gxs/rsnxs.h | 2 + libretroshare/src/gxstunnel/p3gxstunnel.cc | 4 +- libretroshare/src/gxstunnel/p3gxstunnel.h | 2 +- libretroshare/src/pqi/p3notify.cc | 3 +- libretroshare/src/pqi/p3notify.h | 3 +- libretroshare/src/retroshare/rsfiles.h | 3 + libretroshare/src/retroshare/rsgxschannels.h | 3 + libretroshare/src/retroshare/rsnotify.h | 3 +- libretroshare/src/retroshare/rsturtle.h | 11 +- libretroshare/src/rsitems/rsgxsitems.cc | 56 +++++ libretroshare/src/rsitems/rsgxsitems.h | 76 +++++++ libretroshare/src/services/p3gxschannels.cc | 7 + libretroshare/src/services/p3gxschannels.h | 3 + libretroshare/src/turtle/p3turtle.cc | 198 +++++++++++------- libretroshare/src/turtle/p3turtle.h | 19 +- libretroshare/src/turtle/rsturtleitem.cc | 94 +++------ libretroshare/src/turtle/rsturtleitem.h | 95 +++------ .../src/turtle/turtleclientservice.h | 47 ++++- .../src/gui/FileTransfer/SearchDialog.cpp | 6 +- retroshare-gui/src/gui/notifyqt.h | 2 + 31 files changed, 513 insertions(+), 262 deletions(-) diff --git a/libresapi/src/api/FileSearchHandler.cpp b/libresapi/src/api/FileSearchHandler.cpp index 0382005df..eb414fc9f 100644 --- a/libresapi/src/api/FileSearchHandler.cpp +++ b/libresapi/src/api/FileSearchHandler.cpp @@ -190,9 +190,9 @@ void FileSearchHandler::handleCreateSearch(Request &req, Response &resp) // i have no idea what the reasons for two different search modes are // rs-gui does it, so do we if(words.size() == 1) - search_id = mTurtle->turtleSearch(words.front()); + search_id = rsFiles->turtleSearch(words.front()); else - search_id = mTurtle->turtleSearch(lin_exp); + search_id = rsFiles->turtleSearch(lin_exp); } std::list results; diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index 47718caaa..3172cfd89 100644 --- a/libretroshare/src/ft/ftserver.cc +++ b/libretroshare/src/ft/ftserver.cc @@ -1317,7 +1317,7 @@ bool ftServer::encryptItem(RsTurtleGenericTunnelItem *clear_item,const RsFileHas // Decrypts the given item using aead-chacha20-poly1305 -bool ftServer::decryptItem(RsTurtleGenericDataItem *encrypted_item,const RsFileHash& hash,RsTurtleGenericTunnelItem *& decrypted_item) +bool ftServer::decryptItem(const RsTurtleGenericDataItem *encrypted_item,const RsFileHash& hash,RsTurtleGenericTunnelItem *& decrypted_item) { #ifndef USE_NEW_METHOD unsigned char *data = NULL ; @@ -1453,9 +1453,34 @@ bool ftServer::findRealHash(const RsFileHash& hash, RsFileHash& real_hash) return false ; } +TurtleSearchRequestId ftServer::turtleSearch(const std::string& string_to_match) +{ + return mTurtleRouter->turtleSearch(string_to_match) ; +} +TurtleSearchRequestId ftServer::turtleSearch(const RsRegularExpression::LinearizedExpression& expr) +{ + return mTurtleRouter->turtleSearch(expr) ; +} + +#warning we should do this here, but for now it's done by turtle router. +// // Dont delete the item. The client (p3turtle) is doing it after calling this. +// // +// void ftServer::receiveSearchResult(RsTurtleSearchResultItem *item) +// { +// RsTurtleFTSearchResultItem *ft_sr = dynamic_cast(item) ; +// +// if(ft_sr == NULL) +// { +// FTSERVER_ERROR() << "(EE) ftServer::receiveSearchResult(): item cannot be cast to a RsTurtleFTSearchResultItem" << std::endl; +// return ; +// } +// +// RsServer::notify()->notifyTurtleSearchResult(ft_sr->request_id,ft_sr->result) ; +// } + // Dont delete the item. The client (p3turtle) is doing it after calling this. // -void ftServer::receiveTurtleData(RsTurtleGenericTunnelItem *i, +void ftServer::receiveTurtleData(const RsTurtleGenericTunnelItem *i, const RsFileHash& hash, const RsPeerId& virtual_peer_id, RsTurtleGenericTunnelItem::Direction direction) @@ -1475,7 +1500,7 @@ void ftServer::receiveTurtleData(RsTurtleGenericTunnelItem *i, } RsTurtleGenericTunnelItem *decrypted_item ; - if(!decryptItem(dynamic_cast(i),real_hash,decrypted_item)) + if(!decryptItem(dynamic_cast(i),real_hash,decrypted_item)) { FTSERVER_ERROR() << "(EE) decryption error." << std::endl; return ; @@ -1491,7 +1516,7 @@ void ftServer::receiveTurtleData(RsTurtleGenericTunnelItem *i, { case RS_TURTLE_SUBTYPE_FILE_REQUEST: { - RsTurtleFileRequestItem *item = dynamic_cast(i) ; + const RsTurtleFileRequestItem *item = dynamic_cast(i) ; if (item) { #ifdef SERVER_DEBUG @@ -1504,7 +1529,7 @@ void ftServer::receiveTurtleData(RsTurtleGenericTunnelItem *i, case RS_TURTLE_SUBTYPE_FILE_DATA : { - RsTurtleFileDataItem *item = dynamic_cast(i) ; + const RsTurtleFileDataItem *item = dynamic_cast(i) ; if (item) { #ifdef SERVER_DEBUG @@ -1512,7 +1537,7 @@ void ftServer::receiveTurtleData(RsTurtleGenericTunnelItem *i, #endif getMultiplexer()->recvData(virtual_peer_id,hash,0,item->chunk_offset,item->chunk_size,item->chunk_data) ; - item->chunk_data = NULL ; // this prevents deletion in the destructor of RsFileDataItem, because data will be deleted + const_cast(item)->chunk_data = NULL ; // this prevents deletion in the destructor of RsFileDataItem, because data will be deleted // down _ft_server->getMultiplexer()->recvData()...in ftTransferModule::recvFileData } } @@ -1520,7 +1545,7 @@ void ftServer::receiveTurtleData(RsTurtleGenericTunnelItem *i, case RS_TURTLE_SUBTYPE_FILE_MAP : { - RsTurtleFileMapItem *item = dynamic_cast(i) ; + const RsTurtleFileMapItem *item = dynamic_cast(i) ; if (item) { #ifdef SERVER_DEBUG @@ -1543,7 +1568,7 @@ void ftServer::receiveTurtleData(RsTurtleGenericTunnelItem *i, case RS_TURTLE_SUBTYPE_CHUNK_CRC : { - RsTurtleChunkCrcItem *item = dynamic_cast(i) ; + const RsTurtleChunkCrcItem *item = dynamic_cast(i) ; if (item) { #ifdef SERVER_DEBUG @@ -1556,7 +1581,7 @@ void ftServer::receiveTurtleData(RsTurtleGenericTunnelItem *i, case RS_TURTLE_SUBTYPE_CHUNK_CRC_REQUEST: { - RsTurtleChunkCrcRequestItem *item = dynamic_cast(i) ; + const RsTurtleChunkCrcRequestItem *item = dynamic_cast(i) ; if (item) { #ifdef SERVER_DEBUG diff --git a/libretroshare/src/ft/ftserver.h b/libretroshare/src/ft/ftserver.h index 191b201b4..0833127cf 100644 --- a/libretroshare/src/ft/ftserver.h +++ b/libretroshare/src/ft/ftserver.h @@ -96,7 +96,8 @@ public: // Implements RsTurtleClientService // virtual bool handleTunnelRequest(const RsFileHash& hash,const RsPeerId& peer_id) ; - virtual void receiveTurtleData(RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) ; + virtual void receiveTurtleData(const RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) ; + //virtual void receiveSearchResult(RsTurtleSearchResultItem *item);// TODO virtual RsItem *create_item(uint16_t service,uint8_t item_type) const ; virtual RsServiceSerializer *serializer() { return this ; } @@ -143,6 +144,9 @@ public: virtual void setFilePermDirectDL(uint32_t perm) ; virtual uint32_t filePermDirectDL() ; + virtual TurtleSearchRequestId turtleSearch(const std::string& string_to_match) ; + virtual TurtleSearchRequestId turtleSearch(const RsRegularExpression::LinearizedExpression& expr) ; + /*** * Control of Downloads Priority. ***/ @@ -250,7 +254,7 @@ public: static void deriveEncryptionKey(const RsFileHash& hash, uint8_t *key); bool encryptItem(RsTurtleGenericTunnelItem *clear_item,const RsFileHash& hash,RsTurtleGenericDataItem *& encrypted_item); - bool decryptItem(RsTurtleGenericDataItem *encrypted_item, const RsFileHash& hash, RsTurtleGenericTunnelItem *&decrypted_item); + bool decryptItem(const RsTurtleGenericDataItem *encrypted_item, const RsFileHash& hash, RsTurtleGenericTunnelItem *&decrypted_item); /*************** Internal Transfer Fns *************************/ virtual int tick(); diff --git a/libretroshare/src/grouter/p3grouter.cc b/libretroshare/src/grouter/p3grouter.cc index 75e8fd4d6..656da0f9c 100644 --- a/libretroshare/src/grouter/p3grouter.cc +++ b/libretroshare/src/grouter/p3grouter.cc @@ -482,7 +482,7 @@ void p3GRouter::handleLowLevelTransactionAckItem(RsGRouterTransactionAcknItem *t #endif } -void p3GRouter::receiveTurtleData(RsTurtleGenericTunnelItem *gitem, const RsFileHash &/*hash*/, const RsPeerId &virtual_peer_id, RsTurtleGenericTunnelItem::Direction /*direction*/) +void p3GRouter::receiveTurtleData(const RsTurtleGenericTunnelItem *gitem, const RsFileHash &/*hash*/, const RsPeerId &virtual_peer_id, RsTurtleGenericTunnelItem::Direction /*direction*/) { #ifdef GROUTER_DEBUG std::cerr << "p3GRouter::receiveTurtleData() " << std::endl; @@ -496,7 +496,7 @@ void p3GRouter::receiveTurtleData(RsTurtleGenericTunnelItem *gitem, const RsFile // - possibly packs multi-item blocks back together // - converts it into a grouter generic item (by deserialising it) - RsTurtleGenericDataItem *item = dynamic_cast(gitem) ; + const RsTurtleGenericDataItem *item = dynamic_cast(gitem) ; if(item == NULL) { @@ -510,7 +510,8 @@ void p3GRouter::receiveTurtleData(RsTurtleGenericTunnelItem *gitem, const RsFile // Items come out of the pipe in order. We need to recover all chunks before we de-serialise the content and have it handled by handleIncoming() - RsItem *itm = RsGRouterSerialiser().deserialise(item->data_bytes,&item->data_size) ; + uint32_t size = item->data_size ; + RsItem *itm = RsGRouterSerialiser().deserialise(item->data_bytes,&size); if(itm == NULL) { diff --git a/libretroshare/src/grouter/p3grouter.h b/libretroshare/src/grouter/p3grouter.h index 71b2fc138..8a3a54000 100644 --- a/libretroshare/src/grouter/p3grouter.h +++ b/libretroshare/src/grouter/p3grouter.h @@ -209,7 +209,7 @@ protected: //===================================================// virtual bool handleTunnelRequest(const RsFileHash& /*hash*/,const RsPeerId& /*peer_id*/) ; - virtual void receiveTurtleData(RsTurtleGenericTunnelItem */*item*/,const RsFileHash& /*hash*/,const RsPeerId& /*virtual_peer_id*/,RsTurtleGenericTunnelItem::Direction /*direction*/); + virtual void receiveTurtleData(const RsTurtleGenericTunnelItem */*item*/,const RsFileHash& /*hash*/,const RsPeerId& /*virtual_peer_id*/,RsTurtleGenericTunnelItem::Direction /*direction*/); virtual void addVirtualPeer(const TurtleFileHash& hash,const TurtleVirtualPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction dir) ; virtual void removeVirtualPeer(const TurtleFileHash& hash,const TurtleVirtualPeerId& virtual_peer_id) ; diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 11137f8b0..ba330e334 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -3384,3 +3384,11 @@ void RsGenExchange::removeDeleteExistingMessages( std::list& msgs, Gx } } +void RsGenExchange::turtleGroupRequest(const RsGxsGroupId& group_id) +{ + mNetService->turtleGroupRequest(group_id) ; +} +void RsGenExchange::turtleSearchRequest(const std::string& match_string) +{ + mNetService->turtleSearchRequest(match_string) ; +} diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h index 491ff017b..98b1d5d30 100644 --- a/libretroshare/src/gxs/rsgenexchange.h +++ b/libretroshare/src/gxs/rsgenexchange.h @@ -287,6 +287,15 @@ public: */ bool getGroupStatistic(const uint32_t& token, GxsGroupStatistic& stats); + /*! + * \brief turtleGroupRequest + * Issues a browadcast group request using the turtle router generic search system. The request is obviously asynchroneous and will be + * handled in RsGenExchange when received. + * \param group_id + */ + void turtleGroupRequest(const RsGxsGroupId& group_id); + void turtleSearchRequest(const std::string& match_string); + protected: bool messagePublicationTest(const RsGxsMsgMetaData&) ; diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 8a46fc89e..b0d1743d6 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -5102,3 +5102,12 @@ bool RsGxsNetService::locked_stampMsgServerUpdateTS(const RsGxsGroupId& gid) return true; } + +void RsGxsNetService::turtleGroupRequest(const RsGxsGroupId& group_id) +{ + mGxsNetTunnel->turtleGroupRequest(group_id) ; +} +void RsGxsNetService::turtleSearchRequest(const std::string& match_string) +{ + mGxsNetTunnel->turtleSearchRequest(match_string) ; +} diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index fe1c77010..aa8f8288c 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -122,6 +122,8 @@ public: virtual void setDefaultKeepAge(uint32_t t) { mDefaultMsgStorePeriod = t ; } virtual void setDefaultSyncAge(uint32_t t) { mDefaultMsgSyncPeriod = t ; } + virtual void turtleGroupRequest(const RsGxsGroupId& group_id); + virtual void turtleSearchRequest(const std::string& match_string); /*! * pauses synchronisation of subscribed groups and request for group id * from peers diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index b81b6a7c0..964f15781 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -389,7 +389,7 @@ bool RsGxsNetTunnelService::handleTunnelRequest(const RsFileHash &hash,const RsP return mHandledHashes.find(hash) != mHandledHashes.end(); } -void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& turtle_virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) +void RsGxsNetTunnelService::receiveTurtleData(const RsTurtleGenericTunnelItem *item, const RsFileHash& hash, const RsPeerId& turtle_virtual_peer_id, RsTurtleGenericTunnelItem::Direction direction) { RS_STACK_MUTEX(mGxsNetTunnelMtx); @@ -424,7 +424,7 @@ void RsGxsNetTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *item,co generateEncryptionKey(group_id,turtle_virtual_peer_id,encryption_master_key); - if(!p3turtle::decryptItem(static_cast(item),encryption_master_key,data,data_size)) + if(!p3turtle::decryptItem(static_cast(item),encryption_master_key,data,data_size)) { GXS_NET_TUNNEL_ERROR() << "Cannot decrypt data!" << std::endl; @@ -852,3 +852,23 @@ RsSerialiser *RsGxsNetTunnelService::setupSerialiser() return ser ; } + +bool RsGxsNetTunnelService::receiveSearchRequest(unsigned char *search_request_data,uint32_t search_request_data_len,unsigned char *& search_result_data,uint32_t& search_result_data_len) +{ + std::cerr << __PRETTY_FUNCTION__ << ": received a request. Code needed to handle it" << std::endl; + return false ; +} +void RsGxsNetTunnelService::receiveSearchResult(unsigned char *search_result_data,uint32_t search_result_data_len) +{ + std::cerr << __PRETTY_FUNCTION__ << ": received a search result. Code needed to handle it" << std::endl; +} + +void RsGxsNetTunnelService::turtleGroupRequest(const RsGxsGroupId& group_id) +{ + std::cerr << __PRETTY_FUNCTION__ << ": handling of turtle group request not implemented yet" << std::endl; +} +void RsGxsNetTunnelService::turtleSearchRequest(const std::string& match_string) +{ + std::cerr << __PRETTY_FUNCTION__ << ": handling of turtle search request not implemented yet" << std::endl; +} + diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 46314da6f..f85b997f5 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -212,13 +212,23 @@ public: */ void dump() const; - // other methods are still missing. - // - derived from p3Config, to load/save data - // - method to respond to tunnel requests, probably using RsGxsNetService - // - method to encrypt/decrypt data and send/receive to/from turtle. - + /*! + * \brief connectToTurtleRouter + * Should be called after allocating a RsGxsNetTunnelService + * \param tr turtle router object + */ virtual void connectToTurtleRouter(p3turtle *tr) ; + void turtleGroupRequest(const RsGxsGroupId& group_id) ; + void turtleSearchRequest(const std::string& match_string) ; + + /*! + * \brief receiveSearchRequest + * See RsTurtleClientService::@ + */ + virtual bool receiveSearchRequest(unsigned char *search_request_data,uint32_t search_request_data_len,unsigned char *& search_result_data,uint32_t& search_result_data_len); + virtual void receiveSearchResult(unsigned char *search_result_data,uint32_t search_result_data_len) ; + // Overloaded from RsTickingThread void data_tick() ; @@ -233,7 +243,7 @@ protected: // interaction with turtle router virtual bool handleTunnelRequest(const RsFileHash &hash,const RsPeerId& peer_id) ; - virtual void receiveTurtleData(RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) ; + virtual void receiveTurtleData(const RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) ; void addVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&,RsTurtleGenericTunnelItem::Direction dir) ; void removeVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&) ; const Bias20Bytes& locked_randomBias() ; diff --git a/libretroshare/src/gxs/rsnxs.h b/libretroshare/src/gxs/rsnxs.h index faec2577a..59d2bf209 100644 --- a/libretroshare/src/gxs/rsnxs.h +++ b/libretroshare/src/gxs/rsnxs.h @@ -81,6 +81,8 @@ public: virtual uint32_t getDefaultSyncAge() =0; virtual uint32_t getDefaultKeepAge() =0; + virtual void turtleGroupRequest(const RsGxsGroupId& group_id)=0; + virtual void turtleSearchRequest(const std::string& match_string)=0; /*! * Initiates a search through the network * This returns messages which contains the search terms set in RsGxsSearch diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.cc b/libretroshare/src/gxstunnel/p3gxstunnel.cc index eef365230..a57eef36b 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.cc +++ b/libretroshare/src/gxstunnel/p3gxstunnel.cc @@ -685,7 +685,7 @@ void p3GxsTunnelService::removeVirtualPeer(const TurtleFileHash& hash,const Turt } } -void p3GxsTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *gitem,const RsFileHash& hash, const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) +void p3GxsTunnelService::receiveTurtleData(const RsTurtleGenericTunnelItem *gitem, const RsFileHash& hash, const RsPeerId& virtual_peer_id, RsTurtleGenericTunnelItem::Direction direction) { #ifdef DEBUG_GXS_TUNNEL std::cerr << "GxsTunnelService::receiveTurtleData(): Received turtle data. " << std::endl; @@ -697,7 +697,7 @@ void p3GxsTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *gitem,cons (void) direction; #endif - RsTurtleGenericDataItem *item = dynamic_cast(gitem) ; + const RsTurtleGenericDataItem *item = dynamic_cast(gitem) ; if(item == NULL) { diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.h b/libretroshare/src/gxstunnel/p3gxstunnel.h index 32020e619..cff0fd126 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.h +++ b/libretroshare/src/gxstunnel/p3gxstunnel.h @@ -211,7 +211,7 @@ private: // Overloaded from RsTurtleClientService virtual bool handleTunnelRequest(const RsFileHash &hash,const RsPeerId& peer_id) ; - virtual void receiveTurtleData(RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) ; + virtual void receiveTurtleData(const RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) ; void addVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&,RsTurtleGenericTunnelItem::Direction dir) ; void removeVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&) ; diff --git a/libretroshare/src/pqi/p3notify.cc b/libretroshare/src/pqi/p3notify.cc index 2461d5f1c..5cc525dad 100644 --- a/libretroshare/src/pqi/p3notify.cc +++ b/libretroshare/src/pqi/p3notify.cc @@ -231,7 +231,8 @@ void p3Notify::notifyChatLobbyTimeShift (int time_shift) void p3Notify::notifyCustomState (const std::string& peer_id , const std::string& status_string ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyCustomState (peer_id,status_string) ; } void p3Notify::notifyHashingInfo (uint32_t type , const std::string& fileinfo ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyHashingInfo (type,fileinfo) ; } void p3Notify::notifyTurtleSearchResult (uint32_t search_id , const std::list& files ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyTurtleSearchResult(search_id,files) ; } -void p3Notify::notifyTurtleSearchResult (uint32_t search_id , const std::list& groups ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyTurtleSearchResult(search_id,groups) ; } +#warning MISSING CODE HERE +//void p3Notify::notifyTurtleSearchResult (uint32_t search_id , const std::list& groups ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyTurtleSearchResult(search_id,groups) ; } void p3Notify::notifyPeerHasNewAvatar (std::string peer_id ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyPeerHasNewAvatar(peer_id) ; } void p3Notify::notifyOwnAvatarChanged () { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyOwnAvatarChanged() ; } void p3Notify::notifyOwnStatusMessageChanged() { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyOwnStatusMessageChanged() ; } diff --git a/libretroshare/src/pqi/p3notify.h b/libretroshare/src/pqi/p3notify.h index 22e1f143d..30386c95a 100644 --- a/libretroshare/src/pqi/p3notify.h +++ b/libretroshare/src/pqi/p3notify.h @@ -106,7 +106,8 @@ class p3Notify: public RsNotify void notifyCustomState (const std::string& /* peer_id */, const std::string& /* status_string */) ; void notifyHashingInfo (uint32_t /* type */, const std::string& /* fileinfo */) ; void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list& /* files */) ; - void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list& /* groups */) ; +#warning MISSING CODE HERE +// void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list& /* groups */) ; void notifyPeerHasNewAvatar (std::string /* peer_id */) ; void notifyOwnAvatarChanged () ; void notifyOwnStatusMessageChanged () ; diff --git a/libretroshare/src/retroshare/rsfiles.h b/libretroshare/src/retroshare/rsfiles.h index d7efb2937..001328956 100644 --- a/libretroshare/src/retroshare/rsfiles.h +++ b/libretroshare/src/retroshare/rsfiles.h @@ -32,6 +32,7 @@ #include #include "rstypes.h" +#include "rsturtle.h" class RsFiles; extern RsFiles *rsFiles; @@ -213,6 +214,8 @@ class RsFiles virtual uint32_t getMaxUploadSlotsPerFriend()=0; virtual void setFilePermDirectDL(uint32_t perm)=0; virtual uint32_t filePermDirectDL()=0; + virtual TurtleRequestId turtleSearch(const std::string& string_to_match) =0; + virtual TurtleRequestId turtleSearch(const RsRegularExpression::LinearizedExpression& expr) =0; /*** * Control of Downloads Priority. diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index c75235f0e..175c7fc22 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -96,6 +96,9 @@ virtual bool getPostData(const uint32_t &token, std::vector &p //virtual bool createComment(uint32_t &token, RsGxsComment &comment) = 0; //virtual bool createVote(uint32_t &token, RsGxsVote &vote) = 0; + virtual void turtleGroupRequest(const RsGxsGroupId& group_id)=0; + virtual void turtleSearchRequest(const std::string& match_string)=0; + ////////////////////////////////////////////////////////////////////////////// virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0; diff --git a/libretroshare/src/retroshare/rsnotify.h b/libretroshare/src/retroshare/rsnotify.h index 6d9db3ef7..ee731a67a 100644 --- a/libretroshare/src/retroshare/rsnotify.h +++ b/libretroshare/src/retroshare/rsnotify.h @@ -228,7 +228,8 @@ class NotifyClient virtual void notifyCustomState (const std::string& /* peer_id */, const std::string& /* status_string */) {} virtual void notifyHashingInfo (uint32_t /* type */, const std::string& /* fileinfo */) {} virtual void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list& /* files */) {} - virtual void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list& /* groups */) {} +#warning MISSING CODE HERE + // virtual void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list& /* groups */) {} virtual void notifyPeerHasNewAvatar (std::string /* peer_id */) {} virtual void notifyOwnAvatarChanged () {} virtual void notifyOwnStatusMessageChanged () {} diff --git a/libretroshare/src/retroshare/rsturtle.h b/libretroshare/src/retroshare/rsturtle.h index 0467b452d..1b3cb1b7e 100644 --- a/libretroshare/src/retroshare/rsturtle.h +++ b/libretroshare/src/retroshare/rsturtle.h @@ -54,13 +54,7 @@ struct TurtleFileInfo std::string name ; uint64_t size ; }; -struct TurtleGxsInfo -{ - RsGxsGroupId group_id ; - uint16_t service_id ; - std::string name ; - //RsTlvBinaryData meta ;// is that actually needed? Not sure. Better if it's not. -}; + struct TurtleTunnelRequestDisplayInfo { uint32_t request_id ; // Id of the request @@ -118,8 +112,7 @@ class RsTurtle // the request id, which will be further used by the gui to store results // as they come back. // - virtual TurtleRequestId turtleSearch(const std::string& match_string) = 0 ; - virtual TurtleRequestId turtleSearch(const RsRegularExpression::LinearizedExpression& expr) = 0 ; + virtual TurtleRequestId turtleSearch(unsigned char *search_bin_data,uint32_t search_bin_data_len,RsTurtleClientService *client_service) =0; // Initiates tunnel handling for the given file hash. tunnels. Launches // an exception if an error occurs during the initialization process. The diff --git a/libretroshare/src/rsitems/rsgxsitems.cc b/libretroshare/src/rsitems/rsgxsitems.cc index 9971514ec..141f22167 100644 --- a/libretroshare/src/rsitems/rsgxsitems.cc +++ b/libretroshare/src/rsitems/rsgxsitems.cc @@ -6,6 +6,8 @@ */ +#include "serialiser/rstypeserializer.h" +#include "serialiser/rsbaseserial.h" #include "rsgxsitems.h" #include "gxs/rsgxsdata.h" #include @@ -70,4 +72,58 @@ std::ostream &operator<<(std::ostream &out, const RsMsgMetaData &meta) return out; } +template<> uint32_t RsTypeSerializer::serial_size(const TurtleGxsInfo& i) +{ + uint32_t s = 0 ; + s += 2 ; // service_id + s += i.group_id.SIZE_IN_BYTES ; + s += GetTlvStringSize(i.name) ; + + return s; +} + +template<> bool RsTypeSerializer::deserialize(const uint8_t data[],uint32_t size,uint32_t& offset,TurtleGxsInfo& i) +{ + uint32_t saved_offset = offset ; + bool ok = true ; + + ok &= getRawUInt16(data, size, &offset, &i.service_id); // service_id + ok &= i.group_id.deserialise(data, size, offset); // group_id + ok &= GetTlvString(data, size, &offset, TLV_TYPE_STR_NAME, i.name); // group name + + if(!ok) + offset = saved_offset ; + + return ok; +} + +template<> bool RsTypeSerializer::serialize(uint8_t data[],uint32_t size,uint32_t& offset,const TurtleGxsInfo& i) +{ + uint32_t saved_offset = offset ; + bool ok = true ; + + ok &= setRawUInt16(data, size, &offset, i.service_id); // service_id + ok &= i.group_id.serialise(data, size, offset); // group_id + ok &= SetTlvString(data, size, &offset, TLV_TYPE_STR_NAME, i.name); // group name + + if(!ok) + offset = saved_offset ; + + return ok; +} + +template<> void RsTypeSerializer::print_data(const std::string& n, const TurtleGxsInfo& i) +{ + std::cerr << " [GXS Info ] " << n << " group_id=" << i.group_id << " service=" << std::hex << i.service_id << std::dec << ", name=" << i.name << std::endl; +} + +void RsTurtleGxsSearchResultGroupSummaryItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) +{ + RsTypeSerializer::serial_process(j,ctx,result,"result") ; +} +void RsTurtleGxsSearchResultGroupDataItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) +{ + RsTypeSerializer::TlvMemBlock_proxy prox(encrypted_nxs_group_data,encrypted_nxs_group_data_len) ; + RsTypeSerializer::serial_process(j,ctx,prox,"encrypted_nxs_data") ; +} diff --git a/libretroshare/src/rsitems/rsgxsitems.h b/libretroshare/src/rsitems/rsgxsitems.h index fa461a0e8..74f471533 100644 --- a/libretroshare/src/rsitems/rsgxsitems.h +++ b/libretroshare/src/rsitems/rsgxsitems.h @@ -57,6 +57,82 @@ public: RsMsgMetaData meta; }; +// We should make these items templates or generic classes so that each GXS service will handle them on its own. + +static const uint8_t RS_PKT_SUBTYPE_GXS_SUBSTRING_SEARCH_ITEM = 0x20 ; +static const uint8_t RS_PKT_SUBTYPE_GXS_GROUP_SEARCH_ITEM = 0x21 ; +static const uint8_t RS_PKT_SUBTYPE_GXS_GROUP_SUMMARY_ITEM = 0x22 ; +static const uint8_t RS_PKT_SUBTYPE_GXS_GROUP_DATA_ITEM = 0x23 ; + +class RsGxsTurtleSubStringSearchItem: public RsItem +{ + public: + RsGxsTurtleSubStringSearchItem(uint16_t service): RsItem(RS_PKT_VERSION_SERVICE,service,RS_PKT_SUBTYPE_GXS_SUBSTRING_SEARCH_ITEM) {} + virtual ~RsGxsTurtleSubStringSearchItem() {} + + std::string match_string ; // string to match + + std::string GetKeywords() { return match_string; } + void clear() { match_string.clear() ; } + + protected: + void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); +}; + +class RsGxsTurtleGroupSearchItem: public RsItem +{ + public: + RsGxsTurtleGroupSearchItem(uint16_t service): RsItem(RS_PKT_VERSION_SERVICE,service,RS_PKT_SUBTYPE_GXS_GROUP_SEARCH_ITEM) {} + virtual ~RsGxsTurtleGroupSearchItem() {} + + uint16_t service_id ; // searvice to search + Sha1CheckSum hashed_group_id ; // the group ID is hashed in order to keep it private. + + std::string GetKeywords() { return std::string("Group request for [hashed] ")+hashed_group_id.toStdString() ; } + void clear() { hashed_group_id.clear() ; } + + protected: + void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); +}; + +struct TurtleGxsInfo +{ + uint16_t service_id ; + RsGxsGroupId group_id ; + RsGxsId author; + std::string name ; + std::string description ; + time_t last_post ; + uint32_t number_of_posts ; +}; + +class RsTurtleGxsSearchResultGroupSummaryItem: public RsItem +{ + public: + RsTurtleGxsSearchResultGroupSummaryItem(uint16_t service) : RsItem(RS_PKT_VERSION_SERVICE,service,RS_PKT_SUBTYPE_GXS_GROUP_SUMMARY_ITEM){} + virtual ~RsTurtleGxsSearchResultGroupSummaryItem() {} + + std::list result ; + + void clear() { result.clear() ; } + protected: + void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); +}; + +class RsTurtleGxsSearchResultGroupDataItem: public RsItem +{ + public: + RsTurtleGxsSearchResultGroupDataItem(uint16_t service) : RsItem(RS_PKT_VERSION_SERVICE,service,RS_PKT_SUBTYPE_GXS_GROUP_DATA_ITEM){} + virtual ~RsTurtleGxsSearchResultGroupDataItem() {} + + unsigned char *encrypted_nxs_group_data; // data is encrypted with group ID. Only the requester, or anyone who already know the group id can decrypt. + uint32_t encrypted_nxs_group_data_len ; + + void clear() { free(encrypted_nxs_group_data); encrypted_nxs_group_data=NULL; encrypted_nxs_group_data_len=0; } + protected: + void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); +}; + diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index d2578d470..7d36048de 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -1695,3 +1695,10 @@ void p3GxsChannels::handle_event(uint32_t event_type, const std::string &elabel) } } +void p3GxsChannels::turtleGroupRequest(const RsGxsGroupId& group_id) +{ +} +void p3GxsChannels::turtleSearchRequest(const std::string& match_string) +{ +} + diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index 4eb5f5fba..c166dbc2f 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -72,6 +72,9 @@ virtual void service_tick(); virtual bool saveList(bool &cleanup, std::list&saveList); // @see p3Config::saveList(bool &cleanup, std::list&) virtual bool loadList(std::list& loadList); // @see p3Config::loadList(std::list&) + virtual void turtleGroupRequest(const RsGxsGroupId& group_id); + virtual void turtleSearchRequest(const std::string& match_string); + // Overloaded to cache new groups. virtual RsGenExchange::ServiceCreate_Return service_CreateGroup(RsGxsGrpItem* grpItem, RsTlvSecurityKeySet& keySet); diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 5208b32d8..9914d510c 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -156,10 +156,9 @@ void p3turtle::getItemNames(std::map& names) const names.clear(); names[RS_TURTLE_SUBTYPE_STRING_SEARCH_REQUEST ] = "Filename substring search request"; - names[RS_TURTLE_SUBTYPE_GXS_SEARCH_REQUEST ] = "GXS search request"; + names[RS_TURTLE_SUBTYPE_GENERIC_SEARCH_REQUEST ] = "Generic search request"; names[RS_TURTLE_SUBTYPE_FT_SEARCH_RESULT ] = "File search result"; - names[RS_TURTLE_SUBTYPE_GXS_GROUP_SUMMARY ] = "GXS group summary"; - names[RS_TURTLE_SUBTYPE_GXS_GROUP_DATA ] = "GXS group data"; + names[RS_TURTLE_SUBTYPE_GENERIC_SEARCH_RESULT ] = "Generic search result"; names[RS_TURTLE_SUBTYPE_OPEN_TUNNEL ] = "Tunnel request"; names[RS_TURTLE_SUBTYPE_TUNNEL_OK ] = "Tunnel response"; names[RS_TURTLE_SUBTYPE_FILE_REQUEST ] = "Data request"; @@ -840,11 +839,11 @@ int p3turtle::handleIncoming() switch(item->PacketSubType()) { case RS_TURTLE_SUBTYPE_STRING_SEARCH_REQUEST: + case RS_TURTLE_SUBTYPE_GENERIC_SEARCH_REQUEST: case RS_TURTLE_SUBTYPE_REGEXP_SEARCH_REQUEST: handleSearchRequest(dynamic_cast(item)) ; break ; - case RS_TURTLE_SUBTYPE_GXS_GROUP_DATA : - case RS_TURTLE_SUBTYPE_GXS_GROUP_SUMMARY : + case RS_TURTLE_SUBTYPE_GENERIC_SEARCH_RESULT : case RS_TURTLE_SUBTYPE_FT_SEARCH_RESULT : handleSearchResult(dynamic_cast(item)) ; break ; @@ -1002,65 +1001,92 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) void p3turtle::handleSearchResult(RsTurtleSearchResultItem *item) { - RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ - // Find who actually sent the corresponding request. - // - std::map::iterator it = _search_requests_origins.find(item->request_id) ; -#ifdef P3TURTLE_DEBUG - std::cerr << "Received search result:" << std::endl ; - item->print(std::cerr,0) ; -#endif - if(it == _search_requests_origins.end()) + std::list > results_to_notify_off_mutex ; + { - // This is an error: how could we receive a search result corresponding to a search item we - // have forwarded but that it not in the list ?? + RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ + // Find who actually sent the corresponding request. + // + std::map::iterator it = _search_requests_origins.find(item->request_id) ; - std::cerr << __PRETTY_FUNCTION__ << ": search result has no peer direction!" << std::endl ; - return ; - } - - // Is this result's target actually ours ? - - if(it->second.origin == _own_id) - { - it->second.result_count += item->count() ; - returnSearchResult(item) ; // Yes, so send upward. - } - else - { // Nope, so forward it back. #ifdef P3TURTLE_DEBUG - std::cerr << " Forwarding result back to " << it->second.origin << std::endl; + std::cerr << "Received search result:" << std::endl ; + item->print(std::cerr,0) ; #endif - // We update the total count forwarded back, and chop it to TURTLE_SEARCH_RESULT_MAX_HITS. - - uint32_t n = item->count(); // not so good! - - if(it->second.result_count >= TURTLE_SEARCH_RESULT_MAX_HITS) + if(it == _search_requests_origins.end()) { - std::cerr << "(WW) exceeded turtle search result to forward. Req=" << std::hex << item->request_id << std::dec << ": dropping item with " << n << " elements." << std::endl; + // This is an error: how could we receive a search result corresponding to a search item we + // have forwarded but that it not in the list ?? + + std::cerr << __PRETTY_FUNCTION__ << ": search result has no peer direction!" << std::endl ; return ; } - if(it->second.result_count + n > TURTLE_SEARCH_RESULT_MAX_HITS) - { - for(uint32_t i=it->second.result_count + n; i>TURTLE_SEARCH_RESULT_MAX_HITS;--i) - item->pop() ; + // Is this result's target actually ours ? - it->second.result_count = TURTLE_SEARCH_RESULT_MAX_HITS ; + if(it->second.origin == _own_id) + { + it->second.result_count += item->count() ; + + results_to_notify_off_mutex.push_back(std::make_pair(item,it->second.client)) ; } else - it->second.result_count += n ; + { // Nope, so forward it back. +#ifdef P3TURTLE_DEBUG + std::cerr << " Forwarding result back to " << it->second.origin << std::endl; +#endif + // We update the total count forwarded back, and chop it to TURTLE_SEARCH_RESULT_MAX_HITS. - RsTurtleSearchResultItem *fwd_item = item->duplicate(); + uint32_t n = item->count(); // not so good! - // Normally here, we should setup the forward adress, so that the owner's - // of the files found can be further reached by a tunnel. + if(it->second.result_count >= TURTLE_SEARCH_RESULT_MAX_HITS) + { + std::cerr << "(WW) exceeded turtle search result to forward. Req=" << std::hex << item->request_id << std::dec << ": dropping item with " << n << " elements." << std::endl; + return ; + } - fwd_item->PeerId(it->second.origin) ; - fwd_item->depth = 0 ; // obfuscate the depth for non immediate friends. Result will always be 0. This effectively removes the information. + if(it->second.result_count + n > TURTLE_SEARCH_RESULT_MAX_HITS) + { + for(uint32_t i=it->second.result_count + n; i>TURTLE_SEARCH_RESULT_MAX_HITS;--i) + item->pop() ; - sendItem(fwd_item) ; + it->second.result_count = TURTLE_SEARCH_RESULT_MAX_HITS ; + } + else + it->second.result_count += n ; + + RsTurtleSearchResultItem *fwd_item = item->duplicate(); + + // Normally here, we should setup the forward adress, so that the owner's + // of the files found can be further reached by a tunnel. + + fwd_item->PeerId(it->second.origin) ; + fwd_item->depth = 0 ; // obfuscate the depth for non immediate friends. Result will always be 0. This effectively removes the information. + + sendItem(fwd_item) ; + } } + + // now we notify clients off-mutex. + + for(auto it(results_to_notify_off_mutex.begin());it!=results_to_notify_off_mutex.end();++it) + { + // Hack to use the old search result handling in ftServer. Normally ftServer should use the new method with serialized result. + +#warning make sure memory is correctly deleted here + RsTurtleFTSearchResultItem *ftsr = dynamic_cast(it->first) ; + + if(ftsr!=NULL) + { + RsServer::notify()->notifyTurtleSearchResult(ftsr->request_id,ftsr->result) ; + continue ; + } + + RsTurtleGenericSearchResultItem *gnsr = dynamic_cast(it->first) ; + + if(gnsr!=NULL) + (*it).second->receiveSearchResult(gnsr->result_data,gnsr->result_data_len) ; + } } // -----------------------------------------------------------------------------------// @@ -1794,17 +1820,11 @@ void RsTurtleFileSearchRequestItem::performLocalSearch(TurtleSearchRequestInfo & } } -void RsTurtleGxsSearchRequestItem::performLocalSearch(TurtleSearchRequestInfo &req, std::list& result) const +void RsTurtleGenericSearchRequestItem::performLocalSearch(TurtleSearchRequestInfo &req, std::list& result) const { std::cerr << "(EE) p3turtle: Missing code to perform actual GXS search" << std::endl; } -void RsTurtleGxsGroupRequestItem::performLocalSearch(TurtleSearchRequestInfo &req, std::list& result) const -{ - std::cerr << "(EE) p3turtle: Missing code to perform actual retrieval of GXS group" << std::endl; -} - - void RsTurtleStringSearchRequestItem::search(std::list& result) const { /* call to core */ @@ -1939,6 +1959,34 @@ TurtleRequestId p3turtle::turtleSearch(const RsRegularExpression::LinearizedExpr return id ; } +TurtleRequestId p3turtle::turtleSearch(unsigned char *search_bin_data,uint32_t search_bin_data_len,RsTurtleClientService *client_service) +{ + // generate a new search id. + + TurtleRequestId id = generateRandomRequestId() ; + + // Form a request packet that simulates a request from us. + // + RsTurtleGenericSearchRequestItem *item = new RsTurtleGenericSearchRequestItem ; + +#ifdef P3TURTLE_DEBUG + std::cerr << "performing search. OwnId = " << _own_id << std::endl ; +#endif + + item->PeerId(_own_id) ; + item->service_id = client_service->serviceId(); + item->search_data = search_bin_data ; + item->search_data_len = search_bin_data_len ; + item->request_id = id ; + item->depth = 0 ; + + // send it + + handleSearchRequest(item) ; + + return id ; +} + void p3turtle::monitorTunnels(const RsFileHash& hash,RsTurtleClientService *client_service,bool allow_multi_tunnels) { { @@ -1979,36 +2027,26 @@ void p3turtle::monitorTunnels(const RsFileHash& hash,RsTurtleClientService *clie IndicateConfigChanged() ; // initiates saving of handled hashes. } -void p3turtle::returnSearchResult(RsTurtleSearchResultItem *item) -{ #ifdef P3TURTLE_DEBUG std::cerr << " Returning result for search request " << HEX_PRINT(item->request_id) << " upwards." << std::endl ; #endif - RsTurtleFTSearchResultItem *ft_sr = dynamic_cast(item) ; - if(ft_sr != NULL) - { - RsServer::notify()->notifyTurtleSearchResult(ft_sr->request_id,ft_sr->result) ; - return ; - } - - RsTurtleGxsSearchResultGroupSummaryItem *gxs_sr_gs = dynamic_cast(item) ; - - if(gxs_sr_gs != NULL) - { - RsServer::notify()->notifyTurtleSearchResult(gxs_sr_gs->request_id,gxs_sr_gs->result) ; - return ; - } - RsTurtleGxsSearchResultGroupDataItem *gxs_sr_gd = dynamic_cast(item) ; - - if(gxs_sr_gd != NULL) - { -#warning MISSING CODE HERE TO HANDLE ENCRYPTED INCOMING GROUP DATA. - //RsServer::notify()->notifyTurtleSearchResult(gxs_sr_gd->request_id,gxs_sr_gd->encrypted_nxs_group) ; - return ; - } -} +// RsTurtleGxsSearchResultGroupSummaryItem *gxs_sr_gs = dynamic_cast(item) ; +// +// if(gxs_sr_gs != NULL) +// { +// RsServer::notify()->notifyTurtleSearchResult(gxs_sr_gs->request_id,gxs_sr_gs->result) ; +// return ; +// } +// RsTurtleGxsSearchResultGroupDataItem *gxs_sr_gd = dynamic_cast(item) ; +// +// if(gxs_sr_gd != NULL) +// { +//#warning MISSING CODE HERE TO HANDLE ENCRYPTED INCOMING GROUP DATA. +// //RsServer::notify()->notifyTurtleSearchResult(gxs_sr_gd->request_id,gxs_sr_gd->encrypted_nxs_group) ; +// return ; +// } /// Warning: this function should never be called while the turtle mutex is locked. /// Otherwize this is a possible source of cross-lock with the File mutex. diff --git a/libretroshare/src/turtle/p3turtle.h b/libretroshare/src/turtle/p3turtle.h index b3c4debe4..04d90c812 100644 --- a/libretroshare/src/turtle/p3turtle.h +++ b/libretroshare/src/turtle/p3turtle.h @@ -173,6 +173,7 @@ class TurtleSearchRequestInfo int depth ; // depth of the request. Used to optimize tunnel length. uint32_t result_count; // responses to this request. Useful to avoid spamming tunnel responses. std::string keywords; + RsTurtleClientService *client;// client who issues the request. This is null if the request does not have a local origin. }; class TurtleTunnelRequestInfo { @@ -244,11 +245,16 @@ class p3turtle: public p3Service, public RsTurtle, public p3Config // the request id, which will be further used by the gui to store results // as they come back. // - // Eventually, search requests should be handled by client services. We will therefore - // remove the specific file search packets from the turtle router. - // - virtual TurtleSearchRequestId turtleSearch(const std::string& string_to_match) ; - virtual TurtleSearchRequestId turtleSearch(const RsRegularExpression::LinearizedExpression& expr) ; + // The first two methods are old style search requests for FT, while the 3rd one is using a generic search data type, that is only to + // be deserialized by the service. The memory ownership is kept by the calling function. Similarly, the search response will be a + // generic data type that is to be deserialized by the client service. + // + // Eventually, search requests will use the generic system + // even for FT. We need to keep the old method for a while for backward compatibility. + // + virtual TurtleRequestId turtleSearch(const RsRegularExpression::LinearizedExpression& expr) ; + virtual TurtleRequestId turtleSearch(const std::string& string_to_match) ; + virtual TurtleRequestId turtleSearch(unsigned char *search_bin_data,uint32_t search_bin_data_len,RsTurtleClientService *client_service) ; // Initiates tunnel handling for the given file hash. tunnels. Launches // an exception if an error occurs during the initialization process. The @@ -393,9 +399,6 @@ class p3turtle: public p3Service, public RsTurtle, public p3Config /// Performs a search calling local cache and search structure. void performLocalSearch(const std::string& match_string,std::list& result) ; - /// Returns a search result upwards (possibly to the gui) - void returnSearchResult(RsTurtleSearchResultItem *item) ; - /// Returns true if the file with given hash is hosted locally, and accessible in anonymous mode the supplied peer. virtual bool performLocalHashSearch(const TurtleFileHash& hash,const RsPeerId& client_peer_id,RsTurtleClientService *& service); diff --git a/libretroshare/src/turtle/rsturtleitem.cc b/libretroshare/src/turtle/rsturtleitem.cc index 175996575..ce3a4450a 100644 --- a/libretroshare/src/turtle/rsturtleitem.cc +++ b/libretroshare/src/turtle/rsturtleitem.cc @@ -32,11 +32,8 @@ RsItem *RsTurtleSerialiser::create_item(uint16_t service,uint8_t item_subtype) c case RS_TURTLE_SUBTYPE_OPEN_TUNNEL : return new RsTurtleOpenTunnelItem(); case RS_TURTLE_SUBTYPE_TUNNEL_OK : return new RsTurtleTunnelOkItem(); case RS_TURTLE_SUBTYPE_GENERIC_DATA : return new RsTurtleGenericDataItem(); - - case RS_TURTLE_SUBTYPE_GXS_SEARCH_REQUEST : return new RsTurtleGxsSearchRequestItem(); - case RS_TURTLE_SUBTYPE_GXS_GROUP_REQUEST : return new RsTurtleGxsGroupRequestItem(); - case RS_TURTLE_SUBTYPE_GXS_GROUP_SUMMARY : return new RsTurtleGxsSearchResultGroupSummaryItem(); - case RS_TURTLE_SUBTYPE_GXS_GROUP_DATA : return new RsTurtleGxsSearchResultGroupDataItem(); + case RS_TURTLE_SUBTYPE_GENERIC_SEARCH_REQUEST : return new RsTurtleGenericSearchRequestItem(); + case RS_TURTLE_SUBTYPE_GENERIC_SEARCH_RESULT : return new RsTurtleGenericSearchResultItem(); default: break ; @@ -65,21 +62,24 @@ void RsTurtleRegExpSearchRequestItem::serial_process(RsGenericSerializer::Serial RsTypeSerializer::serial_process(j,ctx,depth,"depth") ; RsTypeSerializer::serial_process(j,ctx,expr,"expr") ; } -void RsTurtleGxsSearchRequestItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) +void RsTurtleGenericSearchRequestItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) { RsTypeSerializer::serial_process(j,ctx,request_id,"request_id") ; RsTypeSerializer::serial_process(j,ctx,depth,"depth") ; RsTypeSerializer::serial_process(j,ctx,service_id,"service_id") ; - RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_VALUE,match_string,"match_string") ; -} -void RsTurtleGxsGroupRequestItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) -{ - RsTypeSerializer::serial_process(j,ctx,request_id,"request_id") ; - RsTypeSerializer::serial_process(j,ctx,depth,"depth") ; - RsTypeSerializer::serial_process(j,ctx,service_id,"service_id") ; - RsTypeSerializer::serial_process(j,ctx,hashed_group_id,"hashed_group_id") ; -} + RsTypeSerializer::TlvMemBlock_proxy prox(search_data,search_data_len) ; + RsTypeSerializer::serial_process(j,ctx,prox,"search_data") ; +} +RsTurtleSearchRequestItem *RsTurtleGenericSearchRequestItem::clone() const +{ + RsTurtleGenericSearchRequestItem *sr = new RsTurtleGenericSearchRequestItem ; + + sr->search_data = (unsigned char*)rs_malloc(search_data_len) ; + memcpy(sr->search_data,search_data,search_data_len) ; + sr->search_data_len = search_data_len ; + return sr ; +} template<> uint32_t RsTypeSerializer::serial_size(const RsRegularExpression::LinearizedExpression& r) { uint32_t s = 0 ; @@ -164,18 +164,24 @@ void RsTurtleFTSearchResultItem::serial_process(RsGenericSerializer::SerializeJo RsTypeSerializer::serial_process(j,ctx,depth ,"depth") ; RsTypeSerializer::serial_process (j,ctx,result ,"result") ; } -void RsTurtleGxsSearchResultGroupSummaryItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) +void RsTurtleGenericSearchResultItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) { RsTypeSerializer::serial_process(j,ctx,request_id,"request_id") ; RsTypeSerializer::serial_process(j,ctx,depth ,"depth") ; - RsTypeSerializer::serial_process (j,ctx,result ,"result") ; + + RsTypeSerializer::TlvMemBlock_proxy prox(result_data,result_data_len) ; + RsTypeSerializer::serial_process(j,ctx,prox,"search_data") ; } -void RsTurtleGxsSearchResultGroupDataItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) +RsTurtleSearchResultItem *RsTurtleGenericSearchResultItem::duplicate() const { - RsTypeSerializer::serial_process (j,ctx,request_id,"request_id") ; - RsTypeSerializer::serial_process (j,ctx,depth ,"depth") ; - RsTypeSerializer::serial_process(j,ctx,encrypted_nxs_group,"encrypted_nxs_group") ; + RsTurtleGenericSearchResultItem *sr = new RsTurtleGenericSearchResultItem ; + + sr->result_data = (unsigned char*)rs_malloc(result_data_len) ; + memcpy(sr->result_data,result_data,result_data_len) ; + sr->result_data_len = result_data_len ; + return sr ; } + template<> uint32_t RsTypeSerializer::serial_size(const TurtleFileInfo& i) { uint32_t s = 0 ; @@ -222,52 +228,6 @@ template<> void RsTypeSerializer::print_data(const std::string& n, const TurtleF std::cerr << " [FileInfo ] " << n << " size=" << i.size << " hash=" << i.hash << ", name=" << i.name << std::endl; } -template<> uint32_t RsTypeSerializer::serial_size(const TurtleGxsInfo& i) -{ - uint32_t s = 0 ; - - s += 2 ; // service_id - s += i.group_id.SIZE_IN_BYTES ; - s += GetTlvStringSize(i.name) ; - - return s; -} - -template<> bool RsTypeSerializer::deserialize(const uint8_t data[],uint32_t size,uint32_t& offset,TurtleGxsInfo& i) -{ - uint32_t saved_offset = offset ; - bool ok = true ; - - ok &= getRawUInt16(data, size, &offset, &i.service_id); // service_id - ok &= i.group_id.deserialise(data, size, offset); // group_id - ok &= GetTlvString(data, size, &offset, TLV_TYPE_STR_NAME, i.name); // group name - - if(!ok) - offset = saved_offset ; - - return ok; -} - -template<> bool RsTypeSerializer::serialize(uint8_t data[],uint32_t size,uint32_t& offset,const TurtleGxsInfo& i) -{ - uint32_t saved_offset = offset ; - bool ok = true ; - - ok &= setRawUInt16(data, size, &offset, i.service_id); // service_id - ok &= i.group_id.serialise(data, size, offset); // group_id - ok &= SetTlvString(data, size, &offset, TLV_TYPE_STR_NAME, i.name); // group name - - if(!ok) - offset = saved_offset ; - - return ok; -} - -template<> void RsTypeSerializer::print_data(const std::string& n, const TurtleGxsInfo& i) -{ - std::cerr << " [GXS Info ] " << n << " group_id=" << i.group_id << " service=" << std::hex << i.service_id << std::dec << ", name=" << i.name << std::endl; -} - void RsTurtleOpenTunnelItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) { RsTypeSerializer::serial_process (j,ctx,file_hash ,"file_hash") ; diff --git a/libretroshare/src/turtle/rsturtleitem.h b/libretroshare/src/turtle/rsturtleitem.h index 885ab04de..035490bc1 100644 --- a/libretroshare/src/turtle/rsturtleitem.h +++ b/libretroshare/src/turtle/rsturtleitem.h @@ -23,17 +23,15 @@ const uint8_t RS_TURTLE_SUBTYPE_FILE_REQUEST = 0x07 ; const uint8_t RS_TURTLE_SUBTYPE_FILE_DATA = 0x08 ; const uint8_t RS_TURTLE_SUBTYPE_REGEXP_SEARCH_REQUEST = 0x09 ; const uint8_t RS_TURTLE_SUBTYPE_GENERIC_DATA = 0x0a ; -const uint8_t RS_TURTLE_SUBTYPE_GXS_SEARCH_REQUEST = 0x0b ; -const uint8_t RS_TURTLE_SUBTYPE_GXS_GROUP_REQUEST = 0x0c ; +const uint8_t RS_TURTLE_SUBTYPE_GENERIC_SEARCH_REQUEST = 0x0b ; +const uint8_t RS_TURTLE_SUBTYPE_GENERIC_SEARCH_RESULT = 0x0c ; const uint8_t RS_TURTLE_SUBTYPE_FILE_MAP = 0x10 ; const uint8_t RS_TURTLE_SUBTYPE_FILE_MAP_REQUEST = 0x11 ; -const uint8_t RS_TURTLE_SUBTYPE_CHUNK_CRC = 0x14 ; -const uint8_t RS_TURTLE_SUBTYPE_CHUNK_CRC_REQUEST = 0x15 ; -const uint8_t RS_TURTLE_SUBTYPE_GXS_GROUP_SUMMARY = 0x16 ; -const uint8_t RS_TURTLE_SUBTYPE_GXS_GROUP_DATA = 0x17 ; - // const uint8_t RS_TURTLE_SUBTYPE_FILE_CRC = 0x12 ; // unused // const uint8_t RS_TURTLE_SUBTYPE_FILE_CRC_REQUEST = 0x13 ; +const uint8_t RS_TURTLE_SUBTYPE_CHUNK_CRC = 0x14 ; +const uint8_t RS_TURTLE_SUBTYPE_CHUNK_CRC_REQUEST = 0x15 ; + class TurtleSearchRequestInfo ; @@ -106,6 +104,8 @@ class RsTurtleFileSearchRequestItem: public RsTurtleSearchRequestItem virtual ~RsTurtleFileSearchRequestItem() {} virtual void performLocalSearch(TurtleSearchRequestInfo& req,std::list&) const ; // abstracts the search method + + protected: virtual void search(std::list &) const =0; }; @@ -151,44 +151,29 @@ class RsTurtleRegExpSearchRequestItem: public RsTurtleFileSearchRequestItem void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); }; -class RsTurtleGxsSearchRequestItem: public RsTurtleSearchRequestItem +class RsTurtleGenericSearchRequestItem: public RsTurtleSearchRequestItem { public: - RsTurtleGxsSearchRequestItem() : RsTurtleSearchRequestItem(RS_TURTLE_SUBTYPE_GXS_SEARCH_REQUEST) {} - virtual ~RsTurtleGxsSearchRequestItem() {} + RsTurtleGenericSearchRequestItem() : RsTurtleSearchRequestItem(RS_TURTLE_SUBTYPE_GENERIC_SEARCH_REQUEST) {} + virtual ~RsTurtleGenericSearchRequestItem() { clear(); } - std::string match_string ; // string to match - uint16_t service_id ; // searvice to search + uint16_t service_id ; // service to search + uint32_t search_data_len ; + unsigned char *search_data ; - std::string GetKeywords() { return match_string; } + std::string GetKeywords() { return std::string("Generic search " + RsUtil::BinToHex(search_data,search_data_len,10)); } - virtual void performLocalSearch(TurtleSearchRequestInfo& req,std::list&) const ; // abstracts the search method - virtual RsTurtleSearchRequestItem *clone() const { return new RsTurtleGxsSearchRequestItem(*this) ; } - void clear() { match_string.clear() ; } + virtual RsTurtleSearchRequestItem *clone() const ; + void clear() { free(search_data); search_data=NULL; search_data_len=0; } + virtual void performLocalSearch(TurtleSearchRequestInfo &req, std::list& result) const; protected: void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); + + private: + RsTurtleGenericSearchRequestItem(const RsTurtleGenericSearchRequestItem&): RsTurtleSearchRequestItem(RS_TURTLE_SUBTYPE_GENERIC_SEARCH_REQUEST) {} // make the object non copi-able. + RsTurtleGenericSearchRequestItem& operator=(const RsTurtleGenericSearchRequestItem&) { return *this;} }; - -class RsTurtleGxsGroupRequestItem: public RsTurtleSearchRequestItem -{ - public: - RsTurtleGxsGroupRequestItem() : RsTurtleSearchRequestItem(RS_TURTLE_SUBTYPE_GXS_GROUP_REQUEST) {} - virtual ~RsTurtleGxsGroupRequestItem() {} - - uint16_t service_id ; // searvice to search - Sha1CheckSum hashed_group_id ; // the group ID is hashed in order to keep it private. - - virtual RsTurtleSearchRequestItem *clone() const { return new RsTurtleGxsGroupRequestItem(*this) ; } - - virtual void performLocalSearch(TurtleSearchRequestInfo& req,std::list&) const ; // abstracts the search method - void clear() { hashed_group_id.clear() ; } - std::string GetKeywords() { return hashed_group_id.toStdString(); } - - protected: - void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); -}; - class RsTurtleSearchResultItem: public RsTurtleItem { public: @@ -199,7 +184,6 @@ class RsTurtleSearchResultItem: public RsTurtleItem // If the actual depth is 1, this field will be 1. // If the actual depth is > 1, this field is a larger arbitrary integer. - virtual void clear() =0; virtual uint32_t count() const =0; virtual void pop() =0; @@ -222,33 +206,20 @@ class RsTurtleFTSearchResultItem: public RsTurtleSearchResultItem void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); }; -class RsTurtleGxsSearchResultGroupSummaryItem: public RsTurtleSearchResultItem +class RsTurtleGenericSearchResultItem: public RsTurtleSearchResultItem { public: - RsTurtleGxsSearchResultGroupSummaryItem() : RsTurtleSearchResultItem(RS_TURTLE_SUBTYPE_GXS_GROUP_SUMMARY){} - virtual ~RsTurtleGxsSearchResultGroupSummaryItem() {} + RsTurtleGenericSearchResultItem() : RsTurtleSearchResultItem(RS_TURTLE_SUBTYPE_GENERIC_SEARCH_RESULT){} + virtual ~RsTurtleGenericSearchResultItem() {} - std::list result ; + uint32_t count() const { return result_data_len/50 ; } // This is a blind size estimate. We should probably use the actual size to limit search results. + virtual void pop() {} - void clear() { result.clear() ; } - uint32_t count() const { return result.size() ; } - virtual void pop() { result.pop_back() ;} - virtual RsTurtleSearchResultItem *duplicate() const { return new RsTurtleGxsSearchResultGroupSummaryItem(*this) ; } - protected: - void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); -}; -class RsTurtleGxsSearchResultGroupDataItem: public RsTurtleSearchResultItem -{ - public: - RsTurtleGxsSearchResultGroupDataItem() : RsTurtleSearchResultItem(RS_TURTLE_SUBTYPE_GXS_GROUP_DATA){} - virtual ~RsTurtleGxsSearchResultGroupDataItem() {} + unsigned char *result_data ; + uint32_t result_data_len ; - RsTlvBinaryData encrypted_nxs_group; // data is encrypted with group ID. - - uint32_t count() const { return 1 ; } - virtual void pop() { clear(); } - void clear() { encrypted_nxs_group.TlvClear() ; } - virtual RsTurtleSearchResultItem *duplicate() const { return new RsTurtleGxsSearchResultGroupDataItem(*this) ; } + virtual RsTurtleSearchResultItem *duplicate() const ; + void clear() { free(result_data); result_data=NULL; result_data_len=0; } protected: void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); }; @@ -262,10 +233,10 @@ class RsTurtleOpenTunnelItem: public RsTurtleItem public: RsTurtleOpenTunnelItem() : RsTurtleItem(RS_TURTLE_SUBTYPE_OPEN_TUNNEL), request_id(0), partial_tunnel_id(0), depth(0) { setPriorityLevel(QOS_PRIORITY_RS_TURTLE_OPEN_TUNNEL) ;} - TurtleFileHash file_hash ; // hash to match - uint32_t request_id ; // randomly generated request id. + TurtleFileHash file_hash ; // hash to match + uint32_t request_id ; // randomly generated request id. uint32_t partial_tunnel_id ; // uncomplete tunnel id. Will be completed at destination. - uint16_t depth ; // Used for limiting search depth. + uint16_t depth ; // Used for limiting search depth. void clear() { file_hash.clear() ;} protected: diff --git a/libretroshare/src/turtle/turtleclientservice.h b/libretroshare/src/turtle/turtleclientservice.h index 962e57cf0..277c8d5c3 100644 --- a/libretroshare/src/turtle/turtleclientservice.h +++ b/libretroshare/src/turtle/turtleclientservice.h @@ -42,6 +42,18 @@ class p3turtle ; class RsTurtleClientService { public: + /*! + * \brief serviceId + * Returns the ID of the client service. This is used to pass the ID to search requests, from the client services + * \return + * The service ID. + */ + + virtual uint16_t serviceId() const + { + std::cerr << "!!!!!! Received request for service ID in turtle router client, but the client service is not handling it !!!!!!!" << std::endl ; + return 0 ; + } /*! * \brief handleTunnelRequest @@ -52,7 +64,6 @@ class RsTurtleClientService */ virtual bool handleTunnelRequest(const RsFileHash& /*hash*/,const RsPeerId& /*peer_id*/) { return false ; } - /*! * \brief receiveTurtleData * This method is called by the turtle router to send data that comes out of a turtle tunnel, and should @@ -74,11 +85,43 @@ class RsTurtleClientService * By default (if not overloaded), the method will just free the data, as any subclass should do as well. * Note: p3turtle stays owner of the item, so the client should not delete it! */ - virtual void receiveTurtleData(RsTurtleGenericTunnelItem */*item*/,const RsFileHash& /*hash*/,const RsPeerId& /*virtual_peer_id*/,RsTurtleGenericTunnelItem::Direction /*direction*/) + virtual void receiveTurtleData(const RsTurtleGenericTunnelItem * /* item */,const RsFileHash& /*hash*/,const RsPeerId& /*virtual_peer_id*/,RsTurtleGenericTunnelItem::Direction /*direction*/) { std::cerr << "!!!!!! Received Data from turtle router, but the client service is not handling it !!!!!!!!!!" << std::endl ; } + /*! + * \brief receiveSearchRequest + * This method is called by the turtle router to notify the client of a search request in the form generic data. The returned + * result contains the serialised generic result returned by the client. + * + * The turtle router keeps the memory ownership over search_request_data + * + * \param search_request_data generic serialized search data + * \param search_request_data_len length of the serialized search data + * \param search_result_data generic serialized search result data + * \param search_result_data_len length of the serialized search result data + * + * \return true if the search is successful. + */ + virtual bool receiveSearchRequest(unsigned char */*search_request_data*/,uint32_t /*search_request_data_len*/,unsigned char *& /*search_result_data*/,uint32_t& /*search_result_data_len*/) + { + std::cerr << "!!!!!! Received search result from turtle router, but the client service who requested it is not handling it !!!!!!!!!!" << std::endl ; + return false; + } + + /*! + * \brief receiveSearchResult + * This method is called by the turtle router to notify the client of a search result. The result is serialized for the current class to read. + * + * \param search_result_data result data. Memory ownership is owned by the turtle router. So do not delete! + * \param search_result_data length of result data + */ + virtual void receiveSearchResult(unsigned char * /*search_result_data*/,uint32_t /*search_result_data_len*/) + { + std::cerr << "!!!!!! Received search result from turtle router, but the client service who requested it is not handling it !!!!!!!!!!" << std::endl ; + } + /*! * \brief serializer * Method for creating specific items of the client service. The diff --git a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp index bc2f08644..f1c2e2fb6 100644 --- a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp @@ -792,7 +792,7 @@ void SearchDialog::advancedSearch(RsRegularExpression::Expression* expression) RsRegularExpression::LinearizedExpression e ; expression->linearize(e) ; - TurtleRequestId req_id = rsTurtle->turtleSearch(e) ; + TurtleRequestId req_id = rsFiles->turtleSearch(e) ; // This will act before turtle results come to the interface, thanks to the signals scheduling policy. initSearchResult(QString::fromStdString(e.GetStrings()),req_id, ui.FileTypeComboBox->currentIndex(), true) ; @@ -858,9 +858,9 @@ void SearchDialog::searchKeywords(const QString& keywords) if(ui._anonF2Fsearch_CB->isChecked()) { if(n==1) - req_id = rsTurtle->turtleSearch(words.front()) ; + req_id = rsFiles->turtleSearch(words.front()) ; else - req_id = rsTurtle->turtleSearch(lin_exp) ; + req_id = rsFiles->turtleSearch(lin_exp) ; } else req_id = RSRandom::random_u32() ; // generate a random 32 bits request id diff --git a/retroshare-gui/src/gui/notifyqt.h b/retroshare-gui/src/gui/notifyqt.h index 597231703..56ec5c42a 100644 --- a/retroshare-gui/src/gui/notifyqt.h +++ b/retroshare-gui/src/gui/notifyqt.h @@ -23,7 +23,9 @@ class MessengerWindow; class ToasterItem; class ToasterNotify; class SignatureEventData ; + struct TurtleFileInfo; +struct TurtleGxsInfo; class NotifyQt: public QObject, public NotifyClient { From 6fb459ce642cd04377ee3975560902b9d7f65577 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 10 Jun 2018 22:34:17 +0200 Subject: [PATCH 074/138] added logic for GXS search in RsGxsNetTunnel and Gxs client net service --- libretroshare/src/ft/ftserver.cc | 2 +- libretroshare/src/gxs/rsgxsnetservice.cc | 10 +- libretroshare/src/gxs/rsgxsnetservice.h | 8 + libretroshare/src/gxs/rsgxsnettunnel.cc | 230 ++++++++++++++++-- libretroshare/src/gxs/rsgxsnettunnel.h | 18 +- libretroshare/src/gxs/rsnxs.h | 24 ++ libretroshare/src/turtle/p3turtle.cc | 2 +- .../src/turtle/turtleclientservice.h | 2 +- 8 files changed, 273 insertions(+), 23 deletions(-) diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index 3172cfd89..a454be33f 100644 --- a/libretroshare/src/ft/ftserver.cc +++ b/libretroshare/src/ft/ftserver.cc @@ -1462,7 +1462,7 @@ TurtleSearchRequestId ftServer::turtleSearch(const RsRegularExpression::Lineariz return mTurtleRouter->turtleSearch(expr) ; } -#warning we should do this here, but for now it's done by turtle router. +#warning we should do this here, but for now it is done by turtle router. // // Dont delete the item. The client (p3turtle) is doing it after calling this. // // // void ftServer::receiveSearchResult(RsTurtleSearchResultItem *item) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index b0d1743d6..d83ceed54 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -5105,9 +5105,15 @@ bool RsGxsNetService::locked_stampMsgServerUpdateTS(const RsGxsGroupId& gid) void RsGxsNetService::turtleGroupRequest(const RsGxsGroupId& group_id) { - mGxsNetTunnel->turtleGroupRequest(group_id) ; + mGxsNetTunnel->turtleGroupRequest(group_id,this) ; } void RsGxsNetService::turtleSearchRequest(const std::string& match_string) { - mGxsNetTunnel->turtleSearchRequest(match_string) ; + mGxsNetTunnel->turtleSearchRequest(match_string,this) ; +} + +bool RsGxsNetService::search(const std::string& substring,std::list& group_infos) +{ +#warning MISSING CODE HERE! + return true ; } diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index aa8f8288c..9643f49bf 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -122,8 +122,16 @@ public: virtual void setDefaultKeepAge(uint32_t t) { mDefaultMsgStorePeriod = t ; } virtual void setDefaultSyncAge(uint32_t t) { mDefaultMsgSyncPeriod = t ; } + /*! + * \brief Search methods. + * These four methods are used to request distant search and receive the results. + * \param group_id + */ virtual void turtleGroupRequest(const RsGxsGroupId& group_id); virtual void turtleSearchRequest(const std::string& match_string); + + virtual bool search(const std::string& substring,std::list& group_infos) ; + /*! * pauses synchronisation of subscribed groups and request for group id * from peers diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 964f15781..7cd657a55 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -27,6 +27,7 @@ #include "util/rstime.h" #include "retroshare/rspeers.h" #include "serialiser/rstypeserializer.h" +#include "gxs/rsnxs.h" #include "rsgxsnettunnel.h" #define DEBUG_RSGXSNETTUNNEL 1 @@ -52,9 +53,13 @@ RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") const uint16_t RS_SERVICE_TYPE_GXS_NET_TUNNEL = 0x2233 ; -const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_VIRTUAL_PEER = 0x01 ; -const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_KEEP_ALIVE = 0x02 ; -const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_RANDOM_BIAS = 0x03 ; +const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_VIRTUAL_PEER = 0x01 ; +const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_KEEP_ALIVE = 0x02 ; +const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_RANDOM_BIAS = 0x03 ; +const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_SUBSTRING = 0x04 ; +const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_REQUEST = 0x05 ; +const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_SUMMARY = 0x06 ; +const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_DATA = 0x07 ; class RsGxsNetTunnelItem: public RsItem { @@ -107,6 +112,57 @@ public: Bias20Bytes mRandomBias; // Cannot be a simple char[] because of serialization. }; +class RsGxsNetTunnelTurtleSearchSubstringItem: public RsGxsNetTunnelItem +{ +public: + explicit RsGxsNetTunnelTurtleSearchSubstringItem(): RsGxsNetTunnelItem(RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_SUBSTRING) {} + virtual ~RsGxsNetTunnelTurtleSearchSubstringItem() {} + + uint16_t service ; + std::string substring_match ; + + virtual void clear() { substring_match.clear() ; } + virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) + { + RsTypeSerializer::serial_process(j,ctx,service,"service") ; + RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_KEY,substring_match,"substring_match") ; + } +}; + +class RsGxsNetTunnelTurtleSearchGroupRequestItem: public RsGxsNetTunnelItem +{ +public: + explicit RsGxsNetTunnelTurtleSearchGroupRequestItem(): RsGxsNetTunnelItem(RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_REQUEST) {} + virtual ~RsGxsNetTunnelTurtleSearchGroupRequestItem() {} + + uint16_t service ; + Sha1CheckSum hashed_group_id ; + + virtual void clear() { hashed_group_id.clear() ; } + virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) + { + RsTypeSerializer::serial_process(j,ctx,service,"service") ; + RsTypeSerializer::serial_process(j,ctx,hashed_group_id,"hashed_group_id") ; + } +}; + +class RsGxsNetTunnelTurtleSearchGroupSummaryItem: public RsGxsNetTunnelItem +{ +public: + explicit RsGxsNetTunnelTurtleSearchGroupSummaryItem(): RsGxsNetTunnelItem(RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_SUMMARY) {} + virtual ~RsGxsNetTunnelTurtleSearchGroupSummaryItem() {} + + uint16_t service ; + std::list group_infos; + + virtual void clear() { group_infos.clear() ; } + + virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) + { + RsTypeSerializer::serial_process(j,ctx,service,"service") ; + RsTypeSerializer::serial_process(j,ctx,group_infos,"group_infos") ; + } +}; class RsGxsNetTunnelSerializer: public RsServiceSerializer { public: @@ -132,10 +188,32 @@ public: } }; +template<> +void RsTypeSerializer::serial_process( RsGenericSerializer::SerializeJob j, RsGenericSerializer::SerializeContext& ctx, RsGxsGroupSummary& gs, const std::string& member_name ) +{ + RsTypeSerializer::serial_process(j,ctx,gs.group_id,member_name+"-group_id") ; // RsGxsGroupId group_id ; + RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_NAME ,gs.group_name,member_name+"-group_name") ; // std::string group_name ; + RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_COMMENT,gs.group_description,member_name+"-group_description") ; // std::string group_description ; + RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_VALUE ,gs.search_context,member_name+"-group_name") ; // std::string search_context ; + RsTypeSerializer::serial_process(j,ctx,gs.author_id ,member_name+"-author_id") ; // RsGxsId author_id ; + RsTypeSerializer::serial_process(j,ctx,gs.publish_ts ,member_name+"-publish_ts") ; // time_t publish_ts ; + RsTypeSerializer::serial_process(j,ctx,gs.number_of_messages,member_name+"-number_of_messages") ; // uint32_t number_of_messages ; + RsTypeSerializer::serial_process(j,ctx,gs.last_message_ts,member_name+"-last_message_ts") ; // time_t last_message_ts ; +} + //===========================================================================================================================================// // Interface with rest of the software // //===========================================================================================================================================// +bool RsGxsNetTunnelService::registerSearchableService(RsNetworkExchangeService *gxs_service) +{ + RS_STACK_MUTEX(mGxsNetTunnelMtx); + + mSearchableServices[gxs_service->serviceType()] = gxs_service ; + + return true; +} + class DataAutoDelete { public: @@ -853,22 +931,144 @@ RsSerialiser *RsGxsNetTunnelService::setupSerialiser() return ser ; } -bool RsGxsNetTunnelService::receiveSearchRequest(unsigned char *search_request_data,uint32_t search_request_data_len,unsigned char *& search_result_data,uint32_t& search_result_data_len) +//===========================================================================================================================================// +// Turtle Search system // +//===========================================================================================================================================// + +TurtleRequestId RsGxsNetTunnelService::turtleGroupRequest(const RsGxsGroupId& group_id,RsNetworkExchangeService *client_service) { - std::cerr << __PRETTY_FUNCTION__ << ": received a request. Code needed to handle it" << std::endl; + Sha1CheckSum hashed_group_id = RsDirUtil::sha1sum(group_id.toByteArray(),group_id.SIZE_IN_BYTES) ; + + GXS_NET_TUNNEL_DEBUG() << ": starting a turtle group request for grp \"" << group_id << "\" hashed to \"" << hashed_group_id << "\"" << std::endl; + + RsGxsNetTunnelTurtleSearchGroupRequestItem search_item ; + search_item.hashed_group_id = hashed_group_id ; + search_item.service = client_service->serviceType() ; + + uint32_t size = RsGxsNetTunnelSerializer().size(&search_item) ; + unsigned char *mem = (unsigned char*)rs_malloc(size) ; + + if(mem == NULL) + return 0 ; + + RsGxsNetTunnelSerializer().serialise(&search_item,mem,&size); + + return mTurtle->turtleSearch(mem,size,this) ; +} + +TurtleRequestId RsGxsNetTunnelService::turtleSearchRequest(const std::string& match_string,RsNetworkExchangeService *client_service) +{ + GXS_NET_TUNNEL_DEBUG() << ": starting a turtle search request for string\"" << match_string << "\"" << std::endl; + + RsGxsNetTunnelTurtleSearchSubstringItem search_item ; + search_item.substring_match = match_string ; + search_item.service = client_service->serviceType() ; + + uint32_t size = RsGxsNetTunnelSerializer().size(&search_item) ; + unsigned char *mem = (unsigned char*)rs_malloc(size) ; + + if(mem == NULL) + return 0 ; + + RsGxsNetTunnelSerializer().serialise(&search_item,mem,&size); + + return mTurtle->turtleSearch(mem,size,this) ; +} + +bool RsGxsNetTunnelService::receiveSearchRequest(unsigned char *search_request_data,uint32_t search_request_data_len,unsigned char *& search_result_data,uint32_t& search_result_data_size) +{ + GXS_NET_TUNNEL_DEBUG() << ": received a request." << std::endl; + + RsItem *item = RsGxsNetTunnelSerializer().deserialise(search_request_data,&search_request_data_len) ; + + RsGxsNetTunnelTurtleSearchSubstringItem *substring_sr = dynamic_cast(item) ; + + if(substring_sr != NULL) + { + auto it = mSearchableServices.find(substring_sr->service) ; + + std::list results ; + + if(it != mSearchableServices.end() && it->second->search(substring_sr->substring_match,results)) + { + RsGxsNetTunnelTurtleSearchGroupSummaryItem search_result_item ; + + search_result_item.service = substring_sr->service ; + search_result_item.group_infos = results ; + + search_result_data_size = RsGxsNetTunnelSerializer().size(&search_result_item) ; + search_result_data = (unsigned char*)rs_malloc(search_result_data_size) ; + + if(search_result_data == NULL) + return false ; + + RsGxsNetTunnelSerializer().serialise(&search_result_item,search_result_data,&search_result_data_size); + + return true ; + } + } + + RsGxsNetTunnelTurtleSearchGroupRequestItem *substring_gr = dynamic_cast(item) ; + + if(substring_gr != NULL) + { +#ifdef TODO + auto it = mSearchableGxsServices.find(substring_sr->service) ; + + RsNxsGrp *grp = NULL ; + + if(it != mSearchableGxsServices.end() && it->second.search(substring_sr->group_id,grp)) + { + RsGxsNetTunnelTurtleSearchGroupDataItem search_result_item ; + + search_result_item.service = substring_sr->service ; + search_result_item.group_infos = results ; + + search_result_data_size = RsGxsNetTunnelSerializer().size(&search_result_item) ; + search_result_data = (unsigned char*)rs_malloc(size) ; + + if(search_result_data == NULL) + return false ; + + RsGxsNetTunnelSerializer().serialise(&search_result_item,search_result_data,&search_result_data_size); + + return true ; + } +#endif + } + return false ; } -void RsGxsNetTunnelService::receiveSearchResult(unsigned char *search_result_data,uint32_t search_result_data_len) + +void RsGxsNetTunnelService::receiveSearchResult(TurtleSearchRequestId request_id,unsigned char *search_result_data,uint32_t search_result_data_len) { - std::cerr << __PRETTY_FUNCTION__ << ": received a search result. Code needed to handle it" << std::endl; + RsItem *item = RsGxsNetTunnelSerializer().deserialise(search_result_data,&search_result_data_len); + + RsGxsNetTunnelTurtleSearchGroupSummaryItem *result_gs = dynamic_cast(item) ; + + if(result_gs != NULL) + { + + } } -void RsGxsNetTunnelService::turtleGroupRequest(const RsGxsGroupId& group_id) -{ - std::cerr << __PRETTY_FUNCTION__ << ": handling of turtle group request not implemented yet" << std::endl; -} -void RsGxsNetTunnelService::turtleSearchRequest(const std::string& match_string) -{ - std::cerr << __PRETTY_FUNCTION__ << ": handling of turtle search request not implemented yet" << std::endl; -} + + + + + + + + + + + + + + + + + + + diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index f85b997f5..22917f35b 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -105,6 +105,7 @@ typedef RsPeerId RsGxsNetTunnelVirtualPeerId ; class RsGxsNetTunnelItem ; +class RsNetworkExchangeService ; struct RsGxsNetTunnelVirtualPeerInfo { @@ -159,6 +160,15 @@ public: RsGxsNetTunnelService() ; virtual ~RsGxsNetTunnelService() ; + /*! + * \brief registerSearchableService + * Adds the network exchange service as a possible search source. This is used to allow distant search on the corresponding + * GXS service. + * \return + * always returns true. + */ + bool registerSearchableService(RsNetworkExchangeService *) ; + /*! * \brief Manage tunnels for this group * @param group_id group for which tunnels should be released @@ -219,15 +229,15 @@ public: */ virtual void connectToTurtleRouter(p3turtle *tr) ; - void turtleGroupRequest(const RsGxsGroupId& group_id) ; - void turtleSearchRequest(const std::string& match_string) ; + TurtleRequestId turtleGroupRequest(const RsGxsGroupId& group_id, RsNetworkExchangeService *client_service) ; + TurtleRequestId turtleSearchRequest(const std::string& match_string,RsNetworkExchangeService *client_service) ; /*! * \brief receiveSearchRequest * See RsTurtleClientService::@ */ virtual bool receiveSearchRequest(unsigned char *search_request_data,uint32_t search_request_data_len,unsigned char *& search_result_data,uint32_t& search_result_data_len); - virtual void receiveSearchResult(unsigned char *search_result_data,uint32_t search_result_data_len) ; + virtual void receiveSearchResult(TurtleSearchRequestId request_id,unsigned char *search_result_data,uint32_t search_result_data_len); // Overloaded from RsTickingThread @@ -270,6 +280,8 @@ private: std::map > > mIncomingData; // list of incoming data items + std::map mSearchableServices ; + /*! * \brief Generates the hash to request tunnels for this group. This hash is only used by turtle, and is used to * hide the real group id. diff --git a/libretroshare/src/gxs/rsnxs.h b/libretroshare/src/gxs/rsnxs.h index 59d2bf209..5dfcde9d6 100644 --- a/libretroshare/src/gxs/rsnxs.h +++ b/libretroshare/src/gxs/rsnxs.h @@ -58,6 +58,26 @@ * 2 transfers only between group * - the also group matrix settings which is by default everyone can transfer to each other */ + +/*! + * \brief The RsGxsGroupSymmary struct + * This structure is used to transport group summary information when a GXS service is searched. It contains the group information + * as well as a context string to tell where the information was found. It is more compact than a GroupMeta object, so as to make + * search responses as light as possible. + */ +struct RsGxsGroupSummary +{ + RsGxsGroupId group_id ; + + std::string group_name ; + std::string group_description ; + std::string search_context ; + RsGxsId author_id ; + time_t publish_ts ; + uint32_t number_of_messages ; + time_t last_message_ts ; +}; + class RsNetworkExchangeService { public: @@ -65,6 +85,7 @@ public: RsNetworkExchangeService(){ return;} virtual ~RsNetworkExchangeService() {} + virtual uint16_t serviceType() const =0; /*! * Use this to set how far back synchronisation of messages should take place * @param age in seconds the max age a sync/store item can to be allowed in a synchronisation @@ -83,6 +104,9 @@ public: virtual void turtleGroupRequest(const RsGxsGroupId& group_id)=0; virtual void turtleSearchRequest(const std::string& match_string)=0; + + virtual bool search(const std::string& substring,std::list& group_infos) =0; + /*! * Initiates a search through the network * This returns messages which contains the search terms set in RsGxsSearch diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 9914d510c..1232b950c 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -1085,7 +1085,7 @@ void p3turtle::handleSearchResult(RsTurtleSearchResultItem *item) RsTurtleGenericSearchResultItem *gnsr = dynamic_cast(it->first) ; if(gnsr!=NULL) - (*it).second->receiveSearchResult(gnsr->result_data,gnsr->result_data_len) ; + (*it).second->receiveSearchResult(gnsr->request_id,gnsr->result_data,gnsr->result_data_len) ; } } diff --git a/libretroshare/src/turtle/turtleclientservice.h b/libretroshare/src/turtle/turtleclientservice.h index 277c8d5c3..9bdd15ad4 100644 --- a/libretroshare/src/turtle/turtleclientservice.h +++ b/libretroshare/src/turtle/turtleclientservice.h @@ -117,7 +117,7 @@ class RsTurtleClientService * \param search_result_data result data. Memory ownership is owned by the turtle router. So do not delete! * \param search_result_data length of result data */ - virtual void receiveSearchResult(unsigned char * /*search_result_data*/,uint32_t /*search_result_data_len*/) + virtual void receiveSearchResult(TurtleSearchRequestId /* request_id */,unsigned char * /*search_result_data*/,uint32_t /*search_result_data_len*/) { std::cerr << "!!!!!! Received search result from turtle router, but the client service who requested it is not handling it !!!!!!!!!!" << std::endl ; } From be1e127a93e3a704c825b4c3a116d989c8c2ab35 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 11 Jun 2018 22:00:03 +0200 Subject: [PATCH 075/138] added test search functions in rsgxsnetservice --- libretroshare/src/gxs/rsgxsnetservice.cc | 32 ++++++++++++++++++++++-- libretroshare/src/gxs/rsgxsnettunnel.cc | 5 ++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index d83ceed54..8636bc6b0 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -5112,8 +5112,36 @@ void RsGxsNetService::turtleSearchRequest(const std::string& match_string) mGxsNetTunnel->turtleSearchRequest(match_string,this) ; } +static bool termSearch(const std::string& src, const std::string& substring) +{ + /* always ignore case */ + return src.end() != std::search( src.begin(), src.end(), substring.begin(), substring.end(), RsRegularExpression::CompareCharIC() ); +} + bool RsGxsNetService::search(const std::string& substring,std::list& group_infos) { -#warning MISSING CODE HERE! - return true ; + RsGxsGrpMetaTemporaryMap grpMetaMap; + mDataStore->retrieveGxsGrpMetaData(grpMetaMap); + + RsGroupNetworkStats stats ; + + for(auto it(grpMetaMap.begin());it!=grpMetaMap.end();++it) + if(termSearch(it->second->mGroupName,substring)) + { + getGroupNetworkStats(it->first,stats) ; + + RsGxsGroupSummary s ; + s.group_id = it->first ; + s.group_name = it->second->mGroupName ; + s.group_description = it->second->mGroupName ; // to be filled with something better when we use the real search + s.search_context = it->second->mGroupName ; + s.author_id = it->second->mAuthorId; + s.publish_ts = it->second->mPublishTs; + s.number_of_messages = stats.mMaxVisibleCount ; + s.last_message_ts = stats.mLastGroupModificationTS ; + + group_infos.push_back(s) ; + } + + return !group_infos.empty(); } diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 7cd657a55..48382754b 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -1048,7 +1048,12 @@ void RsGxsNetTunnelService::receiveSearchResult(TurtleSearchRequestId request_id if(result_gs != NULL) { + std::cerr << "Received group summary result for search request " << std::hex << request_id << " for service " << result_gs->service << std::dec << ": " << std::endl; + for(auto it(result_gs->group_infos.begin());it!=result_gs->group_infos.end();++it) + std::cerr << " group " << (*it).group_id << ": " << (*it).group_name << ", " << (*it).number_of_messages << " messages, last is " << time(NULL)-(*it).last_message_ts << " secs ago." << std::endl; + +#warning MISSING CODE HERE - data should be passed up to UI in some way } } From 7a135c5c43750bc8ff279b3434d3dec910254d05 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 13 Jun 2018 22:46:27 +0200 Subject: [PATCH 076/138] added quick and dirty turtle search for channels in Files search tab --- libretroshare/src/gxs/rsgenexchange.h | 2 + libretroshare/src/gxs/rsgxsnetservice.cc | 8 +-- libretroshare/src/gxs/rsgxsnetservice.h | 4 +- libretroshare/src/gxs/rsgxsnettunnel.cc | 2 +- libretroshare/src/gxs/rsnxs.h | 5 +- libretroshare/src/retroshare/rsgxschannels.h | 5 +- libretroshare/src/services/p3gxschannels.cc | 6 +- libretroshare/src/services/p3gxschannels.h | 4 +- .../src/gui/FileTransfer/SearchDialog.cpp | 35 +++++++---- .../src/gui/FileTransfer/SearchDialog.ui | 59 +++++++++++++------ 10 files changed, 86 insertions(+), 44 deletions(-) diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h index 98b1d5d30..1e51d8b04 100644 --- a/libretroshare/src/gxs/rsgenexchange.h +++ b/libretroshare/src/gxs/rsgenexchange.h @@ -764,6 +764,8 @@ protected: */ int createMessage(RsNxsMsg* msg); + RsNetworkExchangeService *netService() const { return mNetService ; } + private: /*! * convenience function to create sign diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 8636bc6b0..da94cb002 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -5103,13 +5103,13 @@ bool RsGxsNetService::locked_stampMsgServerUpdateTS(const RsGxsGroupId& gid) return true; } -void RsGxsNetService::turtleGroupRequest(const RsGxsGroupId& group_id) +TurtleRequestId RsGxsNetService::turtleGroupRequest(const RsGxsGroupId& group_id) { - mGxsNetTunnel->turtleGroupRequest(group_id,this) ; + return mGxsNetTunnel->turtleGroupRequest(group_id,this) ; } -void RsGxsNetService::turtleSearchRequest(const std::string& match_string) +TurtleRequestId RsGxsNetService::turtleSearchRequest(const std::string& match_string) { - mGxsNetTunnel->turtleSearchRequest(match_string,this) ; + return mGxsNetTunnel->turtleSearchRequest(match_string,this) ; } static bool termSearch(const std::string& src, const std::string& substring) diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index 9643f49bf..db2de16b8 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -127,8 +127,8 @@ public: * These four methods are used to request distant search and receive the results. * \param group_id */ - virtual void turtleGroupRequest(const RsGxsGroupId& group_id); - virtual void turtleSearchRequest(const std::string& match_string); + virtual TurtleRequestId turtleGroupRequest(const RsGxsGroupId& group_id); + virtual TurtleRequestId turtleSearchRequest(const std::string& match_string); virtual bool search(const std::string& substring,std::list& group_infos) ; diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 48382754b..de67547d6 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -958,7 +958,7 @@ TurtleRequestId RsGxsNetTunnelService::turtleGroupRequest(const RsGxsGroupId& gr TurtleRequestId RsGxsNetTunnelService::turtleSearchRequest(const std::string& match_string,RsNetworkExchangeService *client_service) { - GXS_NET_TUNNEL_DEBUG() << ": starting a turtle search request for string\"" << match_string << "\"" << std::endl; + GXS_NET_TUNNEL_DEBUG() << ": starting a turtle search request for string \"" << match_string << "\"" << std::endl; RsGxsNetTunnelTurtleSearchSubstringItem search_item ; search_item.substring_match = match_string ; diff --git a/libretroshare/src/gxs/rsnxs.h b/libretroshare/src/gxs/rsnxs.h index 5dfcde9d6..9d3673f1c 100644 --- a/libretroshare/src/gxs/rsnxs.h +++ b/libretroshare/src/gxs/rsnxs.h @@ -36,6 +36,7 @@ #include "services/p3service.h" #include "retroshare/rsreputations.h" #include "retroshare/rsidentity.h" +#include "retroshare/rsturtle.h" #include "rsgds.h" /*! @@ -102,8 +103,8 @@ public: virtual uint32_t getDefaultSyncAge() =0; virtual uint32_t getDefaultKeepAge() =0; - virtual void turtleGroupRequest(const RsGxsGroupId& group_id)=0; - virtual void turtleSearchRequest(const std::string& match_string)=0; + virtual TurtleRequestId turtleGroupRequest(const RsGxsGroupId& group_id)=0; + virtual TurtleRequestId turtleSearchRequest(const std::string& match_string)=0; virtual bool search(const std::string& substring,std::list& group_infos) =0; diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index 175c7fc22..6bad3ba21 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -33,6 +33,7 @@ #include "retroshare/rstokenservice.h" #include "retroshare/rsgxsifacehelper.h" #include "retroshare/rsgxscommon.h" +#include "retroshare/rsturtle.h" @@ -96,8 +97,8 @@ virtual bool getPostData(const uint32_t &token, std::vector &p //virtual bool createComment(uint32_t &token, RsGxsComment &comment) = 0; //virtual bool createVote(uint32_t &token, RsGxsVote &vote) = 0; - virtual void turtleGroupRequest(const RsGxsGroupId& group_id)=0; - virtual void turtleSearchRequest(const std::string& match_string)=0; + virtual TurtleRequestId turtleGroupRequest(const RsGxsGroupId& group_id)=0; + virtual TurtleRequestId turtleSearchRequest(const std::string& match_string)=0; ////////////////////////////////////////////////////////////////////////////// virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0; diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index 7d36048de..493779a8c 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -1695,10 +1695,12 @@ void p3GxsChannels::handle_event(uint32_t event_type, const std::string &elabel) } } -void p3GxsChannels::turtleGroupRequest(const RsGxsGroupId& group_id) +TurtleRequestId p3GxsChannels::turtleGroupRequest(const RsGxsGroupId& group_id) { + return netService()->turtleGroupRequest(group_id) ; } -void p3GxsChannels::turtleSearchRequest(const std::string& match_string) +TurtleRequestId p3GxsChannels::turtleSearchRequest(const std::string& match_string) { + return netService()->turtleSearchRequest(match_string) ; } diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index c166dbc2f..685439211 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -72,8 +72,8 @@ virtual void service_tick(); virtual bool saveList(bool &cleanup, std::list&saveList); // @see p3Config::saveList(bool &cleanup, std::list&) virtual bool loadList(std::list& loadList); // @see p3Config::loadList(std::list&) - virtual void turtleGroupRequest(const RsGxsGroupId& group_id); - virtual void turtleSearchRequest(const std::string& match_string); + virtual TurtleRequestId turtleGroupRequest(const RsGxsGroupId& group_id); + virtual TurtleRequestId turtleSearchRequest(const std::string& match_string); // Overloaded to cache new groups. virtual RsGenExchange::ServiceCreate_Return service_CreateGroup(RsGxsGrpItem* grpItem, RsTlvSecurityKeySet& keySet); diff --git a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp index f1c2e2fb6..6e2bc4223 100644 --- a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp @@ -38,6 +38,7 @@ #include "gui/common/RSTreeWidgetItem.h" #include "util/QtVersion.h" +#include "retroshare/rsgxschannels.h" #include #include #include @@ -165,8 +166,10 @@ SearchDialog::SearchDialog(QWidget *parent) QHeaderView_setSectionResizeModeColumn(_smheader, SS_KEYWORDS_COL, QHeaderView::Interactive); QHeaderView_setSectionResizeModeColumn(_smheader, SS_RESULTS_COL, QHeaderView::Interactive); - _smheader->resizeSection ( SS_KEYWORDS_COL, 160 ); - _smheader->resizeSection ( SS_RESULTS_COL, 50 ); + float f = QFontMetricsF(font()).height()/14.0 ; + + _smheader->resizeSection ( SS_KEYWORDS_COL, 160*f ); + _smheader->resizeSection ( SS_RESULTS_COL, 50*f ); ui.searchResultWidget->setColumnCount(SR_COL_COUNT); _smheader = ui.searchResultWidget->header () ; @@ -174,12 +177,12 @@ SearchDialog::SearchDialog(QWidget *parent) QHeaderView_setSectionResizeModeColumn(_smheader, SR_SIZE_COL, QHeaderView::Interactive); QHeaderView_setSectionResizeModeColumn(_smheader, SR_SOURCES_COL, QHeaderView::Interactive); - _smheader->resizeSection ( SR_NAME_COL, 240 ); - _smheader->resizeSection ( SR_SIZE_COL, 75 ); - _smheader->resizeSection ( SR_SOURCES_COL, 75 ); - _smheader->resizeSection ( SR_TYPE_COL, 75 ); - _smheader->resizeSection ( SR_AGE_COL, 90 ); - _smheader->resizeSection ( SR_HASH_COL, 240 ); + _smheader->resizeSection ( SR_NAME_COL, 240*f ); + _smheader->resizeSection ( SR_SIZE_COL, 75*f ); + _smheader->resizeSection ( SR_SOURCES_COL, 75*f ); + _smheader->resizeSection ( SR_TYPE_COL, 75*f ); + _smheader->resizeSection ( SR_AGE_COL, 90*f ); + _smheader->resizeSection ( SR_HASH_COL, 240*f ); // set header text aligment QTreeWidgetItem * headerItem = ui.searchResultWidget->headerItem(); @@ -201,10 +204,11 @@ SearchDialog::SearchDialog(QWidget *parent) // load settings processSettings(true); - ui._ownFiles_CB->setMinimumWidth(20); - ui._friendListsearch_SB->setMinimumWidth(20); - ui._anonF2Fsearch_CB->setMinimumWidth(20); - ui.label->setMinimumWidth(20); + ui._channels_CB->setMinimumWidth(20 * f); + ui._ownFiles_CB->setMinimumWidth(20*f); + ui._friendListsearch_SB->setMinimumWidth(20*f); + ui._anonF2Fsearch_CB->setMinimumWidth(20*f); + ui.label->setMinimumWidth(20*f); // workaround for Qt bug, be solved in next Qt release 4.7.0 // https://bugreports.qt-project.org/browse/QTBUG-8270 @@ -862,6 +866,13 @@ void SearchDialog::searchKeywords(const QString& keywords) else req_id = rsFiles->turtleSearch(lin_exp) ; } + else if(ui._channels_CB->isChecked()) + { + if(n==1) + req_id = rsGxsChannels->turtleSearchRequest(words.front()) ; + else + QMessageBox::critical(this,"Cannot search multiple words yet.","Search for multiple words is not implemented yet.") ; + } else req_id = RSRandom::random_u32() ; // generate a random 32 bits request id diff --git a/retroshare-gui/src/gui/FileTransfer/SearchDialog.ui b/retroshare-gui/src/gui/FileTransfer/SearchDialog.ui index 5411dd3c8..e6f6ded74 100644 --- a/retroshare-gui/src/gui/FileTransfer/SearchDialog.ui +++ b/retroshare-gui/src/gui/FileTransfer/SearchDialog.ui @@ -6,8 +6,8 @@ 0 0 - 758 - 339 + 1531 + 889 @@ -32,7 +32,16 @@ QFrame::Sunken - + + 2 + + + 2 + + + 2 + + 2 @@ -55,15 +64,24 @@ + + 0 + + + 0 + + + 0 + + + 0 + 0 1 - - 0 - @@ -99,6 +117,13 @@ + + + + Channels + + + @@ -307,7 +332,7 @@ Any - + :/images/FileTypeAny.png:/images/FileTypeAny.png @@ -316,7 +341,7 @@ Archive - + :/images/FileTypeArchive.png:/images/FileTypeArchive.png @@ -325,7 +350,7 @@ Audio - + :/images/FileTypeAudio.png:/images/FileTypeAudio.png @@ -334,7 +359,7 @@ CD-Image - + :/images/FileTypeCDImage.png:/images/FileTypeCDImage.png @@ -343,7 +368,7 @@ Document - + :/images/FileTypeDocument.png:/images/FileTypeDocument.png @@ -352,7 +377,7 @@ Picture - + :/images/FileTypePicture.png:/images/FileTypePicture.png @@ -361,7 +386,7 @@ Program - + :/images/FileTypeProgram.png:/images/FileTypeProgram.png @@ -370,7 +395,7 @@ Video - + :/images/FileTypeVideo.png:/images/FileTypeVideo.png @@ -379,7 +404,7 @@ Directory - + :/images/folder16.png:/images/folder16.png @@ -406,7 +431,7 @@ Download selected - + :/images/download16.png:/images/download16.png @@ -432,7 +457,7 @@ - + From 84194b6234c9156f03fb43b193a9aa4b94ef4a84 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 16 Jun 2018 22:39:35 +0200 Subject: [PATCH 077/138] sereral fixes to GXS distant search --- libretroshare/src/ft/ftserver.h | 2 + libretroshare/src/grouter/p3grouter.h | 1 + libretroshare/src/gxs/rsgxsnetservice.cc | 9 +- libretroshare/src/gxs/rsgxsnettunnel.cc | 30 +++- libretroshare/src/gxs/rsgxsnettunnel.h | 8 + libretroshare/src/gxstunnel/p3gxstunnel.h | 2 + libretroshare/src/rsserver/rsinit.cc | 5 + libretroshare/src/services/p3idservice.cc | 1 - libretroshare/src/turtle/p3turtle.cc | 176 +++++++++++++--------- libretroshare/src/turtle/p3turtle.h | 8 +- libretroshare/src/turtle/rsturtleitem.cc | 4 +- libretroshare/src/turtle/rsturtleitem.h | 33 ++-- 12 files changed, 172 insertions(+), 107 deletions(-) diff --git a/libretroshare/src/ft/ftserver.h b/libretroshare/src/ft/ftserver.h index 0833127cf..cd0101933 100644 --- a/libretroshare/src/ft/ftserver.h +++ b/libretroshare/src/ft/ftserver.h @@ -95,6 +95,8 @@ public: // Implements RsTurtleClientService // + + uint16_t serviceId() const { return RS_SERVICE_TYPE_FILE_TRANSFER ; } virtual bool handleTunnelRequest(const RsFileHash& hash,const RsPeerId& peer_id) ; virtual void receiveTurtleData(const RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) ; //virtual void receiveSearchResult(RsTurtleSearchResultItem *item);// TODO diff --git a/libretroshare/src/grouter/p3grouter.h b/libretroshare/src/grouter/p3grouter.h index 8a3a54000..a4bc280ff 100644 --- a/libretroshare/src/grouter/p3grouter.h +++ b/libretroshare/src/grouter/p3grouter.h @@ -208,6 +208,7 @@ protected: // Interaction with turtle router // //===================================================// + uint16_t serviceId() const { return RS_SERVICE_TYPE_GROUTER; } virtual bool handleTunnelRequest(const RsFileHash& /*hash*/,const RsPeerId& /*peer_id*/) ; virtual void receiveTurtleData(const RsTurtleGenericTunnelItem */*item*/,const RsFileHash& /*hash*/,const RsPeerId& /*virtual_peer_id*/,RsTurtleGenericTunnelItem::Direction /*direction*/); virtual void addVirtualPeer(const TurtleFileHash& hash,const TurtleVirtualPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction dir) ; diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index da94cb002..3a5c9ecb2 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -272,12 +272,12 @@ NXS_NET_DEBUG_8 gxs distant sync ***/ -#define NXS_NET_DEBUG_0 1 -#define NXS_NET_DEBUG_1 1 +//#define NXS_NET_DEBUG_0 1 +//#define NXS_NET_DEBUG_1 1 //#define NXS_NET_DEBUG_2 1 //#define NXS_NET_DEBUG_3 1 //#define NXS_NET_DEBUG_4 1 -#define NXS_NET_DEBUG_5 1 +//#define NXS_NET_DEBUG_5 1 //#define NXS_NET_DEBUG_6 1 //#define NXS_NET_DEBUG_7 1 #define NXS_NET_DEBUG_8 1 @@ -5143,5 +5143,8 @@ bool RsGxsNetService::search(const std::string& substring,std::listturtleSearch(mem,size,this) ; } bool RsGxsNetTunnelService::receiveSearchRequest(unsigned char *search_request_data,uint32_t search_request_data_len,unsigned char *& search_result_data,uint32_t& search_result_data_size) { - GXS_NET_TUNNEL_DEBUG() << ": received a request." << std::endl; + GXS_NET_TUNNEL_DEBUG() << ": received a request." << std::endl; RsItem *item = RsGxsNetTunnelSerializer().deserialise(search_request_data,&search_request_data_len) ; @@ -985,14 +997,20 @@ bool RsGxsNetTunnelService::receiveSearchRequest(unsigned char *search_request_d if(substring_sr != NULL) { - auto it = mSearchableServices.find(substring_sr->service) ; + GXS_NET_TUNNEL_DEBUG() << " : type is substring for service " << std::hex << (int)substring_sr->service << std::dec << std::endl; std::list results ; + RS_STACK_MUTEX(mGxsNetTunnelMtx); + + auto it = mSearchableServices.find(substring_sr->service) ; + if(it != mSearchableServices.end() && it->second->search(substring_sr->substring_match,results)) { RsGxsNetTunnelTurtleSearchGroupSummaryItem search_result_item ; + GXS_NET_TUNNEL_DEBUG() << " : " << results.size() << " result found. Sending back." << std::endl; + search_result_item.service = substring_sr->service ; search_result_item.group_infos = results ; @@ -1044,11 +1062,13 @@ void RsGxsNetTunnelService::receiveSearchResult(TurtleSearchRequestId request_id { RsItem *item = RsGxsNetTunnelSerializer().deserialise(search_result_data,&search_result_data_len); + GXS_NET_TUNNEL_DEBUG() << " : received search result for search request " << std::hex << request_id << "" << std::endl; + RsGxsNetTunnelTurtleSearchGroupSummaryItem *result_gs = dynamic_cast(item) ; if(result_gs != NULL) { - std::cerr << "Received group summary result for search request " << std::hex << request_id << " for service " << result_gs->service << std::dec << ": " << std::endl; + GXS_NET_TUNNEL_DEBUG() << " : result is of type group summary result for service " << result_gs->service << std::dec << ": " << std::endl; for(auto it(result_gs->group_infos.begin());it!=result_gs->group_infos.end();++it) std::cerr << " group " << (*it).group_id << ": " << (*it).group_name << ", " << (*it).number_of_messages << " messages, last is " << time(NULL)-(*it).last_message_ts << " secs ago." << std::endl; diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 22917f35b..ade780fe8 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -187,6 +187,14 @@ public: */ bool getVirtualPeers(std::list& peers) ; // returns the virtual peers for this service + /*! + * \brief serviceId + * Overloads the method in RsTurtleClientService. + * \return + * The service id for RsGxsNetTunnel. + */ + uint16_t serviceId() const ; + /*! * \brief sendData * send data to this virtual peer, and takes memory ownership (deletes the item) diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.h b/libretroshare/src/gxstunnel/p3gxstunnel.h index cff0fd126..a5a53b437 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.h +++ b/libretroshare/src/gxstunnel/p3gxstunnel.h @@ -127,6 +127,8 @@ public: explicit p3GxsTunnelService(RsGixs *pids) ; virtual void connectToTurtleRouter(p3turtle *) ; + uint16_t serviceId() const { return RS_SERVICE_TYPE_GXS_TUNNEL ; } + // Creates the invite if the public key of the distant peer is available. // Om success, stores the invite in the map above, so that we can respond to tunnel requests. // diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 7fd67fa27..34b68ef11 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1621,6 +1621,11 @@ int RsServer::StartupRetroShare() serviceCtrl->registerServiceMonitor(mBwCtrl, mBwCtrl->getServiceInfo().mServiceType); /**************************************************************************/ + // Turtle search for GXS services + + mGxsNetTunnel->registerSearchableService(gxschannels_ns) ; + + /**************************************************************************/ //mConfigMgr->addConfiguration("ftserver.cfg", ftserver); // diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index 5618568fa..eff0f5cb5 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -47,7 +47,6 @@ #include #include -#define DEBUG_IDS 1 /**** * #define DEBUG_IDS 1 * #define DEBUG_RECOGN 1 diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 1232b950c..233703492 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -930,7 +930,7 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) #endif std::list search_results ; - item->performLocalSearch(req,search_results) ; + locked_performLocalSearch(item,req,search_results) ; for(auto it(search_results.begin());it!=search_results.end();++it) sendItem(*it) ; @@ -999,6 +999,97 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) #endif } +// This function should be removed in the future, when file search will also use generic search items. + +void p3turtle::locked_performLocalSearch(RsTurtleSearchRequestItem *item,TurtleSearchRequestInfo& req,std::list& search_results) +{ + RsTurtleFileSearchRequestItem *ftsearch = dynamic_cast(item) ; + + if(ftsearch != NULL) + { + locked_performLocalSearch_files(ftsearch,req,search_results) ; + return ; + } + + RsTurtleGenericSearchRequestItem *gnsearch = dynamic_cast(item) ; + + if(gnsearch != NULL) + { + locked_performLocalSearch_generic(gnsearch,req,search_results) ; + return ; + } +} + +void p3turtle::locked_performLocalSearch_generic(RsTurtleGenericSearchRequestItem *item,TurtleSearchRequestInfo& req,std::list& result) +{ + unsigned char *search_result_data = NULL ; + uint32_t search_result_data_len = 0 ; + + auto it = _registered_services.find(item->service_id) ; + + if(it == _registered_services.end()) + return ; + + if(it->second->receiveSearchRequest(item->search_data,item->search_data_len,search_result_data,search_result_data_len)) + { + RsTurtleGenericSearchResultItem *result_item = new RsTurtleGenericSearchResultItem ; + + result_item->result_data = search_result_data ; + result_item->result_data_len = search_result_data_len ; + + result.push_back(result_item) ; + } +} + +void p3turtle::locked_performLocalSearch_files(RsTurtleFileSearchRequestItem *item,TurtleSearchRequestInfo& req,std::list& result) +{ +#ifdef P3TURTLE_DEBUG + std::cerr << "Performing rsFiles->search()" << std::endl ; +#endif + // now, search! + std::list initialResults ; + item->search(initialResults) ; + +#ifdef P3TURTLE_DEBUG + std::cerr << initialResults.size() << " matches found." << std::endl ; +#endif + result.clear() ; + RsTurtleFTSearchResultItem *res_item = NULL ; + uint32_t item_size = 0 ; + + static const uint32_t RSTURTLE_MAX_SEARCH_RESPONSE_SIZE = 10000 ; + + for(auto it(initialResults.begin());it!=initialResults.end();++it) + { + if(res_item == NULL) + { + res_item = new RsTurtleFTSearchResultItem ; + item_size = 0 ; + + res_item->depth = 0 ; + res_item->request_id = item->request_id ; + res_item->PeerId(item->PeerId()) ; // send back to the same guy + + result.push_back(res_item) ; + } + res_item->result.push_back(*it); + + // Let's chop search results items into several chunks of finite size to avoid exceeding streamer's capacity. + // + ++req.result_count ; // increase hit number for this particular search request. + + item_size += 8 /* size */ + it->hash.serial_size() + it->name.size() ; + + if(item_size > RSTURTLE_MAX_SEARCH_RESPONSE_SIZE || req.result_count >= TURTLE_SEARCH_RESULT_MAX_HITS) + { +#ifdef P3TURTLE_DEBUG + std::cerr << " Sending back chunk of size " << item_size << ", for " << res_item->result.size() << " elements." << std::endl ; +#endif + res_item = NULL ; // forces creation of a new item. + } + } +} + void p3turtle::handleSearchResult(RsTurtleSearchResultItem *item) { std::list > results_to_notify_off_mutex ; @@ -1771,59 +1862,7 @@ void p3turtle::handleTunnelResult(RsTurtleTunnelOkItem *item) // ------------------------------ IO with libretroshare ----------------------------// // -----------------------------------------------------------------------------------// // -void RsTurtleFileSearchRequestItem::performLocalSearch(TurtleSearchRequestInfo &req, std::list& result) const -{ -#ifdef P3TURTLE_DEBUG - std::cerr << "Performing rsFiles->search()" << std::endl ; -#endif - // now, search! - std::list initialResults ; - search(initialResults) ; -#ifdef P3TURTLE_DEBUG - std::cerr << initialResults.size() << " matches found." << std::endl ; -#endif - result.clear() ; - RsTurtleFTSearchResultItem *res_item = NULL ; - uint32_t item_size = 0 ; - - static const uint32_t RSTURTLE_MAX_SEARCH_RESPONSE_SIZE = 10000 ; - - for(auto it(initialResults.begin());it!=initialResults.end();++it) - { - if(res_item == NULL) - { - res_item = new RsTurtleFTSearchResultItem ; - item_size = 0 ; - - res_item->depth = 0 ; - res_item->request_id = request_id ; - res_item->PeerId(PeerId()) ; // send back to the same guy - - result.push_back(res_item) ; - } - res_item->result.push_back(*it); - - // Let's chop search results items into several chunks of finite size to avoid exceeding streamer's capacity. - // - ++req.result_count ; // increase hit number for this particular search request. - - item_size += 8 /* size */ + it->hash.serial_size() + it->name.size() ; - - if(item_size > RSTURTLE_MAX_SEARCH_RESPONSE_SIZE || req.result_count >= TURTLE_SEARCH_RESULT_MAX_HITS) - { -#ifdef P3TURTLE_DEBUG - std::cerr << " Sending back chunk of size " << item_size << ", for " << res_item->result.size() << " elements." << std::endl ; -#endif - res_item = NULL ; // forces creation of a new item. - } - } -} - -void RsTurtleGenericSearchRequestItem::performLocalSearch(TurtleSearchRequestInfo &req, std::list& result) const -{ - std::cerr << "(EE) p3turtle: Missing code to perform actual GXS search" << std::endl; -} void RsTurtleStringSearchRequestItem::search(std::list& result) const { @@ -1967,22 +2006,22 @@ TurtleRequestId p3turtle::turtleSearch(unsigned char *search_bin_data,uint32_t s // Form a request packet that simulates a request from us. // - RsTurtleGenericSearchRequestItem *item = new RsTurtleGenericSearchRequestItem ; + RsTurtleGenericSearchRequestItem item ; #ifdef P3TURTLE_DEBUG std::cerr << "performing search. OwnId = " << _own_id << std::endl ; #endif - item->PeerId(_own_id) ; - item->service_id = client_service->serviceId(); - item->search_data = search_bin_data ; - item->search_data_len = search_bin_data_len ; - item->request_id = id ; - item->depth = 0 ; + item.PeerId(_own_id) ; + item.service_id = client_service->serviceId(); + item.search_data = search_bin_data ; + item.search_data_len = search_bin_data_len ; + item.request_id = id ; + item.depth = 0 ; // send it - handleSearchRequest(item) ; + handleSearchRequest(&item) ; return id ; } @@ -2056,10 +2095,10 @@ bool p3turtle::performLocalHashSearch(const TurtleFileHash& hash,const RsPeerId& if(_registered_services.empty()) std::cerr << "Turtle router has no services registered. Tunnel requests cannot be handled." << std::endl; - for(std::list::const_iterator it(_registered_services.begin());it!=_registered_services.end();++it) - if( (*it)->handleTunnelRequest(hash,peer_id)) + for(auto it(_registered_services.begin());it!=_registered_services.end();++it) + if( (*it).second->handleTunnelRequest(hash,peer_id)) { - service = *it ; + service = it->second ; return true ; } @@ -2069,14 +2108,9 @@ bool p3turtle::performLocalHashSearch(const TurtleFileHash& hash,const RsPeerId& void p3turtle::registerTunnelService(RsTurtleClientService *service) { -#ifdef P3TURTLE_DEBUG - for(std::list::const_iterator it(_registered_services.begin());it!=_registered_services.end();++it) - if(service == *it) - throw std::runtime_error("p3turtle::registerTunnelService(): Cannot register the same service twice. Please fix the code!") ; -#endif - std::cerr << "p3turtle: registered new tunnel service " << (void*)service << std::endl; + std::cerr << "p3turtle: registered new tunnel service with ID=" << std::hex << service->serviceId() << std::dec << " and pointer " << (void*)service << std::endl; - _registered_services.push_back(service) ; + _registered_services[service->serviceId()] = service ; _serialiser->registerClientService(service) ; } diff --git a/libretroshare/src/turtle/p3turtle.h b/libretroshare/src/turtle/p3turtle.h index 04d90c812..0c30653f3 100644 --- a/libretroshare/src/turtle/p3turtle.h +++ b/libretroshare/src/turtle/p3turtle.h @@ -397,7 +397,9 @@ class p3turtle: public p3Service, public RsTurtle, public p3Config //------ Functions connecting the turtle router to other components.----------// /// Performs a search calling local cache and search structure. - void performLocalSearch(const std::string& match_string,std::list& result) ; + void locked_performLocalSearch (RsTurtleSearchRequestItem *item,TurtleSearchRequestInfo& req,std::list& result) ; + void locked_performLocalSearch_files (RsTurtleFileSearchRequestItem *item,TurtleSearchRequestInfo& req,std::list& result) ; + void locked_performLocalSearch_generic(RsTurtleGenericSearchRequestItem *item,TurtleSearchRequestInfo& req,std::list& result) ; /// Returns true if the file with given hash is hosted locally, and accessible in anonymous mode the supplied peer. virtual bool performLocalHashSearch(const TurtleFileHash& hash,const RsPeerId& client_peer_id,RsTurtleClientService *& service); @@ -419,7 +421,7 @@ class p3turtle: public p3Service, public RsTurtle, public p3Config std::map _tunnel_requests_origins ; /// stores adequate tunnels for each file hash locally managed - std::map _incoming_file_hashes ; + std::map _incoming_file_hashes ; /// stores file info for each file we provide. std::map _outgoing_tunnel_client_services ; @@ -434,7 +436,7 @@ class p3turtle: public p3Service, public RsTurtle, public p3Config std::set _hashes_to_remove ; /// List of client services that have regitered. - std::list _registered_services ; + std::map _registered_services ; time_t _last_clean_time ; time_t _last_tunnel_management_time ; diff --git a/libretroshare/src/turtle/rsturtleitem.cc b/libretroshare/src/turtle/rsturtleitem.cc index ce3a4450a..d600b4877 100644 --- a/libretroshare/src/turtle/rsturtleitem.cc +++ b/libretroshare/src/turtle/rsturtleitem.cc @@ -75,9 +75,11 @@ RsTurtleSearchRequestItem *RsTurtleGenericSearchRequestItem::clone() const { RsTurtleGenericSearchRequestItem *sr = new RsTurtleGenericSearchRequestItem ; + memcpy(sr,this,sizeof(RsTurtleGenericSearchRequestItem)) ; + sr->search_data = (unsigned char*)rs_malloc(search_data_len) ; memcpy(sr->search_data,search_data,search_data_len) ; - sr->search_data_len = search_data_len ; + return sr ; } template<> uint32_t RsTypeSerializer::serial_size(const RsRegularExpression::LinearizedExpression& r) diff --git a/libretroshare/src/turtle/rsturtleitem.h b/libretroshare/src/turtle/rsturtleitem.h index 035490bc1..c5e3bc727 100644 --- a/libretroshare/src/turtle/rsturtleitem.h +++ b/libretroshare/src/turtle/rsturtleitem.h @@ -57,26 +57,18 @@ class RsTurtleItem: public RsItem // +---- RsTurtleSearchRequestItem // | | // | +---- RsTurtleFileSearchRequestItem -// | | | -// | | +---- RsTurtleFileSearchRequestItem -// | | | -// | | +---- RsTurtleStringSearchRequestItem -// | | | -// | | +---- RsTurtleReqExpSearchRequestItem +// | | | +// | | +---- RsTurtleStringSearchRequestItem +// | | | +// | | +---- RsTurtleReqExpSearchRequestItem // | | -// | +---- RsTurtleGxsSearchRequestItem -// | | -// | +---- RsTurtleGxsGroupRequestItem +// | +---- RsTurtleGenericSearchRequestItem // | // +---- RsTurtleSearchResultItem // | // +---- RsTurtleFTSearchResultItem // | -// +---- RsTurtleGxsSearchResultItem -// | -// +---- RsTurtleGxsSearchResultGroupSummaryItem -// | -// +---- RsTurtleGxsSearchResultGroupDataItem +// +---- RsTurtleGenericSearchResultItem // class RsTurtleSearchResultItem ; @@ -89,8 +81,6 @@ class RsTurtleSearchRequestItem: public RsTurtleItem virtual RsTurtleSearchRequestItem *clone() const = 0 ; // used for cloning in routing methods - virtual void performLocalSearch(TurtleSearchRequestInfo& req,std::list&) const = 0 ; // abstracts the search method - virtual std::string GetKeywords() = 0; uint32_t request_id ; // randomly generated request id. @@ -103,9 +93,6 @@ class RsTurtleFileSearchRequestItem: public RsTurtleSearchRequestItem RsTurtleFileSearchRequestItem(uint32_t subtype) : RsTurtleSearchRequestItem(subtype) {} virtual ~RsTurtleFileSearchRequestItem() {} - virtual void performLocalSearch(TurtleSearchRequestInfo& req,std::list&) const ; // abstracts the search method - - protected: virtual void search(std::list &) const =0; }; @@ -115,8 +102,9 @@ class RsTurtleStringSearchRequestItem: public RsTurtleFileSearchRequestItem RsTurtleStringSearchRequestItem() : RsTurtleFileSearchRequestItem(RS_TURTLE_SUBTYPE_STRING_SEARCH_REQUEST) {} virtual ~RsTurtleStringSearchRequestItem() {} - std::string match_string ; // string to match + virtual void search(std::list &) const ; + std::string match_string ; // string to match std::string GetKeywords() { return match_string; } virtual RsTurtleSearchRequestItem *clone() const { return new RsTurtleStringSearchRequestItem(*this) ; } @@ -124,7 +112,6 @@ class RsTurtleStringSearchRequestItem: public RsTurtleFileSearchRequestItem void clear() { match_string.clear() ; } protected: - virtual void search(std::list &) const ; void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); }; @@ -144,10 +131,11 @@ class RsTurtleRegExpSearchRequestItem: public RsTurtleFileSearchRequestItem return exs; } + virtual void search(std::list &) const ; + virtual RsTurtleSearchRequestItem *clone() const { return new RsTurtleRegExpSearchRequestItem(*this) ; } void clear() { expr = RsRegularExpression::LinearizedExpression(); } protected: - virtual void search(std::list &) const ; void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); }; @@ -166,7 +154,6 @@ class RsTurtleGenericSearchRequestItem: public RsTurtleSearchRequestItem virtual RsTurtleSearchRequestItem *clone() const ; void clear() { free(search_data); search_data=NULL; search_data_len=0; } - virtual void performLocalSearch(TurtleSearchRequestInfo &req, std::list& result) const; protected: void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); From c67084b7dea39b4707f6ce2d9bd9a2608f9422d3 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 17 Jun 2018 21:23:16 +0200 Subject: [PATCH 078/138] fixed mutex problem in turtle-GXS search --- libretroshare/src/turtle/p3turtle.cc | 125 +++++++++++++++--------- libretroshare/src/turtle/p3turtle.h | 16 +-- libretroshare/src/turtle/rsturtleitem.h | 3 + 3 files changed, 89 insertions(+), 55 deletions(-) diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 233703492..898491cf2 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -870,8 +870,6 @@ int p3turtle::handleIncoming() // void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) { - RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ - // take a look at the item and test against inconsistent values // - If the item destimation is @@ -891,26 +889,55 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) return ; } - if(_search_requests_origins.size() > MAX_ALLOWED_SR_IN_CACHE) { + RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ + + if(_search_requests_origins.size() > MAX_ALLOWED_SR_IN_CACHE) + { #ifdef P3TURTLE_DEBUG - std::cerr << " Dropping, because the search request cache is full." << std::endl ; + std::cerr << " Dropping, because the search request cache is full." << std::endl ; #endif - std::cerr << " More than " << MAX_ALLOWED_SR_IN_CACHE << " search request in cache. A peer is probably trying to flood your network See the depth charts to find him." << std::endl; - return ; + std::cerr << " More than " << MAX_ALLOWED_SR_IN_CACHE << " search request in cache. A peer is probably trying to flood your network See the depth charts to find him." << std::endl; + return ; + } + + // If the item contains an already handled search request, give up. This + // happens when the same search request gets relayed by different peers + // + if(_search_requests_origins.find(item->request_id) != _search_requests_origins.end()) + { +#ifdef P3TURTLE_DEBUG + std::cerr << " This is a bouncing request. Ignoring and deleting it." << std::endl ; +#endif + return ; + } } - // If the item contains an already handled search request, give up. This - // happens when the same search request gets relayed by different peers - // - if(_search_requests_origins.find(item->request_id) != _search_requests_origins.end()) + // Perform local search off-mutex,because this might call some services that are above turtle in the mutex chain. + + uint32_t search_result_count = 0; + + if(item->PeerId() != _own_id) // is the request not coming from us? { #ifdef P3TURTLE_DEBUG - std::cerr << " This is a bouncing request. Ignoring and deleting it." << std::endl ; + std::cerr << " Request not from us. Performing local search" << std::endl ; #endif - return ; + std::list search_results ; + + performLocalSearch(item,search_result_count,search_results) ; + + for(auto it(search_results.begin());it!=search_results.end();++it) + { + (*it)->request_id = item->request_id ; + (*it)->depth = 0 ; + (*it)->PeerId(item->PeerId()) ; + + sendItem(*it) ; + } } + RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ + // This is a new request. Let's add it to the request map, and forward it to // open peers. @@ -918,23 +945,9 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) req.origin = item->PeerId() ; req.time_stamp = time(NULL) ; req.depth = item->depth ; - req.result_count = 0; + req.result_count = search_result_count; req.keywords = item->GetKeywords() ; - - // If it's not for us, perform a local search. If something found, forward the search result back. - - if(item->PeerId() != _own_id) - { -#ifdef P3TURTLE_DEBUG - std::cerr << " Request not from us. Performing local search" << std::endl ; -#endif - std::list search_results ; - - locked_performLocalSearch(item,req,search_results) ; - - for(auto it(search_results.begin());it!=search_results.end();++it) - sendItem(*it) ; - } + req.service_id = item->serviceId() ; // if enough has been sent back already, do not sarch further @@ -1001,13 +1014,13 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) // This function should be removed in the future, when file search will also use generic search items. -void p3turtle::locked_performLocalSearch(RsTurtleSearchRequestItem *item,TurtleSearchRequestInfo& req,std::list& search_results) +void p3turtle::performLocalSearch(RsTurtleSearchRequestItem *item,uint32_t& req_result_count,std::list& search_results) { RsTurtleFileSearchRequestItem *ftsearch = dynamic_cast(item) ; if(ftsearch != NULL) { - locked_performLocalSearch_files(ftsearch,req,search_results) ; + performLocalSearch_files(ftsearch,req_result_count,search_results) ; return ; } @@ -1015,22 +1028,29 @@ void p3turtle::locked_performLocalSearch(RsTurtleSearchRequestItem *item,TurtleS if(gnsearch != NULL) { - locked_performLocalSearch_generic(gnsearch,req,search_results) ; + performLocalSearch_generic(gnsearch,req_result_count,search_results) ; return ; } } -void p3turtle::locked_performLocalSearch_generic(RsTurtleGenericSearchRequestItem *item,TurtleSearchRequestInfo& req,std::list& result) +void p3turtle::performLocalSearch_generic(RsTurtleGenericSearchRequestItem *item, uint32_t& req_result_count, std::list& result) { unsigned char *search_result_data = NULL ; uint32_t search_result_data_len = 0 ; - auto it = _registered_services.find(item->service_id) ; + RsTurtleClientService *client = NULL ; - if(it == _registered_services.end()) - return ; + { + RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ + auto it = _registered_services.find(item->service_id) ; - if(it->second->receiveSearchRequest(item->search_data,item->search_data_len,search_result_data,search_result_data_len)) + if(it == _registered_services.end()) + return ; + + client = it->second ; + } + + if(client->receiveSearchRequest(item->search_data,item->search_data_len,search_result_data,search_result_data_len)) { RsTurtleGenericSearchResultItem *result_item = new RsTurtleGenericSearchResultItem ; @@ -1041,7 +1061,7 @@ void p3turtle::locked_performLocalSearch_generic(RsTurtleGenericSearchRequestIte } } -void p3turtle::locked_performLocalSearch_files(RsTurtleFileSearchRequestItem *item,TurtleSearchRequestInfo& req,std::list& result) +void p3turtle::performLocalSearch_files(RsTurtleFileSearchRequestItem *item,uint32_t& req_result_count,std::list& result) { #ifdef P3TURTLE_DEBUG std::cerr << "Performing rsFiles->search()" << std::endl ; @@ -1066,21 +1086,17 @@ void p3turtle::locked_performLocalSearch_files(RsTurtleFileSearchRequestItem *it res_item = new RsTurtleFTSearchResultItem ; item_size = 0 ; - res_item->depth = 0 ; - res_item->request_id = item->request_id ; - res_item->PeerId(item->PeerId()) ; // send back to the same guy - result.push_back(res_item) ; } res_item->result.push_back(*it); // Let's chop search results items into several chunks of finite size to avoid exceeding streamer's capacity. // - ++req.result_count ; // increase hit number for this particular search request. + ++req_result_count ; // increase hit number for this particular search request. item_size += 8 /* size */ + it->hash.serial_size() + it->name.size() ; - if(item_size > RSTURTLE_MAX_SEARCH_RESPONSE_SIZE || req.result_count >= TURTLE_SEARCH_RESULT_MAX_HITS) + if(item_size > RSTURTLE_MAX_SEARCH_RESPONSE_SIZE || req_result_count >= TURTLE_SEARCH_RESULT_MAX_HITS) { #ifdef P3TURTLE_DEBUG std::cerr << " Sending back chunk of size " << item_size << ", for " << res_item->result.size() << " elements." << std::endl ; @@ -1119,7 +1135,12 @@ void p3turtle::handleSearchResult(RsTurtleSearchResultItem *item) { it->second.result_count += item->count() ; - results_to_notify_off_mutex.push_back(std::make_pair(item,it->second.client)) ; + auto it2 = _registered_services.find(it->second.service_id) ; + + if(it2 != _registered_services.end()) + results_to_notify_off_mutex.push_back(std::make_pair(item,it2->second)) ; + else + std::cerr << "(EE) cannot find client service for ID " << std::hex << it->second.service_id << std::dec << ": search result item will be dropped." << std::endl; } else { // Nope, so forward it back. @@ -2092,10 +2113,20 @@ void p3turtle::monitorTunnels(const RsFileHash& hash,RsTurtleClientService *clie // bool p3turtle::performLocalHashSearch(const TurtleFileHash& hash,const RsPeerId& peer_id,RsTurtleClientService *& service) { - if(_registered_services.empty()) - std::cerr << "Turtle router has no services registered. Tunnel requests cannot be handled." << std::endl; + std::map client_map ; + { + RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ - for(auto it(_registered_services.begin());it!=_registered_services.end();++it) + if(_registered_services.empty()) + { + std::cerr << "Turtle router has no services registered. Tunnel requests cannot be handled." << std::endl; + return false ; + } + + client_map = _registered_services ; + } + + for(auto it(client_map.begin());it!=client_map.end();++it) if( (*it).second->handleTunnelRequest(hash,peer_id)) { service = it->second ; diff --git a/libretroshare/src/turtle/p3turtle.h b/libretroshare/src/turtle/p3turtle.h index 0c30653f3..be34a56a7 100644 --- a/libretroshare/src/turtle/p3turtle.h +++ b/libretroshare/src/turtle/p3turtle.h @@ -169,11 +169,11 @@ class TurtleSearchRequestInfo { public: TurtlePeerId origin ; // where the request came from. - uint32_t time_stamp ; // last time the tunnel was actually used. Used for cleaning old tunnels. - int depth ; // depth of the request. Used to optimize tunnel length. - uint32_t result_count; // responses to this request. Useful to avoid spamming tunnel responses. - std::string keywords; - RsTurtleClientService *client;// client who issues the request. This is null if the request does not have a local origin. + uint32_t time_stamp ; // last time the tunnel was actually used. Used for cleaning old tunnels. + int depth ; // depth of the request. Used to optimize tunnel length. + uint32_t result_count; // responses to this request. Useful to avoid spamming tunnel responses. + std::string keywords; + uint16_t service_id; // ID of the client service who issues the request. This is null if the request does not have a local origin. }; class TurtleTunnelRequestInfo { @@ -397,9 +397,9 @@ class p3turtle: public p3Service, public RsTurtle, public p3Config //------ Functions connecting the turtle router to other components.----------// /// Performs a search calling local cache and search structure. - void locked_performLocalSearch (RsTurtleSearchRequestItem *item,TurtleSearchRequestInfo& req,std::list& result) ; - void locked_performLocalSearch_files (RsTurtleFileSearchRequestItem *item,TurtleSearchRequestInfo& req,std::list& result) ; - void locked_performLocalSearch_generic(RsTurtleGenericSearchRequestItem *item,TurtleSearchRequestInfo& req,std::list& result) ; + void performLocalSearch (RsTurtleSearchRequestItem *item, uint32_t& req_result_count,std::list& result) ; + void performLocalSearch_files (RsTurtleFileSearchRequestItem *item, uint32_t& req_result_count,std::list& result) ; + void performLocalSearch_generic(RsTurtleGenericSearchRequestItem *item, uint32_t& req_result_count,std::list& result) ; /// Returns true if the file with given hash is hosted locally, and accessible in anonymous mode the supplied peer. virtual bool performLocalHashSearch(const TurtleFileHash& hash,const RsPeerId& client_peer_id,RsTurtleClientService *& service); diff --git a/libretroshare/src/turtle/rsturtleitem.h b/libretroshare/src/turtle/rsturtleitem.h index c5e3bc727..d35cbb8fd 100644 --- a/libretroshare/src/turtle/rsturtleitem.h +++ b/libretroshare/src/turtle/rsturtleitem.h @@ -82,6 +82,7 @@ class RsTurtleSearchRequestItem: public RsTurtleItem virtual RsTurtleSearchRequestItem *clone() const = 0 ; // used for cloning in routing methods virtual std::string GetKeywords() = 0; + virtual uint16_t serviceId() = 0 ; uint32_t request_id ; // randomly generated request id. uint16_t depth ; // Used for limiting search depth. @@ -93,6 +94,7 @@ class RsTurtleFileSearchRequestItem: public RsTurtleSearchRequestItem RsTurtleFileSearchRequestItem(uint32_t subtype) : RsTurtleSearchRequestItem(subtype) {} virtual ~RsTurtleFileSearchRequestItem() {} + virtual uint16_t serviceId() { return RS_SERVICE_TYPE_FILE_TRANSFER ; } virtual void search(std::list &) const =0; }; @@ -150,6 +152,7 @@ class RsTurtleGenericSearchRequestItem: public RsTurtleSearchRequestItem unsigned char *search_data ; std::string GetKeywords() { return std::string("Generic search " + RsUtil::BinToHex(search_data,search_data_len,10)); } + virtual uint16_t serviceId() { return service_id ; } virtual RsTurtleSearchRequestItem *clone() const ; void clear() { free(search_data); search_data=NULL; search_data_len=0; } From 91fd38d46fbdbaa1c72a454941f4d229879391ac Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 20 Jun 2018 22:30:44 +0200 Subject: [PATCH 079/138] started GUI part for distant network search of groups --- .../src/gui/common/GroupTreeWidget.cpp | 13 +++++++++++++ .../src/gui/common/GroupTreeWidget.h | 2 ++ .../src/gui/common/GroupTreeWidget.ui | 3 +++ .../src/gui/gxs/GxsGroupFrameDialog.cpp | 18 ++++++++++++++++++ .../src/gui/gxs/GxsGroupFrameDialog.h | 5 +++++ .../src/gui/gxschannels/GxsChannelDialog.cpp | 7 +++++++ .../src/gui/gxschannels/GxsChannelDialog.h | 1 + 7 files changed, 49 insertions(+) diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index fc1cfae19..578d3844a 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. ****************************************************************/ +#include + #include "GroupTreeWidget.h" #include "ui_GroupTreeWidget.h" @@ -119,6 +121,10 @@ GroupTreeWidget::GroupTreeWidget(QWidget *parent) : ui->filterLineEdit->addFilter(QIcon(), tr("Description"), FILTER_DESC_INDEX , tr("Search Description")); ui->filterLineEdit->setCurrentFilter(FILTER_NAME_INDEX); + ui->distantSearchLineEdit->setPlaceholderText(tr("Search entire network...")) ; + + connect(ui->distantSearchLineEdit,SIGNAL(returnPressed()),this,SLOT(distantSearch())) ; + /* Initialize display button */ initDisplayMenu(ui->displayButton); @@ -749,6 +755,13 @@ void GroupTreeWidget::resort(QTreeWidgetItem *categoryItem) } } +void GroupTreeWidget::distantSearch() +{ + emit distantSearchRequested(ui->distantSearchLineEdit->text()); + + ui->distantSearchLineEdit->clear(); +} + void GroupTreeWidget::sort() { resort(NULL); diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.h b/retroshare-gui/src/gui/common/GroupTreeWidget.h index d1a708258..e025f78e0 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.h +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.h @@ -110,6 +110,7 @@ signals: void treeCustomContextMenuRequested(const QPoint &pos); void treeCurrentItemChanged(const QString &id); void treeItemActivated(const QString &id); + void distantSearchRequested(const QString&) ; protected: void changeEvent(QEvent *e); @@ -119,6 +120,7 @@ private slots: void currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous); void itemActivated(QTreeWidgetItem *item, int column); void filterChanged(); + void distantSearch(); void sort(); diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.ui b/retroshare-gui/src/gui/common/GroupTreeWidget.ui index c4d3948b1..7591c6a1c 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.ui +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.ui @@ -124,6 +124,9 @@ + + + diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index fe2ce45be..bce728e7a 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -94,6 +94,7 @@ GxsGroupFrameDialog::GxsGroupFrameDialog(RsGxsIfaceHelper *ifaceImpl, QWidget *p connect(ui->groupTreeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT(groupTreeCustomPopupMenu(QPoint))); connect(ui->groupTreeWidget, SIGNAL(treeCurrentItemChanged(QString)), this, SLOT(changedGroup(QString))); connect(ui->groupTreeWidget->treeWidget(), SIGNAL(signalMouseMiddleButtonClicked(QTreeWidgetItem*)), this, SLOT(groupTreeMiddleButtonClicked(QTreeWidgetItem*))); + connect(ui->groupTreeWidget, SIGNAL(distantSearchRequested(const QString&)), this, SLOT(searchNetwork(const QString&))); connect(ui->messageTabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(messageTabCloseRequested(int))); connect(ui->messageTabWidget, SIGNAL(currentChanged(int)), this, SLOT(messageTabChanged(int))); @@ -1078,3 +1079,20 @@ void GxsGroupFrameDialog::loadRequest(const TokenQueue *queue, const TokenReques } } } + +TurtleRequestId GxsGroupFrameDialog::distantSearch(const QString& search_string) // this should be overloaded in the child class +{ + std::cerr << "Searching for \"" << search_string.toStdString() << "\". Function is not implemented yet." << std::endl; + return 0; +} + +void GxsGroupFrameDialog::searchNetwork(const QString& search_string) +{ + uint32_t request_id = distantSearch(search_string); + + if(request_id == 0) + return ; + + mSearchGroups[request_id] = ui->groupTreeWidget->addCategoryItem(tr("Search for")+ " \"" + search_string + "\"", QIcon(icon(ICON_SEARCH)), true); +} + diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index 2c0dca594..69058382b 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -67,6 +67,7 @@ public: ICON_SUBSCRIBED_GROUP, ICON_POPULAR_GROUP, ICON_OTHER_GROUP, + ICON_SEARCH, ICON_DEFAULT }; @@ -129,11 +130,13 @@ private slots: void sharePublishKey(); void loadComment(const RsGxsGroupId &grpId, const QVector& msg_versions,const RsGxsMessageId &most_recent_msgId, const QString &title); + void searchNetwork(const QString &search_string) ; private: virtual QString text(TextType type) = 0; virtual QString icon(IconType type) = 0; virtual QString settingsGroupName() = 0; + virtual TurtleRequestId distantSearch(const QString& search_string) ; virtual GxsGroupDialog *createNewGroupDialog(TokenQueue *tokenQueue) = 0; virtual GxsGroupDialog *createGroupDialog(TokenQueue *tokenQueue, RsTokenService *tokenService, GxsGroupDialog::Mode mode, RsGxsGroupId groupId) = 0; @@ -201,6 +204,8 @@ private: Ui::GxsGroupFrameDialog *ui; std::list mCachedGroupMetas; + + std::map mSearchGroups ; }; #endif diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp index 4bff7528b..acd9dae0e 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp @@ -137,6 +137,8 @@ QString GxsChannelDialog::icon(IconType type) return ":/images/folder_green.png"; case ICON_OTHER_GROUP: return ":/images/folder_yellow.png"; + case ICON_SEARCH: + return ":/images/find.png"; case ICON_DEFAULT: return ":/images/channels.png"; } @@ -334,3 +336,8 @@ void GxsChannelDialog::groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo groupItemInfo.icon = iconIt.value(); } } + +TurtleRequestId GxsChannelDialog::distantSearch(const QString& search_string) +{ + return rsGxsChannels->turtleSearchRequest(search_string.toStdString()) ; +} diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h index e1f3c75d0..3864fba13 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h @@ -51,6 +51,7 @@ protected: virtual QString getHelpString() const ; virtual void groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo, const RsUserdata *userdata); + virtual TurtleRequestId distantSearch(const QString& search_string) ; private slots: void toggleAutoDownload(); void setDefaultDirectory(); From c79ceba4eed727a72f9425706628ee97b8b8babb Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 20 Jun 2018 23:26:37 +0200 Subject: [PATCH 080/138] added remove buttons for ongoing search entries --- .../src/gui/common/GroupTreeWidget.cpp | 28 +++++++++++ .../src/gui/common/GroupTreeWidget.h | 6 +++ .../src/gui/gxs/GxsGroupFrameDialog.cpp | 49 +++++++++++++++++-- .../src/gui/gxs/GxsGroupFrameDialog.h | 3 ++ 4 files changed, 83 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index 578d3844a..f5fd77daf 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -59,6 +59,8 @@ #define ROLE_SUBSCRIBE_FLAGS Qt::UserRole + 8 #define ROLE_COLOR Qt::UserRole + 9 #define ROLE_SAVED_ICON Qt::UserRole + 10 +#define ROLE_SEARCH_STRING Qt::UserRole + 11 +#define ROLE_REQUEST_ID Qt::UserRole + 12 #define FILTER_NAME_INDEX 0 #define FILTER_DESC_INDEX 1 @@ -397,6 +399,32 @@ QTreeWidgetItem *GroupTreeWidget::addCategoryItem(const QString &name, const QIc return item; } +void GroupTreeWidget::removeSearchItem(QTreeWidgetItem *item) +{ + ui->treeWidget->takeTopLevelItem(ui->treeWidget->indexOfTopLevelItem(item)) ; +} + +QTreeWidgetItem *GroupTreeWidget::addSearchItem(const QString& search_string, uint32_t id, const QIcon& icon) +{ + QTreeWidgetItem *item = addCategoryItem(search_string,icon,true); + + item->setData(COLUMN_DATA,ROLE_SEARCH_STRING,search_string) ; + item->setData(COLUMN_DATA,ROLE_REQUEST_ID ,id) ; + + return item; +} + +bool GroupTreeWidget::isSearchRequestItem(QPoint &point,uint32_t& search_req_id) +{ + QTreeWidgetItem *item = ui->treeWidget->itemAt(point); + if (item == NULL) + return false; + + search_req_id = item->data(COLUMN_DATA, ROLE_REQUEST_ID).toUInt(); + + return search_req_id > 0; +} + QString GroupTreeWidget::itemId(QTreeWidgetItem *item) { if (item == NULL) { diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.h b/retroshare-gui/src/gui/common/GroupTreeWidget.h index e025f78e0..6b782cb7c 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.h +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.h @@ -82,6 +82,10 @@ public: // Add a new category item QTreeWidgetItem *addCategoryItem(const QString &name, const QIcon &icon, bool expand); + // Add a new search item + QTreeWidgetItem *addSearchItem(const QString& search_string, uint32_t id, const QIcon &icon) ; + void removeSearchItem(QTreeWidgetItem *item); + // Get id of item QString itemId(QTreeWidgetItem *item); QString itemIdAt(QPoint &point); @@ -90,6 +94,8 @@ public: // Set the unread count of an item void setUnreadCount(QTreeWidgetItem *item, int unreadCount); + bool isSearchRequestItem(QPoint &point,uint32_t& search_req_id); + QTreeWidgetItem *getItemFromId(const QString &id); QTreeWidgetItem *activateId(const QString &id, bool focus); diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index bce728e7a..d9c2c0bdd 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -46,6 +46,7 @@ #define IMAGE_EDIT ":/images/edit_16.png" #define IMAGE_SHARE ":/images/share-icon-16.png" #define IMAGE_TABNEW ":/images/tab-new.png" +#define IMAGE_DELETE ":/images/delete.png" #define IMAGE_COMMENT "" #define TOKEN_TYPE_GROUP_SUMMARY 1 @@ -252,16 +253,55 @@ void GxsGroupFrameDialog::todo() QMessageBox::information(this, "Todo", text(TEXT_TODO)); } +void GxsGroupFrameDialog::removeCurrentSearch() +{ + QAction *action = dynamic_cast(sender()) ; + + if(!action) + return ; + + TurtleRequestId search_request_id = action->data().toUInt(); + + auto it = mSearchGroups.find(search_request_id) ; + + if(it == mSearchGroups.end()) + return ; + + ui->groupTreeWidget->removeSearchItem(it->second) ; + mSearchGroups.erase(it); +} + +void GxsGroupFrameDialog::removeAllSearches() +{ + for(auto it(mSearchGroups.begin());it!=mSearchGroups.end();++it) + ui->groupTreeWidget->removeSearchItem(it->second) ; + + mSearchGroups.clear(); +} void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) { + // First separately handle the case of search top level items + + TurtleRequestId search_request_id = 0 ; + + if(ui->groupTreeWidget->isSearchRequestItem(point,search_request_id)) + { + QMenu contextMnu(this); + + contextMnu.addAction(QIcon(IMAGE_DELETE), tr("Remove this search"), this, SLOT(removeCurrentSearch()))->setData(search_request_id); + contextMnu.addAction(QIcon(IMAGE_DELETE), tr("Remove all searches"), this, SLOT(removeAllSearches())); + contextMnu.exec(QCursor::pos()); + return ; + } + QString id = ui->groupTreeWidget->itemIdAt(point); if (id.isEmpty()) return; mGroupId = RsGxsGroupId(id.toStdString()); int subscribeFlags = ui->groupTreeWidget->subscribeFlags(QString::fromStdString(mGroupId.toStdString())); - bool isAdmin = IS_GROUP_ADMIN(subscribeFlags); - bool isPublisher = IS_GROUP_PUBLISHER(subscribeFlags); + bool isAdmin = IS_GROUP_ADMIN(subscribeFlags); + bool isPublisher = IS_GROUP_PUBLISHER(subscribeFlags); bool isSubscribed = IS_GROUP_SUBSCRIBED(subscribeFlags); QMenu contextMnu(this); @@ -1088,11 +1128,14 @@ TurtleRequestId GxsGroupFrameDialog::distantSearch(const QString& search_string) void GxsGroupFrameDialog::searchNetwork(const QString& search_string) { + if(search_string.isNull()) + return ; + uint32_t request_id = distantSearch(search_string); if(request_id == 0) return ; - mSearchGroups[request_id] = ui->groupTreeWidget->addCategoryItem(tr("Search for")+ " \"" + search_string + "\"", QIcon(icon(ICON_SEARCH)), true); + mSearchGroups[request_id] = ui->groupTreeWidget->addSearchItem(tr("Search for")+ " \"" + search_string + "\"",(uint32_t)request_id,QIcon(icon(ICON_SEARCH))); } diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index 69058382b..4d56ca76e 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -130,7 +130,10 @@ private slots: void sharePublishKey(); void loadComment(const RsGxsGroupId &grpId, const QVector& msg_versions,const RsGxsMessageId &most_recent_msgId, const QString &title); + void searchNetwork(const QString &search_string) ; + void removeAllSearches(); + void removeCurrentSearch(); private: virtual QString text(TextType type) = 0; From 5cb48c27de3592ab8a95a577dad8b25805377867 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 21 Jun 2018 09:26:03 +0200 Subject: [PATCH 081/138] renamed a few constants of GXS notify system into more consistent values --- libretroshare/src/gxs/rsgenexchange.cc | 14 +++++++------- libretroshare/src/retroshare/rsgxsservice.h | 2 +- libretroshare/src/services/p3gxschannels.cc | 8 ++++---- libretroshare/src/services/p3gxscircles.cc | 4 ++-- libretroshare/src/services/p3gxsforums.cc | 6 +++--- libretroshare/src/services/p3postbase.cc | 4 ++-- retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp | 6 +++--- retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h | 2 +- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index ba330e334..735a09b99 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -1643,7 +1643,7 @@ void RsGenExchange::notifyReceivePublishKey(const RsGxsGroupId &grpId) { RS_STACK_MUTEX(mGenMtx); - RsGxsGroupChange* gc = new RsGxsGroupChange(RsGxsNotify::TYPE_PUBLISHKEY, true); + RsGxsGroupChange* gc = new RsGxsGroupChange(RsGxsNotify::TYPE_RECEIVED_PUBLISHKEY, true); gc->mGrpIdList.push_back(grpId); mNotifications.push_back(gc); } @@ -2314,7 +2314,7 @@ void RsGenExchange::publishMsgs() if(!msgChangeMap.empty()) { - RsGxsMsgChange* ch = new RsGxsMsgChange(RsGxsNotify::TYPE_PUBLISH, false); + RsGxsMsgChange* ch = new RsGxsMsgChange(RsGxsNotify::TYPE_PUBLISHED, false); ch->msgChangeMap = msgChangeMap; mNotifications.push_back(ch); } @@ -2451,7 +2451,7 @@ void RsGenExchange::processGroupDelete() if(!grpDeleted.empty()) { - RsGxsGroupChange* gc = new RsGxsGroupChange(RsGxsNotify::TYPE_PUBLISH, false); + RsGxsGroupChange* gc = new RsGxsGroupChange(RsGxsNotify::TYPE_PUBLISHED, false); gc->mGrpIdList = grpDeleted; mNotifications.push_back(gc); } @@ -2760,7 +2760,7 @@ void RsGenExchange::publishGrps() if(!grpChanged.empty()) { - RsGxsGroupChange* gc = new RsGxsGroupChange(RsGxsNotify::TYPE_RECEIVE, true); + RsGxsGroupChange* gc = new RsGxsGroupChange(RsGxsNotify::TYPE_RECEIVED_NEW, true); gc->mGrpIdList = grpChanged; mNotifications.push_back(gc); #ifdef GEN_EXCH_DEBUG @@ -3026,7 +3026,7 @@ void RsGenExchange::processRecvdMessages() #endif mDataStore->storeMessage(msgs_to_store); - RsGxsMsgChange* c = new RsGxsMsgChange(RsGxsNotify::TYPE_RECEIVE, false); + RsGxsMsgChange* c = new RsGxsMsgChange(RsGxsNotify::TYPE_RECEIVED_NEW, false); c->msgChangeMap = msgIds; mNotifications.push_back(c); } @@ -3159,7 +3159,7 @@ void RsGenExchange::processRecvdGroups() if(!grpIds.empty()) { - RsGxsGroupChange* c = new RsGxsGroupChange(RsGxsNotify::TYPE_RECEIVE, false); + RsGxsGroupChange* c = new RsGxsGroupChange(RsGxsNotify::TYPE_RECEIVED_NEW, false); c->mGrpIdList = grpIds; mNotifications.push_back(c); mDataStore->storeGroup(grps_to_store); @@ -3243,7 +3243,7 @@ void RsGenExchange::performUpdateValidation() } // notify the client - RsGxsGroupChange* c = new RsGxsGroupChange(RsGxsNotify::TYPE_RECEIVE, true); + RsGxsGroupChange* c = new RsGxsGroupChange(RsGxsNotify::TYPE_RECEIVED_NEW, true); for(uint32_t i=0;i > GxsMsgRelatedMe struct RsGxsNotify { enum NotifyType - { TYPE_PUBLISH, TYPE_RECEIVE, TYPE_PROCESSED, TYPE_PUBLISHKEY }; + { TYPE_PUBLISHED, TYPE_RECEIVED_NEW, TYPE_PROCESSED, TYPE_RECEIVED_PUBLISHKEY }; virtual ~RsGxsNotify() {} virtual NotifyType getType() = 0; diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index 493779a8c..a9c54b789 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -237,7 +237,7 @@ void p3GxsChannels::notifyChanges(std::vector &changes) RsGxsMsgChange *msgChange = dynamic_cast(*it); if (msgChange) { - if (msgChange->getType() == RsGxsNotify::TYPE_RECEIVE) + if (msgChange->getType() == RsGxsNotify::TYPE_RECEIVED_NEW) { /* message received */ if (notify) @@ -296,10 +296,10 @@ void p3GxsChannels::notifyChanges(std::vector &changes) switch (grpChange->getType()) { case RsGxsNotify::TYPE_PROCESSED: - case RsGxsNotify::TYPE_PUBLISH: + case RsGxsNotify::TYPE_PUBLISHED: break; - case RsGxsNotify::TYPE_RECEIVE: + case RsGxsNotify::TYPE_RECEIVED_NEW: { /* group received */ std::list &grpList = grpChange->mGrpIdList; @@ -317,7 +317,7 @@ void p3GxsChannels::notifyChanges(std::vector &changes) break; } - case RsGxsNotify::TYPE_PUBLISHKEY: + case RsGxsNotify::TYPE_RECEIVED_PUBLISHKEY: { /* group received */ std::list &grpList = grpChange->mGrpIdList; diff --git a/libretroshare/src/services/p3gxscircles.cc b/libretroshare/src/services/p3gxscircles.cc index 5e27e378d..ac8e3a3a5 100644 --- a/libretroshare/src/services/p3gxscircles.cc +++ b/libretroshare/src/services/p3gxscircles.cc @@ -218,7 +218,7 @@ void p3GxsCircles::notifyChanges(std::vector &changes) std::cerr << " Msgs for Group: " << mit->first << std::endl; #endif force_cache_reload(RsGxsCircleId(mit->first)); - if (notify && (c->getType() == RsGxsNotify::TYPE_RECEIVE) ) + if (notify && (c->getType() == RsGxsNotify::TYPE_RECEIVED_NEW) ) for (std::vector::const_iterator msgIdIt(mit->second.begin()), end(mit->second.end()); msgIdIt != end; ++msgIdIt) { const RsGxsMessageId& msgId = *msgIdIt; @@ -261,7 +261,7 @@ void p3GxsCircles::notifyChanges(std::vector &changes) std::cerr << " forcing cache loading for circle " << *git << " in order to trigger subscribe update." << std::endl; #endif force_cache_reload(RsGxsCircleId(*git)) ; - if (notify && (c->getType() == RsGxsNotify::TYPE_RECEIVE) ) + if (notify && (c->getType() == RsGxsNotify::TYPE_RECEIVED_NEW) ) notify->AddFeedItem(RS_FEED_ITEM_CIRCLE_INVIT_REC,RsGxsCircleId(*git).toStdString(),""); } diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index dd98f88d1..69d33441e 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -197,10 +197,10 @@ void p3GxsForums::notifyChanges(std::vector &changes) switch (c->getType()) { case RsGxsNotify::TYPE_PROCESSED: - case RsGxsNotify::TYPE_PUBLISH: + case RsGxsNotify::TYPE_PUBLISHED: break; - case RsGxsNotify::TYPE_RECEIVE: + case RsGxsNotify::TYPE_RECEIVED_NEW: { RsGxsMsgChange *msgChange = dynamic_cast(c); if (msgChange) @@ -242,7 +242,7 @@ void p3GxsForums::notifyChanges(std::vector &changes) break; } - case RsGxsNotify::TYPE_PUBLISHKEY: + case RsGxsNotify::TYPE_RECEIVED_PUBLISHKEY: { RsGxsGroupChange *grpChange = dynamic_cast(*it); if (grpChange) diff --git a/libretroshare/src/services/p3postbase.cc b/libretroshare/src/services/p3postbase.cc index 0c37db1f1..5aaa6d88f 100644 --- a/libretroshare/src/services/p3postbase.cc +++ b/libretroshare/src/services/p3postbase.cc @@ -123,7 +123,7 @@ void p3PostBase::notifyChanges(std::vector &changes) // It could be taken a step further and directly request these msgs for an update. addGroupForProcessing(mit->first); - if (notify && msgChange->getType() == RsGxsNotify::TYPE_RECEIVE) + if (notify && msgChange->getType() == RsGxsNotify::TYPE_RECEIVED_NEW) { std::vector::iterator mit1; for (mit1 = mit->second.begin(); mit1 != mit->second.end(); ++mit1) @@ -151,7 +151,7 @@ void p3PostBase::notifyChanges(std::vector &changes) std::cerr << std::endl; #endif - if (notify && groupChange->getType() == RsGxsNotify::TYPE_RECEIVE) + if (notify && groupChange->getType() == RsGxsNotify::TYPE_RECEIVED_NEW) { notify->AddFeedItem(RS_FEED_ITEM_POSTED_NEW, git->toStdString()); } diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index d9c2c0bdd..e143278d1 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -93,7 +93,7 @@ GxsGroupFrameDialog::GxsGroupFrameDialog(RsGxsIfaceHelper *ifaceImpl, QWidget *p mStateHelper->addWidget(TOKEN_TYPE_GROUP_SUMMARY, ui->loadingLabel, UISTATE_LOADING_VISIBLE); connect(ui->groupTreeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT(groupTreeCustomPopupMenu(QPoint))); - connect(ui->groupTreeWidget, SIGNAL(treeCurrentItemChanged(QString)), this, SLOT(changedGroup(QString))); + connect(ui->groupTreeWidget, SIGNAL(treeCurrentItemChanged(QString)), this, SLOT(changedCurrentGroup(QString))); connect(ui->groupTreeWidget->treeWidget(), SIGNAL(signalMouseMiddleButtonClicked(QTreeWidgetItem*)), this, SLOT(groupTreeMiddleButtonClicked(QTreeWidgetItem*))); connect(ui->groupTreeWidget, SIGNAL(distantSearchRequested(const QString&)), this, SLOT(searchNetwork(const QString&))); connect(ui->messageTabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(messageTabCloseRequested(int))); @@ -630,7 +630,7 @@ bool GxsGroupFrameDialog::navigate(const RsGxsGroupId &groupId, const RsGxsMessa return false; } - changedGroup(groupIdString); + changedCurrentGroup(groupIdString); /* search exisiting tab */ GxsMessageFrameWidget *msgWidget = messageWidget(mGroupId, false); @@ -691,7 +691,7 @@ GxsCommentDialog *GxsGroupFrameDialog::commentWidget(const RsGxsMessageId& msgId return NULL; } -void GxsGroupFrameDialog::changedGroup(const QString &groupId) +void GxsGroupFrameDialog::changedCurrentGroup(const QString &groupId) { if (mInFill) { return; diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index 4d56ca76e..3e5091857 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -108,7 +108,7 @@ private slots: void restoreGroupKeys(); void newGroup(); - void changedGroup(const QString &groupId); + void changedCurrentGroup(const QString &groupId); void groupTreeMiddleButtonClicked(QTreeWidgetItem *item); void openInNewTab(); void messageTabCloseRequested(int index); From 3981bc8e3b1d3b82bcb3650859e4ade612401214 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 21 Jun 2018 13:48:57 +0200 Subject: [PATCH 082/138] extended notification system to add distant search result notification --- libretroshare/src/gxs/rsgenexchange.cc | 20 +++++++- libretroshare/src/gxs/rsgenexchange.h | 13 ++++- libretroshare/src/gxs/rsgxsnetservice.cc | 50 ++++++++++++++++++- libretroshare/src/gxs/rsgxsnetservice.h | 14 ++++++ libretroshare/src/gxs/rsgxsnettunnel.cc | 25 +++++++--- libretroshare/src/gxs/rsnxs.h | 35 +++++++++++++ libretroshare/src/gxs/rsnxsobserver.h | 15 +++++- libretroshare/src/gxstrans/p3gxstrans.cc | 2 +- libretroshare/src/retroshare/rsgxsservice.h | 14 +++++- libretroshare/src/services/p3gxschannels.cc | 1 + libretroshare/src/services/p3gxsforums.cc | 1 + .../src/gui/gxs/GxsGroupFrameDialog.cpp | 2 +- 12 files changed, 174 insertions(+), 18 deletions(-) diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 735a09b99..f7609a8f9 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -1571,7 +1571,7 @@ bool RsGenExchange::setAuthenPolicyFlag(const uint8_t &msgFlag, uint32_t& authen return true; } -void RsGenExchange::notifyNewGroups(std::vector &groups) +void RsGenExchange::receiveNewGroups(std::vector &groups) { RS_STACK_MUTEX(mGenMtx) ; @@ -1603,7 +1603,7 @@ void RsGenExchange::notifyNewGroups(std::vector &groups) } -void RsGenExchange::notifyNewMessages(std::vector& messages) +void RsGenExchange::receiveNewMessages(std::vector& messages) { RS_STACK_MUTEX(mGenMtx) ; @@ -1639,6 +1639,13 @@ void RsGenExchange::notifyNewMessages(std::vector& messages) } } +void RsGenExchange::receiveDistantSearchResults(TurtleRequestId id,const RsGxsGroupId &grpId) +{ + RS_STACK_MUTEX(mGenMtx); + + RsGxsDistantSearchResultChange* gc = new RsGxsDistantSearchResultChange(id,grpId); + mNotifications.push_back(gc); +} void RsGenExchange::notifyReceivePublishKey(const RsGxsGroupId &grpId) { RS_STACK_MUTEX(mGenMtx); @@ -1833,6 +1840,15 @@ uint32_t RsGenExchange::getSyncPeriod(const RsGxsGroupId& grpId) return RS_GXS_DEFAULT_MSG_REQ_PERIOD; } +bool RsGenExchange::getDistantSearchResults(const TurtleRequestId& id,std::list& group_infos) +{ + return (mNetService!=NULL) && mNetService->getDistantSearchResults(id,group_infos) ; +} +bool RsGenExchange::clearDistantSearchResults(const TurtleRequestId& id) +{ + return (mNetService!=NULL) && mNetService->clearDistantSearchResults(id) ; +} + bool RsGenExchange::getGroupNetworkStats(const RsGxsGroupId& grpId,RsGroupNetworkStats& stats) { return (!mNetService) || mNetService->getGroupNetworkStats(grpId,stats) ; diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h index 1e51d8b04..e08ba80bd 100644 --- a/libretroshare/src/gxs/rsgenexchange.h +++ b/libretroshare/src/gxs/rsgenexchange.h @@ -132,18 +132,24 @@ public: /*! * @param messages messages are deleted after function returns */ - virtual void notifyNewMessages(std::vector& messages); + virtual void receiveNewMessages(std::vector& messages); /*! * @param groups groups are deleted after function returns */ - virtual void notifyNewGroups(std::vector& groups); + virtual void receiveNewGroups(std::vector& groups); /*! * @param grpId group id */ virtual void notifyReceivePublishKey(const RsGxsGroupId &grpId); + /*! + * \brief notifyReceiveDistantSearchResults + * Should be called when new search results arrive. + * \param grpId + */ + virtual void receiveDistantSearchResults(TurtleRequestId id,const RsGxsGroupId &grpId); /*! * @param grpId group id */ @@ -682,6 +688,9 @@ public: virtual void setSyncPeriod(const RsGxsGroupId& grpId,uint32_t age_in_secs) ; virtual bool getGroupNetworkStats(const RsGxsGroupId& grpId,RsGroupNetworkStats& stats); + virtual bool getDistantSearchResults(const TurtleRequestId& id,std::list& group_infos) ; + virtual bool clearDistantSearchResults(const TurtleRequestId& id); + uint16_t serviceType() const { return mServType ; } uint32_t serviceFullType() const { return ((uint32_t)mServType << 8) + (((uint32_t) RS_PKT_VERSION_SERVICE) << 24); } diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 3a5c9ecb2..e5dfbd05a 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -498,8 +498,8 @@ void RsGxsNetService::processObserverNotifications() mNewPublishKeysToNotify.clear() ; } - if(!grps_copy.empty()) mObserver->notifyNewGroups (grps_copy); - if(!msgs_copy.empty()) mObserver->notifyNewMessages(msgs_copy); + if(!grps_copy.empty()) mObserver->receiveNewGroups (grps_copy); + if(!msgs_copy.empty()) mObserver->receiveNewMessages(msgs_copy); for(std::set::const_iterator it(keys_copy.begin());it!=keys_copy.end();++it) mObserver->notifyReceivePublishKey(*it); @@ -5117,9 +5117,36 @@ static bool termSearch(const std::string& src, const std::string& substring) /* always ignore case */ return src.end() != std::search( src.begin(), src.end(), substring.begin(), substring.end(), RsRegularExpression::CompareCharIC() ); } +void RsGxsNetService::receiveTurtleSearchResults(TurtleRequestId req, const std::list& group_infos) +{ + RS_STACK_MUTEX(mNxsMutex) ; +#warning We should use some central way to do that. This might be very costly if done often. + + RsGxsGrpMetaTemporaryMap grpMeta; + std::map& search_results_map(mDistantSearchResults[req]) ; + + for(auto it(group_infos.begin());it!=group_infos.end();++it) + if(search_results_map.find((*it).group_id) == search_results_map.end()) + grpMeta[(*it).group_id] = NULL; + + mDataStore->retrieveGxsGrpMetaData(grpMeta); + + std::list filtered_results ; + + // only keep groups that are not locally known, and groups that are not already in the mDistantSearchResults structure + + for(auto it(group_infos.begin());it!=group_infos.end();++it) + if(grpMeta[(*it).group_id] == NULL) + { + filtered_results.push_back(*it) ; + search_results_map[(*it).group_id] = *it; + mObserver->receiveDistantSearchResults(req,(*it).group_id) ; + } +} bool RsGxsNetService::search(const std::string& substring,std::list& group_infos) { + RS_STACK_MUTEX(mNxsMutex) ; RsGxsGrpMetaTemporaryMap grpMetaMap; mDataStore->retrieveGxsGrpMetaData(grpMetaMap); @@ -5148,3 +5175,22 @@ bool RsGxsNetService::search(const std::string& substring,std::list& group_infos) +{ + RS_STACK_MUTEX(mNxsMutex) ; + auto it = mDistantSearchResults.find(id) ; + + if(it == mDistantSearchResults.end()) + return false ; + + for(auto it2(it->second.begin());it2!=it->second.end();++it2) + group_infos.push_back(it2->second); + return true; +} +bool RsGxsNetService::clearDistantSearchResults(const TurtleRequestId& id) +{ + RS_STACK_MUTEX(mNxsMutex) ; + mDistantSearchResults.erase(id); + return true ; +} diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index db2de16b8..799a2b503 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -131,6 +131,7 @@ public: virtual TurtleRequestId turtleSearchRequest(const std::string& match_string); virtual bool search(const std::string& substring,std::list& group_infos) ; + virtual void receiveTurtleSearchResults(TurtleRequestId req,const std::list& group_infos); /*! * pauses synchronisation of subscribed groups and request for group id @@ -169,6 +170,16 @@ public: */ virtual bool getGroupNetworkStats(const RsGxsGroupId& id,RsGroupNetworkStats& stats) ; + /*! + * \brief getDistantSearchResults + * \param id Id of the search request previously issued + * \param group_infos Groups currently known for this search request. + * \return + * false if the id does not correspond to an ongoing distant search request. + */ + virtual bool getDistantSearchResults(const TurtleRequestId& id,std::list& group_infos) ; + virtual bool clearDistantSearchResults(const TurtleRequestId& id); + /*! * Used to inform the net service that we changed subscription status. That helps * optimising data transfer when e.g. unsubsribed groups are updated less often, etc @@ -598,6 +609,9 @@ private: std::set mNewStatsToNotify ; std::set mNewPublishKeysToNotify ; + // Distant search result map + std::map > mDistantSearchResults ; + void debugDump(); uint32_t mDefaultMsgStorePeriod ; diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index a52b2f020..eabc32e3a 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -1066,15 +1066,26 @@ void RsGxsNetTunnelService::receiveSearchResult(TurtleSearchRequestId request_id RsGxsNetTunnelTurtleSearchGroupSummaryItem *result_gs = dynamic_cast(item) ; - if(result_gs != NULL) + if(result_gs == NULL) { - GXS_NET_TUNNEL_DEBUG() << " : result is of type group summary result for service " << result_gs->service << std::dec << ": " << std::endl; - - for(auto it(result_gs->group_infos.begin());it!=result_gs->group_infos.end();++it) - std::cerr << " group " << (*it).group_id << ": " << (*it).group_name << ", " << (*it).number_of_messages << " messages, last is " << time(NULL)-(*it).last_message_ts << " secs ago." << std::endl; - -#warning MISSING CODE HERE - data should be passed up to UI in some way + GXS_NET_TUNNEL_ERROR() << ": deserialized item is not a GroupSummary Item. Smething's wrong here." << std::endl; + return ; } + + GXS_NET_TUNNEL_DEBUG() << " : result is of type group summary result for service " << result_gs->service << std::dec << ": " << std::endl; + + for(auto it(result_gs->group_infos.begin());it!=result_gs->group_infos.end();++it) + std::cerr << " group " << (*it).group_id << ": " << (*it).group_name << ", " << (*it).number_of_messages << " messages, last is " << time(NULL)-(*it).last_message_ts << " secs ago." << std::endl; + + auto it = mSearchableServices.find(result_gs->service) ; + + if(it == mSearchableServices.end()) + { + GXS_NET_TUNNEL_ERROR() << ": deserialized item is for service " << std::hex << result_gs->service << std::dec << " that is in the searchable services list." << std::endl; + return ; + } + + it->second->receiveTurtleSearchResults(request_id,result_gs->group_infos) ; } diff --git a/libretroshare/src/gxs/rsnxs.h b/libretroshare/src/gxs/rsnxs.h index 9d3673f1c..3f1cc9e25 100644 --- a/libretroshare/src/gxs/rsnxs.h +++ b/libretroshare/src/gxs/rsnxs.h @@ -103,9 +103,44 @@ public: virtual uint32_t getDefaultSyncAge() =0; virtual uint32_t getDefaultKeepAge() =0; + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// DISTANT SEARCH FUNCTIONS /// + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + /*! + * \brief turtleGroupRequest + * Requests a particular group meta data. The request protects the group ID. + * \param group_id + * \return + * returns the turtle request ID that might be associated to some results. + */ virtual TurtleRequestId turtleGroupRequest(const RsGxsGroupId& group_id)=0; + + /*! + * \brief turtleSearchRequest + * Uses distant search to match the substring to the group meta data. + * \param match_string + * \return + * returns the turtle request ID that might be associated to some results. + */ virtual TurtleRequestId turtleSearchRequest(const std::string& match_string)=0; + /*! + * \brief receiveTurtleSearchResults + * Called by turtle (through RsGxsNetTunnel) when new results are received + * \param req Turtle search request ID associated with this result + * \param group_infos Group summary information for the groups returned by the search + */ + virtual void receiveTurtleSearchResults(TurtleRequestId req,const std::list& group_infos)=0; + /*! + * \brief getDistantSearchResults + * \param id + * \param group_infos + * \return + */ + virtual bool getDistantSearchResults(const TurtleRequestId& id,std::list& group_infos)=0 ; + virtual bool clearDistantSearchResults(const TurtleRequestId& id)=0; + virtual bool search(const std::string& substring,std::list& group_infos) =0; /*! diff --git a/libretroshare/src/gxs/rsnxsobserver.h b/libretroshare/src/gxs/rsnxsobserver.h index 087842ef0..a16bc66af 100644 --- a/libretroshare/src/gxs/rsnxsobserver.h +++ b/libretroshare/src/gxs/rsnxsobserver.h @@ -29,6 +29,7 @@ #include #include "rsitems/rsnxsitems.h" +typedef uint32_t TurtleRequestId ; class RsNxsObserver { @@ -42,12 +43,22 @@ public: /*! * @param messages messages are deleted after function returns */ - virtual void notifyNewMessages(std::vector& messages) = 0; + virtual void receiveNewMessages(std::vector& messages) = 0; /*! * @param groups groups are deleted after function returns */ - virtual void notifyNewGroups(std::vector& groups) = 0; + virtual void receiveNewGroups(std::vector& groups) = 0; + + /*! + * \brief receiveDistantSearchResults + * Called when new distant search result arrive. + * \param grpId + */ + virtual void receiveDistantSearchResults(TurtleRequestId& /*id*/,const RsGxsGroupId& /*grpId*/) + { + std::cerr << __PRETTY_FUNCTION__ << ": not overloaded but still called. Nothing will happen." << std::endl; + } /*! * @param grpId group id diff --git a/libretroshare/src/gxstrans/p3gxstrans.cc b/libretroshare/src/gxstrans/p3gxstrans.cc index d0dbb61b0..05c37cdb5 100644 --- a/libretroshare/src/gxstrans/p3gxstrans.cc +++ b/libretroshare/src/gxstrans/p3gxstrans.cc @@ -839,7 +839,7 @@ bool p3GxsTrans::dispatchDecryptedMail( const RsGxsId& authorId, #endif std::vector rcct; rcct.push_back(receipt); - RsGenExchange::notifyNewMessages(rcct); + RsGenExchange::receiveNewMessages(rcct); GxsTransClient* recipientService = NULL; { diff --git a/libretroshare/src/retroshare/rsgxsservice.h b/libretroshare/src/retroshare/rsgxsservice.h index 14f02ed64..83f73887b 100644 --- a/libretroshare/src/retroshare/rsgxsservice.h +++ b/libretroshare/src/retroshare/rsgxsservice.h @@ -6,6 +6,7 @@ #include "retroshare/rstokenservice.h" struct RsMsgMetaData ; +typedef uint32_t TurtleRequestId; typedef std::map > GxsMsgMetaMap; typedef std::map > GxsMsgRelatedMetaMap; @@ -18,7 +19,7 @@ typedef std::map > GxsMsgRelatedMe struct RsGxsNotify { enum NotifyType - { TYPE_PUBLISHED, TYPE_RECEIVED_NEW, TYPE_PROCESSED, TYPE_RECEIVED_PUBLISHKEY }; + { TYPE_PUBLISHED, TYPE_RECEIVED_NEW, TYPE_PROCESSED, TYPE_RECEIVED_PUBLISHKEY, TYPE_RECEIVED_DISTANT_SEARCH_RESULTS }; virtual ~RsGxsNotify() {} virtual NotifyType getType() = 0; @@ -39,6 +40,17 @@ private: bool mMetaChange; }; +class RsGxsDistantSearchResultChange: public RsGxsNotify +{ +public: + RsGxsDistantSearchResultChange(TurtleRequestId id,const RsGxsGroupId& group_id) : mRequestId(id),mGroupId(group_id){} + + NotifyType getType() { return TYPE_RECEIVED_DISTANT_SEARCH_RESULTS ; } +private: + TurtleRequestId mRequestId ; + RsGxsGroupId mGroupId; +}; + /*! * Relevant to message changes */ diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index a9c54b789..221825e9b 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -295,6 +295,7 @@ void p3GxsChannels::notifyChanges(std::vector &changes) { switch (grpChange->getType()) { + default: case RsGxsNotify::TYPE_PROCESSED: case RsGxsNotify::TYPE_PUBLISHED: break; diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index 69d33441e..2fa829c1c 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -196,6 +196,7 @@ void p3GxsForums::notifyChanges(std::vector &changes) switch (c->getType()) { + default: case RsGxsNotify::TYPE_PROCESSED: case RsGxsNotify::TYPE_PUBLISHED: break; diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index e143278d1..04e64258b 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -1122,7 +1122,7 @@ void GxsGroupFrameDialog::loadRequest(const TokenQueue *queue, const TokenReques TurtleRequestId GxsGroupFrameDialog::distantSearch(const QString& search_string) // this should be overloaded in the child class { - std::cerr << "Searching for \"" << search_string.toStdString() << "\". Function is not implemented yet." << std::endl; + std::cerr << "Searching for \"" << search_string.toStdString() << "\". Function is not overloaded, so nothing will happen." << std::endl; return 0; } From 6ccc7654d688c7eff72e57c247ffec585ecd34b3 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 23 Jun 2018 22:25:36 +0200 Subject: [PATCH 083/138] added code to notify GxsBroadcast system with new distant search results --- libretroshare/src/gxs/rsgenexchange.cc | 8 ++++++++ libretroshare/src/gxs/rsgxsnetservice.cc | 9 ++++++--- libretroshare/src/gxs/rsnxsobserver.h | 2 +- libretroshare/src/retroshare/rsgxsiface.h | 1 + libretroshare/src/retroshare/rsgxsservice.h | 2 +- retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp | 10 ++++++++++ retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h | 1 + .../src/gui/gxs/RsGxsUpdateBroadcastBase.cpp | 12 +++++++++++- .../src/gui/gxs/RsGxsUpdateBroadcastBase.h | 5 +++++ .../src/gui/gxs/RsGxsUpdateBroadcastPage.cpp | 5 +++++ .../src/gui/gxs/RsGxsUpdateBroadcastPage.h | 2 ++ .../src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp | 4 ++++ .../src/gui/gxs/RsGxsUpdateBroadcastWidget.h | 2 ++ retroshare-gui/src/util/RsGxsUpdateBroadcast.cpp | 3 +++ retroshare-gui/src/util/RsGxsUpdateBroadcast.h | 3 +++ 15 files changed, 63 insertions(+), 6 deletions(-) diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 8da9e606a..43e515732 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -1110,6 +1110,8 @@ void RsGenExchange::receiveChanges(std::vector& changes) RsGxsNotify* n = *vit; RsGxsGroupChange* gc; RsGxsMsgChange* mc; + RsGxsDistantSearchResultChange *gt; + if((mc = dynamic_cast(n)) != NULL) { if (mc->metaChange()) @@ -1132,6 +1134,10 @@ void RsGenExchange::receiveChanges(std::vector& changes) out.mGrps.splice(out.mGrps.end(), gc->mGrpIdList); } } + else if((gt = dynamic_cast(n)) != NULL) + { + out.mDistantSearchReqs.push_back(gt->mRequestId); + } else std::cerr << "(EE) Unknown changes type!!" << std::endl; @@ -1641,6 +1647,8 @@ void RsGenExchange::receiveDistantSearchResults(TurtleRequestId id,const RsGxsGr RsGxsDistantSearchResultChange* gc = new RsGxsDistantSearchResultChange(id,grpId); mNotifications.push_back(gc); + + std::cerr << "RsGenExchange::receiveDistantSearchResults(): received result for request " << std::hex << id << std::dec << std::endl; } void RsGenExchange::notifyReceivePublishKey(const RsGxsGroupId &grpId) { diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index f456f4d7e..2ac77b279 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -5136,7 +5136,8 @@ void RsGxsNetService::receiveTurtleSearchResults(TurtleRequestId req, const std: // only keep groups that are not locally known, and groups that are not already in the mDistantSearchResults structure for(auto it(group_infos.begin());it!=group_infos.end();++it) - if(grpMeta[(*it).group_id] == NULL) +#warning Uncomment when done with testing! +// if(grpMeta[(*it).group_id] == NULL) { filtered_results.push_back(*it) ; search_results_map[(*it).group_id] = *it; @@ -5146,9 +5147,11 @@ void RsGxsNetService::receiveTurtleSearchResults(TurtleRequestId req, const std: bool RsGxsNetService::search(const std::string& substring,std::list& group_infos) { - RS_STACK_MUTEX(mNxsMutex) ; RsGxsGrpMetaTemporaryMap grpMetaMap; - mDataStore->retrieveGxsGrpMetaData(grpMetaMap); + { + RS_STACK_MUTEX(mNxsMutex) ; + mDataStore->retrieveGxsGrpMetaData(grpMetaMap); + } RsGroupNetworkStats stats ; diff --git a/libretroshare/src/gxs/rsnxsobserver.h b/libretroshare/src/gxs/rsnxsobserver.h index a16bc66af..b52d69d65 100644 --- a/libretroshare/src/gxs/rsnxsobserver.h +++ b/libretroshare/src/gxs/rsnxsobserver.h @@ -55,7 +55,7 @@ public: * Called when new distant search result arrive. * \param grpId */ - virtual void receiveDistantSearchResults(TurtleRequestId& /*id*/,const RsGxsGroupId& /*grpId*/) + virtual void receiveDistantSearchResults(TurtleRequestId /*id*/,const RsGxsGroupId& /*grpId*/) { std::cerr << __PRETTY_FUNCTION__ << ": not overloaded but still called. Nothing will happen." << std::endl; } diff --git a/libretroshare/src/retroshare/rsgxsiface.h b/libretroshare/src/retroshare/rsgxsiface.h index 36c660ef8..b9c974f9c 100644 --- a/libretroshare/src/retroshare/rsgxsiface.h +++ b/libretroshare/src/retroshare/rsgxsiface.h @@ -44,6 +44,7 @@ public: std::map > mMsgsMeta; std::list mGrps; std::list mGrpsMeta; + std::list mDistantSearchReqs; }; /*! diff --git a/libretroshare/src/retroshare/rsgxsservice.h b/libretroshare/src/retroshare/rsgxsservice.h index affbeea50..17ce356ec 100644 --- a/libretroshare/src/retroshare/rsgxsservice.h +++ b/libretroshare/src/retroshare/rsgxsservice.h @@ -46,7 +46,7 @@ public: RsGxsDistantSearchResultChange(TurtleRequestId id,const RsGxsGroupId& group_id) : mRequestId(id),mGroupId(group_id){} NotifyType getType() { return TYPE_RECEIVED_DISTANT_SEARCH_RESULTS ; } -private: + TurtleRequestId mRequestId ; RsGxsGroupId mGroupId; }; diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 470ffbaab..a8b6e6344 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -245,6 +245,16 @@ void GxsGroupFrameDialog::updateDisplay(bool complete) updateMessageSummaryList(msgIt->first); } } + + updateSearchResults() ; +} + +void GxsGroupFrameDialog::updateSearchResults() +{ + const std::set& reqs = getSearchResults(); + + for(auto it(reqs.begin());it!=reqs.end();++it) + std::cerr << "updating search ID " << std::hex << *it << std::dec << std::endl; } void GxsGroupFrameDialog::todo() diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index 3e5091857..f8db16a10 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -152,6 +152,7 @@ private: void initUi(); void updateMessageSummaryList(RsGxsGroupId groupId); + void updateSearchResults(); void openGroupInNewTab(const RsGxsGroupId &groupId); void groupSubscribe(bool subscribe); diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.cpp b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.cpp index ffbd6147e..76274b27a 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.cpp +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.cpp @@ -16,12 +16,19 @@ RsGxsUpdateBroadcastBase::RsGxsUpdateBroadcastBase(RsGxsIfaceHelper *ifaceImpl, connect(mUpdateBroadcast, SIGNAL(changed()), this, SLOT(updateBroadcastChanged())); connect(mUpdateBroadcast, SIGNAL(grpsChanged(std::list, std::list)), this, SLOT(updateBroadcastGrpsChanged(std::list,std::list))); connect(mUpdateBroadcast, SIGNAL(msgsChanged(std::map >, std::map >)), this, SLOT(updateBroadcastMsgsChanged(std::map >,std::map >))); + connect(mUpdateBroadcast, SIGNAL(distantSearchResultsChanged(const std::list&)), this, SLOT(updateBroadcastDistantSearchResultsChanged(const std::list&))); } RsGxsUpdateBroadcastBase::~RsGxsUpdateBroadcastBase() { } +void RsGxsUpdateBroadcastBase::updateBroadcastDistantSearchResultsChanged(const std::list& ids) +{ + for(auto it(ids.begin());it!=ids.end();++it) + mTurtleResults.insert(*it); +} + void RsGxsUpdateBroadcastBase::fillComplete() { mFillComplete = true; @@ -37,6 +44,9 @@ void RsGxsUpdateBroadcastBase::securedUpdateDisplay() return; } + // This is *bad* because if the connection is done asynchronously the client will call mGrpIds, mGrpIdsMeta, etc without the guarranty that the + // the structed havnt' been cleared in the mean time. + emit fillDisplay(mFillComplete); mFillComplete = false; @@ -75,7 +85,7 @@ void RsGxsUpdateBroadcastBase::updateBroadcastChanged() // The question to whether we should re=load when mGrpIds is not empty is still open. It's not harmful anyway. // This should probably be decided by the service itself. - if (!mGrpIds.empty() || !mGrpIdsMeta.empty() /*|| !mMsgIds.empty()*/ || !mMsgIdsMeta.empty()) + if (!mGrpIds.empty() || !mGrpIdsMeta.empty() /*|| !mMsgIds.empty()*/ || !mMsgIdsMeta.empty() || !mTurtleResults.empty()) mFillComplete = true ; securedUpdateDisplay(); diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.h b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.h index 90dd3f507..704ff2157 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.h +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.h @@ -7,6 +7,8 @@ class QShowEvent; class RsGxsIfaceHelper; class RsGxsUpdateBroadcast; +typedef uint32_t TurtleRequestId ; + class RsGxsUpdateBroadcastBase : public QObject { friend class RsGxsUpdateBroadcastPage; @@ -25,6 +27,7 @@ public: const std::map > &getMsgIds() { return mMsgIds; } const std::map > &getMsgIdsMeta() { return mMsgIdsMeta; } void getAllMsgIds(std::map > &msgIds); + const std::set& getSearchResults() { return mTurtleResults ; } protected: void fillComplete(); @@ -39,6 +42,7 @@ private slots: void updateBroadcastChanged(); void updateBroadcastGrpsChanged(const std::list& grpIds, const std::list &grpIdsMeta); void updateBroadcastMsgsChanged(const std::map >& msgIds, const std::map >& msgIdsMeta); + void updateBroadcastDistantSearchResultsChanged(const std::list& ids); void securedUpdateDisplay(); private: @@ -49,4 +53,5 @@ private: std::set mGrpIdsMeta; std::map > mMsgIds; std::map > mMsgIdsMeta; + std::set mTurtleResults; }; diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.cpp b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.cpp index 629148688..c0d19c56f 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.cpp +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.cpp @@ -22,6 +22,11 @@ void RsGxsUpdateBroadcastPage::setUpdateWhenInvisible(bool update) mBase->setUpdateWhenInvisible(update); } +const std::set& RsGxsUpdateBroadcastPage::getSearchResults() +{ + return mBase->getSearchResults(); +} + const std::set &RsGxsUpdateBroadcastPage::getGrpIdsMeta() { return mBase->getGrpIdsMeta(); diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.h b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.h index 0c67f58ff..e3e9a4563 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.h +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.h @@ -13,6 +13,7 @@ class RsGxsIfaceHelper; class RsGxsUpdateBroadcastBase; +typedef uint32_t TurtleRequestId ; class RsGxsUpdateBroadcastPage : public MainPage { @@ -30,6 +31,7 @@ public: const std::map > &getMsgIds(); const std::map > &getMsgIdsMeta(); void getAllMsgIds(std::map > &msgIds); + const std::set& getSearchResults(); protected: virtual void showEvent(QShowEvent *event); diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp index a6e3e5705..bade31287 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp @@ -29,6 +29,10 @@ const std::set &RsGxsUpdateBroadcastWidget::getGrpIds() return mBase->getGrpIds(); } +const std::set& RsGxsUpdateBroadcastWidget::getSearchResults() +{ + return mBase->getSearchResults(); +} const std::set &RsGxsUpdateBroadcastWidget::getGrpIdsMeta() { return mBase->getGrpIdsMeta(); diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h index f0ab07742..f99a34d04 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h @@ -13,6 +13,7 @@ class RsGxsIfaceHelper; class RsGxsUpdateBroadcastBase; +typedef uint32_t TurtleRequestId; class RsGxsUpdateBroadcastWidget : public QWidget { @@ -30,6 +31,7 @@ public: const std::map > &getMsgIds(); const std::map > &getMsgIdsMeta(); void getAllMsgIds(std::map > &msgIds); + const std::set& getSearchResults() ; RsGxsIfaceHelper *interfaceHelper() { return mInterfaceHelper; } diff --git a/retroshare-gui/src/util/RsGxsUpdateBroadcast.cpp b/retroshare-gui/src/util/RsGxsUpdateBroadcast.cpp index 0fdf63d65..6b6295e2e 100644 --- a/retroshare-gui/src/util/RsGxsUpdateBroadcast.cpp +++ b/retroshare-gui/src/util/RsGxsUpdateBroadcast.cpp @@ -79,5 +79,8 @@ void RsGxsUpdateBroadcast::onChangesReceived(const RsGxsChanges& changes) emit grpsChanged(changes.mGrps, changes.mGrpsMeta); } + if(!changes.mDistantSearchReqs.empty()) + emit distantSearchResultsChanged(changes.mDistantSearchReqs) ; + emit changed(); } diff --git a/retroshare-gui/src/util/RsGxsUpdateBroadcast.h b/retroshare-gui/src/util/RsGxsUpdateBroadcast.h index 1622ca606..e08a866c7 100644 --- a/retroshare-gui/src/util/RsGxsUpdateBroadcast.h +++ b/retroshare-gui/src/util/RsGxsUpdateBroadcast.h @@ -8,6 +8,8 @@ class RsGxsIfaceHelper; class RsGxsChanges; +typedef uint32_t TurtleRequestId ; + class RsGxsUpdateBroadcast : public QObject { Q_OBJECT @@ -21,6 +23,7 @@ signals: void changed(); void msgsChanged(const std::map >& msgIds, const std::map >& msgIdsMeta); void grpsChanged(const std::list& grpIds, const std::list& grpIdsMeta); + void distantSearchResultsChanged(const std::list& reqs); private slots: void onChangesReceived(const RsGxsChanges& changes); From e351d7257ebf1489ef491589617c2df71ce3df23 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 24 Jun 2018 16:55:38 +0200 Subject: [PATCH 084/138] added retrieval of search results in UI --- libretroshare/src/gxs/rsgenexchange.cc | 9 ----- libretroshare/src/gxs/rsgenexchange.h | 11 +++--- libretroshare/src/gxs/rsgxsnetservice.cc | 36 ++++++++++--------- libretroshare/src/gxs/rsgxsnetservice.h | 12 ++----- libretroshare/src/gxs/rsnxs.h | 30 ++++++---------- libretroshare/src/retroshare/rsgxschannels.h | 4 +-- libretroshare/src/retroshare/rsgxsiface.h | 20 +++++++++++ libretroshare/src/services/p3gxschannels.cc | 10 ++++++ libretroshare/src/services/p3gxschannels.h | 2 ++ .../src/gui/gxs/GxsGroupFrameDialog.cpp | 11 ++++++ .../src/gui/gxs/GxsGroupFrameDialog.h | 1 + .../src/gui/gxschannels/GxsChannelDialog.cpp | 5 +++ .../src/gui/gxschannels/GxsChannelDialog.h | 1 + 13 files changed, 87 insertions(+), 65 deletions(-) diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 43e515732..8a199331c 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -1844,15 +1844,6 @@ uint32_t RsGenExchange::getSyncPeriod(const RsGxsGroupId& grpId) return RS_GXS_DEFAULT_MSG_REQ_PERIOD; } -bool RsGenExchange::getDistantSearchResults(const TurtleRequestId& id,std::list& group_infos) -{ - return (mNetService!=NULL) && mNetService->getDistantSearchResults(id,group_infos) ; -} -bool RsGenExchange::clearDistantSearchResults(const TurtleRequestId& id) -{ - return (mNetService!=NULL) && mNetService->clearDistantSearchResults(id) ; -} - bool RsGenExchange::getGroupNetworkStats(const RsGxsGroupId& grpId,RsGroupNetworkStats& stats) { return (!mNetService) || mNetService->getGroupNetworkStats(grpId,stats) ; diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h index e08ba80bd..805ab5c26 100644 --- a/libretroshare/src/gxs/rsgenexchange.h +++ b/libretroshare/src/gxs/rsgenexchange.h @@ -121,9 +121,9 @@ public: virtual ~RsGenExchange(); - // Convention that this is implemented here. + // Convention that this is implemented here. // and passes to network service. - virtual RsServiceInfo getServiceInfo() = 0; + virtual RsServiceInfo getServiceInfo() = 0; void setNetworkExchangeService(RsNetworkExchangeService *ns) ; @@ -581,7 +581,7 @@ public: * @param msgs */ void deleteMsgs(uint32_t& token, const GxsMsgReq& msgs); - + protected: /*! * This represents the group before its signature is calculated @@ -665,7 +665,7 @@ public: */ void shareGroupPublishKey(const RsGxsGroupId& grpId,const std::set& peers) ; - + /*! * Returns the local TS of the group as known by the network service. * This is useful to allow various network services to sync their update TS @@ -688,9 +688,6 @@ public: virtual void setSyncPeriod(const RsGxsGroupId& grpId,uint32_t age_in_secs) ; virtual bool getGroupNetworkStats(const RsGxsGroupId& grpId,RsGroupNetworkStats& stats); - virtual bool getDistantSearchResults(const TurtleRequestId& id,std::list& group_infos) ; - virtual bool clearDistantSearchResults(const TurtleRequestId& id); - uint16_t serviceType() const { return mServType ; } uint32_t serviceFullType() const { return ((uint32_t)mServType << 8) + (((uint32_t) RS_PKT_VERSION_SERVICE) << 24); } diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 2ac77b279..480e9dc2e 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -5117,6 +5117,25 @@ static bool termSearch(const std::string& src, const std::string& substring) /* always ignore case */ return src.end() != std::search( src.begin(), src.end(), substring.begin(), substring.end(), RsRegularExpression::CompareCharIC() ); } + +bool RsGxsNetService::retrieveDistantSearchResults(TurtleRequestId req,std::map& group_infos) +{ + RS_STACK_MUTEX(mNxsMutex) ; + + auto it = mDistantSearchResults.find(req) ; + + if(it == mDistantSearchResults.end()) + return false ; + + group_infos = it->second; + return true ; +} +bool RsGxsNetService::clearDistantSearchResults(const TurtleRequestId& id) +{ + RS_STACK_MUTEX(mNxsMutex) ; + mDistantSearchResults.erase(id); + return true ; +} void RsGxsNetService::receiveTurtleSearchResults(TurtleRequestId req, const std::list& group_infos) { RS_STACK_MUTEX(mNxsMutex) ; @@ -5179,21 +5198,4 @@ bool RsGxsNetService::search(const std::string& substring,std::list& group_infos) -{ - RS_STACK_MUTEX(mNxsMutex) ; - auto it = mDistantSearchResults.find(id) ; - if(it == mDistantSearchResults.end()) - return false ; - - for(auto it2(it->second.begin());it2!=it->second.end();++it2) - group_infos.push_back(it2->second); - return true; -} -bool RsGxsNetService::clearDistantSearchResults(const TurtleRequestId& id) -{ - RS_STACK_MUTEX(mNxsMutex) ; - mDistantSearchResults.erase(id); - return true ; -} diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index 799a2b503..05031feb3 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -132,6 +132,8 @@ public: virtual bool search(const std::string& substring,std::list& group_infos) ; virtual void receiveTurtleSearchResults(TurtleRequestId req,const std::list& group_infos); + virtual bool retrieveDistantSearchResults(TurtleRequestId req, std::map &group_infos); + virtual bool clearDistantSearchResults(const TurtleRequestId& id); /*! * pauses synchronisation of subscribed groups and request for group id @@ -170,16 +172,6 @@ public: */ virtual bool getGroupNetworkStats(const RsGxsGroupId& id,RsGroupNetworkStats& stats) ; - /*! - * \brief getDistantSearchResults - * \param id Id of the search request previously issued - * \param group_infos Groups currently known for this search request. - * \return - * false if the id does not correspond to an ongoing distant search request. - */ - virtual bool getDistantSearchResults(const TurtleRequestId& id,std::list& group_infos) ; - virtual bool clearDistantSearchResults(const TurtleRequestId& id); - /*! * Used to inform the net service that we changed subscription status. That helps * optimising data transfer when e.g. unsubsribed groups are updated less often, etc diff --git a/libretroshare/src/gxs/rsnxs.h b/libretroshare/src/gxs/rsnxs.h index 3f1cc9e25..b483e5748 100644 --- a/libretroshare/src/gxs/rsnxs.h +++ b/libretroshare/src/gxs/rsnxs.h @@ -60,25 +60,6 @@ * - the also group matrix settings which is by default everyone can transfer to each other */ -/*! - * \brief The RsGxsGroupSymmary struct - * This structure is used to transport group summary information when a GXS service is searched. It contains the group information - * as well as a context string to tell where the information was found. It is more compact than a GroupMeta object, so as to make - * search responses as light as possible. - */ -struct RsGxsGroupSummary -{ - RsGxsGroupId group_id ; - - std::string group_name ; - std::string group_description ; - std::string search_context ; - RsGxsId author_id ; - time_t publish_ts ; - uint32_t number_of_messages ; - time_t last_message_ts ; -}; - class RsNetworkExchangeService { public: @@ -132,13 +113,22 @@ public: * \param group_infos Group summary information for the groups returned by the search */ virtual void receiveTurtleSearchResults(TurtleRequestId req,const std::list& group_infos)=0; + + /*! + * \brief retrieveTurtleSearchResults + * To be used to retrieve the search results that have been notified (or not) + * \param req request that match the results to retrieve + * \param group_infos results to retrieve. + * \return + * false when the request is unknown. + */ + virtual bool retrieveDistantSearchResults(TurtleRequestId req, std::map &group_infos)=0; /*! * \brief getDistantSearchResults * \param id * \param group_infos * \return */ - virtual bool getDistantSearchResults(const TurtleRequestId& id,std::list& group_infos)=0 ; virtual bool clearDistantSearchResults(const TurtleRequestId& id)=0; virtual bool search(const std::string& substring,std::list& group_infos) =0; diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index 6bad3ba21..af08f4bb4 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -35,8 +35,6 @@ #include "retroshare/rsgxscommon.h" #include "retroshare/rsturtle.h" - - /* The Main Interface Class - for information about your Peers */ class RsGxsChannels; extern RsGxsChannels *rsGxsChannels; @@ -99,6 +97,8 @@ virtual bool getPostData(const uint32_t &token, std::vector &p virtual TurtleRequestId turtleGroupRequest(const RsGxsGroupId& group_id)=0; virtual TurtleRequestId turtleSearchRequest(const std::string& match_string)=0; + virtual bool retrieveDistantSearchResults(TurtleRequestId req, std::map &results) =0; + virtual bool clearDistantSearchResults(TurtleRequestId req)=0; ////////////////////////////////////////////////////////////////////////////// virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0; diff --git a/libretroshare/src/retroshare/rsgxsiface.h b/libretroshare/src/retroshare/rsgxsiface.h index b9c974f9c..e822d70d4 100644 --- a/libretroshare/src/retroshare/rsgxsiface.h +++ b/libretroshare/src/retroshare/rsgxsiface.h @@ -32,6 +32,26 @@ #include "gxs/rsgxsdata.h" #include "retroshare/rsgxsifacetypes.h" +/*! + * \brief The RsGxsGroupSymmary struct + * This structure is used to transport group summary information when a GXS service is searched. It contains the group information + * as well as a context string to tell where the information was found. It is more compact than a GroupMeta object, so as to make + * search responses as light as possible. + */ +struct RsGxsGroupSummary +{ + RsGxsGroupId group_id ; + + std::string group_name ; + std::string group_description ; + std::string search_context ; + RsGxsId author_id ; + time_t publish_ts ; + uint32_t number_of_messages ; + time_t last_message_ts ; +}; + + /*! * Stores ids of changed gxs groups and messages. It is used to notify the GUI about changes. */ diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index de4bb1fe6..e4f89861e 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -1696,3 +1696,13 @@ TurtleRequestId p3GxsChannels::turtleSearchRequest(const std::string& match_stri return netService()->turtleSearchRequest(match_string) ; } +bool p3GxsChannels::clearDistantSearchResults(TurtleRequestId req) +{ + return netService()->clearDistantSearchResults(req); +} +bool p3GxsChannels::retrieveDistantSearchResults(TurtleRequestId req,std::map& results) +{ + return netService()->retrieveDistantSearchResults(req,results); +} + + diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index 961c05fa6..2243e57ee 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -74,6 +74,8 @@ virtual void service_tick(); virtual TurtleRequestId turtleGroupRequest(const RsGxsGroupId& group_id); virtual TurtleRequestId turtleSearchRequest(const std::string& match_string); + virtual bool retrieveDistantSearchResults(TurtleRequestId req, std::map &results) ; + virtual bool clearDistantSearchResults(TurtleRequestId req); // Overloaded to cache new groups. virtual RsGenExchange::ServiceCreate_Return service_CreateGroup(RsGxsGrpItem* grpItem, RsTlvSecurityKeySet& keySet); diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index a8b6e6344..598bd35fc 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -254,7 +254,18 @@ void GxsGroupFrameDialog::updateSearchResults() const std::set& reqs = getSearchResults(); for(auto it(reqs.begin());it!=reqs.end();++it) + { std::cerr << "updating search ID " << std::hex << *it << std::dec << std::endl; + + std::map group_infos; + + getDistantSearchResults(*it,group_infos) ; + + std::cerr << "retrieved " << std::endl; + + for(auto it2(group_infos.begin());it2!=group_infos.end();++it2) + std::cerr << " " << it2->first << " " << it2->second.group_id << " \"" << it2->second.group_name << "\"" << std::endl; + } } void GxsGroupFrameDialog::todo() diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index f8db16a10..ac04edf59 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -148,6 +148,7 @@ private: virtual void groupTreeCustomActions(RsGxsGroupId /*grpId*/, int /*subscribeFlags*/, QList &/*actions*/) {} virtual RsGxsCommentService *getCommentService() { return NULL; } virtual QWidget *createCommentHeaderWidget(const RsGxsGroupId &/*grpId*/, const RsGxsMessageId &/*msgId*/) { return NULL; } + virtual bool getDistantSearchResults(TurtleRequestId id, std::map& group_infos){ return false ;} void initUi(); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp index acd9dae0e..160119ee2 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp @@ -341,3 +341,8 @@ TurtleRequestId GxsChannelDialog::distantSearch(const QString& search_string) { return rsGxsChannels->turtleSearchRequest(search_string.toStdString()) ; } + +bool GxsChannelDialog::getDistantSearchResults(TurtleRequestId id, std::map& group_infos) +{ + return rsGxsChannels->retrieveDistantSearchResults(id,group_infos); +} diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h index 3864fba13..38b27d805 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h @@ -50,6 +50,7 @@ protected: virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Channel; } virtual QString getHelpString() const ; virtual void groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo, const RsUserdata *userdata); + virtual bool getDistantSearchResults(TurtleRequestId id, std::map& group_infos); virtual TurtleRequestId distantSearch(const QString& search_string) ; private slots: From 08b436e5f47eb1d3e4215cbdc13f60ae1be03c3b Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 24 Jun 2018 23:15:22 +0200 Subject: [PATCH 085/138] added display of searched groups --- .../src/gui/gxs/GxsGroupFrameDialog.cpp | 51 ++++++++++++++++--- .../src/gui/gxs/GxsGroupFrameDialog.h | 3 +- 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 598bd35fc..1f2d2fc00 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -263,8 +263,40 @@ void GxsGroupFrameDialog::updateSearchResults() std::cerr << "retrieved " << std::endl; - for(auto it2(group_infos.begin());it2!=group_infos.end();++it2) - std::cerr << " " << it2->first << " " << it2->second.group_id << " \"" << it2->second.group_name << "\"" << std::endl; + auto it2 = mSearchGroupsItems.find(*it); + + std::set& known_groups(mKnownGroups[*it]) ; + + if(mSearchGroupsItems.end() == it2) + { + std::cerr << "GxsGroupFrameDialog::updateSearchResults(): received result notification for req " << std::hex << *it << std::dec << " but no item present!" << std::endl; + continue ; // we could create the item just as well but since this situation is not supposed to happen, I prefer to make this a failure case. + } + + QList group_items ; + + for(auto it3(group_infos.begin());it3!=group_infos.end();++it3) + if(known_groups.end() == known_groups.find(it3->first)) + { + std::cerr << " adding new group " << it3->first << " " << it3->second.group_id << " \"" << it3->second.group_name << "\"" << std::endl; + + known_groups.insert(it3->first) ; + + GroupItemInfo i ; + i.id = QString(it3->second.group_id.toStdString().c_str()) ; + i.name = QString::fromUtf8(it3->second.group_name.c_str()) ; + i.description = QString::fromUtf8(it3->second.group_description.c_str()) ; + i.popularity = 0; // could be set to the number of hits + i.lastpost = QDateTime::fromTime_t(it3->second.last_message_ts); + i.subscribeFlags = 0; // irrelevant here + i.publishKey = false ; // IS_GROUP_PUBLISHER(groupInfo.mSubscribeFlags) ; + i.adminKey = false ; // IS_GROUP_ADMIN(groupInfo.mSubscribeFlags) ; + i.max_visible_posts = it3->second.number_of_messages ; + + group_items.push_back(i); + } + + ui->groupTreeWidget->fillGroupItems(it2->second, group_items); } } @@ -282,21 +314,24 @@ void GxsGroupFrameDialog::removeCurrentSearch() TurtleRequestId search_request_id = action->data().toUInt(); - auto it = mSearchGroups.find(search_request_id) ; + auto it = mSearchGroupsItems.find(search_request_id) ; - if(it == mSearchGroups.end()) + if(it == mSearchGroupsItems.end()) return ; ui->groupTreeWidget->removeSearchItem(it->second) ; - mSearchGroups.erase(it); + mSearchGroupsItems.erase(it); + + mKnownGroups.erase(search_request_id); } void GxsGroupFrameDialog::removeAllSearches() { - for(auto it(mSearchGroups.begin());it!=mSearchGroups.end();++it) + for(auto it(mSearchGroupsItems.begin());it!=mSearchGroupsItems.end();++it) ui->groupTreeWidget->removeSearchItem(it->second) ; - mSearchGroups.clear(); + mSearchGroupsItems.clear(); + mKnownGroups.clear(); } void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) { @@ -1158,6 +1193,6 @@ void GxsGroupFrameDialog::searchNetwork(const QString& search_string) if(request_id == 0) return ; - mSearchGroups[request_id] = ui->groupTreeWidget->addSearchItem(tr("Search for")+ " \"" + search_string + "\"",(uint32_t)request_id,QIcon(icon(ICON_SEARCH))); + mSearchGroupsItems[request_id] = ui->groupTreeWidget->addSearchItem(tr("Search for")+ " \"" + search_string + "\"",(uint32_t)request_id,QIcon(icon(ICON_SEARCH))); } diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index ac04edf59..bcfbabe78 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -210,7 +210,8 @@ private: std::list mCachedGroupMetas; - std::map mSearchGroups ; + std::map mSearchGroupsItems ; + std::map > mKnownGroups; }; #endif From a5d1a154a473b0cd1c1550fa31777412ba453ad9 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 25 Jun 2018 23:08:10 +0200 Subject: [PATCH 086/138] remove channel/posted/forum info when no group is selected --- .../src/gui/Posted/PostedListWidget.cpp | 4 +++ .../src/gui/Posted/PostedListWidget.h | 1 + .../src/gui/gxs/GxsMessageFramePostWidget.h | 1 + .../src/gui/gxs/GxsMessageFrameWidget.cpp | 31 +++++++++++-------- .../src/gui/gxs/GxsMessageFrameWidget.h | 1 + .../gui/gxschannels/GxsChannelPostsWidget.cpp | 14 +++++++++ .../gui/gxschannels/GxsChannelPostsWidget.h | 1 + .../gui/gxsforums/GxsForumThreadWidget.cpp | 22 +++++++++++++ .../src/gui/gxsforums/GxsForumThreadWidget.h | 1 + 9 files changed, 63 insertions(+), 13 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/PostedListWidget.cpp b/retroshare-gui/src/gui/Posted/PostedListWidget.cpp index d321933eb..f7e47863f 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidget.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListWidget.cpp @@ -454,6 +454,10 @@ void PostedListWidget::applyRanking() ui->scrollAreaWidgetContents->update(); } +void PostedListWidget::blank() +{ + clearPosts(); +} void PostedListWidget::clearPosts() { /* clear all messages */ diff --git a/retroshare-gui/src/gui/Posted/PostedListWidget.h b/retroshare-gui/src/gui/Posted/PostedListWidget.h index 89f95e995..b9102cabb 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidget.h +++ b/retroshare-gui/src/gui/Posted/PostedListWidget.h @@ -63,6 +63,7 @@ protected: virtual void insertAllPosts(const uint32_t &token, GxsMessageFramePostThread *thread); virtual void insertPosts(const uint32_t &token); virtual void clearPosts(); + virtual void blank(); virtual bool navigatePostItem(const RsGxsMessageId& msgId); /* GxsMessageFrameWidget */ diff --git a/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.h b/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.h index 2a42cb772..bebdae7cc 100644 --- a/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.h +++ b/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.h @@ -57,6 +57,7 @@ protected: virtual void groupNameChanged(const QString &/*name*/) {} virtual void clearPosts() = 0; + virtual void blank() = 0; virtual bool navigatePostItem(const RsGxsMessageId& msgId) = 0; /* Thread functions */ diff --git a/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.cpp b/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.cpp index e3b4f3cfe..18db60fa2 100644 --- a/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.cpp @@ -72,21 +72,26 @@ bool GxsMessageFrameWidget::isWaiting() void GxsMessageFrameWidget::setGroupId(const RsGxsGroupId &groupId) { - if (mGroupId == groupId) { - if (!groupId.isNull()) { - return; + if (mGroupId == groupId && !groupId.isNull()) + return; + + if(!groupId.isNull()) + { + mAcknowledgeReadStatusToken = 0; + if (mStateHelper->isLoading(mTokenTypeAcknowledgeReadStatus)) { + mStateHelper->setLoading(mTokenTypeAcknowledgeReadStatus, false); + + emit waitingChanged(this); } + + mGroupId = groupId; + groupIdChanged(); } - - mAcknowledgeReadStatusToken = 0; - if (mStateHelper->isLoading(mTokenTypeAcknowledgeReadStatus)) { - mStateHelper->setLoading(mTokenTypeAcknowledgeReadStatus, false); - - emit waitingChanged(this); - } - - mGroupId = groupId; - groupIdChanged(); + else + { + mGroupId.clear(); + blank(); // clear the displayed data, because no group is selected. + } } void GxsMessageFrameWidget::setAllMessagesRead(bool read) diff --git a/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.h b/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.h index 71d0ae2a1..a99aada3c 100644 --- a/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.h +++ b/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.h @@ -43,6 +43,7 @@ public: virtual void groupIdChanged() = 0; virtual QString groupName(bool withUnreadCount) = 0; virtual QIcon groupIcon() = 0; + virtual void blank() =0; virtual bool navigate(const RsGxsMessageId& msgId) = 0; virtual bool isLoading(); virtual bool isWaiting(); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp index b3f5662b4..379b20823 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp @@ -596,6 +596,20 @@ void GxsChannelPostsWidget::clearPosts() ui->fileWidget->clear(); } +void GxsChannelPostsWidget::blank() +{ + mStateHelper->setWidgetEnabled(ui->postButton, false); + mStateHelper->setWidgetEnabled(ui->subscribeToolButton, false); + + clearPosts(); + + groupNameChanged(QString()); + + ui->infoWidget->hide(); + ui->feedWidget->show(); + ui->fileWidget->hide(); +} + bool GxsChannelPostsWidget::navigatePostItem(const RsGxsMessageId &msgId) { FeedItem *feedItem = ui->feedWidget->findGxsFeedItem(groupId(), msgId); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.h b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.h index ddeb474a0..cfd442973 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.h @@ -73,6 +73,7 @@ protected: virtual bool useThread() { return mUseThread; } virtual void fillThreadCreatePost(const QVariant &post, bool related, int current, int count); virtual bool navigatePostItem(const RsGxsMessageId& msgId); + virtual void blank() ; /* GxsMessageFrameWidget */ virtual void setAllMessagesReadDo(bool read, uint32_t &token); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 7b9ff9183..a621872d4 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -299,6 +299,28 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget } +void GxsForumThreadWidget::blank() +{ + ui->progressBar->hide(); + ui->progressText->hide(); + ui->postText->clear() ; + ui->by_label->setId(RsGxsId()) ; + ui->time_label->clear(); + ui->lineRight->hide(); + ui->lineLeft->hide(); + ui->by_text_label->hide(); + ui->by_label->hide(); + ui->postText->setImageBlockWidget(ui->imageBlockWidget) ; + ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages()); + ui->threadTreeWidget->clear(); + ui->forumName->setText(""); + + mStateHelper->setWidgetEnabled(ui->newthreadButton, false); + mStateHelper->setWidgetEnabled(ui->previousButton, false); + mStateHelper->setWidgetEnabled(ui->nextButton, false); + ui->versions_CB->hide(); +} + GxsForumThreadWidget::~GxsForumThreadWidget() { if (mFillThread) { diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 71103507e..cbec31440 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -58,6 +58,7 @@ public: // Callback for all Loads. virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req); + virtual void blank(); protected: bool eventFilter(QObject *obj, QEvent *ev); From 00dfa0f3c2c2a4130f2a1c2458f54413aad24860 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 26 Jun 2018 22:20:02 +0200 Subject: [PATCH 087/138] added fallback for GXS GroupMessage UI to look into cached distant group data --- libretroshare/src/gxs/rsgxsnetservice.cc | 36 +++++++++++++++++-- libretroshare/src/gxs/rsgxsnetservice.h | 1 + libretroshare/src/gxs/rsgxsnettunnel.cc | 3 ++ libretroshare/src/gxs/rsnxs.h | 1 + libretroshare/src/retroshare/rsgxschannels.h | 1 + libretroshare/src/retroshare/rsgxsiface.h | 4 +++ .../src/retroshare/rsgxsifacetypes.h | 12 +++---- libretroshare/src/services/p3gxschannels.cc | 35 ++++++++++++++++++ libretroshare/src/services/p3gxschannels.h | 1 + .../gui/gxschannels/GxsChannelPostsWidget.cpp | 12 ++++++- 10 files changed, 96 insertions(+), 10 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 480e9dc2e..3c97cf95d 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -5130,6 +5130,20 @@ bool RsGxsNetService::retrieveDistantSearchResults(TurtleRequestId req,std::map< group_infos = it->second; return true ; } +bool RsGxsNetService::retrieveDistantGroupSummary(const RsGxsGroupId& group_id,RsGxsGroupSummary& gs) +{ + for(auto it(mDistantSearchResults.begin());it!=mDistantSearchResults.end();++it) + { + auto it2 = it->second.find(group_id) ; + + if(it2 != it->second.end()) + { + gs = it2->second; + return true ; + } + } + return false ; +} bool RsGxsNetService::clearDistantSearchResults(const TurtleRequestId& id) { RS_STACK_MUTEX(mNxsMutex) ; @@ -5139,7 +5153,6 @@ bool RsGxsNetService::clearDistantSearchResults(const TurtleRequestId& id) void RsGxsNetService::receiveTurtleSearchResults(TurtleRequestId req, const std::list& group_infos) { RS_STACK_MUTEX(mNxsMutex) ; -#warning We should use some central way to do that. This might be very costly if done often. RsGxsGrpMetaTemporaryMap grpMeta; std::map& search_results_map(mDistantSearchResults[req]) ; @@ -5159,7 +5172,22 @@ void RsGxsNetService::receiveTurtleSearchResults(TurtleRequestId req, const std: // if(grpMeta[(*it).group_id] == NULL) { filtered_results.push_back(*it) ; - search_results_map[(*it).group_id] = *it; + + auto it2 = search_results_map.find((*it).group_id) ; + + if(it2 != search_results_map.end()) + { + // update existing data + + it2->second.popularity++ ; + it2->second.number_of_messages = std::max(it2->second.number_of_messages,(*it).number_of_messages) ; + } + else + { + search_results_map[(*it).group_id] = *it; + search_results_map[(*it).group_id].popularity = 1; // number of results so far + } + mObserver->receiveDistantSearchResults(req,(*it).group_id) ; } } @@ -5184,10 +5212,12 @@ bool RsGxsNetService::search(const std::string& substring,std::listsecond->mGroupName ; s.group_description = it->second->mGroupName ; // to be filled with something better when we use the real search s.search_context = it->second->mGroupName ; - s.author_id = it->second->mAuthorId; + s.sign_flags = it->second->mSignFlags; s.publish_ts = it->second->mPublishTs; + s.author_id = it->second->mAuthorId; s.number_of_messages = stats.mMaxVisibleCount ; s.last_message_ts = stats.mLastGroupModificationTS ; + s.popularity = it->second->mPop; group_infos.push_back(s) ; } diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index 05031feb3..d6496e795 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -134,6 +134,7 @@ public: virtual void receiveTurtleSearchResults(TurtleRequestId req,const std::list& group_infos); virtual bool retrieveDistantSearchResults(TurtleRequestId req, std::map &group_infos); virtual bool clearDistantSearchResults(const TurtleRequestId& id); + virtual bool retrieveDistantGroupSummary(const RsGxsGroupId&,RsGxsGroupSummary&); /*! * pauses synchronisation of subscribed groups and request for group id diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index eabc32e3a..cce855165 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -203,8 +203,11 @@ void RsTypeSerializer::serial_process( RsGenericSerializer::SerializeJob j, RsGe RsTypeSerializer::serial_process(j,ctx,gs.publish_ts ,member_name+"-publish_ts") ; // time_t publish_ts ; RsTypeSerializer::serial_process(j,ctx,gs.number_of_messages,member_name+"-number_of_messages") ; // uint32_t number_of_messages ; RsTypeSerializer::serial_process(j,ctx,gs.last_message_ts,member_name+"-last_message_ts") ; // time_t last_message_ts ; + RsTypeSerializer::serial_process(j,ctx,gs.sign_flags,member_name+"-sign_flags") ; // uint32_t sign_flags ; + RsTypeSerializer::serial_process(j,ctx,gs.popularity,member_name+"-popularity") ; // uint32_t popularity ; } + //===========================================================================================================================================// // Interface with rest of the software // //===========================================================================================================================================// diff --git a/libretroshare/src/gxs/rsnxs.h b/libretroshare/src/gxs/rsnxs.h index b483e5748..046b2e80f 100644 --- a/libretroshare/src/gxs/rsnxs.h +++ b/libretroshare/src/gxs/rsnxs.h @@ -130,6 +130,7 @@ public: * \return */ virtual bool clearDistantSearchResults(const TurtleRequestId& id)=0; + virtual bool retrieveDistantGroupSummary(const RsGxsGroupId&,RsGxsGroupSummary&)=0; virtual bool search(const std::string& substring,std::list& group_infos) =0; diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index af08f4bb4..a23275b3b 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -99,6 +99,7 @@ virtual bool getPostData(const uint32_t &token, std::vector &p virtual TurtleRequestId turtleSearchRequest(const std::string& match_string)=0; virtual bool retrieveDistantSearchResults(TurtleRequestId req, std::map &results) =0; virtual bool clearDistantSearchResults(TurtleRequestId req)=0; + virtual bool retrieveDistantGroup(const RsGxsGroupId& group_id,RsGxsChannelGroup& distant_group)=0; ////////////////////////////////////////////////////////////////////////////// virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0; diff --git a/libretroshare/src/retroshare/rsgxsiface.h b/libretroshare/src/retroshare/rsgxsiface.h index e822d70d4..bdf65c115 100644 --- a/libretroshare/src/retroshare/rsgxsiface.h +++ b/libretroshare/src/retroshare/rsgxsiface.h @@ -40,6 +40,8 @@ */ struct RsGxsGroupSummary { + RsGxsGroupSummary() : publish_ts(0), number_of_messages(0),last_message_ts(0),sign_flags(0),popularity(0) {} + RsGxsGroupId group_id ; std::string group_name ; @@ -49,6 +51,8 @@ struct RsGxsGroupSummary time_t publish_ts ; uint32_t number_of_messages ; time_t last_message_ts ; + uint32_t sign_flags ; + uint32_t popularity ; }; diff --git a/libretroshare/src/retroshare/rsgxsifacetypes.h b/libretroshare/src/retroshare/rsgxsifacetypes.h index 071b6bd46..0b0bb3322 100644 --- a/libretroshare/src/retroshare/rsgxsifacetypes.h +++ b/libretroshare/src/retroshare/rsgxsifacetypes.h @@ -69,18 +69,18 @@ struct RsGroupMetaData : RsSerializable RsGxsGroupId mGroupId; std::string mGroupName; - uint32_t mGroupFlags; // Combination of FLAG_PRIVACY_PRIVATE | FLAG_PRIVACY_RESTRICTED | FLAG_PRIVACY_PUBLIC - uint32_t mSignFlags; // Combination of RSGXS_GROUP_SIGN_PUBLISH_MASK & RSGXS_GROUP_SIGN_AUTHOR_MASK. + uint32_t mGroupFlags; // Combination of FLAG_PRIVACY_PRIVATE | FLAG_PRIVACY_RESTRICTED | FLAG_PRIVACY_PUBLIC: diffusion + uint32_t mSignFlags; // Combination of RSGXS_GROUP_SIGN_PUBLISH_MASK & RSGXS_GROUP_SIGN_AUTHOR_MASK, i.e. what signatures are required for parent and child msgs time_t mPublishTs; // Mandatory. - RsGxsId mAuthorId; // Optional. + RsGxsId mAuthorId; // Author of the group. Left to "000....0" if anonymous // for circles - RsGxsCircleId mCircleId; - uint32_t mCircleType; + RsGxsCircleId mCircleId; // Id of the circle to which the group is restricted + uint32_t mCircleType; // combination of CIRCLE_TYPE_{ PUBLIC,EXTERNAL,YOUR_FRIENDS_ONLY,LOCAL,EXT_SELF,YOUR_EYES_ONLY } // other stuff. - uint32_t mAuthenFlags; + uint32_t mAuthenFlags; // Actually not used yet. RsGxsGroupId mParentGrpId; // BELOW HERE IS LOCAL DATA, THAT IS NOT FROM MSG. diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index e4f89861e..ee4c89f2f 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -1705,4 +1705,39 @@ bool p3GxsChannels::retrieveDistantSearchResults(TurtleRequestId req,std::mapretrieveDistantSearchResults(req,results); } +bool p3GxsChannels::retrieveDistantGroup(const RsGxsGroupId& group_id,RsGxsChannelGroup& distant_group) +{ + RsGxsGroupSummary gs ; + + if(netService()->retrieveDistantGroupSummary(group_id,gs)) + { + // This is a placeholder information by the time we receive the full group meta data. + + distant_group.mDescription = gs.group_description; + + distant_group.mMeta.mGroupId = gs.group_id ; + distant_group.mMeta.mGroupName = gs.group_name; + distant_group.mMeta.mGroupFlags = GXS_SERV::FLAG_PRIVACY_PUBLIC ; + distant_group.mMeta.mSignFlags = gs.sign_flags; + + distant_group.mMeta.mPublishTs = gs.publish_ts; + distant_group.mMeta.mAuthorId = gs.author_id; + + distant_group.mMeta.mCircleType = GXS_CIRCLE_TYPE_PUBLIC ;// guessed, otherwise the group would not be search-able. + + // other stuff. + distant_group.mMeta.mAuthenFlags = 0; // wild guess... + + distant_group.mMeta.mSubscribeFlags = GXS_SERV::GROUP_SUBSCRIBE_NOT_SUBSCRIBED ; + + distant_group.mMeta.mPop = gs.popularity; // Popularity = number of friend subscribers + distant_group.mMeta.mVisibleMsgCount = gs.number_of_messages; // Max messages reported by friends + distant_group.mMeta.mLastPost = gs.last_message_ts; // Timestamp for last message. Not used yet. + + return true ; + } + else + return false ; +} + diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index 2243e57ee..7a5e19423 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -76,6 +76,7 @@ virtual void service_tick(); virtual TurtleRequestId turtleSearchRequest(const std::string& match_string); virtual bool retrieveDistantSearchResults(TurtleRequestId req, std::map &results) ; virtual bool clearDistantSearchResults(TurtleRequestId req); + virtual bool retrieveDistantGroup(const RsGxsGroupId& group_id,RsGxsChannelGroup& distant_group); // Overloaded to cache new groups. virtual RsGenExchange::ServiceCreate_Return service_CreateGroup(RsGxsGrpItem* grpItem, RsTlvSecurityKeySet& keySet); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp index 379b20823..d238c7007 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp @@ -657,12 +657,22 @@ bool GxsChannelPostsWidget::insertGroupData(const uint32_t &token, RsGroupMetaDa std::vector groups; rsGxsChannels->getGroupData(token, groups); - if (groups.size() == 1) + if(groups.size() == 1) { insertChannelDetails(groups[0]); metaData = groups[0].mMeta; return true; } + else + { + RsGxsChannelGroup distant_group; + if(rsGxsChannels->retrieveDistantGroup(groupId(),distant_group)) + { + insertChannelDetails(distant_group); + metaData = distant_group.mMeta; + return true ; + } + } return false; } From a6edf47e00cbb13c50cf25db7c3797900f52d963 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 26 Jun 2018 22:25:06 +0200 Subject: [PATCH 088/138] removed debug/experimental channel search from files tab --- retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp | 9 --------- retroshare-gui/src/gui/FileTransfer/SearchDialog.ui | 9 +-------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp index 6e2bc4223..be61a1dcc 100644 --- a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp @@ -38,7 +38,6 @@ #include "gui/common/RSTreeWidgetItem.h" #include "util/QtVersion.h" -#include "retroshare/rsgxschannels.h" #include #include #include @@ -204,7 +203,6 @@ SearchDialog::SearchDialog(QWidget *parent) // load settings processSettings(true); - ui._channels_CB->setMinimumWidth(20 * f); ui._ownFiles_CB->setMinimumWidth(20*f); ui._friendListsearch_SB->setMinimumWidth(20*f); ui._anonF2Fsearch_CB->setMinimumWidth(20*f); @@ -866,13 +864,6 @@ void SearchDialog::searchKeywords(const QString& keywords) else req_id = rsFiles->turtleSearch(lin_exp) ; } - else if(ui._channels_CB->isChecked()) - { - if(n==1) - req_id = rsGxsChannels->turtleSearchRequest(words.front()) ; - else - QMessageBox::critical(this,"Cannot search multiple words yet.","Search for multiple words is not implemented yet.") ; - } else req_id = RSRandom::random_u32() ; // generate a random 32 bits request id diff --git a/retroshare-gui/src/gui/FileTransfer/SearchDialog.ui b/retroshare-gui/src/gui/FileTransfer/SearchDialog.ui index e6f6ded74..b3df60f05 100644 --- a/retroshare-gui/src/gui/FileTransfer/SearchDialog.ui +++ b/retroshare-gui/src/gui/FileTransfer/SearchDialog.ui @@ -117,13 +117,6 @@ - - - - Channels - - - @@ -448,7 +441,7 @@ LineEditClear QLineEdit -
gui/common/LineEditClear.h
+
gui/common/LineEditClear.h
SearchTreeWidget From db06c32e806a8c29f3a571e0f9c125a68172a897 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 28 Jun 2018 10:01:57 +0200 Subject: [PATCH 089/138] turned turtle encryption routine into a generic authenticated encryption method in librs::crypto --- libretroshare/src/crypto/rscrypto.cpp | 212 ++++++++++++++++++++++++++ libretroshare/src/crypto/rscrypto.h | 59 +++++++ libretroshare/src/libretroshare.pro | 6 +- libretroshare/src/turtle/p3turtle.cc | 175 ++------------------- 4 files changed, 287 insertions(+), 165 deletions(-) create mode 100644 libretroshare/src/crypto/rscrypto.cpp create mode 100644 libretroshare/src/crypto/rscrypto.h diff --git a/libretroshare/src/crypto/rscrypto.cpp b/libretroshare/src/crypto/rscrypto.cpp new file mode 100644 index 000000000..0a296673e --- /dev/null +++ b/libretroshare/src/crypto/rscrypto.cpp @@ -0,0 +1,212 @@ +/******************************************************************************* + * libretroshare/src/crypto: crypto.cc * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ + +#include +#include +#include + +#include "rscrypto.h" +#include "util/rsrandom.h" + +//#define CRYPTO_DEBUG 1 + +namespace librs { +namespace crypto { + +#define RSCRYPTO_DEBUG() std::cerr << time(NULL) << " : RSCRYPTO : " << __FUNCTION__ << " : " +#define RSCRYPTO_ERROR() std::cerr << "(EE) RSCRYPTO ERROR : " + +static const uint32_t ENCRYPTED_MEMORY_INITIALIZATION_VECTOR_SIZE = 12 ; +static const uint32_t ENCRYPTED_MEMORY_AUTHENTICATION_TAG_SIZE = 16 ; +static const uint32_t ENCRYPTED_MEMORY_HEADER_SIZE = 4 ; +static const uint32_t ENCRYPTED_MEMORY_EDATA_SIZE = 4 ; + +static const uint8_t ENCRYPTED_MEMORY_FORMAT_AEAD_CHACHA20_POLY1305 = 0x01 ; +static const uint8_t ENCRYPTED_MEMORY_FORMAT_AEAD_CHACHA20_SHA256 = 0x02 ; + +bool encryptAuthenticateData(const unsigned char *clear_data,uint32_t clear_data_size,uint8_t *encryption_master_key,unsigned char *& encrypted_data,uint32_t& encrypted_data_len) +{ + uint8_t initialization_vector[ENCRYPTED_MEMORY_INITIALIZATION_VECTOR_SIZE] ; + + RSRandom::random_bytes(initialization_vector,ENCRYPTED_MEMORY_INITIALIZATION_VECTOR_SIZE) ; + +#ifdef CRYPTO_DEBUG + RSCRYPTO_DEBUG() << "ftServer::Encrypting ft item." << std::endl; + RSCRYPTO_DEBUG() << " random nonce : " << RsUtil::BinToHex(initialization_vector,ENCRYPTED_MEMORY_INITIALIZATION_VECTOR_SIZE) << std::endl; +#endif + + uint32_t item_serialized_size = clear_data_size;//RsGenericSerializer().size(clear_item) ; + uint32_t total_data_size = ENCRYPTED_MEMORY_HEADER_SIZE + ENCRYPTED_MEMORY_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_MEMORY_EDATA_SIZE + item_serialized_size + ENCRYPTED_MEMORY_AUTHENTICATION_TAG_SIZE ; + +#ifdef CRYPTO_DEBUG + RSCRYPTO_DEBUG() << " clear part size : " << size(clear_item) << std::endl; + RSCRYPTO_DEBUG() << " total item size : " << total_data_size << std::endl; +#endif + + encrypted_data = (unsigned char*)rs_malloc( total_data_size ) ; + encrypted_data_len = total_data_size ; + + if(encrypted_data == NULL) + return false ; + + uint8_t *edata = (uint8_t*)encrypted_data; + uint32_t edata_size = item_serialized_size; + uint32_t offset = 0; + + edata[0] = 0xae ; + edata[1] = 0xad ; + edata[2] = ENCRYPTED_MEMORY_FORMAT_AEAD_CHACHA20_SHA256 ; // means AEAD_chacha20_sha256 + edata[3] = 0x01 ; + + offset += ENCRYPTED_MEMORY_HEADER_SIZE; + uint32_t aad_offset = offset ; + uint32_t aad_size = ENCRYPTED_MEMORY_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_MEMORY_EDATA_SIZE ; + + memcpy(&edata[offset], initialization_vector, ENCRYPTED_MEMORY_INITIALIZATION_VECTOR_SIZE) ; + offset += ENCRYPTED_MEMORY_INITIALIZATION_VECTOR_SIZE ; + + edata[offset+0] = (edata_size >> 0) & 0xff ; + edata[offset+1] = (edata_size >> 8) & 0xff ; + edata[offset+2] = (edata_size >> 16) & 0xff ; + edata[offset+3] = (edata_size >> 24) & 0xff ; + + offset += ENCRYPTED_MEMORY_EDATA_SIZE ; + + memcpy(&edata[offset],clear_data,clear_data_size); + +#ifdef CRYPTO_DEBUG + RSCRYPTO_DEBUG() << " clear item : " << RsUtil::BinToHex(&edata[offset],std::min(50,(int)total_data_size-(int)offset)) << "(...)" << std::endl; +#endif + + uint32_t clear_item_offset = offset ; + offset += edata_size ; + + uint32_t authentication_tag_offset = offset ; + assert(ENCRYPTED_MEMORY_AUTHENTICATION_TAG_SIZE + offset == total_data_size) ; + + //uint8_t encryption_key[32] ; + //deriveEncryptionKey(hash,encryption_key) ; + + if(edata[2] == ENCRYPTED_MEMORY_FORMAT_AEAD_CHACHA20_POLY1305) + librs::crypto::AEAD_chacha20_poly1305(encryption_master_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],true) ; + else if(edata[2] == ENCRYPTED_MEMORY_FORMAT_AEAD_CHACHA20_SHA256) + librs::crypto::AEAD_chacha20_sha256 (encryption_master_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],true) ; + else + return false ; + +#ifdef CRYPTO_DEBUG + RSCRYPTO_DEBUG() << " encryption key : " << RsUtil::BinToHex(encryption_key,32) << std::endl; + RSCRYPTO_DEBUG() << " authen. tag : " << RsUtil::BinToHex(&edata[authentication_tag_offset],ENCRYPTED_MEMORY_AUTHENTICATION_TAG_SIZE) << std::endl; + RSCRYPTO_DEBUG() << " final item : " << RsUtil::BinToHex(&edata[0],std::min(50u,total_data_size)) << "(...)" << std::endl; +#endif + + return true ; +} + +// Decrypts the given item using aead-chacha20-poly1305 +bool decryptAuthenticateData(const unsigned char *encrypted_data,uint32_t encrypted_data_len,uint8_t *encryption_master_key, unsigned char *& decrypted_data, uint32_t& decrypted_data_size) +{ + //uint8_t encryption_key[32] ; + //deriveEncryptionKey(hash,encryption_key) ; + + uint8_t *edata = (uint8_t*)encrypted_data; + uint32_t offset = 0; + + if(encrypted_data_len < ENCRYPTED_MEMORY_HEADER_SIZE + ENCRYPTED_MEMORY_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_MEMORY_EDATA_SIZE) return false ; + + if(edata[0] != 0xae) return false ; + if(edata[1] != 0xad) return false ; + if(edata[2] != ENCRYPTED_MEMORY_FORMAT_AEAD_CHACHA20_POLY1305 && edata[2] != ENCRYPTED_MEMORY_FORMAT_AEAD_CHACHA20_SHA256) return false ; + if(edata[3] != 0x01) return false ; + + offset += ENCRYPTED_MEMORY_HEADER_SIZE ; + uint32_t aad_offset = offset ; + uint32_t aad_size = ENCRYPTED_MEMORY_EDATA_SIZE + ENCRYPTED_MEMORY_INITIALIZATION_VECTOR_SIZE ; + + uint8_t *initialization_vector = &edata[offset] ; + +#ifdef CRYPTO_DEBUG + RSCRYPTO_DEBUG() << "ftServer::decrypting ft item." << std::endl; + RSCRYPTO_DEBUG() << " item data : " << RsUtil::BinToHex(edata,std::min(50u,encrypted_data_len) << "(...)" << std::endl; + RSCRYPTO_DEBUG() << " hash : " << hash << std::endl; + RSCRYPTO_DEBUG() << " encryption key : " << RsUtil::BinToHex(encryption_key,32) << std::endl; + RSCRYPTO_DEBUG() << " random nonce : " << RsUtil::BinToHex(initialization_vector,ENCRYPTED_MEMORY_INITIALIZATION_VECTOR_SIZE) << std::endl; +#endif + + offset += ENCRYPTED_MEMORY_INITIALIZATION_VECTOR_SIZE ; + + uint32_t edata_size = 0 ; + edata_size += ((uint32_t)edata[offset+0]) << 0 ; + edata_size += ((uint32_t)edata[offset+1]) << 8 ; + edata_size += ((uint32_t)edata[offset+2]) << 16 ; + edata_size += ((uint32_t)edata[offset+3]) << 24 ; + + if(edata_size + ENCRYPTED_MEMORY_EDATA_SIZE + ENCRYPTED_MEMORY_AUTHENTICATION_TAG_SIZE + ENCRYPTED_MEMORY_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_MEMORY_HEADER_SIZE != encrypted_data_len) + { + RSCRYPTO_ERROR() << " ERROR: encrypted data size is " << edata_size << ", should be " << encrypted_data_len - (ENCRYPTED_MEMORY_EDATA_SIZE + ENCRYPTED_MEMORY_AUTHENTICATION_TAG_SIZE + ENCRYPTED_MEMORY_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_MEMORY_HEADER_SIZE ) << std::endl; + return false ; + } + + offset += ENCRYPTED_MEMORY_EDATA_SIZE ; + uint32_t clear_item_offset = offset ; + + uint32_t authentication_tag_offset = offset + edata_size ; +#ifdef CRYPTO_DEBUG + RSCRYPTO_DEBUG() << " authen. tag : " << RsUtil::BinToHex(&edata[authentication_tag_offset],ENCRYPTED_MEMORY_AUTHENTICATION_TAG_SIZE) << std::endl; +#endif + + bool result ; + + if(edata[2] == ENCRYPTED_MEMORY_FORMAT_AEAD_CHACHA20_POLY1305) + result = librs::crypto::AEAD_chacha20_poly1305(encryption_master_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],false) ; + else if(edata[2] == ENCRYPTED_MEMORY_FORMAT_AEAD_CHACHA20_SHA256) + result = librs::crypto::AEAD_chacha20_sha256 (encryption_master_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],false) ; + else + return false ; + +#ifdef CRYPTO_DEBUG + RSCRYPTO_DEBUG() << " authen. result : " << result << std::endl; + RSCRYPTO_DEBUG() << " decrypted daya : " << RsUtil::BinToHex(&edata[clear_item_offset],std::min(50u,edata_size)) << "(...)" << std::endl; +#endif + + if(!result) + { + RSCRYPTO_ERROR() << "(EE) decryption/authentication went wrong." << std::endl; + return false ; + } + + decrypted_data_size = edata_size ; + decrypted_data = (unsigned char*)rs_malloc(edata_size) ; + + if(decrypted_data == NULL) + { + std::cerr << "Failed to allocate memory for decrypted data chunk of size " << edata_size << std::endl; + return false ; + } + memcpy(decrypted_data,&edata[clear_item_offset],edata_size) ; + + return true ; +} + +} +} + diff --git a/libretroshare/src/crypto/rscrypto.h b/libretroshare/src/crypto/rscrypto.h new file mode 100644 index 000000000..9666aed28 --- /dev/null +++ b/libretroshare/src/crypto/rscrypto.h @@ -0,0 +1,59 @@ + +/******************************************************************************* + * libretroshare/src/crypto: crypto.h * + * * + * libretroshare: retroshare core library * + * * + * Copyright 2018 by Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ + +#include "crypto/chacha20.h" + +namespace librs +{ +namespace crypto +{ +/*! + * \brief encryptAuthenticateData + Encrypts/decrypts data, using a autenticated construction + chacha20, based on a given 32 bytes master key. The actual encryption using a randomized key + based on a 96 bits IV. Input values are not touched (memory is not released). Memory ownership of outputs is left to the client. + * \param clear_data input data to encrypt + * \param clear_data_size length of input data + * \param encryption_master_key encryption master key of length 32 bytes. + * \param encrypted_data encrypted data, allocated using malloc + * \param encrypted_data_len length of encrypted data + * \return + * true if everything went well. + */ +bool encryptAuthenticateData(const unsigned char *clear_data,uint32_t clear_data_size,uint8_t *encryption_master_key,unsigned char *& encrypted_data,uint32_t& encrypted_data_size); + +/*! + * \brief decryptAuthenticateData + Encrypts/decrypts data, using a autenticated construction + chacha20, based on a given 32 bytes master key. The actual encryption using a randomized key + based on a 96 bits IV. Input values are not touched (memory is not released). Memory ownership of outputs is left to the client. + * \param encrypted_data input encrypted data + * \param encrypted_data_size input encrypted data length + * \param encryption_master_key encryption master key of length 32 bytes. + * \param decrypted_data decrypted data, allocated using malloc. + * \param decrypted_data_size length of allocated decrypted data. + * \return + * true if decryption + authentication are ok. + */ +bool decryptAuthenticateData(const unsigned char *encrypted_data,uint32_t encrypted_data_size, uint8_t* encryption_master_key, unsigned char *& decrypted_data,uint32_t& decrypted_data_size); +} +} + diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index e34410ed2..ca85b7d83 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -356,7 +356,8 @@ HEADERS += ft/ftchunkmap.h \ ft/ftturtlefiletransferitem.h HEADERS += crypto/chacha20.h \ - crypto/hashstream.h + crypto/hashstream.h \ + crypto/rscrypto.h HEADERS += directory_updater.h \ directory_list.h \ @@ -523,7 +524,8 @@ SOURCES += ft/ftchunkmap.cc \ ft/ftturtlefiletransferitem.cc SOURCES += crypto/chacha20.cpp \ - crypto/hashstream.cc + crypto/hashstream.cc \ + crypto/rscrypto.cpp SOURCES += chat/distantchat.cc \ chat/p3chatservice.cc \ diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 898491cf2..31286de8f 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -34,7 +34,7 @@ #endif #include "rsserver/p3face.h" -#include "crypto/chacha20.h" +#include "crypto/rscrypto.h" #include "pqi/authssl.h" #include "pqi/p3linkmgr.h" @@ -2235,177 +2235,26 @@ std::string p3turtle::getPeerNameForVirtualPeerId(const RsPeerId& virtual_peer_i return name; } -static const uint32_t ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE = 12 ; -static const uint32_t ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE = 16 ; -static const uint32_t ENCRYPTED_TURTLE_HEADER_SIZE = 4 ; -static const uint32_t ENCRYPTED_TURTLE_EDATA_SIZE = 4 ; - -static const uint8_t ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_POLY1305 = 0x01 ; -static const uint8_t ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_SHA256 = 0x02 ; - bool p3turtle::encryptData(const unsigned char *clear_data,uint32_t clear_data_size,uint8_t *encryption_master_key,RsTurtleGenericDataItem *& encrypted_item) { - uint8_t initialization_vector[ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE] ; - - RSRandom::random_bytes(initialization_vector,ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE) ; - -#ifdef SERVER_DEBUG - TURTLE_DEBUG() << "ftServer::Encrypting ft item." << std::endl; - TURTLE_DEBUG() << " random nonce : " << RsUtil::BinToHex(initialization_vector,ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE) << std::endl; -#endif - - uint32_t item_serialized_size = clear_data_size;//RsGenericSerializer().size(clear_item) ; - uint32_t total_data_size = ENCRYPTED_TURTLE_HEADER_SIZE + ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_TURTLE_EDATA_SIZE + item_serialized_size + ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE ; - -#ifdef SERVER_DEBUG - TURTLE_DEBUG() << " clear part size : " << size(clear_item) << std::endl; - TURTLE_DEBUG() << " total item size : " << total_data_size << std::endl; -#endif + unsigned char *encrypted_data = NULL ; + uint32_t encrypted_data_len = 0 ; + if(!librs::crypto::encryptAuthenticateData(clear_data,clear_data_size,encryption_master_key,encrypted_data,encrypted_data_len)) + { + delete encrypted_item ; + return false ; + } encrypted_item = new RsTurtleGenericDataItem ; - encrypted_item->data_bytes = rs_malloc( total_data_size ) ; - encrypted_item->data_size = total_data_size ; - if(encrypted_item->data_bytes == NULL) - return false ; - - uint8_t *edata = (uint8_t*)encrypted_item->data_bytes ; - uint32_t edata_size = item_serialized_size; - uint32_t offset = 0; - - edata[0] = 0xae ; - edata[1] = 0xad ; - edata[2] = ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_SHA256 ; // means AEAD_chacha20_sha256 - edata[3] = 0x01 ; - - offset += ENCRYPTED_TURTLE_HEADER_SIZE; - uint32_t aad_offset = offset ; - uint32_t aad_size = ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_TURTLE_EDATA_SIZE ; - - memcpy(&edata[offset], initialization_vector, ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE) ; - offset += ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE ; - - edata[offset+0] = (edata_size >> 0) & 0xff ; - edata[offset+1] = (edata_size >> 8) & 0xff ; - edata[offset+2] = (edata_size >> 16) & 0xff ; - edata[offset+3] = (edata_size >> 24) & 0xff ; - - offset += ENCRYPTED_TURTLE_EDATA_SIZE ; - - memcpy(&edata[offset],clear_data,clear_data_size); - -#ifdef SERVER_DEBUG - TURTLE_DEBUG() << " clear item : " << RsUtil::BinToHex(&edata[offset],std::min(50,(int)total_data_size-(int)offset)) << "(...)" << std::endl; -#endif - - uint32_t clear_item_offset = offset ; - offset += edata_size ; - - uint32_t authentication_tag_offset = offset ; - assert(ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE + offset == total_data_size) ; - - //uint8_t encryption_key[32] ; - //deriveEncryptionKey(hash,encryption_key) ; - - if(edata[2] == ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_POLY1305) - librs::crypto::AEAD_chacha20_poly1305(encryption_master_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],true) ; - else if(edata[2] == ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_SHA256) - librs::crypto::AEAD_chacha20_sha256 (encryption_master_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],true) ; - else - return false ; - -#ifdef SERVER_DEBUG - TURTLE_DEBUG() << " encryption key : " << RsUtil::BinToHex(encryption_key,32) << std::endl; - TURTLE_DEBUG() << " authen. tag : " << RsUtil::BinToHex(&edata[authentication_tag_offset],ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE) << std::endl; - TURTLE_DEBUG() << " final item : " << RsUtil::BinToHex(&edata[0],std::min(50u,total_data_size)) << "(...)" << std::endl; -#endif - - return true ; + encrypted_item->data_bytes = encrypted_data ; + encrypted_item->data_size = encrypted_data_len ; + return true; } -// Decrypts the given item using aead-chacha20-poly1305 bool p3turtle::decryptItem(const RsTurtleGenericDataItem* encrypted_item, uint8_t *encryption_master_key, unsigned char *& decrypted_data, uint32_t& decrypted_data_size) { - //uint8_t encryption_key[32] ; - //deriveEncryptionKey(hash,encryption_key) ; - - uint8_t *edata = (uint8_t*)encrypted_item->data_bytes ; - uint32_t offset = 0; - - if(encrypted_item->data_size < ENCRYPTED_TURTLE_HEADER_SIZE + ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_TURTLE_EDATA_SIZE) return false ; - - if(edata[0] != 0xae) return false ; - if(edata[1] != 0xad) return false ; - if(edata[2] != ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_POLY1305 && edata[2] != ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_SHA256) return false ; - if(edata[3] != 0x01) return false ; - - offset += ENCRYPTED_TURTLE_HEADER_SIZE ; - uint32_t aad_offset = offset ; - uint32_t aad_size = ENCRYPTED_TURTLE_EDATA_SIZE + ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE ; - - uint8_t *initialization_vector = &edata[offset] ; - -#ifdef SERVER_DEBUG - TURTLE_DEBUG() << "ftServer::decrypting ft item." << std::endl; - TURTLE_DEBUG() << " item data : " << RsUtil::BinToHex(edata,std::min(50u,encrypted_item->data_size)) << "(...)" << std::endl; - TURTLE_DEBUG() << " hash : " << hash << std::endl; - TURTLE_DEBUG() << " encryption key : " << RsUtil::BinToHex(encryption_key,32) << std::endl; - TURTLE_DEBUG() << " random nonce : " << RsUtil::BinToHex(initialization_vector,ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE) << std::endl; -#endif - - offset += ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE ; - - uint32_t edata_size = 0 ; - edata_size += ((uint32_t)edata[offset+0]) << 0 ; - edata_size += ((uint32_t)edata[offset+1]) << 8 ; - edata_size += ((uint32_t)edata[offset+2]) << 16 ; - edata_size += ((uint32_t)edata[offset+3]) << 24 ; - - if(edata_size + ENCRYPTED_TURTLE_EDATA_SIZE + ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE + ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_TURTLE_HEADER_SIZE != encrypted_item->data_size) - { - TURTLE_ERROR() << " ERROR: encrypted data size is " << edata_size << ", should be " << encrypted_item->data_size - (ENCRYPTED_TURTLE_EDATA_SIZE + ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE + ENCRYPTED_TURTLE_INITIALIZATION_VECTOR_SIZE + ENCRYPTED_TURTLE_HEADER_SIZE ) << std::endl; - return false ; - } - - offset += ENCRYPTED_TURTLE_EDATA_SIZE ; - uint32_t clear_item_offset = offset ; - - uint32_t authentication_tag_offset = offset + edata_size ; -#ifdef SERVER_DEBUG - TURTLE_DEBUG() << " authen. tag : " << RsUtil::BinToHex(&edata[authentication_tag_offset],ENCRYPTED_TURTLE_AUTHENTICATION_TAG_SIZE) << std::endl; -#endif - - bool result ; - - if(edata[2] == ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_POLY1305) - result = librs::crypto::AEAD_chacha20_poly1305(encryption_master_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],false) ; - else if(edata[2] == ENCRYPTED_TURTLE_FORMAT_AEAD_CHACHA20_SHA256) - result = librs::crypto::AEAD_chacha20_sha256 (encryption_master_key,initialization_vector,&edata[clear_item_offset],edata_size, &edata[aad_offset],aad_size, &edata[authentication_tag_offset],false) ; - else - return false ; - -#ifdef SERVER_DEBUG - TURTLE_DEBUG() << " authen. result : " << result << std::endl; - TURTLE_DEBUG() << " decrypted daya : " << RsUtil::BinToHex(&edata[clear_item_offset],std::min(50u,edata_size)) << "(...)" << std::endl; -#endif - - if(!result) - { - TURTLE_ERROR() << "(EE) decryption/authentication went wrong." << std::endl; - return false ; - } - - decrypted_data_size = edata_size ; - decrypted_data = (unsigned char*)rs_malloc(edata_size) ; - - if(decrypted_data == NULL) - { - std::cerr << "Failed to allocate memory for decrypted data chunk of size " << edata_size << std::endl; - return false ; - } - memcpy(decrypted_data,&edata[clear_item_offset],edata_size) ; - - return true ; + return librs::crypto::decryptAuthenticateData((unsigned char*)encrypted_item->data_bytes,encrypted_item->data_size,encryption_master_key,decrypted_data,decrypted_data_size); } void p3turtle::getInfo( std::vector >& hashes_info, From 80a43fe3d59163b7f93092a5589bf1ca4f5897b0 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 30 Jun 2018 21:52:25 +0200 Subject: [PATCH 090/138] added secure retrieval of distant groups --- libretroshare/src/gxs/rsgxsdataaccess.cc | 17 +++ libretroshare/src/gxs/rsgxsdataaccess.h | 8 ++ libretroshare/src/gxs/rsgxsnetservice.cc | 134 ++++++++++++++++++++++- libretroshare/src/gxs/rsgxsnetservice.h | 7 ++ libretroshare/src/gxs/rsgxsnettunnel.cc | 38 +++++-- libretroshare/src/gxs/rsnxs.h | 4 + 6 files changed, 199 insertions(+), 9 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsdataaccess.cc b/libretroshare/src/gxs/rsgxsdataaccess.cc index 77c0d05d9..2ba317920 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.cc +++ b/libretroshare/src/gxs/rsgxsdataaccess.cc @@ -1807,6 +1807,23 @@ bool RsGxsDataAccess::updateGroupData(RsNxsGrp* grp) { return mDataStore->updateGroup(grpM); } +bool RsGxsDataAccess::getGroupData(const RsGxsGroupId& grpId, RsNxsGrp *& grp_data) +{ + RsStackMutex stack(mDataMutex); + + std::map grps ; + + grps[grpId] = NULL ; + + if(mDataStore->retrieveNxsGrps(grps, false, true)) // the false here is very important: it removes the private key parts. + { + grp_data = grps.begin()->second; + return true; + } + else + return false ; +} + bool RsGxsDataAccess::addMsgData(RsNxsMsg* msg) { RsStackMutex stack(mDataMutex); diff --git a/libretroshare/src/gxs/rsgxsdataaccess.h b/libretroshare/src/gxs/rsgxsdataaccess.h index 77f94137e..da5da3ca6 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.h +++ b/libretroshare/src/gxs/rsgxsdataaccess.h @@ -156,6 +156,14 @@ public: */ bool addMsgData(RsNxsMsg* msg); + /*! + * This retrieves a group from the gxs data base, this is a blocking call \n + * @param grp the group to add, memory ownership passed to the callee + * @return false if group cound not be retrieved + */ + bool getGroupData(const RsGxsGroupId& grpId,RsNxsGrp *& grp_data); + + public: diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 3c97cf95d..13d2341be 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -254,6 +254,7 @@ #include "retroshare/rsgxscircles.h" #include "retroshare/rspeers.h" #include "pgp/pgpauxutils.h" +#include "crypto/rscrypto.h" #include "util/rsdir.h" #include "util/rstime.h" #include "util/rsmemory.h" @@ -5105,7 +5106,10 @@ bool RsGxsNetService::locked_stampMsgServerUpdateTS(const RsGxsGroupId& gid) TurtleRequestId RsGxsNetService::turtleGroupRequest(const RsGxsGroupId& group_id) { - return mGxsNetTunnel->turtleGroupRequest(group_id,this) ; + TurtleRequestId req = mGxsNetTunnel->turtleGroupRequest(group_id,this) ; + mSearchRequests[req] = group_id; + + return req; } TurtleRequestId RsGxsNetService::turtleSearchRequest(const std::string& match_string) { @@ -5192,6 +5196,58 @@ void RsGxsNetService::receiveTurtleSearchResults(TurtleRequestId req, const std: } } +void RsGxsNetService::receiveTurtleSearchResults(TurtleRequestId req,const unsigned char *encrypted_group_data,uint32_t encrypted_group_data_len) +{ +#ifdef NXS_NET_DEBUG_8 + GXSNETDEBUG___ << " received encrypted group data for turtle search request " << std::hex << req << std::dec << ": " << RsUtil::BinToHex(encrypted_group_data,encrypted_group_data_len,50) << std::endl; +#endif + auto it = mSearchRequests.find(req); + + if(mSearchRequests.end() == it) + { + std::cerr << "(EE) received search results for unknown request " << std::hex << req << std::dec ; + return; + } + RsGxsGroupId grpId = it->second; + + uint8_t encryption_master_key[32]; + Sha256CheckSum s = RsDirUtil::sha256sum(grpId.toByteArray(),grpId.SIZE_IN_BYTES); + memcpy(encryption_master_key,s.toByteArray(),32); + +#ifdef NXS_NET_DEBUG_8 + GXSNETDEBUG___ << " attempting data decryption with master key " << RsUtil::BinToHex(encryption_master_key,32) << std::endl; +#endif + unsigned char *clear_group_data = NULL; + uint32_t clear_group_data_len ; + + if(!librs::crypto::decryptAuthenticateData(encrypted_group_data,encrypted_group_data_len,encryption_master_key,clear_group_data,clear_group_data_len)) + { + std::cerr << "(EE) Could not decrypt data. Something went wrong. Wrong key??" << std::endl; + return ; + } + +#ifdef NXS_NET_DEBUG_8 + GXSNETDEBUG___ << " successfuly decrypted data : " << RsUtil::BinToHex(clear_group_data,clear_group_data_len,50) << std::endl; +#endif + RsItem *item = RsNxsSerialiser(mServType).deserialise(clear_group_data,&clear_group_data_len) ; + free(clear_group_data); + clear_group_data = NULL ; + + RsNxsGrp *nxs_grp = dynamic_cast(item) ; + + if(nxs_grp == NULL) + { + std::cerr << "(EE) decrypted item is not a RsNxsGrp. Weird!" << std::endl; + return ; + } + std::vector new_grps(1,nxs_grp); + +#ifdef NXS_NET_DEBUG_8 + GXSNETDEBUG___ << " passing the grp data to observer." << std::endl; +#endif + mObserver->receiveNewGroups(new_grps); +} + bool RsGxsNetService::search(const std::string& substring,std::list& group_infos) { RsGxsGrpMetaTemporaryMap grpMetaMap; @@ -5228,4 +5284,80 @@ bool RsGxsNetService::search(const std::string& substring,std::listsecond; + } + else + { + // Now check if the last request was too close in time, in which case, we dont retrieve data. + + if(mLastCacheReloadTS + 60 < time(NULL)) + { + std::cerr << "(WW) Not found in cache, and last cache reload less than 60 secs ago. Returning false. " << std::endl; + return false ; + } + +#ifdef NXS_NET_DEBUG_8 + GXSNETDEBUG___ << " reloading group cache information" << std::endl; +#endif + RsNxsGrpDataTemporaryMap grpDataMap; + { + RS_STACK_MUTEX(mNxsMutex) ; + mDataStore->retrieveNxsGrps(grpDataMap, true, true); + } + + for(auto it(grpDataMap.begin());it!=grpDataMap.end();++it) + if(it->second->metaData->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED ) // only cache subscribed groups + { + RsNxsGrp *grp = it->second ; + delete grp->metaData ; // clean private keys + grp->metaData = NULL ; + + Sha1CheckSum hash(RsDirUtil::sha1sum(it->first.toByteArray(),it->first.SIZE_IN_BYTES)); + + mGroupHashCache[hash] = grp ; + + if(hash == hashed_group_id) + grp_data = grp ; + } + } + + if(!grp_data) + { +#ifdef NXS_NET_DEBUG_8 + GXSNETDEBUG___ << " no group found for hash " << hashed_group_id << ": returning false." << std::endl; +#endif + return false ; + } + +#ifdef NXS_NET_DEBUG_8 + GXSNETDEBUG___ << " found corresponding group data group id in cache group_id=" << grp_data->grpId << std::endl; +#endif + // Finally, serialize and encrypt the grp data + + uint32_t size = RsNxsSerialiser(mServType).size(grp_data); + RsTemporaryMemory mem(size) ; + + RsNxsSerialiser(mServType).serialise(grp_data,mem,&size) ; + + uint8_t encryption_master_key[32]; + Sha256CheckSum s = RsDirUtil::sha256sum(grp_data->grpId.toByteArray(),grp_data->grpId.SIZE_IN_BYTES); + memcpy(encryption_master_key,s.toByteArray(),32); + +#ifdef NXS_NET_DEBUG_8 + GXSNETDEBUG___ << " sending data encrypted with master key " << RsUtil::BinToHex(encryption_master_key,32) << std::endl; +#endif + return librs::crypto::encryptAuthenticateData(mem,size,encryption_master_key,encrypted_group_data,encrypted_group_data_len); +} diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index d6496e795..9ab18b4d5 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -131,7 +131,10 @@ public: virtual TurtleRequestId turtleSearchRequest(const std::string& match_string); virtual bool search(const std::string& substring,std::list& group_infos) ; + virtual bool search(const Sha1CheckSum& hashed_group_id,unsigned char *& encrypted_group_data,uint32_t& encrypted_group_data_len); virtual void receiveTurtleSearchResults(TurtleRequestId req,const std::list& group_infos); + virtual void receiveTurtleSearchResults(TurtleRequestId req,const unsigned char *encrypted_group_data,uint32_t encrypted_group_data_len); + virtual bool retrieveDistantSearchResults(TurtleRequestId req, std::map &group_infos); virtual bool clearDistantSearchResults(const TurtleRequestId& id); virtual bool retrieveDistantGroupSummary(const RsGxsGroupId&,RsGxsGroupSummary&); @@ -609,6 +612,10 @@ private: uint32_t mDefaultMsgStorePeriod ; uint32_t mDefaultMsgSyncPeriod ; + + std::map mGroupHashCache; + std::map mSearchRequests; + time_t mLastCacheReloadTS ; }; #endif // RSGXSNETSERVICE_H diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index cce855165..b6bf3c15a 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -163,6 +163,27 @@ public: RsTypeSerializer::serial_process(j,ctx,group_infos,"group_infos") ; } }; +class RsGxsNetTunnelTurtleSearchGroupDataItem: public RsGxsNetTunnelItem +{ +public: + explicit RsGxsNetTunnelTurtleSearchGroupDataItem(): RsGxsNetTunnelItem(RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_DATA) {} + virtual ~RsGxsNetTunnelTurtleSearchGroupDataItem() {} + + uint16_t service ; + unsigned char *encrypted_group_data ; + uint32_t encrypted_group_data_len ; + + virtual void clear() { free(encrypted_group_data);encrypted_group_data=NULL;encrypted_group_data_len=0; } + + virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) + { + RsTypeSerializer::serial_process(j,ctx,service,"service") ; + + RsTypeSerializer::TlvMemBlock_proxy prox(encrypted_group_data,encrypted_group_data_len) ; + RsTypeSerializer::serial_process(j,ctx,prox,"encrypted_group_data") ; + } +}; + class RsGxsNetTunnelSerializer: public RsServiceSerializer { public: @@ -184,7 +205,7 @@ public: case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_SUBSTRING : return new RsGxsNetTunnelTurtleSearchSubstringItem; case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_REQUEST : return new RsGxsNetTunnelTurtleSearchGroupRequestItem; case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_SUMMARY : return new RsGxsNetTunnelTurtleSearchGroupSummaryItem; - //case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_DATA : return new RsGxsNetTunnelTurtleSearchGroupDataItem; + case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_DATA : return new RsGxsNetTunnelTurtleSearchGroupDataItem; default: GXS_NET_TUNNEL_ERROR() << "type ID " << std::hex << (int)item_subtype << std::dec << " is not handled!" << std::endl; return NULL ; @@ -1033,20 +1054,22 @@ bool RsGxsNetTunnelService::receiveSearchRequest(unsigned char *search_request_d if(substring_gr != NULL) { -#ifdef TODO - auto it = mSearchableGxsServices.find(substring_sr->service) ; + RS_STACK_MUTEX(mGxsNetTunnelMtx); + auto it = mSearchableServices.find(substring_gr->service) ; - RsNxsGrp *grp = NULL ; + unsigned char *encrypted_group_data = NULL ; + uint32_t encrypted_group_data_len = 0 ; - if(it != mSearchableGxsServices.end() && it->second.search(substring_sr->group_id,grp)) + if(it != mSearchableServices.end() && it->second->search(substring_gr->hashed_group_id,encrypted_group_data,encrypted_group_data_len)) { RsGxsNetTunnelTurtleSearchGroupDataItem search_result_item ; search_result_item.service = substring_sr->service ; - search_result_item.group_infos = results ; + search_result_item.encrypted_group_data = encrypted_group_data ; + search_result_item.encrypted_group_data_len = encrypted_group_data_len; search_result_data_size = RsGxsNetTunnelSerializer().size(&search_result_item) ; - search_result_data = (unsigned char*)rs_malloc(size) ; + search_result_data = (unsigned char*)rs_malloc(search_result_data_size) ; if(search_result_data == NULL) return false ; @@ -1055,7 +1078,6 @@ bool RsGxsNetTunnelService::receiveSearchRequest(unsigned char *search_request_d return true ; } -#endif } return false ; diff --git a/libretroshare/src/gxs/rsnxs.h b/libretroshare/src/gxs/rsnxs.h index 046b2e80f..7d617ee30 100644 --- a/libretroshare/src/gxs/rsnxs.h +++ b/libretroshare/src/gxs/rsnxs.h @@ -133,6 +133,7 @@ public: virtual bool retrieveDistantGroupSummary(const RsGxsGroupId&,RsGxsGroupSummary&)=0; virtual bool search(const std::string& substring,std::list& group_infos) =0; + virtual bool search(const Sha1CheckSum& hashed_group_id,unsigned char *& encrypted_group_data,uint32_t& encrypted_group_data_len)=0; /*! * Initiates a search through the network @@ -152,6 +153,9 @@ public: */ //virtual int searchGrps(RsGxsSearch* search, uint8_t hops = 1, bool retrieve = 0) = 0; + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// DATA ACCESS FUNCTIONS /// + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /*! * pauses synchronisation of subscribed groups and request for group id From abc5b840d265e6316d2d3efb5b3ef1dbf42629de Mon Sep 17 00:00:00 2001 From: cyril soler Date: Mon, 2 Jul 2018 09:36:21 +0200 Subject: [PATCH 091/138] added queuedConnection type in fillDisplay() between RsGxsBroadcastWidget and RsGxsBroadCastBase. --- retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp index a6e3e5705..2f1ddf4d6 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp @@ -4,8 +4,9 @@ RsGxsUpdateBroadcastWidget::RsGxsUpdateBroadcastWidget(RsGxsIfaceHelper *ifaceImpl, QWidget *parent, Qt::WindowFlags flags) : QWidget(parent, flags) { - mBase = new RsGxsUpdateBroadcastBase(ifaceImpl, this); - connect(mBase, SIGNAL(fillDisplay(bool)), this, SLOT(fillDisplay(bool))); + mBase = new RsGxsUpdateBroadcastBase(ifaceImpl, this); + // The Queued connection is here to circumvent an apparent mutex problem in Qt + connect(mBase, SIGNAL(fillDisplay(bool)), this, SLOT(fillDisplay(bool)),Qt::QueuedConnection); mInterfaceHelper = ifaceImpl; } @@ -14,6 +15,7 @@ RsGxsUpdateBroadcastWidget::~RsGxsUpdateBroadcastWidget() { } + void RsGxsUpdateBroadcastWidget::fillComplete() { mBase->fillComplete(); From e6db04e2b538b7e6ef01013beaf0aae1a8ce0132 Mon Sep 17 00:00:00 2001 From: cyril soler Date: Mon, 2 Jul 2018 09:45:17 +0200 Subject: [PATCH 092/138] cancelled previous commit, because it sort of breaks the update of forum lists. --- .../gui/gxs/RsGxsUpdateBroadcastWidget.cpp | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp index 2f1ddf4d6..19ae2c3d0 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp @@ -2,68 +2,66 @@ #include "RsGxsUpdateBroadcastBase.h" RsGxsUpdateBroadcastWidget::RsGxsUpdateBroadcastWidget(RsGxsIfaceHelper *ifaceImpl, QWidget *parent, Qt::WindowFlags flags) - : QWidget(parent, flags) + : QWidget(parent, flags) { mBase = new RsGxsUpdateBroadcastBase(ifaceImpl, this); - // The Queued connection is here to circumvent an apparent mutex problem in Qt - connect(mBase, SIGNAL(fillDisplay(bool)), this, SLOT(fillDisplay(bool)),Qt::QueuedConnection); + connect(mBase, SIGNAL(fillDisplay(bool)), this, SLOT(fillDisplay(bool))); - mInterfaceHelper = ifaceImpl; + mInterfaceHelper = ifaceImpl; } RsGxsUpdateBroadcastWidget::~RsGxsUpdateBroadcastWidget() { } - void RsGxsUpdateBroadcastWidget::fillComplete() { - mBase->fillComplete(); + mBase->fillComplete(); } void RsGxsUpdateBroadcastWidget::setUpdateWhenInvisible(bool update) { - mBase->setUpdateWhenInvisible(update); + mBase->setUpdateWhenInvisible(update); } -const std::set &RsGxsUpdateBroadcastWidget::getGrpIds() +const std::list &RsGxsUpdateBroadcastWidget::getGrpIds() { - return mBase->getGrpIds(); + return mBase->getGrpIds(); } -const std::set &RsGxsUpdateBroadcastWidget::getGrpIdsMeta() +const std::list &RsGxsUpdateBroadcastWidget::getGrpIdsMeta() { - return mBase->getGrpIdsMeta(); + return mBase->getGrpIdsMeta(); } -void RsGxsUpdateBroadcastWidget::getAllGrpIds(std::set &grpIds) +void RsGxsUpdateBroadcastWidget::getAllGrpIds(std::list &grpIds) { - mBase->getAllGrpIds(grpIds); + mBase->getAllGrpIds(grpIds); } -const std::map > &RsGxsUpdateBroadcastWidget::getMsgIds() +const std::map > &RsGxsUpdateBroadcastWidget::getMsgIds() { - return mBase->getMsgIds(); + return mBase->getMsgIds(); } -const std::map > &RsGxsUpdateBroadcastWidget::getMsgIdsMeta() +const std::map > &RsGxsUpdateBroadcastWidget::getMsgIdsMeta() { - return mBase->getMsgIdsMeta(); + return mBase->getMsgIdsMeta(); } -void RsGxsUpdateBroadcastWidget::getAllMsgIds(std::map > &msgIds) +void RsGxsUpdateBroadcastWidget::getAllMsgIds(std::map > &msgIds) { - mBase->getAllMsgIds(msgIds); + mBase->getAllMsgIds(msgIds); } void RsGxsUpdateBroadcastWidget::fillDisplay(bool complete) { - updateDisplay(complete); - update(); // Qt flush + updateDisplay(complete); + update(); // Qt flush } void RsGxsUpdateBroadcastWidget::showEvent(QShowEvent *event) { - mBase->showEvent(event); - QWidget::showEvent(event); + mBase->showEvent(event); + QWidget::showEvent(event); } From 1b2b3113ca80cfb8b6dff648928f9a4a42f25542 Mon Sep 17 00:00:00 2001 From: cyril soler Date: Mon, 2 Jul 2018 10:21:38 +0200 Subject: [PATCH 093/138] fixed previous commit caused by an apparent bug in qtcreator when updating code --- .../src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp index 19ae2c3d0..c20809937 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp @@ -24,32 +24,32 @@ void RsGxsUpdateBroadcastWidget::setUpdateWhenInvisible(bool update) mBase->setUpdateWhenInvisible(update); } -const std::list &RsGxsUpdateBroadcastWidget::getGrpIds() +const std::set &RsGxsUpdateBroadcastWidget::getGrpIds() { return mBase->getGrpIds(); } -const std::list &RsGxsUpdateBroadcastWidget::getGrpIdsMeta() +const std::set &RsGxsUpdateBroadcastWidget::getGrpIdsMeta() { return mBase->getGrpIdsMeta(); } -void RsGxsUpdateBroadcastWidget::getAllGrpIds(std::list &grpIds) +void RsGxsUpdateBroadcastWidget::getAllGrpIds(std::set &grpIds) { mBase->getAllGrpIds(grpIds); } -const std::map > &RsGxsUpdateBroadcastWidget::getMsgIds() +const std::map > &RsGxsUpdateBroadcastWidget::getMsgIds() { return mBase->getMsgIds(); } -const std::map > &RsGxsUpdateBroadcastWidget::getMsgIdsMeta() +const std::map > &RsGxsUpdateBroadcastWidget::getMsgIdsMeta() { return mBase->getMsgIdsMeta(); } -void RsGxsUpdateBroadcastWidget::getAllMsgIds(std::map > &msgIds) +void RsGxsUpdateBroadcastWidget::getAllMsgIds(std::map > &msgIds) { mBase->getAllMsgIds(msgIds); } From 418c42bd1108b79cf9ad297d3d096858a7f47733 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Mon, 2 Jul 2018 13:50:02 +0200 Subject: [PATCH 094/138] Extra locators in cert invite made optional --- libretroshare/src/retroshare/rspeers.h | 23 +++++++++++++-- libretroshare/src/rsserver/p3peers.cc | 41 +++++++++++++++----------- libretroshare/src/rsserver/p3peers.h | 10 +++++-- 3 files changed, 52 insertions(+), 22 deletions(-) diff --git a/libretroshare/src/retroshare/rspeers.h b/libretroshare/src/retroshare/rspeers.h index 89131e8bf..7824daa11 100644 --- a/libretroshare/src/retroshare/rspeers.h +++ b/libretroshare/src/retroshare/rspeers.h @@ -386,11 +386,30 @@ public: virtual bool resetOwnExternalAddressList() = 0; virtual bool getAllowServerIPDetermination() = 0 ; + /** + * @brief Get RetroShare invite of the given peer + * @param[in] sslId Id of the peer of which we want to generate an invite + * @param[in] includeSignatures true to add key signatures to the invite + * @param[in] includeExtraLocators false to avoid to add extra locators + * @return invite string + */ + virtual std::string GetRetroshareInvite( + const RsPeerId& sslId, bool includeSignatures = false, + bool includeExtraLocators = true ) = 0; + + /** + * @brief Get RetroShare invite of our own peer + * @param[in] includeSignatures true to add key signatures to the invite + * @param[in] includeExtraLocators false to avoid to add extra locators + * @return invite string + */ + virtual std::string GetRetroshareInvite( + bool includeSignatures = false, + bool includeExtraLocators = true ) = 0; + /* Auth Stuff */ - virtual std::string GetRetroshareInvite(const RsPeerId& ssl_id,bool include_signatures) = 0; virtual std::string getPGPKey(const RsPgpId& pgp_id,bool include_signatures) = 0; virtual bool GetPGPBase64StringAndCheckSum(const RsPgpId& gpg_id,std::string& gpg_base64_string,std::string& gpg_base64_checksum) = 0; - virtual std::string GetRetroshareInvite(bool include_signatures) = 0; virtual bool hasExportMinimal() = 0; // Add keys to the keyring diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index 60d724179..36509c33b 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -1048,9 +1048,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) { @@ -1101,37 +1103,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; } diff --git a/libretroshare/src/rsserver/p3peers.h b/libretroshare/src/rsserver/p3peers.h index 43d45f8a7..d2333c420 100644 --- a/libretroshare/src/rsserver/p3peers.h +++ b/libretroshare/src/rsserver/p3peers.h @@ -115,11 +115,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(); From 4eb060e1545c14293c9169e770a6d0e97c6ec89d Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Mon, 2 Jul 2018 17:41:26 +0900 Subject: [PATCH 095/138] gui: do not attempt to create context menu if idlist is empty ...and other side effects --- .../src/gui/chat/ChatLobbyDialog.cpp | 79 +++++++++---------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index e490af1b8..1f7b20ac6 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -2,7 +2,7 @@ * * RetroShare is distributed under the following license: * - * Copyright (C) 2011, csoler + * Copyright (C) 2011, csoler * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * ****************************************************************/ @@ -87,7 +87,7 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi ui.participantsList->setColumnWidth(COLUMN_ICON, 1.7*S); ui.participantsList->setColumnHidden(COLUMN_ACTIVITY,true); ui.participantsList->setColumnHidden(COLUMN_ID,true); - + /* Set header resize modes and initial section sizes */ QHeaderView * header = ui.participantsList->header(); QHeaderView_setSectionResizeModeColumn(header, COLUMN_NAME, QHeaderView::Stretch); @@ -99,16 +99,16 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi distantChatAct = new QAction(QIcon(":/images/chat_24.png"), tr("Start private chat"), this); sendMessageAct = new QAction(QIcon(":/images/mail_new.png"), tr("Send Message"), this); showInPeopleAct = new QAction(QIcon(), tr("Show author in people tab"), this); - + QActionGroup *sortgrp = new QActionGroup(this); actionSortByName = new QAction(QIcon(), tr("Sort by Name"), this); actionSortByName->setCheckable(true); - actionSortByName->setChecked(true); + actionSortByName->setChecked(true); actionSortByName->setActionGroup(sortgrp); actionSortByActivity = new QAction(QIcon(), tr("Sort by Activity"), this); actionSortByActivity->setCheckable(true); - actionSortByActivity->setChecked(false); + actionSortByActivity->setChecked(false); actionSortByActivity->setActionGroup(sortgrp); @@ -122,7 +122,7 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi connect(actionSortByName, SIGNAL(triggered()), this, SLOT(sortParcipants())); connect(actionSortByActivity, SIGNAL(triggered()), this, SLOT(sortParcipants())); - + /* Add filter actions */ QTreeWidgetItem *headerItem = ui.participantsList->headerItem(); QString headerText = headerItem->text(COLUMN_NAME ); @@ -163,7 +163,7 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi } ownIdChooser = new GxsIdChooser() ; ownIdChooser->loadIds(idChooserFlag, current_id) ; - + QWidgetAction *checkableAction = new QWidgetAction(this); checkableAction->setDefaultWidget(ownIdChooser); @@ -246,8 +246,8 @@ void ChatLobbyDialog::participantsTreeWidgetCustomPopupMenu(QPoint) void ChatLobbyDialog::textBrowserAskContextMenu(QMenu* contextMnu, QString anchorForPosition, const QPoint /*point*/) { - if (anchorForPosition.startsWith(PERSONID)){ - QString strId = anchorForPosition.replace(PERSONID,""); + if (anchorForPosition.startsWith(PERSONID)) { + QString strId = anchorForPosition.replace(PERSONID, ""); if (strId.contains(" ")) strId.truncate(strId.indexOf(" ")); @@ -263,6 +263,8 @@ void ChatLobbyDialog::initParticipantsContextMenu(QMenu *contextMnu, QListaddAction(distantChatAct); contextMnu->addAction(sendMessageAct); @@ -281,7 +283,7 @@ void ChatLobbyDialog::initParticipantsContextMenu(QMenu *contextMnu, QListsetEnabled(false); voteNeutralAct->setEnabled(false); voteNegativeAct->setEnabled(false); - showInPeopleAct->setEnabled(idList.count()==1); + showInPeopleAct->setEnabled(idList.count() == 1); distantChatAct->setData(QVariant::fromValue(idList)); sendMessageAct->setData(QVariant::fromValue(idList)); @@ -291,19 +293,16 @@ void ChatLobbyDialog::initParticipantsContextMenu(QMenu *contextMnu, QListsetData(QVariant::fromValue(idList)); showInPeopleAct->setData(QVariant::fromValue(idList)); - if(idList.count()==1) - { - RsGxsId gxsid = idList.at(0); + RsGxsId gxsid = idList.at(0); - if(!gxsid.isNull() && !rsIdentity->isOwnId(gxsid)) - { - distantChatAct->setEnabled(true); - votePositiveAct->setEnabled(rsReputations->overallReputationLevel(gxsid) != RsReputations::REPUTATION_LOCALLY_POSITIVE); - voteNeutralAct->setEnabled((rsReputations->overallReputationLevel(gxsid) == RsReputations::REPUTATION_LOCALLY_POSITIVE) || (rsReputations->overallReputationLevel(gxsid) == RsReputations::REPUTATION_LOCALLY_NEGATIVE) ); - voteNegativeAct->setEnabled(rsReputations->overallReputationLevel(gxsid) != RsReputations::REPUTATION_LOCALLY_NEGATIVE); - muteAct->setEnabled(true); - muteAct->setChecked(isParticipantMuted(gxsid)); - } + if(!gxsid.isNull() && !rsIdentity->isOwnId(gxsid)) + { + distantChatAct->setEnabled(true); + votePositiveAct->setEnabled(rsReputations->overallReputationLevel(gxsid) != RsReputations::REPUTATION_LOCALLY_POSITIVE); + voteNeutralAct->setEnabled((rsReputations->overallReputationLevel(gxsid) == RsReputations::REPUTATION_LOCALLY_POSITIVE) || (rsReputations->overallReputationLevel(gxsid) == RsReputations::REPUTATION_LOCALLY_NEGATIVE) ); + voteNegativeAct->setEnabled(rsReputations->overallReputationLevel(gxsid) != RsReputations::REPUTATION_LOCALLY_NEGATIVE); + muteAct->setEnabled(true); + muteAct->setChecked(isParticipantMuted(gxsid)); } } @@ -443,17 +442,17 @@ void ChatLobbyDialog::processSettings(bool load) // state of splitter ui.splitter->restoreState(Settings->value("splitter").toByteArray()); - + // load sorting actionSortByActivity->setChecked(Settings->value("sortbyActivity", QVariant(false)).toBool()); actionSortByName->setChecked(Settings->value("sortbyName", QVariant(true)).toBool()); - + } else { // save settings // state of splitter Settings->setValue("splitter", ui.splitter->saveState()); - + //save sorting Settings->setValue("sortbyActivity", actionSortByActivity->isChecked()); Settings->setValue("sortbyName", actionSortByName->isChecked()); @@ -464,7 +463,7 @@ void ChatLobbyDialog::processSettings(bool load) /** * Change your Nickname - * + * * - send a Message to all Members => later: send hidden message to clients, so they can actualize there mutedParticipants list */ void ChatLobbyDialog::setIdentity(const RsGxsId& gxs_id) @@ -500,7 +499,7 @@ void ChatLobbyDialog::changeNickname() /** * We get a new Message from a chat participant - * + * * - Ignore Messages from muted chat participants */ void ChatLobbyDialog::addChatMsg(const ChatMessage& msg) @@ -509,7 +508,7 @@ void ChatLobbyDialog::addChatMsg(const ChatMessage& msg) QDateTime recvTime = QDateTime::fromTime_t(msg.recvTime); QString message = QString::fromUtf8(msg.msg.c_str()); RsGxsId gxs_id = msg.lobby_peer_gxs_id ; - + if(!isParticipantMuted(gxs_id)) { // We could change addChatMsg to display the peers icon, passing a ChatId @@ -551,7 +550,7 @@ void ChatLobbyDialog::addChatMsg(const ChatMessage& msg) /** * Regenerate the QTreeWidget participant list of a Chat Lobby - * + * * Show yellow icon for muted Participants */ void ChatLobbyDialog::updateParticipantsList() @@ -602,7 +601,7 @@ void ChatLobbyDialog::updateParticipantsList() time_t tLastAct=widgetitem->text(COLUMN_ACTIVITY).toInt(); time_t now = time(NULL); - + widgetitem->setSizeHint(COLUMN_ICON, QSize(20,20)); @@ -619,7 +618,7 @@ void ChatLobbyDialog::updateParticipantsList() if (RsGxsId(participant.toStdString()) == gxs_id) widgetitem->setIcon(COLUMN_ICON, bullet_yellow_128); widgetitem->updateBannedState(); - + QTime qtLastAct=QTime(0,0,0).addSecs(now-tLastAct); widgetitem->setToolTip(COLUMN_ICON,tr("Right click to mute/unmute participants
Double click to address this person
") +tr("This participant is not active since:") @@ -635,7 +634,7 @@ void ChatLobbyDialog::updateParticipantsList() /** * Called when a Participant get Clicked / Changed - * + * * Check if the Checkbox altered and Mute User */ void ChatLobbyDialog::changeParticipationState() @@ -787,15 +786,15 @@ bool ChatLobbyDialog::isNicknameInLobby(const RsGxsId& nickname) return clinfo.gxs_ids.find(nickname) != clinfo.gxs_ids.end() ; } -/** +/** * Should Messages from this Nickname be muted? - * + * * At the moment it is not possible to 100% know which peer sendet the message, and only - * the nickname is available. So this couldn't work for 100%. So, for example, if a peer - * change his name to the name of a other peer, we couldn't block him. A real implementation + * the nickname is available. So this couldn't work for 100%. So, for example, if a peer + * change his name to the name of a other peer, we couldn't block him. A real implementation * will be possible if we transfer a temporary Session ID from the sending Retroshare client * version 0.6 - * + * * @param QString nickname to check */ bool ChatLobbyDialog::isParticipantMuted(const RsGxsId& participant) @@ -901,7 +900,7 @@ bool ChatLobbyDialog::canClose() void ChatLobbyDialog::showDialog(uint chatflags) { - if (chatflags & RS_CHAT_FOCUS) + if (chatflags & RS_CHAT_FOCUS) { MainWindow::showWindow(MainWindow::ChatLobby); dynamic_cast(MainWindow::getPage(MainWindow::ChatLobby))->setCurrentChatPage(this) ; @@ -916,7 +915,7 @@ void ChatLobbyDialog::sortParcipants() } else if (actionSortByName->isChecked()) { ui.participantsList->sortItems(COLUMN_NAME, Qt::AscendingOrder); } - + } void ChatLobbyDialog::filterChanged(const QString& /*text*/) From ce61174d79227588375678bfe446980420f50168 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sat, 9 Jun 2018 18:02:52 +0200 Subject: [PATCH 096/138] DROP before merge. Reduce INTEGRITY_CHECK_PERIOD So it run each two 2 minutes and it's easy to debug deep search --- libretroshare/src/gxs/rsgenexchange.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index ad7e02dcb..69344383d 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -67,7 +67,7 @@ static const uint32_t INDEX_AUTHEN_ADMIN = 0x00000040; // admin key //#define GEN_EXCH_DEBUG 1 static const uint32_t MSG_CLEANUP_PERIOD = 60*59; // 59 minutes -static const uint32_t INTEGRITY_CHECK_PERIOD = 60*31; // 31 minutes +static const uint32_t INTEGRITY_CHECK_PERIOD = 60*2; // 31 minutes // TODO: Restore this line before merging deep_search RsGenExchange::RsGenExchange(RsGeneralDataService *gds, RsNetworkExchangeService *ns, RsSerialType *serviceSerialiser, uint16_t servType, RsGixs* gixs, @@ -1634,7 +1634,6 @@ void RsGenExchange::notifyNewMessages(std::vector& messages) } } } - void RsGenExchange::notifyReceivePublishKey(const RsGxsGroupId &grpId) { RS_STACK_MUTEX(mGenMtx); From c0e92ddc6b6b8291995e4cdf4c76ea5314f19ead Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sat, 9 Jun 2018 18:06:14 +0200 Subject: [PATCH 097/138] WIP Index GXS channels with xapian Use temporary DB ATM --- libretroshare/src/deep_search/deep_search.h | 106 ++++++++++++ libretroshare/src/gxs/rsgxsutil.cc | 183 +++++++++++++------- libretroshare/src/libretroshare.pro | 4 +- libretroshare/src/rsitems/rsnxsitems.h | 3 +- libretroshare/src/use_libretroshare.pri | 4 + retroshare.pri | 9 + 6 files changed, 247 insertions(+), 62 deletions(-) create mode 100644 libretroshare/src/deep_search/deep_search.h diff --git a/libretroshare/src/deep_search/deep_search.h b/libretroshare/src/deep_search/deep_search.h new file mode 100644 index 000000000..6af963c6d --- /dev/null +++ b/libretroshare/src/deep_search/deep_search.h @@ -0,0 +1,106 @@ +#pragma once +/* + * RetroShare Content Search and Indexing. + * Copyright (C) 2018 Gioacchino Mazzurco + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include + +#include "retroshare/rsgxschannels.h" + +struct DeepSearch +{ + //DeepSearch(const std::string& dbPath) : mDbPath(dbPath) {} + + static void search(/*query*/) { /*return all matching results*/ } + + + static void indexChannelGroup(const RsGxsChannelGroup& chan) + { + Xapian::WritableDatabase db(mDbPath, Xapian::DB_CREATE_OR_OPEN); + + // Set up a TermGenerator that we'll use in indexing. + Xapian::TermGenerator termgenerator; + //termgenerator.set_stemmer(Xapian::Stem("en")); + + // We make a document and tell the term generator to use this. + Xapian::Document doc; + termgenerator.set_document(doc); + + // Index each field with a suitable prefix. + termgenerator.index_text(chan.mMeta.mGroupName, 1, "G"); + termgenerator.index_text(chan.mDescription, 1, "XD"); + + // Index fields without prefixes for general search. + termgenerator.index_text(chan.mMeta.mGroupName); + termgenerator.increase_termpos(); + termgenerator.index_text(chan.mDescription); + + // We use the identifier to ensure each object ends up in the + // database only once no matter how many times we run the + // indexer. + std::string idTerm("Qretroshare://channel?id="); + idTerm += chan.mMeta.mGroupId.toStdString(); + + doc.add_boolean_term(idTerm); + db.replace_document(idTerm, doc); + } + + static void removeChannelFromIndex(RsGxsGroupId grpId) + { + std::string idTerm("Qretroshare://channel?id="); + idTerm += grpId.toStdString(); + + Xapian::WritableDatabase db(mDbPath, Xapian::DB_CREATE_OR_OPEN); + db.delete_document(idTerm); + } + + static void indexChannelPost(const RsGxsChannelPost& post) + { + Xapian::WritableDatabase db(mDbPath, Xapian::DB_CREATE_OR_OPEN); + + // Set up a TermGenerator that we'll use in indexing. + Xapian::TermGenerator termgenerator; + //termgenerator.set_stemmer(Xapian::Stem("en")); + + // We make a document and tell the term generator to use this. + Xapian::Document doc; + termgenerator.set_document(doc); + + // Index each field with a suitable prefix. + termgenerator.index_text(post.mMeta.mMsgName, 1, "S"); + termgenerator.index_text(post.mMsg, 1, "XD"); + + // Index fields without prefixes for general search. + termgenerator.index_text(post.mMeta.mMsgName); + termgenerator.increase_termpos(); + termgenerator.index_text(post.mMsg); + + // We use the identifier to ensure each object ends up in the + // database only once no matter how many times we run the + // indexer. + std::string idTerm("Qretroshare://channel?id="); + idTerm += post.mMeta.mGroupId.toStdString(); + idTerm += "&msgid="; + idTerm += post.mMeta.mMsgId.toStdString(); + doc.add_boolean_term(idTerm); + db.replace_document(idTerm, doc); + } + + static std::string mDbPath; +}; + +std::string DeepSearch::mDbPath = "/tmp/deep_search_xapian_db"; diff --git a/libretroshare/src/gxs/rsgxsutil.cc b/libretroshare/src/gxs/rsgxsutil.cc index bb0b1fb05..2c23d9e89 100644 --- a/libretroshare/src/gxs/rsgxsutil.cc +++ b/libretroshare/src/gxs/rsgxsutil.cc @@ -31,6 +31,12 @@ #include "pqi/pqihash.h" #include "gxs/rsgixs.h" +#ifdef RS_DEEP_SEARCH +# include "deep_search/deep_search.h" +# include "services/p3gxschannels.h" +# include "rsitems/rsgxschannelitems.h" +#endif + static const uint32_t MAX_GXS_IDS_REQUESTS_NET = 10 ; // max number of requests from cache/net (avoids killing the system!) //#define DEBUG_GXSUTIL 1 @@ -141,20 +147,28 @@ bool RsGxsMessageCleanUp::clean() return mGrpMeta.empty(); } -RsGxsIntegrityCheck::RsGxsIntegrityCheck(RsGeneralDataService* const dataService, RsGenExchange *genex, RsGixs *gixs) : - mDs(dataService),mGenExchangeClient(genex), mDone(false), mIntegrityMutex("integrity"),mGixs(gixs) -{ } +RsGxsIntegrityCheck::RsGxsIntegrityCheck( + RsGeneralDataService* const dataService, RsGenExchange* genex, + RsGixs* gixs ) : + mDs(dataService), mGenExchangeClient(genex), mDone(false), + mIntegrityMutex("integrity"), mGixs(gixs) {} void RsGxsIntegrityCheck::run() { check(); - RsStackMutex stack(mIntegrityMutex); - mDone = true; + RS_STACK_MUTEX(mIntegrityMutex); + mDone = true; } bool RsGxsIntegrityCheck::check() { +#ifdef RS_DEEP_SEARCH + bool isGxsChannels = dynamic_cast(mGenExchangeClient); + std::cout << __PRETTY_FUNCTION__ << " isGxsChannels: " << isGxsChannels + << std::endl; +#endif + // first take out all the groups std::map grp; mDs->retrieveNxsGrps(grp, true, true); @@ -166,67 +180,113 @@ bool RsGxsIntegrityCheck::check() std::set subscribed_groups ; // compute hash and compare to stored value, if it fails then simply add it - // to list - std::map::iterator git = grp.begin(); - for(; git != grp.end(); ++git) - { - RsNxsGrp* grp = git->second; - RsFileHash currHash; - pqihash pHash; - pHash.addData(grp->grp.bin_data, grp->grp.bin_len); - pHash.Complete(currHash); + // to list + for( std::map::iterator git = grp.begin(); + git != grp.end(); ++git ) + { + RsNxsGrp* grp = git->second; + RsFileHash currHash; + pqihash pHash; + pHash.addData(grp->grp.bin_data, grp->grp.bin_len); + pHash.Complete(currHash); - if(currHash == grp->metaData->mHash) - { - // get all message ids of group - if (mDs->retrieveMsgIds(grp->grpId, msgIds[grp->grpId]) == 1) - { - // store the group for retrieveNxsMsgs - grps[grp->grpId]; + if(currHash == grp->metaData->mHash) + { + // get all message ids of group + if (mDs->retrieveMsgIds(grp->grpId, msgIds[grp->grpId]) == 1) + { + // store the group for retrieveNxsMsgs + grps[grp->grpId]; - if(grp->metaData->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED) - { - subscribed_groups.insert(git->first) ; + if(grp->metaData->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED) + { + subscribed_groups.insert(git->first); - if(!grp->metaData->mAuthorId.isNull()) - { -#ifdef DEBUG_GXSUTIL - GXSUTIL_DEBUG() << "TimeStamping group authors' key ID " << grp->metaData->mAuthorId << " in group ID " << grp->grpId << std::endl; +#ifdef RS_DEEP_SEARCH + if(isGxsChannels) + { + RsGxsChannelGroup cg; + RsGxsGrpMetaData meta; + + meta.deserialise(grp->meta.bin_data, grp->meta.bin_len); + + /* TODO: Apparently a copy of the pointer to + * grp.bin_data is stored into grp.bin_data thus + * breaking the deserialization, skipping the pointer + * (8 bytes on x86_64 debug build) fix the + * deserilization, talk to Cyril how to properly fix + * this.*/ + RsGenericSerializer::SerializeContext ctx( + static_cast(grp->grp.bin_data)+8, + grp->grp.bin_len-8 ); + + RsGxsChannelGroupItem cgIt; + cgIt.serial_process( RsGenericSerializer::DESERIALIZE, + ctx ); + + if(ctx.mOk) + { + cgIt.toChannelGroup(cg, false); + cg.mMeta = meta; + + DeepSearch::indexChannelGroup(cg); + + std::cout << __PRETTY_FUNCTION__ << " ||Channel: " + << meta.mGroupName << " ||Description: " + << cg.mDescription << std::endl; + } + else + std::cout << __PRETTY_FUNCTION__ << " ||Group: " + << meta.mGroupName + << " ||doesn't seems a channel" + << " ||ctx.mOk: " << ctx.mOk + << " ||ctx.mData: " << (void*)ctx.mData + << " ||ctx.mSize: " << ctx.mSize + << " ||grp->grp.bin_data: " << grp->grp.bin_data + << " ||grp->grp.bin_len: " << grp->grp.bin_len + << std::endl; + } #endif - if(rsReputations!=NULL && rsReputations->overallReputationLevel(grp->metaData->mAuthorId) > RsReputations::REPUTATION_LOCALLY_NEGATIVE) - used_gxs_ids.insert(std::make_pair(grp->metaData->mAuthorId,RsIdentityUsage(mGenExchangeClient->serviceType(),RsIdentityUsage::GROUP_AUTHOR_KEEP_ALIVE,grp->grpId))) ; - } - } - } - else - { - msgIds.erase(msgIds.find(grp->grpId)); - // grpsToDel.push_back(grp->grpId); - } - - } - else - { - grpsToDel.push_back(grp->grpId); - } - - if(!(grp->metaData->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED) && !(grp->metaData->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN) && !(grp->metaData->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH)) - { - RsGroupNetworkStats stats ; - mGenExchangeClient->getGroupNetworkStats(grp->grpId,stats); - - if(stats.mSuppliers == 0 && stats.mMaxVisibleCount == 0 && stats.mGrpAutoSync) - { + if(!grp->metaData->mAuthorId.isNull()) + { #ifdef DEBUG_GXSUTIL - GXSUTIL_DEBUG() << "Scheduling group \"" << grp->metaData->mGroupName << "\" ID=" << grp->grpId << " in service " << std::hex << mGenExchangeClient->serviceType() << std::dec << " for deletion because it has no suppliers not any visible data at friends." << std::endl; + GXSUTIL_DEBUG() << "TimeStamping group authors' key ID " << grp->metaData->mAuthorId << " in group ID " << grp->grpId << std::endl; +#endif + if( rsReputations && rsReputations->overallReputationLevel(grp->metaData->mAuthorId ) > RsReputations::REPUTATION_LOCALLY_NEGATIVE ) + used_gxs_ids.insert(std::make_pair(grp->metaData->mAuthorId, RsIdentityUsage(mGenExchangeClient->serviceType(), RsIdentityUsage::GROUP_AUTHOR_KEEP_ALIVE,grp->grpId))); + } + } + } + else msgIds.erase(msgIds.find(grp->grpId)); + } + else + { + grpsToDel.push_back(grp->grpId); +#ifdef RS_DEEP_SEARCH + if(isGxsChannels) DeepSearch::removeChannelFromIndex(grp->grpId); +#endif + } + + if( !(grp->metaData->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED) && + !(grp->metaData->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN) && + !(grp->metaData->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH) ) + { + RsGroupNetworkStats stats; + mGenExchangeClient->getGroupNetworkStats(grp->grpId,stats); + + if( stats.mSuppliers == 0 && stats.mMaxVisibleCount == 0 + && stats.mGrpAutoSync ) + { +#ifdef DEBUG_GXSUTIL + GXSUTIL_DEBUG() << "Scheduling group \"" << grp->metaData->mGroupName << "\" ID=" << grp->grpId << " in service " << std::hex << mGenExchangeClient->serviceType() << std::dec << " for deletion because it has no suppliers not any visible data at friends." << std::endl; #endif grpsToDel.push_back(grp->grpId); - } - } + } + } - delete grp; - } + delete grp; + } mDs->removeGroups(grpsToDel); @@ -299,6 +359,10 @@ bool RsGxsIntegrityCheck::check() } } +#ifdef RS_DEEP_SEARCH + // TODO:remove msgsToDel from deep search index too +#endif + mDs->removeMsgs(msgsToDel); { @@ -373,14 +437,13 @@ bool RsGxsIntegrityCheck::check() bool RsGxsIntegrityCheck::isDone() { - RsStackMutex stack(mIntegrityMutex); + RS_STACK_MUTEX(mIntegrityMutex); return mDone; } void RsGxsIntegrityCheck::getDeletedIds(std::list& grpIds, std::map >& msgIds) { - RsStackMutex stack(mIntegrityMutex); - + RS_STACK_MUTEX(mIntegrityMutex); grpIds = mDeletedGrps; msgIds = mDeletedMsgs; } diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index 13d8fc8b2..70ded089e 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -846,7 +846,9 @@ rs_gxs_trans { SOURCES += gxstrans/p3gxstransitems.cc gxstrans/p3gxstrans.cc } - +rs_deep_search { + HEADERS += deep_search/deep_search.h +} ########################################################################################################### diff --git a/libretroshare/src/rsitems/rsnxsitems.h b/libretroshare/src/rsitems/rsnxsitems.h index f717a3d09..6c7a72002 100644 --- a/libretroshare/src/rsitems/rsnxsitems.h +++ b/libretroshare/src/rsitems/rsnxsitems.h @@ -293,7 +293,8 @@ public: virtual void clear(); - virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); + virtual void serial_process( RsGenericSerializer::SerializeJob j, + RsGenericSerializer::SerializeContext& ctx ); RsGxsGroupId grpId; /// group Id, needed to complete version Id (ncvi) static int refcount; diff --git a/libretroshare/src/use_libretroshare.pri b/libretroshare/src/use_libretroshare.pri index 3a3d1acb7..8dcf2d381 100644 --- a/libretroshare/src/use_libretroshare.pri +++ b/libretroshare/src/use_libretroshare.pri @@ -26,6 +26,10 @@ linux-* { mLibs += dl } +rs_deep_search { + mLibs += xapian +} + static { sLibs *= $$mLibs } else { diff --git a/retroshare.pri b/retroshare.pri index 111530a39..1348464ab 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -115,6 +115,11 @@ rs_macos10.9:CONFIG -= rs_macos10.11 rs_macos10.10:CONFIG -= rs_macos10.11 rs_macos10.12:CONFIG -= rs_macos10.11 +# To disable deep search append the following assignation to qmake command line +# "CONFIG+=no_rs_deep_search" +CONFIG *= rs_deep_search +no_rs_deep_search:CONFIG -= rs_deep_search + ########################################################################################################################################################### # # V07_NON_BACKWARD_COMPATIBLE_CHANGE_001: @@ -313,6 +318,10 @@ rs_chatserver { DEFINES *= RS_CHATSERVER } +rs_deep_search { + DEFINES *= RS_DEEP_SEARCH +} + debug { QMAKE_CXXFLAGS -= -O2 -fomit-frame-pointer QMAKE_CFLAGS -= -O2 -fomit-frame-pointer From c15ae864b5d7f82c39267b4762a6b37060b77e87 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sun, 10 Jun 2018 11:00:38 +0200 Subject: [PATCH 098/138] deep_search: use service serializer not serial_process Avoid tricky pointers arithmetic, thanks Cyril for suggestion --- libretroshare/src/gxs/rsgenexchange.cc | 3 +- libretroshare/src/gxs/rsgxsutil.cc | 44 +++++++++++--------------- libretroshare/src/gxs/rsgxsutil.h | 12 ++++--- 3 files changed, 28 insertions(+), 31 deletions(-) diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 69344383d..7538c19c0 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -206,7 +206,8 @@ void RsGenExchange::tick() if(!mIntegrityCheck) { - mIntegrityCheck = new RsGxsIntegrityCheck(mDataStore,this,mGixs); + mIntegrityCheck = new RsGxsIntegrityCheck( mDataStore, this, + *mSerialiser, mGixs); mIntegrityCheck->start("gxs integrity"); mChecking = true; } diff --git a/libretroshare/src/gxs/rsgxsutil.cc b/libretroshare/src/gxs/rsgxsutil.cc index 2c23d9e89..5e3ed9b83 100644 --- a/libretroshare/src/gxs/rsgxsutil.cc +++ b/libretroshare/src/gxs/rsgxsutil.cc @@ -149,9 +149,9 @@ bool RsGxsMessageCleanUp::clean() RsGxsIntegrityCheck::RsGxsIntegrityCheck( RsGeneralDataService* const dataService, RsGenExchange* genex, - RsGixs* gixs ) : - mDs(dataService), mGenExchangeClient(genex), mDone(false), - mIntegrityMutex("integrity"), mGixs(gixs) {} + RsSerialType& serializer, RsGixs* gixs ) : + mDs(dataService), mGenExchangeClient(genex), mSerializer(serializer), + mDone(false), mIntegrityMutex("integrity"), mGixs(gixs) {} void RsGxsIntegrityCheck::run() { @@ -205,28 +205,18 @@ bool RsGxsIntegrityCheck::check() #ifdef RS_DEEP_SEARCH if(isGxsChannels) { - RsGxsChannelGroup cg; RsGxsGrpMetaData meta; - meta.deserialise(grp->meta.bin_data, grp->meta.bin_len); - /* TODO: Apparently a copy of the pointer to - * grp.bin_data is stored into grp.bin_data thus - * breaking the deserialization, skipping the pointer - * (8 bytes on x86_64 debug build) fix the - * deserilization, talk to Cyril how to properly fix - * this.*/ - RsGenericSerializer::SerializeContext ctx( - static_cast(grp->grp.bin_data)+8, - grp->grp.bin_len-8 ); + uint32_t blz = grp->grp.bin_len; + RsItem* rIt = mSerializer.deserialise(grp->grp.bin_data, + &blz); - RsGxsChannelGroupItem cgIt; - cgIt.serial_process( RsGenericSerializer::DESERIALIZE, - ctx ); - - if(ctx.mOk) + if( RsGxsChannelGroupItem* cgIt = + dynamic_cast(rIt) ) { - cgIt.toChannelGroup(cg, false); + RsGxsChannelGroup cg; + cgIt->toChannelGroup(cg, false); cg.mMeta = meta; DeepSearch::indexChannelGroup(cg); @@ -239,12 +229,14 @@ bool RsGxsIntegrityCheck::check() std::cout << __PRETTY_FUNCTION__ << " ||Group: " << meta.mGroupName << " ||doesn't seems a channel" - << " ||ctx.mOk: " << ctx.mOk - << " ||ctx.mData: " << (void*)ctx.mData - << " ||ctx.mSize: " << ctx.mSize - << " ||grp->grp.bin_data: " << grp->grp.bin_data - << " ||grp->grp.bin_len: " << grp->grp.bin_len - << std::endl; + << " ||grp->grp.bin_data: " + << grp->grp.bin_data + << " ||grp->grp.bin_len: " + << grp->grp.bin_len + << " ||rIt: " << rIt << " ||blz: " << blz + << " ||cgIt: " << cgIt << std::endl; + + delete rIt; } #endif diff --git a/libretroshare/src/gxs/rsgxsutil.h b/libretroshare/src/gxs/rsgxsutil.h index 70e832c3e..faea08040 100644 --- a/libretroshare/src/gxs/rsgxsutil.h +++ b/libretroshare/src/gxs/rsgxsutil.h @@ -201,7 +201,9 @@ public: * @param chunkSize * @param sleepPeriod */ - RsGxsIntegrityCheck(RsGeneralDataService* const dataService, RsGenExchange *genex, RsGixs *gixs); + RsGxsIntegrityCheck( RsGeneralDataService* const dataService, + RsGenExchange *genex, RsSerialType& gxsSerialiser, + RsGixs *gixs); bool check(); bool isDone(); @@ -213,13 +215,15 @@ public: private: RsGeneralDataService* const mDs; - RsGenExchange *mGenExchangeClient; + RsGenExchange *mGenExchangeClient; + RsSerialType& mSerializer; + bool mDone; RsMutex mIntegrityMutex; std::list mDeletedGrps; std::map > mDeletedMsgs; - - RsGixs *mGixs ; + + RsGixs* mGixs; }; class GroupUpdate From 0f63283f96f644f475a87315a48583bd8c44267a Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sun, 10 Jun 2018 19:04:11 +0200 Subject: [PATCH 099/138] Add search capability to DeepSearch --- libretroshare/src/deep_search/deep_search.h | 78 +++++++++++++++++++-- libretroshare/src/gxs/rsgxsutil.cc | 23 +++--- libretroshare/src/gxs/rsgxsutil.h | 1 + 3 files changed, 83 insertions(+), 19 deletions(-) diff --git a/libretroshare/src/deep_search/deep_search.h b/libretroshare/src/deep_search/deep_search.h index 6af963c6d..ae5a97f2e 100644 --- a/libretroshare/src/deep_search/deep_search.h +++ b/libretroshare/src/deep_search/deep_search.h @@ -17,6 +17,7 @@ * along with this program. If not, see . */ +#include #include #include "retroshare/rsgxschannels.h" @@ -25,7 +26,55 @@ struct DeepSearch { //DeepSearch(const std::string& dbPath) : mDbPath(dbPath) {} - static void search(/*query*/) { /*return all matching results*/ } + struct SearchResult + { + // TODO: Use RsUrl from extra_locators branch instead of plain string + std::string mUrl; + std::string mSnippet; + }; + + /** + * @return search results count + */ + static uint32_t search( const std::string& queryStr, + std::vector& results, + uint32_t maxResults = 100 ) + { + results.clear(); + + // Open the database we're going to search. + Xapian::Database db(mDbPath); + + // Set up a QueryParser with a stemmer and suitable prefixes. + Xapian::QueryParser queryparser; + //queryparser.set_stemmer(Xapian::Stem("en")); + queryparser.set_stemming_strategy(queryparser.STEM_SOME); + // Start of prefix configuration. + //queryparser.add_prefix("title", "S"); + //queryparser.add_prefix("description", "XD"); + // End of prefix configuration. + + // And parse the query. + Xapian::Query query = queryparser.parse_query(queryStr); + + // Use an Enquire object on the database to run the query. + Xapian::Enquire enquire(db); + enquire.set_query(query); + + Xapian::MSet mset = enquire.get_mset(0, maxResults); + + for ( Xapian::MSetIterator m = mset.begin(); m != mset.end(); ++m ) + { + const Xapian::Document& doc = m.get_document(); + + SearchResult s; + s.mUrl = doc.get_value(URL_VALUENO); + s.mSnippet = mset.snippet(doc.get_data()); + results.push_back(s); + } + + return results.size(); + } static void indexChannelGroup(const RsGxsChannelGroup& chan) @@ -49,18 +98,26 @@ struct DeepSearch termgenerator.increase_termpos(); termgenerator.index_text(chan.mDescription); + std::string rsLink("retroshare://channel?id="); + rsLink += chan.mMeta.mGroupId.toStdString(); + + // store the RS link so we are able to retrive it on matching search + doc.add_value(URL_VALUENO, rsLink); + + // Store some fields for display purposes. + doc.set_data(chan.mMeta.mGroupName + "\n" + chan.mDescription); + // We use the identifier to ensure each object ends up in the // database only once no matter how many times we run the - // indexer. - std::string idTerm("Qretroshare://channel?id="); - idTerm += chan.mMeta.mGroupId.toStdString(); - + // indexer. "Q" prefix is a Xapian convention for unique id term. + const std::string idTerm("Q" + rsLink); doc.add_boolean_term(idTerm); db.replace_document(idTerm, doc); } static void removeChannelFromIndex(RsGxsGroupId grpId) { + // "Q" prefix is a Xapian convention for unique id term. std::string idTerm("Qretroshare://channel?id="); idTerm += grpId.toStdString(); @@ -100,6 +157,17 @@ struct DeepSearch db.replace_document(idTerm, doc); } +private: + + enum : Xapian::valueno + { + /// Used to store retroshare url of indexed documents + URL_VALUENO, + + /// @see Xapian::BAD_VALUENO + BAD_VALUENO = Xapian::BAD_VALUENO + }; + static std::string mDbPath; }; diff --git a/libretroshare/src/gxs/rsgxsutil.cc b/libretroshare/src/gxs/rsgxsutil.cc index 5e3ed9b83..2011ff8d9 100644 --- a/libretroshare/src/gxs/rsgxsutil.cc +++ b/libretroshare/src/gxs/rsgxsutil.cc @@ -4,6 +4,7 @@ * RetroShare C++ Interface. Generic routines that are useful in GXS * * Copyright 2013-2013 by Christopher Evi-Parker + * Copyright (C) 2018 Gioacchino Mazzurco * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -165,8 +166,6 @@ bool RsGxsIntegrityCheck::check() { #ifdef RS_DEEP_SEARCH bool isGxsChannels = dynamic_cast(mGenExchangeClient); - std::cout << __PRETTY_FUNCTION__ << " isGxsChannels: " << isGxsChannels - << std::endl; #endif // first take out all the groups @@ -220,21 +219,17 @@ bool RsGxsIntegrityCheck::check() cg.mMeta = meta; DeepSearch::indexChannelGroup(cg); - - std::cout << __PRETTY_FUNCTION__ << " ||Channel: " - << meta.mGroupName << " ||Description: " - << cg.mDescription << std::endl; } else - std::cout << __PRETTY_FUNCTION__ << " ||Group: " + { + std::cerr << __PRETTY_FUNCTION__ << " Group: " + << meta.mGroupId.toStdString() << " " << meta.mGroupName - << " ||doesn't seems a channel" - << " ||grp->grp.bin_data: " - << grp->grp.bin_data - << " ||grp->grp.bin_len: " - << grp->grp.bin_len - << " ||rIt: " << rIt << " ||blz: " << blz - << " ||cgIt: " << cgIt << std::endl; + << " doesn't seems a channel, please " + << "report to developers" + << std::endl; + print_stacktrace(); + } delete rIt; } diff --git a/libretroshare/src/gxs/rsgxsutil.h b/libretroshare/src/gxs/rsgxsutil.h index faea08040..694f22116 100644 --- a/libretroshare/src/gxs/rsgxsutil.h +++ b/libretroshare/src/gxs/rsgxsutil.h @@ -4,6 +4,7 @@ * RetroShare C++ Interface. Generic routines that are useful in GXS * * Copyright 2013-2013 by Christopher Evi-Parker + * Copyright (C) 2018 Gioacchino Mazzurco * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public From 5a41b3cb3762450d27dd44d9ba8a754e613ee880 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Mon, 11 Jun 2018 13:03:01 +0200 Subject: [PATCH 100/138] Index only public channels --- libretroshare/src/gxs/rsgxsutil.cc | 70 +++++++++++---------- libretroshare/src/retroshare/rsgxscircles.h | 7 +-- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsutil.cc b/libretroshare/src/gxs/rsgxsutil.cc index 2011ff8d9..60106b411 100644 --- a/libretroshare/src/gxs/rsgxsutil.cc +++ b/libretroshare/src/gxs/rsgxsutil.cc @@ -201,40 +201,6 @@ bool RsGxsIntegrityCheck::check() { subscribed_groups.insert(git->first); -#ifdef RS_DEEP_SEARCH - if(isGxsChannels) - { - RsGxsGrpMetaData meta; - meta.deserialise(grp->meta.bin_data, grp->meta.bin_len); - - uint32_t blz = grp->grp.bin_len; - RsItem* rIt = mSerializer.deserialise(grp->grp.bin_data, - &blz); - - if( RsGxsChannelGroupItem* cgIt = - dynamic_cast(rIt) ) - { - RsGxsChannelGroup cg; - cgIt->toChannelGroup(cg, false); - cg.mMeta = meta; - - DeepSearch::indexChannelGroup(cg); - } - else - { - std::cerr << __PRETTY_FUNCTION__ << " Group: " - << meta.mGroupId.toStdString() << " " - << meta.mGroupName - << " doesn't seems a channel, please " - << "report to developers" - << std::endl; - print_stacktrace(); - } - - delete rIt; - } -#endif - if(!grp->metaData->mAuthorId.isNull()) { #ifdef DEBUG_GXSUTIL @@ -246,6 +212,42 @@ bool RsGxsIntegrityCheck::check() } } else msgIds.erase(msgIds.find(grp->grpId)); + +#ifdef RS_DEEP_SEARCH + if( isGxsChannels + && grp->metaData->mCircleType == GXS_CIRCLE_TYPE_PUBLIC + && grp->metaData->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED ) + { + RsGxsGrpMetaData meta; + meta.deserialise(grp->meta.bin_data, grp->meta.bin_len); + + uint32_t blz = grp->grp.bin_len; + RsItem* rIt = mSerializer.deserialise(grp->grp.bin_data, + &blz); + + if( RsGxsChannelGroupItem* cgIt = + dynamic_cast(rIt) ) + { + RsGxsChannelGroup cg; + cgIt->toChannelGroup(cg, false); + cg.mMeta = meta; + + DeepSearch::indexChannelGroup(cg); + } + else + { + std::cerr << __PRETTY_FUNCTION__ << " Group: " + << meta.mGroupId.toStdString() << " " + << meta.mGroupName + << " doesn't seems a channel, please " + << "report to developers" + << std::endl; + print_stacktrace(); + } + + delete rIt; + } +#endif } else { diff --git a/libretroshare/src/retroshare/rsgxscircles.h b/libretroshare/src/retroshare/rsgxscircles.h index 8ce446200..6d93507e8 100644 --- a/libretroshare/src/retroshare/rsgxscircles.h +++ b/libretroshare/src/retroshare/rsgxscircles.h @@ -49,10 +49,9 @@ extern RsGxsCircles *rsGxsCircles; typedef RsPgpId RsPgpId; -// The meaning of the different circle types is: -// -// -static const uint32_t GXS_CIRCLE_TYPE_UNKNOWN = 0x0000 ; // not known. Is treated as public. +/// The meaning of the different circle types is: +/// TODO: convert to enum +static const uint32_t GXS_CIRCLE_TYPE_UNKNOWN = 0x0000 ; /// Used to detect uninizialized values. static const uint32_t GXS_CIRCLE_TYPE_PUBLIC = 0x0001 ; // not restricted to a circle static const uint32_t GXS_CIRCLE_TYPE_EXTERNAL = 0x0002 ; // restricted to an external circle, made of RsGxsId static const uint32_t GXS_CIRCLE_TYPE_YOUR_FRIENDS_ONLY = 0x0003 ; // restricted to a subset of friend nodes of a given RS node given by a RsPgpId list From 32014eaac1cb0496195956b3305cdc12a4833245 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Tue, 12 Jun 2018 14:12:08 +0200 Subject: [PATCH 101/138] Use proper path for DeepSearch xapian DB --- libretroshare/src/deep_search/deep_search.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libretroshare/src/deep_search/deep_search.h b/libretroshare/src/deep_search/deep_search.h index ae5a97f2e..3d916a62a 100644 --- a/libretroshare/src/deep_search/deep_search.h +++ b/libretroshare/src/deep_search/deep_search.h @@ -21,11 +21,10 @@ #include #include "retroshare/rsgxschannels.h" +#include "retroshare/rsinit.h" struct DeepSearch { - //DeepSearch(const std::string& dbPath) : mDbPath(dbPath) {} - struct SearchResult { // TODO: Use RsUrl from extra_locators branch instead of plain string @@ -43,7 +42,7 @@ struct DeepSearch results.clear(); // Open the database we're going to search. - Xapian::Database db(mDbPath); + Xapian::Database db(dbPath()); // Set up a QueryParser with a stemmer and suitable prefixes. Xapian::QueryParser queryparser; @@ -79,7 +78,7 @@ struct DeepSearch static void indexChannelGroup(const RsGxsChannelGroup& chan) { - Xapian::WritableDatabase db(mDbPath, Xapian::DB_CREATE_OR_OPEN); + Xapian::WritableDatabase db(dbPath(), Xapian::DB_CREATE_OR_OPEN); // Set up a TermGenerator that we'll use in indexing. Xapian::TermGenerator termgenerator; @@ -121,13 +120,13 @@ struct DeepSearch std::string idTerm("Qretroshare://channel?id="); idTerm += grpId.toStdString(); - Xapian::WritableDatabase db(mDbPath, Xapian::DB_CREATE_OR_OPEN); + Xapian::WritableDatabase db(dbPath(), Xapian::DB_CREATE_OR_OPEN); db.delete_document(idTerm); } static void indexChannelPost(const RsGxsChannelPost& post) { - Xapian::WritableDatabase db(mDbPath, Xapian::DB_CREATE_OR_OPEN); + Xapian::WritableDatabase db(dbPath(), Xapian::DB_CREATE_OR_OPEN); // Set up a TermGenerator that we'll use in indexing. Xapian::TermGenerator termgenerator; @@ -168,7 +167,11 @@ private: BAD_VALUENO = Xapian::BAD_VALUENO }; - static std::string mDbPath; + static const std::string& dbPath() + { + static const std::string dbDir = + RsAccounts::AccountDirectory() + "/deep_search_xapian_db"; + return dbDir; + } }; -std::string DeepSearch::mDbPath = "/tmp/deep_search_xapian_db"; From 5925aa06fed41e770630811dd4d5d021882b7ae7 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Mon, 2 Jul 2018 21:22:22 +0900 Subject: [PATCH 102/138] gui: anchor not only first word of nickname, if any --- .../src/gui/common/RSTextBrowser.cpp | 55 +++++++++++++++---- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/retroshare-gui/src/gui/common/RSTextBrowser.cpp b/retroshare-gui/src/gui/common/RSTextBrowser.cpp index 03fbfe3de..8c59c815c 100644 --- a/retroshare-gui/src/gui/common/RSTextBrowser.cpp +++ b/retroshare-gui/src/gui/common/RSTextBrowser.cpp @@ -251,22 +251,53 @@ bool RSTextBrowser::checkImage(QPoint pos, QString &imageStr) */ QString RSTextBrowser::anchorForPosition(const QPoint &pos) const { + // Many calls when time label shows up QTextCursor cursor = cursorForPosition(pos); cursor.select(QTextCursor::WordUnderCursor); + QString word = cursor.selectedText(); QString anchor = ""; - if (!cursor.selectedText().isEmpty()){ - QRegExp rx(" Date: Wed, 4 Jul 2018 00:19:36 +0900 Subject: [PATCH 103/138] gui: disable quote option if no text is selected in chat --- retroshare-gui/src/gui/chat/ChatWidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 3ed194789..48e4b63a6 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -1096,6 +1096,10 @@ void ChatWidget::contextMenuTextBrowser(QPoint point) contextMnu->addSeparator(); contextMnu->addAction(ui->actionClearChatHistory); contextMnu->addAction(ui->actionQuote); + if (ui->textBrowser->textCursor().selection().toPlainText().length() == 0) + ui->actionQuote->setEnabled(false); + else + ui->actionQuote->setEnabled(true); contextMnu->addAction(ui->actionDropPlacemark); if(ui->textBrowser->checkImage(point)) From 77c3eae976f9733906729b48c7dade17b617c7ca Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Wed, 4 Jul 2018 00:34:45 +0900 Subject: [PATCH 104/138] gui: check for show "is typing" before time call --- retroshare-gui/src/gui/chat/ChatWidget.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 48e4b63a6..674204d16 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -110,7 +110,7 @@ ChatWidget::ChatWidget(QWidget *parent) : ui->searchButton->setIconSize(iconSize); ui->sendButton->setFixedHeight(iconHeight); ui->sendButton->setIconSize(iconSize); - + //Initialize search iCharToStartSearch=Settings->getChatSearchCharToStartSearch(); bFindCaseSensitively=Settings->getChatSearchCaseSensitively(); @@ -177,7 +177,7 @@ ChatWidget::ChatWidget(QWidget *parent) : ui->infoFrame->setVisible(false); ui->statusMessageLabel->hide(); - + setAcceptDrops(true); ui->chatTextEdit->setAcceptDrops(false); ui->hashBox->setDropWidget(this); @@ -197,7 +197,7 @@ ChatWidget::ChatWidget(QWidget *parent) : menu->addAction(ui->actionMessageHistory); ui->pushtoolsButton->setMenu(menu); menu->addMenu(fontmenu); - + ui->actionSendAsPlainText->setChecked(Settings->getChatSendAsPlainTextByDef()); ui->chatTextEdit->setOnlyPlainText(ui->actionSendAsPlainText->isChecked()); connect(ui->actionSendAsPlainText, SIGNAL(toggled(bool)), ui->chatTextEdit, SLOT(setOnlyPlainText(bool)) ); @@ -357,12 +357,12 @@ void ChatWidget::init(const ChatId &chat_id, const QString &title) ui->titleBarFrame->setVisible(false); } - if (rsHistory->getEnable(hist_chat_type)) + if (rsHistory->getEnable(hist_chat_type)) { // get chat messages from history std::list historyMsgs; - if (messageCount > 0) + if (messageCount > 0) { rsHistory->getMessages(chatId, historyMsgs, messageCount); @@ -376,7 +376,7 @@ void ChatWidget::init(const ChatId &chat_id, const QString &title) continue; QString name; - if (chatId.isLobbyId() || chatId.isDistantChatId()) + if (chatId.isLobbyId() || chatId.isDistantChatId()) { RsIdentityDetails details; if (rsIdentity->getIdDetails(RsGxsId(historyIt->peerName), details)) @@ -962,7 +962,7 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const RsGxsId gx unsigned int formatFlag = 0; bool addDate = false; - if (QDate::currentDate()>lastMsgDate) + if (QDate::currentDate()>lastMsgDate) { addDate=true; } @@ -1165,13 +1165,14 @@ void ChatWidget::resetStatusBar() void ChatWidget::updateStatusTyping() { + if(Settings->getChatDoNotSendIsTyping()) + return; if (time(NULL) - lastStatusSendTime > 5) // limit 'peer is typing' packets to at most every 10 sec { #ifdef ONLY_FOR_LINGUIST tr("is typing..."); #endif - if(!Settings->getChatDoNotSendIsTyping()) - rsMsgs->sendStatusString(chatId, "is typing..."); + rsMsgs->sendStatusString(chatId, "is typing..."); lastStatusSendTime = time(NULL) ; } } @@ -1677,7 +1678,7 @@ void ChatWidget::updateStatus(const QString &peer_id, int status) vpid = chatId.toPeerId(); /* set font size for status */ - if (peer_id.toStdString() == vpid.toStdString()) + if (peer_id.toStdString() == vpid.toStdString()) { // the peers status has changed From d3e5b760a2e8bf663bd002d85e5e52fed2fd46ec Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Wed, 4 Jul 2018 12:08:50 +0200 Subject: [PATCH 105/138] DeepSearch index channels posts too Improve indexing using RsUrl, store some relevant fields in stored url --- libretroshare/src/deep_search/deep_search.h | 87 ++++++++++++--- libretroshare/src/gxs/rsgxsutil.cc | 112 ++++++++++++++------ 2 files changed, 154 insertions(+), 45 deletions(-) diff --git a/libretroshare/src/deep_search/deep_search.h b/libretroshare/src/deep_search/deep_search.h index 3d916a62a..7152e34ce 100644 --- a/libretroshare/src/deep_search/deep_search.h +++ b/libretroshare/src/deep_search/deep_search.h @@ -17,17 +17,18 @@ * along with this program. If not, see . */ +#include #include #include #include "retroshare/rsgxschannels.h" #include "retroshare/rsinit.h" +#include "util/rsurl.h" struct DeepSearch { struct SearchResult { - // TODO: Use RsUrl from extra_locators branch instead of plain string std::string mUrl; std::string mSnippet; }; @@ -90,6 +91,11 @@ struct DeepSearch // Index each field with a suitable prefix. termgenerator.index_text(chan.mMeta.mGroupName, 1, "G"); + + char date[] = "YYYYMMDD\0"; + std::strftime(date, 9, "%Y%m%d", std::gmtime(&chan.mMeta.mPublishTs)); + termgenerator.index_text(date, 1, "D"); + termgenerator.index_text(chan.mDescription, 1, "XD"); // Index fields without prefixes for general search. @@ -97,8 +103,14 @@ struct DeepSearch termgenerator.increase_termpos(); termgenerator.index_text(chan.mDescription); - std::string rsLink("retroshare://channel?id="); - rsLink += chan.mMeta.mGroupId.toStdString(); + RsUrl chanUrl; chanUrl + .setScheme("retroshare").setPath("/channel") + .setQueryKV("id", chan.mMeta.mGroupId.toStdString()); + const std::string idTerm("Q" + chanUrl.toString()); + + chanUrl.setQueryKV("publishDate", date); + chanUrl.setQueryKV("name", chan.mMeta.mGroupName); + std::string rsLink(chanUrl.toString()); // store the RS link so we are able to retrive it on matching search doc.add_value(URL_VALUENO, rsLink); @@ -109,7 +121,6 @@ struct DeepSearch // We use the identifier to ensure each object ends up in the // database only once no matter how many times we run the // indexer. "Q" prefix is a Xapian convention for unique id term. - const std::string idTerm("Q" + rsLink); doc.add_boolean_term(idTerm); db.replace_document(idTerm, doc); } @@ -117,8 +128,10 @@ struct DeepSearch static void removeChannelFromIndex(RsGxsGroupId grpId) { // "Q" prefix is a Xapian convention for unique id term. - std::string idTerm("Qretroshare://channel?id="); - idTerm += grpId.toStdString(); + RsUrl chanUrl; chanUrl + .setScheme("retroshare").setPath("/channel") + .setQueryKV("id", grpId.toStdString()); + std::string idTerm("Q" + chanUrl.toString()); Xapian::WritableDatabase db(dbPath(), Xapian::DB_CREATE_OR_OPEN); db.delete_document(idTerm); @@ -138,24 +151,72 @@ struct DeepSearch // Index each field with a suitable prefix. termgenerator.index_text(post.mMeta.mMsgName, 1, "S"); - termgenerator.index_text(post.mMsg, 1, "XD"); + + char date[] = "YYYYMMDD\0"; + std::strftime(date, 9, "%Y%m%d", std::gmtime(&post.mMeta.mPublishTs)); + termgenerator.index_text(date, 1, "D"); + + // Avoid indexing HTML + bool isPlainMsg = post.mMsg[0] != '<' || post.mMsg[post.mMsg.size() - 1] != '>'; + + if(isPlainMsg) + termgenerator.index_text(post.mMsg, 1, "XD"); // Index fields without prefixes for general search. termgenerator.index_text(post.mMeta.mMsgName); - termgenerator.increase_termpos(); - termgenerator.index_text(post.mMsg); + if(isPlainMsg) + { + termgenerator.increase_termpos(); + termgenerator.index_text(post.mMsg); + } + + for(const RsGxsFile& attachment : post.mFiles) + { + termgenerator.index_text(attachment.mName, 1, "F"); + + termgenerator.increase_termpos(); + termgenerator.index_text(attachment.mName); + } // We use the identifier to ensure each object ends up in the // database only once no matter how many times we run the // indexer. - std::string idTerm("Qretroshare://channel?id="); - idTerm += post.mMeta.mGroupId.toStdString(); - idTerm += "&msgid="; - idTerm += post.mMeta.mMsgId.toStdString(); + RsUrl postUrl; postUrl + .setScheme("retroshare").setPath("/channel") + .setQueryKV("id", post.mMeta.mGroupId.toStdString()) + .setQueryKV("msgid", post.mMeta.mMsgId.toStdString()); + std::string idTerm("Q" + postUrl.toString()); + + postUrl.setQueryKV("publishDate", date); + postUrl.setQueryKV("name", post.mMeta.mMsgName); + std::string rsLink(postUrl.toString()); + + // store the RS link so we are able to retrive it on matching search + doc.add_value(URL_VALUENO, rsLink); + + // Store some fields for display purposes. + if(isPlainMsg) + doc.set_data(post.mMeta.mMsgName + "\n" + post.mMsg); + else doc.set_data(post.mMeta.mMsgName); + doc.add_boolean_term(idTerm); db.replace_document(idTerm, doc); } + static void removeChannelPostFromIndex( + RsGxsGroupId grpId, RsGxsMessageId msgId ) + { + RsUrl postUrl; postUrl + .setScheme("retroshare").setPath("/channel") + .setQueryKV("id", grpId.toStdString()) + .setQueryKV("msgid", msgId.toStdString()); + // "Q" prefix is a Xapian convention for unique id term. + std::string idTerm("Q" + postUrl.toString()); + + Xapian::WritableDatabase db(dbPath(), Xapian::DB_CREATE_OR_OPEN); + db.delete_document(idTerm); + } + private: enum : Xapian::valueno diff --git a/libretroshare/src/gxs/rsgxsutil.cc b/libretroshare/src/gxs/rsgxsutil.cc index 60106b411..75b43da83 100644 --- a/libretroshare/src/gxs/rsgxsutil.cc +++ b/libretroshare/src/gxs/rsgxsutil.cc @@ -166,6 +166,7 @@ bool RsGxsIntegrityCheck::check() { #ifdef RS_DEEP_SEARCH bool isGxsChannels = dynamic_cast(mGenExchangeClient); + std::set indexedGroups; #endif // first take out all the groups @@ -232,6 +233,7 @@ bool RsGxsIntegrityCheck::check() cgIt->toChannelGroup(cg, false); cg.mMeta = meta; + indexedGroups.insert(grp->grpId); DeepSearch::indexChannelGroup(cg); } else @@ -309,53 +311,99 @@ bool RsGxsIntegrityCheck::check() } if (nxsMsgIt == nxsMsgV.end()) - { - msgsToDel[grpId].insert(msgId); + { + msgsToDel[grpId].insert(msgId); +#ifdef RS_DEEP_SEARCH + if(isGxsChannels) + DeepSearch::removeChannelPostFromIndex(grpId, msgId); +#endif } } } - GxsMsgResult::iterator mit = msgs.begin(); + GxsMsgResult::iterator mit = msgs.begin(); + for(; mit != msgs.end(); ++mit) + { + std::vector& msgV = mit->second; + std::vector::iterator vit = msgV.begin(); - for(; mit != msgs.end(); ++mit) - { - std::vector& msgV = mit->second; - std::vector::iterator vit = msgV.begin(); + for(; vit != msgV.end(); ++vit) + { + RsNxsMsg* msg = *vit; + RsFileHash currHash; + pqihash pHash; + pHash.addData(msg->msg.bin_data, msg->msg.bin_len); + pHash.Complete(currHash); - for(; vit != msgV.end(); ++vit) - { - RsNxsMsg* msg = *vit; - RsFileHash currHash; - pqihash pHash; - pHash.addData(msg->msg.bin_data, msg->msg.bin_len); - pHash.Complete(currHash); - - if(msg->metaData == NULL || currHash != msg->metaData->mHash) - { - std::cerr << "(EE) deleting message data with wrong hash or null meta data. meta=" << (void*)msg->metaData << std::endl; - msgsToDel[msg->grpId].insert(msg->msgId); - } - else if(!msg->metaData->mAuthorId.isNull() && subscribed_groups.find(msg->metaData->mGroupId)!=subscribed_groups.end()) - { -#ifdef DEBUG_GXSUTIL - GXSUTIL_DEBUG() << "TimeStamping message authors' key ID " << msg->metaData->mAuthorId << " in message " << msg->msgId << ", group ID " << msg->grpId<< std::endl; + if(msg->metaData == NULL || currHash != msg->metaData->mHash) + { + std::cerr << __PRETTY_FUNCTION__ <<" (EE) deleting message data" + << " with wrong hash or null meta data. meta=" + << (void*)msg->metaData << std::endl; + msgsToDel[msg->grpId].insert(msg->msgId); +#ifdef RS_DEEP_SEARCH + if(isGxsChannels) + DeepSearch::removeChannelPostFromIndex(msg->grpId, msg->msgId); #endif - if(rsReputations!=NULL && rsReputations->overallReputationLevel(msg->metaData->mAuthorId) > RsReputations::REPUTATION_LOCALLY_NEGATIVE) - used_gxs_ids.insert(std::make_pair(msg->metaData->mAuthorId,RsIdentityUsage(mGenExchangeClient->serviceType(),RsIdentityUsage::MESSAGE_AUTHOR_KEEP_ALIVE,msg->metaData->mGroupId,msg->metaData->mMsgId))) ; - } + } + else if (subscribed_groups.count(msg->metaData->mGroupId)) + { +#ifdef RS_DEEP_SEARCH + if( isGxsChannels + && indexedGroups.count(msg->metaData->mGroupId) ) + { + RsGxsMsgMetaData meta; + meta.deserialise(msg->meta.bin_data, &msg->meta.bin_len); + + uint32_t blz = msg->msg.bin_len; + RsItem* rIt = mSerializer.deserialise(msg->msg.bin_data, + &blz); + + if( RsGxsChannelPostItem* cgIt = + dynamic_cast(rIt) ) + { + RsGxsChannelPost cg; + cgIt->toChannelPost(cg, false); + cg.mMeta = meta; + + DeepSearch::indexChannelPost(cg); + } + else if(dynamic_cast(rIt)) {} + else if(dynamic_cast(rIt)) {} + else + { + std::cerr << __PRETTY_FUNCTION__ << " Message: " + << meta.mMsgId.toStdString() + << " in group: " + << meta.mGroupId.toStdString() << " " + << " doesn't seems a channel post, please " + << "report to developers" + << std::endl; + print_stacktrace(); + } + + delete rIt; + } +#endif + + if(!msg->metaData->mAuthorId.isNull()) + { +#ifdef DEBUG_GXSUTIL + GXSUTIL_DEBUG() << "TimeStamping message authors' key ID " << msg->metaData->mAuthorId << " in message " << msg->msgId << ", group ID " << msg->grpId<< std::endl; +#endif + if(rsReputations!=NULL && rsReputations->overallReputationLevel(msg->metaData->mAuthorId) > RsReputations::REPUTATION_LOCALLY_NEGATIVE) + used_gxs_ids.insert(std::make_pair(msg->metaData->mAuthorId,RsIdentityUsage(mGenExchangeClient->serviceType(),RsIdentityUsage::MESSAGE_AUTHOR_KEEP_ALIVE,msg->metaData->mGroupId,msg->metaData->mMsgId))) ; + } + } delete msg; } } -#ifdef RS_DEEP_SEARCH - // TODO:remove msgsToDel from deep search index too -#endif - mDs->removeMsgs(msgsToDel); { - RsStackMutex stack(mIntegrityMutex); + RS_STACK_MUTEX(mIntegrityMutex); std::vector::iterator grpIt; for(grpIt = grpsToDel.begin(); grpIt != grpsToDel.end(); ++grpIt) From b3fb7abf9925634b7f565668f0eeeef32625937a Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Wed, 4 Jul 2018 22:46:01 +0900 Subject: [PATCH 106/138] gui: reduce size of icons in chat for font.height lesser than 26 --- .../src/gui/chat/ChatLobbyDialog.cpp | 24 +++++++++++-------- retroshare-gui/src/gui/chat/ChatWidget.cpp | 20 +++++++++++----- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 1f7b20ac6..35a6f0f54 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -80,7 +80,7 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi connect(ui.filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString))); - int S = QFontMetricsF(font()).height() ; + int S = QFontMetricsF(font()).height() ; ui.participantsList->setIconSize(QSize(1.4*S,1.4*S)); ui.participantsList->setColumnCount(COLUMN_COUNT); @@ -128,23 +128,27 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi QString headerText = headerItem->text(COLUMN_NAME ); ui.filterLineEdit->addFilter(QIcon(), headerText, COLUMN_NAME , QString("%1 %2").arg(tr("Search"), headerText)); + // just empiric values + double scaler_factor = S > 25 ? 2.4 : 1.8; + QSize icon_size(scaler_factor * S, scaler_factor * S); + // Add a button to invite friends. // inviteFriendsButton = new QToolButton ; - inviteFriendsButton->setMinimumSize(QSize(2.4*S,2.4*S)) ; - inviteFriendsButton->setMaximumSize(QSize(2.4*S,2.4*S)) ; + inviteFriendsButton->setMinimumSize(icon_size); + inviteFriendsButton->setMaximumSize(icon_size); inviteFriendsButton->setText(QString()) ; inviteFriendsButton->setAutoRaise(true) ; inviteFriendsButton->setToolTip(tr("Invite friends to this lobby")); - mParticipantCompareRole = new RSTreeWidgetItemCompareRole; - mParticipantCompareRole->setRole(COLUMN_ACTIVITY, ROLE_SORT); + mParticipantCompareRole = new RSTreeWidgetItemCompareRole; + mParticipantCompareRole->setRole(COLUMN_ACTIVITY, ROLE_SORT); { QIcon icon ; icon.addPixmap(QPixmap(":/icons/png/invite.png")) ; inviteFriendsButton->setIcon(icon) ; - inviteFriendsButton->setIconSize(QSize(2.4*S,2.4*S)) ; + inviteFriendsButton->setIconSize(icon_size); } connect(inviteFriendsButton, SIGNAL(clicked()), this , SLOT(inviteFriends())); @@ -175,9 +179,9 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi connect(ownIdChooser,SIGNAL(currentIndexChanged(int)),this,SLOT(changeNickname())) ; - unsubscribeButton = new QToolButton ; - unsubscribeButton->setMinimumSize(QSize(2.4*S,2.4*S)) ; - unsubscribeButton->setMaximumSize(QSize(2.4*S,2.4*S)) ; + unsubscribeButton = new QToolButton; + unsubscribeButton->setMinimumSize(icon_size); + unsubscribeButton->setMaximumSize(icon_size); unsubscribeButton->setText(QString()) ; unsubscribeButton->setAutoRaise(true) ; unsubscribeButton->setToolTip(tr("Leave this chat room (Unsubscribe)")); @@ -186,7 +190,7 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi QIcon icon ; icon.addPixmap(QPixmap(":/icons/png/leave.png")) ; unsubscribeButton->setIcon(icon) ; - unsubscribeButton->setIconSize(QSize(2.4*S,2.4*S)) ; + unsubscribeButton->setIconSize(icon_size); } /* Initialize splitter */ diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 674204d16..016d87d49 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -65,6 +65,8 @@ #include #define FMM 2.5//fontMetricsMultiplicator +#define FMM_SMALLER 1.8 +#define FMM_THRESHOLD 25 /***** * #define CHAT_DEBUG 1 @@ -75,9 +77,12 @@ ChatWidget::ChatWidget(QWidget *parent) : { ui->setupUi(this); - int iconHeight = FMM*QFontMetricsF(font()).height() ; - QSize iconSize = QSize(iconHeight,iconHeight); - QSize buttonSize = QSize(iconSize + QSize((int)FMM,(int)FMM)); + int iconHeight = QFontMetricsF(font()).height(); + double fmm = iconHeight > FMM_THRESHOLD ? FMM : FMM_SMALLER; + iconHeight *= fmm; + QSize iconSize = QSize(iconHeight, iconHeight); + int butt_size(iconSize.height() + fmm); + QSize buttonSize = QSize(butt_size, butt_size); newMessages = false; typing = false; @@ -259,9 +264,12 @@ void ChatWidget::addChatHorizontalWidget(QWidget *w) void ChatWidget::addChatBarWidget(QWidget *w) { - int iconHeight = FMM*QFontMetricsF(font()).height() ; - QSize iconSize = QSize(iconHeight,iconHeight); - QSize buttonSize = QSize(iconSize + QSize((int)FMM,(int)FMM)); + int iconHeight = QFontMetricsF(font()).height(); + double fmm = iconHeight > FMM_THRESHOLD ? FMM : FMM_SMALLER; + iconHeight *= fmm; + QSize iconSize = QSize(iconHeight, iconHeight); + int butt_size(iconSize.height() + fmm); + QSize buttonSize = QSize(butt_size, butt_size); w->setFixedSize(buttonSize); ui->pluginButtonFrame->layout()->addWidget(w) ; } From 74075fddedc70e6fe3c83be72ca22df82afded69 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Wed, 4 Jul 2018 23:18:21 +0900 Subject: [PATCH 107/138] gui: do not show the quote section of context menu in chat if no text selected --- retroshare-gui/src/gui/chat/ChatWidget.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 016d87d49..f35c0425d 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -1103,11 +1103,8 @@ void ChatWidget::contextMenuTextBrowser(QPoint point) contextMnu->addSeparator(); contextMnu->addAction(ui->actionClearChatHistory); - contextMnu->addAction(ui->actionQuote); - if (ui->textBrowser->textCursor().selection().toPlainText().length() == 0) - ui->actionQuote->setEnabled(false); - else - ui->actionQuote->setEnabled(true); + if (ui->textBrowser->textCursor().selection().toPlainText().length()) + contextMnu->addAction(ui->actionQuote); contextMnu->addAction(ui->actionDropPlacemark); if(ui->textBrowser->checkImage(point)) @@ -1829,13 +1826,10 @@ bool ChatWidget::setStyle() void ChatWidget::quote() { QString text = ui->textBrowser->textCursor().selection().toPlainText(); - if(text.length() > 0) - { - QStringList sl = text.split(QRegExp("[\r\n]"),QString::SkipEmptyParts); - text = sl.join("\n> "); - text.replace(QChar(-4)," ");//Char used when image on text. - emit ui->chatTextEdit->append(QString("> ") + text); - } + QStringList sl = text.split(QRegExp("[\r\n]"), QString::SkipEmptyParts); + text = sl.join("\n> "); + text.replace(QChar(-4), " "); // Char used when image on text. + emit ui->chatTextEdit->append(QString("> ") + text); } void ChatWidget::dropPlacemark() From 8ad454723a37fa7a551195d64f312cad903284ac Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 4 Jul 2018 21:42:09 +0200 Subject: [PATCH 108/138] added group data request when search items are selected --- libretroshare/src/gxs/rsgxsnetservice.cc | 24 ++++++++++++++++++- libretroshare/src/gxs/rsgxsnetservice.h | 9 +++++++ .../src/gui/gxs/GxsGroupFrameDialog.cpp | 3 +++ .../src/gui/gxs/GxsGroupFrameDialog.h | 1 + .../src/gui/gxschannels/GxsChannelDialog.cpp | 11 +++++++++ .../src/gui/gxschannels/GxsChannelDialog.h | 2 ++ 6 files changed, 49 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 13d2341be..e58a7c52e 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -304,6 +304,7 @@ static const uint32_t REJECTED_MESSAGE_RETRY_DELAY = 24*3600; // static const uint32_t GROUP_STATS_UPDATE_DELAY = 240; // update unsubscribed group statistics every 3 mins static const uint32_t GROUP_STATS_UPDATE_NB_PEERS = 2; // number of peers to which the group stats are asked static const uint32_t MAX_ALLOWED_GXS_MESSAGE_SIZE = 199000; // 200,000 bytes including signature and headers +static const uint32_t MIN_DELAY_BETWEEN_GROUP_SEARCH = 40; // dont search same group more than every 40 secs. static const uint32_t RS_NXS_ITEM_ENCRYPTION_STATUS_UNKNOWN = 0x00 ; static const uint32_t RS_NXS_ITEM_ENCRYPTION_STATUS_NO_ERROR = 0x01 ; @@ -380,6 +381,8 @@ RsGxsNetService::RsGxsNetService(uint16_t servType, RsGeneralDataService *gds, mOwnId = mNetMgr->getOwnId(); mUpdateCounter = 0; + mLastCacheReloadTS = 0; + // check the consistency if(mDefaultMsgStorePeriod > 0 && mDefaultMsgSyncPeriod > mDefaultMsgStorePeriod) @@ -5106,7 +5109,25 @@ bool RsGxsNetService::locked_stampMsgServerUpdateTS(const RsGxsGroupId& gid) TurtleRequestId RsGxsNetService::turtleGroupRequest(const RsGxsGroupId& group_id) { + time_t now = time(NULL); + auto it = mSearchedGroups.find(group_id) ; + + if(mSearchedGroups.end() != it && (it->second.ts + MIN_DELAY_BETWEEN_GROUP_SEARCH > now)) + { + std::cerr << "(WW) Last turtle request was " << now - it->second.ts << " secs ago. Not searching again." << std::endl; + return it->second.request_id; + } + +#ifdef NXS_NET_DEBUG_8 + GXSNETDEBUG__G(group_id) << " requesting group id " << group_id << " using turtle" << std::endl; +#endif TurtleRequestId req = mGxsNetTunnel->turtleGroupRequest(group_id,this) ; + + GroupRequestRecord& rec(mSearchedGroups[group_id]) ; + + rec.request_id = req; + rec.ts = now; + mSearchRequests[req] = group_id; return req; @@ -5302,7 +5323,7 @@ bool RsGxsNetService::search(const Sha1CheckSum& hashed_group_id,unsigned char * { // Now check if the last request was too close in time, in which case, we dont retrieve data. - if(mLastCacheReloadTS + 60 < time(NULL)) + if(mLastCacheReloadTS + 60 > time(NULL)) { std::cerr << "(WW) Not found in cache, and last cache reload less than 60 secs ago. Returning false. " << std::endl; return false ; @@ -5315,6 +5336,7 @@ bool RsGxsNetService::search(const Sha1CheckSum& hashed_group_id,unsigned char * { RS_STACK_MUTEX(mNxsMutex) ; mDataStore->retrieveNxsGrps(grpDataMap, true, true); + mLastCacheReloadTS = time(NULL); } for(auto it(grpDataMap.begin());it!=grpDataMap.end();++it) diff --git a/libretroshare/src/gxs/rsgxsnetservice.h b/libretroshare/src/gxs/rsgxsnetservice.h index 9ab18b4d5..295397ae2 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.h +++ b/libretroshare/src/gxs/rsgxsnetservice.h @@ -59,6 +59,14 @@ class RsGroupNetworkStatsRecord time_t update_TS ; }; +struct GroupRequestRecord +{ + GroupRequestRecord(): ts(0), request_id(0) {} + + time_t ts ; + TurtleRequestId request_id; +}; + /*! * This class implements the RsNetWorkExchangeService * using transactions to handle synchrnisation of Nxs items between @@ -615,6 +623,7 @@ private: std::map mGroupHashCache; std::map mSearchRequests; + std::map mSearchedGroups ; time_t mLastCacheReloadTS ; }; diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 1f2d2fc00..2ac49df42 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -767,6 +767,9 @@ void GxsGroupFrameDialog::changedCurrentGroup(const QString &groupId) return; } + // send a request for the group, if it has been distant-searched. + checkRequestGroup(mGroupId) ; + /* search exisiting tab */ GxsMessageFrameWidget *msgWidget = messageWidget(mGroupId, true); diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index bcfbabe78..7908f8b5b 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -95,6 +95,7 @@ protected: virtual RetroShareLink::enumType getLinkType() = 0; virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Nothing; } virtual void groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo, const RsUserdata *userdata); + virtual void checkRequestGroup(const RsGxsGroupId& grpId) {} private slots: void todo(); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp index 160119ee2..f839a0a3f 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp @@ -346,3 +346,14 @@ bool GxsChannelDialog::getDistantSearchResults(TurtleRequestId id, std::mapretrieveDistantSearchResults(id,group_infos); } + +void GxsChannelDialog::checkRequestGroup(const RsGxsGroupId& grpId) +{ + RsGxsChannelGroup distant_group; + + if( rsGxsChannels->retrieveDistantGroup(grpId,distant_group)) // normally we should also check that the group meta is not already here. + { + std::cerr << "GxsChannelDialog::checkRequestGroup() sending turtle request for group data for group " << grpId << std::endl; + rsGxsChannels->turtleGroupRequest(grpId); + } +} diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h index 38b27d805..43a81aca5 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h @@ -53,6 +53,8 @@ protected: virtual bool getDistantSearchResults(TurtleRequestId id, std::map& group_infos); virtual TurtleRequestId distantSearch(const QString& search_string) ; + virtual void checkRequestGroup(const RsGxsGroupId& grpId) ; + private slots: void toggleAutoDownload(); void setDefaultDirectory(); From 2067b106e4b29fd23f6cc0eebcfb2f85c4b76041 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 4 Jul 2018 23:54:26 +0200 Subject: [PATCH 109/138] fixed missing code in passing turtle group data result to client service --- libretroshare/src/gxs/rsgxsnetservice.cc | 1 + libretroshare/src/gxs/rsgxsnettunnel.cc | 62 +++++++++++++------ libretroshare/src/gxs/rsnxs.h | 8 +++ .../src/gui/gxs/GxsGroupFrameDialog.h | 4 +- 4 files changed, 55 insertions(+), 20 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index e58a7c52e..054795873 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -5349,6 +5349,7 @@ bool RsGxsNetService::search(const Sha1CheckSum& hashed_group_id,unsigned char * Sha1CheckSum hash(RsDirUtil::sha1sum(it->first.toByteArray(),it->first.SIZE_IN_BYTES)); mGroupHashCache[hash] = grp ; + it->second = NULL ; // prevents deletion if(hash == hashed_group_id) grp_data = grp ; diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index b6bf3c15a..86bee73e7 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -1064,7 +1064,7 @@ bool RsGxsNetTunnelService::receiveSearchRequest(unsigned char *search_request_d { RsGxsNetTunnelTurtleSearchGroupDataItem search_result_item ; - search_result_item.service = substring_sr->service ; + search_result_item.service = substring_gr->service ; search_result_item.encrypted_group_data = encrypted_group_data ; search_result_item.encrypted_group_data_len = encrypted_group_data_len; @@ -1091,26 +1091,52 @@ void RsGxsNetTunnelService::receiveSearchResult(TurtleSearchRequestId request_id RsGxsNetTunnelTurtleSearchGroupSummaryItem *result_gs = dynamic_cast(item) ; - if(result_gs == NULL) + if(result_gs != NULL) + { + GXS_NET_TUNNEL_DEBUG() << " : result is of type group summary result for service " << result_gs->service << std::dec << ": " << std::endl; + + for(auto it(result_gs->group_infos.begin());it!=result_gs->group_infos.end();++it) + std::cerr << " group " << (*it).group_id << ": " << (*it).group_name << ", " << (*it).number_of_messages << " messages, last is " << time(NULL)-(*it).last_message_ts << " secs ago." << std::endl; + + auto it = mSearchableServices.find(result_gs->service) ; + + if(it == mSearchableServices.end()) + { + GXS_NET_TUNNEL_ERROR() << ": deserialized item is for service " << std::hex << result_gs->service << std::dec << " that is not in the searchable services list." << std::endl; + delete item; + return ; + } + + it->second->receiveTurtleSearchResults(request_id,result_gs->group_infos) ; + + delete item; + return ; + } + + RsGxsNetTunnelTurtleSearchGroupDataItem *result_gd = dynamic_cast(item) ; + + if(result_gd != NULL) { - GXS_NET_TUNNEL_ERROR() << ": deserialized item is not a GroupSummary Item. Smething's wrong here." << std::endl; - return ; + GXS_NET_TUNNEL_DEBUG() << " : result is of type group data for service " << result_gd->service << std::dec << ": " << std::endl; + + auto it = mSearchableServices.find(result_gd->service) ; + + if(it == mSearchableServices.end()) + { + GXS_NET_TUNNEL_ERROR() << ": deserialized item is for service " << std::hex << result_gd->service << std::dec << " that is not in the searchable services list." << std::endl; + delete item; + return ; + } + + it->second->receiveTurtleSearchResults(request_id,result_gd->encrypted_group_data,result_gd->encrypted_group_data_len) ; + + result_gd->encrypted_group_data = NULL ; // prevents deletion + delete item; + + return ; } - GXS_NET_TUNNEL_DEBUG() << " : result is of type group summary result for service " << result_gs->service << std::dec << ": " << std::endl; - - for(auto it(result_gs->group_infos.begin());it!=result_gs->group_infos.end();++it) - std::cerr << " group " << (*it).group_id << ": " << (*it).group_name << ", " << (*it).number_of_messages << " messages, last is " << time(NULL)-(*it).last_message_ts << " secs ago." << std::endl; - - auto it = mSearchableServices.find(result_gs->service) ; - - if(it == mSearchableServices.end()) - { - GXS_NET_TUNNEL_ERROR() << ": deserialized item is for service " << std::hex << result_gs->service << std::dec << " that is in the searchable services list." << std::endl; - return ; - } - - it->second->receiveTurtleSearchResults(request_id,result_gs->group_infos) ; + GXS_NET_TUNNEL_ERROR() << ": deserialized item is of unknown type. Dropping!" << std::endl; } diff --git a/libretroshare/src/gxs/rsnxs.h b/libretroshare/src/gxs/rsnxs.h index 7d617ee30..a6044aa46 100644 --- a/libretroshare/src/gxs/rsnxs.h +++ b/libretroshare/src/gxs/rsnxs.h @@ -114,6 +114,14 @@ public: */ virtual void receiveTurtleSearchResults(TurtleRequestId req,const std::list& group_infos)=0; + /*! + * \brief receiveTurtleSearchResults + * Called by turtle (through RsGxsNetTunnel) when new data is received + * \param req Turtle search request ID associated with this result + * \param encrypted_group_data Group data + */ + virtual void receiveTurtleSearchResults(TurtleRequestId req,const unsigned char *encrypted_group_data,uint32_t encrypted_group_data_len)=0; + /*! * \brief retrieveTurtleSearchResults * To be used to retrieve the search results that have been notified (or not) diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index 7908f8b5b..1dfa8b78e 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -95,7 +95,7 @@ protected: virtual RetroShareLink::enumType getLinkType() = 0; virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Nothing; } virtual void groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo, const RsUserdata *userdata); - virtual void checkRequestGroup(const RsGxsGroupId& grpId) {} + virtual void checkRequestGroup(const RsGxsGroupId& /* grpId */) {} // overload this one in order to retrieve full group data when the group is browsed private slots: void todo(); @@ -149,7 +149,7 @@ private: virtual void groupTreeCustomActions(RsGxsGroupId /*grpId*/, int /*subscribeFlags*/, QList &/*actions*/) {} virtual RsGxsCommentService *getCommentService() { return NULL; } virtual QWidget *createCommentHeaderWidget(const RsGxsGroupId &/*grpId*/, const RsGxsMessageId &/*msgId*/) { return NULL; } - virtual bool getDistantSearchResults(TurtleRequestId id, std::map& group_infos){ return false ;} + virtual bool getDistantSearchResults(TurtleRequestId /* id */, std::map& /* group_infos */){ return false ;} void initUi(); From 47e760a2c522f9508c65175b01bbed0106f05cab Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 5 Jul 2018 10:11:12 +0200 Subject: [PATCH 110/138] added a few missing mutexes in prevent searches to be shown when already known --- libretroshare/src/gxs/rsgxsnetservice.cc | 3 ++ .../gui/FileTransfer/SharedFilesDialog.cpp | 12 ++--- .../src/gui/gxs/GxsGroupFrameDialog.cpp | 45 +++++++++---------- .../src/gui/gxs/GxsGroupFrameDialog.h | 6 +-- 4 files changed, 34 insertions(+), 32 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 054795873..67e031b9e 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -5109,6 +5109,8 @@ bool RsGxsNetService::locked_stampMsgServerUpdateTS(const RsGxsGroupId& gid) TurtleRequestId RsGxsNetService::turtleGroupRequest(const RsGxsGroupId& group_id) { + RS_STACK_MUTEX(mNxsMutex) ; + time_t now = time(NULL); auto it = mSearchedGroups.find(group_id) ; @@ -5157,6 +5159,7 @@ bool RsGxsNetService::retrieveDistantSearchResults(TurtleRequestId req,std::map< } bool RsGxsNetService::retrieveDistantGroupSummary(const RsGxsGroupId& group_id,RsGxsGroupSummary& gs) { + RS_STACK_MUTEX(mNxsMutex) ; for(auto it(mDistantSearchResults.begin());it!=mDistantSearchResults.end();++it) { auto it2 = it->second.find(group_id) ; diff --git a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp index 240839a2e..1cfa95cb6 100644 --- a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp @@ -1140,14 +1140,14 @@ void LocalSharedFilesDialog::spawnCustomPopupMenu( QPoint point ) { shareChannelMenu.setIcon(QIcon(IMAGE_CHANNEL)); - std::list grp_metas ; + std::map grp_metas ; channelDialog->getGroupList(grp_metas) ; std::vector > grplist ; // I dont use a std::map because two or more channels may have the same name. for(auto it(grp_metas.begin());it!=grp_metas.end();++it) - if(IS_GROUP_PUBLISHER((*it).mSubscribeFlags) && IS_GROUP_SUBSCRIBED((*it).mSubscribeFlags)) - grplist.push_back(std::make_pair((*it).mGroupName, (*it).mGroupId)); + if(IS_GROUP_PUBLISHER((*it).second.mSubscribeFlags) && IS_GROUP_SUBSCRIBED((*it).second.mSubscribeFlags)) + grplist.push_back(std::make_pair((*it).second.mGroupName, (*it).second.mGroupId)); std::sort(grplist.begin(),grplist.end(),ChannelCompare()) ; @@ -1164,14 +1164,14 @@ void LocalSharedFilesDialog::spawnCustomPopupMenu( QPoint point ) { shareForumMenu.setIcon(QIcon(IMAGE_FORUMS)); - std::list grp_metas ; + std::map grp_metas ; forumsDialog->getGroupList(grp_metas) ; std::vector > grplist ; // I dont use a std::map because two or more channels may have the same name. for(auto it(grp_metas.begin());it!=grp_metas.end();++it) - if(IS_GROUP_SUBSCRIBED((*it).mSubscribeFlags)) - grplist.push_back(std::make_pair((*it).mGroupName, (*it).mGroupId)); + if(IS_GROUP_SUBSCRIBED((*it).second.mSubscribeFlags)) + grplist.push_back(std::make_pair((*it).second.mGroupName, (*it).second.mGroupId)); std::sort(grplist.begin(),grplist.end(),ChannelCompare()) ; diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 2ac49df42..180ffa231 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -123,7 +123,7 @@ GxsGroupFrameDialog::~GxsGroupFrameDialog() delete(ui); } -void GxsGroupFrameDialog::getGroupList(std::list& group_list) +void GxsGroupFrameDialog::getGroupList(std::map &group_list) { group_list = mCachedGroupMetas ; @@ -265,8 +265,6 @@ void GxsGroupFrameDialog::updateSearchResults() auto it2 = mSearchGroupsItems.find(*it); - std::set& known_groups(mKnownGroups[*it]) ; - if(mSearchGroupsItems.end() == it2) { std::cerr << "GxsGroupFrameDialog::updateSearchResults(): received result notification for req " << std::hex << *it << std::dec << " but no item present!" << std::endl; @@ -276,24 +274,22 @@ void GxsGroupFrameDialog::updateSearchResults() QList group_items ; for(auto it3(group_infos.begin());it3!=group_infos.end();++it3) - if(known_groups.end() == known_groups.find(it3->first)) - { + if(mCachedGroupMetas.find(it3->first) == mCachedGroupMetas.end()) + { std::cerr << " adding new group " << it3->first << " " << it3->second.group_id << " \"" << it3->second.group_name << "\"" << std::endl; - known_groups.insert(it3->first) ; - - GroupItemInfo i ; - i.id = QString(it3->second.group_id.toStdString().c_str()) ; - i.name = QString::fromUtf8(it3->second.group_name.c_str()) ; - i.description = QString::fromUtf8(it3->second.group_description.c_str()) ; - i.popularity = 0; // could be set to the number of hits + GroupItemInfo i ; + i.id = QString(it3->second.group_id.toStdString().c_str()) ; + i.name = QString::fromUtf8(it3->second.group_name.c_str()) ; + i.description = QString::fromUtf8(it3->second.group_description.c_str()) ; + i.popularity = 0; // could be set to the number of hits i.lastpost = QDateTime::fromTime_t(it3->second.last_message_ts); i.subscribeFlags = 0; // irrelevant here i.publishKey = false ; // IS_GROUP_PUBLISHER(groupInfo.mSubscribeFlags) ; i.adminKey = false ; // IS_GROUP_ADMIN(groupInfo.mSubscribeFlags) ; i.max_visible_posts = it3->second.number_of_messages ; - group_items.push_back(i); + group_items.push_back(i); } ui->groupTreeWidget->fillGroupItems(it2->second, group_items); @@ -768,7 +764,9 @@ void GxsGroupFrameDialog::changedCurrentGroup(const QString &groupId) } // send a request for the group, if it has been distant-searched. - checkRequestGroup(mGroupId) ; + + if(mCachedGroupMetas.find(mGroupId) == mCachedGroupMetas.end()) + checkRequestGroup(mGroupId) ; /* search exisiting tab */ GxsMessageFrameWidget *msgWidget = messageWidget(mGroupId, true); @@ -894,7 +892,7 @@ void GxsGroupFrameDialog::groupInfoToGroupItemInfo(const RsGroupMetaData &groupI } } -void GxsGroupFrameDialog::insertGroupsData(const std::list &groupList, const RsUserdata *userdata) +void GxsGroupFrameDialog::insertGroupsData(const std::map &groupList, const RsUserdata *userdata) { if (!mInitialized) { return; @@ -902,20 +900,18 @@ void GxsGroupFrameDialog::insertGroupsData(const std::list &gro mInFill = true; - std::list::const_iterator it; - QList adminList; QList subList; QList popList; QList otherList; std::multimap popMap; - for (it = groupList.begin(); it != groupList.end(); ++it) { + for (auto it = groupList.begin(); it != groupList.end(); ++it) { /* sort it into Publish (Own), Subscribed, Popular and Other */ - uint32_t flags = it->mSubscribeFlags; + uint32_t flags = it->second.mSubscribeFlags; GroupItemInfo groupItemInfo; - groupInfoToGroupItemInfo(*it, groupItemInfo, userdata); + groupInfoToGroupItemInfo(it->second, groupItemInfo, userdata); if (IS_GROUP_SUBSCRIBED(flags)) { @@ -932,7 +928,7 @@ void GxsGroupFrameDialog::insertGroupsData(const std::list &gro else { //popMap.insert(std::make_pair(it->mPop, groupItemInfo)); /* rate the others by popularity */ - popMap.insert(std::make_pair(it->mLastPost, groupItemInfo)); /* rate the others by time of last post */ + popMap.insert(std::make_pair(it->second.mLastPost, groupItemInfo)); /* rate the others by time of last post */ } } @@ -1043,9 +1039,12 @@ void GxsGroupFrameDialog::loadGroupSummary(const uint32_t &token) RsUserdata *userdata = NULL; loadGroupSummaryToken(token, groupInfo, userdata); - mCachedGroupMetas = groupInfo ; + mCachedGroupMetas.clear(); + for(auto it(groupInfo.begin());it!=groupInfo.end();++it) + mCachedGroupMetas[(*it).mGroupId] = *it; - insertGroupsData(groupInfo, userdata); + insertGroupsData(mCachedGroupMetas, userdata); + updateSearchResults(); mStateHelper->setLoading(TOKEN_TYPE_GROUP_SUMMARY, false); diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index 1dfa8b78e..e429d98b2 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -82,7 +82,7 @@ public: virtual QString getHelpString() const =0; - virtual void getGroupList(std::list& groups) ; + virtual void getGroupList(std::map &groups) ; protected: virtual void showEvent(QShowEvent *event); @@ -162,7 +162,7 @@ private: void processSettings(bool load); // New Request/Response Loading Functions. - void insertGroupsData(const std::list &groupList, const RsUserdata *userdata); + void insertGroupsData(const std::map &groupList, const RsUserdata *userdata); void requestGroupSummary(); void loadGroupSummary(const uint32_t &token); @@ -209,7 +209,7 @@ private: /** Qt Designer generated object */ Ui::GxsGroupFrameDialog *ui; - std::list mCachedGroupMetas; + std::map mCachedGroupMetas; std::map mSearchGroupsItems ; std::map > mKnownGroups; From 59c51a250b23d38089fa27658d22c10cabe3da35 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 5 Jul 2018 10:16:48 +0200 Subject: [PATCH 111/138] removed debug switch to allow display of existing distant group search results --- libretroshare/src/gxs/rsgxsnetservice.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 67e031b9e..d8a882945 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -5196,8 +5196,7 @@ void RsGxsNetService::receiveTurtleSearchResults(TurtleRequestId req, const std: // only keep groups that are not locally known, and groups that are not already in the mDistantSearchResults structure for(auto it(group_infos.begin());it!=group_infos.end();++it) -#warning Uncomment when done with testing! -// if(grpMeta[(*it).group_id] == NULL) + if(grpMeta[(*it).group_id] == NULL) { filtered_results.push_back(*it) ; From 0e37de3e1145cc20432eda51516f0b5ed1a4b32d Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 5 Jul 2018 11:43:55 +0200 Subject: [PATCH 112/138] made retrieval of group data manual instead of automatic --- libretroshare/src/gxs/rsgxsnettunnel.cc | 8 ++-- libretroshare/src/turtle/p3turtle.cc | 2 +- .../src/gui/common/GroupTreeWidget.cpp | 17 +++++++++ .../src/gui/common/GroupTreeWidget.h | 1 + .../src/gui/gxs/GxsGroupFrameDialog.cpp | 37 ++++++++++++++++--- .../src/gui/gxs/GxsGroupFrameDialog.h | 1 + 6 files changed, 56 insertions(+), 10 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 86bee73e7..90d73e85a 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -94,7 +94,7 @@ public: RsGxsNetTunnelKeepAliveItem() :RsGxsNetTunnelItem(RS_PKT_SUBTYPE_GXS_NET_TUNNEL_KEEP_ALIVE) {} virtual ~RsGxsNetTunnelKeepAliveItem() {} - virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) {} + virtual void serial_process(RsGenericSerializer::SerializeJob /* j */,RsGenericSerializer::SerializeContext& /* ctx */) {} }; class RsGxsNetTunnelRandomBiasItem: public RsGxsNetTunnelItem @@ -314,7 +314,7 @@ bool RsGxsNetTunnelService::receiveTunnelData(uint16_t service_id, unsigned char return true; } -bool RsGxsNetTunnelService::sendTunnelData(uint16_t service_id,unsigned char *& data,uint32_t data_len,const RsGxsNetTunnelVirtualPeerId& virtual_peer) +bool RsGxsNetTunnelService::sendTunnelData(uint16_t /* service_id */,unsigned char *& data,uint32_t data_len,const RsGxsNetTunnelVirtualPeerId& virtual_peer) { RS_STACK_MUTEX(mGxsNetTunnelMtx); // The item is serialized and encrypted using chacha20+SHA256, using the generic turtle encryption, and then sent to the turtle router. @@ -398,7 +398,7 @@ bool RsGxsNetTunnelService::requestDistantPeers(uint16_t service_id, const RsGxs return true; } -bool RsGxsNetTunnelService::releaseDistantPeers(uint16_t service_id,const RsGxsGroupId& group_id) +bool RsGxsNetTunnelService::releaseDistantPeers(uint16_t /* service_id */,const RsGxsGroupId& group_id) { RS_STACK_MUTEX(mGxsNetTunnelMtx); @@ -492,7 +492,7 @@ void RsGxsNetTunnelService::connectToTurtleRouter(p3turtle *tr) mTurtle->registerTunnelService(this) ; } -bool RsGxsNetTunnelService::handleTunnelRequest(const RsFileHash &hash,const RsPeerId& peer_id) +bool RsGxsNetTunnelService::handleTunnelRequest(const RsFileHash &hash,const RsPeerId& /* peer_id */) { RS_STACK_MUTEX(mGxsNetTunnelMtx); // We simply check for wether a managed group has a hash that corresponds to the given hash. diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 31286de8f..1fe6adfb0 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -1125,7 +1125,7 @@ void p3turtle::handleSearchResult(RsTurtleSearchResultItem *item) // This is an error: how could we receive a search result corresponding to a search item we // have forwarded but that it not in the list ?? - std::cerr << __PRETTY_FUNCTION__ << ": search result has no peer direction!" << std::endl ; + std::cerr << __PRETTY_FUNCTION__ << ": search result for request " << std::hex << item->request_id << std::dec << " has no peer direction!" << std::endl ; return ; } diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index 4a88eee48..d823298d9 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -430,6 +430,23 @@ QTreeWidgetItem *GroupTreeWidget::addSearchItem(const QString& search_string, ui return item; } +bool GroupTreeWidget::isSearchRequestResult(QPoint &point,QString& group_id,uint32_t& search_req_id) +{ + QTreeWidgetItem *item = ui->treeWidget->itemAt(point); + if (item == NULL) + return false; + + QTreeWidgetItem *parent = item->parent(); + + if(parent == NULL) + return false ; + + search_req_id = parent->data(COLUMN_DATA, ROLE_REQUEST_ID).toUInt(); + group_id = itemId(item) ; + + return search_req_id > 0; +} + bool GroupTreeWidget::isSearchRequestItem(QPoint &point,uint32_t& search_req_id) { QTreeWidgetItem *item = ui->treeWidget->itemAt(point); diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.h b/retroshare-gui/src/gui/common/GroupTreeWidget.h index 4ad19f0e1..64506cfb0 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.h +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.h @@ -95,6 +95,7 @@ public: void setUnreadCount(QTreeWidgetItem *item, int unreadCount); bool isSearchRequestItem(QPoint &point,uint32_t& search_req_id); + bool isSearchRequestResult(QPoint &point, QString &group_id, uint32_t& search_req_id); QTreeWidgetItem *getItemFromId(const QString &id); QTreeWidgetItem *activateId(const QString &id, bool focus); diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 180ffa231..a1a66eed2 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -47,6 +47,7 @@ #define IMAGE_SHARE ":/images/share-icon-16.png" #define IMAGE_TABNEW ":/images/tab-new.png" #define IMAGE_DELETE ":/images/delete.png" +#define IMAGE_RETRIEVE ":/images/edit_add24.png" #define IMAGE_COMMENT "" #define TOKEN_TYPE_GROUP_SUMMARY 1 @@ -345,6 +346,19 @@ void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) return ; } + // Then check whether we have a searched item, or a normal group + + QString group_id_s ; + + if(ui->groupTreeWidget->isSearchRequestResult(point,group_id_s,search_request_id)) + { + QMenu contextMnu(this); + + contextMnu.addAction(QIcon(IMAGE_RETRIEVE), tr("Request data"), this, SLOT(distantRequestGroupData()))->setData(group_id_s); + contextMnu.exec(QCursor::pos()); + return ; + } + QString id = ui->groupTreeWidget->itemIdAt(point); if (id.isEmpty()) return; @@ -763,11 +777,6 @@ void GxsGroupFrameDialog::changedCurrentGroup(const QString &groupId) return; } - // send a request for the group, if it has been distant-searched. - - if(mCachedGroupMetas.find(mGroupId) == mCachedGroupMetas.end()) - checkRequestGroup(mGroupId) ; - /* search exisiting tab */ GxsMessageFrameWidget *msgWidget = messageWidget(mGroupId, true); @@ -1198,3 +1207,21 @@ void GxsGroupFrameDialog::searchNetwork(const QString& search_string) mSearchGroupsItems[request_id] = ui->groupTreeWidget->addSearchItem(tr("Search for")+ " \"" + search_string + "\"",(uint32_t)request_id,QIcon(icon(ICON_SEARCH))); } +void GxsGroupFrameDialog::distantRequestGroupData() +{ + QAction *action = dynamic_cast(sender()) ; + + if(!action) + return ; + + RsGxsGroupId group_id(action->data().toString().toStdString()); + + if(group_id.isNull()) + { + std::cerr << "Cannot retrieve group! Group id is null!" << std::endl; + } + + std::cerr << "Explicit request for group " << group_id << std::endl; + checkRequestGroup(group_id) ; +} + diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index e429d98b2..4951caf36 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -108,6 +108,7 @@ private slots: void restoreGroupKeys(); void newGroup(); + void distantRequestGroupData(); void changedCurrentGroup(const QString &groupId); void groupTreeMiddleButtonClicked(QTreeWidgetItem *item); From 0cc87c988046ffc2f947ba3396edaf60add04255 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 5 Jul 2018 12:20:22 +0200 Subject: [PATCH 113/138] fixed bug causing search data result to not be forwarded correctly (missing request id) --- libretroshare/src/turtle/rsturtleitem.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libretroshare/src/turtle/rsturtleitem.cc b/libretroshare/src/turtle/rsturtleitem.cc index 20e9666f1..182e6deca 100644 --- a/libretroshare/src/turtle/rsturtleitem.cc +++ b/libretroshare/src/turtle/rsturtleitem.cc @@ -184,6 +184,8 @@ RsTurtleSearchResultItem *RsTurtleGenericSearchResultItem::duplicate() const sr->result_data = (unsigned char*)rs_malloc(result_data_len) ; memcpy(sr->result_data,result_data,result_data_len) ; sr->result_data_len = result_data_len ; + sr->request_id = request_id ; + sr->depth = depth ; return sr ; } From 4a64ea5f1f3099952bb80de959406c77fd43fe97 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 5 Jul 2018 14:00:04 +0200 Subject: [PATCH 114/138] added optional use of dist sync in GroupFrameDialog --- libretroshare/src/gxs/rsgxsnettunnel.cc | 26 +++---- libretroshare/src/retroshare/rsgxschannels.h | 68 ++++++++----------- .../src/gui/common/GroupTreeWidget.cpp | 5 ++ .../src/gui/common/GroupTreeWidget.h | 1 + .../src/gui/gxs/GxsGroupFrameDialog.cpp | 9 ++- .../src/gui/gxs/GxsGroupFrameDialog.h | 3 +- .../src/gui/gxschannels/GxsChannelDialog.cpp | 2 +- 7 files changed, 57 insertions(+), 57 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 90d73e85a..2b234fe57 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -199,9 +199,9 @@ public: switch(item_subtype) { - case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_VIRTUAL_PEER: return new RsGxsNetTunnelVirtualPeerItem ; - case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_KEEP_ALIVE : return new RsGxsNetTunnelKeepAliveItem ; - case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_RANDOM_BIAS : return new RsGxsNetTunnelRandomBiasItem ; + case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_VIRTUAL_PEER : return new RsGxsNetTunnelVirtualPeerItem ; + case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_KEEP_ALIVE : return new RsGxsNetTunnelKeepAliveItem ; + case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_RANDOM_BIAS : return new RsGxsNetTunnelRandomBiasItem ; case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_SUBSTRING : return new RsGxsNetTunnelTurtleSearchSubstringItem; case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_REQUEST : return new RsGxsNetTunnelTurtleSearchGroupRequestItem; case RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_SUMMARY : return new RsGxsNetTunnelTurtleSearchGroupSummaryItem; @@ -216,16 +216,16 @@ public: template<> void RsTypeSerializer::serial_process( RsGenericSerializer::SerializeJob j, RsGenericSerializer::SerializeContext& ctx, RsGxsGroupSummary& gs, const std::string& member_name ) { - RsTypeSerializer::serial_process(j,ctx,gs.group_id,member_name+"-group_id") ; // RsGxsGroupId group_id ; - RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_NAME ,gs.group_name,member_name+"-group_name") ; // std::string group_name ; - RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_COMMENT,gs.group_description,member_name+"-group_description") ; // std::string group_description ; - RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_VALUE ,gs.search_context,member_name+"-group_name") ; // std::string search_context ; - RsTypeSerializer::serial_process(j,ctx,gs.author_id ,member_name+"-author_id") ; // RsGxsId author_id ; - RsTypeSerializer::serial_process(j,ctx,gs.publish_ts ,member_name+"-publish_ts") ; // time_t publish_ts ; - RsTypeSerializer::serial_process(j,ctx,gs.number_of_messages,member_name+"-number_of_messages") ; // uint32_t number_of_messages ; - RsTypeSerializer::serial_process(j,ctx,gs.last_message_ts,member_name+"-last_message_ts") ; // time_t last_message_ts ; - RsTypeSerializer::serial_process(j,ctx,gs.sign_flags,member_name+"-sign_flags") ; // uint32_t sign_flags ; - RsTypeSerializer::serial_process(j,ctx,gs.popularity,member_name+"-popularity") ; // uint32_t popularity ; + RsTypeSerializer::serial_process (j,ctx,gs.group_id ,member_name+"-group_id") ; // RsGxsGroupId group_id ; + RsTypeSerializer::serial_process (j,ctx,TLV_TYPE_STR_NAME ,gs.group_name,member_name+"-group_name") ; // std::string group_name ; + RsTypeSerializer::serial_process (j,ctx,TLV_TYPE_STR_COMMENT ,gs.group_description,member_name+"-group_description") ; // std::string group_description ; + RsTypeSerializer::serial_process (j,ctx,TLV_TYPE_STR_VALUE ,gs.search_context,member_name+"-group_name") ; // std::string search_context ; + RsTypeSerializer::serial_process (j,ctx,gs.author_id ,member_name+"-author_id") ; // RsGxsId author_id ; + RsTypeSerializer::serial_process (j,ctx,gs.publish_ts ,member_name+"-publish_ts") ; // time_t publish_ts ; + RsTypeSerializer::serial_process (j,ctx,gs.number_of_messages,member_name+"-number_of_messages") ; // uint32_t number_of_messages ; + RsTypeSerializer::serial_process (j,ctx,gs.last_message_ts ,member_name+"-last_message_ts") ; // time_t last_message_ts ; + RsTypeSerializer::serial_process(j,ctx,gs.sign_flags ,member_name+"-sign_flags") ; // uint32_t sign_flags ; + RsTypeSerializer::serial_process(j,ctx,gs.popularity ,member_name+"-popularity") ; // uint32_t popularity ; } diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index a23275b3b..c80b75f31 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -76,61 +76,49 @@ std::ostream &operator<<(std::ostream &out, const RsGxsChannelPost &post); class RsGxsChannels: public RsGxsIfaceHelper, public RsGxsCommentService { - public: +public: explicit RsGxsChannels(RsGxsIface *gxs) - :RsGxsIfaceHelper(gxs) {} + :RsGxsIfaceHelper(gxs) {} virtual ~RsGxsChannels() {} /* Specific Service Data */ -virtual bool getGroupData(const uint32_t &token, std::vector &groups) = 0; -virtual bool getPostData(const uint32_t &token, std::vector &posts, std::vector &cmts) = 0; -virtual bool getPostData(const uint32_t &token, std::vector &posts) = 0; -//Not currently used -//virtual bool getRelatedPosts(const uint32_t &token, std::vector &posts) = 0; + virtual bool getGroupData(const uint32_t &token, std::vector &groups) = 0; + virtual bool getPostData(const uint32_t &token, std::vector &posts, std::vector &cmts) = 0; + virtual bool getPostData(const uint32_t &token, std::vector &posts) = 0; - /* From RsGxsCommentService */ -//virtual bool getCommentData(const uint32_t &token, std::vector &comments) = 0; -//virtual bool getRelatedComments(const uint32_t &token, std::vector &comments) = 0; -//virtual bool createComment(uint32_t &token, RsGxsComment &comment) = 0; -//virtual bool createVote(uint32_t &token, RsGxsVote &vote) = 0; + ////////////////////////////////////////////////////////////////////////////// + /// Distant synchronisation methods /// + ////////////////////////////////////////////////////////////////////////////// + /// + virtual TurtleRequestId turtleGroupRequest(const RsGxsGroupId& group_id)=0; + virtual TurtleRequestId turtleSearchRequest(const std::string& match_string)=0; + virtual bool retrieveDistantSearchResults(TurtleRequestId req, std::map &results) =0; + virtual bool clearDistantSearchResults(TurtleRequestId req)=0; + virtual bool retrieveDistantGroup(const RsGxsGroupId& group_id,RsGxsChannelGroup& distant_group)=0; - virtual TurtleRequestId turtleGroupRequest(const RsGxsGroupId& group_id)=0; - virtual TurtleRequestId turtleSearchRequest(const std::string& match_string)=0; - virtual bool retrieveDistantSearchResults(TurtleRequestId req, std::map &results) =0; - virtual bool clearDistantSearchResults(TurtleRequestId req)=0; - virtual bool retrieveDistantGroup(const RsGxsGroupId& group_id,RsGxsChannelGroup& distant_group)=0; + ////////////////////////////////////////////////////////////////////////////// + virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0; - ////////////////////////////////////////////////////////////////////////////// -virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0; + virtual bool setChannelAutoDownload(const RsGxsGroupId &groupId, bool enabled) = 0; + virtual bool getChannelAutoDownload(const RsGxsGroupId &groupid, bool& enabled) = 0; -virtual bool setChannelAutoDownload(const RsGxsGroupId &groupId, bool enabled) = 0; -virtual bool getChannelAutoDownload(const RsGxsGroupId &groupid, bool& enabled) = 0; + virtual bool setChannelDownloadDirectory(const RsGxsGroupId &groupId, const std::string& directory)=0; + virtual bool getChannelDownloadDirectory(const RsGxsGroupId &groupId, std::string& directory)=0; -virtual bool setChannelDownloadDirectory(const RsGxsGroupId &groupId, const std::string& directory)=0; -virtual bool getChannelDownloadDirectory(const RsGxsGroupId &groupId, std::string& directory)=0; - -//virtual void setChannelAutoDownload(uint32_t& token, const RsGxsGroupId& groupId, bool autoDownload) = 0; - -//virtual bool setMessageStatus(const std::string &msgId, const uint32_t status, const uint32_t statusMask); -//virtual bool setGroupSubscribeFlags(const std::string &groupId, uint32_t subscribeFlags, uint32_t subscribeMask); - -//virtual bool groupRestoreKeys(const std::string &groupId); - virtual bool groupShareKeys(const RsGxsGroupId &groupId, std::set& peers)=0; + virtual bool groupShareKeys(const RsGxsGroupId &groupId, std::set& peers)=0; // Overloaded subscribe fn. -virtual bool subscribeToGroup(uint32_t &token, const RsGxsGroupId &groupId, bool subscribe) = 0; + virtual bool subscribeToGroup(uint32_t &token, const RsGxsGroupId &groupId, bool subscribe) = 0; -virtual bool createGroup(uint32_t &token, RsGxsChannelGroup &group) = 0; -virtual bool createPost(uint32_t &token, RsGxsChannelPost &post) = 0; - -virtual bool updateGroup(uint32_t &token, RsGxsChannelGroup &group) = 0; - - // File Interface -virtual bool ExtraFileHash(const std::string &path, std::string filename) = 0; -virtual bool ExtraFileRemove(const RsFileHash &hash) = 0; + virtual bool createGroup(uint32_t &token, RsGxsChannelGroup &group) = 0; + virtual bool createPost(uint32_t &token, RsGxsChannelPost &post) = 0; + virtual bool updateGroup(uint32_t &token, RsGxsChannelGroup &group) = 0; + // File Interface + virtual bool ExtraFileHash(const std::string &path, std::string filename) = 0; + virtual bool ExtraFileRemove(const RsFileHash &hash) = 0; }; diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index d823298d9..87be83e91 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -430,6 +430,11 @@ QTreeWidgetItem *GroupTreeWidget::addSearchItem(const QString& search_string, ui return item; } +void GroupTreeWidget::setDistSearchVisible(bool visible) +{ + ui->distantSearchLineEdit->setVisible(visible); +} + bool GroupTreeWidget::isSearchRequestResult(QPoint &point,QString& group_id,uint32_t& search_req_id) { QTreeWidgetItem *item = ui->treeWidget->itemAt(point); diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.h b/retroshare-gui/src/gui/common/GroupTreeWidget.h index 64506cfb0..59e0ae261 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.h +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.h @@ -83,6 +83,7 @@ public: // Add a new category item QTreeWidgetItem *addCategoryItem(const QString &name, const QIcon &icon, bool expand); // Add a new search item + void setDistSearchVisible(bool) ; // shows/hides distant search UI parts. QTreeWidgetItem *addSearchItem(const QString& search_string, uint32_t id, const QIcon &icon) ; void removeSearchItem(QTreeWidgetItem *item); diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index a1a66eed2..58e7bb93a 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -67,7 +67,7 @@ */ /** Constructor */ -GxsGroupFrameDialog::GxsGroupFrameDialog(RsGxsIfaceHelper *ifaceImpl, QWidget *parent) +GxsGroupFrameDialog::GxsGroupFrameDialog(RsGxsIfaceHelper *ifaceImpl, QWidget *parent,bool allow_dist_sync) : RsGxsUpdateBroadcastPage(ifaceImpl, parent) { /* Invoke the Qt Designer generated object setup routine */ @@ -75,6 +75,7 @@ GxsGroupFrameDialog::GxsGroupFrameDialog(RsGxsIfaceHelper *ifaceImpl, QWidget *p ui->setupUi(this); mInitialized = false; + mDistSyncAllowed = allow_dist_sync; mInFill = false; mCountChildMsgs = false; mYourGroups = NULL; @@ -96,12 +97,16 @@ GxsGroupFrameDialog::GxsGroupFrameDialog(RsGxsIfaceHelper *ifaceImpl, QWidget *p connect(ui->groupTreeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT(groupTreeCustomPopupMenu(QPoint))); connect(ui->groupTreeWidget, SIGNAL(treeCurrentItemChanged(QString)), this, SLOT(changedCurrentGroup(QString))); connect(ui->groupTreeWidget->treeWidget(), SIGNAL(signalMouseMiddleButtonClicked(QTreeWidgetItem*)), this, SLOT(groupTreeMiddleButtonClicked(QTreeWidgetItem*))); - connect(ui->groupTreeWidget, SIGNAL(distantSearchRequested(const QString&)), this, SLOT(searchNetwork(const QString&))); connect(ui->messageTabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(messageTabCloseRequested(int))); connect(ui->messageTabWidget, SIGNAL(currentChanged(int)), this, SLOT(messageTabChanged(int))); connect(ui->todoPushButton, SIGNAL(clicked()), this, SLOT(todo())); + ui->groupTreeWidget->setDistSearchVisible(allow_dist_sync) ; + + if(allow_dist_sync) + connect(ui->groupTreeWidget, SIGNAL(distantSearchRequested(const QString&)), this, SLOT(searchNetwork(const QString&))); + /* Set initial size the splitter */ ui->splitter->setStretchFactor(0, 0); ui->splitter->setStretchFactor(1, 1); diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index 4951caf36..46ff05ec3 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -72,7 +72,7 @@ public: }; public: - GxsGroupFrameDialog(RsGxsIfaceHelper *ifaceImpl, QWidget *parent = 0); + GxsGroupFrameDialog(RsGxsIfaceHelper *ifaceImpl, QWidget *parent = 0,bool allow_dist_sync=false); virtual ~GxsGroupFrameDialog(); bool navigate(const RsGxsGroupId &groupId, const RsGxsMessageId& msgId); @@ -190,6 +190,7 @@ protected: private: bool mInitialized; bool mInFill; + bool mDistSyncAllowed; QString mSettingsName; RsGxsGroupId mGroupId; RsGxsIfaceHelper *mInterface; diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp index f839a0a3f..8090dc353 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp @@ -47,7 +47,7 @@ public: /** Constructor */ GxsChannelDialog::GxsChannelDialog(QWidget *parent) - : GxsGroupFrameDialog(rsGxsChannels, parent) + : GxsGroupFrameDialog(rsGxsChannels, parent,true) { } From 98f8e4da0a296ef3db6bee3b92e9d791f16d430b Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 5 Jul 2018 17:40:06 +0200 Subject: [PATCH 115/138] added per-item type limit for turtle search results --- libretroshare/src/gxs/rsgxsnettunnel.cc | 8 ++- libretroshare/src/gxs/rsgxsnettunnel.h | 2 +- libretroshare/src/turtle/p3turtle.cc | 52 ++++++++++--------- libretroshare/src/turtle/p3turtle.h | 7 +-- libretroshare/src/turtle/rsturtleitem.cc | 6 +++ libretroshare/src/turtle/rsturtleitem.h | 11 ++-- .../src/turtle/turtleclientservice.h | 7 ++- 7 files changed, 59 insertions(+), 34 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 2b234fe57..fc8d5eb79 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -36,6 +36,8 @@ #define GXS_NET_TUNNEL_DEBUG() std::cerr << time(NULL) << " : GXS_NET_TUNNEL: " << __FUNCTION__ << " : " #define GXS_NET_TUNNEL_ERROR() std::cerr << "(EE) GXS_NET_TUNNEL ERROR : " +static const uint32_t RS_GXS_NET_TUNNEL_MAX_ALLOWED_HITS_GROUP_DATA = 1; +static const uint32_t RS_GXS_NET_TUNNEL_MAX_ALLOWED_HITS_GROUP_SEARCH = 100; RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") { @@ -1011,7 +1013,7 @@ TurtleRequestId RsGxsNetTunnelService::turtleSearchRequest(const std::string& ma return mTurtle->turtleSearch(mem,size,this) ; } -bool RsGxsNetTunnelService::receiveSearchRequest(unsigned char *search_request_data,uint32_t search_request_data_len,unsigned char *& search_result_data,uint32_t& search_result_data_size) +bool RsGxsNetTunnelService::receiveSearchRequest(unsigned char *search_request_data,uint32_t search_request_data_len,unsigned char *& search_result_data,uint32_t& search_result_data_size,uint32_t& max_allowed_hits) { GXS_NET_TUNNEL_DEBUG() << ": received a request." << std::endl; @@ -1023,6 +1025,8 @@ bool RsGxsNetTunnelService::receiveSearchRequest(unsigned char *search_request_d { GXS_NET_TUNNEL_DEBUG() << " : type is substring for service " << std::hex << (int)substring_sr->service << std::dec << std::endl; + max_allowed_hits = RS_GXS_NET_TUNNEL_MAX_ALLOWED_HITS_GROUP_SEARCH ; + std::list results ; RS_STACK_MUTEX(mGxsNetTunnelMtx); @@ -1057,6 +1061,8 @@ bool RsGxsNetTunnelService::receiveSearchRequest(unsigned char *search_request_d RS_STACK_MUTEX(mGxsNetTunnelMtx); auto it = mSearchableServices.find(substring_gr->service) ; + max_allowed_hits = RS_GXS_NET_TUNNEL_MAX_ALLOWED_HITS_GROUP_DATA ; + unsigned char *encrypted_group_data = NULL ; uint32_t encrypted_group_data_len = 0 ; diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index ade780fe8..0fdff3ccc 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -244,7 +244,7 @@ public: * \brief receiveSearchRequest * See RsTurtleClientService::@ */ - virtual bool receiveSearchRequest(unsigned char *search_request_data,uint32_t search_request_data_len,unsigned char *& search_result_data,uint32_t& search_result_data_len); + virtual bool receiveSearchRequest(unsigned char *search_request_data, uint32_t search_request_data_len, unsigned char *& search_result_data, uint32_t& search_result_data_len, uint32_t &max_allowed_hits); virtual void receiveSearchResult(TurtleSearchRequestId request_id,unsigned char *search_result_data,uint32_t search_result_data_len); // Overloaded from RsTickingThread diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 1fe6adfb0..0db63a7df 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -83,17 +83,18 @@ void TS_dumpState() ; // - The total number of TR per second emmited from self will be MAX_TUNNEL_REQS_PER_SECOND / TIME_BETWEEN_TUNNEL_MANAGEMENT_CALLS = 0.5 // - I updated forward probabilities to higher values, and min them to 1/nb_connected_friends to prevent blocking tunnels. // -static const time_t TUNNEL_REQUESTS_LIFE_TIME = 240 ; /// life time for tunnel requests in the cache. -static const time_t SEARCH_REQUESTS_LIFE_TIME = 240 ; /// life time for search requests in the cache -static const time_t REGULAR_TUNNEL_DIGGING_TIME = 300 ; /// maximum interval between two tunnel digging campaigns. -static const time_t MAXIMUM_TUNNEL_IDLE_TIME = 60 ; /// maximum life time of an unused tunnel. -static const time_t EMPTY_TUNNELS_DIGGING_TIME = 50 ; /// look into tunnels regularly every 50 sec. -static const time_t TUNNEL_SPEED_ESTIMATE_LAPSE = 5 ; /// estimate tunnel speed every 5 seconds -static const time_t TUNNEL_CLEANING_LAPS_TIME = 10 ; /// clean tunnels every 10 secs -static const time_t TIME_BETWEEN_TUNNEL_MANAGEMENT_CALLS = 2 ; /// Tunnel management calls every 2 secs. -static const uint32_t MAX_TUNNEL_REQS_PER_SECOND = 1 ; /// maximum number of tunnel requests issued per second. Was 0.5 before -static const uint32_t MAX_ALLOWED_SR_IN_CACHE = 120 ; /// maximum number of search requests allowed in cache. That makes 2 per sec. -static const uint32_t TURTLE_SEARCH_RESULT_MAX_HITS =5000 ; /// maximum number of search results forwarded back to the source. +static const time_t TUNNEL_REQUESTS_LIFE_TIME = 240 ; /// life time for tunnel requests in the cache. +static const time_t SEARCH_REQUESTS_LIFE_TIME = 240 ; /// life time for search requests in the cache +static const time_t REGULAR_TUNNEL_DIGGING_TIME = 300 ; /// maximum interval between two tunnel digging campaigns. +static const time_t MAXIMUM_TUNNEL_IDLE_TIME = 60 ; /// maximum life time of an unused tunnel. +static const time_t EMPTY_TUNNELS_DIGGING_TIME = 50 ; /// look into tunnels regularly every 50 sec. +static const time_t TUNNEL_SPEED_ESTIMATE_LAPSE = 5 ; /// estimate tunnel speed every 5 seconds +static const time_t TUNNEL_CLEANING_LAPS_TIME = 10 ; /// clean tunnels every 10 secs +static const time_t TIME_BETWEEN_TUNNEL_MANAGEMENT_CALLS = 2 ; /// Tunnel management calls every 2 secs. +static const uint32_t MAX_TUNNEL_REQS_PER_SECOND = 1 ; /// maximum number of tunnel requests issued per second. Was 0.5 before +static const uint32_t MAX_ALLOWED_SR_IN_CACHE = 120 ; /// maximum number of search requests allowed in cache. That makes 2 per sec. +static const uint32_t TURTLE_SEARCH_RESULT_MAX_HITS_FILES =5000 ; /// maximum number of search results forwarded back to the source. +static const uint32_t TURTLE_SEARCH_RESULT_MAX_HITS_DEFAULT= 100 ; /// default maximum number of search results forwarded back source. static const float depth_peer_probability[7] = { 1.0f,0.99f,0.9f,0.7f,0.6f,0.5,0.4f } ; @@ -916,6 +917,7 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) // Perform local search off-mutex,because this might call some services that are above turtle in the mutex chain. uint32_t search_result_count = 0; + uint32_t max_allowed_hits = TURTLE_SEARCH_RESULT_MAX_HITS_DEFAULT; if(item->PeerId() != _own_id) // is the request not coming from us? { @@ -924,7 +926,7 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) #endif std::list search_results ; - performLocalSearch(item,search_result_count,search_results) ; + performLocalSearch(item,search_result_count,search_results,max_allowed_hits) ; for(auto it(search_results.begin());it!=search_results.end();++it) { @@ -948,13 +950,14 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) req.result_count = search_result_count; req.keywords = item->GetKeywords() ; req.service_id = item->serviceId() ; + req.max_allowed_hits = max_allowed_hits; // if enough has been sent back already, do not sarch further #ifdef P3TURTLE_DEBUG std::cerr << " result count = " << req.result_count << std::endl; #endif - if(req.result_count >= TURTLE_SEARCH_RESULT_MAX_HITS) + if(req.result_count >= max_allowed_hits) return ; // If search depth not too large, also forward this search request to all other peers. @@ -1014,13 +1017,13 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item) // This function should be removed in the future, when file search will also use generic search items. -void p3turtle::performLocalSearch(RsTurtleSearchRequestItem *item,uint32_t& req_result_count,std::list& search_results) +void p3turtle::performLocalSearch(RsTurtleSearchRequestItem *item,uint32_t& req_result_count,std::list& search_results,uint32_t& max_allowed_hits) { RsTurtleFileSearchRequestItem *ftsearch = dynamic_cast(item) ; if(ftsearch != NULL) { - performLocalSearch_files(ftsearch,req_result_count,search_results) ; + performLocalSearch_files(ftsearch,req_result_count,search_results,max_allowed_hits) ; return ; } @@ -1028,12 +1031,12 @@ void p3turtle::performLocalSearch(RsTurtleSearchRequestItem *item,uint32_t& req_ if(gnsearch != NULL) { - performLocalSearch_generic(gnsearch,req_result_count,search_results) ; + performLocalSearch_generic(gnsearch,req_result_count,search_results,max_allowed_hits) ; return ; } } -void p3turtle::performLocalSearch_generic(RsTurtleGenericSearchRequestItem *item, uint32_t& req_result_count, std::list& result) +void p3turtle::performLocalSearch_generic(RsTurtleGenericSearchRequestItem *item, uint32_t& req_result_count, std::list& result,uint32_t& max_allowed_hits) { unsigned char *search_result_data = NULL ; uint32_t search_result_data_len = 0 ; @@ -1050,7 +1053,7 @@ void p3turtle::performLocalSearch_generic(RsTurtleGenericSearchRequestItem *item client = it->second ; } - if(client->receiveSearchRequest(item->search_data,item->search_data_len,search_result_data,search_result_data_len)) + if(client->receiveSearchRequest(item->search_data,item->search_data_len,search_result_data,search_result_data_len,max_allowed_hits)) { RsTurtleGenericSearchResultItem *result_item = new RsTurtleGenericSearchResultItem ; @@ -1061,7 +1064,7 @@ void p3turtle::performLocalSearch_generic(RsTurtleGenericSearchRequestItem *item } } -void p3turtle::performLocalSearch_files(RsTurtleFileSearchRequestItem *item,uint32_t& req_result_count,std::list& result) +void p3turtle::performLocalSearch_files(RsTurtleFileSearchRequestItem *item,uint32_t& req_result_count,std::list& result,uint32_t& max_allowed_hits) { #ifdef P3TURTLE_DEBUG std::cerr << "Performing rsFiles->search()" << std::endl ; @@ -1078,6 +1081,7 @@ void p3turtle::performLocalSearch_files(RsTurtleFileSearchRequestItem *item,uint uint32_t item_size = 0 ; static const uint32_t RSTURTLE_MAX_SEARCH_RESPONSE_SIZE = 10000 ; + max_allowed_hits = TURTLE_SEARCH_RESULT_MAX_HITS_FILES; for(auto it(initialResults.begin());it!=initialResults.end();++it) { @@ -1096,7 +1100,7 @@ void p3turtle::performLocalSearch_files(RsTurtleFileSearchRequestItem *item,uint item_size += 8 /* size */ + it->hash.serial_size() + it->name.size() ; - if(item_size > RSTURTLE_MAX_SEARCH_RESPONSE_SIZE || req_result_count >= TURTLE_SEARCH_RESULT_MAX_HITS) + if(item_size > RSTURTLE_MAX_SEARCH_RESPONSE_SIZE || req_result_count >= max_allowed_hits) { #ifdef P3TURTLE_DEBUG std::cerr << " Sending back chunk of size " << item_size << ", for " << res_item->result.size() << " elements." << std::endl ; @@ -1151,18 +1155,18 @@ void p3turtle::handleSearchResult(RsTurtleSearchResultItem *item) uint32_t n = item->count(); // not so good! - if(it->second.result_count >= TURTLE_SEARCH_RESULT_MAX_HITS) + if(it->second.result_count >= it->second.max_allowed_hits) { std::cerr << "(WW) exceeded turtle search result to forward. Req=" << std::hex << item->request_id << std::dec << ": dropping item with " << n << " elements." << std::endl; return ; } - if(it->second.result_count + n > TURTLE_SEARCH_RESULT_MAX_HITS) + if(it->second.result_count + n > it->second.max_allowed_hits) { - for(uint32_t i=it->second.result_count + n; i>TURTLE_SEARCH_RESULT_MAX_HITS;--i) + for(uint32_t i=it->second.result_count + n; i>it->second.max_allowed_hits;--i) item->pop() ; - it->second.result_count = TURTLE_SEARCH_RESULT_MAX_HITS ; + it->second.result_count = it->second.max_allowed_hits ; } else it->second.result_count += n ; diff --git a/libretroshare/src/turtle/p3turtle.h b/libretroshare/src/turtle/p3turtle.h index be34a56a7..93d397d67 100644 --- a/libretroshare/src/turtle/p3turtle.h +++ b/libretroshare/src/turtle/p3turtle.h @@ -174,6 +174,7 @@ class TurtleSearchRequestInfo uint32_t result_count; // responses to this request. Useful to avoid spamming tunnel responses. std::string keywords; uint16_t service_id; // ID of the client service who issues the request. This is null if the request does not have a local origin. + uint32_t max_allowed_hits;// Max number of hits allowed for this search. This actually depends on the type of search (files, GXS groups, GXS group data, etc) }; class TurtleTunnelRequestInfo { @@ -397,9 +398,9 @@ class p3turtle: public p3Service, public RsTurtle, public p3Config //------ Functions connecting the turtle router to other components.----------// /// Performs a search calling local cache and search structure. - void performLocalSearch (RsTurtleSearchRequestItem *item, uint32_t& req_result_count,std::list& result) ; - void performLocalSearch_files (RsTurtleFileSearchRequestItem *item, uint32_t& req_result_count,std::list& result) ; - void performLocalSearch_generic(RsTurtleGenericSearchRequestItem *item, uint32_t& req_result_count,std::list& result) ; + void performLocalSearch (RsTurtleSearchRequestItem *item, uint32_t& req_result_count,std::list& result,uint32_t& max_allowed_hits) ; + void performLocalSearch_files (RsTurtleFileSearchRequestItem *item, uint32_t& req_result_count, std::list& result, uint32_t &max_allowed_hits) ; + void performLocalSearch_generic(RsTurtleGenericSearchRequestItem *item, uint32_t& req_result_count, std::list& result, uint32_t &max_allowed_hits) ; /// Returns true if the file with given hash is hosted locally, and accessible in anonymous mode the supplied peer. virtual bool performLocalHashSearch(const TurtleFileHash& hash,const RsPeerId& client_peer_id,RsTurtleClientService *& service); diff --git a/libretroshare/src/turtle/rsturtleitem.cc b/libretroshare/src/turtle/rsturtleitem.cc index 182e6deca..cfc775f24 100644 --- a/libretroshare/src/turtle/rsturtleitem.cc +++ b/libretroshare/src/turtle/rsturtleitem.cc @@ -50,6 +50,11 @@ RsItem *RsTurtleSerialiser::create_item(uint16_t service,uint8_t item_subtype) c return NULL ; } +std::string RsTurtleGenericSearchRequestItem::GetKeywords() +{ + return std::string("Generic search : " + RsUtil::BinToHex(search_data,search_data_len,10)); +} + void RsTurtleStringSearchRequestItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) { RsTypeSerializer::serial_process (j,ctx,TLV_TYPE_STR_VALUE,match_string,"match_string") ; @@ -67,6 +72,7 @@ void RsTurtleGenericSearchRequestItem::serial_process(RsGenericSerializer::Seria RsTypeSerializer::serial_process(j,ctx,request_id,"request_id") ; RsTypeSerializer::serial_process(j,ctx,depth,"depth") ; RsTypeSerializer::serial_process(j,ctx,service_id,"service_id") ; + RsTypeSerializer::serial_process(j,ctx,request_type,"request_type") ; RsTypeSerializer::TlvMemBlock_proxy prox(search_data,search_data_len) ; RsTypeSerializer::serial_process(j,ctx,prox,"search_data") ; diff --git a/libretroshare/src/turtle/rsturtleitem.h b/libretroshare/src/turtle/rsturtleitem.h index d35cbb8fd..d8ee48165 100644 --- a/libretroshare/src/turtle/rsturtleitem.h +++ b/libretroshare/src/turtle/rsturtleitem.h @@ -82,7 +82,7 @@ class RsTurtleSearchRequestItem: public RsTurtleItem virtual RsTurtleSearchRequestItem *clone() const = 0 ; // used for cloning in routing methods virtual std::string GetKeywords() = 0; - virtual uint16_t serviceId() = 0 ; + virtual uint16_t serviceId() const= 0 ; uint32_t request_id ; // randomly generated request id. uint16_t depth ; // Used for limiting search depth. @@ -94,7 +94,7 @@ class RsTurtleFileSearchRequestItem: public RsTurtleSearchRequestItem RsTurtleFileSearchRequestItem(uint32_t subtype) : RsTurtleSearchRequestItem(subtype) {} virtual ~RsTurtleFileSearchRequestItem() {} - virtual uint16_t serviceId() { return RS_SERVICE_TYPE_FILE_TRANSFER ; } + virtual uint16_t serviceId() const { return RS_SERVICE_TYPE_FILE_TRANSFER ; } virtual void search(std::list &) const =0; }; @@ -149,12 +149,15 @@ class RsTurtleGenericSearchRequestItem: public RsTurtleSearchRequestItem uint16_t service_id ; // service to search uint32_t search_data_len ; + uint8_t request_type ; // type of request. This is used to limit the number of responses. unsigned char *search_data ; - std::string GetKeywords() { return std::string("Generic search " + RsUtil::BinToHex(search_data,search_data_len,10)); } - virtual uint16_t serviceId() { return service_id ; } + std::string GetKeywords() ; + virtual uint16_t serviceId() const { return service_id ; } virtual RsTurtleSearchRequestItem *clone() const ; + virtual uint32_t requestType() const { return request_type; } + void clear() { free(search_data); search_data=NULL; search_data_len=0; } protected: diff --git a/libretroshare/src/turtle/turtleclientservice.h b/libretroshare/src/turtle/turtleclientservice.h index b3aa37af1..039827ef4 100644 --- a/libretroshare/src/turtle/turtleclientservice.h +++ b/libretroshare/src/turtle/turtleclientservice.h @@ -101,10 +101,15 @@ class RsTurtleClientService * \param search_request_data_len length of the serialized search data * \param search_result_data generic serialized search result data * \param search_result_data_len length of the serialized search result data + * \param max_allowed_hits max number of hits allowed to be sent back and forwarded * * \return true if the search is successful. */ - virtual bool receiveSearchRequest(unsigned char */*search_request_data*/,uint32_t /*search_request_data_len*/,unsigned char *& /*search_result_data*/,uint32_t& /*search_result_data_len*/) + virtual bool receiveSearchRequest(unsigned char */*search_request_data*/, + uint32_t /*search_request_data_len*/, + unsigned char *& /*search_result_data*/, + uint32_t& /*search_result_data_len*/, + uint32_t& /* max_allows_hits */) { std::cerr << "!!!!!! Received search result from turtle router, but the client service who requested it is not handling it !!!!!!!!!!" << std::endl ; return false; From b3dddeafdffaa0b739a7067dccfdccad246ac74e Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 6 Jul 2018 23:55:12 +0900 Subject: [PATCH 116/138] add missing namespaces --- libretroshare/src/pqi/p3peermgr.cc | 174 +++++++++--------- libretroshare/src/services/p3banlist.cc | 30 +-- retroshare-gui/src/gui/MainWindow.cpp | 10 +- retroshare-gui/src/gui/PluginsPage.h | 12 +- .../src/gui/settings/PluginsPage.cpp | 20 +- retroshare-gui/src/gui/settings/PluginsPage.h | 3 + .../src/gui/settings/rsettingswin.cpp | 2 +- 7 files changed, 133 insertions(+), 118 deletions(-) diff --git a/libretroshare/src/pqi/p3peermgr.cc b/libretroshare/src/pqi/p3peermgr.cc index fb17dddb6..243b26135 100644 --- a/libretroshare/src/pqi/p3peermgr.cc +++ b/libretroshare/src/pqi/p3peermgr.cc @@ -89,11 +89,11 @@ static const std::string kConfigKeyProxyServerIpAddrTor = "PROXY_SERVER_IPADDR"; static const std::string kConfigKeyProxyServerPortTor = "PROXY_SERVER_PORT"; static const std::string kConfigKeyProxyServerIpAddrI2P = "PROXY_SERVER_IPADDR_I2P"; static const std::string kConfigKeyProxyServerPortI2P = "PROXY_SERVER_PORT_I2P"; - + void printConnectState(std::ostream &out, peerState &peer); peerState::peerState() - :netMode(RS_NET_MODE_UNKNOWN), vs_disc(RS_VS_DISC_FULL), vs_dht(RS_VS_DHT_FULL), lastcontact(0), + :netMode(RS_NET_MODE_UNKNOWN), vs_disc(RS_VS_DISC_FULL), vs_dht(RS_VS_DHT_FULL), lastcontact(0), hiddenNode(false), hiddenPort(0), hiddenType(RS_HIDDEN_TYPE_NONE) { sockaddr_storage_clear(localaddr); @@ -107,13 +107,13 @@ std::string textPeerConnectState(peerState &state) std::string out = "Id: " + state.id.toStdString() + "\n"; rs_sprintf_append(out, "NetMode: %lu\n", state.netMode); rs_sprintf_append(out, "VisState: Disc: %u Dht: %u\n", state.vs_disc, state.vs_dht); - + out += "laddr: "; out += sockaddr_storage_tostring(state.localaddr); out += "\neaddr: "; out += sockaddr_storage_tostring(state.serveraddr); out += "\n"; - + return out; } @@ -136,7 +136,7 @@ p3PeerMgrIMPL::p3PeerMgrIMPL(const RsPeerId& ssl_own_id, const RsPgpId& gpg_own_ mOwnState.netMode = RS_NET_MODE_UPNP; // Default to UPNP. mOwnState.vs_disc = RS_VS_DISC_FULL; mOwnState.vs_dht = RS_VS_DHT_FULL; - + // setup default ProxyServerAddress. // Tor sockaddr_storage_clear(mProxyServerAddressTor); @@ -154,7 +154,7 @@ p3PeerMgrIMPL::p3PeerMgrIMPL(const RsPeerId& ssl_own_id, const RsPgpId& gpg_own_ mProxyServerStatusTor = RS_NET_PROXY_STATUS_UNKNOWN ; mProxyServerStatusI2P = RS_NET_PROXY_STATUS_UNKNOWN; } - + #ifdef PEER_DEBUG std::cerr << "p3PeerMgr() Startup" << std::endl; #endif @@ -222,8 +222,8 @@ bool p3PeerMgrIMPL::forceHiddenNode() struct sockaddr_storage loopback; sockaddr_storage_clear(loopback); sockaddr_storage_ipv4_aton(loopback, "127.0.0.1"); - uint16_t port = sockaddr_storage_port(mOwnState.localaddr); - sockaddr_storage_ipv4_setport(loopback, port); + uint16_t port = sockaddr_storage_port(mOwnState.localaddr); + sockaddr_storage_ipv4_setport(loopback, port); setLocalAddress(AuthSSL::getAuthSSL()->OwnId(), loopback); @@ -254,7 +254,7 @@ bool p3PeerMgrIMPL::setOwnNetworkMode(uint32_t netMode) changed = true; } } - + // Pass on Flags to NetMgr. mNetMgr->setNetworkMode((netMode & RS_NET_MODE_ACTUAL)); return changed; @@ -267,7 +267,7 @@ bool p3PeerMgrIMPL::setOwnVisState(uint16_t vs_disc, uint16_t vs_dht) RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ std::string out; - rs_sprintf(out, "p3PeerMgr::setOwnVisState() Existing vis: %u/%u Input vis: %u/%u", + rs_sprintf(out, "p3PeerMgr::setOwnVisState() Existing vis: %u/%u Input vis: %u/%u", mOwnState.vs_disc, mOwnState.vs_dht, vs_disc, vs_dht); rslog(RSL_WARNING, p3peermgrzone, out); @@ -275,7 +275,7 @@ bool p3PeerMgrIMPL::setOwnVisState(uint16_t vs_disc, uint16_t vs_dht) std::cerr << out.c_str() << std::endl; #endif - if (mOwnState.vs_disc != vs_disc || mOwnState.vs_dht != vs_dht) + if (mOwnState.vs_disc != vs_disc || mOwnState.vs_dht != vs_dht) { mOwnState.vs_disc = vs_disc; mOwnState.vs_dht = vs_dht; @@ -283,7 +283,7 @@ bool p3PeerMgrIMPL::setOwnVisState(uint16_t vs_disc, uint16_t vs_dht) IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/ } } - + // Pass on Flags to NetMgr. mNetMgr->setVisState(vs_disc, vs_dht); @@ -575,7 +575,7 @@ bool p3PeerMgrIMPL::setHiddenDomainPort(const RsPeerId &ssl_id, const std::strin IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/ - if (ssl_id == AuthSSL::getAuthSSL()->OwnId()) + if (ssl_id == AuthSSL::getAuthSSL()->OwnId()) { mOwnState.hiddenNode = true; mOwnState.hiddenDomain = domain; @@ -917,7 +917,7 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ - if (id == AuthSSL::getAuthSSL()->OwnId()) + if (id == AuthSSL::getAuthSSL()->OwnId()) { #ifdef PEER_DEBUG std::cerr << "p3PeerMgrIMPL::addFriend() cannot add own id as a friend." << std::endl; @@ -973,7 +973,7 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg /* setup connectivity parameters */ it->second.vs_disc = vs_disc; it->second.vs_dht = vs_dht; - + it->second.netMode = netMode; it->second.lastcontact = lastContact; @@ -995,7 +995,7 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg pstate.id = id; pstate.gpg_id = gpg_id; pstate.name = AuthGPG::getAuthGPG()->getGPGName(gpg_id); - + pstate.vs_disc = vs_disc; pstate.vs_dht = vs_dht; pstate.netMode = netMode; @@ -1018,7 +1018,7 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg mLinkMgr->addFriend(id, vs_dht != RS_VS_DHT_OFF); } - service_flags &= servicePermissionFlags(gpg_id) ; // Always reduce the permissions. + service_flags &= servicePermissionFlags(gpg_id) ; // Always reduce the permissions. #ifdef RS_CHATSERVER //Defined by chatserver setServicePermissionFlags(gpg_id,RS_NODE_PERM_NONE) ; #else @@ -1029,7 +1029,7 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg printPeerLists(std::cerr); mLinkMgr->printPeerLists(std::cerr); #endif - + return true; } @@ -1071,10 +1071,10 @@ bool p3PeerMgrIMPL::removeFriend(const RsPgpId &id) } for(std::list::iterator rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); ++rit) - if (mFriendList.end() != (it = mFriendList.find(*rit))) + if (mFriendList.end() != (it = mFriendList.find(*rit))) mFriendList.erase(it); - std::map::iterator it2 = mFriendsPermissionFlags.find(id) ; + std::map::iterator it2 = mFriendsPermissionFlags.find(id) ; if(it2 != mFriendsPermissionFlags.end()) mFriendsPermissionFlags.erase(it2); @@ -1146,13 +1146,13 @@ bool p3PeerMgrIMPL::removeFriend(const RsPeerId &id, bool removePgpId) } for(std::list::iterator rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); ++rit) - if (mFriendList.end() != (it = mFriendList.find(*rit))) + if (mFriendList.end() != (it = mFriendList.find(*rit))) mFriendList.erase(it); std::map::iterator it2 ; for(std::list::iterator rit = pgpid_toRemove.begin(); rit != pgpid_toRemove.end(); ++rit) - if (mFriendsPermissionFlags.end() != (it2 = mFriendsPermissionFlags.find(*rit))) + if (mFriendsPermissionFlags.end() != (it2 = mFriendsPermissionFlags.find(*rit))) mFriendsPermissionFlags.erase(it2); #ifdef PEER_DEBUG @@ -1432,7 +1432,7 @@ bool p3PeerMgrIMPL::setLocalAddress( const RsPeerId &id, if (changed) { IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/ - + mNetMgr->setLocalAddress(addr); mLinkMgr->setLocalAddress(addr); } @@ -1499,9 +1499,9 @@ bool p3PeerMgrIMPL::setExtAddress( const RsPeerId &id, changed = true; } } - + mNetMgr->setExtAddress(addr); - + return changed; } @@ -1584,12 +1584,16 @@ bool p3PeerMgrIMPL::setDynDNS(const RsPeerId &id, const std::string &dyndns) return changed; } +namespace pqi { + struct ZeroedInt { ZeroedInt() { n=0 ;} int n ; }; +} + bool p3PeerMgrIMPL::addCandidateForOwnExternalAddress(const RsPeerId &from, const sockaddr_storage &addr) { // The algorithm is the following: @@ -1617,10 +1621,10 @@ bool p3PeerMgrIMPL::addCandidateForOwnExternalAddress(const RsPeerId &from, cons // Update a list of own IPs: // - remove old values for that same peer // - remove values for non connected peers - + { RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ - + mReportedOwnAddresses[from] = addr_filtered ; for(std::map::iterator it(mReportedOwnAddresses.begin());it!=mReportedOwnAddresses.end();) @@ -1641,8 +1645,8 @@ bool p3PeerMgrIMPL::addCandidateForOwnExternalAddress(const RsPeerId &from, cons std::cerr << "p3PeerMgr:: Current external address is calculated to be: " << sockaddr_storage_iptostring(current_best_ext_address_guess) << " (simultaneously reported by " << count << " peers)." << std::endl; } - - // now current + + // now current sockaddr_storage own_addr ; @@ -1665,7 +1669,7 @@ bool p3PeerMgrIMPL::addCandidateForOwnExternalAddress(const RsPeerId &from, cons RsServer::notify()->AddFeedItem(RS_FEED_ITEM_SEC_IP_WRONG_EXTERNAL_IP_REPORTED, from.toStdString(), sockaddr_storage_iptostring(own_addr), sockaddr_storage_iptostring(addr)); } - + // we could also sweep over all connected friends and see if some report a different address. return true ; @@ -1673,46 +1677,46 @@ bool p3PeerMgrIMPL::addCandidateForOwnExternalAddress(const RsPeerId &from, cons bool p3PeerMgrIMPL::locked_computeCurrentBestOwnExtAddressCandidate(sockaddr_storage& addr, uint32_t& count) { - std::map addr_counts ; - + std::map addr_counts ; + for(std::map::iterator it(mReportedOwnAddresses.begin());it!=mReportedOwnAddresses.end();++it) ++addr_counts[it->second].n ; #ifdef PEER_DEBUG std::cerr << "Current ext addr statistics:" << std::endl; #endif - + count = 0 ; - - for(std::map::const_iterator it(addr_counts.begin());it!=addr_counts.end();++it) + + for(std::map::const_iterator it(addr_counts.begin());it!=addr_counts.end();++it) { if(uint32_t(it->second.n) > count) { addr = it->first ; count = it->second.n ; } - + #ifdef PEER_DEBUG std::cerr << sockaddr_storage_iptostring(it->first) << " : " << it->second.n << std::endl; #endif } - + return true ; } - + bool p3PeerMgrIMPL::getExtAddressReportedByFriends(sockaddr_storage &addr, uint8_t& /*isstable*/) { RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ - + uint32_t count ; - + locked_computeCurrentBestOwnExtAddressCandidate(addr,count) ; - + #ifdef PEER_DEBUG std::cerr << "Estimation count = " << count << ". Trusted? = " << (count>=2) << std::endl; #endif - - return count >= 2 ;// 2 is not conservative enough. 3 should be probably better. + + return count >= 2 ;// 2 is not conservative enough. 3 should be probably better. } static bool cleanIpList(std::list& lst,const RsPeerId& pid,p3LinkMgr *link_mgr) @@ -1765,7 +1769,7 @@ bool p3PeerMgrIMPL::updateAddressList(const RsPeerId& id, const pqiIpAddrSet RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ /* check if it is our own ip */ - if (id == getOwnId()) + if (id == getOwnId()) { mOwnState.ipAddrs.updateAddrs(clean_set); return true; @@ -1811,11 +1815,11 @@ bool p3PeerMgrIMPL::updateCurrentAddress(const RsPeerId& id, const pqiIpAddre #ifdef PEER_DEBUG std::cerr << "p3PeerMgrIMPL::updateCurrentAddress() called for id : " << id << std::endl; #endif - + RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ - + /* cannot be own id */ - + /* check if it is a friend */ std::map::iterator it; if (mFriendList.end() == (it = mFriendList.find(id))) @@ -1846,23 +1850,23 @@ bool p3PeerMgrIMPL::updateCurrentAddress(const RsPeerId& id, const pqiIpAddre std::cerr << addrstr; std::cerr << std::endl; #endif - + IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/ - + return true; } - + bool p3PeerMgrIMPL::updateLastContact(const RsPeerId& id) { #ifdef PEER_DEBUG std::cerr << "p3PeerMgrIMPL::updateLastContact() called for id : " << id << std::endl; #endif - + RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ - + /* cannot be own id */ - + /* check if it is a friend */ std::map::iterator it; if (mFriendList.end() == (it = mFriendList.find(id))) @@ -1877,7 +1881,7 @@ bool p3PeerMgrIMPL::updateLastContact(const RsPeerId& id) it->second.lastcontact = time(NULL); IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/ - + return true; } @@ -2061,7 +2065,7 @@ bool p3PeerMgrIMPL::saveList(bool &cleanup, std::list& saveData) getProxyServerAddress(RS_HIDDEN_TYPE_TOR, proxy_addr_tor); getProxyServerAddress(RS_HIDDEN_TYPE_I2P, proxy_addr_i2p); - mPeerMtx.lock(); /****** MUTEX LOCKED *******/ + mPeerMtx.lock(); /****** MUTEX LOCKED *******/ RsPeerNetItem *item = new RsPeerNetItem(); item->clear(); @@ -2088,14 +2092,14 @@ bool p3PeerMgrIMPL::saveList(bool &cleanup, std::list& saveData) item->vs_disc = mOwnState.vs_disc; item->vs_dht = mOwnState.vs_dht; - + item->lastContact = mOwnState.lastcontact; item->localAddrV4.addr = mOwnState.localaddr; item->extAddrV4.addr = mOwnState.serveraddr; sockaddr_storage_clear(item->localAddrV6.addr); sockaddr_storage_clear(item->extAddrV6.addr); - + item->dyndns = mOwnState.dyndns; mOwnState.ipAddrs.mLocal.loadTlv(item->localAddrList); mOwnState.ipAddrs.mExt.loadTlv(item->extAddrList); @@ -2125,20 +2129,20 @@ bool p3PeerMgrIMPL::saveList(bool &cleanup, std::list& saveData) item->vs_dht = (it->second).vs_dht; item->lastContact = (it->second).lastcontact; - + item->localAddrV4.addr = (it->second).localaddr; item->extAddrV4.addr = (it->second).serveraddr; sockaddr_storage_clear(item->localAddrV6.addr); sockaddr_storage_clear(item->extAddrV6.addr); - - + + item->dyndns = (it->second).dyndns; (it->second).ipAddrs.mLocal.loadTlv(item->localAddrList); (it->second).ipAddrs.mExt.loadTlv(item->extAddrList); item->domain_addr = (it->second).hiddenDomain; item->domain_port = (it->second).hiddenPort; - + saveData.push_back(item); #ifdef PEER_DEBUG std::cerr << "p3PeerMgrIMPL::saveList() Peer Config Item:" << std::endl; @@ -2150,7 +2154,7 @@ bool p3PeerMgrIMPL::saveList(bool &cleanup, std::list& saveData) RsPeerBandwidthLimitsItem *pblitem = new RsPeerBandwidthLimitsItem ; pblitem->peers = mPeerBandwidthLimits ; saveData.push_back(pblitem) ; - + RsPeerServicePermissionItem *sitem = new RsPeerServicePermissionItem ; for(std::map::const_iterator it(mFriendsPermissionFlags.begin());it!=mFriendsPermissionFlags.end();++it) @@ -2158,11 +2162,11 @@ bool p3PeerMgrIMPL::saveList(bool &cleanup, std::list& saveData) sitem->pgp_ids.push_back(it->first) ; sitem->service_flags.push_back(it->second) ; } - + saveData.push_back(sitem) ; // Now save config for network digging strategies - + RsConfigKeyValueSet *vitem = new RsConfigKeyValueSet ; RsTlvKeyValue kv; @@ -2199,7 +2203,7 @@ bool p3PeerMgrIMPL::saveList(bool &cleanup, std::list& saveData) kv.key = kConfigKeyProxyServerPortI2P; kv.value = sockaddr_storage_porttostring(proxy_addr_i2p); vitem->tlvkvs.pairs.push_back(kv) ; - + saveData.push_back(vitem); /* save groups */ @@ -2213,7 +2217,7 @@ bool p3PeerMgrIMPL::saveList(bool &cleanup, std::list& saveData) return true; } -bool p3PeerMgrIMPL::getMaxRates(const RsPeerId& pid,uint32_t& maxUp,uint32_t& maxDn) +bool p3PeerMgrIMPL::getMaxRates(const RsPeerId& pid,uint32_t& maxUp,uint32_t& maxDn) { RsPgpId pgp_id ; @@ -2235,7 +2239,7 @@ bool p3PeerMgrIMPL::getMaxRates(const RsPeerId& pid,uint32_t& maxUp,uint32_t& ma return getMaxRates(pgp_id,maxUp,maxDn) ; } -bool p3PeerMgrIMPL::getMaxRates(const RsPgpId& pid,uint32_t& maxUp,uint32_t& maxDn) +bool p3PeerMgrIMPL::getMaxRates(const RsPgpId& pid,uint32_t& maxUp,uint32_t& maxDn) { RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ @@ -2254,25 +2258,25 @@ bool p3PeerMgrIMPL::getMaxRates(const RsPgpId& pid,uint32_t& maxUp,uint32_t& max return false ; } } -bool p3PeerMgrIMPL::setMaxRates(const RsPgpId& pid,uint32_t maxUp,uint32_t maxDn) +bool p3PeerMgrIMPL::setMaxRates(const RsPgpId& pid,uint32_t maxUp,uint32_t maxDn) { RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ PeerBandwidthLimits& p(mPeerBandwidthLimits[pid]) ; - + if(maxUp == p.max_up_rate_kbs && maxDn == p.max_dl_rate_kbs) return true ; - + std::cerr << "Updating max rates for peer " << pid << " to " << maxUp << " kB/s (up), " << maxDn << " kB/s (dn)" << std::endl; - + p.max_up_rate_kbs = maxUp ; p.max_dl_rate_kbs = maxDn ; - + IndicateConfigChanged(); - + return true ; } - + void p3PeerMgrIMPL::saveDone() { /* clean up the save List */ @@ -2396,7 +2400,7 @@ bool p3PeerMgrIMPL::loadList(std::list& load) #ifdef PEER_DEBUG std::cerr << "setting use_extr_addr_finder to " << useExtAddrFinder << std::endl ; #endif - } + } // Tor else if (kit->key == kConfigKeyProxyServerIpAddrTor) { @@ -2859,13 +2863,13 @@ bool p3PeerMgrIMPL::removeAllFriendLocations(const RsPgpId &gpgid) { return false; } - + std::list::iterator it; for(it = sslIds.begin(); it != sslIds.end(); ++it) { removeFriend(*it, true); } - + return true; } @@ -2877,7 +2881,7 @@ bool p3PeerMgrIMPL::getAssociatedPeers(const RsPgpId &gpg_id, std::list::iterator it; for(it = mFriendList.begin(); it != mFriendList.end(); ++it) @@ -2890,10 +2894,10 @@ bool p3PeerMgrIMPL::getAssociatedPeers(const RsPgpId &gpg_id, std::listfirst << std::endl; #endif - + } } - + return (count > 0); } @@ -2930,10 +2934,10 @@ bool p3PeerMgrIMPL::removeBannedIps() return true ; } -// /* This only removes SSL certs, that are old... Can end up with no Certs per GPG Id +// /* This only removes SSL certs, that are old... Can end up with no Certs per GPG Id // * We are removing the concept of a "DummyId" - There is no need for it. // */ -// +// // bool isDummyFriend(RsPeerId id) // { // bool ret = (id.substr(0,5) == "dummy"); @@ -2974,7 +2978,7 @@ bool p3PeerMgrIMPL::removeUnusedLocations() { RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ - + // First put a sensible number in all PGP ids for(std::list::const_iterator it = pgpList.begin(); it != pgpList.end(); ++it) @@ -2984,7 +2988,7 @@ bool p3PeerMgrIMPL::removeUnusedLocations() std::cerr << "p3PeerMgr::removeUnusedLocations()" << std::endl; #endif // Then compute the most recently used location for all PGP ids - + for( std::map::iterator it = mFriendList.begin(); it != mFriendList.end(); ++it) { time_t& bst(mostRecentTime[it->second.gpg_id]) ; @@ -3010,4 +3014,4 @@ bool p3PeerMgrIMPL::removeUnusedLocations() return true; } - + diff --git a/libretroshare/src/services/p3banlist.cc b/libretroshare/src/services/p3banlist.cc index b1fc07113..fdfcb05b5 100644 --- a/libretroshare/src/services/p3banlist.cc +++ b/libretroshare/src/services/p3banlist.cc @@ -55,7 +55,7 @@ #define RSBANLIST_DELAY_BETWEEN_TALK_TO_DHT 240 // every 4 mins. /************ IMPLEMENTATION NOTES ********************************* - * + * * Get Bad Peers passed to us (from DHT mainly). * we distribute and track the network list of bad peers. * @@ -113,6 +113,8 @@ void p3BanList::setAutoRangeLimit(int n) IndicateConfigChanged(); } +namespace services { + class ZeroedInt { public: @@ -120,6 +122,8 @@ class ZeroedInt uint32_t n ; }; +} + BanListPeer::BanListPeer() { memset(&addr, 0, sizeof(addr)); @@ -220,14 +224,14 @@ void p3BanList::autoFigureOutBanRanges() std::cerr << "Automatically figuring out IP ranges from banned IPs." << std::endl; #endif - std::map range_map ; + std::map range_map ; for(std::map::iterator it(mBanSet.begin());it!=mBanSet.end();++it) ++range_map[makeBitsRange(it->first,1)].n ; time_t now = time(NULL) ; - for(std::map::const_iterator it=range_map.begin();it!=range_map.end();++it) + for(std::map::const_iterator it=range_map.begin();it!=range_map.end();++it) { #ifdef DEBUG_BANLIST std::cerr << "Ban range: " << sockaddr_storage_iptostring(it->first) << " : " << it->second.n << std::endl; @@ -646,7 +650,7 @@ bool p3BanList::processIncoming() break; case RS_PKT_SUBTYPE_BANLIST_ITEM: { - // Order is important!. + // Order is important!. updated = (recvBanItem((RsBanListItem *) item) || updated); } break; @@ -669,8 +673,8 @@ bool p3BanList::processIncoming() } return true ; -} - +} + bool p3BanList::recvBanItem(RsBanListItem *item) { @@ -681,7 +685,7 @@ bool p3BanList::recvBanItem(RsBanListItem *item) for(it = item->peerList.mList.begin(); it != item->peerList.mList.end(); ++it) { - // Order is important!. + // Order is important!. updated = (addBanEntry(item->PeerId(), it->addr.addr, it->level, it->reason, now - it->age) || updated); } return updated; @@ -961,7 +965,7 @@ bool p3BanList::addBanEntry( const RsPeerId &peerId, it = mBanSources.find(peerId); updated = true; } - + // index is FAMILY + IP - the rest should be Zeros.. struct sockaddr_storage bannedaddr; sockaddr_storage_clear(bannedaddr); @@ -980,7 +984,7 @@ bool p3BanList::addBanEntry( const RsPeerId &peerId, blp.level = level; blp.mTs = time_stamp ; blp.masked_bytes = 0 ; - + it->second.mBanPeers[bannedaddr] = blp; it->second.mLastUpdate = now; updated = true; @@ -1036,7 +1040,7 @@ int p3BanList::condenseBanSources_locked() time_t now = time(NULL); RsPeerId ownId = mServiceCtrl->getOwnId(); - + #ifdef DEBUG_BANLIST std::cerr << "p3BanList::condenseBanSources_locked()"; std::cerr << std::endl; @@ -1062,7 +1066,7 @@ int p3BanList::condenseBanSources_locked() std::cerr << " Condensing Info from peer: " << it->first; std::cerr << std::endl; #endif - + std::map::const_iterator lit; for(lit = it->second.mBanPeers.begin(); lit != it->second.mBanPeers.end(); ++lit) { @@ -1135,7 +1139,7 @@ int p3BanList::condenseBanSources_locked() } } - + #ifdef DEBUG_BANLIST std::cerr << "p3BanList::condenseBanSources_locked() Printing New Set:"; std::cerr << std::endl; @@ -1280,7 +1284,7 @@ int p3BanList::printBanSet_locked(std::ostream &out) int p3BanList::printBanSources_locked(std::ostream &out) { time_t now = time(NULL); - + std::map::const_iterator it; for(it = mBanSources.begin(); it != mBanSources.end(); ++it) { diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index e00417080..ffa7a49fd 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -433,7 +433,7 @@ void MainWindow::initStackedPage() #ifndef RS_RELEASE_VERSION #ifdef PLUGINMGR - addPage(pluginsPage = new PluginsPage(ui->stackPages), grp, NULL); + addPage(pluginsPage = new gui::PluginsPage(ui->stackPages), grp, NULL); #endif #endif @@ -643,10 +643,10 @@ const QList &MainWindow::getUserNotifyList() /*static*/ void MainWindow::displayLobbySystrayMsg(const QString& title,const QString& msg) { - if (_instance == NULL) + if (_instance == NULL) return; - if(Settings->getDisplayTrayChatLobby()) + if(Settings->getDisplayTrayChatLobby()) _instance->displaySystrayMsg(title,msg) ; } @@ -1011,7 +1011,7 @@ void SetForegroundWindowInternal(HWND hWnd) return NULL; } - switch (page) + switch (page) { case Network: return _instance->friendsDialog->networkDialog; @@ -1457,7 +1457,7 @@ void MainWindow::externalLinkActivated(const QUrl &url) int res = mb.exec() ; - if (res == QMessageBox::No) + if (res == QMessageBox::No) return ; if(dontAsk_CB->isChecked()) diff --git a/retroshare-gui/src/gui/PluginsPage.h b/retroshare-gui/src/gui/PluginsPage.h index de90a3d8f..fac165396 100644 --- a/retroshare-gui/src/gui/PluginsPage.h +++ b/retroshare-gui/src/gui/PluginsPage.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. ****************************************************************/ @@ -39,6 +39,8 @@ class QScriptEngine; class PluginManager; +namespace gui { + //! A demo widget for showing plugin engine in action :) @@ -46,7 +48,7 @@ class PluginManager; //! loaded plugin widgets. All specific actions moved to //! PluginManagerWidget class. It contains a PluginManager instance, but it's //! supposed that in future a pluginManager will become a global variable -class PluginsPage : public MainPage +class PluginsPage : public MainPage { Q_OBJECT @@ -70,10 +72,10 @@ protected: QVBoxLayout* pluginPageLayout; QGroupBox* pluginPanel; QVBoxLayout* pluginPanelLayout; - + //! Plugin widgets will be loaded into this tabs QTabWidget* pluginTabs ; - + QVBoxLayout* pmLay; QFrame* pmFrame; QSpacerItem* pmSpacer; @@ -82,5 +84,7 @@ protected: PluginManager* pluginManager; }; +} // namespace gui + #endif diff --git a/retroshare-gui/src/gui/settings/PluginsPage.cpp b/retroshare-gui/src/gui/settings/PluginsPage.cpp index cdc326ec0..4be141c6e 100644 --- a/retroshare-gui/src/gui/settings/PluginsPage.cpp +++ b/retroshare-gui/src/gui/settings/PluginsPage.cpp @@ -33,7 +33,7 @@ #include "../MainWindow.h" -PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags) +settings::PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags) : ConfigPage(parent, flags) { ui.setupUi(this); @@ -123,7 +123,7 @@ PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags) if(plugin == NULL || plugin->qt_config_panel() == NULL) item->_configure_PB->hide() ; - + if(plugin != NULL){ item->enableButton->hide(); @@ -159,7 +159,7 @@ PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags) QObject::connect(ui.enableAll,SIGNAL(toggled(bool)),this,SLOT(toggleEnableAll(bool))) ; } -QString PluginsPage::helpText() const +QString settings::PluginsPage::helpText() const { return tr("

  Plugins

\

Plugins are loaded from the directories listed in the bottom list.

\ @@ -171,11 +171,11 @@ QString PluginsPage::helpText() const

If you want to develop your own plugins, contact the developpers team \ they will be happy to help you out!

") ; } -void PluginsPage::toggleEnableAll(bool b) +void settings::PluginsPage::toggleEnableAll(bool b) { rsPlugins->allowAllPlugins(b) ; } -void PluginsPage::aboutPlugin(int i) +void settings::PluginsPage::aboutPlugin(int i) { std::cerr << "Launching about window for plugin " << i << std::endl; @@ -183,7 +183,7 @@ void PluginsPage::aboutPlugin(int i) if(rsPlugins->plugin(i) != NULL && (dialog = rsPlugins->plugin(i)->qt_about_page()) != NULL) dialog->exec() ; } -void PluginsPage::configurePlugin(int i) +void settings::PluginsPage::configurePlugin(int i) { std::cerr << "Launching configuration window for plugin " << i << std::endl; @@ -191,14 +191,14 @@ void PluginsPage::configurePlugin(int i) rsPlugins->plugin(i)->qt_config_panel()->show() ; } -void PluginsPage::enablePlugin(const QString& hash) +void settings::PluginsPage::enablePlugin(const QString& hash) { std::cerr << "Switching status of plugin " << hash.toStdString() << " to enable" << std::endl; rsPlugins->enablePlugin(RsFileHash(hash.toStdString()) ); } -void PluginsPage::disablePlugin(const QString& hash) +void settings::PluginsPage::disablePlugin(const QString& hash) { std::cerr << "Switching status of plugin " << hash.toStdString() << " to disable " << std::endl; @@ -206,11 +206,11 @@ void PluginsPage::disablePlugin(const QString& hash) } -PluginsPage::~PluginsPage() +settings::PluginsPage::~PluginsPage() { } /** Loads the settings for this page */ -void PluginsPage::load() +void settings::PluginsPage::load() { } diff --git a/retroshare-gui/src/gui/settings/PluginsPage.h b/retroshare-gui/src/gui/settings/PluginsPage.h index 0d8f72dac..0151592af 100644 --- a/retroshare-gui/src/gui/settings/PluginsPage.h +++ b/retroshare-gui/src/gui/settings/PluginsPage.h @@ -24,6 +24,8 @@ #include #include "ui_PluginsPage.h" +namespace settings { + class PluginsPage : public ConfigPage { Q_OBJECT @@ -52,3 +54,4 @@ class PluginsPage : public ConfigPage Ui::PluginsPage ui; }; +} // namespace settings diff --git a/retroshare-gui/src/gui/settings/rsettingswin.cpp b/retroshare-gui/src/gui/settings/rsettingswin.cpp index 0a2b348f0..7f2dcf115 100644 --- a/retroshare-gui/src/gui/settings/rsettingswin.cpp +++ b/retroshare-gui/src/gui/settings/rsettingswin.cpp @@ -158,7 +158,7 @@ SettingsPage::initStackedWidget() addPage(new ForumPage()); // FORUMS addPage(new PostedPage()); // POSTED RENAME TO LINKS addPage(new NotifyPage()); // NOTIFY - addPage(new PluginsPage() ); // PLUGINS + addPage(new settings::PluginsPage() ); // PLUGINS addPage(new AppearancePage()); // APPEARENCE addPage(new SoundPage() ); // SOUND addPage(new ServicePermissionsPage() ); // PERMISSIONS From fd45d44826ff63b37d09986bf13db3e3b1c693ef Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 15 Jul 2018 11:14:58 +0200 Subject: [PATCH 117/138] added interface to get statistics about GxsNetTunnel --- libretroshare/src/gxs/rsgxsnettunnel.cc | 8 ++++ libretroshare/src/gxs/rsgxsnettunnel.h | 60 ++++--------------------- libretroshare/src/libretroshare.pro | 1 + libretroshare/src/rsserver/rsinit.cc | 2 + 4 files changed, 20 insertions(+), 51 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index fc8d5eb79..85fcec2d8 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -39,6 +39,8 @@ static const uint32_t RS_GXS_NET_TUNNEL_MAX_ALLOWED_HITS_GROUP_DATA = 1; static const uint32_t RS_GXS_NET_TUNNEL_MAX_ALLOWED_HITS_GROUP_SEARCH = 100; +RsGxsDistSync *rsGxsDistSync = NULL; + RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") { #warning this is for testing only. In the final version this needs to be initialized with some random content, saved and re-used for a while (e.g. 1 month) @@ -1145,6 +1147,12 @@ void RsGxsNetTunnelService::receiveSearchResult(TurtleSearchRequestId request_id GXS_NET_TUNNEL_ERROR() << ": deserialized item is of unknown type. Dropping!" << std::endl; } +void RsGxsNetTunnelService::getStatistics( std::map& groups,std::map& virtual_peers,Bias20Bytes& bias ) const +{ + groups = mGroups ; + virtual_peers = mVirtualPeers ; + bias = mRandomBias ; +} diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 0fdff3ccc..53cd42b96 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -27,7 +27,8 @@ #include -#include +#include "turtle/p3turtle.h" +#include "retroshare/rsgxsdistsync.h" /*! * \brief The RsGxsNetTunnelService class takes care of requesting tunnels to the turtle router, through which it is possible to sync @@ -102,59 +103,10 @@ // and there is no way to prevent it. We therefore rely on GXS data integrity system to prevent this to happen. // -typedef RsPeerId RsGxsNetTunnelVirtualPeerId ; - class RsGxsNetTunnelItem ; class RsNetworkExchangeService ; -struct RsGxsNetTunnelVirtualPeerInfo -{ - enum { RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN = 0x00, // unknown status. - RS_GXS_NET_TUNNEL_VP_STATUS_TUNNEL_OK = 0x01, // tunnel has been established and we're waiting for virtual peer id - RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE = 0x02 // virtual peer id is known. Data can transfer. - }; - - RsGxsNetTunnelVirtualPeerInfo() : vpid_status(RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN), last_contact(0),side(0) { memset(encryption_master_key,0,32) ; } - virtual ~RsGxsNetTunnelVirtualPeerInfo(){} - - uint8_t vpid_status ; // status of the peer - time_t last_contact ; // last time some data was sent/recvd - uint8_t side ; // client/server - uint8_t encryption_master_key[32]; - - TurtleVirtualPeerId turtle_virtual_peer_id ; // turtle peer to use when sending data to this vpid. - - RsGxsGroupId group_id ; // group that virtual peer is providing - uint16_t service_id ; // this is used for checkng consistency of the incoming data -}; - -struct RsGxsNetTunnelGroupInfo -{ - enum GroupStatus { - RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN = 0x00, // unknown status - RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE = 0x01, // no virtual peers requested, just waiting - RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE = 0x02 // some virtual peers are available. Data can be read/written - }; - - enum GroupPolicy { - RS_GXS_NET_TUNNEL_GRP_POLICY_UNKNOWN = 0x00, // nothing has been set - RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE = 0x01, // group is available for server side tunnels, but does not explicitely request tunnels - RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE = 0x02, // group will only explicitely request tunnels if none available - RS_GXS_NET_TUNNEL_GRP_POLICY_REQUESTING = 0x03, // group explicitely requests tunnels - }; - - RsGxsNetTunnelGroupInfo() : group_policy(RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE),group_status(RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE),last_contact(0) {} - - GroupPolicy group_policy ; - GroupStatus group_status ; - time_t last_contact ; - TurtleFileHash hash ; - uint16_t service_id ; - - std::set virtual_peers ; // list of which virtual peers provide this group. Can me more than 1. -}; - -class RsGxsNetTunnelService: public RsTurtleClientService, public RsTickingThread, public p3Config +class RsGxsNetTunnelService: public RsTurtleClientService, public RsTickingThread, public p3Config, public RsGxsDistSync { public: RsGxsNetTunnelService() ; @@ -257,6 +209,12 @@ public: bool saveList(bool& cleanup, std::list& save); bool loadList(std::list &load); + // Overloads RsGxsDistSync + + void getStatistics(std::map& groups, // groups on the client and server side + std::map& virtual_peers, // current virtual peers, which group they provide, and how to talk to them through turtle + Bias20Bytes& bias) const; + protected: // interaction with turtle router diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index 1b8018167..998f32b51 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -137,6 +137,7 @@ PUBLIC_HEADERS = retroshare/rsdisc.h \ retroshare/rsconfig.h \ retroshare/rsversion.h \ retroshare/rsservicecontrol.h \ + retroshare/rsgxsdistsync.h HEADERS += plugins/pluginmanager.h \ plugins/dlfcn_win32.h \ diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 8ec0d7e8c..877c45488 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -62,6 +62,7 @@ #include #include "gxstunnel/p3gxstunnel.h" +#include "retroshare/rsgxsdistsync.h" #include "file_sharing/p3filelists.h" #define ENABLE_GROUTER @@ -1283,6 +1284,7 @@ int RsServer::StartupRetroShare() #ifdef RS_USE_GXS_DISTANT_SYNC RsGxsNetTunnelService *mGxsNetTunnel = new RsGxsNetTunnelService ; + rsGxsDistSync = mGxsNetTunnel ; #else RsGxsNetTunnelService *mGxsNetTunnel = NULL ; #endif From 34e924f99bc5359ef22dccc37abbdc21315d8918 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 15 Jul 2018 14:40:50 +0200 Subject: [PATCH 118/138] added visualisation for GXS net tunnels (unfinished) --- .../src/gui/statistics/TurtleRouterDialog.cpp | 250 ++++++++++++++---- .../src/gui/statistics/TurtleRouterDialog.h | 44 ++- .../gui/statistics/TurtleRouterStatistics.cpp | 10 +- 3 files changed, 242 insertions(+), 62 deletions(-) diff --git a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp index 7572bdfae..f7d10374e 100644 --- a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp +++ b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp @@ -2,6 +2,9 @@ #include #include #include +#include +#include +#include #include "TurtleRouterDialog.h" #include #include @@ -240,19 +243,14 @@ QTreeWidgetItem *TurtleRouterDialog::findParentHashItem(const std::string& hash) else return items.front() ; } + //=======================================================================================================================// - -GxsTunnelsDialog::GxsTunnelsDialog(QWidget *parent) +TunnelStatisticsDialog::TunnelStatisticsDialog(QWidget *parent) : RsAutoUpdatePage(2000,parent) { -// setupUi(this) ; - m_bProcessSettings = false; - //float fontHeight = QFontMetricsF(font()).height(); - //float fact = fontHeight/14.0; - maxWidth = 200 ; maxHeight = 200 ; @@ -260,14 +258,13 @@ GxsTunnelsDialog::GxsTunnelsDialog(QWidget *parent) processSettings(true); } -GxsTunnelsDialog::~GxsTunnelsDialog() +TunnelStatisticsDialog::~TunnelStatisticsDialog() { - // save settings processSettings(false); } -void GxsTunnelsDialog::processSettings(bool bLoad) +void TunnelStatisticsDialog::processSettings(bool bLoad) { m_bProcessSettings = true; @@ -284,7 +281,77 @@ void GxsTunnelsDialog::processSettings(bool bLoad) m_bProcessSettings = false; } -void GxsTunnelsDialog::updateDisplay() +QString TunnelStatisticsDialog::getPeerName(const RsPeerId &peer_id) +{ + static std::map names ; + + std::map::const_iterator it = names.find(peer_id) ; + + if( it != names.end()) + return it->second ; + else + { + RsPeerDetails detail ; + if(!rsPeers->getPeerDetails(peer_id,detail)) + return tr("Unknown Peer"); + + return (names[peer_id] = QString::fromUtf8(detail.name.c_str())) ; + } +} + +QString TunnelStatisticsDialog::getPeerName(const RsGxsId& gxs_id) +{ + static std::map names ; + + std::map::const_iterator it = names.find(gxs_id) ; + + if( it != names.end()) + return it->second ; + else + { + RsIdentityDetails detail ; + + if(!rsIdentity->getIdDetails(gxs_id,detail)) + return tr("Unknown Peer"); + + return (names[gxs_id] = QString::fromUtf8(detail.mNickname.c_str())) ; + } +} + + +QString TunnelStatisticsDialog::speedString(float f) +{ + if(f < 1.0f) + return QString("0 B/s") ; + if(f < 1024.0f) + return QString::number((int)f)+" B/s" ; + + return QString::number(f/1024.0,'f',2) + " KB/s"; +} + +void TunnelStatisticsDialog::paintEvent(QPaintEvent */*event*/) +{ + QStylePainter(this).drawPixmap(0, 0, pixmap); +} + +void TunnelStatisticsDialog::resizeEvent(QResizeEvent *event) +{ + QRect TaskGraphRect = geometry(); + + maxWidth = TaskGraphRect.width(); + maxHeight = TaskGraphRect.height() ; + + QWidget::resizeEvent(event); + update(); +} +//=======================================================================================================================// + +GxsAuthenticatedTunnelsDialog::GxsAuthenticatedTunnelsDialog(QWidget *parent) + : TunnelStatisticsDialog(parent) +{ +} + +void GxsAuthenticatedTunnelsDialog::updateDisplay() { // Request info about ongoing tunnels @@ -334,8 +401,8 @@ void GxsTunnelsDialog::updateDisplay() // draw... painter.drawText(ox+4*cellx,oy+celly,tr("Tunnel ID: %1").arg(QString::fromStdString(tunnel_infos[i].tunnel_id.toStdString()))) ; oy += celly ; - painter.drawText(ox+6*cellx,oy+celly,tr("from: %1").arg(QString::fromStdString(tunnel_infos[i].source_gxs_id.toStdString()))) ; oy += celly ; - painter.drawText(ox+6*cellx,oy+celly,tr("to: %1").arg(QString::fromStdString(tunnel_infos[i].destination_gxs_id.toStdString()))) ; oy += celly ; + painter.drawText(ox+6*cellx,oy+celly,tr("from: %1 (%2)").arg(QString::fromStdString(tunnel_infos[i].source_gxs_id.toStdString())).arg(getPeerName(tunnel_infos[i].source_gxs_id))) ; oy += celly ; + painter.drawText(ox+6*cellx,oy+celly,tr("to: %1 (%2)").arg(QString::fromStdString(tunnel_infos[i].destination_gxs_id.toStdString())).arg(getPeerName(tunnel_infos[i].destination_gxs_id))) ; oy += celly ; painter.drawText(ox+6*cellx,oy+celly,tr("status: %1").arg(QString::number(tunnel_infos[i].tunnel_status))) ; oy += celly ; painter.drawText(ox+6*cellx,oy+celly,tr("total sent: %1 bytes").arg(QString::number(tunnel_infos[i].total_size_sent))) ; oy += celly ; painter.drawText(ox+6*cellx,oy+celly,tr("total recv: %1 bytes").arg(QString::number(tunnel_infos[i].total_size_received))) ; oy += celly ; @@ -350,46 +417,131 @@ void GxsTunnelsDialog::updateDisplay() maxHeight = std::max(oy,10*celly); } -QString GxsTunnelsDialog::getPeerName(const RsPeerId &peer_id) +//=======================================================================================================================// + +GxsNetTunnelsDialog::GxsNetTunnelsDialog(QWidget *parent) + : TunnelStatisticsDialog(parent) { - static std::map names ; +} - std::map::const_iterator it = names.find(peer_id) ; +static QString getGroupStatusString(RsGxsNetTunnelGroupInfo::GroupStatus group_status) +{ + switch(group_status) + { + default: + case RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN : return QObject::tr("Unknown") ; + case RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE : return QObject::tr("Idle"); + case RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE : return QObject::tr("Virtual peers available"); + } + return QString(); +} - if( it != names.end()) - return it->second ; - else +static QString getGroupPolicyString(RsGxsNetTunnelGroupInfo::GroupPolicy group_policy) +{ + switch(group_policy) + { + default: + case RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_UNKNOWN : return QObject::tr("Unknown") ; + case RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE : return QObject::tr("Passive") ; + case RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE : return QObject::tr("Active") ; + case RsGxsNetTunnelGroupInfo::RS_GXS_NET_TUNNEL_GRP_POLICY_REQUESTING : return QObject::tr("Requesting peers") ; + } + return QString(); +} + +static QString getLastContactString(time_t last_contact) +{ + time_t now = time(NULL); + + if(last_contact == 0) + return QObject::tr("Never"); + + return QString::number(now - last_contact) + " secs ago" ; +} + +static QString getServiceNameString(uint16_t service_id) +{ + static RsPeerServiceInfo ownServices; + + if(ownServices.mServiceList.find(service_id) == ownServices.mServiceList.end()) + rsServiceControl->getOwnServices(ownServices); + + return QString::fromUtf8(ownServices.mServiceList[service_id].mServiceName.c_str()) ; +} + +void GxsNetTunnelsDialog::updateDisplay() +{ + // Request info about ongoing tunnels + + std::map groups; // groups on the client and server side + std::map virtual_peers; // current virtual peers, which group they provide, and how to talk to them through turtle + Bias20Bytes bias; + + rsGxsDistSync->getStatistics(groups,virtual_peers,bias) ; + + // RsGxsNetTunnelGroupInfo: + // + // enum GroupStatus { + // RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN = 0x00, // unknown status + // RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE = 0x01, // no virtual peers requested, just waiting + // RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE = 0x02 // some virtual peers are available. Data can be read/written + // }; + // enum GroupPolicy { + // RS_GXS_NET_TUNNEL_GRP_POLICY_UNKNOWN = 0x00, // nothing has been set + // RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE = 0x01, // group is available for server side tunnels, but does not explicitely request tunnels + // RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE = 0x02, // group will only explicitely request tunnels if none available + // RS_GXS_NET_TUNNEL_GRP_POLICY_REQUESTING = 0x03, // group explicitely requests tunnels + // }; + // + // RsGxsNetTunnelGroupInfo() : group_policy(RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE),group_status(RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE),last_contact(0) {} + // + // GroupPolicy group_policy ; + // GroupStatus group_status ; + // time_t last_contact ; + // RsFileHash hash ; + // uint16_t service_id ; + // std::set virtual_peers ; + + // now draw the shit + QPixmap tmppixmap(maxWidth, maxHeight); + tmppixmap.fill(Qt::transparent); + //setFixedHeight(maxHeight); + + QPainter painter(&tmppixmap); + painter.initFrom(this); + + // extracts the height of the fonts in pixels. This is used to calibrate the size of the objects to draw. + + float fontHeight = QFontMetricsF(font()).height(); + float fact = fontHeight/14.0; + + int cellx = 6*fact ; + int celly = (10+4)*fact ; + int ox=5*fact,oy=5*fact ; + + painter.setPen(QColor::fromRgb(0,0,0)) ; + painter.drawText(ox+2*cellx,oy+celly,tr("GXS Groups:")) ; oy += celly ; + + for(auto it(groups.begin());it!=groups.end();++it) { - RsPeerDetails detail ; - if(!rsPeers->getPeerDetails(peer_id,detail)) - return tr("Unknown Peer"); + // std::cerr << "Drawing into pixmap of size " << maxWidth << "x" << maxHeight << std::endl; + // draw... - return (names[peer_id] = QString::fromUtf8(detail.name.c_str())) ; + painter.drawText(ox+4*cellx,oy+celly,tr("Service: %1 (%2) - Group ID: %3,\t policy: %4, \tstatus: %5, \tlast contact: %6, \t%7 virtual peers.") + .arg(QString::number(it->second.service_id)) + .arg(getServiceNameString(it->second.service_id)) + .arg(QString::fromStdString(it->first.toStdString())) + .arg(getGroupPolicyString(it->second.group_policy)) + .arg(getGroupStatusString(it->second.group_status)) + .arg(getLastContactString(it->second.last_contact)) + .arg(QString::number(it->second.virtual_peers.size())) + ) ; oy += celly ; } -} - -QString GxsTunnelsDialog::speedString(float f) -{ - if(f < 1.0f) - return QString("0 B/s") ; - if(f < 1024.0f) - return QString::number((int)f)+" B/s" ; - - return QString::number(f/1024.0,'f',2) + " KB/s"; -} - -void GxsTunnelsDialog::paintEvent(QPaintEvent */*event*/) -{ - QStylePainter(this).drawPixmap(0, 0, pixmap); -} - -void GxsTunnelsDialog::resizeEvent(QResizeEvent *event) -{ - QRect TaskGraphRect = geometry(); - - maxWidth = TaskGraphRect.width(); - maxHeight = TaskGraphRect.height() ; - - QWidget::resizeEvent(event); - update(); + + painter.drawText(ox+2*cellx,oy+celly,tr("Virtual peers:")) ; oy += celly ; + + // update the pixmap + // + pixmap = tmppixmap; + maxHeight = std::max(oy,10*celly); } diff --git a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.h b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.h index 22bc6dd56..d51e69c68 100644 --- a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.h +++ b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.h @@ -37,29 +37,55 @@ class TurtleRouterDialog: public RsAutoUpdatePage, public Ui::TurtleRouterDialog } ; -class GxsTunnelsDialog: public RsAutoUpdatePage +class TunnelStatisticsDialog: public RsAutoUpdatePage { Q_OBJECT public: - GxsTunnelsDialog(QWidget *parent = NULL) ; - ~GxsTunnelsDialog(); + TunnelStatisticsDialog(QWidget *parent = NULL) ; + ~TunnelStatisticsDialog(); // Cache for peer names. static QString getPeerName(const RsPeerId &peer_id) ; + static QString getPeerName(const RsGxsId& gxs_id); protected: virtual void paintEvent(QPaintEvent *); virtual void resizeEvent(QResizeEvent *event); + + int maxWidth ; + int maxHeight ; + + QPixmap pixmap; + private: void processSettings(bool bLoad); bool m_bProcessSettings; static QString speedString(float f); - virtual void updateDisplay() ; - - int maxWidth ; - int maxHeight ; - - QPixmap pixmap; + virtual void updateDisplay() =0; +} ; + +class GxsAuthenticatedTunnelsDialog: public TunnelStatisticsDialog +{ + Q_OBJECT + +public: + GxsAuthenticatedTunnelsDialog(QWidget *parent = NULL) ; + ~GxsAuthenticatedTunnelsDialog() {} + +private: + virtual void updateDisplay() ; +} ; + +class GxsNetTunnelsDialog: public TunnelStatisticsDialog +{ + Q_OBJECT + +public: + GxsNetTunnelsDialog(QWidget *parent = NULL) ; + ~GxsNetTunnelsDialog() {} + +private: + virtual void updateDisplay() ; } ; diff --git a/retroshare-gui/src/gui/statistics/TurtleRouterStatistics.cpp b/retroshare-gui/src/gui/statistics/TurtleRouterStatistics.cpp index d3e912bbf..ce983f8b5 100644 --- a/retroshare-gui/src/gui/statistics/TurtleRouterStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/TurtleRouterStatistics.cpp @@ -195,11 +195,13 @@ TurtleRouterStatistics::TurtleRouterStatistics(QWidget *parent) _tunnel_statistics_F->setFrameStyle(QFrame::NoFrame); _tunnel_statistics_F->setFocusPolicy(Qt::NoFocus); - routertabWidget->addTab(new TurtleRouterDialog(),QString(tr("Anonymous tunnels"))); - routertabWidget->addTab(new GxsTunnelsDialog(),QString(tr("Authenticated tunnels"))); + routertabWidget->addTab(new TurtleRouterDialog(), QString(tr("File transfer tunnels"))); + routertabWidget->addTab(new GxsAuthenticatedTunnelsDialog(),QString(tr("Authenticated tunnels"))); + routertabWidget->addTab(new GxsNetTunnelsDialog(), QString(tr("GXS sync tunnels") )); + + float fontHeight = QFontMetricsF(font()).height(); + float fact = fontHeight/14.0; - float fontHeight = QFontMetricsF(font()).height(); - float fact = fontHeight/14.0; frmGraph->setMinimumHeight(200*fact); // load settings From cca986ad75f90aa30f7977ca8f157f00adb94f9e Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 15 Jul 2018 15:07:24 +0200 Subject: [PATCH 119/138] added more info to tunnel display --- .../src/gui/statistics/TurtleRouterDialog.cpp | 56 +++++++++++++++++-- 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp index f7d10374e..fa849c1a8 100644 --- a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp +++ b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp @@ -469,6 +469,23 @@ static QString getServiceNameString(uint16_t service_id) return QString::fromUtf8(ownServices.mServiceList[service_id].mServiceName.c_str()) ; } +static QString getVirtualPeerStatusString(uint8_t status) +{ + switch(status) + { + default: + case RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN : return QObject::tr("Unknown") ; + case RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_TUNNEL_OK : return QObject::tr("Tunnel OK") ; + case RsGxsNetTunnelVirtualPeerInfo::RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE : return QObject::tr("Tunnel active") ; + } + return QString(); +} + +static QString getMasterKeyString(uint8_t *key) +{ + return QString(); +} + void GxsNetTunnelsDialog::updateDisplay() { // Request info about ongoing tunnels @@ -523,10 +540,6 @@ void GxsNetTunnelsDialog::updateDisplay() painter.drawText(ox+2*cellx,oy+celly,tr("GXS Groups:")) ; oy += celly ; for(auto it(groups.begin());it!=groups.end();++it) - { - // std::cerr << "Drawing into pixmap of size " << maxWidth << "x" << maxHeight << std::endl; - // draw... - painter.drawText(ox+4*cellx,oy+celly,tr("Service: %1 (%2) - Group ID: %3,\t policy: %4, \tstatus: %5, \tlast contact: %6, \t%7 virtual peers.") .arg(QString::number(it->second.service_id)) .arg(getServiceNameString(it->second.service_id)) @@ -535,11 +548,42 @@ void GxsNetTunnelsDialog::updateDisplay() .arg(getGroupStatusString(it->second.group_status)) .arg(getLastContactString(it->second.last_contact)) .arg(QString::number(it->second.virtual_peers.size())) - ) ; oy += celly ; - } + ),oy+=celly ; + + oy += celly ; + + // struct RsGxsNetTunnelVirtualPeerInfo: + // + // enum { RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN = 0x00, // unknown status. + // RS_GXS_NET_TUNNEL_VP_STATUS_TUNNEL_OK = 0x01, // tunnel has been established and we're waiting for virtual peer id + // RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE = 0x02 // virtual peer id is known. Data can transfer. + // }; + // + // RsGxsNetTunnelVirtualPeerInfo() : vpid_status(RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN), last_contact(0),side(0) { memset(encryption_master_key,0,32) ; } + // virtual ~RsGxsNetTunnelVirtualPeerInfo(){} + // + // uint8_t vpid_status ; // status of the peer + // time_t last_contact ; // last time some data was sent/recvd + // uint8_t side ; // client/server + // uint8_t encryption_master_key[32]; + // + // RsPeerId turtle_virtual_peer_id ; // turtle peer to use when sending data to this vpid. + // + // RsGxsGroupId group_id ; // group that virtual peer is providing + // uint16_t service_id ; // this is used for checkng consistency of the incoming data painter.drawText(ox+2*cellx,oy+celly,tr("Virtual peers:")) ; oy += celly ; + for(auto it(virtual_peers.begin());it!=virtual_peers.end();++it) + painter.drawText(ox+4*cellx,oy+celly,tr("Peer: %1 - Group ID: %2 (service %3),\t status: %4, \tlast contact: %5, \tside %6 \tMaster key: %7.") + .arg(QString::fromStdString(it->first.toStdString())) + .arg(QString::fromStdString(it->second.group_id.toStdString())) + .arg(getServiceNameString(it->second.service_id)) + .arg(getVirtualPeerStatusString(it->second.vpid_status)) + .arg(getLastContactString(it->second.last_contact)) + .arg(getMasterKeyString(it->second.encryption_master_key)) + ),oy+=celly ; + // update the pixmap // pixmap = tmppixmap; From 820841668e72017212cc12a7631e833b5d3a8b3b Mon Sep 17 00:00:00 2001 From: Phenom Date: Sun, 15 Jul 2018 16:37:33 +0200 Subject: [PATCH 120/138] Change Lobby text to Room in CreateLobbyDialog. --- .../src/gui/chat/CreateLobbyDialog.cpp | 2 +- .../src/gui/chat/CreateLobbyDialog.ui | 125 ++++++------------ .../src/gui/qss/stylesheet/Standard.qss | 2 +- 3 files changed, 44 insertions(+), 85 deletions(-) diff --git a/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp b/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp index a9871ab77..b0e5da106 100644 --- a/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp @@ -106,7 +106,7 @@ void CreateLobbyDialog::checkTextFields() break ; } - RsIdentityDetails(idd) ; + RsIdentityDetails idd; rsIdentity->getIdDetails(id,idd) ; diff --git a/retroshare-gui/src/gui/chat/CreateLobbyDialog.ui b/retroshare-gui/src/gui/chat/CreateLobbyDialog.ui index 1d2340e08..77aab56ea 100644 --- a/retroshare-gui/src/gui/chat/CreateLobbyDialog.ui +++ b/retroshare-gui/src/gui/chat/CreateLobbyDialog.ui @@ -11,17 +11,26 @@
- Create Chat Lobby + Create Chat Room :/images/logo/logo_32.png:/images/logo/logo_32.png - + 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -29,11 +38,11 @@ - + - A chat lobby is a decentralized and anonymous chat group. All participants receive all messages. Once the lobby is created you can invite other friends from the Friends tab. + A chat room is a decentralized and anonymous chat group. All participants receive all messages. Once the room is created you can invite other friend nodes with invite button on top right. true @@ -41,16 +50,16 @@ - + - - + + - + - + - Lobby name: + Room name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -61,9 +70,9 @@ - + - Lobby topic: + Room topic: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -74,7 +83,7 @@ - + Identity to use: @@ -84,7 +93,7 @@ - + Visibility: @@ -113,7 +122,7 @@ - <html><head/><body><p>If you check this, only PGP-signed ids can be used to join and talk in this lobby. This limitation prevents anonymous spamming as it becomes possible for at least some people in the lobby to locate the spammer's node.</p></body></html> + <html><head/><body><p>If you check this, only PGP-signed ids can be used to join and talk in this room. This limitation prevents anonymous spamming as it becomes possible for at least some people in the room to locate the spammer's node.</p></body></html> require PGP-signed identities @@ -121,7 +130,7 @@ - + Qt::LeftToRight @@ -136,7 +145,7 @@ - + Qt::Vertical @@ -152,34 +161,37 @@ - + - + Select the Friends with which you want to group chat. - - - true - + - + 0 - 0 + 4 + + + 20 + 0 + + - 52487 - 524287 + 1677215 + 16777215 - 220 + 0 0 @@ -189,59 +201,6 @@ 0 - - false - - - QDockWidget::NoDockWidgetFeatures - - - Invited friends - - - - - 0 - - - 0 - - - - - - 0 - 4 - - - - - 20 - 0 - - - - - 1677215 - 16777215 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - -
@@ -249,7 +208,7 @@ - + QLayout::SetDefaultConstraint diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index 7d518d4c2..2996d4ee5 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -186,7 +186,7 @@ ChatLobbyDialog QListWidget#participantsList { background: white; } -CreateLobbyDialog QFrame#lobbyFrame { +CreateLobbyDialog QFrame#roomFrame { border: 2px solid #CCCCCC; border-radius:6px; background: white; From aaea97d06f133639b2adbb84e1b2f751698f566b Mon Sep 17 00:00:00 2001 From: Phenom Date: Sun, 15 Jul 2018 16:53:52 +0200 Subject: [PATCH 121/138] Remove unneeded Search: text in FriendSelectionWidget.ui --- .../src/gui/common/FriendSelectionWidget.ui | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/retroshare-gui/src/gui/common/FriendSelectionWidget.ui b/retroshare-gui/src/gui/common/FriendSelectionWidget.ui index 23d98c9b6..d3682f014 100644 --- a/retroshare-gui/src/gui/common/FriendSelectionWidget.ui +++ b/retroshare-gui/src/gui/common/FriendSelectionWidget.ui @@ -10,19 +10,21 @@ 320 - - + + + 0 + + + 0 + + + 0 + + 0 - - - Search : - - - - - + From 1de31493a9ea5823d8c990cdda85b217ea00ee40 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 15 Jul 2018 19:09:12 +0200 Subject: [PATCH 122/138] fixed up display of GXS net tunnel info --- libretroshare/src/gxs/rsgxsnettunnel.cc | 3 +- libretroshare/src/gxs/rsgxsnettunnel.h | 1 + libretroshare/src/retroshare/rsgxsdistsync.h | 92 +++++++++++++++++ libretroshare/src/retroshare/rsturtle.h | 1 + .../src/gui/statistics/TurtleRouterDialog.cpp | 98 ++++++++++++------- 5 files changed, 156 insertions(+), 39 deletions(-) create mode 100644 libretroshare/src/retroshare/rsgxsdistsync.h diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 85fcec2d8..1e04c6621 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -1147,10 +1147,11 @@ void RsGxsNetTunnelService::receiveSearchResult(TurtleSearchRequestId request_id GXS_NET_TUNNEL_ERROR() << ": deserialized item is of unknown type. Dropping!" << std::endl; } -void RsGxsNetTunnelService::getStatistics( std::map& groups,std::map& virtual_peers,Bias20Bytes& bias ) const +void RsGxsNetTunnelService::getStatistics(std::map& groups, std::map& virtual_peers, std::map &turtle_vpid_to_net_tunnel_vpid, Bias20Bytes& bias ) const { groups = mGroups ; virtual_peers = mVirtualPeers ; + turtle_vpid_to_net_tunnel_vpid = mTurtle2GxsPeer; bias = mRandomBias ; } diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 53cd42b96..cbac109a9 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -213,6 +213,7 @@ public: void getStatistics(std::map& groups, // groups on the client and server side std::map& virtual_peers, // current virtual peers, which group they provide, and how to talk to them through turtle + std::map& turtle_vpid_to_net_tunnel_vpid, Bias20Bytes& bias) const; protected: diff --git a/libretroshare/src/retroshare/rsgxsdistsync.h b/libretroshare/src/retroshare/rsgxsdistsync.h new file mode 100644 index 000000000..df597f03a --- /dev/null +++ b/libretroshare/src/retroshare/rsgxsdistsync.h @@ -0,0 +1,92 @@ +/* + * RetroShare C++ Interface. + * + * Copyright 2018 by Cyril Soler + * + * 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". + * + */ + +#pragma once + +#include "retroshare/rsfiles.h" +#include "retroshare/rsturtle.h" + +typedef RsPeerId RsGxsNetTunnelVirtualPeerId ; + +struct RsGxsNetTunnelVirtualPeerInfo +{ + enum { RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN = 0x00, // unknown status. + RS_GXS_NET_TUNNEL_VP_STATUS_TUNNEL_OK = 0x01, // tunnel has been established and we're waiting for virtual peer id + RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE = 0x02 // virtual peer id is known. Data can transfer. + }; + + RsGxsNetTunnelVirtualPeerInfo() : vpid_status(RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN), last_contact(0),side(0) { memset(encryption_master_key,0,32) ; } + virtual ~RsGxsNetTunnelVirtualPeerInfo(){} + + uint8_t vpid_status ; // status of the peer + time_t last_contact ; // last time some data was sent/recvd + uint8_t side ; // client/server + uint8_t encryption_master_key[32]; + + TurtleVirtualPeerId turtle_virtual_peer_id ; // turtle peer to use when sending data to this vpid. + + RsGxsGroupId group_id ; // group that virtual peer is providing + uint16_t service_id ; // this is used for checkng consistency of the incoming data +}; + +struct RsGxsNetTunnelGroupInfo +{ + enum GroupStatus { + RS_GXS_NET_TUNNEL_GRP_STATUS_UNKNOWN = 0x00, // unknown status + RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE = 0x01, // no virtual peers requested, just waiting + RS_GXS_NET_TUNNEL_GRP_STATUS_VPIDS_AVAILABLE = 0x02 // some virtual peers are available. Data can be read/written + }; + + enum GroupPolicy { + RS_GXS_NET_TUNNEL_GRP_POLICY_UNKNOWN = 0x00, // nothing has been set + RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE = 0x01, // group is available for server side tunnels, but does not explicitely request tunnels + RS_GXS_NET_TUNNEL_GRP_POLICY_ACTIVE = 0x02, // group will only explicitely request tunnels if none available + RS_GXS_NET_TUNNEL_GRP_POLICY_REQUESTING = 0x03, // group explicitely requests tunnels + }; + + RsGxsNetTunnelGroupInfo() : group_policy(RS_GXS_NET_TUNNEL_GRP_POLICY_PASSIVE),group_status(RS_GXS_NET_TUNNEL_GRP_STATUS_IDLE),last_contact(0) {} + + GroupPolicy group_policy ; + GroupStatus group_status ; + time_t last_contact ; + RsFileHash hash ; + uint16_t service_id ; + + std::set virtual_peers ; // list of which virtual peers provide this group. Can me more than 1. +}; + +// This class is here to provide statistics about GXS dist sync internals. It +// +class RsGxsDistSync +{ + public: + virtual void getStatistics( + std::map& groups, // groups on the client and server side + std::map& virtual_peers, // current virtual peers, which group they provide, and how to talk to them through turtle + std::map& turtle_vpid_to_net_tunnel_vpid, + Bias20Bytes& bias + ) const =0; +}; + +extern RsGxsDistSync *rsGxsDistSync ; + diff --git a/libretroshare/src/retroshare/rsturtle.h b/libretroshare/src/retroshare/rsturtle.h index 1b3cb1b7e..4130a9bea 100644 --- a/libretroshare/src/retroshare/rsturtle.h +++ b/libretroshare/src/retroshare/rsturtle.h @@ -44,6 +44,7 @@ class RsTurtle; extern RsTurtle *rsTurtle ; typedef uint32_t TurtleRequestId ; +typedef RsPeerId TurtleVirtualPeerId; // This is the structure used to send back results of the turtle search // to the notifyBase class, or send info to the GUI. diff --git a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp index fa849c1a8..bbabb8fd6 100644 --- a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp +++ b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -481,9 +482,14 @@ static QString getVirtualPeerStatusString(uint8_t status) return QString(); } +static QString getSideString(uint8_t side) +{ + return side?QObject::tr("Client"):QObject::tr("Server") ; +} + static QString getMasterKeyString(uint8_t *key) { - return QString(); + return QString::fromStdString(RsUtil::BinToHex(key,10)); } void GxsNetTunnelsDialog::updateDisplay() @@ -491,10 +497,11 @@ void GxsNetTunnelsDialog::updateDisplay() // Request info about ongoing tunnels std::map groups; // groups on the client and server side + std::map turtle2gxsnettunnel; // convertion table from turtle to net tunnel virtual peer id std::map virtual_peers; // current virtual peers, which group they provide, and how to talk to them through turtle Bias20Bytes bias; - rsGxsDistSync->getStatistics(groups,virtual_peers,bias) ; + rsGxsDistSync->getStatistics(groups,virtual_peers,turtle2gxsnettunnel,bias) ; // RsGxsNetTunnelGroupInfo: // @@ -518,6 +525,29 @@ void GxsNetTunnelsDialog::updateDisplay() // RsFileHash hash ; // uint16_t service_id ; // std::set virtual_peers ; + // + // struct RsGxsNetTunnelVirtualPeerInfo: + // + // enum { RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN = 0x00, // unknown status. + // RS_GXS_NET_TUNNEL_VP_STATUS_TUNNEL_OK = 0x01, // tunnel has been established and we're waiting for virtual peer id + // RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE = 0x02 // virtual peer id is known. Data can transfer. + // }; + // + // RsGxsNetTunnelVirtualPeerInfo() : vpid_status(RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN), last_contact(0),side(0) { memset(encryption_master_key,0,32) ; } + // virtual ~RsGxsNetTunnelVirtualPeerInfo(){} + // + // uint8_t vpid_status ; // status of the peer + // time_t last_contact ; // last time some data was sent/recvd + // uint8_t side ; // client/server + // uint8_t encryption_master_key[32]; + // + // RsPeerId turtle_virtual_peer_id ; // turtle peer to use when sending data to this vpid. + // + // RsGxsGroupId group_id ; // group that virtual peer is providing + // uint16_t service_id ; // this is used for checkng consistency of the incoming data + + // update the pixmap + // // now draw the shit QPixmap tmppixmap(maxWidth, maxHeight); @@ -540,52 +570,44 @@ void GxsNetTunnelsDialog::updateDisplay() painter.drawText(ox+2*cellx,oy+celly,tr("GXS Groups:")) ; oy += celly ; for(auto it(groups.begin());it!=groups.end();++it) - painter.drawText(ox+4*cellx,oy+celly,tr("Service: %1 (%2) - Group ID: %3,\t policy: %4, \tstatus: %5, \tlast contact: %6, \t%7 virtual peers.") + { + painter.drawText(ox+4*cellx,oy+celly,tr("Service: %1 (%2) - Group ID: %3,\t policy: %4, \tstatus: %5, \tlast contact: %6") .arg(QString::number(it->second.service_id)) .arg(getServiceNameString(it->second.service_id)) .arg(QString::fromStdString(it->first.toStdString())) .arg(getGroupPolicyString(it->second.group_policy)) .arg(getGroupStatusString(it->second.group_status)) .arg(getLastContactString(it->second.last_contact)) - .arg(QString::number(it->second.virtual_peers.size())) ),oy+=celly ; + + for(auto it2(it->second.virtual_peers.begin());it2!=it->second.virtual_peers.end();++it2) + { + auto it4 = turtle2gxsnettunnel.find(*it2) ; + + if(it4 != turtle2gxsnettunnel.end()) + { + auto it3 = virtual_peers.find(it4->second) ; + + if(virtual_peers.end() != it3) + painter.drawText(ox+6*cellx,oy+celly,tr("Peer: %1:\tstatus: %2/%3, \tlast contact: %4, \tMaster key: %5.") + .arg(QString::fromStdString((*it2).toStdString())) + .arg(getVirtualPeerStatusString(it3->second.vpid_status)) + .arg(getSideString(it3->second.side)) + .arg(getLastContactString(it3->second.last_contact)) + .arg(getMasterKeyString(it3->second.encryption_master_key)) + ),oy+=celly ; + } + else + painter.drawText(ox+6*cellx,oy+celly,tr("Peer: %1: no information available") + .arg(QString::fromStdString((*it2).toStdString())) + ),oy+=celly; + + } + } + oy += celly ; - // struct RsGxsNetTunnelVirtualPeerInfo: - // - // enum { RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN = 0x00, // unknown status. - // RS_GXS_NET_TUNNEL_VP_STATUS_TUNNEL_OK = 0x01, // tunnel has been established and we're waiting for virtual peer id - // RS_GXS_NET_TUNNEL_VP_STATUS_ACTIVE = 0x02 // virtual peer id is known. Data can transfer. - // }; - // - // RsGxsNetTunnelVirtualPeerInfo() : vpid_status(RS_GXS_NET_TUNNEL_VP_STATUS_UNKNOWN), last_contact(0),side(0) { memset(encryption_master_key,0,32) ; } - // virtual ~RsGxsNetTunnelVirtualPeerInfo(){} - // - // uint8_t vpid_status ; // status of the peer - // time_t last_contact ; // last time some data was sent/recvd - // uint8_t side ; // client/server - // uint8_t encryption_master_key[32]; - // - // RsPeerId turtle_virtual_peer_id ; // turtle peer to use when sending data to this vpid. - // - // RsGxsGroupId group_id ; // group that virtual peer is providing - // uint16_t service_id ; // this is used for checkng consistency of the incoming data - - painter.drawText(ox+2*cellx,oy+celly,tr("Virtual peers:")) ; oy += celly ; - - for(auto it(virtual_peers.begin());it!=virtual_peers.end();++it) - painter.drawText(ox+4*cellx,oy+celly,tr("Peer: %1 - Group ID: %2 (service %3),\t status: %4, \tlast contact: %5, \tside %6 \tMaster key: %7.") - .arg(QString::fromStdString(it->first.toStdString())) - .arg(QString::fromStdString(it->second.group_id.toStdString())) - .arg(getServiceNameString(it->second.service_id)) - .arg(getVirtualPeerStatusString(it->second.vpid_status)) - .arg(getLastContactString(it->second.last_contact)) - .arg(getMasterKeyString(it->second.encryption_master_key)) - ),oy+=celly ; - - // update the pixmap - // pixmap = tmppixmap; maxHeight = std::max(oy,10*celly); } From a52c94d23c0f061c4a6f746a59fc8fc7d78dc8ef Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 15 Jul 2018 19:15:05 +0200 Subject: [PATCH 123/138] improved display of encryption master key --- retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp index bbabb8fd6..c8f34c8b9 100644 --- a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp +++ b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp @@ -489,7 +489,7 @@ static QString getSideString(uint8_t side) static QString getMasterKeyString(uint8_t *key) { - return QString::fromStdString(RsUtil::BinToHex(key,10)); + return QString::fromStdString(RsUtil::BinToHex(key,32,10)); } void GxsNetTunnelsDialog::updateDisplay() From 55e99ef0d1f9b292ffb0c75816c8b2480c14a9dd Mon Sep 17 00:00:00 2001 From: sehraf Date: Mon, 16 Jul 2018 23:22:04 +0200 Subject: [PATCH 124/138] add auto detection of installed rapidjson --- libretroshare/src/serialiser/rsserializer.h | 4 ++++ libretroshare/src/serialiser/rstypeserializer.cc | 5 ++++- libretroshare/src/serialiser/rstypeserializer.h | 4 ++++ libretroshare/src/use_libretroshare.pri | 10 +++++++++- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/serialiser/rsserializer.h b/libretroshare/src/serialiser/rsserializer.h index 35dc091c3..6bde6930c 100644 --- a/libretroshare/src/serialiser/rsserializer.h +++ b/libretroshare/src/serialiser/rsserializer.h @@ -154,7 +154,11 @@ #include #include #include +#ifdef HAS_RAPIDJSON +#include +#else #include +#endif // HAS_RAPIDJSON #include "retroshare/rsflags.h" #include "serialiser/rsserial.h" diff --git a/libretroshare/src/serialiser/rstypeserializer.cc b/libretroshare/src/serialiser/rstypeserializer.cc index 72d20ecc2..79a3eaab0 100644 --- a/libretroshare/src/serialiser/rstypeserializer.cc +++ b/libretroshare/src/serialiser/rstypeserializer.cc @@ -36,8 +36,11 @@ #include #include // for typeid -#include +#ifdef HAS_RAPIDJSON +#include +#else #include +#endif // HAS_RAPIDJSON //static const uint32_t MAX_SERIALIZED_ARRAY_SIZE = 500 ; static const uint32_t MAX_SERIALIZED_CHUNK_SIZE = 10*1024*1024 ; // 10 MB. diff --git a/libretroshare/src/serialiser/rstypeserializer.h b/libretroshare/src/serialiser/rstypeserializer.h index 3e3c0b251..e91aa0c45 100644 --- a/libretroshare/src/serialiser/rstypeserializer.h +++ b/libretroshare/src/serialiser/rstypeserializer.h @@ -35,7 +35,11 @@ #include "serialiser/rsserializer.h" #include "serialiser/rsserializable.h" +#ifdef HAS_RAPIDJSON +#include +#else #include +#endif // HAS_RAPIDJSON #include // for typeid #include #include diff --git a/libretroshare/src/use_libretroshare.pri b/libretroshare/src/use_libretroshare.pri index 3a3d1acb7..7c5af09b7 100644 --- a/libretroshare/src/use_libretroshare.pri +++ b/libretroshare/src/use_libretroshare.pri @@ -16,7 +16,15 @@ bitdht { # when rapidjson is mainstream on all distribs, we will not need the sources # anymore in the meantime, they are part of the RS directory so that it is # always possible to find them -INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../rapidjson-1.1.0)) +RAPIDJSON_AVAILABLE = $$system(pkg-config --atleast-version 1.1 RapidJSON && echo yes) +isEmpty(RAPIDJSON_AVAILABLE) { + message("using built-in rapidjson") + INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../rapidjson-1.1.0)) +} else { + message("using systems rapidjson") + DEFINES *= HAS_RAPIDJSON +} + sLibs = mLibs = $$RS_SQL_LIB ssl crypto $$RS_THREAD_LIB $$RS_UPNP_LIB From b9436fbef27c941a0818f53280b5e765d0f5aa09 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 17 Jul 2018 10:08:39 +0200 Subject: [PATCH 125/138] fixed leading zeroes problem in title bar --- retroshare-gui/src/rshare.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/rshare.cpp b/retroshare-gui/src/rshare.cpp index ff6038de0..a87ad358f 100644 --- a/retroshare-gui/src/rshare.cpp +++ b/retroshare-gui/src/rshare.cpp @@ -360,7 +360,7 @@ QString Rshare::retroshareVersion(bool withRevision) { QString version = QString("%1.%2.%3%4").arg(RS_MAJOR_VERSION).arg(RS_MINOR_VERSION).arg(RS_BUILD_NUMBER).arg(RS_BUILD_NUMBER_ADD); if (withRevision) { - version += QString(" %1 %2").arg(tr("Revision")).arg(QString::number(RS_REVISION_NUMBER,16)); + version += QString(" %1 %2").arg(tr("Revision")).arg(RS_REVISION_NUMBER,8,16,QChar('0')); } return version; From 9b0a4b966e2d90bb563bd97ead25edec4b873d33 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 18 Jul 2018 21:20:51 +0200 Subject: [PATCH 126/138] removed extra call to loadConfiguration() --- libretroshare/src/rsserver/rsinit.cc | 41 +++++++++++++--------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 877c45488..ba84eda17 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1631,46 +1631,43 @@ int RsServer::StartupRetroShare() //mConfigMgr->addConfiguration("ftserver.cfg", ftserver); // - mConfigMgr->addConfiguration("gpg_prefs.cfg", AuthGPG::getAuthGPG()); + mConfigMgr->addConfiguration("gpg_prefs.cfg" , AuthGPG::getAuthGPG()); mConfigMgr->addConfiguration("gxsnettunnel.cfg", mGxsNetTunnel); - 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("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 From dac885e24dc7172aae1071c7d45c5e4b541def1d Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 18 Jul 2018 21:22:38 +0200 Subject: [PATCH 127/138] made randomBias initilized with true random bytes at start --- libretroshare/src/gxs/rsgxsnettunnel.cc | 16 +++++++--------- libretroshare/src/pqi/p3cfgmgr.cc | 6 +++--- retroshare-gui/src/gui/common/GroupTreeWidget.ui | 6 +++++- .../src/gui/gxs/GxsGroupFrameDialog.ui | 13 +++++++++++-- .../src/gui/statistics/TurtleRouterDialog.cpp | 7 ++++--- 5 files changed, 30 insertions(+), 18 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index 1e04c6621..a35026a74 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -30,7 +30,7 @@ #include "gxs/rsnxs.h" #include "rsgxsnettunnel.h" -//#define DEBUG_RSGXSNETTUNNEL 1 +#define DEBUG_RSGXSNETTUNNEL 1 #define GXS_NET_TUNNEL_NOT_IMPLEMENTED() { std::cerr << __PRETTY_FUNCTION__ << ": not yet implemented." << std::endl; } #define GXS_NET_TUNNEL_DEBUG() std::cerr << time(NULL) << " : GXS_NET_TUNNEL: " << __FUNCTION__ << " : " @@ -43,7 +43,6 @@ RsGxsDistSync *rsGxsDistSync = NULL; RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") { -#warning this is for testing only. In the final version this needs to be initialized with some random content, saved and re-used for a while (e.g. 1 month) mRandomBias.clear(); mLastKeepAlive = time(NULL) + (lrand48()%20); // adds some variance in order to avoid doing all this tasks at once across services @@ -779,14 +778,10 @@ const Bias20Bytes& RsGxsNetTunnelService::locked_randomBias() { if(mRandomBias.isNull()) { -#ifdef DEBUG_RSGXSNETTUNNEL -#warning /!\ this is for testing only! Remove this when done! Can not be done at initialization when rsPeer is not started. - RsPeerId ssl_id = rsPeers->getOwnId() ; - mRandomBias = Bias20Bytes(RsDirUtil::sha1sum(ssl_id.toByteArray(),ssl_id.SIZE_IN_BYTES)) ; -#else mRandomBias = Bias20Bytes::random(); -#endif IndicateConfigChanged(); + + std::cerr << "Initialized RsGxsNetTunnel random bias to " << RsUtil::BinToHex(mRandomBias.toByteArray(),mRandomBias.SIZE_IN_BYTES) << std::endl; } return mRandomBias ; @@ -796,7 +791,7 @@ RsGxsNetTunnelVirtualPeerId RsGxsNetTunnelService::locked_makeVirtualPeerId(cons { assert(RsPeerId::SIZE_IN_BYTES <= Sha1CheckSum::SIZE_IN_BYTES) ;// so that we can build the virtual PeerId from a SHA1 sum. - // We compute sha1( SSL_id | mRandomBias ) and trunk it to 16 bytes in order to compute a RsPeerId + // We compute sha1( GroupId | mRandomBias ) and trunk it to 16 bytes in order to compute a RsPeerId Bias20Bytes rb(locked_randomBias()); @@ -934,6 +929,7 @@ bool RsGxsNetTunnelService::saveList(bool& cleanup, std::list& save) { RS_STACK_MUTEX(mGxsNetTunnelMtx); it2->mRandomBias = mRandomBias; + std::cerr << "Saving RsGxsNetTunnel random bias to disc" << std::endl; } save.push_back(it2) ; @@ -952,6 +948,8 @@ bool RsGxsNetTunnelService::loadList(std::list &load) { RS_STACK_MUTEX(mGxsNetTunnelMtx); mRandomBias = rbsi->mRandomBias; + + std::cerr << "Loaded RsGxsNetTunnel random bias from disc: " << RsUtil::BinToHex(mRandomBias.toByteArray(),mRandomBias.SIZE_IN_BYTES) << std::endl; } else GXS_NET_TUNNEL_ERROR() << " unknown item in config file: type=" << std::hex << (*it)->PacketId() << std::dec << std::endl; diff --git a/libretroshare/src/pqi/p3cfgmgr.cc b/libretroshare/src/pqi/p3cfgmgr.cc index 3266f68d4..97d8165a3 100644 --- a/libretroshare/src/pqi/p3cfgmgr.cc +++ b/libretroshare/src/pqi/p3cfgmgr.cc @@ -65,7 +65,7 @@ void p3ConfigMgr::tick() #ifdef CONFIG_DEBUG std::cerr << "p3ConfigMgr::tick() Config Changed - Element: "; - std::cerr << it->first; + std::cerr << *it; std::cerr << std::endl; #endif @@ -111,7 +111,7 @@ void p3ConfigMgr::saveConfig() { #ifdef CONFIG_DEBUG std::cerr << "p3ConfigMgr::globalSaveConfig() Saving Element: "; - std::cerr << it->first; + std::cerr << *it; std::cerr << std::endl; #endif ok &= (*it)->saveConfiguration(); @@ -137,7 +137,7 @@ void p3ConfigMgr::loadConfig() { #ifdef CONFIG_DEBUG std::cerr << "p3ConfigMgr::loadConfig() Element: "; - std::cerr << cit->first <<"Dummy Hash: " << dummyHash; + std::cerr << *cit <<" Dummy Hash: " << dummyHash; std::cerr << std::endl; #endif diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.ui b/retroshare-gui/src/gui/common/GroupTreeWidget.ui index 7591c6a1c..26167dcd7 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.ui +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.ui @@ -125,7 +125,11 @@ - + + + <html><head/><body><p>Searches a single keyword into the reachable network.</p><p>Objects already provided by friend nodes are not reported.</p></body></html> + + diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.ui b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.ui index 274207b5c..7431deb97 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.ui +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.ui @@ -7,7 +7,7 @@ 0 0 619 - 420 + 493 @@ -38,7 +38,16 @@ QFrame::Sunken - + + 2 + + + 2 + + + 2 + + 2 diff --git a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp index c8f34c8b9..b81264e77 100644 --- a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp +++ b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp @@ -487,9 +487,9 @@ static QString getSideString(uint8_t side) return side?QObject::tr("Client"):QObject::tr("Server") ; } -static QString getMasterKeyString(uint8_t *key) +static QString getMasterKeyString(const uint8_t *key,uint32_t size) { - return QString::fromStdString(RsUtil::BinToHex(key,32,10)); + return QString::fromStdString(RsUtil::BinToHex(key,size,10)); } void GxsNetTunnelsDialog::updateDisplay() @@ -567,6 +567,7 @@ void GxsNetTunnelsDialog::updateDisplay() int ox=5*fact,oy=5*fact ; painter.setPen(QColor::fromRgb(0,0,0)) ; + painter.drawText(ox+2*cellx,oy+celly,tr("Random Bias: %1").arg(getMasterKeyString(bias.toByteArray(),20))) ; oy += celly ; painter.drawText(ox+2*cellx,oy+celly,tr("GXS Groups:")) ; oy += celly ; for(auto it(groups.begin());it!=groups.end();++it) @@ -595,7 +596,7 @@ void GxsNetTunnelsDialog::updateDisplay() .arg(getVirtualPeerStatusString(it3->second.vpid_status)) .arg(getSideString(it3->second.side)) .arg(getLastContactString(it3->second.last_contact)) - .arg(getMasterKeyString(it3->second.encryption_master_key)) + .arg(getMasterKeyString(it3->second.encryption_master_key,32)) ),oy+=celly ; } else From d4fce07e4c2d375ac65415fcb6c1b0450e1b5b62 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 19 Jul 2018 23:46:31 +0200 Subject: [PATCH 128/138] changed lrand48 to RSRandom for cross-plateform compatibility, in rsgxsnettunnel.cc --- libretroshare/src/gxs/rsgxsnettunnel.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index a35026a74..ff3134493 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -45,9 +45,9 @@ RsGxsNetTunnelService::RsGxsNetTunnelService(): mGxsNetTunnelMtx("GxsNetTunnel") { mRandomBias.clear(); - mLastKeepAlive = time(NULL) + (lrand48()%20); // adds some variance in order to avoid doing all this tasks at once across services - mLastAutoWash = time(NULL) + (lrand48()%20); - mLastDump = time(NULL) + (lrand48()%20); + mLastKeepAlive = time(NULL) + (RSRandom::random_u32()%20); // adds some variance in order to avoid doing all this tasks at once across services + mLastAutoWash = time(NULL) + (RSRandom::random_u32()%20); + mLastDump = time(NULL) + (RSRandom::random_u32()%20); } //===========================================================================================================================================// From 3fc9ff3fef95cbca2fab51967280b704d5c8aec8 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Fri, 20 Jul 2018 15:29:37 +0200 Subject: [PATCH 129/138] WIP Plug deep search into GXS search --- libretroshare/src/gxs/rsgxsnetservice.cc | 53 ++++++++++++++++++++--- libretroshare/src/retroshare/rsgxsiface.h | 5 ++- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index d8a882945..6818caae6 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -260,6 +260,10 @@ #include "util/rsmemory.h" #include "util/stacktrace.h" +#ifdef RS_DEEP_SEARCH +# include "deep_search/deep_search.h" +#endif + /*** * Use the following defines to debug: NXS_NET_DEBUG_0 shows group update high level information @@ -5271,16 +5275,52 @@ void RsGxsNetService::receiveTurtleSearchResults(TurtleRequestId req,const unsig mObserver->receiveNewGroups(new_grps); } -bool RsGxsNetService::search(const std::string& substring,std::list& group_infos) +bool RsGxsNetService::search( const std::string& substring, + std::list& group_infos ) { + group_infos.clear(); + RsGxsGrpMetaTemporaryMap grpMetaMap; - { + { RS_STACK_MUTEX(mNxsMutex) ; mDataStore->retrieveGxsGrpMetaData(grpMetaMap); - } + } +#ifdef RS_DEEP_SEARCH + std::vector results; + DeepSearch::search(substring, results, 0); + + for(auto dsr : results) + { + RsUrl rUrl(dsr.mUrl); + auto rit = rUrl.query().find("id"); + if(rit != rUrl.query().end()) + { + RsGroupNetworkStats stats; + RsGxsGroupId grpId(rit->second); + RsGxsGrpMetaTemporaryMap::iterator mIt; + if( !grpId.isNull() && + (mIt = grpMetaMap.find(grpId)) != grpMetaMap.end() && + getGroupNetworkStats(grpId, stats) ) + { + RsGxsGrpMetaData& gMeta(*mIt->second); + RsGxsGroupSummary s; + s.group_id = grpId; + s.group_name = gMeta.mGroupName; + s.search_context = dsr.mSnippet; + s.sign_flags = gMeta.mSignFlags; + s.publish_ts = gMeta.mSignFlags; + s.author_id = gMeta.mAuthorId; + s.number_of_messages = stats.mMaxVisibleCount; + s.last_message_ts = stats.mLastGroupModificationTS; + s.popularity = gMeta.mPop; + + group_infos.push_back(s); + } + } + } +#else // RS_DEEP_SEARCH RsGroupNetworkStats stats ; - for(auto it(grpMetaMap.begin());it!=grpMetaMap.end();++it) if(termSearch(it->second->mGroupName,substring)) { @@ -5289,7 +5329,7 @@ bool RsGxsNetService::search(const std::string& substring,std::listfirst ; s.group_name = it->second->mGroupName ; - s.group_description = it->second->mGroupName ; // to be filled with something better when we use the real search + // to be filled with something better when we use the real search s.search_context = it->second->mGroupName ; s.sign_flags = it->second->mSignFlags; s.publish_ts = it->second->mPublishTs; @@ -5298,8 +5338,9 @@ bool RsGxsNetService::search(const std::string& substring,std::listsecond->mPop; - group_infos.push_back(s) ; + group_infos.push_back(s); } +#endif // RS_DEEP_SEARCH #ifdef NXS_NET_DEBUG_8 GXSNETDEBUG___ << " performing local substring search in response to distant request. Found " << group_infos.size() << " responses." << std::endl; diff --git a/libretroshare/src/retroshare/rsgxsiface.h b/libretroshare/src/retroshare/rsgxsiface.h index bdf65c115..7ccedff36 100644 --- a/libretroshare/src/retroshare/rsgxsiface.h +++ b/libretroshare/src/retroshare/rsgxsiface.h @@ -31,6 +31,7 @@ #include "retroshare/rsgxsservice.h" #include "gxs/rsgxsdata.h" #include "retroshare/rsgxsifacetypes.h" +#include "util/rsdeprecate.h" /*! * \brief The RsGxsGroupSymmary struct @@ -44,8 +45,8 @@ struct RsGxsGroupSummary RsGxsGroupId group_id ; - std::string group_name ; - std::string group_description ; + std::string group_name ; + RS_DEPRECATED std::string group_description; std::string search_context ; RsGxsId author_id ; time_t publish_ts ; From 8149ef9e45fe421df333faf976f4587d48f4245e Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sat, 21 Jul 2018 01:17:28 +0200 Subject: [PATCH 130/138] Install xapian dependency in Continuos Integration --- .travis.yml | 4 ++-- appveyor.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4ecc0dab7..e11da2148 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,10 +13,10 @@ matrix: before_install: - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update; fi - - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y build-essential libssl-dev libsqlcipher-dev libbz2-dev libmicrohttpd-dev libsqlite3-dev libupnp-dev pkg-config qt5-default libxss-dev qtmultimedia5-dev libqt5x11extras5-dev libqt5designer5 qttools5-dev; fi + - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y build-essential libssl-dev libsqlcipher-dev libbz2-dev libmicrohttpd-dev libsqlite3-dev libupnp-dev pkg-config qt5-default libxss-dev qtmultimedia5-dev libqt5x11extras5-dev libqt5designer5 libxapian-dev qttools5-dev; fi - if [ $TRAVIS_OS_NAME == osx ]; then brew update ; fi - - if [ $TRAVIS_OS_NAME == osx ]; then brew install qt55 openssl miniupnpc libmicrohttpd sqlcipher; fi + - if [ $TRAVIS_OS_NAME == osx ]; then brew install qt55 openssl miniupnpc libmicrohttpd sqlcipher xapian; fi - if [ $TRAVIS_OS_NAME == osx ]; then brew link --force qt55 ; fi - wget https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz diff --git a/appveyor.yml b/appveyor.yml index 6f26a1c67..8764ef0f5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -88,7 +88,7 @@ install: # Configuring MSys2 - set PATH=C:\msys64\usr\bin;%PATH% - set PATH=C:\msys64\mingw32\bin;%PATH% - - pacman --noconfirm -S mingw-w64-i686-qt5 mingw-w64-i686-miniupnpc mingw-w64-i686-sqlcipher mingw-w64-i686-libmicrohttpd + - pacman --noconfirm -S mingw-w64-i686-qt5 mingw-w64-i686-miniupnpc mingw-w64-i686-sqlcipher mingw-w64-i686-libmicrohttpd mingw-w64-xapian-core #- pacman --noconfirm -S mingw-w64-i686-qt5-static mingw-w64-i686-miniupnpc mingw-w64-i686-sqlcipher mingw-w64-i686-libmicrohttpd #- set PATH=C:\msys64\mingw32\qt5-static\bin\;%PATH% From 6982ae6cd5be55ab79135f6bfa1adc88f9f621e2 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sat, 21 Jul 2018 13:20:50 +0200 Subject: [PATCH 131/138] Improve retrocompatibility with older xapian --- libretroshare/src/deep_search/deep_search.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/deep_search/deep_search.h b/libretroshare/src/deep_search/deep_search.h index 7152e34ce..368aa7e84 100644 --- a/libretroshare/src/deep_search/deep_search.h +++ b/libretroshare/src/deep_search/deep_search.h @@ -25,6 +25,13 @@ #include "retroshare/rsinit.h" #include "util/rsurl.h" +#ifndef XAPIAN_AT_LEAST +#define XAPIAN_AT_LEAST(A,B,C) (XAPIAN_MAJOR_VERSION > (A) || \ + (XAPIAN_MAJOR_VERSION == (A) && \ + (XAPIAN_MINOR_VERSION > (B) || \ + (XAPIAN_MINOR_VERSION == (B) && XAPIAN_REVISION >= (C))))) +#endif // ndef XAPIAN_AT_LEAST + struct DeepSearch { struct SearchResult @@ -66,10 +73,11 @@ struct DeepSearch for ( Xapian::MSetIterator m = mset.begin(); m != mset.end(); ++m ) { const Xapian::Document& doc = m.get_document(); - SearchResult s; s.mUrl = doc.get_value(URL_VALUENO); +#if XAPIAN_AT_LEAST(1,3,5) s.mSnippet = mset.snippet(doc.get_data()); +#endif // XAPIAN_AT_LEAST(1,3,5) results.push_back(s); } From 2ab12a2ef57a59fb603cb6ff2f3be03443ef97c2 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 22 Jul 2018 00:21:45 +0200 Subject: [PATCH 132/138] fixed deadlock due to turtle calling addVirtualPeer for client services inside a mutex protected zone (breaks mutex order service > turtle) --- libretroshare/src/turtle/p3turtle.cc | 49 +++++++++++++++------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 0db63a7df..9366d5b34 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -1611,8 +1611,6 @@ void p3turtle::handleTunnelRequest(RsTurtleOpenTunnelItem *item) } { - RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ - if(found) { #ifdef P3TURTLE_DEBUG @@ -1621,37 +1619,44 @@ void p3turtle::handleTunnelRequest(RsTurtleOpenTunnelItem *item) // Send back tunnel ok to the same guy // RsTurtleTunnelOkItem *res_item = new RsTurtleTunnelOkItem ; + TurtleVirtualPeerId vpid ; res_item->request_id = item->request_id ; - res_item->tunnel_id = item->partial_tunnel_id ^ generatePersonalFilePrint(item->file_hash,_random_bias,false) ; - res_item->PeerId(item->PeerId()) ; + { + RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ + res_item->tunnel_id = item->partial_tunnel_id ^ generatePersonalFilePrint(item->file_hash,_random_bias,false) ; - TurtleTunnelId t_id = res_item->tunnel_id ; // save it because sendItem deletes the item + res_item->PeerId(item->PeerId()) ; - sendItem(res_item) ; + TurtleTunnelId t_id = res_item->tunnel_id ; // save it because sendItem deletes the item - // Note in the tunnels list that we have an ending tunnel here. - TurtleTunnel tt ; - tt.local_src = item->PeerId() ; - tt.hash = item->file_hash ; - tt.local_dst = _own_id ; // this means us - tt.time_stamp = time(NULL) ; - tt.transfered_bytes = 0 ; - tt.speed_Bps = 0.0f ; + sendItem(res_item) ; - _local_tunnels[t_id] = tt ; + // Note in the tunnels list that we have an ending tunnel here. + TurtleTunnel tt ; + tt.local_src = item->PeerId() ; + tt.hash = item->file_hash ; + tt.local_dst = _own_id ; // this means us + tt.time_stamp = time(NULL) ; + tt.transfered_bytes = 0 ; + tt.speed_Bps = 0.0f ; - // We add a virtual peer for that tunnel+hash combination. - // - locked_addDistantPeer(item->file_hash,t_id) ; + _local_tunnels[t_id] = tt ; - // Store some info string about the tunnel. - // - _outgoing_tunnel_client_services[t_id] = service ; + // We add a virtual peer for that tunnel+hash combination. + // + locked_addDistantPeer(item->file_hash,t_id) ; + + // Store some info string about the tunnel. + // + _outgoing_tunnel_client_services[t_id] = service ; + + vpid = _local_tunnels[t_id].vpid; + } // Notify the client service that there's a new virtual peer id available as a client. // - service->addVirtualPeer(item->file_hash,_local_tunnels[t_id].vpid,RsTurtleGenericTunnelItem::DIRECTION_CLIENT) ; + service->addVirtualPeer(item->file_hash,vpid,RsTurtleGenericTunnelItem::DIRECTION_CLIENT) ; // We return straight, because when something is found, there's no need to digg a tunnel further. // From d03ee1c0b08872312d6ff3bb712e73c55290e4d1 Mon Sep 17 00:00:00 2001 From: Phenom Date: Sat, 19 Aug 2017 19:18:58 +0200 Subject: [PATCH 133/138] Add CommonMark in ChatLobbyDialog --- .gitmodules | 3 + appveyor.yml | 1 + retroshare-gui/src/cmark_export.h | 42 ++++++++++ retroshare-gui/src/cmark_version.h | 7 ++ retroshare-gui/src/config.h | 76 ++++++++++++++++++ retroshare-gui/src/gui/NetworkView.cpp | 2 +- .../src/gui/chat/ChatLobbyDialog.cpp | 2 +- retroshare-gui/src/gui/chat/ChatWidget.cpp | 51 +++++++++--- retroshare-gui/src/gui/chat/ChatWidget.h | 5 +- retroshare-gui/src/gui/chat/ChatWidget.ui | 55 +++++++++---- .../src/gui/common/{html.cpp => rshtml.cpp} | 12 +-- .../src/gui/common/{html.h => rshtml.h} | 10 +-- retroshare-gui/src/gui/common/vmessagebox.cpp | 8 +- retroshare-gui/src/gui/elastic/arrow.cpp | 2 +- retroshare-gui/src/gui/elastic/edge.cpp | 2 +- .../src/gui/elastic/{node.cpp => elnode.cpp} | 2 +- .../src/gui/elastic/{node.h => elnode.h} | 4 +- .../src/gui/elastic/graphwidget.cpp | 2 +- .../src/gui/help/browser/helptextbrowser.cpp | 2 +- retroshare-gui/src/gui/icons.qrc | 1 + .../src/gui/icons/png/markdown-mark.png | Bin 0 -> 9770 bytes retroshare-gui/src/retroshare-gui.pro | 50 ++++++++++-- retroshare-gui/src/rshare.cpp | 2 +- retroshare-gui/src/util/HandleRichText.cpp | 33 ++++++++ retroshare-gui/src/util/HandleRichText.h | 1 + supportlibs/cmark | 1 + 26 files changed, 318 insertions(+), 58 deletions(-) create mode 100644 .gitmodules create mode 100644 retroshare-gui/src/cmark_export.h create mode 100644 retroshare-gui/src/cmark_version.h create mode 100644 retroshare-gui/src/config.h rename retroshare-gui/src/gui/common/{html.cpp => rshtml.cpp} (95%) rename retroshare-gui/src/gui/common/{html.h => rshtml.h} (95%) rename retroshare-gui/src/gui/elastic/{node.cpp => elnode.cpp} (96%) rename retroshare-gui/src/gui/elastic/{node.h => elnode.h} (96%) create mode 100644 retroshare-gui/src/gui/icons/png/markdown-mark.png create mode 160000 supportlibs/cmark diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..f7f9e74a2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "cmark"] + path = supportlibs/cmark + url = https://github.com/commonmark/cmark.git diff --git a/appveyor.yml b/appveyor.yml index 6f26a1c67..7c13becb2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -85,6 +85,7 @@ environment: # - cmd: echo This is batch again # - cmd: set MY_VAR=12345 install: + - git submodule update --init # Configuring MSys2 - set PATH=C:\msys64\usr\bin;%PATH% - set PATH=C:\msys64\mingw32\bin;%PATH% diff --git a/retroshare-gui/src/cmark_export.h b/retroshare-gui/src/cmark_export.h new file mode 100644 index 000000000..333e5d542 --- /dev/null +++ b/retroshare-gui/src/cmark_export.h @@ -0,0 +1,42 @@ + +#ifndef CMARK_EXPORT_H +#define CMARK_EXPORT_H + +#ifdef CMARK_STATIC_DEFINE +# define CMARK_EXPORT +# define CMARK_NO_EXPORT +#else +# ifndef CMARK_EXPORT +# ifdef libcmark_EXPORTS + /* We are building this library */ +# define CMARK_EXPORT __attribute__((visibility("default"))) +# else + /* We are using this library */ +# define CMARK_EXPORT __attribute__((visibility("default"))) +# endif +# endif + +# ifndef CMARK_NO_EXPORT +# define CMARK_NO_EXPORT __attribute__((visibility("hidden"))) +# endif +#endif + +#ifndef CMARK_DEPRECATED +# define CMARK_DEPRECATED __attribute__ ((__deprecated__)) +#endif + +#ifndef CMARK_DEPRECATED_EXPORT +# define CMARK_DEPRECATED_EXPORT CMARK_EXPORT CMARK_DEPRECATED +#endif + +#ifndef CMARK_DEPRECATED_NO_EXPORT +# define CMARK_DEPRECATED_NO_EXPORT CMARK_NO_EXPORT CMARK_DEPRECATED +#endif + +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef CMARK_NO_DEPRECATED +# define CMARK_NO_DEPRECATED +# endif +#endif + +#endif diff --git a/retroshare-gui/src/cmark_version.h b/retroshare-gui/src/cmark_version.h new file mode 100644 index 000000000..c6fe002fb --- /dev/null +++ b/retroshare-gui/src/cmark_version.h @@ -0,0 +1,7 @@ +#ifndef CMARK_VERSION_H +#define CMARK_VERSION_H + +#define CMARK_VERSION ((0 << 16) | (28 << 8) | 0) +#define CMARK_VERSION_STRING "0.28.0" + +#endif diff --git a/retroshare-gui/src/config.h b/retroshare-gui/src/config.h new file mode 100644 index 000000000..d38c7c7a5 --- /dev/null +++ b/retroshare-gui/src/config.h @@ -0,0 +1,76 @@ +#ifndef CMARK_CONFIG_H +#define CMARK_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define HAVE_STDBOOL_H + +#ifdef HAVE_STDBOOL_H + #include +#elif !defined(__cplusplus) + typedef char bool; +#endif + +#define HAVE___BUILTIN_EXPECT + +#define HAVE___ATTRIBUTE__ + +#ifdef HAVE___ATTRIBUTE__ + #define CMARK_ATTRIBUTE(list) __attribute__ (list) +#else + #define CMARK_ATTRIBUTE(list) +#endif + +#ifndef CMARK_INLINE + #if defined(_MSC_VER) && !defined(__cplusplus) + #define CMARK_INLINE __inline + #else + #define CMARK_INLINE inline + #endif +#endif + +/* snprintf and vsnprintf fallbacks for MSVC before 2015, + due to Valentin Milea http://stackoverflow.com/questions/2915672/ +*/ + +#if defined(_MSC_VER) && _MSC_VER < 1900 + +#include +#include + +#define snprintf c99_snprintf +#define vsnprintf c99_vsnprintf + +CMARK_INLINE int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap) +{ + int count = -1; + + if (size != 0) + count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap); + if (count == -1) + count = _vscprintf(format, ap); + + return count; +} + +CMARK_INLINE int c99_snprintf(char *outBuf, size_t size, const char *format, ...) +{ + int count; + va_list ap; + + va_start(ap, format); + count = c99_vsnprintf(outBuf, size, format, ap); + va_end(ap); + + return count; +} + +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/retroshare-gui/src/gui/NetworkView.cpp b/retroshare-gui/src/gui/NetworkView.cpp index 44c99736d..d0e486293 100644 --- a/retroshare-gui/src/gui/NetworkView.cpp +++ b/retroshare-gui/src/gui/NetworkView.cpp @@ -28,7 +28,7 @@ #include #include -#include "gui/elastic/node.h" +#include "gui/elastic/elnode.h" /******** * #define DEBUG_NETWORKVIEW diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 35a6f0f54..3d98a4b62 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -34,7 +34,7 @@ #include "gui/FriendsDialog.h" #include "gui/MainWindow.h" #include "gui/chat/ChatWidget.h" -#include "gui/common/html.h" +#include "gui/common/rshtml.h" #include "gui/common/FriendSelectionDialog.h" #include "gui/common/RSTreeWidgetItem.h" #include "gui/gxs/GxsIdChooser.h" diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index f35c0425d..4d7c42a66 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -72,8 +72,15 @@ * #define CHAT_DEBUG 1 *****/ -ChatWidget::ChatWidget(QWidget *parent) : - QWidget(parent), sendingBlocked(false), ui(new Ui::ChatWidget) +ChatWidget::ChatWidget(QWidget *parent) + : QWidget(parent) + , completionPosition(0), newMessages(false), typing(false), peerStatus(0) + , sendingBlocked(false), useCMark(false) + , lastStatusSendTime(0) + , firstShow(true), inChatCharFormatChanged(false), firstSearch(true) + , lastUpdateCursorPos(0), lastUpdateCursorEnd(0) + , completer(NULL), notify(NULL) + , ui(new Ui::ChatWidget) { ui->setupUi(this); @@ -84,17 +91,8 @@ ChatWidget::ChatWidget(QWidget *parent) : int butt_size(iconSize.height() + fmm); QSize buttonSize = QSize(butt_size, butt_size); - newMessages = false; - typing = false; - peerStatus = 0; - firstShow = true; - firstSearch = true; - inChatCharFormatChanged = false; - completer = NULL; lastMsgDate = QDate::currentDate(); - lastStatusSendTime = 0 ; - //Resize Tool buttons ui->emoteiconButton->setFixedSize(buttonSize); ui->emoteiconButton->setIconSize(iconSize); @@ -144,7 +142,6 @@ ChatWidget::ChatWidget(QWidget *parent) : connect(ui->actionSearchWithoutLimit, SIGNAL(triggered()), this, SLOT(toogle_SeachWithoutLimit())); connect(ui->searchButton, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuSearchButton(QPoint))); - notify=NULL; ui->notifyButton->setVisible(false); ui->markButton->setToolTip(tr("Mark this selected text
Ctrl+M")); @@ -194,6 +191,7 @@ ChatWidget::ChatWidget(QWidget *parent) : fontmenu->addAction(ui->actionResetFont); fontmenu->addAction(ui->actionNoEmbed); fontmenu->addAction(ui->actionSendAsPlainText); + fontmenu->addAction(ui->actionSend_as_CommonMark); QMenu *menu = new QMenu(); menu->addAction(ui->actionClearChatHistory); @@ -207,6 +205,10 @@ ChatWidget::ChatWidget(QWidget *parent) : ui->chatTextEdit->setOnlyPlainText(ui->actionSendAsPlainText->isChecked()); connect(ui->actionSendAsPlainText, SIGNAL(toggled(bool)), ui->chatTextEdit, SLOT(setOnlyPlainText(bool)) ); + connect(ui->actionSend_as_CommonMark, SIGNAL(toggled(bool)), this, SLOT(setUseCMark(bool)) ); + ui->cmPreview->setVisible(false); + connect(ui->chatTextEdit, SIGNAL(textChanged()), this, SLOT(updateCMPreview()) ); + ui->textBrowser->resetImagesStatus(Settings->getChatLoadEmbeddedImages()); ui->textBrowser->installEventFilter(this); ui->textBrowser->viewport()->installEventFilter(this); @@ -981,6 +983,11 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const RsGxsId gx formatTextFlag |= RSHTML_FORMATTEXT_EMBED_SMILEYS; } + //Use CommonMark + if (message.contains("CMark=\"true\"")) { + formatTextFlag |= RSHTML_FORMATTEXT_USE_CMARK; + } + // Always fix colors formatTextFlag |= RSHTML_FORMATTEXT_FIX_COLORS; qreal desiredContrast = Settings->valueFromGroup("Chat", "MinimumContrast", 4.5).toDouble(); @@ -1229,7 +1236,9 @@ void ChatWidget::sendChat() text = chatWidget->toPlainText(); text.replace(QChar(-4),"");//Char used when image on text. } else { - RsHtml::optimizeHtml(chatWidget, text, (ui->actionNoEmbed->isChecked() ? RSHTML_FORMATTEXT_NO_EMBED : 0)); + RsHtml::optimizeHtml(chatWidget, text, + (ui->actionNoEmbed->isChecked() ? RSHTML_FORMATTEXT_NO_EMBED : 0) + + (ui->actionSend_as_CommonMark->isChecked() ? RSHTML_FORMATTEXT_USE_CMARK : 0) ); } std::string msg = text.toUtf8().constData(); @@ -1823,6 +1832,22 @@ bool ChatWidget::setStyle() return false; } +void ChatWidget::setUseCMark(const bool bUseCMark) +{ + useCMark = bUseCMark; + ui->cmPreview->setVisible(useCMark); + updateCMPreview(); +} + +void ChatWidget::updateCMPreview() +{ + if (!useCMark) return; + + QString message = ui->chatTextEdit->toHtml(); + QString formattedMessage = RsHtml().formatText(ui->cmPreview->document(), message, RSHTML_FORMATTEXT_USE_CMARK); + ui->cmPreview->setHtml(formattedMessage); +} + void ChatWidget::quote() { QString text = ui->textBrowser->textCursor().selection().toPlainText(); diff --git a/retroshare-gui/src/gui/chat/ChatWidget.h b/retroshare-gui/src/gui/chat/ChatWidget.h index 8de38620e..127575d73 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.h +++ b/retroshare-gui/src/gui/chat/ChatWidget.h @@ -128,6 +128,8 @@ public: public slots: void updateStatus(const QString &peer_id, int status); + void setUseCMark(const bool bUseCMark); + void updateCMPreview(); private slots: //void pasteCreateMsgLink() ; @@ -222,7 +224,8 @@ private: bool typing; int peerStatus; - bool sendingBlocked; + bool sendingBlocked; + bool useCMark; time_t lastStatusSendTime; diff --git a/retroshare-gui/src/gui/chat/ChatWidget.ui b/retroshare-gui/src/gui/chat/ChatWidget.ui index 9ea7277ef..16a411eb5 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.ui +++ b/retroshare-gui/src/gui/chat/ChatWidget.ui @@ -268,22 +268,34 @@ border-image: url(:/images/closepressed.png)
- - - - 0 - 0 - + + + Qt::Horizontal - - - 0 - 30 - + + 2 - - Type a message here + + false + + + + 0 + 0 + + + + + 0 + 30 + + + + Type a message here + + + @@ -915,6 +927,21 @@ border-image: url(:/images/closepressed.png) Show Hidden Images + + + true + + + + :/icons/png/markdown-mark.png:/icons/png/markdown-mark.png + + + Send as CommonMark + + + Text will be formatted using CommonMark. + + @@ -945,8 +972,8 @@ border-image: url(:/images/closepressed.png) - + diff --git a/retroshare-gui/src/gui/common/html.cpp b/retroshare-gui/src/gui/common/rshtml.cpp similarity index 95% rename from retroshare-gui/src/gui/common/html.cpp rename to retroshare-gui/src/gui/common/rshtml.cpp index ce71518f9..e0a1cdaf6 100644 --- a/retroshare-gui/src/gui/common/html.cpp +++ b/retroshare-gui/src/gui/common/rshtml.cpp @@ -1,7 +1,7 @@ /**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2008, defnax + * This file is distributed under the following license: + * + * Copyright (c) 2008, defnax * Copyright (c) 2008, Matt Edman, Justin Hipple * * This program is free software; you can redistribute it and/or @@ -21,12 +21,12 @@ ****************************************************************/ /* -** \file html.cpp -** \version $Id: html.cpp 2362 2008-02-29 04:30:11Z edmanm $ +** \file rshtml.cpp +** \version $Id: rshtml.cpp 2362 2008-02-29 04:30:11Z edmanm $ ** \brief HTML formatting functions */ -#include "html.h" +#include "rshtml.h" /** Wraps a string in "

" tags, converts "\n" to "
" and converts "\n\n" diff --git a/retroshare-gui/src/gui/common/html.h b/retroshare-gui/src/gui/common/rshtml.h similarity index 95% rename from retroshare-gui/src/gui/common/html.h rename to retroshare-gui/src/gui/common/rshtml.h index bb217d220..627b81a59 100644 --- a/retroshare-gui/src/gui/common/html.h +++ b/retroshare-gui/src/gui/common/rshtml.h @@ -1,7 +1,7 @@ /**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2008, defnax + * This file is distributed under the following license: + * + * Copyright (c) 2008, defnax * Copyright (c) 2008, Matt Edman, Justin Hipple * * This program is free software; you can redistribute it and/or @@ -21,8 +21,8 @@ ****************************************************************/ /* -** \file html.h -** \version $Id: html.h 2362 2008-02-29 04:30:11Z edmanm $ +** \file rshtml.h +** \version $Id: rshtml.h 2362 2008-02-29 04:30:11Z edmanm $ ** \brief HTML formatting functions */ diff --git a/retroshare-gui/src/gui/common/vmessagebox.cpp b/retroshare-gui/src/gui/common/vmessagebox.cpp index 933310acd..f1465fa4f 100644 --- a/retroshare-gui/src/gui/common/vmessagebox.cpp +++ b/retroshare-gui/src/gui/common/vmessagebox.cpp @@ -1,7 +1,7 @@ /**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2008, defnax + * This file is distributed under the following license: + * + * Copyright (c) 2008, defnax * Copyright (c) 2008, Matt Edman, Justin Hipple * * This program is free software; you can redistribute it and/or @@ -26,7 +26,7 @@ ** \brief Provides a custom Vidalia mesage box */ -#include "html.h" +#include "rshtml.h" #include "vmessagebox.h" diff --git a/retroshare-gui/src/gui/elastic/arrow.cpp b/retroshare-gui/src/gui/elastic/arrow.cpp index 8ef0991d4..f9fc8a95b 100644 --- a/retroshare-gui/src/gui/elastic/arrow.cpp +++ b/retroshare-gui/src/gui/elastic/arrow.cpp @@ -37,7 +37,7 @@ #include #include "arrow.h" -#include "node.h" +#include "elnode.h" #include diff --git a/retroshare-gui/src/gui/elastic/edge.cpp b/retroshare-gui/src/gui/elastic/edge.cpp index e9e60f06b..cee1e1e88 100644 --- a/retroshare-gui/src/gui/elastic/edge.cpp +++ b/retroshare-gui/src/gui/elastic/edge.cpp @@ -42,7 +42,7 @@ #include #include "edge.h" -#include "node.h" +#include "elnode.h" #include diff --git a/retroshare-gui/src/gui/elastic/node.cpp b/retroshare-gui/src/gui/elastic/elnode.cpp similarity index 96% rename from retroshare-gui/src/gui/elastic/node.cpp rename to retroshare-gui/src/gui/elastic/elnode.cpp index 6a3020b21..99bbfd310 100644 --- a/retroshare-gui/src/gui/elastic/node.cpp +++ b/retroshare-gui/src/gui/elastic/elnode.cpp @@ -54,7 +54,7 @@ #include #include "edge.h" -#include "node.h" +#include "elnode.h" #include "graphwidget.h" #define IMAGE_AUTHED ":/images/accepted16.png" diff --git a/retroshare-gui/src/gui/elastic/node.h b/retroshare-gui/src/gui/elastic/elnode.h similarity index 96% rename from retroshare-gui/src/gui/elastic/node.h rename to retroshare-gui/src/gui/elastic/elnode.h index e43fa3521..6e59cf43d 100644 --- a/retroshare-gui/src/gui/elastic/node.h +++ b/retroshare-gui/src/gui/elastic/elnode.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef NODE_H -#define NODE_H +#ifndef ELNODE_H +#define ELNODE_H #include #if QT_VERSION >= 0x040600 diff --git a/retroshare-gui/src/gui/elastic/graphwidget.cpp b/retroshare-gui/src/gui/elastic/graphwidget.cpp index 9aeebbeda..aa8cbf241 100644 --- a/retroshare-gui/src/gui/elastic/graphwidget.cpp +++ b/retroshare-gui/src/gui/elastic/graphwidget.cpp @@ -41,7 +41,7 @@ #include "graphwidget.h" #include "edge.h" -#include "node.h" +#include "elnode.h" #include "fft.h" #include diff --git a/retroshare-gui/src/gui/help/browser/helptextbrowser.cpp b/retroshare-gui/src/gui/help/browser/helptextbrowser.cpp index 60d4ed427..f6b445e1c 100644 --- a/retroshare-gui/src/gui/help/browser/helptextbrowser.cpp +++ b/retroshare-gui/src/gui/help/browser/helptextbrowser.cpp @@ -30,7 +30,7 @@ #include #include #include "gui/common/vmessagebox.h" -#include "gui/common/html.h" +#include "gui/common/rshtml.h" #include #include "helptextbrowser.h" diff --git a/retroshare-gui/src/gui/icons.qrc b/retroshare-gui/src/gui/icons.qrc index aab1afb40..31e3f816a 100644 --- a/retroshare-gui/src/gui/icons.qrc +++ b/retroshare-gui/src/gui/icons.qrc @@ -241,5 +241,6 @@ icons/warning_yellow_128.png icons/yahoo.png icons/yandex.png + icons/png/markdown-mark.png diff --git a/retroshare-gui/src/gui/icons/png/markdown-mark.png b/retroshare-gui/src/gui/icons/png/markdown-mark.png new file mode 100644 index 0000000000000000000000000000000000000000..da4bb71234f38840a6931cc74fddeba0a4c9fdda GIT binary patch literal 9770 zcmeHNc{o&k`~RMqX=W;0n=D~Mww@v(5l)M>ETvLfjBI6%EHN>sy+;&Mlw!&jm3=E@ zN=m3ywya5(tl4+-J7XTA^t{h|UB5rx_qyJ$bIqA^-{1Rlf9`b#{b``5$-aPZ0RVtq zTWi}c0PqL^I6%arl7UzoM*uLX20M1EGZ+k1^1pxo%fNq82JT2!Tu13PIq%Xl1T8$n zc;1^Yn=ChC#{y*7dfz4Q;J5nCUg7!Ov-!0e1$Vs?Dh?voyLE>?mAZ;@~&Aw zBPquw%tbHxC@F8;_29{uw_5Y^tfW1L88-L20r{$@en(IHNVZNIYdvh6It2XrC~w;#*EjF6$Nt2Ci@p zUinPO;JFF#-DsJ9kqwRgXwdq2A1XjH!%WHmf3fShW@ET2uuh;(agiHD-6pXzr^#JVbZo>^dCSM2xfTJXfIz z6dk&}as0)SbsxiYG34iidaqUCkK8`Kx)>yJVU&dcO|oP^=PVw=D#CTwM3KLQmR@)+MR~a?#Boi)FNiy0AqDh`=(7dP<=S(J{GF2@pdo z^8`pBWs~(ha6@P}1034uVqdZV6y5Q#@WeWI7d{BT0m%J@%gd$VX5HHYsd$hq9%>W@ zT%$u4_@rC~&a+Wl;(`HT`wtu}2QI_yXYPxDecwN=bzw8;uG(n@zPmcsVC0;) z09a)Qk8u#__Y?=T!?oWIjDr57jJ*KP&MJMX`3SrFFgGyJw`fddH>e7QKz~`XT?fXQ z91jq-KBWW&Xryba$$XGcUwv`HZ4JixwFLxjX0!*a;Vd@9Vu7se_n0;82HF+?wv^hQ zCIgqN@dCe_;_-D!Kqc7(z!wH6mfJBUU!nlAqo(A@LX2}K1x4`as(wSbpQR4qm&Sn( z3h*8?43JfblA6#>9x^I75dwbM2OMg?;!7G|L16w^MxhwC#L*nU7!hTADLC^X5ojIB zTN^?wZnh!-(RHJ}{G7#9H&hytOLdTg$2I2xQQ26=OH4|y00drFC-!P!oClKtVt%70 zyB_pE6$7NZHXaT#a7`2rh{{D)UBK*?QwF4%PwM={Vpp`#0k<-0@R*X7fRxA)#!;Lo z4}m{RSB%DhM==~g>!HV+XiN$fz)qtK3L-@y_^pu1=&8fVi3ea2DlS@m?98=yH_Kdw`~zQ_M?BV*hU8DKO;Xtif}U#uNF28x4I)h4`? z(uEVxdPhx&z>(6L#_~p8BRZgX=uT4KTNU9)hE`(@+y^tYT74w3Ik9TMz5aSU$89GK z(b7(#@`TJ&YKx^jO>6fjV~|bj+8(+~2Wo7o>*^U4$;b`$cJ>-}+7J9pr1b0rz8(Dj zzD|Mm-hapIf@}Q*Qdi)etR&F@UIFUDVgdgG(^ogVR)KtF6G@eU1g*v^IrCaBzvk=C z&*Q`a_iv{!3u*67m!6P^&x)z@*(h_cfu0ij6&n#>?XwenGzSen<*?%xz%M;+lWDV7 zLkN}KpjqplbyYtE3m(X^+avmZSQ?UgDz~eG(PRO^hYz^+PWV5M%%gG`xa*33@8FNc zBAbjnbJImm-|A5#+!xz*GR6V;4URlrDp@kN5f;+KP_F!m0rX%Mk<(WhD`=(u*~wml z^B^QFY}uy+QOr&m5IpiIzxt~1^3}pN%WrIhAlldG`IX-J>Vx@}^=HEo zAT#tm-*_-zy)J*>H=2Y5V3YFo>G!pKEbpI~WOXkA9M@Afx6Q0x>7RNnJOTKTQ-lKA zmh)zwJh_wyTrgR|+ZIGwFY7vTPeKO#p`;=^U}?X3U_;viHZcFf=$Yz({CyWujVMp& zb|=nlX&lm5&tT!USa1vy)x7ZFoOD*|>lm z%zsHKtWFm`u;gAb>N$(LdaysgY)C>5#p^P8m%5mQTo8vJ$x;c<$Cr`-$J;T1;@12! z!<|QgmQ1Ztv#?p659;nrcc?q!#W#5CR|)4A6_n#k?>$RPc*zrg-YyOxb^d z`RpKnCU4LLxJb+kM`T_Q21WpS&6dp+Po0}7W0@OoTavt%FZ~cz&_%N<@_mNglCK{b z?*}cgBUoiOQ=I%#4bwi8JY{;#U53taH#hOE(9i)(`;!}^&z6R?d-aMnejKoVIiO#P zmw~GV_o|1N9?t~WZQ(Y(7V@SWbN0Rg*cUGG+Tp|fm4J+7BtGIx=+J=h#Fc0*W#BD1 z2t!7=gwY~lMYo}ZSPC{Smf{?d$VCS$Cly+k&@%r}U~oSaXs&)$AkdaeOhs|jIpUm$ zc}PDLQ-}SyAP6(1n7;@|{Gr&4fH@S{b6nF38JIX}v3N3^zZ9%E|5h=TfJuvgk(qy) zG9Hu3sQrG>qJ!TAGR1c?Pg8;L{fm+uWrf1Z?eDz&1F&;z=PU{t`L!rq{1<;;L4n`a z=*dE~sphOgAMaG7{hZEVbclXbS!}u?(R1gH&GcldGqZ7n4Q84}q1$Y_jOXT~o9nMu z^y8Xs#zis*c&$r*^U==%KdzOFNvQ9YTf|_%bhiUR=j9ynCV-d)l!Y(|v{-l>2FDzf zd~}>=7%rJ*s5O_NIm?h4ki^!>4ly{#wGuT%i84K+^TYJWj2-pJ>()WZDZv$pEc@!yp!WgT0c2-u;t_u zLGoG4;wCHMvaIr(&obni)39ikq3~RWKY27~d7N!H+vBC*QXNYM5P3g!L7c$88vr6Q zvp>EH1{f@E1WTvFV23#Z=;)ETUS(jkG0+zI?JEz7sh#tcjSH0zEI%F1DFd?+VtEM{ ztg$?#r)-1=iwGB`ONlb@snD(%vG$wPI73_I$e_Eql zq#qM7y)9?0C9h3??ao=dXe9=Nn_5!;WT{RK9dkuZE!7#HDnAeV^mOklW2j#`ZdM6B zj~?M~f3lDN^I_l0#PUw$r4BkOWW_@@U-~|aXS`=}I62zC+r`_^q>hi)J^B1t(d5vV zu`iKC(<0{T3O%K`U*OBvi{es>w=cM~nfc=BcgpOmrq3AfH zaHk$BRcQV;z(ux&D)2aAKs=KO*EvQ16NHS@_ z7RyvUt3Xw=oJ^_~UpkH_5ntjH*tJL)1eh(PE09nxTt4h%em@uopqJbzHmV}=@S`de z8{@ME#hzBN++O?{{NIRx>9&pZ6ZqUQQON%=%nXh>GWOdr&$azqIm}r0k25C7^Gg!{ znP_&ZS=msYnf?EN(fVKE=Mb&__0$}qISf6gnuw-4)nEofXdh2j!RJej-6 z4Z>u{+AaZT?pRI8%-!UAm@EYgj#-MI-~y*N+gxzWQv3|}gWVi(bFpKVg2iqwIA-pC zVmDce$=x~^+>c*O-1tSLwxoTP*HU;=BqT66~{vt^gxE2M{|1{7~SD!GFnE4w#3h93VWSgR|Y4&ESE$ zo8l2lqQ9KvhRRsbEN-xmiV5O7C1XKP@t_m{eipYM?k2gRJSeAsU>}}^eHk|+6iVbw zi1?-CAN1PKV{F;}$`I_6z3b@ajhOpicyV~lUfLde6o(W%z_ zwco=wr!My$0@|aic0&M*p(6mjWY90oB)~>wURVsx0*?cD90Eb;MMl4Bqu-~|ug+Y* zkX?=aO151`-)75NbnNt$ zw^+joRF1kAj9B+8VEMcNzAvryb6|fyC_XEAGl?UvDe~c~d5Bd?<&|t}LJ!&N?Oz|;U|7bPMg%HWmxUr8Haw`=RW{s(J~j(9M?b8IohR9j!kxIX z!*pTn_^y4+fQR1o=K~MQwwr2t3WL62{T0`rmpyo^XIj2#HTr0E=-TtQakaNTT)@Cr zd3BCCJgQYwKJR&a6cih#F~|!-#wVoA3@hy+T6Fu34=y08api65gyZ%v^4!yIR<_=R4FLgX%W*?wAAgTKSZ-y;jZCLv5ak3R>~6? zDgebIhuz8E{Min%2fJGW2YbT^NT|W~_d=fPvF4WpH#pdvfELK}L~~@;ngFTCYvmO? z1kfyIHKde$eiEURrYoR2hUTNccC5a{v?@YJHAB<-c=zXfptzBn{qSwR_U>m9I)aMw zE-gZ18lc6xj;CE;K+lsD6JQ%^e0%J(G#*(ykVgo+ZEPDFq0`e_(l8t*zy=Q4d{2I- zui`Zk1gW^&wyx`XaR&njRepQn9`mX~oM8d47K;|!{xsbkWw*sMgzBJeE$glxKoEa@ zzohX?)=<H6S>}s_Qn)+2~b#4Ae5qj&5ChXviD^raJDkJLz7l9}A zOAgYW9Z4mvLt{Hds44ZA#tqY(bo*ZOtmhI4L8PsO-+dVFrO-HK=?djK5Q5u&B;1 z^^aV$QFVqQEm~zHIz|ZW81DBS4ws@jH7t>31E1$_Xc8g>>Y{JS*T#C0fl+g70tl<_ zGQkJlE#Uwcdg8H_WDjdR__$#x9U6E3Si%Mr#=qsTOPH{M5?j*=PuTMW7Np*ybWnK= zTv3_ztFdS(yFLxTzV?({>I#FsIAEP3%y5UhPVNUZ1!>AFDZF#TZ2;RfRcClZjdm0~ zuuf{ON{WSQHmU-HYu#>fPVmhWM*)rd;@j7;gg$yN2Be;>#XjIQuzb1!7@Qq^ThxkT z?7>QM0DRmN$5d>=&C9!1pugr{|3JvVQg??bka65wCP!Wtwu3-7;{raBpF!Ed_r3<$^C3*i{T&Sp8uFaq_Iw z#DX=WN9+2(nZp|g>pdZayI*Cj+F5~is(YOos^c9EmX7)eH3pfDqE9VCqlM0@v=ynP z8W0j?mr}Y@avg0&|EEt7BKBsYeW&DlT9JEi34jfwp1SMluuCYLOgsSa5-*qGw~`xZ zV`+(d0NFRqdQ4#zA@HD78*P_pC zt@g)Qxvl{H9q8HTFZ2%vc;Ev!Y;v^+pVe-SR&0ofgBq)o)zrAa&<1Rn+GuskJ%4Ur zYRe)Bp$-I$a!1PVF-~cTMAzfkHMcD1ovnffu1a?4rvbf=t=+X!@7Nv@yNb~$H$0eV z|ETZjU~Cl0-ZfrtN)eq8+8rx6>p~RdK7>AM3gZVA<{uJ|Z5Qcy()U=69kiuMieJ$Q ziA}L7;iwuQATIkDY05r2nS9^qZQQrHLD`=5;+;VQ@*n&Q4QYw39{|NgTknm1xF)-9qZg*3lw7Dc)sx=k*2kJlD>g`Un6}9 z1mtiZz3XLlz!^Tt_Qa|?kI@g48-ITE8Y>Je)pEQ#Qug(e+I*0Gq*b!F_PCXfO$2vc zW^YoSCJwP53~&??k`Gpr+Z9sod8D)88oJgzTsupYe@IRmI0wCM z2y^Zze_0*OC%-F)k=f;r6@Qr3cMBw>wF#9DW?j}l+0qzuNF=v$r}7H5`hnBEYduOW z^gUj<1RWFvWgLw3+Vx#eUA}H^b2!z#gj #include -#include +#include #include #include #include diff --git a/retroshare-gui/src/util/HandleRichText.cpp b/retroshare-gui/src/util/HandleRichText.cpp index 2b3e75b35..046ea47a6 100644 --- a/retroshare-gui/src/util/HandleRichText.cpp +++ b/retroshare-gui/src/util/HandleRichText.cpp @@ -38,6 +38,10 @@ #include "util/imageutil.h" #include "util/rstime.h" +//Include for CMark +#include +#include + #include /** @@ -582,6 +586,29 @@ QString RsHtml::formatText(QTextDocument *textDocument, const QString &text, ulo // Save Space and Tab because doc loose it. formattedText=saveSpace(formattedText); + if (flag & RSHTML_FORMATTEXT_USE_CMARK) { + // Transform html to plain text + QTextBrowser textBrowser; + textBrowser.setHtml(text); + formattedText = textBrowser.toPlainText(); + // Parse CommonMark + int options = CMARK_OPT_DEFAULT; + cmark_parser *parser = cmark_parser_new(options); + cmark_parser_feed(parser, formattedText.toStdString().c_str(),formattedText.length()); + cmark_node *document = cmark_parser_finish(parser); + cmark_parser_free(parser); + char *result; + result = cmark_render_html(document, options); + // Get result as html + formattedText = QString::fromUtf8(result); + //Clean + cmark_node_mem(document)->free(result); + cmark_node_free(document); + //Get document formed HTML + textBrowser.setHtml(formattedText); + formattedText=textBrowser.toHtml(); + } + QString errorMsg; int errorLine; int errorColumn; QDomDocument doc; @@ -981,6 +1008,12 @@ static void styleCreate(QDomDocument& doc noEmbedAttr.setValue("true"); styleElem.attributes().setNamedItem(noEmbedAttr); } + if (flag & RSHTML_FORMATTEXT_USE_CMARK) { + QDomAttr cMarkAttr; + cMarkAttr = doc.createAttribute("CMark"); + cMarkAttr.setValue("true"); + styleElem.attributes().setNamedItem(cMarkAttr); + } } while(styleElem.childNodes().count()>0) { diff --git a/retroshare-gui/src/util/HandleRichText.h b/retroshare-gui/src/util/HandleRichText.h index a8f8d66ef..afa91f091 100644 --- a/retroshare-gui/src/util/HandleRichText.h +++ b/retroshare-gui/src/util/HandleRichText.h @@ -44,6 +44,7 @@ #define RSHTML_FORMATTEXT_REMOVE_FONT (RSHTML_FORMATTEXT_REMOVE_FONT_WEIGHT | RSHTML_FORMATTEXT_REMOVE_FONT_STYLE | RSHTML_FORMATTEXT_REMOVE_FONT_FAMILY | RSHTML_FORMATTEXT_REMOVE_FONT_SIZE) #define RSHTML_FORMATTEXT_CLEANSTYLE (RSHTML_FORMATTEXT_REMOVE_FONT | RSHTML_FORMATTEXT_REMOVE_COLOR) #define RSHTML_FORMATTEXT_NO_EMBED 0x0400//1024 +#define RSHTML_FORMATTEXT_USE_CMARK 0x0800//2048 /* Flags for RsHtml::optimizeHtml */ #define RSHTML_OPTIMIZEHTML_MASK (RSHTML_FORMATTEXT_CLEANSTYLE | RSHTML_FORMATTEXT_FIX_COLORS | RSHTML_FORMATTEXT_OPTIMIZE) diff --git a/supportlibs/cmark b/supportlibs/cmark new file mode 160000 index 000000000..b9c7a496b --- /dev/null +++ b/supportlibs/cmark @@ -0,0 +1 @@ +Subproject commit b9c7a496ba7dd9c3495bae2ff2855899e47b245d From f97dc8a1258ff66efcc01ae4105f8b653544e35d Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sun, 22 Jul 2018 21:33:40 +0200 Subject: [PATCH 134/138] Properly plug deep search in GXS search Some modifications breaks retrocompatibility of GXS search: remove horrible templated RsTypeSerializer::serial_process for RsGxsGroupSummary with hardcoded member names RsGxsGroupSummary doesn't use old TLV serialization format anymore RsGxsGroupSummary remove unused description member RsGxsGroupSummary derive from RsSerializable and use serialization helper macro Add autor id and signature flags to the index so there is no need to retrive them from GXS, thus improving performances RsGroupNetworkStats initialize members properly RsGxsGroupSummary rename members to follow usual mMemberName convention --- libretroshare/src/deep_search/deep_search.h | 5 ++ libretroshare/src/gxs/rsgds.h | 26 ++++--- libretroshare/src/gxs/rsgxsnetservice.cc | 70 +++++++++++-------- libretroshare/src/gxs/rsgxsnettunnel.cc | 18 +---- libretroshare/src/retroshare/rsgxsiface.h | 48 ++++++++----- libretroshare/src/services/p3gxschannels.cc | 21 +++--- .../src/gui/gxs/GxsGroupFrameDialog.cpp | 23 +++--- 7 files changed, 111 insertions(+), 100 deletions(-) diff --git a/libretroshare/src/deep_search/deep_search.h b/libretroshare/src/deep_search/deep_search.h index 368aa7e84..914fce6a2 100644 --- a/libretroshare/src/deep_search/deep_search.h +++ b/libretroshare/src/deep_search/deep_search.h @@ -118,6 +118,11 @@ struct DeepSearch chanUrl.setQueryKV("publishDate", date); chanUrl.setQueryKV("name", chan.mMeta.mGroupName); + if(!chan.mMeta.mAuthorId.isNull()) + chanUrl.setQueryKV("authorId", chan.mMeta.mAuthorId.toStdString()); + if(chan.mMeta.mSignFlags) + chanUrl.setQueryKV( "signFlags", + std::to_string(chan.mMeta.mSignFlags) ); std::string rsLink(chanUrl.toString()); // store the RS link so we are able to retrive it on matching search diff --git a/libretroshare/src/gxs/rsgds.h b/libretroshare/src/gxs/rsgds.h index 34e5d2076..84276d7b6 100644 --- a/libretroshare/src/gxs/rsgds.h +++ b/libretroshare/src/gxs/rsgds.h @@ -74,23 +74,21 @@ public: }; /*! - * This is used to query network statistics for a given group. This is useful to e.g. show group - * popularity, or number of visible messages for unsubscribed group. + * This is used to query network statistics for a given group. This is useful + * to e.g. show group popularity, or number of visible messages for unsubscribed + * group. */ - -class RsGroupNetworkStats +struct RsGroupNetworkStats { -public: - RsGroupNetworkStats() - { - mMaxVisibleCount = 0 ; - } + RsGroupNetworkStats() : + mSuppliers(0), mMaxVisibleCount(0), mGrpAutoSync(false), + mAllowMsgSync(false), mLastGroupModificationTS(0) {} - uint32_t mSuppliers ; - uint32_t mMaxVisibleCount ; - bool mGrpAutoSync ; - bool mAllowMsgSync; - time_t mLastGroupModificationTS ; + uint32_t mSuppliers; + uint32_t mMaxVisibleCount; + bool mGrpAutoSync; + bool mAllowMsgSync; + time_t mLastGroupModificationTS; }; typedef std::map > NxsMsgDataResult; diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index b5751b2cd..b6fe8420d 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -243,6 +243,7 @@ #include #include #include +#include #include "rsgxsnetservice.h" #include "gxssecurity.h" @@ -5187,8 +5188,8 @@ void RsGxsNetService::receiveTurtleSearchResults(TurtleRequestId req, const std: std::map& search_results_map(mDistantSearchResults[req]) ; for(auto it(group_infos.begin());it!=group_infos.end();++it) - if(search_results_map.find((*it).group_id) == search_results_map.end()) - grpMeta[(*it).group_id] = NULL; + if(search_results_map.find((*it).mGroupId) == search_results_map.end()) + grpMeta[(*it).mGroupId] = NULL; mDataStore->retrieveGxsGrpMetaData(grpMeta); @@ -5197,26 +5198,26 @@ void RsGxsNetService::receiveTurtleSearchResults(TurtleRequestId req, const std: // only keep groups that are not locally known, and groups that are not already in the mDistantSearchResults structure for(auto it(group_infos.begin());it!=group_infos.end();++it) - if(grpMeta[(*it).group_id] == NULL) + if(grpMeta[(*it).mGroupId] == NULL) { filtered_results.push_back(*it) ; - auto it2 = search_results_map.find((*it).group_id) ; + auto it2 = search_results_map.find((*it).mGroupId) ; if(it2 != search_results_map.end()) { // update existing data - it2->second.popularity++ ; - it2->second.number_of_messages = std::max(it2->second.number_of_messages,(*it).number_of_messages) ; + it2->second.mPopularity++ ; + it2->second.mNumberOfMessages = std::max(it2->second.mNumberOfMessages,(*it).mNumberOfMessages) ; } else { - search_results_map[(*it).group_id] = *it; - search_results_map[(*it).group_id].popularity = 1; // number of results so far + search_results_map[(*it).mGroupId] = *it; + search_results_map[(*it).mGroupId].mPopularity = 1; // number of results so far } - mObserver->receiveDistantSearchResults(req,(*it).group_id) ; + mObserver->receiveDistantSearchResults(req,(*it).mGroupId) ; } } @@ -5277,12 +5278,6 @@ bool RsGxsNetService::search( const std::string& substring, { group_infos.clear(); - RsGxsGrpMetaTemporaryMap grpMetaMap; - { - RS_STACK_MUTEX(mNxsMutex) ; - mDataStore->retrieveGxsGrpMetaData(grpMetaMap); - } - #ifdef RS_DEEP_SEARCH std::vector results; DeepSearch::search(substring, results, 0); @@ -5290,33 +5285,48 @@ bool RsGxsNetService::search( const std::string& substring, for(auto dsr : results) { RsUrl rUrl(dsr.mUrl); - auto rit = rUrl.query().find("id"); + const auto& uQ(rUrl.query()); + auto rit = uQ.find("id"); if(rit != rUrl.query().end()) { RsGroupNetworkStats stats; RsGxsGroupId grpId(rit->second); - RsGxsGrpMetaTemporaryMap::iterator mIt; - if( !grpId.isNull() && - (mIt = grpMetaMap.find(grpId)) != grpMetaMap.end() && - getGroupNetworkStats(grpId, stats) ) + if( !grpId.isNull() && getGroupNetworkStats(grpId, stats) ) { - RsGxsGrpMetaData& gMeta(*mIt->second); RsGxsGroupSummary s; - s.group_id = grpId; - s.group_name = gMeta.mGroupName; - s.search_context = dsr.mSnippet; - s.sign_flags = gMeta.mSignFlags; - s.publish_ts = gMeta.mSignFlags; - s.author_id = gMeta.mAuthorId; - s.number_of_messages = stats.mMaxVisibleCount; - s.last_message_ts = stats.mLastGroupModificationTS; - s.popularity = gMeta.mPop; + + s.mGroupId = grpId; + + if((rit = uQ.find("name")) != uQ.end()) + s.mGroupName = rit->second; + if((rit = uQ.find("signFlags")) != uQ.end()) + s.mSignFlags = std::stoul(rit->second); + if((rit = uQ.find("publishDate")) != uQ.end()) + { + std::istringstream ss(rit->second); + std::tm tm; + ss >> std::get_time(&tm, "%Y%m%d"); + s.mPublishTs = mktime(&tm); + } + if((rit = uQ.find("authorId")) != uQ.end()) + s.mAuthorId = RsGxsId(rit->second); + + s.mSearchContext = dsr.mSnippet; + + s.mNumberOfMessages = stats.mMaxVisibleCount; + s.mLastMessageTs = stats.mLastGroupModificationTS; + s.mPopularity = stats.mSuppliers; group_infos.push_back(s); } } } #else // RS_DEEP_SEARCH + RsGxsGrpMetaTemporaryMap grpMetaMap; + { + RS_STACK_MUTEX(mNxsMutex) ; + mDataStore->retrieveGxsGrpMetaData(grpMetaMap); + } RsGroupNetworkStats stats ; for(auto it(grpMetaMap.begin());it!=grpMetaMap.end();++it) if(termSearch(it->second->mGroupName,substring)) diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index ff3134493..dfa0d8655 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -216,22 +216,6 @@ public: } }; -template<> -void RsTypeSerializer::serial_process( RsGenericSerializer::SerializeJob j, RsGenericSerializer::SerializeContext& ctx, RsGxsGroupSummary& gs, const std::string& member_name ) -{ - RsTypeSerializer::serial_process (j,ctx,gs.group_id ,member_name+"-group_id") ; // RsGxsGroupId group_id ; - RsTypeSerializer::serial_process (j,ctx,TLV_TYPE_STR_NAME ,gs.group_name,member_name+"-group_name") ; // std::string group_name ; - RsTypeSerializer::serial_process (j,ctx,TLV_TYPE_STR_COMMENT ,gs.group_description,member_name+"-group_description") ; // std::string group_description ; - RsTypeSerializer::serial_process (j,ctx,TLV_TYPE_STR_VALUE ,gs.search_context,member_name+"-group_name") ; // std::string search_context ; - RsTypeSerializer::serial_process (j,ctx,gs.author_id ,member_name+"-author_id") ; // RsGxsId author_id ; - RsTypeSerializer::serial_process (j,ctx,gs.publish_ts ,member_name+"-publish_ts") ; // time_t publish_ts ; - RsTypeSerializer::serial_process (j,ctx,gs.number_of_messages,member_name+"-number_of_messages") ; // uint32_t number_of_messages ; - RsTypeSerializer::serial_process (j,ctx,gs.last_message_ts ,member_name+"-last_message_ts") ; // time_t last_message_ts ; - RsTypeSerializer::serial_process(j,ctx,gs.sign_flags ,member_name+"-sign_flags") ; // uint32_t sign_flags ; - RsTypeSerializer::serial_process(j,ctx,gs.popularity ,member_name+"-popularity") ; // uint32_t popularity ; -} - - //===========================================================================================================================================// // Interface with rest of the software // //===========================================================================================================================================// @@ -1102,7 +1086,7 @@ void RsGxsNetTunnelService::receiveSearchResult(TurtleSearchRequestId request_id GXS_NET_TUNNEL_DEBUG() << " : result is of type group summary result for service " << result_gs->service << std::dec << ": " << std::endl; for(auto it(result_gs->group_infos.begin());it!=result_gs->group_infos.end();++it) - std::cerr << " group " << (*it).group_id << ": " << (*it).group_name << ", " << (*it).number_of_messages << " messages, last is " << time(NULL)-(*it).last_message_ts << " secs ago." << std::endl; + std::cerr << " group " << (*it).mGroupId << ": " << (*it).mGroupName << ", " << (*it).mNumberOfMessages << " messages, last is " << time(NULL)-(*it).mLastMessageTs << " secs ago." << std::endl; auto it = mSearchableServices.find(result_gs->service) ; diff --git a/libretroshare/src/retroshare/rsgxsiface.h b/libretroshare/src/retroshare/rsgxsiface.h index 7ccedff36..b85f3fbce 100644 --- a/libretroshare/src/retroshare/rsgxsiface.h +++ b/libretroshare/src/retroshare/rsgxsiface.h @@ -34,26 +34,42 @@ #include "util/rsdeprecate.h" /*! - * \brief The RsGxsGroupSymmary struct - * This structure is used to transport group summary information when a GXS service is searched. It contains the group information - * as well as a context string to tell where the information was found. It is more compact than a GroupMeta object, so as to make - * search responses as light as possible. + * This structure is used to transport group summary information when a GXS + * service is searched. It contains the group information as well as a context + * string to tell where the information was found. It is more compact than a + * GroupMeta object, so as to make search responses as light as possible. */ -struct RsGxsGroupSummary +struct RsGxsGroupSummary : RsSerializable { - RsGxsGroupSummary() : publish_ts(0), number_of_messages(0),last_message_ts(0),sign_flags(0),popularity(0) {} + RsGxsGroupSummary() : + mPublishTs(0), mNumberOfMessages(0),mLastMessageTs(0), + mSignFlags(0),mPopularity(0) {} - RsGxsGroupId group_id ; + RsGxsGroupId mGroupId; + std::string mGroupName; + RsGxsId mAuthorId; + time_t mPublishTs; + uint32_t mNumberOfMessages; + time_t mLastMessageTs; + uint32_t mSignFlags; + uint32_t mPopularity; - std::string group_name ; - RS_DEPRECATED std::string group_description; - std::string search_context ; - RsGxsId author_id ; - time_t publish_ts ; - uint32_t number_of_messages ; - time_t last_message_ts ; - uint32_t sign_flags ; - uint32_t popularity ; + std::string mSearchContext; + + /// @see RsSerializable::serial_process + void serial_process( RsGenericSerializer::SerializeJob j, + RsGenericSerializer::SerializeContext& ctx ) + { + RS_SERIAL_PROCESS(mGroupId); + RS_SERIAL_PROCESS(mGroupName); + RS_SERIAL_PROCESS(mAuthorId); + RS_SERIAL_PROCESS(mPublishTs); + RS_SERIAL_PROCESS(mNumberOfMessages); + RS_SERIAL_PROCESS(mLastMessageTs); + RS_SERIAL_PROCESS(mSignFlags); + RS_SERIAL_PROCESS(mPopularity); + RS_SERIAL_PROCESS(mSearchContext); + } }; diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index 8474d3111..1c7cf1058 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -1703,21 +1703,18 @@ bool p3GxsChannels::retrieveDistantSearchResults(TurtleRequestId req,std::mapretrieveDistantGroupSummary(group_id,gs)) { // This is a placeholder information by the time we receive the full group meta data. - - distant_group.mDescription = gs.group_description; - - distant_group.mMeta.mGroupId = gs.group_id ; - distant_group.mMeta.mGroupName = gs.group_name; + distant_group.mMeta.mGroupId = gs.mGroupId ; + distant_group.mMeta.mGroupName = gs.mGroupName; distant_group.mMeta.mGroupFlags = GXS_SERV::FLAG_PRIVACY_PUBLIC ; - distant_group.mMeta.mSignFlags = gs.sign_flags; + distant_group.mMeta.mSignFlags = gs.mSignFlags; - distant_group.mMeta.mPublishTs = gs.publish_ts; - distant_group.mMeta.mAuthorId = gs.author_id; + distant_group.mMeta.mPublishTs = gs.mPublishTs; + distant_group.mMeta.mAuthorId = gs.mAuthorId; distant_group.mMeta.mCircleType = GXS_CIRCLE_TYPE_PUBLIC ;// guessed, otherwise the group would not be search-able. @@ -1726,9 +1723,9 @@ bool p3GxsChannels::retrieveDistantGroup(const RsGxsGroupId& group_id,RsGxsChann distant_group.mMeta.mSubscribeFlags = GXS_SERV::GROUP_SUBSCRIBE_NOT_SUBSCRIBED ; - distant_group.mMeta.mPop = gs.popularity; // Popularity = number of friend subscribers - distant_group.mMeta.mVisibleMsgCount = gs.number_of_messages; // Max messages reported by friends - distant_group.mMeta.mLastPost = gs.last_message_ts; // Timestamp for last message. Not used yet. + distant_group.mMeta.mPop = gs.mPopularity; // Popularity = number of friend subscribers + distant_group.mMeta.mVisibleMsgCount = gs.mNumberOfMessages; // Max messages reported by friends + distant_group.mMeta.mLastPost = gs.mLastMessageTs; // Timestamp for last message. Not used yet. return true ; } diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 58e7bb93a..473b26e7d 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -279,21 +279,22 @@ void GxsGroupFrameDialog::updateSearchResults() QList group_items ; - for(auto it3(group_infos.begin());it3!=group_infos.end();++it3) - if(mCachedGroupMetas.find(it3->first) == mCachedGroupMetas.end()) + for(auto it3(group_infos.begin());it3!=group_infos.end();++it3) + if(mCachedGroupMetas.find(it3->first) == mCachedGroupMetas.end()) { - std::cerr << " adding new group " << it3->first << " " << it3->second.group_id << " \"" << it3->second.group_name << "\"" << std::endl; + std::cerr << " adding new group " << it3->first << " " + << it3->second.mGroupId << " \"" + << it3->second.mGroupName << "\"" << std::endl; - GroupItemInfo i ; - i.id = QString(it3->second.group_id.toStdString().c_str()) ; - i.name = QString::fromUtf8(it3->second.group_name.c_str()) ; - i.description = QString::fromUtf8(it3->second.group_description.c_str()) ; + GroupItemInfo i; + i.id = QString(it3->second.mGroupId.toStdString().c_str()); + i.name = QString::fromUtf8(it3->second.mGroupName.c_str()); i.popularity = 0; // could be set to the number of hits - i.lastpost = QDateTime::fromTime_t(it3->second.last_message_ts); + i.lastpost = QDateTime::fromTime_t(it3->second.mLastMessageTs); i.subscribeFlags = 0; // irrelevant here - i.publishKey = false ; // IS_GROUP_PUBLISHER(groupInfo.mSubscribeFlags) ; - i.adminKey = false ; // IS_GROUP_ADMIN(groupInfo.mSubscribeFlags) ; - i.max_visible_posts = it3->second.number_of_messages ; + i.publishKey = false ; // IS_GROUP_PUBLISHER(groupInfo.mSubscribeFlags); + i.adminKey = false ; // IS_GROUP_ADMIN(groupInfo.mSubscribeFlags); + i.max_visible_posts = it3->second.mNumberOfMessages; group_items.push_back(i); } From d9aa37219cc715fc8e8e255712d28e2558ec3e5b Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sun, 22 Jul 2018 21:45:43 +0200 Subject: [PATCH 135/138] Revert "DROP before merge. Reduce INTEGRITY_CHECK_PERIOD" This reverts commit ce61174d79227588375678bfe446980420f50168. --- libretroshare/src/gxs/rsgenexchange.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 2630c7379..3927e6f61 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -59,10 +59,10 @@ static const uint32_t INDEX_AUTHEN_ADMIN = 0x00000040; // admin key #define GXS_MASK "GXS_MASK_HACK" -#define GEN_EXCH_DEBUG 1 +//#define GEN_EXCH_DEBUG 1 static const uint32_t MSG_CLEANUP_PERIOD = 60*59; // 59 minutes -static const uint32_t INTEGRITY_CHECK_PERIOD = 60*2; // 31 minutes // TODO: Restore this line before merging deep_search +static const uint32_t INTEGRITY_CHECK_PERIOD = 60*31; // 31 minutes RsGenExchange::RsGenExchange(RsGeneralDataService *gds, RsNetworkExchangeService *ns, RsSerialType *serviceSerialiser, uint16_t servType, RsGixs* gixs, From 51c25219bb965f2c2e5702664a229e48cae16c8c Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sun, 22 Jul 2018 22:47:30 +0200 Subject: [PATCH 136/138] Fix compiling with old GCC --- libretroshare/src/gxs/rsgxsnetservice.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index b6fe8420d..bd68b53f7 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -243,7 +243,6 @@ #include #include #include -#include #include "rsgxsnetservice.h" #include "gxssecurity.h" @@ -262,6 +261,13 @@ # include "deep_search/deep_search.h" #endif +#include "util/cxx11retrocompat.h" +#if defined(GCC_VERSION) && GCC_VERSION > 50100 +# include +#else +# include +#endif + /*** * Use the following defines to debug: NXS_NET_DEBUG_0 shows group update high level information @@ -5303,9 +5309,15 @@ bool RsGxsNetService::search( const std::string& substring, s.mSignFlags = std::stoul(rit->second); if((rit = uQ.find("publishDate")) != uQ.end()) { + std::tm tm; memset(&tm, 0, sizeof(tm)); +#if defined(GCC_VERSION) && GCC_VERSION > 50100 std::istringstream ss(rit->second); - std::tm tm; ss >> std::get_time(&tm, "%Y%m%d"); +#else // defined(GCC_VERSION) && GCC_VERSION > 50100 + sscanf( rit->second.c_str(), + "%4d%2d%2d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday ); +#endif // defined(GCC_VERSION) && GCC_VERSION > 50100 + s.mPublishTs = mktime(&tm); } if((rit = uQ.find("authorId")) != uQ.end()) From 6f8c2f6f41af9b7b63795d662950669690f30a64 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sun, 22 Jul 2018 23:39:06 +0200 Subject: [PATCH 137/138] Fix compilation if deep_search is disabled --- libretroshare/src/gxs/rsgxsnetservice.cc | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index bd68b53f7..12b218138 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -5339,23 +5339,23 @@ bool RsGxsNetService::search( const std::string& substring, RS_STACK_MUTEX(mNxsMutex) ; mDataStore->retrieveGxsGrpMetaData(grpMetaMap); } - RsGroupNetworkStats stats ; - for(auto it(grpMetaMap.begin());it!=grpMetaMap.end();++it) + + RsGroupNetworkStats stats; + for(auto it(grpMetaMap.begin());it!=grpMetaMap.end();++it) if(termSearch(it->second->mGroupName,substring)) { - getGroupNetworkStats(it->first,stats) ; + getGroupNetworkStats(it->first,stats); - RsGxsGroupSummary s ; - s.group_id = it->first ; - s.group_name = it->second->mGroupName ; - // to be filled with something better when we use the real search - s.search_context = it->second->mGroupName ; - s.sign_flags = it->second->mSignFlags; - s.publish_ts = it->second->mPublishTs; - s.author_id = it->second->mAuthorId; - s.number_of_messages = stats.mMaxVisibleCount ; - s.last_message_ts = stats.mLastGroupModificationTS ; - s.popularity = it->second->mPop; + RsGxsGroupSummary s; + s.mGroupId = it->first; + s.mGroupName = it->second->mGroupName; + s.mSearchContext = it->second->mGroupName; + s.mSignFlags = it->second->mSignFlags; + s.mPublishTs = it->second->mPublishTs; + s.mAuthorId = it->second->mAuthorId; + s.mNumberOfMessages = stats.mMaxVisibleCount; + s.mLastMessageTs = stats.mLastGroupModificationTS; + s.mPopularity = it->second->mPop; group_infos.push_back(s); } From e8c9ba52b247bb32348d5b1c2f6b1fdf7d63d364 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Mon, 23 Jul 2018 11:18:32 +0200 Subject: [PATCH 138/138] Improve code quality after Cyril review --- libretroshare/src/deep_search/deep_search.h | 23 +++++++++++---------- libretroshare/src/gxs/rsgxsnetservice.cc | 22 ++------------------ libretroshare/src/gxs/rsgxsnettunnel.cc | 3 ++- libretroshare/src/gxs/rsgxsutil.cc | 2 +- 4 files changed, 17 insertions(+), 33 deletions(-) diff --git a/libretroshare/src/deep_search/deep_search.h b/libretroshare/src/deep_search/deep_search.h index 914fce6a2..3fed67c01 100644 --- a/libretroshare/src/deep_search/deep_search.h +++ b/libretroshare/src/deep_search/deep_search.h @@ -99,11 +99,7 @@ struct DeepSearch // Index each field with a suitable prefix. termgenerator.index_text(chan.mMeta.mGroupName, 1, "G"); - - char date[] = "YYYYMMDD\0"; - std::strftime(date, 9, "%Y%m%d", std::gmtime(&chan.mMeta.mPublishTs)); - termgenerator.index_text(date, 1, "D"); - + termgenerator.index_text(timetToXapianDate(chan.mMeta.mPublishTs), 1, "D"); termgenerator.index_text(chan.mDescription, 1, "XD"); // Index fields without prefixes for general search. @@ -116,7 +112,7 @@ struct DeepSearch .setQueryKV("id", chan.mMeta.mGroupId.toStdString()); const std::string idTerm("Q" + chanUrl.toString()); - chanUrl.setQueryKV("publishDate", date); + chanUrl.setQueryKV("publishTs", std::to_string(chan.mMeta.mPublishTs)); chanUrl.setQueryKV("name", chan.mMeta.mGroupName); if(!chan.mMeta.mAuthorId.isNull()) chanUrl.setQueryKV("authorId", chan.mMeta.mAuthorId.toStdString()); @@ -164,10 +160,7 @@ struct DeepSearch // Index each field with a suitable prefix. termgenerator.index_text(post.mMeta.mMsgName, 1, "S"); - - char date[] = "YYYYMMDD\0"; - std::strftime(date, 9, "%Y%m%d", std::gmtime(&post.mMeta.mPublishTs)); - termgenerator.index_text(date, 1, "D"); + termgenerator.index_text(timetToXapianDate(post.mMeta.mPublishTs), 1, "D"); // Avoid indexing HTML bool isPlainMsg = post.mMsg[0] != '<' || post.mMsg[post.mMsg.size() - 1] != '>'; @@ -200,8 +193,9 @@ struct DeepSearch .setQueryKV("msgid", post.mMeta.mMsgId.toStdString()); std::string idTerm("Q" + postUrl.toString()); - postUrl.setQueryKV("publishDate", date); + postUrl.setQueryKV("publishTs", std::to_string(post.mMeta.mPublishTs)); postUrl.setQueryKV("name", post.mMeta.mMsgName); + postUrl.setQueryKV("authorId", post.mMeta.mAuthorId.toStdString()); std::string rsLink(postUrl.toString()); // store the RS link so we are able to retrive it on matching search @@ -247,5 +241,12 @@ private: RsAccounts::AccountDirectory() + "/deep_search_xapian_db"; return dbDir; } + + static std::string timetToXapianDate(const time_t& time) + { + char date[] = "YYYYMMDD\0"; + std::strftime(date, 9, "%Y%m%d", std::gmtime(&time)); + return date; + } }; diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 12b218138..8f4ee033c 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -261,13 +261,6 @@ # include "deep_search/deep_search.h" #endif -#include "util/cxx11retrocompat.h" -#if defined(GCC_VERSION) && GCC_VERSION > 50100 -# include -#else -# include -#endif - /*** * Use the following defines to debug: NXS_NET_DEBUG_0 shows group update high level information @@ -5307,19 +5300,8 @@ bool RsGxsNetService::search( const std::string& substring, s.mGroupName = rit->second; if((rit = uQ.find("signFlags")) != uQ.end()) s.mSignFlags = std::stoul(rit->second); - if((rit = uQ.find("publishDate")) != uQ.end()) - { - std::tm tm; memset(&tm, 0, sizeof(tm)); -#if defined(GCC_VERSION) && GCC_VERSION > 50100 - std::istringstream ss(rit->second); - ss >> std::get_time(&tm, "%Y%m%d"); -#else // defined(GCC_VERSION) && GCC_VERSION > 50100 - sscanf( rit->second.c_str(), - "%4d%2d%2d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday ); -#endif // defined(GCC_VERSION) && GCC_VERSION > 50100 - - s.mPublishTs = mktime(&tm); - } + if((rit = uQ.find("publishTs")) != uQ.end()) + s.mPublishTs = static_cast(std::stoll(rit->second)); if((rit = uQ.find("authorId")) != uQ.end()) s.mAuthorId = RsGxsId(rit->second); diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index dfa0d8655..bbe10694b 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -61,8 +61,9 @@ const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_KEEP_ALIVE = 0x02 const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_RANDOM_BIAS = 0x03 ; const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_SUBSTRING = 0x04 ; const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_REQUEST = 0x05 ; -const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_SUMMARY = 0x06 ; +// const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_SUMMARY = 0x06; // DEPRECATED const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_DATA = 0x07 ; +const uint8_t RS_PKT_SUBTYPE_GXS_NET_TUNNEL_TURTLE_SEARCH_GROUP_SUMMARY = 0x08; class RsGxsNetTunnelItem: public RsItem { diff --git a/libretroshare/src/gxs/rsgxsutil.cc b/libretroshare/src/gxs/rsgxsutil.cc index 2212ea311..2e7a69079 100644 --- a/libretroshare/src/gxs/rsgxsutil.cc +++ b/libretroshare/src/gxs/rsgxsutil.cc @@ -162,7 +162,7 @@ void RsGxsIntegrityCheck::run() bool RsGxsIntegrityCheck::check() { #ifdef RS_DEEP_SEARCH - bool isGxsChannels = dynamic_cast(mGenExchangeClient); + bool isGxsChannels = mGenExchangeClient->serviceType() == RS_SERVICE_GXS_TYPE_CHANNELS; std::set indexedGroups; #endif