01: /*
02: * Copyright (c) 2000 by Matt Welsh and The Regents of the University of
03: * California. All rights reserved.
04: *
05: * Permission to use, copy, modify, and distribute this software and its
06: * documentation for any purpose, without fee, and without written agreement is
07: * hereby granted, provided that the above copyright notice and the following
08: * two paragraphs appear in all copies of this software.
09: *
10: * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
11: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
12: * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
13: * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14: *
15: * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
16: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17: * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
18: * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
19: * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
20: *
21: * Author: Matt Welsh <mdw@cs.berkeley.edu>
22: *
23: */
24:
25: package seda.sandStorm.lib.Gnutella;
26:
27: /**
28: * This interface defines various constants used by the Gnutella
29: * protocol.
30: */
31: public interface GnutellaConst {
32: final static int DEFAULT_GNUTELLA_PORT = 6346;
33: final static int DEFAULT_DOWNLOAD_PORT = 8081;
34: final static int DEFAULT_PING_INTERVAL = 5000; // msec
35: final static int DEFAULT_TTL = 5;
36: final static int DEFAULT_HOPS = 0;
37: final static int DEFAULT_SPEED = 1000; // kbits/sec
38:
39: final static int PACKET_HEADER_SIZE = 23;
40: // Set to -1 to accept all packets regardless of payload size
41: final static int MAX_PAYLOAD_SIZE = 1000;
42:
43: final static String GNUTELLA_CONNECT = "GNUTELLA CONNECT/0.4\n\n";
44: final static String GNUTELLA_OK = "GNUTELLA OK\n\n";
45:
46: final static byte GNUTELLA_FN_PING = (byte) 0x00;
47: final static byte GNUTELLA_FN_PONG = (byte) 0x01;
48: final static byte GNUTELLA_FN_PUSH = (byte) 0x40;
49: final static byte GNUTELLA_FN_QUERY = (byte) 0x80;
50: final static byte GNUTELLA_FN_QUERYHITS = (byte) 0x81;
51:
52: //final static int WRITE_CLOG_THRESHOLD = 500;
53: final static int WRITE_CLOG_THRESHOLD = -1;
54:
55: }
|