-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathpeerdata.h
60 lines (47 loc) · 1.37 KB
/
peerdata.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* This file is part of the tknet project.
* which be used under the terms of the GNU General Public
* License version 3.0 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included
* in the packaging of this file. Please review the following
* information to ensure the GNU General Public License
* version 3.0 requirements will be met:
* http://www.gnu.org/copyleft/gpl.html
*
* Copyright (C) 2012 Zhong Wei <[email protected]> .
*/
#define MAX_RELAYS_TO_SELECT_SEED 2
struct SeedPeer;
struct PeerData
{
struct NetAddr addr;
struct BridgeProc BdgProc;
struct Treap tpnd;
uint TreeLevel;
char NameID[PEER_NAME_ID_LEN];
uchar NATType;
struct SeedPeer *pSeedPeer;
};
struct SeedPeer
{
struct ListNode ln;
struct PeerData *pPD;
uchar Relays;
};
DECLARATION_STRUCT_CONSTRUCTOR( PeerData )
void
PeerDataInsert(struct PeerData *,struct PeerData *);
struct PeerData*
PeerDataFind(struct PeerData *,char *);
void
PeerDataTrace(struct PeerData *);
void
PeerDataDestroy(struct PeerData *,struct Iterator *);
void
PeerDataSelectAsSeed(struct PeerData* , struct Iterator *);
void
PeerDataDele(struct PeerData *, struct Iterator *);
void
PeerDataUpdateSeedInfo(struct PeerData *,uchar );
struct PeerData *
SeedPeerSelectOne(struct Iterator *);