001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020package org.apache.directory.api.asn1.ber.tlv; 021 022 023/** 024 * Stores the different states of a PDU parsing. 025 * 026 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 027 */ 028public enum TLVStateEnum 029{ 030 /** Start means that the deconding hasn't read the first byte */ 031 TAG_STATE_START, 032 033 /** Pending means that the Type Tag is contained in more that one byte */ 034 TAG_STATE_PENDING, 035 036 /** End means that the Type is totally read */ 037 TAG_STATE_END, 038 039 /** 040 * Overflow could have two meaning : either there are more than 5 bytes to 041 * encode the value (5 bytes = 5bits + 4*7 bits = 33 bits) or the value that 042 * is represented by those bytes is over MAX_INTEGER 043 */ 044 TAG_STATE_OVERFLOW, 045 046 /** Start means that the decoding hasn't read the first byte */ 047 LENGTH_STATE_START, 048 049 /** Pending means that the Type length is contained in more that one byte */ 050 LENGTH_STATE_PENDING, 051 052 /** End means that the Length is totally read */ 053 LENGTH_STATE_END, 054 055 /** Start means that the decoding hasn't read the first byte */ 056 VALUE_STATE_START, 057 058 /** Pending means that the Type Value is contained in more that one byte */ 059 VALUE_STATE_PENDING, 060 061 /** End means that the Value is totally read */ 062 VALUE_STATE_END, 063 064 /** The decoding of a TLV is done */ 065 TLV_STATE_DONE, 066 067 /** The decoding of a PDU is done */ 068 PDU_DECODED, 069 070 /** The ending state */ 071 GRAMMAR_END 072}