comparison src/gt_gnutella.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:de72dfdc0726
1 /*
2 * $Id: gt_gnutella.h,v 1.43 2006/08/06 17:26:39 hexwab 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_GNUTELLA_H_
18 #define GIFT_GT_GNUTELLA_H_
19
20 /*****************************************************************************/
21
22 #include "config.h"
23
24 /*****************************************************************************/
25
26 #define GT_VERSION GT_MAJOR_VERSION "." GT_MINOR_VERSION "." \
27 GT_MICRO_VERSION GT_EXTRA_VERSION
28
29 #define GT_DEBUG
30 #define LIBGIFT_DEBUG
31
32 #define GIFT_PLUGIN
33 #include <libgift/libgift.h>
34
35 /* this works because duplicate case labels are disallowed in C */
36 #define assert_at_compile(cond) \
37 do { switch (0) { default: case 0: case cond: break; } } while (0)
38
39 /*****************************************************************************/
40
41 #include <libgift/proto/protocol.h>
42 #include <libgift/proto/share.h>
43 #include <libgift/proto/share_hash.h>
44 #include <libgift/proto/transfer_api.h>
45
46 /*****************************************************************************/
47
48 #include <libgift/event.h>
49 #include <libgift/dataset.h>
50 #include <libgift/file.h>
51
52 #include <libgift/network.h>
53 #include <libgift/fdbuf.h>
54
55 /*****************************************************************************/
56
57 #include "gt_guid.h"
58 #include "gt_conf.h"
59
60 #include <ctype.h>
61
62 /*****************************************************************************/
63 /* global variables */
64
65 extern Protocol *GT;
66
67 extern struct gt_node *GT_SELF;
68
69 extern gt_guid_t *GT_SELF_GUID;
70
71 /*****************************************************************************/
72
73 #define GNUTELLA_LOCAL_MODE gt_config_get_int("local/lan_mode=0")
74 #define GNUTELLA_LOCAL_FW gt_config_get_int("local/firewalled=0")
75 #define GNUTELLA_LOCAL_ALLOW gt_config_get_str("local/hosts_allow=LOCAL")
76
77 /*****************************************************************************/
78
79 BOOL gt_is_local_ip (in_addr_t ip, in_addr_t src);
80
81 /*****************************************************************************/
82
83 /*
84 * libgift doesn't define this...
85 */
86 #ifndef EDAYS
87 #define EDAYS (24 * EHOURS)
88 #endif
89
90 /*
91 * This needs libgift >= 0.11.5
92 */
93 #ifndef GIFT_PLUGIN_EXPORT
94 #define GIFT_PLUGIN_EXPORT
95 #endif
96
97 /*
98 * Invalid input/timer ids used for readability and to help porting to libgift
99 * 0.12.
100 */
101 #define INPUT_NONE ((input_id)0)
102 #define TIMER_NONE ((timer_id)0)
103
104 /*
105 * The entry-point for the giFT daemon
106 */
107 GIFT_PLUGIN_EXPORT
108 BOOL Gnutella_init (Protocol *p);
109
110 /*****************************************************************************/
111
112 #endif /* GIFT_GT_GNUTELLA_H_ */