+ BAD_LABEL_VALUE(10, 2),
+ /**
+ * Segment Routing error: Unsupported number of Segment ERO subobjects.
+ */
+ UNSUPPORTED_NUMBER_OF_SR_ERO_SUBOBJECTS(10, 3),
+ /**
+ * Segment Routing error: Bad label format.
+ */
+ BAD_LABEL_FORMAT(10, 4),
+ /**
+ * Segment Routing error: Non-identical ERO subobjects.
+ */
+ NON_IDENTICAL_ERO_SUBOBJECTS(10, 5),
+ /**
+ * Segment Routing error: Both SID and NAI are absent in ERO subobject.
+ */
+ SID_AND_NAI_ABSENT_IN_ERO(10, 6),
+ /**
+ * Segment Routing error: Both SID and NAI are absent in RRO subobject.
+ */
+ SID_AND_NAI_ABSENT_IN_RRO(10, 7),
+ /**
+ * Segment Routing error: Non-identical RRO subobjects.
+ */
+ SID_NON_IDENTICAL_RRO_SUBOBJECTS(10, 8),
+ /**
+ * Invalid traffic engineering path setup type: Unsupported path setup type.
+ */
+ UNSUPPORTED_PST(21, 1),
+ /**
+ * Invalid traffic engineering path setup type: Mismatched path setup type.
+ */
+ MISMATCHED_PST(21, 2),
+ /**
+ * MONITORING object missing.
+ */
+ MONITORING_OBJECT_MISSING(6, 4),
+ /**
+ * Reception of StartTLS after any PCEP exchange.
+ */
+ // FIXME: error code to be assigned by IANA
+ STARTTLS_RCVD_INCORRECTLY(30, 1),
+ /**
+ * Reception of non-StartTLS or non-PCErr message.
+ */
+ // FIXME: error code to be assigned by IANA
+ NON_STARTTLS_MSG_RCVD(30, 2),
+ /**
+ * Failure, connection without TLS not possible.
+ */
+ // FIXME: error code to be assigned by IANA
+ NOT_POSSIBLE_WITHOUT_TLS(30, 3),
+ /**
+ * Failure, connection without TLS possible.
+ */
+ // FIXME: error code to be assigned by IANA
+ POSSIBLE_WITHOUT_TLS(30, 4),
+ /**
+ * No StartTLS message before StartTLSWait timer expired.
+ */
+ // FIXME: error code to be assigned by IANA
+ STARTTLS_TIMER_EXP(30, 5),
+ /**
+ * LSP is not PCE-initiated.
+ */
+ LSP_NOT_PCE_INITIATED(19, 9),
+ /**
+ * LSP-DB-VERSION TLV missing.
+ */
+ LSP_DB_VERSION_MISSING(6, 12),
+ /**
+ * Attempt to trigger a synchronization when the PCE triggered synchronization capability has not been advertised.
+ */
+ UNEXPECTED_SYNCHRONIZATION_ATTEMPT(20, 4),
+ /**
+ * No sufficient LSP change information for incremental LSP state synchronization.
+ */
+ NO_SUFFICIENT_LSP_CHANGE(20, 6),
+ /**
+ * Received an invalid LSP DB Version Number.
+ */
+ INVALID_LSP_DB_VERSION(20, 7);
+
+ private static final ImmutableMap<PCEPErrorIdentifier, PCEPErrors> VALUE_MAP = Maps.uniqueIndex(
+ Arrays.asList(values()), PCEPErrors::getErrorIdentifier);
+
+ private PCEPErrorIdentifier errorId;
+
+ public static PCEPErrors forValue(final Uint8 errorType, final Uint8 errorValue) {
+ return VALUE_MAP.get(new PCEPErrorIdentifier(errorType, errorValue));
+ }
+
+ PCEPErrors(final int type, final int value) {
+ this.errorId = new PCEPErrorIdentifier(Uint8.valueOf(type), Uint8.valueOf(value));
+ }
+
+ private PCEPErrorIdentifier getErrorIdentifier() {
+ return errorId;
+ }
+
+ public Uint8 getErrorType() {
+ return errorId.getType();
+ }
+
+ public Uint8 getErrorValue() {
+ return errorId.getValue();
+ }