annotate 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
rev   line source
paulo@0 1 /*
paulo@0 2 * $Id: gt_gnutella.h,v 1.43 2006/08/06 17:26:39 hexwab Exp $
paulo@0 3 *
paulo@0 4 * Copyright (C) 2001-2003 giFT project (gift.sourceforge.net)
paulo@0 5 *
paulo@0 6 * This program is free software; you can redistribute it and/or modify it
paulo@0 7 * under the terms of the GNU General Public License as published by the
paulo@0 8 * Free Software Foundation; either version 2, or (at your option) any
paulo@0 9 * later version.
paulo@0 10 *
paulo@0 11 * This program is distributed in the hope that it will be useful, but
paulo@0 12 * WITHOUT ANY WARRANTY; without even the implied warranty of
paulo@0 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
paulo@0 14 * General Public License for more details.
paulo@0 15 */
paulo@0 16
paulo@0 17 #ifndef GIFT_GT_GNUTELLA_H_
paulo@0 18 #define GIFT_GT_GNUTELLA_H_
paulo@0 19
paulo@0 20 /*****************************************************************************/
paulo@0 21
paulo@0 22 #include "config.h"
paulo@0 23
paulo@0 24 /*****************************************************************************/
paulo@0 25
paulo@0 26 #define GT_VERSION GT_MAJOR_VERSION "." GT_MINOR_VERSION "." \
paulo@0 27 GT_MICRO_VERSION GT_EXTRA_VERSION
paulo@0 28
paulo@0 29 #define GT_DEBUG
paulo@0 30 #define LIBGIFT_DEBUG
paulo@0 31
paulo@0 32 #define GIFT_PLUGIN
paulo@0 33 #include <libgift/libgift.h>
paulo@0 34
paulo@0 35 /* this works because duplicate case labels are disallowed in C */
paulo@0 36 #define assert_at_compile(cond) \
paulo@0 37 do { switch (0) { default: case 0: case cond: break; } } while (0)
paulo@0 38
paulo@0 39 /*****************************************************************************/
paulo@0 40
paulo@0 41 #include <libgift/proto/protocol.h>
paulo@0 42 #include <libgift/proto/share.h>
paulo@0 43 #include <libgift/proto/share_hash.h>
paulo@0 44 #include <libgift/proto/transfer_api.h>
paulo@0 45
paulo@0 46 /*****************************************************************************/
paulo@0 47
paulo@0 48 #include <libgift/event.h>
paulo@0 49 #include <libgift/dataset.h>
paulo@0 50 #include <libgift/file.h>
paulo@0 51
paulo@0 52 #include <libgift/network.h>
paulo@0 53 #include <libgift/fdbuf.h>
paulo@0 54
paulo@0 55 /*****************************************************************************/
paulo@0 56
paulo@0 57 #include "gt_guid.h"
paulo@0 58 #include "gt_conf.h"
paulo@0 59
paulo@0 60 #include <ctype.h>
paulo@0 61
paulo@0 62 /*****************************************************************************/
paulo@0 63 /* global variables */
paulo@0 64
paulo@0 65 extern Protocol *GT;
paulo@0 66
paulo@0 67 extern struct gt_node *GT_SELF;
paulo@0 68
paulo@0 69 extern gt_guid_t *GT_SELF_GUID;
paulo@0 70
paulo@0 71 /*****************************************************************************/
paulo@0 72
paulo@0 73 #define GNUTELLA_LOCAL_MODE gt_config_get_int("local/lan_mode=0")
paulo@0 74 #define GNUTELLA_LOCAL_FW gt_config_get_int("local/firewalled=0")
paulo@0 75 #define GNUTELLA_LOCAL_ALLOW gt_config_get_str("local/hosts_allow=LOCAL")
paulo@0 76
paulo@0 77 /*****************************************************************************/
paulo@0 78
paulo@0 79 BOOL gt_is_local_ip (in_addr_t ip, in_addr_t src);
paulo@0 80
paulo@0 81 /*****************************************************************************/
paulo@0 82
paulo@0 83 /*
paulo@0 84 * libgift doesn't define this...
paulo@0 85 */
paulo@0 86 #ifndef EDAYS
paulo@0 87 #define EDAYS (24 * EHOURS)
paulo@0 88 #endif
paulo@0 89
paulo@0 90 /*
paulo@0 91 * This needs libgift >= 0.11.5
paulo@0 92 */
paulo@0 93 #ifndef GIFT_PLUGIN_EXPORT
paulo@0 94 #define GIFT_PLUGIN_EXPORT
paulo@0 95 #endif
paulo@0 96
paulo@0 97 /*
paulo@0 98 * Invalid input/timer ids used for readability and to help porting to libgift
paulo@0 99 * 0.12.
paulo@0 100 */
paulo@0 101 #define INPUT_NONE ((input_id)0)
paulo@0 102 #define TIMER_NONE ((timer_id)0)
paulo@0 103
paulo@0 104 /*
paulo@0 105 * The entry-point for the giFT daemon
paulo@0 106 */
paulo@0 107 GIFT_PLUGIN_EXPORT
paulo@0 108 BOOL Gnutella_init (Protocol *p);
paulo@0 109
paulo@0 110 /*****************************************************************************/
paulo@0 111
paulo@0 112 #endif /* GIFT_GT_GNUTELLA_H_ */