Set the svn:eol-style property on all text files to "native", so that
[obnox/wireshark/wip.git] / 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 #define GNUTELLA_MAX_SNAP_SIZE  1500
31
32 #define GNUTELLA_UNKNOWN_NAME   "Unknown"
33 #define GNUTELLA_PING           0x00
34 #define GNUTELLA_PING_NAME      "Ping"
35 #define GNUTELLA_PONG           0x01
36 #define GNUTELLA_PONG_NAME      "Pong"
37 #define GNUTELLA_PUSH           0x40
38 #define GNUTELLA_PUSH_NAME      "Push"
39 #define GNUTELLA_QUERY          0x80
40 #define GNUTELLA_QUERY_NAME     "Query"
41 #define GNUTELLA_QUERYHIT       0x81
42 #define GNUTELLA_QUERYHIT_NAME  "QueryHit"
43
44 #define GNUTELLA_HEADER_LENGTH          23
45 #define GNUTELLA_SERVENT_ID_LENGTH      16
46 #define GNUTELLA_PORT_LENGTH            2
47 #define GNUTELLA_IP_LENGTH              4
48 #define GNUTELLA_LONG_LENGTH            4
49 #define GNUTELLA_SHORT_LENGTH           2
50 #define GNUTELLA_BYTE_LENGTH            1
51
52 #define GNUTELLA_PONG_LENGTH            14
53 #define GNUTELLA_PONG_PORT_OFFSET       0
54 #define GNUTELLA_PONG_IP_OFFSET         2
55 #define GNUTELLA_PONG_FILES_OFFSET      6
56 #define GNUTELLA_PONG_KBYTES_OFFSET     10
57
58 #define GNUTELLA_QUERY_SPEED_OFFSET     0
59 #define GNUTELLA_QUERY_SEARCH_OFFSET    2
60
61 #define GNUTELLA_QUERYHIT_HEADER_LENGTH         11
62 #define GNUTELLA_QUERYHIT_COUNT_OFFSET          0
63 #define GNUTELLA_QUERYHIT_PORT_OFFSET           1
64 #define GNUTELLA_QUERYHIT_IP_OFFSET             3
65 #define GNUTELLA_QUERYHIT_SPEED_OFFSET          7
66 #define GNUTELLA_QUERYHIT_FIRST_HIT_OFFSET      11
67 #define GNUTELLA_QUERYHIT_HIT_INDEX_OFFSET      0
68 #define GNUTELLA_QUERYHIT_HIT_SIZE_OFFSET       4
69 #define GNUTELLA_QUERYHIT_END_OF_STRING_LENGTH  2
70
71 #define GNUTELLA_PUSH_SERVENT_ID_OFFSET         0
72 #define GNUTELLA_PUSH_INDEX_OFFSET              16
73 #define GNUTELLA_PUSH_IP_OFFSET                 20
74 #define GNUTELLA_PUSH_PORT_OFFSET               24
75
76 #define GNUTELLA_HEADER_ID_OFFSET               0
77 #define GNUTELLA_HEADER_PAYLOAD_OFFSET          16
78 #define GNUTELLA_HEADER_TTL_OFFSET              17
79 #define GNUTELLA_HEADER_HOPS_OFFSET             18
80 #define GNUTELLA_HEADER_SIZE_OFFSET             19