2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.pcep.spi;
10 import com.google.common.collect.Maps;
17 * Possible errors listed in RFC5440, RFC 5455 and stateful draft.
19 * @see <a href="http://tools.ietf.org/html/rfc5440#section-9.12">PCEP-ERROR Object(RFC5440)</a>, <a href=
20 * "http://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-8.4" >PCEP-ERROR Object(stateful draft)</a>,
21 * <a href="http://tools.ietf.org/html/rfc5455#section-3.6">Error Codes for CLASSTYPE Object(RFC5455)</a>, <a href=
22 * "http://www.ietf.org/id/draft-crabbe-pce-pce-initiated-lsp-00.txt#section-7.1" >PCEP-Error Object</a>
24 public enum PCEPErrors {
27 * Reception of an invalid Open message or a non Open message.
29 NON_OR_INVALID_OPEN_MSG(1, 1),
31 * No Open message received before the expiration of the OpenWait timer.
33 NO_OPEN_BEFORE_EXP_OPENWAIT(1, 2),
35 * Unacceptable and non-negotiable session characteristics.
37 NON_ACC_NON_NEG_SESSION_CHAR(1, 3),
39 * Unacceptable but negotiable session characteristics.
41 NON_ACC_NEG_SESSION_CHAR(1, 4),
43 * Reception of a second Open message with still unacceptable session characteristics.
45 SECOND_OPEN_MSG(1, 5),
47 * Reception of a PCErr message proposing unacceptable session characteristics.
49 PCERR_NON_ACC_SESSION_CHAR(1, 6),
51 * No Keepalive or PCErr message received before the expiration of the KeepWait timer.
53 NO_MSG_BEFORE_EXP_KEEPWAIT(1, 7),
55 * Capability not supported.
57 CAPABILITY_NOT_SUPPORTED(2, 0),
59 * PCEP version not supported.
61 PCEP_VERSION_NOT_SUPPORTED(1, 8),
63 * Unrecognized object class.
65 UNRECOGNIZED_OBJ_CLASS(3, 1),
67 * Unrecognized object Type.
69 UNRECOGNIZED_OBJ_TYPE(3, 2),
71 * Not supported object class.
73 NOT_SUPPORTED_OBJ_CLASS(4, 1),
75 * Not supported object Type.
77 NOT_SUPPORTED_OBJ_TYPE(4, 2),
79 * C bit of the METRIC object set (request rejected).
83 * O bit of the RP object cleared (request rejected).
87 * Objective function not allowed (request rejected)
91 * OF bit of the RP object set (request rejected)
95 * Global concurrent optimization not allowed (GCO extension)
97 GCO_NOT_ALLOWED(5, 5),
99 * P2MP Path computation is not allowed
101 P2MP_COMPUTATION_NOT_ALLOWED(5, 7),
107 * RRO missing for a reoptimization request (R bit of the RP object set).
111 * END-POINTS object missing
113 END_POINTS_MISSING(6, 3),
115 * LSP cleanup TLV missing
117 LSP_CLEANUP_TLV_MISSING(6, 13),
119 * SYMBOLIC-PATH-NAME TLV missing
121 SYMBOLIC_PATH_NAME_MISSING(6, 14),
123 * Synchronized path computation request missing.
125 SYNC_PATH_COMP_REQ_MISSING(7, 0),
127 * Unknown request reference
129 UNKNOWN_REQ_REF(8, 0),
131 * Attempt to establish a second PCEP session.
133 ATTEMPT_2ND_SESSION(9, 0),
135 * LSP Object missing.
139 * ERO Object missing for a path in an LSP Update Request where TE-LSP setup is requested.
143 * Srp Object missing for a path in an LSP Update Request where TE-LSP setup is requested.
147 * LSP-IDENTIFIERS TLV missing for a path in an LSP Update Request where TE-LSP setup is requested.
149 LSP_IDENTIFIERS_TLV_MISSING(6, 11),
151 * Reception of an object with P flag not set although the P flag must be set according to this specification.
153 P_FLAG_NOT_SET(10, 1),
155 * Insufficient memory (GCO extension)
157 INSUFFICIENT_MEMORY(15, 1),
159 * Global concurrent optimization not supported (GCO extension)
161 GCO_NOT_SUPPORTED(15, 2),
163 * Diffserv-aware TE error: Unsupported Class-Type.
165 UNSUPPORTED_CT(12, 1),
167 * Diffserv-aware TE error: Invalid Class-Type.
171 * Diffserv-aware TE error: Class-Type and setup priority do not form a configured TE-class.
173 CT_AND_SETUP_PRIORITY_DO_NOT_FORM_TE_CLASS(12, 3),
176 * The PCE cannot satisfy the request due to insufficient memory
178 CANNOT_SATISFY_P2MP_REQUEST_DUE_TO_INSUFFISIENT_MEMMORY(16, 1),
180 * The PCE is not capable of P2MP computation
182 NOT_CAPPABLE_P2MP_COMPUTATION(16, 2),
184 * The PCE is not capable to satisfy the request due to no END-POINTS with leaf type 2
186 P2MP_NOT_CAPPABLE_SATISFY_REQ_DUE_LT2(17, 1),
188 * The PCE is not capable to satisfy the request due to no END-POINTS with leaf type 3
190 P2MP_NOT_CAPPABLE_SATISFY_REQ_DUE_LT3(17, 2),
192 * The PCE is not capable to satisfy the request due to no END-POINTS with leaf type 4
194 P2MP_NOT_CAPPABLE_SATISFY_REQ_DUE_LT4(17, 3),
196 * The PCE is not capable to satisfy the request due to inconsistent END-POINTS
198 P2MP_NOT_CAPPABLE_SATISFY_REQ_DUE_INCONSISTENT_EP(17, 4),
200 * P2MP Fragmented request failure
202 P2MP_FRAGMENTATION_FAILRUE(18, 1),
204 * Attempted LSP Update Request for a non- delegated LSP. The PCEP-ERROR Object is followed by the LSP Object that
205 * identifies the LSP.
207 UPDATE_REQ_FOR_NON_LSP(19, 1),
209 * Attempted LSP Update Request if active stateful PCE capability was not negotiated active PCE.
211 UPDATE_REQ_FOR_NO_STATEFUL(19, 2),
213 * Attempted LSP Update Request for an LSP identified by an unknown PLSP-ID.
215 UNKNOWN_PLSP_ID(19, 3),
217 * A PCE indicates to a PCC that it has exceeded the resource limit allocated for its state, and thus it cannot
218 * accept and process its LSP State Report message.
220 RESOURCE_LIMIT_EXCEEDED(19, 4),
222 * PCE-initiated LSP limit reached
224 LSP_LIMIT_EXCEEDED(19, 6),
226 * Delegation for PCE-initiated LSP cannot be revoked
228 DELEGATION_NON_REVOKABLE(19, 7),
230 * Non-zero PLSP-ID in LSP initiation request
232 NON_ZERO_PLSPID(19, 8),
234 * A PCE indicates to a PCC that it can not process (an otherwise valid) LSP State Report. The PCEP-ERROR Object is
235 * followed by the LSP Object that identifies the LSP.
237 CANNOT_PROCESS_STATE_REPORT(20, 1),
239 * LSP Database version mismatch.
241 LSP_DB_VERSION_MISMATCH(20, 2),
243 * The LSP-DB-VERSION TLV Missing when State Synchronization Avoidance enabled.
245 DB_VERSION_TLV_MISSING_WHEN_SYNC_ALLOWED(20, 3),
247 * A PCC indicates to a PCE that it can not complete the state synchronization,
249 CANNOT_COMPLETE_STATE_SYNC(20, 5),
251 * SYMBOLIC-PATH-NAME in use
253 USED_SYMBOLIC_PATH_NAME(23, 1),
255 * LSP instantiation error: Unacceptable instantiation parameters
257 LSP_UNACC_INST_PARAMS(24, 1),
259 * LSP instantiation error: Internal error
261 LSP_INTERNAL_ERROR(24, 2),
263 * LSP instantiation error: RSVP signaling error
265 LSP_RSVP_ERROR(24, 3),
267 * Segment Routing error: Non-identical ERO subobjects
269 NON_IDENTICAL_ERO_SUBOBJECTS(10, 5),
271 * Segment Routing error: ERO subobject with invalid SID value;
273 BAD_LABEL_VALUE(10, 2);
275 private PCEPErrorIdentifier errorId;
276 private static final Map<PCEPErrorIdentifier, PCEPErrors> VALUE_MAP;
279 VALUE_MAP = Maps.newHashMap();
280 for (final PCEPErrors enumItem : PCEPErrors.values()) {
281 VALUE_MAP.put(enumItem.getErrorIdentifier(), enumItem);
285 public static PCEPErrors forValue(final short errorType, final short errorValue) {
286 return VALUE_MAP.get(new PCEPErrorIdentifier(errorType, errorValue));
289 private PCEPErrors(final int type, final int value) {
290 this.errorId = new PCEPErrorIdentifier((short) type, (short) value);
293 private PCEPErrorIdentifier getErrorIdentifier() {
297 public short getErrorType() {
298 return this.errorId.getType();
301 public short getErrorValue() {
302 return this.errorId.getValue();
306 * Caret for combination of Error-type and Error-value
308 static class PCEPErrorIdentifier {
309 private final short type;
310 private final short value;
312 PCEPErrorIdentifier(final short type, final short value) {
317 public short getType() {
321 public short getValue() {
326 public int hashCode() {
327 final int prime = 31;
329 result = prime * result + this.type;
330 result = prime * result + this.value;
335 public boolean equals(final java.lang.Object obj) {
342 if (this.getClass() != obj.getClass()) {
345 final PCEPErrorIdentifier other = (PCEPErrorIdentifier) obj;
346 if (this.type != other.type) {
349 if (this.value != other.value) {
356 public String toString() {
357 return "type " + this.type + " value " + this.value;