view 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
line source
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 */
17 #ifndef GIFT_GT_NETORG_H_
18 #define GIFT_GT_NETORG_H_
20 /*****************************************************************************/
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")
25 /* number of leaf connections we will maintain as ultrapeer */
26 #define GT_LEAF_CONNECTIONS gt_config_get_int("main/leaf_connections=0")
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")
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")
36 /*****************************************************************************/
38 /* return how many connections we need for the given node class */
39 int gt_conn_need_connections (gt_node_class_t klass);
41 /*****************************************************************************/
43 void gt_netorg_init (void);
44 void gt_netorg_cleanup (void);
46 /*****************************************************************************/
48 #endif /* GIFT_GT_NETORG_H_ */