Subversion Repositories programming

Rev

Rev 214 | Rev 216 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 214 Rev 215
Line 17... Line 17...
17
    private byte packetNumber;
17
    private byte packetNumber;
18
    private byte packetDataSize;
18
    private byte packetDataSize;
19
    private byte[] packetData;
19
    private byte[] packetData;
20
    private static byte lastPacketNum = -1;
20
    private static byte lastPacketNum = -1;
21
 
21
 
-
 
22
    // Fake an enum
-
 
23
    public static final byte DROP = 0;
-
 
24
    public static final byte TRANSREQ = 1;
-
 
25
    public static final byte TRANSREPL = 2;
-
 
26
    public static final byte QUIT = 3;
-
 
27
    public static final byte BADPACKET = 4;
-
 
28
 
22
    /**
29
    /**
23
     * Packet Format:
30
     * Packet Format:
24
     * 1 byte: packetBegin
31
     * 1 byte: packetBegin
25
     * 1 byte: packetType
32
     * 1 byte: packetType
26
     * 1 byte: packetNumber
33
     * 1 byte: packetNumber
Line 28... Line 35...
28
     * packetDataSize bytes: data
35
     * packetDataSize bytes: data
29
     * 1 byte: packetEnd
36
     * 1 byte: packetEnd
30
     */
37
     */
31
 
38
 
32
    /**
39
    /**
33
     * Packet Types:
-
 
34
     * 0: DROP packet, data contains a single byte telling how often to drop
-
 
35
     * 1: TRANSLATE packet, data contains 4 bytes to translate to 5B encoding
-
 
36
     * 2: REPLY packet, data contains 5 bytes of 5B encoded data
-
 
37
     * 3: QUIT packet, data contains 0 bytes of data
-
 
38
     */
-
 
39
 
-
 
40
    /**
-
 
41
     * Method: P2_Packet constructor
40
     * Method: P2_Packet constructor
42
     * Purpose: Construct a P2_Packet given the type and data
41
     * Purpose: Construct a P2_Packet given the type and data
43
     */
42
     */
44
    public P2_Packet (byte type, byte[] data)
43
    public P2_Packet (byte type, byte[] data)
45
    {
44
    {