1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 * 19 */ 20 package org.apache.directory.api.asn1.ber.tlv; 21 22 23 /** 24 * Stores the different states of a PDU parsing. 25 * 26 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 27 */ 28 public enum TLVStateEnum 29 { 30 /** Start means that the deconding hasn't read the first byte */ 31 TAG_STATE_START, 32 33 /** Pending means that the Type Tag is contained in more that one byte */ 34 TAG_STATE_PENDING, 35 36 /** End means that the Type is totally read */ 37 TAG_STATE_END, 38 39 /** 40 * Overflow could have two meaning : either there are more than 5 bytes to 41 * encode the value (5 bytes = 5bits + 4*7 bits = 33 bits) or the value that 42 * is represented by those bytes is over MAX_INTEGER 43 */ 44 TAG_STATE_OVERFLOW, 45 46 /** Start means that the decoding hasn't read the first byte */ 47 LENGTH_STATE_START, 48 49 /** Pending means that the Type length is contained in more that one byte */ 50 LENGTH_STATE_PENDING, 51 52 /** End means that the Length is totally read */ 53 LENGTH_STATE_END, 54 55 /** Start means that the decoding hasn't read the first byte */ 56 VALUE_STATE_START, 57 58 /** Pending means that the Type Value is contained in more that one byte */ 59 VALUE_STATE_PENDING, 60 61 /** End means that the Value is totally read */ 62 VALUE_STATE_END, 63 64 /** The decoding of a TLV is done */ 65 TLV_STATE_DONE, 66 67 /** The decoding of a PDU is done */ 68 PDU_DECODED, 69 70 /** The ending state */ 71 GRAMMAR_END 72 }