paulo@0: /* paulo@0: * $Id: gt_gnutella.h,v 1.43 2006/08/06 17:26:39 hexwab Exp $ paulo@0: * paulo@0: * Copyright (C) 2001-2003 giFT project (gift.sourceforge.net) paulo@0: * paulo@0: * This program is free software; you can redistribute it and/or modify it paulo@0: * under the terms of the GNU General Public License as published by the paulo@0: * Free Software Foundation; either version 2, or (at your option) any paulo@0: * later version. paulo@0: * paulo@0: * This program is distributed in the hope that it will be useful, but paulo@0: * WITHOUT ANY WARRANTY; without even the implied warranty of paulo@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU paulo@0: * General Public License for more details. paulo@0: */ paulo@0: paulo@0: #ifndef GIFT_GT_GNUTELLA_H_ paulo@0: #define GIFT_GT_GNUTELLA_H_ paulo@0: paulo@0: /*****************************************************************************/ paulo@0: paulo@0: #include "config.h" paulo@0: paulo@0: /*****************************************************************************/ paulo@0: paulo@0: #define GT_VERSION GT_MAJOR_VERSION "." GT_MINOR_VERSION "." \ paulo@0: GT_MICRO_VERSION GT_EXTRA_VERSION paulo@0: paulo@0: #define GT_DEBUG paulo@0: #define LIBGIFT_DEBUG paulo@0: paulo@0: #define GIFT_PLUGIN paulo@0: #include paulo@0: paulo@0: /* this works because duplicate case labels are disallowed in C */ paulo@0: #define assert_at_compile(cond) \ paulo@0: do { switch (0) { default: case 0: case cond: break; } } while (0) paulo@0: paulo@0: /*****************************************************************************/ paulo@0: paulo@0: #include paulo@0: #include paulo@0: #include paulo@0: #include paulo@0: paulo@0: /*****************************************************************************/ paulo@0: paulo@0: #include paulo@0: #include paulo@0: #include paulo@0: paulo@0: #include paulo@0: #include paulo@0: paulo@0: /*****************************************************************************/ paulo@0: paulo@0: #include "gt_guid.h" paulo@0: #include "gt_conf.h" paulo@0: paulo@0: #include paulo@0: paulo@0: /*****************************************************************************/ paulo@0: /* global variables */ paulo@0: paulo@0: extern Protocol *GT; paulo@0: paulo@0: extern struct gt_node *GT_SELF; paulo@0: paulo@0: extern gt_guid_t *GT_SELF_GUID; paulo@0: paulo@0: /*****************************************************************************/ paulo@0: paulo@0: #define GNUTELLA_LOCAL_MODE gt_config_get_int("local/lan_mode=0") paulo@0: #define GNUTELLA_LOCAL_FW gt_config_get_int("local/firewalled=0") paulo@0: #define GNUTELLA_LOCAL_ALLOW gt_config_get_str("local/hosts_allow=LOCAL") paulo@0: paulo@0: /*****************************************************************************/ paulo@0: paulo@0: BOOL gt_is_local_ip (in_addr_t ip, in_addr_t src); paulo@0: paulo@0: /*****************************************************************************/ paulo@0: paulo@0: /* paulo@0: * libgift doesn't define this... paulo@0: */ paulo@0: #ifndef EDAYS paulo@0: #define EDAYS (24 * EHOURS) paulo@0: #endif paulo@0: paulo@0: /* paulo@0: * This needs libgift >= 0.11.5 paulo@0: */ paulo@0: #ifndef GIFT_PLUGIN_EXPORT paulo@0: #define GIFT_PLUGIN_EXPORT paulo@0: #endif paulo@0: paulo@0: /* paulo@0: * Invalid input/timer ids used for readability and to help porting to libgift paulo@0: * 0.12. paulo@0: */ paulo@0: #define INPUT_NONE ((input_id)0) paulo@0: #define TIMER_NONE ((timer_id)0) paulo@0: paulo@0: /* paulo@0: * The entry-point for the giFT daemon paulo@0: */ paulo@0: GIFT_PLUGIN_EXPORT paulo@0: BOOL Gnutella_init (Protocol *p); paulo@0: paulo@0: /*****************************************************************************/ paulo@0: paulo@0: #endif /* GIFT_GT_GNUTELLA_H_ */