mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-06 13:18:06 -05:00
cc5fa5e5dc
* Advertises client as DBxxxx where xxxx is provided by using app. * Added COMPILE switches to enable ANONYMOUS version or remove BD portion. * Fixed version code. * Added slow increase in retry timeout, to reduce DHT traffic over time. now RETRY PERIOD = query age / 2 * initialised bdToken bdVersion etc length. * new bdboot.txt git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3615 b45a01b8-16f6-495d-af2f-9b41ad6348cc
65 lines
1.5 KiB
C++
65 lines
1.5 KiB
C++
#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 <iostream>
|
|
#include <inttypes.h>
|
|
|
|
class bdToken
|
|
{
|
|
public:
|
|
bdToken() :len(0) { return; }
|
|
uint32_t len;
|
|
unsigned char data[BITDHT_TOKEN_MAX_LEN];
|
|
};
|
|
|
|
class bdCompactIds
|
|
{
|
|
public:
|
|
bdCompactIds() :len(0) { return; }
|
|
uint32_t len;
|
|
unsigned char data[BITDHT_TOKEN_MAX_LEN];
|
|
};
|
|
|
|
class bdVersion
|
|
{
|
|
public:
|
|
bdVersion() :len(0) { return; }
|
|
uint32_t len;
|
|
unsigned char data[BITDHT_TOKEN_MAX_LEN];
|
|
};
|
|
|
|
void bdPrintTransId(std::ostream &out, bdToken *transId);
|
|
void bdPrintToken(std::ostream &out, bdToken *transId);
|
|
void bdPrintCompactPeerId(std::ostream &out, std::string cpi);
|
|
|
|
#endif
|
|
|