make dissect_ber_choice take a guint* that will return the
[obnox/wireshark/wip.git] / epan / dissectors / packet-gnutella.h
1 /* packet-gnutella.h
2  * Declarations for gnutella dissection
3  * Copyright 2001, B. Johannessen <bob@havoq.com>
4  *
5  * $Id$
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@ethereal.com>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24  */
25
26 void proto_register_gnutella(void);
27
28 #define GNUTELLA_TCP_PORT       6346
29
30 /*
31  * Used to determine whether a chunk of data looks like a Gnutella packet
32  * or not - it might be a transfer stream, or it might be part of a
33  * Gnutella packet that starts in an earlier missing TCP segment.
34  *
35  * One Gnutella spec says packets SHOULD be no bigger than 4K, although
36  * that's SHOULD, not MUST.
37  */
38 #define GNUTELLA_MAX_SNAP_SIZE  4096
39
40 #define GNUTELLA_UNKNOWN_NAME   "Unknown"
41 #define GNUTELLA_PING           0x00
42 #define GNUTELLA_PING_NAME      "Ping"
43 #define GNUTELLA_PONG           0x01
44 #define GNUTELLA_PONG_NAME      "Pong"
45 #define GNUTELLA_PUSH           0x40
46 #define GNUTELLA_PUSH_NAME      "Push"
47 #define GNUTELLA_QUERY          0x80
48 #define GNUTELLA_QUERY_NAME     "Query"
49 #define GNUTELLA_QUERYHIT       0x81
50 #define GNUTELLA_QUERYHIT_NAME  "QueryHit"
51
52 #define GNUTELLA_HEADER_LENGTH          23
53 #define GNUTELLA_SERVENT_ID_LENGTH      16
54 #define GNUTELLA_PORT_LENGTH            2
55 #define GNUTELLA_IP_LENGTH              4
56 #define GNUTELLA_LONG_LENGTH            4
57 #define GNUTELLA_SHORT_LENGTH           2
58 #define GNUTELLA_BYTE_LENGTH            1
59
60 #define GNUTELLA_PONG_LENGTH            14
61 #define GNUTELLA_PONG_PORT_OFFSET       0
62 #define GNUTELLA_PONG_IP_OFFSET         2
63 #define GNUTELLA_PONG_FILES_OFFSET      6
64 #define GNUTELLA_PONG_KBYTES_OFFSET     10
65
66 #define GNUTELLA_QUERY_SPEED_OFFSET     0
67 #define GNUTELLA_QUERY_SEARCH_OFFSET    2
68
69 #define GNUTELLA_QUERYHIT_HEADER_LENGTH         11
70 #define GNUTELLA_QUERYHIT_COUNT_OFFSET          0
71 #define GNUTELLA_QUERYHIT_PORT_OFFSET           1
72 #define GNUTELLA_QUERYHIT_IP_OFFSET             3
73 #define GNUTELLA_QUERYHIT_SPEED_OFFSET          7
74 #define GNUTELLA_QUERYHIT_FIRST_HIT_OFFSET      11
75 #define GNUTELLA_QUERYHIT_HIT_INDEX_OFFSET      0
76 #define GNUTELLA_QUERYHIT_HIT_SIZE_OFFSET       4
77 #define GNUTELLA_QUERYHIT_END_OF_STRING_LENGTH  2
78
79 #define GNUTELLA_PUSH_SERVENT_ID_OFFSET         0
80 #define GNUTELLA_PUSH_INDEX_OFFSET              16
81 #define GNUTELLA_PUSH_IP_OFFSET                 20
82 #define GNUTELLA_PUSH_PORT_OFFSET               24
83
84 #define GNUTELLA_HEADER_ID_OFFSET               0
85 #define GNUTELLA_HEADER_PAYLOAD_OFFSET          16
86 #define GNUTELLA_HEADER_TTL_OFFSET              17
87 #define GNUTELLA_HEADER_HOPS_OFFSET             18
88 #define GNUTELLA_HEADER_SIZE_OFFSET             19