mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-17 10:31:05 -04:00
More of the same
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/ammorais_branch@1343 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6b7dba1d98
commit
60602809f2
3 changed files with 106 additions and 107 deletions
|
@ -7,7 +7,6 @@ SOURCES = $$PWP/rsinit.cc \
|
||||||
$$PWP/notifybase.cc \
|
$$PWP/notifybase.cc \
|
||||||
$$PWP/rsifacereal.cc \
|
$$PWP/rsifacereal.cc \
|
||||||
$$PWP/rstypes.cc
|
$$PWP/rstypes.cc
|
||||||
|
|
||||||
HEADERS = $$PWP/rsinit.h \
|
HEADERS = $$PWP/rsinit.h \
|
||||||
$$PWP/rsiface.h \
|
$$PWP/rsiface.h \
|
||||||
$$PWP/rscontrol.h \
|
$$PWP/rscontrol.h \
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
* only prints stuff out at the moment
|
* only prints stuff out at the moment
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "rsiface/rstypes.h"
|
#include "rstypes.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
@ -48,13 +48,13 @@
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, const FileInfo &info)
|
std::ostream &operator<<(std::ostream &out, const FileInfo &info)
|
||||||
{
|
{
|
||||||
out << "FileInfo: path: " << info.path;
|
out << "FileInfo: path: " << info.path;
|
||||||
out << std::endl;
|
out << std::endl;
|
||||||
out << "File: " << info.fname;
|
out << "File: " << info.fname;
|
||||||
out << " Size: " << info.size;
|
out << " Size: " << info.size;
|
||||||
out << std::endl;
|
out << std::endl;
|
||||||
out << "Hash: " << info.hash;
|
out << "Hash: " << info.hash;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,57 +45,57 @@ const uint32_t FT_STATE_COMPLETE = 0x0004;
|
||||||
|
|
||||||
class TransferInfo
|
class TransferInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**** Need Some of these Fields ****/
|
/**** Need Some of these Fields ****/
|
||||||
std::string peerId;
|
std::string peerId;
|
||||||
std::string name; /* if has alternative name? */
|
std::string name; /* if has alternative name? */
|
||||||
double tfRate; /* kbytes */
|
double tfRate; /* kbytes */
|
||||||
int status; /* FT_STATE_... */
|
int status; /* FT_STATE_... */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class FileInfo
|
class FileInfo
|
||||||
{
|
{
|
||||||
/* old BaseInfo Entries */
|
/* old BaseInfo Entries */
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FileInfo() :flags(0), mId(0) { return; }
|
FileInfo() :flags(0), mId(0) { return; }
|
||||||
RsCertId id; /* key for matching everything */
|
RsCertId id; /* key for matching everything */
|
||||||
int flags; /* INFO_TAG above */
|
int flags; /* INFO_TAG above */
|
||||||
|
|
||||||
/* allow this to be tweaked by the GUI Model */
|
/* allow this to be tweaked by the GUI Model */
|
||||||
mutable unsigned int mId; /* (GUI) Model Id -> unique number */
|
mutable unsigned int mId; /* (GUI) Model Id -> unique number */
|
||||||
|
|
||||||
/* Old FileInfo Entries */
|
/* Old FileInfo Entries */
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static const int kRsFiStatusNone = 0;
|
static const int kRsFiStatusNone = 0;
|
||||||
static const int kRsFiStatusStall = 1;
|
static const int kRsFiStatusStall = 1;
|
||||||
static const int kRsFiStatusProgress = 2;
|
static const int kRsFiStatusProgress = 2;
|
||||||
static const int kRsFiStatusDone = 2;
|
static const int kRsFiStatusDone = 2;
|
||||||
|
|
||||||
/* FileInfo(); */
|
/* FileInfo(); */
|
||||||
|
|
||||||
int searchId; /* 0 if none */
|
int searchId; /* 0 if none */
|
||||||
std::string path;
|
std::string path;
|
||||||
std::string fname;
|
std::string fname;
|
||||||
std::string hash;
|
std::string hash;
|
||||||
std::string ext;
|
std::string ext;
|
||||||
|
|
||||||
uint64_t size;
|
uint64_t size;
|
||||||
uint64_t avail; /* how much we have */
|
uint64_t avail; /* how much we have */
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
bool inRecommend;
|
bool inRecommend;
|
||||||
|
|
||||||
double rank;
|
double rank;
|
||||||
int age;
|
int age;
|
||||||
|
|
||||||
/* Transfer Stuff */
|
/* Transfer Stuff */
|
||||||
uint64_t transfered;
|
uint64_t transfered;
|
||||||
double tfRate; /* in kbytes */
|
double tfRate; /* in kbytes */
|
||||||
uint32_t downloadStatus; /* 0 = Err, 1 = Ok, 2 = Done */
|
uint32_t downloadStatus; /* 0 = Err, 1 = Ok, 2 = Done */
|
||||||
std::list<TransferInfo> peers;
|
std::list<TransferInfo> peers;
|
||||||
|
|
||||||
time_t lastTS;
|
time_t lastTS;
|
||||||
};
|
};
|
||||||
|
@ -113,47 +113,47 @@ std::ostream &operator<<(std::ostream &out, const FileInfo &info);
|
||||||
|
|
||||||
class RsConfig
|
class RsConfig
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::string ownId;
|
std::string ownId;
|
||||||
std::string ownName;
|
std::string ownName;
|
||||||
|
|
||||||
std::string localAddr;
|
std::string localAddr;
|
||||||
int localPort;
|
int localPort;
|
||||||
std::string extAddr;
|
std::string extAddr;
|
||||||
int extPort;
|
int extPort;
|
||||||
std::string extName;
|
std::string extName;
|
||||||
|
|
||||||
bool firewalled;
|
bool firewalled;
|
||||||
bool forwardPort;
|
bool forwardPort;
|
||||||
|
|
||||||
int maxDownloadDataRate; /* kb */
|
int maxDownloadDataRate; /* kb */
|
||||||
int maxUploadDataRate; /* kb */
|
int maxUploadDataRate; /* kb */
|
||||||
int maxIndivDataRate; /* kb */
|
int maxIndivDataRate; /* kb */
|
||||||
|
|
||||||
int promptAtBoot; /* popup the password prompt */
|
int promptAtBoot; /* popup the password prompt */
|
||||||
|
|
||||||
/* older data types */
|
/* older data types */
|
||||||
bool DHTActive;
|
bool DHTActive;
|
||||||
bool uPnPActive;
|
bool uPnPActive;
|
||||||
|
|
||||||
int uPnPState;
|
int uPnPState;
|
||||||
int DHTPeers;
|
int DHTPeers;
|
||||||
|
|
||||||
/* Flags for Network Status */
|
/* Flags for Network Status */
|
||||||
bool netOk; /* That we've talked to someone! */
|
bool netOk; /* That we've talked to someone! */
|
||||||
bool netUpnpOk; /* upnp is enabled and active */
|
bool netUpnpOk; /* upnp is enabled and active */
|
||||||
bool netDhtOk; /* response from dht */
|
bool netDhtOk; /* response from dht */
|
||||||
bool netExtOk; /* know our external address */
|
bool netExtOk; /* know our external address */
|
||||||
bool netUdpOk; /* recvd stun / udp packets */
|
bool netUdpOk; /* recvd stun / udp packets */
|
||||||
bool netTcpOk; /* recvd incoming tcp */
|
bool netTcpOk; /* recvd incoming tcp */
|
||||||
bool netResetReq;
|
bool netResetReq;
|
||||||
};
|
};
|
||||||
|
|
||||||
/********************** For Search Interface *****************/
|
/********************** For Search Interface *****************/
|
||||||
|
|
||||||
/* This is still rough, implement later! */
|
/* This is still rough, implement later! */
|
||||||
|
|
||||||
/* text based ones */
|
/* text based ones */
|
||||||
const std::string TypeExt = "ext";
|
const std::string TypeExt = "ext";
|
||||||
const std::string TypeName = "name";
|
const std::string TypeName = "name";
|
||||||
const std::string TypeHash = "hash";
|
const std::string TypeHash = "hash";
|
||||||
|
@ -166,20 +166,20 @@ const int OpGreaterThan = 0x004;
|
||||||
|
|
||||||
class Condition
|
class Condition
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
std::string type;
|
std::string type;
|
||||||
int op;
|
int op;
|
||||||
double value;
|
double value;
|
||||||
std::string name;
|
std::string name;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SearchRequest
|
class SearchRequest
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int searchId;
|
int searchId;
|
||||||
RsCertId toId; /* all zeros for everyone! */
|
RsCertId toId; /* all zeros for everyone! */
|
||||||
std::list<Condition> tests;
|
std::list<Condition> tests;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -206,41 +206,41 @@ class SearchRequest
|
||||||
|
|
||||||
class DirStub
|
class DirStub
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
std::string name;
|
std::string name;
|
||||||
void *ref;
|
void *ref;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DirDetails
|
class DirDetails
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void *parent;
|
void *parent;
|
||||||
uint32_t prow; /* parent row */
|
uint32_t prow; /* parent row */
|
||||||
|
|
||||||
void *ref;
|
void *ref;
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
std::string id;
|
std::string id;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string hash;
|
std::string hash;
|
||||||
std::string path;
|
std::string path;
|
||||||
uint64_t count;
|
uint64_t count;
|
||||||
uint32_t age;
|
uint32_t age;
|
||||||
uint32_t rank;
|
uint32_t rank;
|
||||||
|
|
||||||
std::list<DirStub> children;
|
std::list<DirStub> children;
|
||||||
};
|
};
|
||||||
|
|
||||||
class FileDetail
|
class FileDetail
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::string id;
|
std::string id;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string hash;
|
std::string hash;
|
||||||
std::string path;
|
std::string path;
|
||||||
uint64_t size;
|
uint64_t size;
|
||||||
uint32_t age;
|
uint32_t age;
|
||||||
uint32_t rank;
|
uint32_t rank;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue