comparison src/gt_netorg.h @ 0:d39e1d0d75b6

initial add
author paulo@hit-nxdomain.opendns.com
date Sat, 20 Feb 2010 21:18:28 -0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d4b079339e47
1 /*
2 * $Id: gt_netorg.h,v 1.16 2004/01/04 06:01:20 hipnod Exp $
3 *
4 * Copyright (C) 2001-2003 giFT project (gift.sourceforge.net)
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 */
16
17 #ifndef GIFT_GT_NETORG_H_
18 #define GIFT_GT_NETORG_H_
19
20 /*****************************************************************************/
21
22 /* number of ultrapeers we try to maintain connections to if we are a leaf */
23 #define GT_SHIELDED_CONNECTIONS gt_config_get_int("main/connections=3")
24
25 /* number of leaf connections we will maintain as ultrapeer */
26 #define GT_LEAF_CONNECTIONS gt_config_get_int("main/leaf_connections=0")
27
28 /* number of ultrapeer<->ultrapeer connections we maintain if we're one */
29 #define GT_PEER_CONNECTIONS gt_config_get_int("main/peer_connections=3")
30
31 /* timeouts for connecting to nodes at different stages */
32 #define TIMEOUT_1 gt_config_get_int("handshake/timeout1=20")
33 #define TIMEOUT_2 gt_config_get_int("handshake/timeout2=40")
34 #define TIMEOUT_3 gt_config_get_int("handshake/timeout3=60")
35
36 /*****************************************************************************/
37
38 /* return how many connections we need for the given node class */
39 int gt_conn_need_connections (gt_node_class_t klass);
40
41 /*****************************************************************************/
42
43 void gt_netorg_init (void);
44 void gt_netorg_cleanup (void);
45
46 /*****************************************************************************/
47
48 #endif /* GIFT_GT_NETORG_H_ */