diff 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
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/gt_gnutella.h	Sat Feb 20 21:18:28 2010 -0800
     1.3 @@ -0,0 +1,112 @@
     1.4 +/*
     1.5 + * $Id: gt_gnutella.h,v 1.43 2006/08/06 17:26:39 hexwab Exp $
     1.6 + *
     1.7 + * Copyright (C) 2001-2003 giFT project (gift.sourceforge.net)
     1.8 + *
     1.9 + * This program is free software; you can redistribute it and/or modify it
    1.10 + * under the terms of the GNU General Public License as published by the
    1.11 + * Free Software Foundation; either version 2, or (at your option) any
    1.12 + * later version.
    1.13 + *
    1.14 + * This program is distributed in the hope that it will be useful, but
    1.15 + * WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.17 + * General Public License for more details.
    1.18 + */
    1.19 +
    1.20 +#ifndef GIFT_GT_GNUTELLA_H_
    1.21 +#define GIFT_GT_GNUTELLA_H_
    1.22 +
    1.23 +/*****************************************************************************/
    1.24 +
    1.25 +#include "config.h"
    1.26 +
    1.27 +/*****************************************************************************/
    1.28 +
    1.29 +#define GT_VERSION           GT_MAJOR_VERSION "." GT_MINOR_VERSION "." \
    1.30 +                             GT_MICRO_VERSION GT_EXTRA_VERSION
    1.31 +
    1.32 +#define      GT_DEBUG
    1.33 +#define LIBGIFT_DEBUG
    1.34 +
    1.35 +#define GIFT_PLUGIN
    1.36 +#include <libgift/libgift.h>
    1.37 +
    1.38 +/* this works because duplicate case labels are disallowed in C */
    1.39 +#define assert_at_compile(cond) \
    1.40 +        do { switch (0) { default: case 0: case cond: break; } } while (0)
    1.41 +
    1.42 +/*****************************************************************************/
    1.43 +
    1.44 +#include <libgift/proto/protocol.h>
    1.45 +#include <libgift/proto/share.h>
    1.46 +#include <libgift/proto/share_hash.h>
    1.47 +#include <libgift/proto/transfer_api.h>
    1.48 +
    1.49 +/*****************************************************************************/
    1.50 +
    1.51 +#include <libgift/event.h>
    1.52 +#include <libgift/dataset.h>
    1.53 +#include <libgift/file.h>
    1.54 +
    1.55 +#include <libgift/network.h>
    1.56 +#include <libgift/fdbuf.h>
    1.57 +
    1.58 +/*****************************************************************************/
    1.59 +
    1.60 +#include "gt_guid.h"
    1.61 +#include "gt_conf.h"
    1.62 +
    1.63 +#include <ctype.h>
    1.64 +
    1.65 +/*****************************************************************************/
    1.66 +/* global variables */
    1.67 +
    1.68 +extern Protocol        *GT;
    1.69 +
    1.70 +extern struct gt_node  *GT_SELF;
    1.71 +
    1.72 +extern gt_guid_t       *GT_SELF_GUID;
    1.73 +
    1.74 +/*****************************************************************************/
    1.75 +
    1.76 +#define GNUTELLA_LOCAL_MODE     gt_config_get_int("local/lan_mode=0")
    1.77 +#define GNUTELLA_LOCAL_FW       gt_config_get_int("local/firewalled=0")
    1.78 +#define GNUTELLA_LOCAL_ALLOW    gt_config_get_str("local/hosts_allow=LOCAL")
    1.79 +
    1.80 +/*****************************************************************************/
    1.81 +
    1.82 +BOOL gt_is_local_ip (in_addr_t ip, in_addr_t src);
    1.83 +
    1.84 +/*****************************************************************************/
    1.85 +
    1.86 +/*
    1.87 + * libgift doesn't define this...
    1.88 + */
    1.89 +#ifndef EDAYS
    1.90 +#define EDAYS (24 * EHOURS)
    1.91 +#endif
    1.92 +
    1.93 +/*
    1.94 + * This needs libgift >= 0.11.5
    1.95 + */
    1.96 +#ifndef GIFT_PLUGIN_EXPORT
    1.97 +#define GIFT_PLUGIN_EXPORT
    1.98 +#endif
    1.99 +
   1.100 +/*
   1.101 + * Invalid input/timer ids used for readability and to help porting to libgift
   1.102 + * 0.12.
   1.103 + */
   1.104 +#define INPUT_NONE   ((input_id)0)
   1.105 +#define TIMER_NONE   ((timer_id)0)
   1.106 +
   1.107 +/*
   1.108 + * The entry-point for the giFT daemon
   1.109 + */
   1.110 +GIFT_PLUGIN_EXPORT
   1.111 +  BOOL Gnutella_init (Protocol *p);
   1.112 +
   1.113 +/*****************************************************************************/
   1.114 +
   1.115 +#endif /* GIFT_GT_GNUTELLA_H_ */