~ubuntu-branches/ubuntu/raring/gift-gnutella/raring

« back to all changes in this revision

Viewing changes to src/message/msg_handler.h

  • Committer: Bazaar Package Importer
  • Author(s): Göran Weinholt
  • Date: 2005-07-31 13:56:53 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050731135653-3i7bcwnrbe7wfd1i
Tags: 0.0.10.1-1
* New upstream version.
  - Fixes FTBFS with gcc-4.0 (closes: #286732).
* Updated debian/patches/update-gwebcaches.patch.
* Updated debian/patches/remove-too-old-check.patch.
* debian/control:
  - Change the encoding of my name to UTF-8.
  - Updated to Standards-Version: 3.6.2 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id: msg_handler.h,v 1.3 2004/01/07 07:24:43 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
 */
 
16
 
 
17
#ifndef GIFT_GT_MSG_HANDLER_H_
 
18
#define GIFT_GT_MSG_HANDLER_H_
 
19
 
 
20
/*****************************************************************************/
 
21
 
 
22
#define MSG_DEBUG             gt_config_get_int("message/debug=0")
 
23
 
 
24
/*****************************************************************************/
 
25
 
 
26
/* Erm, ugly node state encoded in a query-hit */
 
27
typedef enum gt_eqhd_type1
 
28
{
 
29
        EQHD1_EMPTY       = 0x00,  /* no flags set */
 
30
        EQHD1_PUSH_FLAG   = 0x01,  /* send a push request for this result */
 
31
        EQHD1_HAS_BAD     = 0x02,  /* bad flag in qhd[2] is signficant,always 0? */
 
32
        EQHD1_HAS_BUSY    = 0x04,  /* busy ... */
 
33
        EQHD1_HAS_STABLE  = 0x08,  /* stable ... */
 
34
        EQHD1_HAS_SPEED   = 0x10,  /* speed ... */
 
35
        EQHD1_HAS_GGEP    = 0x20,  /* query-hit has GGEP encoded block */
 
36
} gt_eqhd1_t;
 
37
 
 
38
typedef enum gt_eqhd_type2
 
39
{
 
40
        EQHD2_EMPTY       = 0x00,  /* no flags set */
 
41
        EQHD2_HAS_PUSH    = 0x01,  /* set if push flag is significant */
 
42
        EQHD2_BAD_FLAG    = 0x02,  /* always 0? */
 
43
        EQHD2_BUSY_FLAG   = 0x04,  /* set if for no availability */
 
44
        EQHD2_STABLE_FLAG = 0x08,  /* set if transmitted an upload */
 
45
        EQHD2_SPEED_FLAG  = 0x10,  /* if set, speed is max attained upload speed */
 
46
        EQHD2_HAS_GGEP    = 0x20,  /* packet has GGEP */
 
47
} gt_eqhd2_t;
 
48
 
 
49
/*****************************************************************************/
 
50
 
 
51
#include "gt_node.h"
 
52
#include "gt_packet.h"
 
53
 
 
54
#include "message/gt_message.h"
 
55
 
 
56
/*****************************************************************************/
 
57
 
 
58
/*
 
59
 * A message handler function.
 
60
 */
 
61
typedef void (*GtMessageHandler) (GtNode *node, TCPC *c, GtPacket *packet);
 
62
 
 
63
#define MSG_HANDLER_ARG_NAMES \
 
64
        node, c, packet
 
65
 
 
66
#define GT_MSG_HANDLER(func) \
 
67
        void func (GtNode *node, TCPC *c, GtPacket *packet)
 
68
 
 
69
/*****************************************************************************/
 
70
 
 
71
#endif /* GIFT_GT_MSG_HANDLER_H_ */