mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-24 23:19:29 -05:00
moved converted serialisation files into new directory rsitems/, leaving serialiser/ for the serialisation classes
This commit is contained in:
parent
f8fc8b40e4
commit
e2d9152b22
@ -29,7 +29,7 @@
|
||||
#include "retroshare/rstypes.h"
|
||||
#include "serialization/rsserializer.h"
|
||||
#include "serialiser/rstlvkeys.h"
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
|
||||
#include "serialiser/rstlvidset.h"
|
||||
|
@ -22,7 +22,7 @@
|
||||
* Please report all bugs and problems to "retroshare.project@gmail.com".
|
||||
*
|
||||
*/
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
|
||||
#include "file_sharing/p3filelists.h"
|
||||
#include "file_sharing/directory_storage.h"
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <map>
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rstlvbase.h"
|
||||
#include "serialiser/rstlvitem.h"
|
||||
|
@ -49,8 +49,8 @@ const int ftserverzone = 29539;
|
||||
#include "pqi/pqi.h"
|
||||
#include "pqi/p3linkmgr.h"
|
||||
|
||||
#include "serialiser/rsfiletransferitems.h"
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsfiletransferitems.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
|
||||
/***
|
||||
* #define SERVER_DEBUG 1
|
||||
|
@ -27,557 +27,17 @@
|
||||
#include <stdexcept>
|
||||
|
||||
#include <util/rsmemory.h>
|
||||
#include <serialiser/itempriorities.h>
|
||||
#include <rsitems/itempriorities.h>
|
||||
#include <ft/ftturtlefiletransferitem.h>
|
||||
|
||||
#include <serialization/rstypeserializer.h>
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
uint32_t RsTurtleFileRequestItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
s += 8 ; // header
|
||||
s += 4 ; // tunnel id
|
||||
s += 8 ; // file offset
|
||||
s += 4 ; // chunk size
|
||||
|
||||
return s ;
|
||||
}
|
||||
|
||||
uint32_t RsTurtleFileDataItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
s += 8 ; // header
|
||||
s += 4 ; // tunnel id
|
||||
s += 8 ; // file offset
|
||||
s += 4 ; // chunk size
|
||||
s += chunk_size ; // actual data size.
|
||||
|
||||
return s ;
|
||||
}
|
||||
|
||||
uint32_t RsTurtleFileMapRequestItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
s += 8 ; // header
|
||||
s += 4 ; // tunnel id
|
||||
s += 4 ; // direction
|
||||
|
||||
return s ;
|
||||
}
|
||||
|
||||
uint32_t RsTurtleFileMapItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
s += 8 ; // header
|
||||
s += 4 ; // tunnel id
|
||||
s += 4 ; // direction
|
||||
s += 4 ; // compressed_map.size()
|
||||
|
||||
s += 4 * compressed_map._map.size() ;
|
||||
|
||||
return s ;
|
||||
}
|
||||
|
||||
uint32_t RsTurtleChunkCrcItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
s += 8 ; // header
|
||||
s += 4 ; // tunnel id
|
||||
s += 4 ; // chunk number
|
||||
s += check_sum.serial_size() ; // check_sum
|
||||
|
||||
return s ;
|
||||
}
|
||||
uint32_t RsTurtleChunkCrcRequestItem::serial_size() const
|
||||
{
|
||||
uint32_t s = 0 ;
|
||||
|
||||
s += 8 ; // header
|
||||
s += 4 ; // tunnel id
|
||||
s += 4 ; // chunk number
|
||||
|
||||
return s ;
|
||||
}
|
||||
#endif
|
||||
|
||||
void RsTurtleFileMapRequestItem::serial_process(SerializeJob j,SerializeContext& ctx)
|
||||
{
|
||||
RsTypeSerializer::serial_process<uint32_t>(j,ctx,tunnel_id,"tunnel_id") ;
|
||||
RsTypeSerializer::serial_process<uint32_t>(j,ctx,direction,"direction") ;
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
bool RsTurtleFileMapRequestItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
|
||||
if (pktsize < tlvsize)
|
||||
return false; /* not enough space */
|
||||
|
||||
pktsize = tlvsize;
|
||||
|
||||
bool ok = true;
|
||||
|
||||
ok &= setRsItemHeader(data,tlvsize,PacketId(), tlvsize);
|
||||
|
||||
/* skip the header */
|
||||
offset += 8;
|
||||
|
||||
/* add mandatory parts first */
|
||||
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, tunnel_id);
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, direction);
|
||||
|
||||
if (offset != tlvsize)
|
||||
{
|
||||
ok = false;
|
||||
#ifdef RSSERIAL_DEBUG
|
||||
std::cerr << "RsFileConfigSerialiser::serialiseTransfer() Size Error! " << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
bool RsTurtleFileMapItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
|
||||
if (pktsize < tlvsize)
|
||||
return false; /* not enough space */
|
||||
|
||||
pktsize = tlvsize;
|
||||
|
||||
bool ok = true;
|
||||
|
||||
ok &= setRsItemHeader(data,tlvsize,PacketId(), tlvsize);
|
||||
|
||||
/* skip the header */
|
||||
offset += 8;
|
||||
|
||||
/* add mandatory parts first */
|
||||
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, tunnel_id);
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, direction);
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, compressed_map._map.size());
|
||||
|
||||
for(uint32_t i=0;i<compressed_map._map.size() && ok;++i)
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, compressed_map._map[i]);
|
||||
|
||||
if (offset != tlvsize)
|
||||
{
|
||||
ok = false;
|
||||
#ifdef RSSERIAL_DEBUG
|
||||
std::cerr << "RsFileConfigSerialiser::serialiseTransfer() Size Error! " << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool RsTurtleChunkCrcRequestItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
#ifdef P3TURTLE_DEBUG
|
||||
std::cerr << "RsTurtleChunkCrcRequestItem::serialize(): serializing packet:" << std::endl ;
|
||||
print(std::cerr,2) ;
|
||||
#endif
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
|
||||
if (pktsize < tlvsize)
|
||||
return false; /* not enough space */
|
||||
|
||||
pktsize = tlvsize;
|
||||
|
||||
bool ok = true;
|
||||
|
||||
ok &= setRsItemHeader(data,tlvsize,PacketId(), tlvsize);
|
||||
|
||||
/* skip the header */
|
||||
offset += 8;
|
||||
|
||||
/* add mandatory parts first */
|
||||
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, tunnel_id);
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, chunk_number);
|
||||
|
||||
if (offset != tlvsize)
|
||||
{
|
||||
ok = false;
|
||||
std::cerr << "RsFileConfigSerialiser::serialiseTransfer() Size Error! " << std::endl;
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool RsTurtleChunkCrcItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
#ifdef P3TURTLE_DEBUG
|
||||
std::cerr << "RsTurtleChunkCrcRequestItem::serialize(): serializing packet:" << std::endl ;
|
||||
print(std::cerr,2) ;
|
||||
#endif
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
|
||||
if (pktsize < tlvsize)
|
||||
return false; /* not enough space */
|
||||
|
||||
pktsize = tlvsize;
|
||||
|
||||
bool ok = true;
|
||||
|
||||
ok &= setRsItemHeader(data,tlvsize,PacketId(), tlvsize);
|
||||
|
||||
/* skip the header */
|
||||
offset += 8;
|
||||
|
||||
/* add mandatory parts first */
|
||||
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, tunnel_id);
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, chunk_number);
|
||||
ok &= check_sum.serialise(data, tlvsize, offset) ;
|
||||
|
||||
if (offset != tlvsize)
|
||||
{
|
||||
ok = false;
|
||||
std::cerr << "RsFileConfigSerialiser::serialiseTransfer() Size Error! " << std::endl;
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
RsTurtleFileMapItem::RsTurtleFileMapItem(void *data,uint32_t pktsize)
|
||||
: RsTurtleGenericTunnelItem(RS_TURTLE_SUBTYPE_FILE_MAP)
|
||||
{
|
||||
setPriorityLevel(QOS_PRIORITY_RS_TURTLE_FILE_MAP) ;
|
||||
#ifdef P3TURTLE_DEBUG
|
||||
std::cerr << " type = file map item" << std::endl ;
|
||||
#endif
|
||||
uint32_t offset = 8; // skip the header
|
||||
|
||||
/* add mandatory parts first */
|
||||
|
||||
bool ok = true ;
|
||||
uint32_t s,d ;
|
||||
ok &= getRawUInt32(data, pktsize, &offset, &tunnel_id);
|
||||
ok &= getRawUInt32(data, pktsize, &offset, &d);
|
||||
direction = d ;
|
||||
ok &= getRawUInt32(data, pktsize, &offset, &s) ;
|
||||
|
||||
compressed_map._map.resize(s) ;
|
||||
|
||||
for(uint32_t i=0;i<s && ok;++i)
|
||||
ok &= getRawUInt32(data, pktsize, &offset, &(compressed_map._map[i])) ;
|
||||
|
||||
#ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs).
|
||||
#else
|
||||
if (offset != pktsize)
|
||||
throw std::runtime_error("Size error while deserializing.") ;
|
||||
if (!ok)
|
||||
throw std::runtime_error("Unknown error while deserializing.") ;
|
||||
#endif
|
||||
}
|
||||
|
||||
RsTurtleFileMapRequestItem::RsTurtleFileMapRequestItem(void *data,uint32_t pktsize)
|
||||
: RsTurtleGenericTunnelItem(RS_TURTLE_SUBTYPE_FILE_MAP_REQUEST)
|
||||
{
|
||||
setPriorityLevel(QOS_PRIORITY_RS_TURTLE_FILE_MAP_REQUEST) ;
|
||||
#ifdef P3TURTLE_DEBUG
|
||||
std::cerr << " type = file map request item" << std::endl ;
|
||||
#endif
|
||||
uint32_t offset = 8; // skip the header
|
||||
|
||||
/* add mandatory parts first */
|
||||
|
||||
bool ok = true ;
|
||||
ok &= getRawUInt32(data, pktsize, &offset, &tunnel_id);
|
||||
ok &= getRawUInt32(data, pktsize, &offset, &direction);
|
||||
|
||||
#ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs).
|
||||
#else
|
||||
if (offset != pktsize)
|
||||
throw std::runtime_error("Size error while deserializing.") ;
|
||||
if (!ok)
|
||||
throw std::runtime_error("Unknown error while deserializing.") ;
|
||||
#endif
|
||||
}
|
||||
|
||||
RsTurtleChunkCrcItem::RsTurtleChunkCrcItem(void *data,uint32_t pktsize)
|
||||
: RsTurtleGenericTunnelItem(RS_TURTLE_SUBTYPE_CHUNK_CRC)
|
||||
{
|
||||
setPriorityLevel(QOS_PRIORITY_RS_TURTLE_CHUNK_CRC) ;
|
||||
#ifdef P3TURTLE_DEBUG
|
||||
std::cerr << " type = file map item" << std::endl ;
|
||||
#endif
|
||||
uint32_t offset = 8; // skip the header
|
||||
|
||||
/* add mandatory parts first */
|
||||
|
||||
bool ok = true ;
|
||||
ok &= getRawUInt32(data, pktsize, &offset, &tunnel_id) ;
|
||||
ok &= getRawUInt32(data, pktsize, &offset, &chunk_number) ;
|
||||
ok &= check_sum.deserialise(data, pktsize, offset) ;
|
||||
|
||||
#ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs).
|
||||
#else
|
||||
if (offset != pktsize)
|
||||
throw std::runtime_error("Size error while deserializing.") ;
|
||||
if (!ok)
|
||||
throw std::runtime_error("Unknown error while deserializing.") ;
|
||||
#endif
|
||||
}
|
||||
|
||||
RsTurtleChunkCrcRequestItem::RsTurtleChunkCrcRequestItem(void *data,uint32_t pktsize)
|
||||
: RsTurtleGenericTunnelItem(RS_TURTLE_SUBTYPE_CHUNK_CRC_REQUEST)
|
||||
{
|
||||
setPriorityLevel(QOS_PRIORITY_RS_TURTLE_CHUNK_CRC_REQUEST) ;
|
||||
#ifdef P3TURTLE_DEBUG
|
||||
std::cerr << " type = file map item" << std::endl ;
|
||||
#endif
|
||||
uint32_t offset = 8; // skip the header
|
||||
|
||||
/* add mandatory parts first */
|
||||
|
||||
bool ok = true ;
|
||||
ok &= getRawUInt32(data, pktsize, &offset, &tunnel_id) ;
|
||||
ok &= getRawUInt32(data, pktsize, &offset, &chunk_number) ;
|
||||
|
||||
#ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs).
|
||||
#else
|
||||
if (offset != pktsize)
|
||||
throw std::runtime_error("Size error while deserializing.") ;
|
||||
if (!ok)
|
||||
throw std::runtime_error("Unknown error while deserializing.") ;
|
||||
#endif
|
||||
}
|
||||
bool RsTurtleFileRequestItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
|
||||
if (pktsize < tlvsize)
|
||||
return false; /* not enough space */
|
||||
|
||||
pktsize = tlvsize;
|
||||
|
||||
bool ok = true;
|
||||
|
||||
ok &= setRsItemHeader(data,tlvsize,PacketId(), tlvsize);
|
||||
|
||||
/* skip the header */
|
||||
offset += 8;
|
||||
|
||||
/* add mandatory parts first */
|
||||
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, tunnel_id) ;
|
||||
ok &= setRawUInt64(data, tlvsize, &offset, chunk_offset);
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, chunk_size);
|
||||
|
||||
if (offset != tlvsize)
|
||||
{
|
||||
ok = false;
|
||||
#ifdef RSSERIAL_DEBUG
|
||||
std::cerr << "RsTurtleTunnelOkItem::serialiseTransfer() Size Error! " << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
RsTurtleFileRequestItem::RsTurtleFileRequestItem(void *data,uint32_t pktsize)
|
||||
: RsTurtleGenericTunnelItem(RS_TURTLE_SUBTYPE_FILE_REQUEST)
|
||||
{
|
||||
setPriorityLevel(QOS_PRIORITY_RS_TURTLE_FILE_REQUEST) ;
|
||||
#ifdef P3TURTLE_DEBUG
|
||||
std::cerr << " type = file request" << std::endl ;
|
||||
#endif
|
||||
uint32_t offset = 8; // skip the header
|
||||
uint32_t rssize = getRsItemSize(data);
|
||||
|
||||
/* add mandatory parts first */
|
||||
|
||||
bool ok = true ;
|
||||
ok &= getRawUInt32(data, pktsize, &offset, &tunnel_id) ;
|
||||
ok &= getRawUInt64(data, pktsize, &offset, &chunk_offset);
|
||||
ok &= getRawUInt32(data, pktsize, &offset, &chunk_size);
|
||||
#ifdef P3TURTLE_DEBUG
|
||||
std::cerr << " tunnel_id=" << (void*)tunnel_id << ", chunk_offset=" << chunk_offset << ", chunk_size=" << chunk_size << std::endl ;
|
||||
#endif
|
||||
|
||||
#ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs).
|
||||
UNREFERENCED_LOCAL_VARIABLE(rssize);
|
||||
#else
|
||||
if (offset != rssize)
|
||||
throw std::runtime_error("RsTurtleTunnelOkItem::() error while deserializing.") ;
|
||||
if (!ok)
|
||||
throw std::runtime_error("RsTurtleTunnelOkItem::() unknown error while deserializing.") ;
|
||||
#endif
|
||||
}
|
||||
|
||||
RsTurtleFileDataItem::~RsTurtleFileDataItem()
|
||||
{
|
||||
free(chunk_data) ;
|
||||
}
|
||||
RsTurtleFileDataItem::RsTurtleFileDataItem(void *data,uint32_t pktsize)
|
||||
: RsTurtleGenericTunnelItem(RS_TURTLE_SUBTYPE_FILE_DATA)
|
||||
{
|
||||
setPriorityLevel(QOS_PRIORITY_RS_TURTLE_FILE_DATA) ;
|
||||
#ifdef P3TURTLE_DEBUG
|
||||
std::cerr << " type = file request" << std::endl ;
|
||||
#endif
|
||||
uint32_t offset = 8; // skip the header
|
||||
uint32_t rssize = getRsItemSize(data);
|
||||
|
||||
bool ok = true ;
|
||||
|
||||
if(rssize > pktsize)
|
||||
ok = false ;
|
||||
|
||||
/* add mandatory parts first */
|
||||
ok &= getRawUInt32(data, pktsize, &offset, &tunnel_id) ;
|
||||
ok &= getRawUInt64(data, pktsize, &offset, &chunk_offset);
|
||||
ok &= getRawUInt32(data, pktsize, &offset, &chunk_size);
|
||||
|
||||
if(chunk_size > rssize || rssize - chunk_size < offset)
|
||||
throw std::runtime_error("RsTurtleFileDataItem::() error while deserializing.") ;
|
||||
|
||||
chunk_data = (void*)rs_malloc(chunk_size) ;
|
||||
|
||||
if(chunk_data == NULL)
|
||||
throw std::runtime_error("RsTurtleFileDataItem::() cannot allocate memory.") ;
|
||||
|
||||
memcpy(chunk_data,(void*)((unsigned char*)data+offset),chunk_size) ;
|
||||
|
||||
offset += chunk_size ;
|
||||
|
||||
#ifdef P3TURTLE_DEBUG
|
||||
std::cerr << " tunnel_id=" << (void*)tunnel_id << ", chunk_offset=" << chunk_offset << ", chunk_size=" << chunk_size << std::endl ;
|
||||
#endif
|
||||
|
||||
#ifdef WINDOWS_SYS // No Exceptions in Windows compile. (drbobs).
|
||||
UNREFERENCED_LOCAL_VARIABLE(rssize);
|
||||
#else
|
||||
if (offset != rssize)
|
||||
throw std::runtime_error("RsTurtleFileDataItem::() error while deserializing.") ;
|
||||
if (!ok)
|
||||
throw std::runtime_error("RsTurtleFileDataItem::() unknown error while deserializing.") ;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool RsTurtleFileDataItem::serialize(void *data,uint32_t& pktsize) const
|
||||
{
|
||||
uint32_t tlvsize = serial_size();
|
||||
uint32_t offset = 0;
|
||||
|
||||
if (pktsize < tlvsize)
|
||||
return false; /* not enough space */
|
||||
|
||||
pktsize = tlvsize;
|
||||
|
||||
bool ok = true;
|
||||
|
||||
ok &= setRsItemHeader(data,tlvsize,PacketId(), tlvsize);
|
||||
|
||||
/* skip the header */
|
||||
offset += 8;
|
||||
|
||||
/* add mandatory parts first */
|
||||
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, tunnel_id) ;
|
||||
ok &= setRawUInt64(data, tlvsize, &offset, chunk_offset);
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, chunk_size);
|
||||
|
||||
memcpy((void*)((unsigned char*)data+offset),chunk_data,chunk_size) ;
|
||||
offset += chunk_size ;
|
||||
|
||||
if (offset != tlvsize)
|
||||
{
|
||||
ok = false;
|
||||
#ifdef RSSERIAL_DEBUG
|
||||
std::cerr << "RsTurtleTunnelOkItem::serialiseTransfer() Size Error! " << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
std::ostream& RsTurtleFileRequestItem::print(std::ostream& o, uint16_t)
|
||||
{
|
||||
o << "File request item:" << std::endl ;
|
||||
|
||||
o << " tunnel id : " << std::hex << tunnel_id << std::dec << std::endl ;
|
||||
o << " offset : " << chunk_offset << std::endl ;
|
||||
o << " chunk size: " << chunk_size << std::endl ;
|
||||
|
||||
return o ;
|
||||
}
|
||||
|
||||
std::ostream& RsTurtleFileDataItem::print(std::ostream& o, uint16_t)
|
||||
{
|
||||
o << "File request item:" << std::endl ;
|
||||
|
||||
o << " tunnel id : " << std::hex << tunnel_id << std::dec << std::endl ;
|
||||
o << " offset : " << chunk_offset << std::endl ;
|
||||
o << " chunk size: " << chunk_size << std::endl ;
|
||||
o << " data : " << std::hex << chunk_data << std::dec << std::endl ;
|
||||
|
||||
return o ;
|
||||
}
|
||||
|
||||
std::ostream& RsTurtleFileMapItem::print(std::ostream& o, uint16_t)
|
||||
{
|
||||
o << "File map item:" << std::endl ;
|
||||
|
||||
o << " tunnel id : " << std::hex << tunnel_id << std::dec << std::endl ;
|
||||
o << " direction : " << direction << std::endl ;
|
||||
o << " map : " ;
|
||||
|
||||
for(uint32_t i=0;i<compressed_map._map.size();++i)
|
||||
o << std::hex << compressed_map._map[i] << std::dec << std::endl ;
|
||||
|
||||
return o ;
|
||||
}
|
||||
|
||||
std::ostream& RsTurtleFileMapRequestItem::print(std::ostream& o, uint16_t)
|
||||
{
|
||||
o << "File map request item:" << std::endl ;
|
||||
|
||||
o << " tunnel id : " << std::hex << tunnel_id << std::dec << std::endl ;
|
||||
o << " direction : " << direction << std::endl ;
|
||||
|
||||
return o ;
|
||||
}
|
||||
|
||||
|
||||
std::ostream& RsTurtleChunkCrcRequestItem::print(std::ostream& o, uint16_t)
|
||||
{
|
||||
o << "Chunk CRC request item:" << std::endl ;
|
||||
|
||||
o << " tunnel id : " << std::hex << tunnel_id << std::dec << std::endl ;
|
||||
o << " chunk num : " << chunk_number << std::endl ;
|
||||
|
||||
return o ;
|
||||
}
|
||||
std::ostream& RsTurtleChunkCrcItem::print(std::ostream& o, uint16_t)
|
||||
{
|
||||
o << "Chunk CRC item:" << std::endl ;
|
||||
|
||||
o << " tunnel id : " << std::hex << tunnel_id << std::dec << std::endl ;
|
||||
o << " chunk num : " << chunk_number << std::endl ;
|
||||
o << " sha1 sum : " << check_sum.toStdString() << std::endl ;
|
||||
|
||||
return o ;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void RsTurtleFileMapItem::serial_process(SerializeJob j,SerializeContext& ctx)
|
||||
{
|
||||
RsTypeSerializer::serial_process<uint32_t>(j,ctx,tunnel_id,"tunnel_id") ;
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rstlvkeys.h"
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "retroshare/rstypes.h"
|
||||
|
||||
#include "retroshare/rsgrouter.h"
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
#include "retroshare/rstypes.h"
|
||||
#include "serialiser/rstlvkeys.h"
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
|
||||
#include "serialiser/rstlvidset.h"
|
||||
|
@ -452,15 +452,15 @@ HEADERS += grouter/groutercache.h \
|
||||
grouter/groutertypes.h \
|
||||
grouter/rsgrouterclient.h
|
||||
|
||||
HEADERS += serialiser/itempriorities.h \
|
||||
HEADERS += rsitems/itempriorities.h \
|
||||
serialiser/rsbaseserial.h \
|
||||
serialiser/rsfiletransferitems.h \
|
||||
rsitems/rsfiletransferitems.h \
|
||||
serialiser/rsserviceserialiser.h \
|
||||
serialiser/rsconfigitems.h \
|
||||
serialiser/rshistoryitems.h \
|
||||
serialiser/rsmsgitems.h \
|
||||
serialiser/rsserial.h \
|
||||
serialiser/rsserviceids.h \
|
||||
rsitems/rsserviceids.h \
|
||||
serialiser/rsserviceitems.h \
|
||||
serialiser/rsstatusitems.h \
|
||||
serialiser/rstlvaddrs.h \
|
||||
@ -479,8 +479,8 @@ HEADERS += serialiser/itempriorities.h \
|
||||
serialiser/rstlvlist.h \
|
||||
serialiser/rstlvmaps.h \
|
||||
serialiser/rstlvbanlist.h \
|
||||
serialiser/rsbanlistitems.h \
|
||||
serialiser/rsbwctrlitems.h \
|
||||
rsitems/rsbanlistitems.h \
|
||||
rsitems/rsbwctrlitems.h \
|
||||
serialiser/rsdiscovery2items.h \
|
||||
serialiser/rsheartbeatitems.h \
|
||||
serialiser/rsrttitems.h \
|
||||
@ -608,7 +608,7 @@ SOURCES += plugins/pluginmanager.cc \
|
||||
serialiser/rspluginitems.cc
|
||||
|
||||
SOURCES += serialiser/rsbaseserial.cc \
|
||||
serialiser/rsfiletransferitems.cc \
|
||||
rsitems/rsfiletransferitems.cc \
|
||||
serialiser/rsserviceserialiser.cc \
|
||||
serialiser/rsconfigitems.cc \
|
||||
serialiser/rshistoryitems.cc \
|
||||
@ -627,8 +627,8 @@ SOURCES += serialiser/rsbaseserial.cc \
|
||||
serialiser/rstlvkeyvalue.cc \
|
||||
serialiser/rstlvgenericparam.cc \
|
||||
serialiser/rstlvbanlist.cc \
|
||||
serialiser/rsbanlistitems.cc \
|
||||
serialiser/rsbwctrlitems.cc \
|
||||
rsitems/rsbanlistitems.cc \
|
||||
rsitems/rsbwctrlitems.cc \
|
||||
serialiser/rsdiscovery2items.cc \
|
||||
serialiser/rsheartbeatitems.cc \
|
||||
serialiser/rsrttitems.cc \
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "p3servicecontrol.h"
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rsbaseserial.h"
|
||||
#include "pqi/p3cfgmgr.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
#include "serialiser/rsbaseserial.h"
|
||||
#include "serialiser/rsbanlistitems.h"
|
||||
#include "rsitems/rsbanlistitems.h"
|
||||
|
||||
#include "serialization/rstypeserializer.h"
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rstlvbanlist.h"
|
||||
#include "serialization/rsserializer.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
#include "serialiser/rsbaseserial.h"
|
||||
#include "serialiser/rsbwctrlitems.h"
|
||||
#include "rsitems/rsbwctrlitems.h"
|
||||
|
||||
/***
|
||||
#define RSSERIAL_DEBUG 1
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rstlvbase.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
#include "serialiser/rsbaseserial.h"
|
||||
#include "serialiser/rstlvbase.h"
|
||||
#include "serialiser/rsfiletransferitems.h"
|
||||
#include "rsitems/rsfiletransferitems.h"
|
||||
|
||||
#include "serialization/rstypeserializer.h"
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "retroshare/rstypes.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rstlvfileitem.h"
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
|
||||
#include "serialization/rsserializer.h"
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
#if 0
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
|
||||
#include "serialiser/rstlvbase.h"
|
||||
#include "serialiser/rstlvtypes.h"
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rstlvidset.h"
|
||||
#include "serialiser/rstlvaddrs.h"
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
|
||||
const uint8_t RS_PKT_SUBTYPE_DISC_PGP_LIST = 0x01;
|
||||
const uint8_t RS_PKT_SUBTYPE_DISC_PGP_CERT = 0x02;
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rstlvbase.h"
|
||||
#include "serialiser/rstlvbinary.h"
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
//#include "serialiser/rstlvtypes.h"
|
||||
#include "serialiser/rstlvfileitem.h"
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rstlvitem.h"
|
||||
#include "serialiser/rstlvstring.h"
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
//#include "serialiser/rstlvtypes.h"
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
//#include "serialiser/rstlvtypes.h"
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
|
||||
#include "rsgxsitems.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
//#include "serialiser/rstlvtypes.h"
|
||||
//#include "serialiser/rstlvkeys.h"
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rstlvkeys.h"
|
||||
#include "serialiser/rstlvidset.h"
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rstlvidset.h"
|
||||
#include "retroshare/rsgxsifacetypes.h"
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#if 0
|
||||
#include <map>
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rstlvbase.h"
|
||||
#include "serialiser/rstlvtypes.h"
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "serialiser/rsbaseserial.h"
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsheartbeatitems.h"
|
||||
|
||||
/***
|
||||
|
@ -29,7 +29,7 @@
|
||||
#define RS_HEARTBEAT_ITEMS_H
|
||||
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
|
||||
const uint8_t RS_PKT_SUBTYPE_HEARTBEAT_PULSE = 0x01;
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "retroshare/rstypes.h"
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#include "retroshare/rstypes.h"
|
||||
#include "serialiser/rstlvkeys.h"
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
|
||||
#include "serialiser/rstlvidset.h"
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <map>
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rstlvbase.h"
|
||||
#include "serialiser/rstlvitem.h"
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
|
||||
#include "rsgxsitems.h"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef RSPOSTEDITEMS_H
|
||||
#define RSPOSTEDITEMS_H
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
//#include "serialiser/rstlvtypes.h"
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
|
||||
/**************************************************************************/
|
||||
|
@ -60,7 +60,7 @@
|
||||
******************************************************************/
|
||||
|
||||
#include <util/smallobject.h>
|
||||
#include "itempriorities.h"
|
||||
#include "rsitems/itempriorities.h"
|
||||
|
||||
const uint8_t RS_PKT_VERSION1 = 0x01;
|
||||
const uint8_t RS_PKT_VERSION_SERVICE = 0x02;
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rstlvbase.h"
|
||||
#include "serialiser/rstlvgenericmap.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
|
||||
/**************************************************************************/
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
//#include "serialiser/rstlvtypes.h"
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
//#include "serialiser/rstlvtypes.h"
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "util/rsnet.h"
|
||||
|
||||
#include "services/p3banlist.h"
|
||||
#include "serialiser/rsbanlistitems.h"
|
||||
#include "rsitems/rsbanlistitems.h"
|
||||
#include "serialiser/rsconfigitems.h"
|
||||
#include "retroshare/rsdht.h"
|
||||
#include "retroshare/rsbanlist.h"
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsbanlistitems.h"
|
||||
#include "rsitems/rsbanlistitems.h"
|
||||
#include "services/p3service.h"
|
||||
#include "retroshare/rsbanlist.h"
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "util/rsnet.h"
|
||||
|
||||
#include "services/p3bwctrl.h"
|
||||
#include "serialiser/rsbwctrlitems.h"
|
||||
#include "rsitems/rsbwctrlitems.h"
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsbwctrlitems.h"
|
||||
#include "rsitems/rsbwctrlitems.h"
|
||||
#include "services/p3service.h"
|
||||
#include "pqi/pqiservicemonitor.h"
|
||||
#include "retroshare/rsconfig.h" // for datatypes.
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "util/rsnet.h"
|
||||
|
||||
#include "services/p3serviceinfo.h"
|
||||
#include "serialiser/rsbanlistitems.h"
|
||||
#include "rsitems/rsbanlistitems.h"
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "retroshare/rsturtle.h"
|
||||
#include "retroshare/rsexpr.h"
|
||||
#include "retroshare/rstypes.h"
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "turtle/turtletypes.h"
|
||||
|
||||
#include "serialization/rsserializer.h"
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <serialiser/rsserviceids.h>
|
||||
#include <rsitems/rsserviceids.h>
|
||||
#include <retroshare/rsplugin.h>
|
||||
#include <retroshare-gui/mainpage.h>
|
||||
#include "services/p3FeedReader.h"
|
||||
|
@ -22,7 +22,7 @@
|
||||
#ifndef RS_FEEDREADER_ITEMS_H
|
||||
#define RS_FEEDREADER_ITEMS_H
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "serialiser/rstlvstring.h"
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
|
||||
/**************************************************************************/
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "rsitems/rsserviceids.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
|
||||
#include "serialiser/rsgxsitems.h"
|
||||
|
Loading…
Reference in New Issue
Block a user