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;
14 * Possible errors listed in RFC5440, RFC 5455 and stateful draft.
16 * @see <a href="http://tools.ietf.org/html/rfc5440#section-9.12">PCEP-ERROR Object(RFC5440)</a>, <a href=
17 * "http://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-8.4" >PCEP-ERROR Object(stateful draft)</a>,
18 * <a href="http://tools.ietf.org/html/rfc5455#section-3.6">Error Codes for CLASSTYPE Object(RFC5455)</a>, <a href=
19 * "http://www.ietf.org/id/draft-crabbe-pce-pce-initiated-lsp-00.txt#section-7.1" >PCEP-Error Object</a>
21 public enum PCEPErrors {
24 * Reception of an invalid Open message or a non Open message.
26 NON_OR_INVALID_OPEN_MSG(1, 1),
28 * No Open message received before the expiration of the OpenWait timer.
30 NO_OPEN_BEFORE_EXP_OPENWAIT(1, 2),
32 * Unacceptable and non-negotiable session characteristics.
34 NON_ACC_NON_NEG_SESSION_CHAR(1, 3),
36 * Unacceptable but negotiable session characteristics.
38 NON_ACC_NEG_SESSION_CHAR(1, 4),
40 * Reception of a second Open message with still unacceptable session characteristics.
42 SECOND_OPEN_MSG(1, 5),
44 * Reception of a PCErr message proposing unacceptable session characteristics.
46 PCERR_NON_ACC_SESSION_CHAR(1, 6),
48 * No Keepalive or PCErr message received before the expiration of the KeepWait timer.
50 NO_MSG_BEFORE_EXP_KEEPWAIT(1, 7),
52 * Capability not supported.
54 CAPABILITY_NOT_SUPPORTED(2, 0),
56 * PCEP version not supported.
58 PCEP_VERSION_NOT_SUPPORTED(1, 8),
60 * Unrecognized object class.
62 UNRECOGNIZED_OBJ_CLASS(3, 1),
64 * Unrecognized object Type.
66 UNRECOGNIZED_OBJ_TYPE(3, 2),
68 * Not supported object class.
70 NOT_SUPPORTED_OBJ_CLASS(4, 1),
72 * Not supported object Type.
74 NOT_SUPPORTED_OBJ_TYPE(4, 2),
76 * C bit of the METRIC object set (request rejected).
80 * O bit of the RP object cleared (request rejected).
84 * Objective function not allowed (request rejected)
88 * OF bit of the RP object set (request rejected)
92 * Global concurrent optimization not allowed (GCO extension)
94 GCO_NOT_ALLOWED(5, 5),
96 * P2MP Path computation is not allowed
98 P2MP_COMPUTATION_NOT_ALLOWED(5, 7),
104 * RRO missing for a reoptimization request (R bit of the RP object set).
108 * END-POINTS object missing
110 END_POINTS_MISSING(6, 3),
112 * LSP cleanup TLV missing
114 LSP_CLEANUP_TLV_MISSING(6, 13),
116 * SYMBOLIC-PATH-NAME TLV missing
118 SYMBOLIC_PATH_NAME_MISSING(6, 14),
120 * Synchronized path computation request missing.
122 SYNC_PATH_COMP_REQ_MISSING(7, 0),
124 * Unknown request reference
126 UNKNOWN_REQ_REF(8, 0),
128 * Attempt to establish a second PCEP session.
130 ATTEMPT_2ND_SESSION(9, 0),
132 * LSP Object missing.
136 * ERO Object missing for a path in an LSP Update Request where TE-LSP setup is requested.
140 * Srp Object missing for a path in an LSP Update Request where TE-LSP setup is requested.
144 * LSP-IDENTIFIERS TLV missing for a path in an LSP Update Request where TE-LSP setup is requested.
146 LSP_IDENTIFIERS_TLV_MISSING(6, 11),
148 * Reception of an object with P flag not set although the P flag must be set according to this specification.
150 P_FLAG_NOT_SET(10, 1),
152 * Insufficient memory (GCO extension)
154 INSUFFICIENT_MEMORY(15, 1),
156 * Global concurrent optimization not supported (GCO extension)
158 GCO_NOT_SUPPORTED(15, 2),
160 * Diffserv-aware TE error: Unsupported Class-Type.
162 UNSUPPORTED_CT(12, 1),
164 * Diffserv-aware TE error: Invalid Class-Type.
168 * Diffserv-aware TE error: Class-Type and setup priority do not form a configured TE-class.
170 CT_AND_SETUP_PRIORITY_DO_NOT_FORM_TE_CLASS(12, 3),
173 * The PCE cannot satisfy the request due to insufficient memory
175 CANNOT_SATISFY_P2MP_REQUEST_DUE_TO_INSUFFISIENT_MEMMORY(16, 1),
177 * The PCE is not capable of P2MP computation
179 NOT_CAPPABLE_P2MP_COMPUTATION(16, 2),
181 * The PCE is not capable to satisfy the request due to no END-POINTS with leaf type 2
183 P2MP_NOT_CAPPABLE_SATISFY_REQ_DUE_LT2(17, 1),
185 * The PCE is not capable to satisfy the request due to no END-POINTS with leaf type 3
187 P2MP_NOT_CAPPABLE_SATISFY_REQ_DUE_LT3(17, 2),
189 * The PCE is not capable to satisfy the request due to no END-POINTS with leaf type 4
191 P2MP_NOT_CAPPABLE_SATISFY_REQ_DUE_LT4(17, 3),
193 * The PCE is not capable to satisfy the request due to inconsistent END-POINTS
195 P2MP_NOT_CAPPABLE_SATISFY_REQ_DUE_INCONSISTENT_EP(17, 4),
197 * P2MP Fragmented request failure
199 P2MP_FRAGMENTATION_FAILRUE(18, 1),
201 * Attempted LSP Update Request for a non- delegated LSP. The PCEP-ERROR Object is followed by the LSP Object that
202 * identifies the LSP.
204 UPDATE_REQ_FOR_NON_LSP(19, 1),
206 * Attempted LSP Update Request if active stateful PCE capability was not negotiated active PCE.
208 UPDATE_REQ_FOR_NO_STATEFUL(19, 2),
210 * Attempted LSP Update Request for an LSP identified by an unknown PLSP-ID.
212 UNKNOWN_PLSP_ID(19, 3),
214 * A PCE indicates to a PCC that it has exceeded the resource limit allocated for its state, and thus it cannot
215 * accept and process its LSP State Report message.
217 RESOURCE_LIMIT_EXCEEDED(19, 4),
219 * PCE-initiated LSP limit reached
221 LSP_LIMIT_EXCEEDED(19, 6),
223 * Delegation for PCE-initiated LSP cannot be revoked
225 DELEGATION_NON_REVOKABLE(19, 7),
227 * Non-zero PLSP-ID in LSP initiation request
229 NON_ZERO_PLSPID(19, 8),
231 * A PCE indicates to a PCC that it can not process (an otherwise valid) LSP State Report. The PCEP-ERROR Object is
232 * followed by the LSP Object that identifies the LSP.
234 CANNOT_PROCESS_STATE_REPORT(20, 1),
236 * LSP Database version mismatch.
238 LSP_DB_VERSION_MISMATCH(20, 2),
240 * The LSP-DB-VERSION TLV Missing when State Synchronization Avoidance enabled.
242 DB_VERSION_TLV_MISSING_WHEN_SYNC_ALLOWED(20, 3),
244 * A PCC indicates to a PCE that it can not complete the state synchronization,
246 CANNOT_COMPLETE_STATE_SYNC(20, 5),
248 * SYMBOLIC-PATH-NAME in use
250 USED_SYMBOLIC_PATH_NAME(23, 1),
252 * LSP instantiation error: Unacceptable instantiation parameters
254 LSP_UNACC_INST_PARAMS(24, 1),
256 * LSP instantiation error: Internal error
258 LSP_INTERNAL_ERROR(24, 2),
260 * LSP instantiation error: RSVP signaling error
262 LSP_RSVP_ERROR(24, 3),
264 * Segment Routing error: Non-identical ERO subobjects
266 NON_IDENTICAL_ERO_SUBOBJECTS(10, 5),
268 * Segment Routing error: ERO subobject with invalid SID value;
270 BAD_LABEL_VALUE(10, 2),
272 * Invalid traffic engineering path setup type: Unsupported path setup type
274 UNSUPPORTED_PST(21, 1),
276 * Invalid traffic engineering path setup type: Mismatched path setup type
278 MISMATCHED_PST(21, 2),
280 * MONITORING object missing
282 MONITORING_OBJECT_MISSING(6, 4);
284 private PCEPErrorIdentifier errorId;
285 private static final Map<PCEPErrorIdentifier, PCEPErrors> VALUE_MAP;
288 VALUE_MAP = Maps.newHashMap();
289 for (final PCEPErrors enumItem : PCEPErrors.values()) {
290 VALUE_MAP.put(enumItem.getErrorIdentifier(), enumItem);
294 public static PCEPErrors forValue(final short errorType, final short errorValue) {
295 return VALUE_MAP.get(new PCEPErrorIdentifier(errorType, errorValue));
298 private PCEPErrors(final int type, final int value) {
299 this.errorId = new PCEPErrorIdentifier((short) type, (short) value);
302 private PCEPErrorIdentifier getErrorIdentifier() {
306 public short getErrorType() {
307 return this.errorId.getType();
310 public short getErrorValue() {
311 return this.errorId.getValue();