twister-core/src/twister.h

38 lines
1.1 KiB
C
Raw Normal View History

#ifndef TWISTER_H
#define TWISTER_H
#include "util.h"
#include "key.h"
#include <boost/thread.hpp>
#define LIBTORRENT_PORT_OFFSET 1000
#define USERPOST_FLAG_RT 0x01
#define USERPOST_FLAG_DM 0x02
#define BLOCK_AGE_TO_EXPIRE_DHT_ENTRY 2000
class twister
{
public:
twister();
};
void startSessionTorrent(boost::thread_group& threadGroup);
2013-08-02 00:43:04 -03:00
void stopSessionTorrent();
std::string createSignature(std::string const &strMessage, CKeyID &keyID);
2013-08-04 18:26:45 -03:00
std::string createSignature(std::string const &strMessage, std::string const &strUsername);
bool verifySignature(std::string const &strMessage, std::string const &strUsername, std::string const &strSign);
bool acceptSignedPost(char const *data, int data_size, std::string username, int seq, std::string &errmsg, boost::uint32_t *flags);
2013-08-18 21:05:23 -03:00
bool validatePostNumberForUser(std::string const &username, int k);
bool usernameExists(std::string const &username);
2013-08-18 20:33:54 -03:00
2013-10-01 08:57:51 -03:00
void receivedSpamMessage(std::string const &message, std::string const &user);
2013-08-04 16:16:36 -03:00
int getBestHeight();
bool shouldDhtResourceExpire(std::string resource, bool multi, int height);
#endif // TWISTER_H