1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.asn1new.ber.tlv;
18
19 /***
20 * Stores the different states of a PDU parsing.
21 *
22 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
23 */
24 public class TLVStateEnum
25 {
26
27
28 /*** Start means that the deconding hasn't read the first byte */
29 public static final int TAG_STATE_START = 0x00;
30
31 /*** Pending means that the Type Tag is contained in more that one byte */
32 public static final int TAG_STATE_PENDING = 0x01;
33
34 /*** End means that the Type is totally read */
35 public static final int TAG_STATE_END = 0x02;
36
37 /***
38 * Overflow could have two meaning : either there are more than 5 bytes to
39 * encode the value (5 bytes = 5bits + 4*7 bits = 33 bits) or the value that
40 * is represented by those bytes is over MAX_INTEGER
41 */
42 public static final int TAG_STATE_OVERFLOW = 0x04;
43
44 /*** Start means that the decoding hasn't read the first byte */
45 public static final int LENGTH_STATE_START = 0x08;
46
47 /*** Pending means that the Type length is contained in more that one byte */
48 public static final int LENGTH_STATE_PENDING = 0x10;
49
50 /*** End means that the Length is totally read */
51 public static final int LENGTH_STATE_END = 0x20;
52
53 /*** Start means that the decoding hasn't read the first byte */
54 public static final int VALUE_STATE_START = 0x40;
55
56 /*** Pending means that the Type Value is contained in more that one byte */
57 public static final int VALUE_STATE_PENDING = 0x80;
58
59 /*** End means that the Value is totally read */
60 public static final int VALUE_STATE_END = 0x100;
61
62 /*** The decoding of a TLV is done */
63 public static final int TLV_STATE_DONE = 0x200;
64
65 /*** The decoding of a PDU is done */
66 public static final int PDU_DECODED = 0x400;
67 }